
var agt=navigator.userAgent.toLowerCase();
var is_ie =((agt.indexOf("msie 5.5\; windows nt 5.0")!= -1) || (agt.indexOf("msie 5.01\; windows nt 5.0")!= -1));  
function win2000() {
	if (is_ie == true) {
		window.open('/security.php3','newin','toolbar=yes,location=top,directories=0,status=0,resizable=yes,menubar=yes,scrollbars=yes,width=350,height=200');
	}
}

function changeMenu(menuNum,subMenuName,formName,productNum){

	//alert ('1 formname is '+formName);

	//mysubMenu = eval('document.' + formName + '.' + subMenuName);
	mysubMenu = document[formName][subMenuName];
	//alert (subMenuName);
	for (i=mysubMenu.options.length-1;i>0;i--){
		mysubMenu.options[i]=null
		}
		
	for (i=0;i<eval('menu'+productNum)[menuNum].length;i++){
		mysubMenu.options[i]=new Option(eval('menu'+productNum)[menuNum][i].text,eval('menu'+productNum)[menuNum][i].value)
		}
		
	mysubMenu.selectedIndex=0
	}


function selectmenu(mySelect){
	
	formName = mySelect.form.name;
	//alert ('2 formname is '+formName);
	if (mySelect.options[mySelect.selectedIndex].value == "null"){
		alert('Select a topMenu');
		}
	else{
		window.top.location.href = mySelect.options[mySelect.selectedIndex].value;
		}
		
	return formName;
}

function check_options(thisform) {

	var error_message = '';
	
	//alert("checking options for " + thisform);
	
	theForm = document.forms[thisform];
	
	for (formElementCounter = 0; formElementCounter < theForm.elements.length; formElementCounter++)
	{
		theElement = theForm.elements[formElementCounter];
		elementName = new String(theElement.name);
		elementID = new String(theElement.id);
		//alert("checking " + elementName);
		if (theElement.name.indexOf("*") == 0) { //a required attribute
			if (theElement.type == "select-one"){
				thisvalue = theElement.options[theElement.selectedIndex].value;
			} else {
				thisvalue = theElement.value;
			}
			
			//alert(elementName + "is required " + theElement.type + " value is *" +thisvalue+ "*");
			//alert (where_change);
			if ((thisvalue == '') || (thisvalue == 'null')){
				if ((elementID != '') && (elementID != 'undefined')) {
					error_message += elementID +"\n";
				} else {
					error_message += str_replace("_"," ",elementName)+"\n";
				}
				//alert(error_message);
			}
			
		}
	}
	
	if (error_message != '') {
		alert("Please select the following required options:"+"\n"+error_message);
		return false;
	} else {
		return true;
	}

}