
function isEmpty(inputStr){
	if ( inputStr == null || inputStr == "" ) {
   	return true
}
else {
 		return false  
}
}  
function QtyChanged(idx,btn) {
	  with (document.Form1) {
     if (btn == '1') {
       if (qty[(idx)].selectedIndex == '0') { 
	       qty[(idx)].selectedIndex = 1 
	   }else{
	      if (pack[(idx)].checked == false) { qty[(idx)].selectedIndex = '0' }
	   }	      
	 }else if(btn == '2') {
	   if (qty[idx].selectedIndex != '0') {
	     if (pack[(idx)].checked == false) { pack[(idx)].checked = true}
	   }else{
	     pack[(idx)].checked = false
	   }
     }
  }  // end with
}

function ValidEmail(Str)
{
	var invalid = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
	var valid = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;

	return (!invalid.test(Str) && valid.test(Str))
}


function openpanel(theURL,winName,features) 
{
	window.open(theURL,winName,features);
}

function cancel() {
    if (confirm("Are you sure you wish to cancel your order?")){
		  window.location = "index.asp"
    }
}

function ZipCodeLookup(){

	//if (document.Form1.ZipCode && document.Form1.ZipCode.value == '') return;

	// Check to see if record has city & state fill in, if so then skip lookup
	//if (document.Form1.City.value != "" || document.Form1.State.value != "") return true;
		
	// // Create Query String Params used by the ZipCodeLookUp.asp page
	if (document.Form1.LeadZip) var querystr = "?" + "idbszip=" + document.Form1.LeadZip.value;
	
	// Process ZipCode lookup
	if (window.showModalDialog) {	
		retval = showModalDialog("ZipCodeLookUp.asp" + querystr,"","dialogWidth:20;dialogHeight:10;center:1;status=0");
	} else {
		winModalWindow = window.open ("ZipCodeLookUp.asp" + querystr,"","dependent=yes,width=20,height=10")
	}

	// Fill in form fields with returned values IE
	if (navigator.appName == 'Netscape') {
	}
	else{
		if(retval[1] != ''){
			if(document.Form1.LeadCity) 	document.Form1.LeadCity.value = retval[1];
			if(document.Form1.LeadState) 	document.Form1.LeadState.value = retval[2];
			if(document.Form1.LeadCountry) document.Form1.LeadCountry.value = 'United States';
		}
	}
	
}


function IsNum(ValueIn) {
   ValidFlag = true
//   if (ValueIn == "") {
//      ValidFlag = false
//   }
   for (i=0; i<ValueIn.length; i++) {
      if (ValueIn.charAt(i) < "0") {
          ValidFlag = false
      }
      if (ValueIn.charAt(i) > "9") {
          ValidFlag = false
      }
   }
   if (ValidFlag != true) {
      alert('Please enter a numeric value.')
   }
   return ValidFlag
}

