if((typeof pmts)=='undefined'){var pmts=22;}else if(pmts==null){pmts=22;}
if((typeof useIfHN)=='undefined'){var useIfHN=true;}else if(useIfHN==null){useIfHN=true;}
useIfHN=(!window.opera&&true);
function getDistance(obj,isTop){
  var acum=0
  while(obj.tagName!="BODY"){
    acum+=isTop?obj.offsetTop:obj.offsetLeft
    obj=obj.offsetParent
  }
  return acum
}
var timeOutObj = null
function closeMenuHN(index){
  
  timeOutObj = null
  if(!overHNOpen&&!overHNTab){
    if ((typeof openHNtabIndex != 'undefined')&&openHNtabIndex!=null&&("|"+horNav[openHNtabIndex].pIDs+"|").indexOf("|"+pID+"|")==-1&&openHNtab)
      openHNtab.style.color='#000000'
    document.getElementById("hnpopup").style.display='none'
    document.getElementById("hnpopup").style.visibility='hidden'
  } else {
    timeOutObj = setTimeout("closeMenuHN("+index+")",1*500)
  }
  
}
function openMenuHN(index){

  var ifobj,ifdoc;
  if (openHNtabIndex&&("|"+horNav[openHNtabIndex].pIDs+"|").indexOf("|"+pID+"|")==-1&&openHNtab)
    openHNtab.style.color='#000000'
  var tabObj = document.getElementById("hntab"+index)
  var popObj = document.getElementById("hnpopup")
  var popupWidth = (tabObj.offsetWidth > 120) ? (tabObj.offsetWidth+25) : '120';
  if (index == 5) popupWidth = '135';
  var tmpHTML2='<table id="hnpt" bgcolor="#F4F5F8" border="0" cellspacing="0" cellpadding="0" width="'+(popupWidth)+'" style="border-bottom:1px solid #75889F;border-right:1px solid #75889F;border-left:1px solid #75889F;margin-right:0px;z-index:1000;">'
  for(i=0;i<horNav[index].subnav.length;i++){
    var tempHref = horNav[index].subnav[i].href
    if(tempHref.indexOf("http://")==-1&&tempHref.indexOf("javascript")==-1){
      tempHref = ((nSP)?nSP:((document.domain)?"http://"+document.domain:""))+horNav[index].subnav[i].href+'?mod=topnav_'+pID.replace('\'','')
    }
    if(openHSection!=null&&openHSection==index){
      var tempLoc = ("".concat(window.top.location).substring("".concat(window.top.location).indexOf("/",8)))
      if(tempLoc.indexOf("?")>-1){
        tempLoc=tempLoc.substring(0,tempLoc.indexOf("?"))
      }
      if(i==0)
      	tmpHTML2+= '<tr><td style="padding:12px 0px 7px 11px;font-family: Arial, Helvetica, sans-serif;font-size: 11px;text-decoration: none;'
      else
      	tmpHTML2+= '<tr><td style="padding:2px 0px 7px 11px;font-family: Arial, Helvetica, sans-serif;font-size: 11px;text-decoration: none;'
      var tempBlock = 'cursor:hand;" onclick="'+(useIfHN?'top':'window')+'.location=\''+tempHref+'\'" onmouseover="status=\''+tempHref+'\';this.style.textDecoration=\'underline\'" onmouseout="status=\''+'\';this.style.textDecoration=\'none\'"'
      if(tempHref.indexOf("http://")==-1&&tempHref.indexOf("javascript")==-1){
        if(tempLoc==horNav[index].subnav[i].href||(isOpen&&isOpen(horNav[index].subnav[i].href))){
          tempBlock = 'color:#fff;"'
        }
      }
      tmpHTML2+= tempBlock+'>'+horNav[index].subnav[i].text+'</td></tr>'
    } else {
      if(i==0)
	tmpHTML2+= '<tr><td style="padding:12px 0px 7px 11px;font-family: Arial, Helvetica, sans-serif;font-size: 11px;text-decoration: none;cursor:pointer;" onclick="'+(useIfHN?'top':'window')+'.location=\''+tempHref+'\'" onmouseover="status=\''+tempHref+'\';this.style.textDecoration=\'underline\'" onmouseout="status=\''+'\';this.style.textDecoration=\'none\'">'+horNav[index].subnav[i].text+'</td></tr>'
      else if(i==horNav[index].subnav.length-1)
      	tmpHTML2+= '<tr><td style="padding:0px 0px 0px 11px;font-family: Arial, Helvetica, sans-serif;font-size: 11px;text-decoration: none;cursor:pointer;" onclick="'+(useIfHN?'top':'window')+'.location=\''+tempHref+'\'" onmouseover="status=\''+tempHref+'\';this.style.textDecoration=\'underline\'" onmouseout="status=\''+'\';this.style.textDecoration=\'none\'">'+horNav[index].subnav[i].text+'</td></tr>'
      else
      	tmpHTML2+= '<tr><td style="padding:0px 0px 7px 11px;font-family: Arial, Helvetica, sans-serif;font-size: 11px;text-decoration: none;cursor:pointer;" onclick="'+(useIfHN?'top':'window')+'.location=\''+tempHref+'\'" onmouseover="status=\''+tempHref+'\';this.style.textDecoration=\'underline\'" onmouseout="status=\''+'\';this.style.textDecoration=\'none\'">'+horNav[index].subnav[i].text+'</td></tr>'
    }
  }

  tmpHTML2+= '<tr><td style="background-image: url(http://s.wsj.net/img/Bevel_bottom_drop_down.jpg); background-repeat:repeat-x;"><img src="http://s.wsj.net/img/b.gif" width="1" height="17" alt="" /></td></tr>'

  tmpHTML2+='</table>';
  popObj.innerHTML='<div id="idiv"></div>';

  if(useIfHN){
	$('idiv').innerHTML='<'+'iframe id="hnpopupif" marginWidth="0" src="" marginHeight="0" hspace="0" vspace="0" frameBorder="0" scrolling="no" style="display:block;">'+'<'+'/'+'iframe>';
	ifobj=$('hnpopupif');

    ifdoc=getIfDocHN(ifobj);
    var ifc='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'+
      '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'+
      '<head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><title></title></head>'+
      '<body style="padding:0px;margin:0px;background-color:white;">'+tmpHTML2+'</body></html>';

	  if (ifdoc !=null) {
		ifdoc.open("text/html","replace");
		ifdoc.write(ifc);
		ifdoc.close();
	  }
  }
  else{
    $('idiv').innerHTML=tmpHTML2;
  }

  if(index == 0)
    popObj.style.left=(getDistance(tabObj,false)-11)+"px"
  else
    popObj.style.left=(getDistance(tabObj,false)-13)+"px"
  popObj.style.top=(getDistance(tabObj,true)+pmts)+"px"
  popObj.style.width=(popupWidth)+"px"
  tabObj.style.color='#990000'
  popObj.style.display='block'
  popObj.style.visibility='visible'
  if(useIfHN){
	ifobj.style.display='block';
	if (ifdoc!=null) ifobj.style.height=ifdoc.getElementById('hnpt').offsetHeight+'px';
	ifobj.style.width=(popupWidth)+'px';
  }
  if (ifdoc!=null)  {
	  openHNtab=tabObj
	  openHNtabIndex=index
  }
}
function getIfDocHN(ifobj){var o=null;if(typeof document.frames!='undefined'){o=document.frames[ifobj.id].document;}else if(typeof ifobj.Document!='undefined'){o=ifobj.Document;}else if(typeof ifobj.contentDocument!='undefined'){o=ifobj.contentDocument;}else if(typeof ifobj.contentWindow!='undefined'){o=ifobj.contentWindow;}return o;}
