//jmc
// Global Variables
ie4 = ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ));

//Had to copy cookie functions to root for cookies 
//to work with both cold fusion and javascript

// Selects all text in textField
function selectAll(myTextField){
	myTextField.focus();
	myTextField.select();
}




function toggle( targetId ){
	myLayer=document.getElementById(targetId);
	myStyle=myLayer.style||myLayer;
	if(myStyle.visibility=='visible'){
		myStyle.visibility='hidden';myStyle.display='none';
	}
	else	{
		myStyle.visibility='visible';myStyle.display='block';
	}
}

// Submit main model form
function submitModelForm(myObj,myPage) {
	myModel = (myObj[myObj.selectedIndex].value);
	if(myModel == -1) {
		alert("Please select a model");
		myObj.focus();		
	}
	else {
		window.location.href=("index.cfm?curPage=" + myPage + "&model=" + myModel);	
	}
}

// Submit docNum search form
function submitDocNumSearchForm(myObj,myPage) {
	myDocNum = (myObj.value);
	alert("index.cfm?curPage=" + myPage + "&t=_prodDoc&f=docNum&v=" + myDocNum);
	window.location.href=("<cfoutput>#relRootPath#</cfoutput>index.cfm?curPage=" + myPage + "&t=_prodDoc&f=docNum&v=" + myDocNum);
}

function formSubmit(myForm) {
	document.myForm.submit();
}

// Checks if myFormField is a number and if so, submits myForm
function checkIfNum(myFormField, myForm){
	if (isNaN(myFormField.value)){
		alert('Please enter a numeric value.');
		selectAll(myFormField);
	}
	else {
		myForm.submit();
	}
}