<!-- //
function no_right_click() 
{
var CDate = new Date();
 if (event.button==2) 
  {
  alert('Copyright ' + CDate.getFullYear() + ' Concrete Countertop Specialties. All rights reserved.');
  }
}
//-->
<!-- //
// begin check form

function IsFormValid(){
var IsFormValid = false;
if (document.form.FirstName.value!=="" && 
	document.form.LastName.value!=="" && 
	document.form.Address.value!=="" && 
	document.form.City.value!=="" && 
	document.form.State.value!=="" && 
	document.form.Zip.value!=="" && 
	document.form.Phone.value!=="" && 
	document.form.UserName.value!=="" && 
	document.form.pswd.value!=="" && 
	document.form.pswd2.value!=="" && 
	document.form.pswd.value==document.form.pswd2.value
	)
{
IsFormValid = true;
}
if (IsFormValid==false) DisplayErrors();
return IsFormValid;
} // end IsFormValid function

function DisplayErrors(){
if (document.form.FirstName.value=="") {
	 alert("Please enter your first name")
	 document.form.FirstName.focus();
	 }
else if (document.form.LastName.value=="") {
	alert("Please be sure to enter your last name")
	 document.form.LastName.focus();
	 }
else if (document.form.Address.value=="") {
	alert("Please be sure to enter your address")
	 document.form.Address.focus();
	 }
else if (document.form.City.value=="") {
	 alert("Please enter your city")
	 document.form.City.focus();
	 }
else if (document.form.State.value=="") {
	alert("Please be sure to enter your state")
	 document.form.State.focus();
	 }
else if (document.form.Zip.value=="") {
	alert("Please be sure to enter your postal code")
	 document.form.Zip.focus();
	 }
else if (document.form.Phone.value=="") {
	alert("Please be sure to enter your phone number")
	 document.form.Phone.focus();
	 }
else if (document.form.UserName.value=="") {
	alert("Please be sure to enter your email address")
	 document.form.UserName.focus();
	 }
else if (document.form.pswd.value=="") {
	alert("Please be sure to enter your password")
	 document.form.pswd.focus();
	 }
else if (document.form.pswd2.value=="") {
	alert("Please be sure to validate your password")
	 document.form.pswd2.focus();
	 }
else if (document.form.pswd.value!==document.form.pswd2.value) {
	alert("Your passwords do not match")
	 document.form.pswd.focus();
	 }
} // end DisplayErrors() function;

// end check form
// -->
<!-- // Credit Card Form validator (checkout.cfm)
   function DisableButton(b)
   {
	var textObj = document.theform.cardnum;
	/*
	*  This function validates a credit card entry.
	*  If the checksum is ok, the function returns true.
	*/
	var ccNum
	var odd = 1
	var even = 2
	var calcCard = 0
	var calcs = 0
	var ccNum2 = ""
	var aChar = ''
	var cc
	var r
	
	ccNum = textObj.value
	for(var i = 0; i != ccNum.length; i++) {
		aChar = ccNum.substring(i,i+1)
		if(aChar == '-') {
			continue
		}
		ccNum2 = ccNum2 + aChar
	}
	
	cc = parseInt(ccNum2)
	
	if(cc == 0) {
		return false
	}
	
	r = ccNum.length / 2
	if(ccNum.length - (parseInt(r)*2) == 0) {
		odd = 2
		even = 1
	}
	
	for(var x = ccNum.length - 1; x > 0; x--) {
		r = x / 2
		if(r < 1) {
			r++
		}
		if(x - (parseInt(r) * 2) != 0) {
			calcs = (parseInt(ccNum.charAt(x - 1))) * odd
		}else {
			calcs = (parseInt(ccNum.charAt(x - 1))) * even
		}
		if(calcs >= 10) {
			calcs = calcs - 10 + 1
		}
		calcCard = calcCard + calcs
	}
	
	calcs = 10 - (calcCard % 10)
	if(calcs == 10) {
	calcs = 0
	}
	
	if(calcs == (parseInt(ccNum.charAt(ccNum.length - 1)))) {
		if (document.theform.cardtype.value=="") {
		   alert("210:  Please select your credit card type");
		   document.theform.cardtype.focus();
		   return false;
		   }
		else if (document.theform.cardexp.value=="") {
		   alert("220:  Please enter your card expiration date");
		   document.theform.cardexp.focus();
		   return false;
		   }
		else if (document.theform.cvv.value=="") {
		   alert("230:  Please enter your card validation code");
		   document.theform.cvv.focus();
		   return false;
		   }
		else if (document.theform.tnc.checked==false) {
		   alert("240:  You must agree to the terms and conditions");
		   document.theform.tnc.focus();
		   return false;
		   }
		else
			{
			var is_protocol_ok=document.theform.cardexp.value.indexOf('/');
			if (is_protocol_ok==-1)
			 { 
			  alert("310:  Your card expiration date is improperly formated" + '\n' + "The correct format is mm/yy.  Example: 05/09");
		      document.theform.cardexp.focus();
		      return false;
			 }
			else if (document.theform.cardexp.value.length != 5) {
			  alert("320:  Your card expiration date is improperly formated" + '\n' + "The correct format is mm/yy.  Example: 05/09");
		      document.theform.cardexp.focus();
		      return false;
			 }
			else
			 { 
			 	b.disabled = true;
      			b.value = 'Submitting';
      			b.form.submit();
		   		return true;
			 }
			}
	}else {
		alert ("100:  Invalid Credit Card Number");
		return false;
	}
}
// End Credit Card Form validator
//-->