// global browser stuff
var is = new Is();
if(is.ns4) {
        doc = "document";
        sty = "";
        htm = ".document"
} else if(is.ie4) {
        doc = "document.all";
        sty = ".style";
        htm = ""
}
objDoc = eval(doc);

// init routine
function init() {
//	displayMenu();
}

function displayMenu() {
	objDoc.menu.innerHTML = 
		"<a href='index.htm'>Home</a><br>" +
		"<a href='accomodation.htm'>Accommodation</a><br>" +
		"<a href='prices.htm'>Prices</a><br>" + 
		"<a href='contact.htm'>Contact Us</a><br>" +
		"<a href='directions.htm'>Directions</a><br>";
}

// open Window
function openWindow() {
	window.open("index.htm", "", "width=800, height=600, status=yes, toolbar=yes, scrollbars, resizable=yes",true)
}

// opens a window to display an image
// at present - the window size is fixed
function winImage(title, src) {
	var str = "<html><head>";
	str += "<meta http-equiv='Content-Language' content='en-gb'>";
	str += "<meta http-equiv='Content-Type' content='text/html; charset=windows-1252'>";
	str += "<title>The Dairy B&B - " + title + "</title>";
	str += "<link rel=stylesheet href='style.css' title='windows'>";
	str += "</head><body id='main' topmargin='0' leftmargin='0' marginheight='0' marginwidth='0'>";
	str += "<img src='" + src + "' width='300' height='225'><br><br>";
	str += "<div align='center' class='body'><a href='javascript:window.close();'>Close</a></div>";
	str += "</body></html>";
	
	var win = window.open("" , "ImageViewer", "status='no', toolbar='no', width=300, height=280, noresize");
	var doc = win.document;
	win.focus();
	doc.open();
	doc.write(str);
        doc.close();
}
	
// broswer sniffer routine
function Is() {
	var agent = navigator.userAgent.toLowerCase();
	this.major = parseInt(navigator.appVersion);
	this.minor = parseFloat(navigator.appVersion);
	this.ns = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
	this.ns2 = (this.ns && (this.major == 3));
	this.ns3 = (this.ns && (this.major == 3));
	this.ns4b = (this.ns && (this.minor < 4.04));
	this.ns4 = (this.ns && (this.major >= 4));
	this.ie = (agent.indexOf("msie") != -1);
	this.ie3 = (this.ie && (this.major == 2));
	this.ie4 = (this.ie && (this.major >= 4));
	this.op3 = (agent.indexOf("opera") != -1);
	this.win = (agent.indexOf("win")!=-1);
	this.mac = (agent.indexOf("mac")!=-1);
	this.unix = (agent.indexOf("x11")!=-1);
}
