/* general functions used in site */

	function MM_openBrWindow(theURL,winName,features) { //v2.0
		window.open(theURL,winName,features);
	}

	//jumps to a URL based on a call				
	function linkTo(optVal){
		if(optVal=="") return false;
		window.location=optVal;
	} 
	  
	  function LaunchTool() {
	 
		window.open('swf/optimenu.html','optimenu','status=yes,width=600,height=425');
	}
	function locateObject(n) 
{ 
    if(document.getElementById)
        return document.getElementById(n);
    else if(document.all) 
        return document.all[n];
    else if(document.layers)
    	 return document.layers[n]; 
}

   function getWindowWidth()
{
	var x;
	if(document.all)
	{
	    if(document.documentElement)
        {
            //alert(document.documentElement.scrollTop);
            return document.documentElement.clientWidth;
        }
		x = parseInt(document.body.clientWidth);
	}
	else 
    {
		x = parseInt(self.innerWidth);
        x = x - (getWindowHeight() < document.height ? 16 : 0);
    }
	return x;
}

function getWindowHeight()
{
	var x;
	if(document.all)
	{
	    if(document.documentElement)
        {
            //alert(document.documentElement.scrollTop);
            return document.documentElement.clientHeight;
        }

		x = parseInt(document.body.clientHeight);
	}
	else 
		x = parseInt(self.innerHeight);
	return x;
}
function getObjectY(obj)
{
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
}
function setClientTop(top)
{
//    
        window.scrollTo(0,top);
    

}

function clickButton(e, buttonid)
{
  var evt = e ? e : window.event;
  var bt = document.getElementById(buttonid);
  if (bt && evt.keyCode == 13)
  {
    bt.click();
    return false;
  }
}

function doSearch(dropdownId)
{
  var dropdown = document.getElementById(dropdownId);
  var url = dropdown.options[dropdown.selectedIndex].value;

  if (url.startsWith('http://') == true)
    window.open(url, '_new');
  else
    window.location = url;
}

