// JavaScript Document
/*function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}*/
function findPos(obj)
{
    var curleft = curtop = 0;
    if (obj.offsetParent)
    {
        curleft = obj.offsetLeft;
        curtop = obj.offsetTop;
        while (obj = obj.offsetParent) 
        {
            curleft += obj.offsetLeft;
            curtop += obj.offsetTop;
        }
    }
    return [curleft,curtop];
}
function Disp_SubcatDropDown(anchor_id,subDivName,subDiv_id,divs)
{
	var i=1;
	while(i <= divs)
	{
		if(document.getElementById(subDivName+i)!=null)
			document.getElementById(subDivName+i).style.visibility='hidden';
		i++;
	}
	if(document.getElementById(anchor_id)!=null)
	{
		if(document.getElementById(subDiv_id)!=null)
		{
			var oDiv = document.getElementById(subDiv_id);
			var oAnchor = document.getElementById(anchor_id);
			var pos = findPos(oAnchor);
			//alert(document.getElementById('menuHairProduct'));
			oDiv.style.display='';
			oDiv.style.visibility = 'visible';
			oDiv.style.position = 'absolute';
			oDiv.style.left = pos[0]+180+'px';
			oDiv.style.top = pos[1]+0+'px';
			oDiv.style.zIndex = 1002;
			return false;
		}
	}
}
function Disp_DropDown(id)
{
	var browserName=navigator.appName;
	//alert(browserName);
	var width = screen.width;
	//var height = screen.height;
	//alert(width+' and '+height);
	if (browserName=="Netscape")
	{ 
		document.getElementById(id).style.top='143px';
	}
	else if (browserName=="Microsoft Internet Explorer")
	{
		//alert(id);
		if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
		 var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
		 if (ieversion>=7)
		 	document.getElementById(id).style.top='142px';
		 else if (ieversion>=6)
			document.getElementById(id).style.top='148px';
		}
	}
	if(width==1024)
	{
		//alert(id);
		if(id=='menuHairProduct')
			document.getElementById(id).style.left='193px';
		else if(id=='menuProductReview')
			document.getElementById(id).style.left='320px';
		else if(id=='menuVendor')
			document.getElementById(id).style.left='466px';
	}
	else if(width==1280)
	{
		//alert(id);
		if(id=='menuHairProduct')
			document.getElementById(id).style.left='325px';
		else if(id=='menuProductReview')
			document.getElementById(id).style.left='442px';
		else if(id=='menuVendor')
			document.getElementById(id).style.left='598px';
	}
/*	if(width==1024)
	{
		//alert(id);
		if(id=='menuHairProduct')
			document.getElementById(id).style.left='193px';
		else if(id=='menuProductReview')
			document.getElementById(id).style.left='310px';
		else if(id=='menuLatestPost')
			document.getElementById(id).style.left='446px';
		else if(id=='menuVendor')
			document.getElementById(id).style.left='557px';
	}
	else if(width==1280)
	{
		//alert(id);
		if(id=='menuHairProduct')
			document.getElementById(id).style.left='325px';
		else if(id=='menuProductReview')
			document.getElementById(id).style.left='442px';
		else if(id=='menuLatestPost')
			document.getElementById(id).style.left='578px';
		else if(id=='menuVendor')
			document.getElementById(id).style.left='690px';
	}
*/
	if(document.getElementById(id)!=null)
		document.getElementById(id).style.visibility="visible";
	return false;
}
function Disp_bothDropDown(cat,subcat)
{
	if(document.getElementById(cat)!=null)
	{
		if(document.getElementById(subcat)!=null)
		{
			document.getElementById(cat).style.visibility="visible";
			document.getElementById(subcat).style.visibility="visible";
			return false;
		}
	}
}
function Hide_DropDown(id)
{
	if(document.getElementById(id)!=null)
		document.getElementById(id).style.visibility="hidden";
	return false;
}
function Hide_DropDown_subcats(catDiv,subDivName,totlasubDivs)
{
	var i=1;
	while(i <= totlasubDivs)
	{
		if(document.getElementById(subDivName+i)!=null)
			document.getElementById(subDivName+i).style.visibility='hidden';
		i++;
	}
	if(document.getElementById(catDiv)!=null)
		document.getElementById(catDiv).style.visibility="hidden";
	return false;
}
function Hide_bothDropDown(catDiv,subcatDiv)
{
	if(document.getElementById(catDiv)!=null)
	{
		if(document.getElementById(subcatDiv)!=null)
		{
			document.getElementById(subcatDiv).style.visibility="hidden";
			document.getElementById(catDiv).style.visibility="hidden";
			return false;
		}
	}
}





