//----------------------------------------------
//  Programmer....: Allen Yang
//  Date..........: 09/04/2001 
//----------------------------------------------

var imageName="";
var btnTemp=""
var timeID="";
IMAGE_BASE="/images/menus/";

function popUpEx(menu,evnt,btn) {
	if (timeID != "") {
		clearTimeout(timeID);
	}
	popUp(menu,evnt);
	btnTemp = btn;
	wait = HM_PG_TopSecondsVisible * 1000;
	timeID=setTimeout("onOff()",wait);
}

function onOff() {
	for (var i=0; i<btnArray.length; i++) {
		if(btnArray[i] == btnTemp) {
			changeButton(btnTemp,"on");
		} else {
			changeButton(btnArray[i],"off");
		}
	}
	clearTimeout(timeID);
}

function changeButton(imgName,state) {
	if (state == "on") {
		imageName = imgName;
	}

	if (imgName != "") {
		document[imgName].src = IMAGE_BASE + imgName + "_" + state + ".gif";
	}
}

function openWindow(url) {
	var tempwin = window.open(url, "LiteratureWindow", "width=800,height=600,toolbar=yes,location=no,scrollbars=yes,resizable=yes");
}

function openWinNoOpt(url,name) {

    var tempwin=window.open(url,name,"width=800,height=600,toolbar=no,location=no,scrollbars=yes,resizable=yes");
	if (tempwin != null)
	{
	    tempwin.focus();
	}

}

function openWin(url,name) {

    var tempwin=window.open(url,name,"width=800,height=600,toolbar=yes,location=yes,scrollbars=yes,resizable=yes");
	if (tempwin != null)
	{
	    tempwin.focus();
	}
   
}

//function openWinEmailFriend(url,name) 
//{
//    var tempwin=window.open(url,name,"width=525,height=500,toolbar=yes,location=yes,scrollbars=yes,resizable=no");
//    if (tempwin != null)
//    {
//       tempwin.focus();
//    }
//}

function openWinEmailFriend(url,name) 
{
    var newUrl = url;
    newUrl     = newUrl.replace( /content\/ip\/control/g, "content/dr/control" );

    var tempwin=window.open("http://" + document.location.hostname + newUrl +"&from="+escape(url)+"&ref="+ escape(document.location) ,name,"width=525,height=500,toolbar=yes,location=yes,scrollbars=yes,resizable=no");
    if (tempwin != null)
    {
       tempwin.focus();
    }
}


