function validateForm(OrderForm){
	
	if(""==document.OrderForm.shipto_firstname.value){
		alert("Please enter your first name.");
		document.OrderForm.shipto_firstname.focus();
		return false;
	}
	
	if(""==document.OrderForm.shipto_lastname.value){
		alert("Please enter your last name.");
		document.OrderForm.shipto_lastname.focus();
		return false;
	}
	
	if(""==document.OrderForm.email.value){
		alert("Please enter your email address.");
		document.OrderForm.email.focus();
		return false;
	}
		
	

	var str = new String(document.OrderForm.email.value);
	var isOK = true;
	rExp = /[!\"£$%\^&*()-+=<>,\'#?\\|¬`\/\[\]]/
	if( rExp.test(str) )
	isOK = false;
	if( str.indexOf('.') == -1 || str.indexOf('@') == -1 )
	isOK = false;
	if( str.slice(str.lastIndexOf('.')+1,str.length).length < 2 )
	isOK = false;
	if( str.slice(0,str.indexOf('@')).length < 1 )
	isOK = false;
	if( str.slice(str.indexOf('@')+1,str.lastIndexOf('.')).length < 1 )
	isOK = false;
	
	if( !isOK ){
	alert( "Invalid email address" );
	return false;
	}
	
	
	
	
	
	
	if(""==document.OrderForm.phone.value){
		alert("Please enter your phone number.");
		document.OrderForm.phone.focus();
		return false;
	}
		
	if (document.OrderForm.phone.value.length < 10){ 
	  alert('Please enter a 10 digit phone phone number.');
	  document.OrderForm.phone.focus();
	  return false;
	 }	
	 
	if(""==document.OrderForm.shipto_address1.value){
		alert("Please enter your shipping address.");
		document.OrderForm.shipto_address1.focus();
		return false;
	}
	
	if(""==document.OrderForm.shipto_state.value){
		alert("Please select your shipping state.");
		document.OrderForm.shipto_state.focus();
		return false;
	}
	
	if(""==document.OrderForm.shipto_city.value){
		alert("Please enter your shipping city.");
		document.OrderForm.shipto_city.focus();
		return false;
	}
	
	if(""==document.OrderForm.shipto_zip.value){
		alert("Please enter your shipping zip code.");
		document.OrderForm.shipto_zip.focus();
		return false;
	}
	
	if (isNaN(document.OrderForm.shipto_zip.value)) { 
	  alert('Please enter only numbers for your shipping zip code') 
	  document.OrderForm.shipto_zip.focus();
	  return false;
	}
	
	if (document.OrderForm.shipto_zip.value.length < 5){ 
	  alert('Please enter a valid zip code.');
	  document.OrderForm.shipto_zip.focus();
	  return false;
	 }
	 
	if(!document.OrderForm.billsame.checked){

		if(""==document.OrderForm.billto_firstname.value){
			alert("Please enter your billing first name.");
			document.OrderForm.billto_firstname.focus();
			return false;
		}
		
		if(""==document.OrderForm.billto_lastname.value){
			alert("Please enter your billing last name.");
			document.OrderForm.billto_lastname.focus();
			return false;
		}
		
		if(""==document.OrderForm.billto_address1.value){
			alert("Please enter your billing address.");
			document.OrderForm.billto_address1.focus();
			return false;
		}
		
		if(""==document.OrderForm.billto_state.value){
			alert("Please enter your billing state.");
			document.OrderForm.billto_state.focus();
			return false;
		}
		
		if(""==document.OrderForm.billto_city.value){
			alert("Please enter your billing city.");
			document.OrderForm.billto_city.focus();
			return false;
		}
		
		if(""==document.OrderForm.billto_zip.value){
			alert("Please enter your billing zip.");
			document.OrderForm.billto_zip.focus();
			return false;
		}
		
		if (document.OrderForm.billto_zip.value.length < 5){ 
			alert('Please enter a valid zip code.');
			document.OrderForm.billto_zip.focus();
			return false;
		}
		
		if("1"==document.OrderForm.CardType.value){
			alert("Please choose a credit card type.");
			document.OrderForm.CardType.focus();
			return false;
		}

	}
	

	var expired = false;
	var month = document.OrderForm.ExpMon.value;
	var year = '20'+document.OrderForm.ExpYear.value;

	var now = new Date();
	var nowMonth = now.getMonth() + 1;
	var nowYear = now.getFullYear();
	
	if (nowYear > year || (nowYear == year ) && (nowMonth > month)){
		alert('The date for has expired.');
		document.OrderForm.ExpYear.focus();
		return false;
	}
	
//////// CHECK EXP DATE  ///////////
var ccNumb = document.OrderForm.CardNumber.value;
var valid = "0123456789"
var len = ccNumb.length;
var iCCN = parseInt(ccNumb);
var sCCN = ccNumb.toString();
sCCN = sCCN.replace (/^s+|s+$/g,'');
var iTotal = 0;
var bNum = true;
var bResult = false;
var temp;
var calc;


// Determine if the ccNumb is in fact all numbers
for (var j=0; j<len; j++) {
  temp = "" + sCCN.substring(j, j+1);
  if (valid.indexOf(temp) == "-1"){bNum = false;}
}

// if it is NOT a number, you can either alert to the fact, or just pass a failure
if(!bNum){
  //alert("Not a Number");
  bResult = false;
}

// Determine if it is the proper length 
if((len == 0)&&(bResult)){  // nothing, field is blank AND passed above # check
  bResult = false;
} else{  // ccNumb is a number and the proper length - let's see if it is a valid card number
  if(len >= 15){  // 15 or 16 for Amex or V/MC
    for(var i=len;i>0;i--){  // LOOP throught the digits of the card
      calc = parseInt(iCCN) % 10;  // right most digit
      calc = parseInt(calc);  // assure it is an integer
      iTotal += calc;  // running total of the card number as we loop - Do Nothing to first digit
      i--;  // decrement the count - move to the next digit in the card
      iCCN = iCCN / 10;                              // subtracts right most digit from ccNumb
      calc = parseInt(iCCN) % 10 ;    // NEXT right most digit
      calc = calc *2;                                 // multiply the digit by two
      // Instead of some screwy method of converting 16 to a string and then parsing 1 and 6 and then adding them to make 7,
      // I use a simple switch statement to change the value of calc2 to 7 if 16 is the multiple.
      switch(calc){
        case 10: calc = 1; break;       //5*2=10 & 1+0 = 1
        case 12: calc = 3; break;       //6*2=12 & 1+2 = 3
        case 14: calc = 5; break;       //7*2=14 & 1+4 = 5
        case 16: calc = 7; break;       //8*2=16 & 1+6 = 7
        case 18: calc = 9; break;       //9*2=18 & 1+8 = 9
        default: calc = calc;           //4*2= 8 &   8 = 8  -same for all lower numbers
      }                                               
    iCCN = iCCN / 10;  // subtracts right most digit from ccNum
    iTotal += calc;  // running total of the card number as we loop
  }  // END OF LOOP
  if ((iTotal%10)==0){  // check to see if the sum Mod 10 is zero
    bResult = true;  // This IS (or could be) a valid credit card number.
  } else {
    bResult = false;  // This could NOT be a valid credit card number
    }
  }
}

if(!bResult){
  alert("Please enter a valid Credit Card Number.");
}
  return bResult;

}




function validateSignup(signup){
	
	if(""==document.signup.downemail.value){
		alert("Please enter your email address.");
		document.signup.downemail.focus();
		return false;
	}

	var str = new String(document.signup.downemail.value);
	var isOK = true;
	rExp = /[!\"£$%\^&*()-+=<>,\'#?\\|¬`\/\[\]]/
	if( rExp.test(str) )
	isOK = false;
	if( str.indexOf('.') == -1 || str.indexOf('@') == -1 )
	isOK = false;
	if( str.slice(str.lastIndexOf('.')+1,str.length).length < 2 )
	isOK = false;
	if( str.slice(0,str.indexOf('@')).length < 1 )
	isOK = false;
	if( str.slice(str.indexOf('@')+1,str.lastIndexOf('.')).length < 1 )
	isOK = false;
	
	if( !isOK ){
	alert( "Invalid email address" );
	return false;
	}
	
	if( isOK ){
		signupslider2();
	}
}

