//Common JS functions

function setLang(sLang)
{
 document.forms[0].elements["__lang"].value = sLang;
 document.forms[0].submit();
 return false;
}
        
function openPopup(iWidth,iHeight,sUrl,sWinName)
{
 var x = (screen.width - iWidth) / 2;
 var y = (screen.height - iHeight) / 2;
 var popln = top.open(sUrl,sWinName,"scrollbars=yes,resizable=yes,width="+iWidth+",height="+iHeight+",status=yes,location=no,toolbar=no,left="+x+",top="+y);
 popln.opener = self;
 popln.focus();
}

function setCookie(cName, cValue, cExpireDays)
{
 var exp = "";
 if(cExpireDays > 0)
 {
  var exdate = new Date();
  exdate.setDate(exdate.getDate() + cExpireDays);
  exp = ";expires=" + exdate.toGMTString();
 }
 document.cookie=cName+ "=" + escape(cValue) + exp;
}

var openedCat2Lev = "";

function openclosecat2(cookiename,cat1id,catid)
{
 if(catid == "")
  return false;
  
 if(openedCat2Lev != "" && openedCat2Lev != null)
 {        
  if(catid == openedCat2Lev)
  {
   document.getElementById(catid).style.display = "none";
   openedCat2Lev = null;
  }
  else
  {
   document.getElementById(openedCat2Lev).style.display = "none";
   document.getElementById(catid).style.display = "block";
   openedCat2Lev = catid;
  }
 }
 else
 {
  document.getElementById(catid).style.display = "block";
  openedCat2Lev = catid;
 }
 
 document.cookie = cookiename+"="+cat1id;
 
 return false;
}


function openSimpleSearchHelp()
{
    openPopup(600,450,"../search/SimpleSearchHelpPopup.aspx","kvcsmhlp");
}



