document.onclick=noFocus
var visValTrue, visValFalse, left_center, showFlag, x, witch, over

function noFocus()
{
	if(event.srcElement.tagName=="A")
		event.srcElement.blur()
}

function getStyleSyntax(idNm,s)
{
	
	if(document.all)
	{
		syntax=(!s) ? document.all[idNm].style:document.all[idNm]
	}
	else if(document.layers)
	{	
		syntax=eval("document['"+idNm+"']");	
	}
	else
	{ 	
		syntax=(!s) ? document.getElementById(idNm).style:document.getElementById(idNm);
	}
	
	return syntax;
}

function setMenuPosition()
{
	visValTrue=(document.layers) ? "show":"visible";
	visValFalse=(document.layers) ? "hide":"hidden";
	left_center=(window.innerWidth) ? window.innerWidth/2:document.body.clientWidth/2;
	left_minusAbo=(navigator.userAgent.indexOf("Gecko")>-1) ? 42:0
	left_minusPol=(navigator.userAgent.indexOf("Gecko")>-1) ? 52:0
	left_minusSer=(navigator.userAgent.indexOf("Gecko")>-1) ? 62:0
	left_minusPro=(navigator.userAgent.indexOf("Gecko")>-1) ? 72:0
	getStyleSyntax("aboutMenuTop").left=left_center-(288+left_minusAbo);
	getStyleSyntax("policiesMenuTop").left=left_center-(166+left_minusPol);
	getStyleSyntax("productsMenuTop").left=left_center-(68+left_minusPro); 
	getStyleSyntax("jewelryMenuTop").left=left_center+(39+left_minusSer);
	getStyleSyntax("servicesMenuTop").left=left_center+(139+left_minusSer);
	getStyleSyntax("contactMenuTop").left=left_center+(245+left_minusSer);
	showFlag=true;
}

function menu()
{
	clearInterval(x)
	over=menu.arguments[0]
	witch=menu.arguments[1]
	
	if(showFlag)
	{
		
		if(over)
		{
			getStyleSyntax(witch).visibility=visValTrue;
		}
		else
		{
			if(document.layers)
			{setTimeout("getStyleSyntax(witch).visibility=visValFalse",3000);}
			else
			{getStyleSyntax(witch).visibility=visValFalse;}
		}
	}
	else if(!over)
	{
		x=setInterval("menu(true,witch)",10)
	}
}
function openWin(url,w,h)					// url - window page url; w - window width; h - window height;
{
	winName=url.split("/")[url.split("/").length-1].replace(/\./,"")
	window.open(url,winName,"width="+w+" height="+h+" left="+(screen.width-w)/2+" top=0");
	return false;
}
function colorRoll(objRef) 				// color rollover for navBar headers
{
	objRef.style.color=(objRef.style.color=="" || objRef.style.color=="#303498" || objRef.style.color=="rgb(48,52,152)") ? "#980038":"#303498";
}

function colorRollSale(objRef,side) 				// color rollover for Special Sale
{
	if(side=="left")
	{
		colorToSet=(objRef.cells[0].style.color=="" || objRef.cells[0].style.color=="#303498" || objRef.cells[0].style.color=="rgb(48,52,152)") ? "#980038":"#303498";
	}
	else
	{
		colorToSet=(objRef.cells[0].style.color=="" || objRef.cells[0].style.color=="#980038" || objRef.cells[0].style.color=="rgb(152,0,56)") ? "#303498":"#980038";
	}
	
	
	for(c=0;c<objRef.cells.length;c++)
	{
		objRef.cells[c].style.color=colorToSet
	}
}