//
// Browser Detection
//
agt = navigator.userAgent.toLowerCase();
isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
NS4 = (document.layers) ? true : false;
IEmac = ((document.all)&&(isMac)) ? true : false;
IE4plus = (document.all) ? true : false;
IE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true : false;
IE5 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1)) ? true : false;
IE6 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 6.")!=-1)) ? true : false;
ver4 = (NS4 || IE4plus) ? true : false;
NS6 = (!document.layers) && (navigator.userAgent.indexOf('Netscape')!=-1)?true:false;
gecko = (agt.indexOf("gecko") != -1);

IE5plus = IE5 || IE6;
IEMajor = 0;

if (IE4plus)
{
	var start = navigator.appVersion.indexOf("MSIE");
	var end = navigator.appVersion.indexOf(".",start);
	IEMajor = parseInt(navigator.appVersion.substring(start+5,end));
	IE5plus = (IEMajor>=5) ? true : false;
}


function WriteEdgeHTML(name, target)
{
	document.write(EdgeHTML(name, target));
}

function WriteHomeEdgeHTML(name)
{
	var target = getCookie("home");
	if (target == "") target = "index.php";
	document.write(EdgeHTML(name, target));
}

function EdgeHTML(name, target)
{
	var ret = "<A class=\"darkblue\" href=\"" + target + "\">" + name + "</A>";
	if (IE5plus || gecko)
		ret = "<input type=\"button\" class=\"smallbutton\" value=\"" + name + "\" onclick=\"window.location='" + target + "'\" onmouseover=\"this.style.backgroundColor='white';this.style.color='black'\" onmouseout=\"this.style.backgroundColor='blue';this.style.color='white'\"/>";
	return ret;
}

function PhotoHeader(title)
{
	document.write("<table width=100% cellspacing=\"0\" cellpadding=\"3\" border=\"0\">");
	document.write("<!-- Header Bar -->");
	document.write("<tr><td colspan=\"2\" class=\"spacebar\"></td></tr>");
	document.write("<tr>");
	document.write("<td class=\"scripttitlewide\">" + title + "</td>");
	document.write("<td class=\"toolbaritemright\">" + EdgeHTML("Galleries", "photos.html") + "</td>");
	document.write("</tr>");
	document.write("<tr><td colspan=\"2\" class=\"spacebar\"></td></tr>");
	document.write("<!-- Content -->");
	document.write("<tr><td colspan=\"2\" align=\"center\">");

}

function PhotoFooter()
{
	document.write("</td></tr>");
	document.write("<!-- Footer Bar -->");
	document.write("<tr><td colspan=\"2\" class=\"spacebar\"></td></tr>");
	document.write("<tr>");
	document.write("<td class=\"toolbaritemleft\">" + EdgeHTML("Send e-mail", "email.html") + "</td>");
	document.write("<td class=\"toolbaritemright\">" + EdgeHTML("Bookmarks", "bookmarks.html") + "</td>");
	document.write("</tr>");
	document.write("<tr><td colspan=\"2\" class=\"spacebar\"></td></tr>");
	document.write("</table>");
}

// Over ridden by JavaScript 1.2 versions in cookie.js
function getCookie(name) {return true;}
function setCookie(name, value) {return true;}
