//Open win and resize -- all pages
function resizeWin(newLoc, newHeight, newWidth) {
	newWin1 = open("",newLoc,"scrollbars=yes,resizable=yes,height=" + newHeight + ",width=" + newWidth)
	if (newWin1 != null && window.focus != null) {
		newWin1.focus()
	}
}

//Open win and resize -- all pages
function resizeWin2(URL, newLoc, newHeight, newWidth) {
	newWin1 = open(URL,newLoc,"scrollbars=yes,resizable=yes,height=" + newHeight + ",width=" + newWidth)
	if (newWin1 != null && window.focus != null) {
		newWin1.focus()
	}
}

//Preload images on header page 
function MSFPpreload(img) {
  	var a=new Image();
  	a.src=img;
  	return a; 
}

//Check User screen size
function setValues()
{
	document.log.scrwidth.value = screen.width;
	document.log.scrheight.value = screen.height;
	document.log.userid.focus();
}

//Validate Contractor number
function validateForm(theForm) {
	if (theForm.license.value == "") {
		alert("You must provide your contractor license number.");
		theForm.license.focus();
		return (false);
	}
	return (true);
}

//Center Window
function CenterWindow(){
	window.moveTo(0,0)
	window.resizeTo(screen.width,screen.height)
}

//Show Other Options -- Cart Summary
function ShowOtherOptions(e) {

	var ns6 = (!document.all && document.getElementById);
	var ie4 = (document.all);
	
	
	if ( ie4 )
	{
		if (document.all['otheroptions'].style.visibility == 'visible'){
			document.all['otheroptions'].style.visibility = 'hidden';
			e.innerHTML = "More Download Options ..."
			document.all['mefirst'].checked = true;
		}
		else
		{
			document.all['otheroptions'].style.visibility = 'visible';
			e.innerHTML = "Hide Download Options ..."		
		}
	}
		
	//if ( ns6 ) document.getElementById('otheroptions').style.visibility = 'visible';

	if ( ns6 )
	{
		if (document.getElementById('otheroptions').style.visibility == 'visible'){
			document.getElementById('otheroptions').style.visibility = 'hidden';
			e.innerHTML = "More Download Options ..."
			document.getElementById('mefirst').checked = true;
		}
		else
		{
			document.getElementById('otheroptions').style.visibility = 'visible';
			e.innerHTML = "Hide Download Options ..."		
		}
	}
	
}		

//IS Checked
function isChecked(){

	if (!document.form1.C1.checked)
	{
		return (true);
	}
	else
	{
		return (false);
	}
		
}	

function open_win(e){

window.open(e, 'newwindow', config='height=500, width=700, toolbar=no, menubar=no, scrollbars=no, resizable=yes, location=no, directories=no, status=no');

}

