var newPage;
var browserName;
var lastItem;

function checkBrowser()
	{
	browserName = navigator.appName;
	window.defaultStatus = "Helen Lush - Artist";
	
	if (document.body.clientWidth) 
		{
		var mxWidth = document.body.clientWidth;
		}
	if (window.innerWidth) 
		{
		var mxWidth = window.innerWidth;
		}
	
	if (browserName=="Opera")
		{
		var topBanner =  document.getElementById("top_banner");
		topBanner.style.width = mxWidth-20;
		main_body.style.width=mxWidth-20;
		}
	return true;
	}
	
	
function openPage(pictureName, picWidth, picHeight, title)
		{

		if (newPage != null) newPage.close();
		
		var mxWidth, leftPos;
		var borderWidth = 20;
		
		pageWidth = picWidth + (borderWidth * 2);
		pageHeight = picHeight + (borderWidth* 2);
				
		if (document.body.clientWidth) {
			mxWidth = document.body.clientWidth;
		}
		if (window.innerWidth) {
			mxWidth = window.innerWidth;
		}

		leftPos = (mxWidth - picWidth) / 2;
		title += " by Helen Lush";
		var settings = "width=" + pageWidth + ",height=" + pageHeight + ",location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,left="+leftPos+",top=40";
		newPage = window.open ("","_blank", settings);
		
		newPage.document.open();
		newPage.document.write("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'>");
		newPage.document.write("<html xmlns='http://www.w3.org/1999/xhtml'>");
		newPage.document.write("	<head>");
		newPage.document.write("		<title>" + title + "</title>");
		newPage.document.write("		<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />");
		newPage.document.write("		<link rel='stylesheet' href='stylesheets/lushart.css' />");
		newPage.document.write("	</head>");
		newPage.document.write("	<body>");
		newPage.document.write("		<table width='100%' border='0' cellpadding='0' cellspacing='0'>");
		newPage.document.write("			<tr>");
		newPage.document.write("				<td class='centercenteralign'>");
		newPage.document.write("					<img height='"+picHeight+"' width='"+picWidth+"' hspace='20' vspace='20' src='"+"images/large/" + pictureName+"' border='0' alt='"+title+"' title='"+title+"' />");
		newPage.document.write("				</td>");
		newPage.document.write("			</tr>");
		newPage.document.write("		</table>");
		newPage.document.write("	</body>");
		newPage.document.write("</html>");
		newPage.document.close();
	
		}
	
	function highlightOn(item, statusText)
		{
		var oItemAnchor = document.getElementById(item+"_anchor");
		var oItemMenu = document.getElementById(item+"_menu");

		oItemAnchor.className="navwhite";

		if (browserName == "Netscape"|browserName == "Opera"|browserName == "Mozilla")
			{
			oItemMenu.className = "centeraligngray";
			}
		else
			{
			oItemMenu.background = "images/misc/blob_plain.jpg";
			}
		
		window.status = "Go to '" + statusText + "'";
		lastItem = item;
		return true;

		}
	
	function highlightClick(item)
		{
		var oItemAnchor = document.getElementById(item+"_anchor");
		oItemAnchor.click();
		return true;
		}
		
	function highlightOff()
		{
		var oItemMenu = document.getElementById(lastItem + "_menu");
		var oItemAnchor = document.getElementById(lastItem+"_anchor");
		oItemAnchor.className="nav";
		oItemMenu.background= "";
		oItemMenu.className = "centeralign";
		window.status = "";
		return true;
		}

	function setStatus(txt)
		{
		window.status="Go to pictures of " + txt;
		return true;
		}
		
	function resetStatus()
		{
		window.status="";
		return true;
		}