// fix DropDown if JS is not available (redefine styles by JS)
function selectFix(name){
if (document.getElementById(name)!= null) {
document.getElementById(name).className="navigation-select";
}
}

function productsListShowback() {
// This will appear visibility of full list controls. on page.load
		var contolList=document.getElementById("navigation-products")
		contolList.style.display="block";
}


var t;
var d;
function toplistOn(dv)
{
dv.className='navigation-select on';
}

function toplistOff(dv)
{
dv.className='navigation-select';
}

function menuFix(list) {
	var sfEls = document.getElementById(list).getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
		this.className+=(this.className.length>0? " ": "") + "sfhover";
		}
		// event added to keep menu items from disappearing
		sfEls[i].onMouseDown=function() {
		this.className+=(this.className.length>0? " ": "") + "sfhover";
		}
		// event added to keep menu items from disappearing
		sfEls[i].onMouseUp=function() {
		this.className+=(this.className.length>0? " ": "") + "sfhover";
		}
		sfEls[i].onmouseout=function() {
		this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
		}
	}
}

function section(k) {

	for (i=1; i<=2; i++) 
	{
        if (i==k) 
        {
                document.getElementById('advanced'+i).style.display='block';
                document.getElementById('link'+i).className='selected';
                SetCookie ('SelectedSection',i,1)
		}
        else {
                document.getElementById('advanced'+i).style.display='none';
                document.getElementById('link'+i).className='';
		}
                
	}
}


function MapOrListInit()
{
var SelectedSection=ReadCookie('SelectedSection');


if (SelectedSection=="2")
	section(2) //list
else
	section(1); 
	

}

function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString();
}

function ReadCookie(cookieName) {
 var theCookie=""+document.cookie;
 var ind=theCookie.indexOf(cookieName);
 if (ind==-1 || cookieName=="") return ""; 
 var ind1=theCookie.indexOf(';',ind);
 if (ind1==-1) ind1=theCookie.length; 
 return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}


