function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// hide "jump to" type buttons if javascript is on
function hideButtons()
{
var x = document.getElementsByTagName('input');
	for (var i=0;i<x.length;i++) {
		if (x[i].className == 'jumpButton')
			x[i].style.display = 'none';
	}
}

function winOnLoad()
{

	   // in IE, if the footer is not at the bottom of the page, put it there.
	   // Mozilla 5 does this correctly from the CSS
	   var footer = xGetElementById("Footer");
	   var content = xGetElementById("Content");
	   hideButtons();
	   if(xIE4Up && content && footer && xClientHeight()-xHeight(footer)-10 > xPageY(footer)) {
		var d =  xClientHeight()-xHeight(footer)-60;
		xHeight(content, d);
	   }
	   xHide("Header");
}

var isMinNS4 = (document.layers) ? 1 : 0;
var isMinIE4 = (document.all)    ? 1 : 0;


function popUp(url)
{
	newwindow=window.open('/popup.php?pic=' + url,'popUp','width=4,height=4,scrollbars=no,resizable=no,status=no,menubar=no');
	if(window.focus)
	   	newwindow.focus()
}

//SuckerTree Horizontal Menu (Sept 14th, 06)
//By Dynamic Drive: http://www.dynamicdrive.com/style/


function buildsubmenus_horizontal(){
	for (var i=0; i != menuids.length; i++){
		var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
		for(var t=0; t != ultags.length; t++){
			if(ultags[t].parentNode.parentNode.id==menuids[i]){ //if this is a first level submenu
				ultags[t].style.top=ultags[t].parentNode.offsetHeight+"px" //dynamically position first level submenus to be height of main menu item
					ultags[t].parentNode.getElementsByTagName("a")[0].className="mainfoldericon"
			}
			else { //else if this is a sub level menu (ul)
				ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
				ultags[t].parentNode.getElementsByTagName("a")[0].className="subfoldericon"
			}
			ultags[t].parentNode.onmouseover=function(){
				this.getElementsByTagName("ul")[0].style.visibility="visible"
			}
			ultags[t].parentNode.onmouseout=function(){
				this.getElementsByTagName("ul")[0].style.visibility="hidden"
			}
		}
	}

	/* now set the sub menu of compilers to be extra wide to fit the PSoC name */
	setMenuWidth('/products/compilers/$', 300);
}

function changePage(newLoc)
{
	nextPage = newLoc.options[newLoc.selectedIndex].value
	if (nextPage != "")
		document.location.href = nextPage
}


