// JavaScript Documentfunction validate_namebox(){//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/* First and Last names must be filled out using only alph numeric   However if only e-mail is filled in then names will be ignored for now   so the dB can be checked to see if customer exists so we can pre-fill   the information in the form for them.*///++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++if(document.getElementById("ccname-f-name").value !="" && document.getElementById("ccname-l-name").value !=""){		var helperMsg = "Please complete your name using only letters in your name. You may use Roman Numerals (ie. IV or III)";		var fName = document.getElementById("ccname-f-name");		var isValid = isAlphabet(fName, helperMsg);		if(isValid){			var lName = document.getElementById("ccname-l-name");			var isValid = isAlphabet(lName, helperMsg);		}}else{		if(!document.getElementById("ccemail").value){ 		alert("Please complete your name or enter your e-mail if you have purchased here befor.");		}//if e-mail NOT has been entered	}//else	if(document.getElementById("ccemail").value){// if e-mail HAS been entered		var elem = document.getElementById("ccemail");		var helperMsg = "E-mail not valid. Please try again.";		var isValid = emailValidator(elem, helperMsg);		// validate it.	}	return isValid;// return false}//validate_namebox()/*function vldt_ccnamebox(){	if(document.getElementById("ccname_first_n")){		var fName = document.getElementById("ccname_first_n").value;		var vldtFirstNameToggle = "on";	}	if(document.getElementById("ccname_last_n")){		var lName = document.getElementById("ccname_last_n").value;		var vldtLastNameToggle = "on";	}	if(document.getElementById("ccemail")){		var eMail = document.getElementById("ccemail").value;			var vldtEmailToggle = "on";	}		if(document.getElementById("ccname_first_n")){		if(fName== "" || fName.length < 2) 			{ 			alert( "Please Complete Your First Name" );			return; 			}		}	if(document.getElementById("ccname_last_n")){		if( lName== "" )  			{ 			alert( "Please Complete Your Last Name" );			if( lName.length < 3 ) 				{ 				alert( "Last Name must have at least 3 letters in it." );				return; 				}			return; 			}		}	if(document.getElementById("ccemail")){			if( eMail == ("put your e-mail here" || "" )) 			{ 			alert( "Please include your e-mail address so we can send you a reciept" );			return; 			}		}	else{ 			eMailcheck(eMail);			//ccprocess();		}				}//function  vldt_ccnamebox()*/function vldt_ccBillingBox(){	if(document.getElementById("billAddress_ln_1")){		var billAddress_ln_1 = document.getElementById("billAddress_ln_1").value;		var vldtAdress1Toggle = "on";	}	if(document.getElementById("billAddress_ln_2")){		var billAddress_ln_2 = document.getElementById("billAddress_ln_2").value;		var vldtAdress2Toggle = "on";	}	if(document.getElementById("billCity")){		var billCity = document.getElementById("billCity").value;			var vldtbillCityToggle = "on";	}	if(document.getElementById("billState")){		var billState = document.getElementById("billState").value;			var vldtbillStateToggle = "on";	}	if(document.getElementById("postCode")){		var postCode = document.getElementById("postCode").value;			var vldtPostCodeToggle = "on";	}		if(document.getElementById("billAddress_ln_1")){		if(billAddress_ln_1 == "" || billAddress_ln_1.length < 4) 			{ 			alert( "Please Complete Your Street Adress" );			return; 			}		}	if(document.getElementById("billCity")){		if(billCity == "" || billCity.length < 3) 			{ 			alert( "Please Enter A City Name" );			return; 			}		}	if(document.getElementById("billState")){		if(billState == "" || billState.length < 2) 			{ 			alert( "Please Enter A State or Province" );			return; 			}		}		if(document.getElementById("postCode")){		if(postCode == "" || postCode.length < 5) 			{ 			alert( "Please Enter A Valid Postal Code with a least 5 numbers" );			return; 			}		}}//function vldt_ccBillingBox()function eMailcheck(str) {		var at="@";		var dot=".";		var lat=str.indexOf(at);		var lstr=str.length;		var ldot=str.indexOf(dot);		if (str.indexOf(at)==-1){		   alert("Invalid E-mail ID");		   return false;		}		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){		   alert("Invalid E-mail ID");		   return false;		}		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){		    alert("Invalid E-mail ID");		    return false;		}		 if (str.indexOf(at,(lat+1))!=-1){		    alert("Invalid E-mail ID");		    return false;		 }		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){		    alert("Invalid E-mail ID");		    return false;		 }		 if (str.indexOf(dot,(lat+2))==-1){		    alert("Invalid E-mail ID");		    return false;		 }				 if (str.indexOf(" ")!=-1){		    alert("Invalid E-mail ID");		    return false;		 } 		 return true;						}//function eMailcheck(str)	/*		function ccprocess(){  var custInfo = [];  //var ccBoxShell = document.getElementById("cc_box_shell");  //var ccNameBox = document.getElementById("cc_namebox");  var ccNameFirst = document.getElementById("ccname_first_n");  var ccNameLast = document.getElementById("ccname_last_n");  var ccEmail = document.getElementById("ccemail");  custInfo[0] = ccNameFirst.value; alert(custInfo[0]);  custInfo[1] = ccNameLast.value ; alert(custInfo[1]);  custInfo[2] = ccEmail.value    ; alert(custInfo[2]);  //-------  var postVars		=	"pklcc="+custInfo;  var targetDiv		=	"name-shell";  var processFile 	=	"/__shared/_pkl_cart/ccProcess.php";  //-------    useAjax_cc01(postVars,targetDiv,processFile);   // ccBoxShell.style.display = "block";}//function startCheckout()function useAjax_cc01(postVars,targetDiv,processFile) {// create an ajax function to go get the products in this cat and display them in the main page  var XMLHttpRequestObject = false;  if (window.XMLHttpRequest) {	XMLHttpRequestObject = new XMLHttpRequest();  } else if (window.ActiveXObject) {	XMLHttpRequestObject = new 	ActiveXObject("Microsoft.XMLHTTP");  }  if(XMLHttpRequestObject)   {	XMLHttpRequestObject.open("POST", processFile);     XMLHttpRequestObject.setRequestHeader('Content-Type',             'application/x-www-form-urlencoded');  	XMLHttpRequestObject.onreadystatechange = 		function() 				{ 								if (XMLHttpRequestObject.readyState == 4 && 						XMLHttpRequestObject.status == 200) 						{ 						document.getElementById(targetDiv).innerHTML =						XMLHttpRequestObject.responseText;						}				} //function	XMLHttpRequestObject.send(postVars);   }   }// function useAjax01 */