/* Browser check */
/* IS_DOM = (document.getElementById) ? true : false;*/
IS_DOM = (typeof(document) != "undefined" && typeof(document.getElementById) != "undefined") ? true : false;

// preload level 1 menu buttons
var btnLevel1 = new Array();
btnLevel1 = ["","products","purchase","support","about_us","downloads","forum"];
for (i=0;i<btnLevel1.length;i++) { 
	eval("menu"+i+"on = new Image();"); eval("menu"+i+"off = new Image();");
	if (btnLevel1[i] != "") {
		eval("menu"+(i)+"on.src = \"" + "/img/buttons/"+btnLevel1[i]+"-over.jpg\";");
		eval("menu"+(i)+"off.src = \"" + "/img/buttons/"+btnLevel1[i]+"-up.jpg\";");
	}
}

function imgOn(imgName) {
  if (IS_DOM) {
    document.getElementById(imgName).src = eval(imgName + "on.src");
  }
}
 
function imgOff(imgName) {
  if (IS_DOM) {
    document.getElementById(imgName).src = eval(imgName + "off.src");
  }
}

//Open new window
function OpenWindow(sPath, iHeight, iWidth ) {
	var winName = "newWind" + Math.round(Math.random() * 9999999);
	window.open(sPath, winName, 'height=' + iHeight + ',width=' + iWidth + ',scrollbars,resizable,top=20,left=20')
}

//Open new window in specified target
function OpenTargetWindow(sPath, sTarget, iHeight, iWidth ) {
	var winName = sTarget;
	var newWin = window.open(sPath, winName, 'height=' + iHeight + ',width=' + iWidth + ',scrollbars,resizable,top=20,left=20');
	newWin.focus();
}

