function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function featuresWin(url){
	var featwin = window.open(url,'fWin','width=500,height=480,toolbar=0,directories=0,menubar=1,status=0,resizable=0,location=0,scrollbars=0,copyhistory=0');
	featwin.focus();
}

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_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_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 checkPsearch(){

	if (document.pSearch.itemid.options[document.pSearch.itemid.selectedIndex].value == "na"){
	 alert("Please choose a benefit from the pulldown menu.")
	 document.pSearch.itemid.focus();
	 return false;
	}
	if (document.pSearch.zip.value == ""){
	 alert("Please enter a zip code to search.")
	 document.pSearch.zip.focus();
	 return false;
	}

}

function CheckParams() {
		// check if zipcode is 5 characters long and catch any spaces or alpha in zipcode
		if (( window.document.frmSearch.Zip.value.length  != 5 ) || (! isNum(window.document.frmSearch.Zip.value) )) {
			alert("Please enter a valid 5 digit USPS Zip Code.     ");
			window.document.frmSearch.Zip.focus();
			return false;
		}
		
		if (window.document.frmSearch.Products.value == "") {
			alert("Please select a Product to search on.   ");
			return false;
		}

		return true;
	}
	////	
	function isNum(strA) {
		var strB, num = "0123456789", x;
		for ( x = 0; x < strA.length; x++ ){
			strB = strA.substr(x,1);
			if (num.search(strB) == -1){
				return false;
			}
		}
		return true;
	}
	
function checkCart(){
	var itemChecked = 0	
	for (i=0;i<document.detailForm.priceInfo.length;i++) {
        if (document.detailForm.priceInfo[i].checked) {
           itemChecked = 1
        }
    }
	if (itemChecked==0){
		alert('Please choose items to add to your cart');
		return false;
	}
}

function checkAccountNEW(){
	var minLength=4;
	if (document.myForm.First_Name){
			if (document.myForm.First_Name.value == ""){
			 alert("Please enter your first name.")
			 document.myForm.First_Name.focus();
			 return false;
			}
		}
	if (document.myForm.Last_Name){
			if (document.myForm.Last_Name.value == ""){
			 alert("Please enter your last name.")
			 document.myForm.Last_Name.focus();
			 return false;
			}
		}
	//if (document.myForm.Email){
		//		var str=document.myForm.Email.value
		//		var filter=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
		//		if (filter.test(str)!=true){
		//		 alert("Please enter a valid email address.")
		//		 document.myForm.Email.focus();
		//		document.myForm.Email.select();	
		//		 return false;
		//		}
		//}
	if (document.myForm.Address){
			if (document.myForm.Address.value == ""){
			 alert("Please enter your address.")
			 document.myForm.Address.focus();
			 return false;
			}
		}
	if (document.myForm.City){
			if (document.myForm.City.value == ""){
			 alert("Please enter your city.")
			 document.myForm.City.focus();
			 return false;
			}
		}
	if (document.myForm.state){
			if (document.myForm.state.options[document.myForm.state.selectedIndex].value == "NAP"){
			 alert("Please choose a State from the pulldown menu.")
			 document.myForm.state.focus();
			 return false;
			}
		}
	if (document.myForm.Country){
			if (document.myForm.Country.options[document.myForm.Country.selectedIndex].value == "nap"){
			 alert("Please choose a Country from the pulldown menu.")
			 document.myForm.Country.focus();
			 return false;
			}
		}
	if (document.myForm.ZIP){
			if (document.myForm.ZIP.value == ""){
			 alert("Please enter your ZIP code.")
			 document.myForm.ZIP.focus();
			 return false;
			}
		}
	if (document.myForm.Phone){
		if (document.myForm.Phone.value == ""){
	        alert("Please enter a valid Phone Number.");
	        document.myForm.Phone.focus();
	        return false;
		}
	}
	if (document.myForm.comments){
			if (document.myForm.comments.value == ""){
			 alert("Please enter your comments.")
			 document.myForm.comments.focus();
			 return false;
			}
		}
	if (document.myForm.Username){
			if (document.myForm.Username.value.length < minLength) {
			alert("Please enter at least a 4 character Username.");
			document.myForm.Username.focus();
			document.myForm.Username.select();
			return false;
	  		}
		}
	if (document.myForm.Password){
		if (document.myForm.Password.value.length < minLength) {
			alert("Please enter at least a 4 character Password.");
			document.myForm.Password.focus();	
			document.myForm.Password.select();	
			return false;
		   }
		}
	if (document.myForm.Password){
		if (document.myForm.VerifyPassword.value == ''){
			 alert('Please re-enter your password for verification purposes.')
			 document.myForm.VerifyPassword.focus();
			 return false;
			}
		
		if (document.myForm.Password.value != document.myForm.VerifyPassword.value){
			 alert('Your entries in the Password and Verify Password fields did not match.\n\nPlease re-enter this information.')
			 document.myForm.Password.value=''
			 document.myForm.VerifyPassword.value=''
			 document.myForm.Password.focus();
			 return false;
			}
		}
		
	if(document.myForm.CreditCardNumber){
			/// cc info filled in?
		if(document.myForm.CreditCardNumber.value==""){
			alert('Please enter your credit card number number.')
			document.myForm.CreditCardNumber.focus();
			return false;
		}
		else if(document.myForm.ccv.value==""){
			alert('Please enter your credit card ID.')
			document.myForm.ccv.focus();
			return false;
		}
	}
	
}

		function jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

MM_preloadImages('images/nav/01_on.gif','images/nav/02_on.gif','images/nav/03_on.gif','images/nav/04_on.gif','images/nav/05_on.gif','images/nav/06_on.gif','images/nav/07_on.gif','images/nav/08_on.gif','images/nav/09_on.gif','images/nav/10_on.gif');

