// JavaScript Document
//Our old friend the MacroMedia Jump Menu!
function MM_jumpMenu(targ,selObj,restore){ 
//v3.0  
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");  
if (restore) selObj.selectedIndex=0;
}

//Our form checking script from address realtime.asp
function validateMe(form) {

	var first_name = form.x_first_name.value;
	if (!first_name) {
		alert("Sorry, first name is a required field.");
    	return false;
	}
	
	var last_name = form.x_last_name.value;
	if (!last_name) {
		alert("Sorry, last name is a required field.");
    	return false;
	}

	var billing_address = form.Billing_Address.value;
	if (!billing_address) {
		alert("Sorry, billing address is a required field.");
    	return false;
	}

	var billing_city = form.Billing_City.value;
	if (!billing_city) {
		alert("Sorry, billing city is a required field.");
    	return false;
	}

	var billing_state = document.Hyper_Form.Billing_State[document.Hyper_Form.Billing_State.selectedIndex].value;
	if (!billing_state) {
		alert("Sorry, billing state is a required field.");
    	return false;
	}

	var billing_zip = form.Billing_Zip.value;
	if (!billing_zip) {
		alert("Sorry, billing zip code is a required field.");
    	return false;
	}
	
	var billing_country = document.Hyper_Form.Billing_Country[document.Hyper_Form.Billing_Country.selectedIndex].value;
	if (!billing_country) {
		alert("Sorry, billing country is a required field.");
    	return false;
	}	

	var phone = form.Phone.value;
	if (!phone) {
		alert("Sorry, phone number is a required field.");
    	return false;
	}

	var email = form.Email.value;
	if (!email) {
		alert("Sorry, email address is a required field.");
    	return false;
	}

	var EmailOk  = true;
	var Temp     = document.Hyper_Form.Email;
	var AtSym    = Temp.value.indexOf('@');
	var Period   = Temp.value.lastIndexOf('.');
	var Space    = Temp.value.indexOf(' ');
	var Length   = Temp.value.length - 1;   // Array is from 0 to length-1
	
	if ((AtSym < 1) ||                     // '@' cannot be in first position
		(Period <= AtSym+1) ||             // Must be atleast one valid char btwn '@' and '.'
		(Period == Length ) ||             // Must be atleast one valid char after '.'
		(Space  != -1))                    // No empty spaces permitted
	   {  
		  EmailOk = false;
		  alert('Please enter a valid e-mail address!');
		  Temp.focus();
	   }
	return EmailOk;

}

function validateBilling(form) {

	var cc_type = document.ccinfo.Card_Type[document.ccinfo.Card_Type.selectedIndex].value
	if (!cc_type) {
		alert("Sorry, you must specify a card type for credit card transactions.");
    	return false;
	}
	
	var card_number = form.x_card_num.value;
	if (!card_number) {
		alert("Sorry, a card number is required for credit card transactions.");
    	return false;
	}

	var exp_date = form.x_exp_date.value;
	if (!exp_date) {
		alert("Sorry, an expiration date is required for credit card transactions.");
    	return false;
	}
	/*var card_code = form.x_card_code.value;
	if (!card_code) {
		alert("Sorry, to protect you, we're now requiring a card code for credit card transactions.\nSee the 'What's this?' link for information about why we want this and where it's located on your card.");
    	return false;
	}*/

}

<!-- 
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function pop_coupons(){
	window.open("http://www.wwwenterprise2.com/siteincludes/dailycoupon_popup.asp","daily_coupons","scrollbars,resizable,width=385,height=425")
}
//-->



