	

function imgOn(imgName) { if (document.images)
            document[imgName].src = eval(imgName + "on.src");
                        }
                        
function imgOff(imgName) { if (document.images)
            document[imgName].src = eval(imgName + "off.src");
            }
            
            
function mouseOver(img)
{
	if (document.images)
	{
		document.images[img].src = eval(img + "_on.src");
	}
}

function mouseOff(img)
{
	if (document.images)
	{
		document.images[img].src = eval(img + "_off.src");
	}
}

function imgOn(imgName) { if (document.images)
            document[imgName].src = eval(imgName + "on.src");
                        }

function imgOff(imgName) { if (document.images)
            document[imgName].src = eval(imgName + "off.src");
                        }

function printMe()
{
  window.print();
}


function printDetail(strTitle,strAsOf,strHtmlID)
{
w = window.open('','newwin','width=600,scrollbars=1,resizable=1');
w.document.write('<html><head><title>PIMCO Institutional ' + strTitle + ' Print Page</title>');
w.document.write('<link rel="stylesheet" type="text/css" href="CSS/style.css"></head><body>');
w.document.write('<table width="550"><tr><td class="title">' + strTitle + ' as of ' + unescape(strAsOf) + '</td><td align="right" class="default">');
w.document.write('<a href="javascript:window.close();">Close Window</a><br>')
w.document.write('<a href="javascript:window.print();"><img src="Images/btn_print.gif" border="0" vspace="5"></a>');

w.document.write('</td></tr></table>');
var content = document.getElementById(strHtmlID).innerHTML;
//find index of "<!--SearchBegin-->" length = 18
//find index of "<!--SearchEnd-->" length = 16
var searchBegin = content.indexOf("<!--SearchBegin-->");
var searchEnd = content.indexOf("<!--SearchEnd-->");
if ((searchBegin != -1) && (searchEnd != -1) && (searchBegin < searchEnd))
{
	content = content.substr(0, searchBegin) + content.substr(searchEnd+16);
}
w.document.write( content + '</body></html>');
w.document.close();		
}


function popUp(url,wide,tall,left,top) {
popupwin=window.open(url,'win','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,width=' + wide + ',height=' + tall + ',left=' + left + ',top=' + top + ', resizable=1');
if (popupwin.opener == null) popupwin.opener = window; 
    popupwin.opener.name = "opener";
setTimeout("popupwin.focus()",100);  
}


function gotoglossary(anchor)
{
  URL = "/pimcofund/glossary/bonds_glossaryd.aspx#"+anchor;
  OpenWin = open(URL, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
}

function getElementPosition(elemID)
{
	var offsetTrail = document.getElementById(elemID);
	var offsetLeft = 0 ;
	var offsetTop = 0 ;
	
	while (offsetTrail)
	{
		offsetLeft += offsetTrail.offsetLeft;
		offsetTop += offsetTrail.offsetTop;
		offsetTrail = offsetTrail.offsetParent;
	}
	
	if (navigator.userAgent.indexOf("Mac") != -1 &&
		typeof document.body.leftMargin != "undefined")
	{
		offsetLeft += document.body.leftMargin;
		offsetTop += document.body.topMargin;
	}
	
	return {left:offsetLeft, top:offsetTop};
}
function getElementPosition(elemID)
{
	var offsetTrail = document.getElementById(elemID);
	var offsetLeft = 0 ;
	var offsetTop = 0 ;
	
	while (offsetTrail)
	{
		offsetLeft += offsetTrail.offsetLeft;
		offsetTop += offsetTrail.offsetTop;
		offsetTrail = offsetTrail.offsetParent;
	}
	
	if (navigator.userAgent.indexOf("Mac") != -1 &&
		typeof document.body.leftMargin != "undefined")
	{
		offsetLeft += document.body.leftMargin;
		offsetTop += document.body.topMargin;
	}
	
	return {left:offsetLeft, top:offsetTop};
}

function setElementPositionByElementTarget(elemID,elemTargetID)
{
	var elemTargetPosition = getElementPosition(elemTargetID);

	var elem = document.getElementById(elemID);
	
	elem.style.left =eval(elemTargetPosition.left) ;
	elem.style.top =eval(elemTargetPosition.top)  ;

}

// Controlling the behavior of the the dropdown list control
// Hovering over the ddl will give it focus, if the ddl list is clicked it will keep focus
// when the mouse is moved away from the ddl it will lose focus (iff the ddl was not clicked on)
// Usage: OnMouseOver="ddlSetFocus(this);" OnMouseOut="ddlBlur(this);" OnClick="ddlOpen();"
//        OnFocus="do something;" OnBlur="do something;" 

var ddltimeout = 350;
var ddlclosetimer = 0;
var ddlOpened = false;

function ddlSetFocus(ctrl) {
    ddlCancelClose();
    ctrl.focus();
}

function ddlBlur(ctrl) {
    if (ddlOpened == false) {
        var fun = 'ddlClose("' + ctrl.id + '")';
        ddlclosetimer = window.setTimeout(fun, ddltimeout);
    }
    ddlOpened = false
}

function ddlOpen() {
    ddlOpened = true;
}

function ddlClose(elemID) {
    var elem = document.getElementById(elemID);
    elem.blur();
    ddlOpened = false;
}

function ddlCancelClose() {
    if (ddlclosetimer) {
        window.clearTimeout(ddlclosetimer);
        ddlclosetimer = null;
    }
}
       