<!--//--><![CDATA[//><!--
sfPBarHover = function() {
	var navPbar = document.getElementById("pbarNav");
	if (navPbar){
		var sfEls = document.getElementById("pbarNav").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfpbarhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfpbarhover\\b"), "");
			}
		}
	}
}
if (window.attachEvent) window.attachEvent("onload",sfPBarHover);
//--><!]]>

var popupTimerHandle = null;
 var popupHandlerForPageAction= null;
 function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x) 
        curleft += obj.x;
		return curleft;
  }

function findPosY(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 setPosPageAction(refObj, childObj) 
	{
			
        var referenceObj = document.getElementById(refObj);

        var parentTop= referenceObj.offsetTop;
		var parentHeight = referenceObj.offsetHeight;
        var parentLeft = referenceObj.offsetLeft;
        var parentWidth = referenceObj.offsetWidth;
        var parentRight = findPosX(referenceObj) + parentWidth;
		var childObj = document.getElementById(childObj);
        var childWidth = childObj.offsetWidth;
		childObj.style.top =parentHeight +findPosY(referenceObj)+ 'px';
        childObj.style.left =parentRight-childWidth+ 'px';
     
     
     }
function showMenu(div) {
    if (popupTimerHandle != null) {
        clearTimeout(popupTimerHandle);
        popupTimerHandle = null;
    }
	  if (popupHandlerForPageAction != null) {
        clearTimeout(popupHandlerForPageAction);
        popupHandlerForPageAction = null;
    }

    divObj = document.getElementById(div);
    divObj.style.display = 'block';
}
function popupTimerHandleShow(div) {
    if (popupTimerHandle != null) {
        clearTimeout(popupTimerHandle);
        popupTimerHandle = null;
    }
    divObj = document.getElementById(div);
    divObj.style.display = 'block';
}
function popupHandlerPAShow(div) {
    if (popupHandlerForPageAction  != null) {
        clearTimeout(popupHandlerForPageAction );
        popupHandlerForPageAction = null;
    }
    divObj = document.getElementById(div);
    divObj.style.display = 'block';
}
function hideMenu(div) {
    popupTimerHandle = setTimeout("hideMenuAct('" + div + "');", 250);
}
function hideMenuForPA(div) {
    popupHandlerForPageAction= setTimeout("hideMenuAct('" + div + "');",50);
}
function hideMenuAct(div) {
    divObj = document.getElementById(div);
    divObj.style.display = 'none';
}   
function displayWhyReg(code){ 
		var url = "/webapp/shared/components/inc_collateral.jsp?code="+code;
		var window_title = "Why Should I Register?"
		var width = "700";
		var height = "350";
		ajaxwin=dhtmlwindow.open('ajaxbox',url,window_title, 'width='+width+'px,height='+height+'px,left=100px,top=100px,resize=0,scrolling=1');
		return ajaxwin ;
}

function call_pbar_metrics(action)
{
if (window.personalization_bar_metrics && action!= 'undefined' ){
		personalization_bar_metrics(action);
	}
}