// EPS Javascript Pages
// set css style for browser type IE/Netscape

if((navigator.appName.indexOf('Netscape')!= -1)){
document.write('<link href="../images/netscape.css" rel="styleSheet" type="text/css">');
} else {
document.write('<link href="../images/eps.css" rel="stylesheet" type="text/css">');
}

function popUp(url) {
// Network Solutions SSL Verification popup script
sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
self.name = "mainWin";
}

function quickMess(){
// Quick Message Popup Window
var h;
var w;
h = "500";
w = "400";
var wl = (screen.width - w) / 2;
var wt = (screen.height - h) / 2;
window.open( "popMail.php", "quickmessage", "scrollbars=no,toolbar=no,resizable=no,height="+h+",width="+w+",top="+wt+",left="+wl+"");
}
//-----------
function cvv2(){
// Quick Message Popup Window
var h;
var w;
h = "350";
w = "500";
var wl = (screen.width - w) / 2;
var wt = (screen.height - h) / 2;
window.open( "csc.htm", "cvv2help", "scrollbars=no,toolbar=no,resizable=no,height="+h+",width="+w+",top="+wt+",left="+wl+"");
}
//-----------

//Below is form validation functions:
//-----------
// Code to copy fields:
function copy_info(){
window.document.ccform.ship_name.value = window.document.ccform.CardHolderName.value;
window.document.ccform.ship_address1.value = window.document.ccform.AddressLine1.value;
window.document.ccform.ship_address2.value = window.document.ccform.AddressLine2.value;
window.document.ccform.ship_city.value = window.document.ccform.bill_city.value;
window.document.ccform.ship_state.value = window.document.ccform.bill_state.value;
window.document.ccform.ship_aptHouse.value = window.document.ccform.AptHouseNbr.value;
window.document.ccform.ship_zipCode.value = window.document.ccform.ZipCode.value;
window.document.ccform.ship_country.value = window.document.ccform.bill_country.value;
window.document.ccform.ship_email.value = window.document.ccform.bill_email.value;


}// end copy function
//-----------
// General Validation

function chkform(){
var req = "";

if(window.document.ccform.CardNumber.value == "" ){
req += "Please Enter A valid Credit Card Number.\n";
}
if(window.document.ccform.month.value == "" || window.document.ccform.month.value == "00" ){
req += "Please Enter The Expiration Month. \n";
}
if(window.document.ccform.year.value == "" || window.document.ccform.year.value == "00" ){
req += "Please Enter the Expiration Year.\n";
}
if(window.document.ccform.CVV2Code.value == ""){
req += "Please Enter The CVV2 Code located on the Back of the Credit Card.\n";
}
if(window.document.ccform.CardHolderName.value == ""){
req += "Please Enter the Card Holder Name.\n";
}
if(window.document.ccform.AddressLine1.value == ""){
req += "Please Eneter The Billing Address.\n";
}
if(window.document.ccform.bill_city.value == ""){
req += "Please Enter The Billing City.\n";
}
if(window.document.ccform.bill_state.value == ""){
req += "Please Enter The Billing State.\n";
}
if(window.document.ccform.ZipCode.value == ""){
req += "Please Enter The Billing Zip Code.\n";
}
if(window.document.ccform.bill_country.value == ""){
req += "Please Enter The Billing Country.\n";
}

	if(window.document.ccform.connectionType.value == "sc"){
		if(window.document.ccform.noShipping.value == "Yes"){
			
			if(window.document.ccform.shipService.value == ""){
			req += "Please Choose a Shipping Method.\n";
			}	
		}
	}

	
if(window.document.ccform.reqphone.value == "Yes"){
	if(window.document.ccform.bill_phone.value == ""){	
		req += "Please Enter Your Telephone Number.\n";
	}
}
	
if(window.document.ccform.reqemail.value == "Yes"){
	if(window.document.ccform.bill_email.value == ""){	
		req += "Please Enter Your E-Mail address.\n";
	}
}

if (req != "") {
	alert(req);
		return false;
	}else{
		return true;
	}
}