<!-- Begin
	var clicked=false;
	function SubmitStyleOnece(){
		if (clicked ){
			alert("Please wait processing request");
			return false;
	   } else {
			clicked=true;
			return true;
		}
	}

   function CheckStyleRequiredDCP(which) {
      var pass=true; 
	 
	  if (which.ponumber.value == ""){
				alert("Please enter your name.");
				which.ponumber.focus();
				return false;
			}
			
      for (i=0;i<which.length;i++) {
		
      	var tempobj=which.elements[i];
		
		  if ( tempobj.name =="color") {
				if ( tempobj.selectedIndex==0 ) {
				 alert("Please select a color. ");
				 	tempobj.focus();
					pass=false;
					break;
				}
			}
	      if (tempobj.name =="size") {
				if ( tempobj.selectedIndex==0 ) {
				 alert("Please select a size. ");
				 	tempobj.focus();
					pass=false;
			   	break;
				}
			}
			if ( tempobj.name =="qty"){
				if ( isNaN(tempobj.value) ) {
					alert("A number value is request for a quantity "+tempobj.value+"");
					tempobj.select();
					tempobj.focus();
					pass=false;
					break;
				}
			}
		}
     
      if (!pass) {
         return false;
      }  else {
         return  SubmitStyleOnece();
	  	}
   }
      function CheckStyleRequired(which) {
      var pass=true;
      for (i=0;i<which.length;i++) {
		
      	var tempobj=which.elements[i];
		
         if ( tempobj.name =="color") {
				if ( tempobj.selectedIndex==0 ) {
				 alert("Please select a color. ");
				 	tempobj.focus();
					pass=false;
					break;
				}
			}
	      if (tempobj.name =="size") {
				if ( tempobj.selectedIndex==0 ) {
				 alert("Please select a size. ");
				 	tempobj.focus();
					pass=false;
			   	break;
				}
			}
			if (tempobj.name =="wearerinfo") {
				if ( tempobj.selectedIndex<0 ) {
					alert ("Please select a wearer.");
					tempobj.focus();
					pass=false;
					break;
				}
			}
			if ( tempobj.name =="qty"){
				if ( isNaN(tempobj.value) ) {
					alert("A number value is request for a quantity "+tempobj.value+"");
					tempobj.select();
					tempobj.focus();
					pass=false;
					break;
				}
			}
		}
     
	 
      if (!pass) {
         return false;
      }  else {
         return  SubmitStyleOnece();
	  	}
   }
   
   function CheckStyleRequiredConfig(which) {
      var pass=true;
      for (i=0;i<which.length;i++) {
		
      	var tempobj=which.elements[i];
		
         if ( tempobj.name =="color") {
				if ( tempobj.selectedIndex==0 ) {
				 alert("Please select a color. ");
				 	tempobj.focus();
					pass=false;
					break;
				}
			}
		 try{
			if(document.buy.persoption[0].checked == true){	
	      		if (tempobj.name =="size") {
					if ( tempobj.selectedIndex==0 ) {
				 	alert("Please select a size. ");
				 	tempobj.focus();
					pass=false;
			   		break;
					}
				}
			 }
		 }
		 catch(e){}
		
		if ( tempobj.name =="qty"){
			if ( isNaN(tempobj.value) ) {
					alert("A number value is request for a quantity "+tempobj.value+"");
					tempobj.select();
					tempobj.focus();
					pass=false;
					break;
			}
		}
		}
     
	 
      if (!pass) {
         return false;
      }  else {
         return  SubmitStyleOnece();
	  	}
   }
   
   function CheckStyleRequired_kci(which) {
      var pass=true;

	  
	   if (document.wgorder.emp_firstname.value.length == 0)
	{
		alert ("Please enter Employee First Name.");
		document.wgorder.emp_firstname.focus();
		return false;
	}
		 if (document.wgorder.emp_lastname.value.length == 0)
	{
		alert ("Please enter Employee Last Name.");
		document.wgorder.emp_lastname.focus();
		return false;
	}
		 if (document.wgorder.emp_id.value.length == 0)
	{
		alert ("Please enter Employee ID.");
		document.wgorder.emp_id.focus();
		return false;
	}
      for (i=0;i<which.length;i++) {
		
      	var tempobj=which.elements[i];

         if ( tempobj.name =="color") {
				if ( tempobj.selectedIndex==0 ) {
				 alert("Please select a color. ");
				 	tempobj.focus();
					pass=false;
					break;
				}
			}
	      if (tempobj.name =="size") {
				if ( tempobj.selectedIndex<=0) {
				 alert("Please select a size.");
				 	tempobj.focus();
					pass=false;
			   	break;
				}
			}
			
			
			
			if ( tempobj.name =="qty"){
				if ( isNaN(tempobj.value) ) {
					alert("A number value is request for a quantity "+tempobj.value+"");
					tempobj.select();
					tempobj.focus();
					pass=false;
					break;
				}
			}
		}
     
	 
	 
	 
      if (!pass) {
         return false;
      }  else {
         return  SubmitStyleOnece();
	  	}
   }
   
      function UpperCaseNamePin(which) {
      var pass=true;
      for (i=0;i<which.length;i++) {
		
      var tempobj=which.elements[i];
		
		// change the namepin entered to upper case
		if(document.wgorder.text11 != null){
 		document.wgorder.text11.value = document.wgorder.text11.value.toUpperCase();
 		}
		if(document.wgorder.text21 != null){
 		document.wgorder.text21.value = document.wgorder.text21.value.toUpperCase();
 		}
		if(document.wgorder.text31 != null){
 		document.wgorder.text31.value = document.wgorder.text31.value.toUpperCase();
 		}
			
         if ( tempobj.name =="color") {
				if ( tempobj.selectedIndex==0 ) {
				 alert("Please select a color. ");
				 	tempobj.focus();
					pass=false;
					break;
				}
			}
	      if (tempobj.name =="size") {
				if ( tempobj.selectedIndex==0 ) {
				 alert("Please select a size. ");
				 	tempobj.focus();
					pass=false;
			   	break;
				}
			}
			if ( tempobj.name =="qty"){
				if ( isNaN(tempobj.value) ) {
					alert("A number value is request for a quantity "+tempobj.value+"");
					tempobj.select();
					tempobj.focus();
					pass=false;
					break;
				}
			}
		}
     
      if (!pass) {
         return false;
      }  else {
         return  SubmitStyleOnece();
	  	}
   }
 function checkAirborne( )
  {
  /* this is for the Airborne site */
	if (document.paymentform.customernote.value.length < 62)
	{
		alert ("Missing Information - Manager's Name and New Hire or Annual Allowance Status are required.")
		document.paymentform.customernote.focus();
		return false;
	}
	
  }
  
 function CheckIronMountain()
 {
  /* this is for the Iron Mountain site */
  /*var newtext = document.paymentform.buyer.value;*/
  
  if (document.paymentform.ponumber.value.length < 11)
	{
		alert ("Missing Information - GL / Cost Center Number is required: ex) 12345/12345.");
		document.paymentform.ponumber.focus();
		return false;
	}

  /*if (document.paymentform.ponumber.value.length == 0)
	{
		alert ("Missing Information - Oracle number is required.");
		document.paymentform.ponumber.focus();
		return false;
	}
	else 
	{

         if (document.paymentform.buyer.value == 1)
		{
			alert ("Missing Information - You Must Select a Buyer");
			document.paymentform.buyer.focus();
			return false;
		}
		else
		{
			newtext = "/" + newtext;
			document.paymentform.ponumber.value += newtext;
        	return  SubmitStyleOnece();
		}
	}*/
}
  
  
	
 function CheckKroger()
  {
  /* this is for the Kroger site */
	if (document.paymentform.ponumber.value.length == 0)
	{
		alert ("Missing Information - Store Number is required.")
		document.paymentform.ponumber.focus();
		return false;
	}
	else {
         return  SubmitStyleOnece();
		}
  }
  
  function AirborneShipping()
  {
  /* this sets the shipmethod for Airborne orders */
  	if (document.shippingform.newemployee.checked == true)
  	{
  		shippingform.shipmethod.value=28;
  		
  	}
	
  }
  
	function checkComponent( )
  {
  /* this is for the Aramark2Aramark sites */
	if (document.paymentform.customernote.value.length < 1)
	{
		alert ("You must enter a Component Number")
		document.paymentform.customernote.focus();
		return false;
	}
  }

  

  
  function CheckHenkelsPO()
  {
  /* this is for the Henkels McCoy site */
	if (document.paymentform.ponumber.value.length == 0)
	{
		alert ("Missing Information - First and Last Name in the Purchase Order field is required.")
		document.paymentform.ponumber.focus();
		return false;
	}
	else {
         return  SubmitStyleOnece();
		}
  }
  
  function CheckWalgreenPO()
  {
  /* this is for the Walgreens Branded site */
	po1 = paymentform.ponumber1.value;
	po2 = paymentform.ponumber2.value;
	
	document.paymentform.ponumber.value = (po1 + '-' +  po2);
	if (document.paymentform.ponumber1.value.length == 0)
	{
		alert ("Missing Information - Please enter the Lawson #.")
		document.paymentform.ponumber1.focus();
		return false;
	}
	else {
		  return  SubmitStyleOnece();
		}
  }
  
  function NamePinVerification(which) {
      var pass=true;
      for (i=0;i<which.length;i++) {
		
      	var tempobj=which.elements[i];
		
		
         if ( tempobj.name =="color") {
				if ( tempobj.selectedIndex==0 ) {
				 alert("Please select a color. ");
				 	tempobj.focus();
					pass=false;
					break;
				}
			}
			
	      if (tempobj.name =="size") {
				if ( tempobj.selectedIndex==0 ) {
				 alert("Please select a size. ");
				 	tempobj.focus();
					pass=false;
			   	break;
				}
			}
			if ( tempobj.name =="qty"){
				if ( isNaN(tempobj.value) ) {
					alert("A number value is request for a quantity "+tempobj.value+"");
					tempobj.select();
					tempobj.focus();
					pass=false;
					break;
				}
			}
		}
     if(document.wgorder.text11.value.length == 0){
 		alert ("A Name is Required")
		document.wgorder.text11.focus();
		pass=false;
		
 		}
      if (!pass) {
         return false;
      }  else {
         return  SubmitStyleOnece();
	  	}
   }
   

     
function CheckAddressInfo()
{
/* this is to check that the address fields are enetered before it hits the dll */
var error=false;
var msg='Missing Information: ';
	if (document.redeemcoupon.billto_firstname.value.length == 0)
	{
		msg+="Bill-To First Name";
		error=true;
	}
	if (document.redeemcoupon.billto_lastname.value.length == 0)
	{
		if (msg.length > 21)
		{
		msg+=",  Bill-To Last Name";
		error=true;
		}
		else
		{
		msg+="Bill-To Last Name";
		error=true;
		}
	}
	if (document.redeemcoupon.billto_street.value.length == 0)
	{
		if (msg.length > 21)
		{
		msg+=",  Bill-To Street";
		error=true;
		}
		else
		{
		msg+="Bill-To Street";
		error=true;
		}
	}
	if (document.redeemcoupon.billto_city.value.length == 0)
	{
		if (msg.length > 21)
		{
		msg+=",  Bill-To City";
		error=true;
		}
		else
		{
		msg+="Bill-To City";
		error=true;
		}
	}
	if (document.redeemcoupon.billto_state.value == 'XX')
	{
		if (msg.length > 21)
		{
		msg+=",  Bill-To State";
		error=true;
		}
		else
		{
		msg+="Bill-To State";
		error=true;
		}
	}
	if (document.redeemcoupon.billto_postalcode.value.length == 0)
	{
		if (msg.length > 21)
		{
		msg+=",  Bill-To Zip Code";
		error=true;
		}
		else
		{
		msg+="Bill-To Zip Code";
		error=true;
		}
	}
	if (document.redeemcoupon.phone_areacode.value.length == 0)
	{
		if (msg.length > 21)
		{
		msg+=",  Phone Area Code";
		error=true;
		}
		else
		{
		msg+="Phone Area Code";
		error=true;
		}
	}
	if (document.redeemcoupon.phone_number_exch.value.length == 0)
	{
		if (msg.length > 21)
		{
		msg+=",  Phone Exchange";
		error=true;
		}
		else
		{
		msg+="Phone Exchange";
		error=true;
		}
	}
	if (document.redeemcoupon.phone_number_tele.value.length == 0)
	{
		if (msg.length > 21)
		{
		msg+=",  Phone Number";
		error=true;
		}
		else
		{
		msg+="Phone Number";
		error=true;
		}
	}
	if (document.redeemcoupon.email.value.length == 0)
	{
		if (msg.length > 21)
		{
		msg+=",  Email Address";
		error=true;
		}
		else
		{
		msg+="Email Address";
		error=true;
		}
	}
	if (document.redeemcoupon.shiptosame.checked == false)
	{
		if (document.redeemcoupon.shipto_firstname.value.length == 0)
		{
			if (msg.length > 21)
			{
			msg+=",  Ship-To First Name";
			error=true;
			}
			else
			{
			msg+="Ship-To First Name";
			error=true;
			}
		}
		if (document.redeemcoupon.shipto_lastname.value.length == 0)
		{
			if (msg.length > 21)
			{
			msg+=",  Ship-To Last Name";
			error=true;
			}
			else
			{
			msg+="Ship-To Last Name";
			error=true;
			}
		}
		if (document.redeemcoupon.shipto_street.value.length == 0)
		{
			if (msg.length > 21)
			{
			msg+=",  Ship-To Street";
			error=true;
			}
			else
			{
			msg+="Ship-To Street";
			error=true;
			}
		}
		if (document.redeemcoupon.shipto_city.value.length == 0)
		{
			if (msg.length > 21)
			{
			msg+=",  Ship-To City";
			error=true;
			}
			else
			{
			msg+="Ship-To City";
			error=true;
			}
		}
		if (document.redeemcoupon.shipto_state.value == 'XX')
		{
			if (msg.length > 21)
			{
			msg+=",  Ship-To State";
			error=true;
			}
			else
			{
			msg+="Ship-To State";
			error=true;
			}
		}
		if (document.redeemcoupon.shipto_postalcode.value.length == 0)
		{
			if (msg.length > 21)
			{
			msg+=",  Ship-To Zip Code";
			error=true;
			}
			else
			{
			msg+="Ship-To Zip Code";
			error=true;
			}
		}
	}
	
	if (error == true)
	{
	alert (msg);
	return false;
	}

	
}

function SameAsBill() {
	var checkBox = document.getElementById("shiptosame");
	var shipFName = document.getElementById("shipto_firstname");
	var shipLName = document.getElementById("shipto_lastname");
	var shipCompany = document.getElementById("shipto_company");
	var shipStreet = document.getElementById("shipto_street");
	var shipCity = document.getElementById("shipto_city");
	var shipState = document.getElementById("shipto_state");
	var shipZip = document.getElementById("shipto_postalcode");
	var shipPArea = document.getElementById("phone_areacode");
	var shipPExchange = document.getElementById("phone_number_exch");
	var shipPTele = document.getElementById("phone_number_tele");
	var shipPExtension = document.getElementById("phone_extension");
	
	
	if (checkBox.checked == true){
		
		shipFName.value = document.getElementById("billto_firstname").value;
		shipFName.readOnly = "readOnly";
		
		shipLName.readOnly = "readOnly";
		shipLName.value = document.getElementById("billto_lastname").value;
		
		shipCompany.readOnly = "readOnly";
		shipCompany.value = document.getElementById("billto_company").value;
		
		shipStreet.readOnly = "readOnly";
		shipStreet.value = document.getElementById("billto_street").value;
		
		shipCity.readOnly = "readOnly";
		shipCity.value = document.getElementById("billto_city").value;
		
		shipState.disabled = true;
		shipState.value = document.getElementById("billto_state").value;
		
		shipZip.readOnly = "readOnly";
		shipZip.value = document.getElementById("billto_postalcode").value;
		
		shipPArea.readOnly = "readOnly";
		shipPArea.value = document.getElementById("billto_phone_areacode").value;
		
		shipPExchange.readOnly = "readOnly";
		shipPExchange.value = document.getElementById("billto_phone_number_exch").value;
		
		
		shipPTele.readOnly = "readOnly";
		shipPTele.value = document.getElementById("billto_phone_number_tele").value;
		
		shipPExtension.readOnly = "readOnly";
		shipPExtension.value = document.getElementById("billto_phone_extension").value;
		
		
	} else {
		shipFName.value = "";
		shipFName.readOnly = false;
		
		shipLName.readOnly = false;
		shipLName.value = "";
		
		shipCompany.readOnly = false;
		shipCompany.value = "";
		
		shipStreet.readOnly = false;
		shipStreet.value = "";
		
		shipCity.readOnly = false;
		shipCity.value = "";
		
		shipState.disabled = false;
		shipState.value = "";
		
		shipZip.readOnly = false;
		shipZip.value = "";
		
		shipPArea.readOnly = false;
		shipPArea.value = "";
		
		shipPExchange.readOnly = false;
		shipPExchange.value = "";
		
		
		shipPTele.readOnly = false;
		shipPTele.value = "";
		
		shipPExtension.readOnly = false;
		shipPExtension.value = "";
	
	
	
	}
}