function MM_openBrWindow(theURL,winName,features) {
    window.open(theURL,winName,features);
}

function MM_swapImgRestore() { //v2.0

    if (document.MM_swapImgData != null)
        for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)
            document.MM_swapImgData[i].src = document.MM_swapImgData[i+1];
}

function MM_swapImage() { //v2.0
    var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;
    for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {
        objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];
        if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
            (objStr.indexOf('document.all[')   ==0 && document.all   ==null))
            objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
        obj = eval(objStr);
        if (obj != null) {
            swapArray[j++] = obj;
            swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];
            obj.src = MM_swapImage.arguments[i+2];
        }
    }
    document.MM_swapImgData = swapArray; //used for restore
}
function gothere(){
	window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value;
}

function openList(whichlist) {
	theURL = eval("document.guideform."+whichlist+".options[document.guideform."+whichlist+".selectedIndex].value");
    window.open(theURL,'reflibrary','scrollbars=yes,resizable=yes,width=570,height=550');
}

function swapMe(str_imgName, str_imgSrc){
	        document.images[str_imgName].src = str_imgSrc;
}

// function used to select the navigation dropdowns based on the page filename (i.e. aa0000.jsp) --//

function setNav(whichForm,whichSelect) {
	var locale = location.pathname.substring(location.pathname.indexOf('/')-1)
	var filename = location.pathname.substring(location.pathname.lastIndexOf('/')+1)
	
	if (filename == "") { //append index.jsp onto anything that doesn't have a file name in the URL
		locale = locale + "index.jsp";
	}
	var docForm = "document."+whichForm+"."+whichSelect;
	
	if(filename == "activity.do") { // if the page is the pyk, select pyk in the menu
		eval(docForm).selectedIndex = eval(docForm+".length")-1;
	} else{
		for (i=0;i<eval(docForm+".length");i++) {
			if (eval(docForm+".options["+i+"].value") == locale) {
				eval(docForm).selectedIndex = i;
			}
		}
	}
	
	/*for (i=0;i<eval(docForm+".length");i++) {
		if (eval(docForm+".options["+i+"].value") == locale) {
			eval(docForm).selectedIndex = i;
		}
	}*/
}

function popUp(gotourl) {
	var ref = escape("http://" + self.document.location.host);
	if (gotourl.indexOf("?") == -1) {
		gotourl = gotourl + '?rref=' + ref;
	} else {
		gotourl = gotourl + '&rref=' + ref;
	}
	props = window.open(gotourl, 'hpproducts', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=640,height=480');
	props.focus();
}
function synLink(aid, uid, lid, linktext) {
	switch(lid) {
		case 1:
			lang='usen';
			break;
		case 2:
			lang='caen';
			break;
		case 3:
			lang='cafr';
			break;
		default:
			lang='usen';
			break;
	}
	if (typeof linktext == 'undefined') {
		uselinktext=false;
	} else {
		switch(linktext) {
			case 1:
			case "":
			case false:
				uselinktext=false;
				break;
			case 2:
			case true:
				uselinktext=true;
				linktext="view demo"; //default linktext
				break;
			default:
				uselinktext=true;
				linktext=linktext; //use provided text string
				break;
		}
	}
  if (uselinktext) {
		document.writeln('<a href="#" onClick="return synViewer(' + aid + ', ' + uid + ');">' + linktext + '</a>');
	} else {
		document.writeln('<a href="#" onClick="return synViewer(' + aid + ', ' + uid + ');"><img src="http://h30038.www3.hp.com/assets/' + lang + '/buttons/view_demo_button.gif" border=0></a>');
	}
}
function synViewer(aid, uid) {
	if (self.document.location.host.indexOf(".dev.") == -1 && self.document.location.host.indexOf(".proto.") == -1) {
		baseURL = "h30038.www3.hp.com";
	} else {
		baseURL = self.document.location.host;
	}
  synWin = window.open('http://h30038.www3.hp.com/products/_display/get_flash.php?asset_id=' + aid + '&uid=' + uid + '&rref=' + escape(window.location.href), '_blank', 'width=560,height=209,scrollbars=no,toolbar=no,personalbar=no,statusbar=no,directories=no,location=no,resizable=yes,menubar=no,locationbar=no');
  synWin.focus();
	return false; 
}
function popUpBig(gotourl) {
	var ref = escape("http://" + self.document.location.host);
	if (gotourl.indexOf("?") == -1) {
		gotourl = gotourl + '?rref=' + ref;
	} else {
		gotourl = gotourl + '&rref=' + ref;
	}
	props = window.open(gotourl, 'hpproducts', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=740,height=520');
	props.focus();
}
function popUpNewWindow(gotourl) {
	popUp(gotourl);
}
function maxWindow() {
	window.moveTo(0,0);
	if (document.all) {
		top.window.resizeTo(screen.availWidth,screen.availHeight);
	}	else if (document.layers||document.getElementById) {
		if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth) {
			top.window.outerHeight = screen.availHeight;
			top.window.outerWidth = screen.availWidth;
		}
	}
}
/**********************************************************************
 politePopup :
 Opens a popup window (w/variable atttributes, if stated)
 use like this:

 <a href="/url.do" onclick="return politePopup('/url.do','windowName','optional attributes specifications');"

**********************************************************************/

function politePopup(url,windowName,attributes)
{
    if (attributes == '' || attributes == null){
        attributes = 'scrollbars=yes,resizable=yes,width=680,height=480,menubar=yes,status=yes,toolbar=yes';
    }
	newwindow=window.open(url,windowName,attributes);
	if (window.focus) {newwindow.focus()}
	return false;
}