

function GET_HTTP_QueryString(Query_String_Name) {
    
    var i, pos, argname, argvalue, queryString, pairs;
     // get the string following the question mark
     queryString = location.href.substring(location.href.indexOf("?")+1);
     // split parameters into pairs, assuming pairs are separated by ampersands
     pairs = queryString.split("&");
     // for each pair, we get the name and the value
        for (i = 0; i < pairs.length; i++) { 
	  pos = pairs[i].indexOf('='); 
	  if (pos == -1) {
	  continue; 
	  }
	  argname = pairs[i].substring(0,pos);
	  argvalue = pairs[i].substring(pos+1); 
	// Replaces "Google-style" + signs with the spaces they represent
	    if (argname == Query_String_Name) {
	       return unescape(argvalue.replace(/\+/g, " "));
	    }
	}
	return false;
}


function setFrameSrc() {
    
    var theIFrame = document.getElementById('share_indices');
   
    var provider = GET_HTTP_QueryString("provider");
    
    if (provider.length>0) {
    
        if (theIFrame) {
        
            theIFrame.src =    provider;
        }
    }
}


var imgArray = new Array();
function preload(imgname){

		

		var img = new Image();

		img.src = imgname;

		imgArray[imgArray.length]=img;

	}


// Global variables

var timeoutMs = 250;var mTimeout;var mTimeoutleft;

function isOpera(){if(navigator.userAgent.search(/opera/gi)>-1){return true;}return false;}

function isIE(){if(navigator.userAgent.search(/MSIE/gi)>-1){return true;}return false;}

function findPosX(obj){

var curleft = 0;

while(obj!=null){curleft+=obj.offsetLeft;obj=obj.offsetParent;}

return curleft;

}

function findPosY(obj){

var curtop = 0;

while (obj!=null){curtop+=obj.offsetTop;obj=obj.offsetParent;}

return curtop;

}

function swapimg(aname){
 
    aname = aname.replace('ctl00_','');
	var obj = document.getElementById('ctl00_image_' + aname);
    
   
    if(obj.className != 'active') {
    
	    if(obj.src.indexOf("_on")>-1){

		    obj.src=obj.src.replace("_on","_off");

	    }else{

		    obj.src=obj.src.replace("_off","_on");

	    }
	}
}

function allFallDown() {

	var navDiv = document.getElementById('topnav');
	var images = navDiv.getElementsByTagName('IMG');

	for (var i = 0;i<images.length;i++) {
        
        if(images[i].className != 'active') 
		    images[i].src=images[i].src.replace("_on","_off");

	}

}

function showMenu(aname){
	
	var isMac = navigator.userAgent.indexOf("Mac") > 0;
	var isIe = navigator.userAgent.indexOf("MSIE") > 0;
	var menu = document.getElementById(aname);
    
    aname = aname.replace('ctl00_','');
	
	hideMenus('menu'); 
    hideMenus('menu_left');
	  clearMenuTimeout();

	  swapimg(aname);

	  var d = document.getElementById('ctl00_sub_' + aname);
      
	  if (d)
	  {
		  if (isMac && isIe )
		  {
		      if (aname != 'investor') {
		      d.style.top = '447px';
		       } else {
		        d.style.top = '75px';
		       }
			  
		  }
		  d.style.zIndex=1000;

		  d.onmouseover= clearMenuTimeout;

		  d.onmouseout = menuTimeout;

		  d.style.left = ((findPosX(menu)+menu.offsetWidth)-menu.offsetWidth -1) + 'px';

		  d.style.display='block'; 

	  } 

}

function hideMenus(menuname){

allFallDown();

var divArr = document.getElementsByTagName('div');

for(var i=0;i<divArr.length;i++){if(divArr[i].className==menuname){divArr[i].style.display='none';}}

}

function menuTimeout(){
    clearMenuTimeout();
    mTimeout = window.setTimeout("hideMenus('menu_left');",timeoutMs);
    mTimeoutleft = window.setTimeout("hideMenus('menu_left');",timeoutMs);
}

function clearMenuTimeout(){
    clearTimeout(mTimeout);
    clearTimeout(mTimeoutleft);
}

function nav(location){window.location.href=location;}


function startIeFix(){

if(isIE()){

document.write('<div id="bo_ns_id_' + bo_ns_id + '"><!-- ');

}

}



function endIeFix(){

if(isIE()){

document.write('</div>');

var theObject = document.getElementById("bo_ns_id_" + bo_ns_id++);

var theCode = theObject.innerHTML;

theCode = theCode.substring(4 ,9+theCode.indexOf("</object>"))

document.write(theCode);

}

}



function isIE(){

// only for Win IE 6+

// But not in Windows 98, Me, NT 4.0, 2000

var strBrwsr= navigator.userAgent.toLowerCase();

if(strBrwsr.indexOf("msie") > -1 && strBrwsr.indexOf("mac") < 0){

if(parseInt(strBrwsr.charAt(strBrwsr.indexOf("msie")+5)) < 6){

return false;

}

if(strBrwsr.indexOf("win98") > -1 ||

strBrwsr.indexOf("win 9x 4.90") > -1 ||

strBrwsr.indexOf("winnt4.0") > -1 ||

strBrwsr.indexOf("windows nt 5.0") > -1)

{

return false;

}

return true;

}else{

return false;

}

}