var isNN4, isNN7, isIE;
var coll = "";
var styleObj = "";
var hidden, visible;
var IEversion = true;

visible = 'visible';
hidden = 'hidden';

if (parseInt(navigator.appVersion) >= 4) {
	if (navigator.appName == "Netscape") {
		if (parseInt(navigator.appVersion) == 4) {
			isNN4 = true;
			visible = 'show';
			hidden = 'hide';
		} else {
			isNN7 = true;
		}
	} else {
		isIE = true;
		coll = "all.";
		styleObj = ".style";
	}
}

function writeOut(div, content) {
	var cObj = document.getElementById(div);
	if (isIE || isNN7) {
		cObj.style.visibility = visible;
		cObj.innerHTML = content;
	} else {
		cObj.visibility = visible;
		var cDoc = document.layers[div].document;
		cDoc.open();
		cDoc.writeln(content);
		cDoc.close();
	}
}

function loadPage(page)
{
	setDivContents(page,'ceditor','diffordsguide');
	if(page != "../main/cocktail.jsp")
	{
		dojo.addClass(dojo.byId('term'), 'invisible');
	}else{
		dojo.removeClass(dojo.byId('term'), 'invisible');
		dojo.addClass(dojo.byId('term'), 'visible');
	}
}

function writeMenu() {
	var html = "<table cellpadding=0 cellspacing=0 border=0 width=\"950px\"><tr>";
	html += "<td class=\"m_cocktails\"><a href=\"#\" onclick=\"loadPage('../main/cocktail.jsp')\"><img src=\"../images/web/menu.gif\" alt=\"Cocktails\" border=0></a></td>";
	html += "<td><img src=\"../images/web/menu.gif\" width=2 height=20 border=0></td>";	
	html += "<td class=\"m_books\"><a href=\"#\" onclick=\"loadPage('../main/books.jsp')\"><img src=\"../images/web/menu.gif\" alt=\"Our books\" border=0></a></td>";
	html += "<td><img src=\"../images/web/menu.gif\" width=2 height=20 border=0></td>";	
	html += "<td class=\"m_pubs\"><a href=\"#\" onclick=\"loadPage('../main/pubs.jsp')\"><img src=\"../images/web/menu.gif\" alt=\"Pubs and Bars\" border=0></a></td>";
	html += "<td><img src=\"../images/web/menu.gif\" width=2 height=20 border=0></td>";
	html += "<td class=\"m_spirits\"><a href=\"#\" onclick=\"loadPage('../main/spirit.jsp')\"><img src=\"../images/web/menu.gif\" alt=\"Spirits and Liqueurs\" border=0></a></td>";
	html += "<td><img src=\"../images/web/menu.gif\" width=2 height=20 border=0></td>";
	html += "<td class=\"m_class\"><a href=\"http://www.classbar.com/\" ><img src=\"../images/web/menu.gif\" alt=\"Class magazine\" border=0></a></td>";
	html += "<td><img src=\"../images/web/menu.gif\" width=2 height=20 border=0></td>";
	html += "<td class=\"m_about\"><a href=\"#\" onclick=\"loadPage('../main/about.jsp')\"><img src=\"../images/web/menu.gif\" alt=\"About us\" border=0></a></td>";
	html += "<td><img src=\"../images/web/menu.gif\" width=2 height=20 border=0></td>";
	html += "<td class=\"m_contact\"><a href=\"#\" onclick=\"loadPage('../main/contactUs.jsp')\"><img src=\"../images/web/menu.gif\" alt=\"Contact us\" border=0></a></td>";
	html += "<td><img src=\"../images/web/menu.gif\" width=2 height=20 border=0></td>";
	html += "<td class=\"m_links\"><a href=\"#\" onclick=\"loadPage('../main/links.jsp')\"><img src=\"../images/web/menu.gif\" alt=\"Links\" border=0></a></td>";
	html += "</tr></table>";
	writeOut("menu", html);		
	resetSearchForm();
}


function resetSearchForm()
{	
	document.frmSearch.filterLetter.value ='';	
}



