
// determine which browser
var isIE4 = false; // Microsoft Internet Explorer
var isNS4 = false; // Netscape 4+
var isW3C = false; // W3C compliant (inc NS6)
var isUnknown = true; // in case something else comes along

	if (document.getElementById) {
	isW3C = true ;	// NS6, MSIE 5+, Mozilla, Opera 6 in Opera (W3C) mode
	isUnknown = false;
	}
	if (isW3C != true && document.all) {
	isIE4 = true ;	// MSIE (all versions) and Opera 6 in MSIE 5 mode
	isUnknown = false;
	}
	if (document.layers) {
	isNS4 = true ;	// NS 4
	isUnknown = false;
	}
//I don't use this but it's here if I want to.
//if(isUnknown == true) { location.href = "http://www.stormshutters.com/shop_cart/alternate_pricing.php" }

var win=null;
function popup(mypage,myname,w,h,scroll,pos)
{
	if(pos=="random")
	{
	LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
	TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	}
	if(pos=="center")
	{
	LeftPosition=(screen.width)?(screen.width-w)/2:100;
	TopPosition=(screen.height)?(screen.height-h)/2:100;
	}
	else if((pos!="center" && pos!="random") || pos==null)
	{
	LeftPosition=0;TopPosition=20
	}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes'; 
win=window.open(mypage,myname,settings);
win.focus() ;
} 

function checkOut()
{
	theForm = document.form1 ;	
	var pass = true ;
	var name = theForm.required_name.value ;
	var addr_1 = theForm.required_addr_1.value ;
	var city = theForm.required_city.value ;
	var state = theForm.required_state.value ;
	var zip = theForm.required_zip.value ;
	var phone = theForm.required_phone.value ;
	var email = theForm.required_email.value ;

	if (name == "") { alert("Please enter your name.") ; return false ; }
	if (addr_1 == "") { alert("Please enter your street address.") ; return false ; }
	if (city == "") { alert("Please enter your city.") ; return false ; }
	if (state == "") { alert("Please your state or select International.") ; return false ; }
	if (zip == "") { alert("Please enter your zipcode.") ; return false ; }
	if (phone == "") { alert("Please enter your phone.") ; return false ; }
	if (email == "") { alert("Please enter your email so\nwe can confirm your order.") ; return false ; }

	var ccName = theForm.cc_name.value ;
	var ccType = theForm.cc_type.options[theForm.cc_type.selectedIndex].value ; 
	var ccNumber = theForm.cc_number.value ;
	var expMonth = theForm.exp_month.options[theForm.exp_month.selectedIndex].value ;
	var expYear = theForm.exp_year.options[theForm.exp_year.selectedIndex].value ;

	if (ccType == "") 
	{
		alert("Please select a payment method.") ; pass = false ;
	}
		else
		{
			if (ccType == "check") { pass = true ; }
				else 
				{
					if (ccName == "") { alert("Please enter the name on the credit card.") ; return false ; }
					if (ccNumber == "") { alert("Please enter your credit card number.") ; return false ; }
					if (expMonth == "") { alert("Please enter the expiration month.") ; return false ; }
					if (expYear == "") { alert("Please enter the expiration year.") ; return false ; }
				}				 
		}

		if (pass == false) { return false ; } else {  return true ; }

}

function setImageUrl(pic,url)
{
	eval("document." + pic + ".src = url")
}


