// JavaScript Document

 //Function phone validation Script
// Declaring required variables
var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 10;

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkInternationalPhone(strPhone){
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}
function isString (s) //Checks whether the string contains only alphabets, . and _
	{  
	    var i;
		var bag="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ._-"
	    for (i = 0; i < s.length; i++)
	    {   
	        var c = s.charAt(i);
	        if (bag.indexOf(c) == -1) return false;
	    }
	    return true;
	}
function isAlphaNumeric (s) //Checks whether the string contains only alphabets and Numbers
	{  
	    var i;
		var bag="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789,-_. ";
	    for (i = 0; i < s.length; i++)
	    {   var c = s.charAt(i);
			if (bag.indexOf(c) == -1) return false;
		}
		return true;
	}

var whitespace = " \t\n\r";

function isEmpty(s)  //Checks whether string is Empty
	{  
		return ((s == null) || (s.length == 0))
	}

function isWhitespace (s) //Checks for White spaces in the string 
	{  
		var i;
	 	if (isEmpty(s)) return true;
	 	   for (i = 0; i < s.length; i++)
	 	   {   
	 	       var c = s.charAt(i);
	 	       if (whitespace.indexOf(c) == -1) return false;
	 	   }
		   return true;
	}
	


function poplinks(url)
{
	newwindow=window.open(url,'ImageDisplay','height=600,width=600,left=0,top=0,resizable=yes,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}
function matrixpoplinks(url)
{
	newwindow=window.open(url,'ImageDisplay','height=500,width=950,left=0,top=0,resizable=yes,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}
function szchartpoplinks(url)
{
	newwindow=window.open(url,'ImageDisplay','height=510,width=820,left=0,top=0,resizable=yes,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}
//Validation for Bookmark site
function bookmarksite(title, url){
	if (document.all)
	window.external.AddFavorite(url, title);
	else if (window.sidebar)
	window.sidebar.addPanel(title, url, "");
}

function confirmMsg(msg){
	if(!confirm(msg)){
		return false;

	} else {
		return true;

	}
}
function search_validate()
{
	Searchfor=document.frm_search.searchfor;
	if(Searchfor.value=="")
	{
		alert("Enter the Search Phrase");
		Searchfor.focus();
		return false;
	}
	if(isWhitespace(Searchfor.value)){
		alert("Please Enter Search Phrase without white spaces");
		Searchfor.focus();
		return false;
	}
}
function member_validate()
{
	if(document.frm_member.txtusername.value=="")
	{
		alert("Enter the Username");
		document.frm_member.txtusername.focus();
		return false;
	}
	if (!validateEmail(document.frm_member.txtusername.value,1,1)) 
	{
			document.frm_member.txtusername.focus();
			return false;
	}
	if(document.frm_member.txtpassword.value=="")
	{
		alert("Enter the Password");
		document.frm_member.txtpassword.focus();
		return false;
	}
	if(document.frm_member.txtckcpassword.value=="")
	{
		alert("Please Retype the password");
		document.frm_member.txtckcpassword.focus();
		return false;
	}
	if(document.frm_member.txtckcpassword.value!=document.frm_member.txtpassword.value )
	{
		alert("Password and Retype password should be same");
		document.frm_member.txtckcpassword.focus();
		return false;
	}
	BFirstName=document.frm_member.varBFirstName;
	if(BFirstName.value=="")
	{
		alert("Enter the Billing First name");
		BFirstName.focus();
		return false;
	}
	if(isWhitespace(BFirstName.value)){
		alert("Please Enter your Billing First name without white spaces");
		BFirstName.focus();
		return false;
	}
	if(!isString(BFirstName.value)){
		alert("Please Enter your Billing First name without any special characters");
		BFirstName.focus();
		return false;
	}
	
	BLastName=document.frm_member.varBLastName;
	if(BLastName.value=="")
	{
		alert("Enter the Billing Last name");
		BLastName.focus();
		return false;
	}
	if(isWhitespace(BLastName.value)){
		alert("Please Enter your Billing Last name without white spaces");
		BLastName.focus();
		return false;
	}
	if(!isString(BLastName.value)){
		alert("Please Enter your Billing Last name without any special characters");
		BLastName.focus();
		return false;
	}
	BAddress1=document.frm_member.varBAddress1;
	if(BAddress1.value=="")
	{
		alert("Enter the Billing Address");
		BAddress1.focus();
		return false;
	}
	if(isWhitespace(BAddress1.value)){
		alert("Please Enter your Billing Address without white spaces");
		BAddress1.focus();
		return false;
	}
	
	if(!isAlphaNumeric(BAddress1.value)){
		alert("Please Enter your Billing Address without any special characters");
		BAddress1.focus();
		return false;
		}
		
	BCity=document.frm_member.varBCity;
	if(BCity.value=="")
	{
		alert("Enter the Billing City");
		BCity.focus();
		return false;
	}
	if(isWhitespace(BCity.value)){
		alert("Please Enter your Billing City without white spaces");
		BCity.focus();
		return false;
	}
	if(!isString(BCity.value)){
		alert("Please Enter your Billing City without any special characters");
		BCity.focus();
		return false;
	}
	
	if(document.frm_member.varBState.value==0)
	{
		alert("Select the Billing State");
		document.frm_member.varBState.focus();
		return false;
	}
	if(document.frm_member.varBPostcode.value=="")
	{
		alert("Enter the Billing Zipcode");
		document.frm_member.varBPostcode.focus();
		return false;
	}
	if(isWhitespace(document.frm_member.varBPostcode.value)){
		alert("Please Enter your Billing Zipcode without white spaces");
		document.frm_member.varBPostcode.focus();
		return false;
	}
	if(isNaN(document.frm_member.varBPostcode.value) ){
						alert("Enter the Zipcode in numeric value");
						document.frm_member.varBPostcode.focus();
						return false;
			}
	zipcodelength = document.frm_member.varBPostcode.value.length;
		if(zipcodelength != 5){
			alert("Please Enter your 5 digit card Billing zipcode");
			document.frm_member.varBPostcode.focus();
			return false;
		}
	if(document.frm_member.varBPhoneNo1.value=="")
	{
		alert("Enter the Billing Phone Number1");
		document.frm_member.varBPhoneNo1.focus();
		return false;
	}
	if(isWhitespace(document.frm_member.varBPhoneNo1.value)){
		alert("Please Enter your Billing Phone1 without white spaces");
		document.frm_member.varBPhoneNo1.focus();
		return false;
	}
	zipcodelength1 = document.frm_member.varBPhoneNo1.value.length;
		if(zipcodelength1 != 3){
			alert("Please Enter your 3 digit card Billing zipcode");
			document.frm_member.varBPhoneNo1.focus();
			return false;
		}
	
	if(document.frm_member.varBPhoneNo2.value=="")
	{
		alert("Enter the Billing Phone Number2");
		document.frm_member.varBPhoneNo2.focus();
		return false;
	}
	if(isWhitespace(document.frm_member.varBPhoneNo2.value)){
		alert("Please Enter your Billing Phone2 without white spaces");
		document.frm_member.varBPhoneNo2.focus();
		return false;
	}
	zipcodelength1 = document.frm_member.varBPhoneNo2.value.length;
		if(zipcodelength1 != 3){
			alert("Please Enter your 3 digit card Billing Phone2");
			document.frm_member.varBPhoneNo2.focus();
			return false;
		}
	if(document.frm_member.varBPhoneNo3.value=="")
	{
		alert("Enter the Billing Phone Number3");
		document.frm_member.varBPhoneNo3.focus();
		return false;
	}
	if(isWhitespace(document.frm_member.varBPhoneNo3.value)){
		alert("Please Enter your Billing Phone3 without white spaces");
		document.frm_member.varBPhoneNo3.focus();
		return false;
	}
	zipcodelength1 = document.frm_member.varBPhoneNo3.value.length;
		if(zipcodelength1 != 4){
			alert("Please Enter your 4 digit card Billing Phone3");
			document.frm_member.varBPhoneNo3.focus();
			return false;
		}
	
	if(document.frm_member.varShipFirstName.value=="")
	{
		alert("Enter the Shipping First name");
		document.frm_member.varShipFirstName.focus();
		return false;
	}
	if(isWhitespace(document.frm_member.varShipFirstName.value)){
		alert("Please Enter your Shipping First name without white spaces");
		document.frm_member.varShipFirstName.focus();
		return false;
	}
	if(!isString(document.frm_member.varShipFirstName.value)){
		alert("Please Enter your Shipping first name without any special characters");
		document.frm_member.varShipFirstName.focus();
		return false;
	}
	ShipLastName=document.frm_member.varShipLastName;
	if(ShipLastName.value=="")
	{
		alert("Enter the Shipping Last name");
		ShipLastName.focus();
		return false;
	}
	if(isWhitespace(ShipLastName.value)){
		alert("Please Enter your Shipping Last name without white spaces");
		ShipLastName.focus();
		return false;
	}
	if(!isString(ShipLastName.value)){
		alert("Please Enter your Shipping Last name without any special characters");
		ShipLastName.focus();
		return false;
	}
	if(document.frm_member.varShipAddress1.value=="")
	{
		alert("Enter the Shipping Address name");
		document.frm_member.varShipAddress1.focus();
		return false;
	}
	if(isWhitespace(frm_member.varShipAddress1.value)){
		alert("Please Enter your Shipping Address without white spaces");
		frm_member.varShipAddress1.focus();
		return false;
	}
	if(!isAlphaNumeric(document.frm_member.varShipAddress1.value)){
		alert("Please Enter your Shipping Address without any special characters");
		document.frm_member.varShipAddress1.focus();
		return false;
		}
	if(document.frm_member.varShipCity.value=="")
	{
		alert("Enter the Shipping City");
		document.frm_member.varShipCity.focus();
		return false;
	}
	if(isWhitespace(document.frm_member.varShipCity.value)){
		alert("Please Enter your Shipping City without white spaces");
		document.frm_member.varShipCity.focus();
		return false;
	}
	if(!isString(document.frm_member.varShipCity.value)){
		alert("Please Enter your Shipping City without any special characters");
		document.frm_member.varShipCity.focus();
		return false;
	}
	if(document.frm_member.varShipState.value==0)
		{
			alert("Select the Shipping State");
			document.frm_member.varShipState.focus();
			return false;
		}
	if(isWhitespace(document.frm_member.varShipState.value)){
			alert("Please Enter your Shipping State without white spaces");
			document.frm_member.varShipState.focus();
			return false;
		}
	if(!isString(document.frm_member.varShipState.value)){
			alert("Please Enter your Shipping State without any special characters");
			document.frm_member.varShipState.focus();
			return false;
		}
	
	if(document.frm_member.varShipZip.value=="")
	{
		alert("Enter the Shipping zipcode");
		document.frm_member.varShipZip.focus();
		return false;
	}
	if(isNaN(document.frm_member.varShipZip.value) ){
						alert("Enter the Zipcode in numeric value");
						document.frm_member.varShipZip.focus();
						return false;
			}
	if(isWhitespace(document.frm_member.varShipZip.value)){
		alert("Please Enter your Shipping Zipcode without white spaces");
		document.frm_member.varShipZip.focus();
		return false;
	}
	zipcodelength = document.frm_member.varShipZip.value.length;
		if(zipcodelength != 5){
			alert("Please Enter your 5 digit card shipping zipcode");
			document.frm_member.varShipZip.focus();
			return false;
		}
	if(document.frm_member.varShipPhone1.value=="")
	{
		alert("Enter the Shipping Phone1");
		document.frm_member.varShipPhone1.focus();
		return false;
	}
	if(isWhitespace(document.frm_member.varShipPhone1.value)){
		alert("Please Enter your Shipping Phone1 without white spaces");
		document.frm_member.varShipPhone1.focus();
		return false;
	}
	zipcodelength1 = document.frm_member.varShipPhone1.value.length;
		if(zipcodelength1 != 3){
			alert("Please Enter your 3 digit card shipping zipcode");
			document.frm_member.varShipPhone1.focus();
			return false;
		}
	
	if(document.frm_member.varShipPhone2.value=="")
	{
		alert("Enter the Shipping Phone2");
		document.frm_member.varShipPhone2.focus();
		return false;
	}
	if(isWhitespace(document.frm_member.varShipPhone2.value)){
		alert("Please Enter your Shipping Phone2 without white spaces");
		document.frm_member.varShipPhone2.focus();
		return false;
	}
	varShipPhone2length = document.frm_member.varShipPhone2.value.length;
		if(varShipPhone2length != 3){
			alert("Please Enter your 3 digit card shipping zipcode");
			document.frm_member.varShipPhone2.focus();
			return false;
		}
	
	if(document.frm_member.varShipPhone3.value=="")
	{
		alert("Enter the Shipping Phone3");
		document.frm_member.varShipPhone3.focus();
		return false;
	}
	if(isWhitespace(document.frm_member.varShipPhone3.value)){
		alert("Please Enter your Shipping Phone3 without white spaces");
		document.frm_member.varShipPhone3.focus();
		return false;
	}
	zipcodelength3 = document.frm_member.varShipPhone3.value.length;
		if(zipcodelength3 != 4){
			alert("Please Enter your shipping Phone3 in 4 digit ");
			document.frm_member.varShipPhone3.focus();
			return false;
		}
	/*if(document.frm_member.varShipPhone.value=="")
	{
		alert("Enter the Shipping Phone");
		document.frm_member.varShipPhone.focus();
		return false;
	}
	phoneno = document.frm_member.varShipPhone;
	if(checkInternationalPhone(phoneno.value)==false)
	{
		alert("Please Enter a Valid Phone Number")
		phoneno.value=""
		phoneno.focus()
		return false
	}*/
}

function shipaddr_validate(){
	if(document.frm_shipaddr.IntShipId.value=="")
	{
		alert("Enter the Shipping ID");
		document.frm_shipaddr.IntShipId.focus();
		return false;
	}
	if(isWhitespace(document.frm_shipaddr.IntShipId.value)){
		alert("Please Enter your Shipping ID without white spaces");
		document.frm_shipaddr.IntShipId.focus();
		return false;
	}
	if(!isAlphaNumeric(document.frm_shipaddr.IntShipId.value)){
		alert("Please Enter your Shipping ID without any special characters");
		document.frm_shipaddr.IntShipId.focus();
		return false;
		}
	if(document.frm_shipaddr.varShipFirstName.value=="")
	{
		alert("Enter the Shipping First name");
		document.frm_shipaddr.varShipFirstName.focus();
		return false;
	}
	if(isWhitespace(document.frm_shipaddr.varShipFirstName.value)){
		alert("Please Enter your Shipping First name without white spaces");
		document.frm_shipaddr.varShipFirstName.focus();
		return false;
	}
	if(!isString(document.frm_shipaddr.varShipFirstName.value)){
		alert("Please Enter your Shipping first name without any special characters");
		document.frm_shipaddr.varShipFirstName.focus();
		return false;
	}
	ShipLastName=document.frm_shipaddr.varShipLastName;
	if(ShipLastName.value=="")
	{
		alert("Enter the Shipping Last name");
		ShipLastName.focus();
		return false;
	}
	if(isWhitespace(ShipLastName.value)){
		alert("Please Enter your Shipping Last name without white spaces");
		ShipLastName.focus();
		return false;
	}
	if(!isString(ShipLastName.value)){
		alert("Please Enter your Shipping Last name without any special characters");
		ShipLastName.focus();
		return false;
	}
	if(document.frm_shipaddr.varShipAddress1.value=="")
	{
		alert("Enter the Shipping Address name");
		document.frm_shipaddr.varShipAddress1.focus();
		return false;
	}
	if(isWhitespace(frm_shipaddr.varShipAddress1.value)){
		alert("Please Enter your Shipping Address without white spaces");
		frm_shipaddr.varShipAddress1.focus();
		return false;
	}
	if(!isAlphaNumeric(document.frm_shipaddr.varShipAddress1.value)){
		alert("Please Enter your Shipping Address without any special characters");
		document.frm_shipaddr.varShipAddress1.focus();
		return false;
		}
	if(document.frm_shipaddr.varShipCity.value=="")
	{
		alert("Enter the Shipping City");
		document.frm_shipaddr.varShipCity.focus();
		return false;
	}
	if(isWhitespace(document.frm_shipaddr.varShipCity.value)){
		alert("Please Enter your Shipping City without white spaces");
		document.frm_shipaddr.varShipCity.focus();
		return false;
	}
	if(!isString(document.frm_shipaddr.varShipCity.value)){
		alert("Please Enter your Shipping City without any special characters");
		document.frm_shipaddr.varShipCity.focus();
		return false;
	}
	if(document.frm_shipaddr.varShipState.value==0)
		{
			alert("Select the Shipping State");
			document.frm_shipaddr.varShipState.focus();
			return false;
		}
	if(isWhitespace(document.frm_shipaddr.varShipState.value)){
			alert("Please Enter your Shipping State without white spaces");
			document.frm_shipaddr.varShipState.focus();
			return false;
		}
	if(!isString(document.frm_shipaddr.varShipState.value)){
			alert("Please Enter your Shipping State without any special characters");
			document.frm_shipaddr.varShipState.focus();
			return false;
		}
	
	if(document.frm_shipaddr.varShipZip.value=="")
	{
		alert("Enter the Shipping zipcode");
		document.frm_shipaddr.varShipZip.focus();
		return false;
	}
	if(isNaN(document.frm_shipaddr.varShipZip.value) ){
						alert("Enter the Zipcode in numeric value");
						document.frm_shipaddr.varShipZip.focus();
						return false;
			}
	if(isWhitespace(document.frm_shipaddr.varShipZip.value)){
		alert("Please Enter your Shipping Zipcode without white spaces");
		document.frm_shipaddr.varShipZip.focus();
		return false;
	}
	zipcodelength = document.frm_shipaddr.varShipZip.value.length;
		if(zipcodelength != 5){
			alert("Please Enter your 5 digit card shipping zipcode");
			document.frm_shipaddr.varShipZip.focus();
			return false;
		}
	
	if(document.frm_shipaddr.varShipPhone1.value=="")
	{
		alert("Enter the Shipping Phone1");
		document.frm_shipaddr.varShipPhone1.focus();
		return false;
	}
	if(isWhitespace(document.frm_shipaddr.varShipPhone1.value)){
		alert("Please Enter your Shipping Phone1 without white spaces");
		document.frm_shipaddr.varShipPhone1.focus();
		return false;
	}
	zipcodelength1 = document.frm_shipaddr.varShipPhone1.value.length;
		if(zipcodelength1 != 3){
			alert("Please Enter your 3 digit card shipping zipcode");
			document.frm_shipaddr.varShipPhone1.focus();
			return false;
		}
	
	if(document.frm_shipaddr.varShipPhone2.value=="")
	{
		alert("Enter the Shipping Phone2");
		document.frm_shipaddr.varShipPhone2.focus();
		return false;
	}
	if(isWhitespace(document.frm_shipaddr.varShipPhone2.value)){
		alert("Please Enter your Shipping Phone2 without white spaces");
		document.frm_shipaddr.varShipPhone2.focus();
		return false;
	}
	varShipPhone2length = document.frm_shipaddr.varShipPhone2.value.length;
		if(varShipPhone2length != 3){
			alert("Please Enter your 3 digit card shipping zipcode");
			document.frm_shipaddr.varShipPhone2.focus();
			return false;
		}
	
	if(document.frm_shipaddr.varShipPhone3.value=="")
	{
		alert("Enter the Shipping Phone3");
		document.frm_shipaddr.varShipPhone3.focus();
		return false;
	}
	if(isWhitespace(document.frm_shipaddr.varShipPhone3.value)){
		alert("Please Enter your Shipping Phone3 without white spaces");
		document.frm_shipaddr.varShipPhone3.focus();
		return false;
	}
	zipcodelength3 = document.frm_shipaddr.varShipPhone3.value.length;
		if(zipcodelength3 != 4){
			alert("Please Enter your 4 digit card shipping zipcode");
			document.frm_shipaddr.varShipPhone3.focus();
			return false;
		}
	
	/*phoneno = document.frm_shipaddr.varShipPhone;
	if(checkInternationalPhone(phoneno.value)==false)
	{
		alert("Please Enter a Valid Phone Number")
		phoneno.value=""
		phoneno.focus()
		return false
	}*/
}
function memlogin_validate(){
	if(document.memlogin.txtusername.value==""){
		alert("Please Enter your Email");
		document.memlogin.txtusername.focus();
		return false;
	}
	if (!validateEmail(document.memlogin.txtusername.value,1,1)) 
	{
			document.memlogin.txtusername.focus();
			return false;
	}
	if(document.memlogin.txtpassword.value==""){
		alert("Please Enter your Password");
		document.memlogin.txtpassword.focus();
		return false;
	}
}
//Email Validation
function validateEmail(addr,man,db) {
	if (addr == '' && man) {
	   if (db) alert('Email address is mandatory');
	   return false;
	}
	var invalidChars = '\/\'\\ ";:?!()[]\{\}^|';
	for (i=0; i<invalidChars.length; i++) {
	   if (addr.indexOf(invalidChars.charAt(i),0) > -1) {
		  if (db) alert('Email address contains invalid characters');
		  return false;
	   }
	}
	for (i=0; i<addr.length; i++) {
	   if (addr.charCodeAt(i)>127) {
		  if (db) alert("Email address contains non ascii characters.");
		  return false;
	   }
	}

	var atPos = addr.indexOf('@',0);
	if (atPos == -1) {
	   if (db) alert('Email address must contain an @');
	   return false;
	}
	if (atPos == 0) {
	   if (db) alert('Email address must not start with @');
	   return false;
	}
	if (addr.indexOf('@', atPos + 1) > - 1) {
	   if (db) alert('Email address must contain only one @');
	   return false;
	}
	if (addr.indexOf('.', atPos) == -1) {
	   if (db) alert('Email address must contain a period in the domain name');
	   return false;
	}
	if (addr.indexOf('@.',0) != -1) {
	   if (db) alert('period must not immediately follow @ in email address');
	   return false;
	}
	if (addr.indexOf('.@',0) != -1){
	   if (db) alert('period must not immediately precede @ in email address');
	   return false;
	}
	if (addr.indexOf('..',0) != -1) {
	   if (db) alert('two periods must not be adjacent in email address');
	   return false;
	}
	var suffix = addr.substring(addr.lastIndexOf('.')+1);
	if (suffix.length != 2 && suffix != 'com' && suffix != 'net' && suffix != 'org' && suffix != 'edu' && suffix != 'int' && suffix != 'mil' && suffix != 'gov' & suffix != 'arpa' && suffix != 'biz' && suffix != 'aero' && suffix != 'name' && suffix != 'coop' && suffix != 'info' && suffix != 'pro' && suffix != 'museum') {
	   if (db) alert('invalid primary domain in email address');
	   return false;
	}
return true;
}
//function for popup menu
function popupmenu(url)
{
	newwindow=window.open(url,'ImageDisplay','height=500,width=600,left=0,top=0,resizable=no,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}


function CartValidation(formname)
{

		//Product size validation
		var x=0;
		var sum=0;

		ProductSizeLength = document.forms[formname].ProductSize.length;
		

		if(ProductSizeLength > 1){
			for(PrIndex = 0; PrIndex < ProductSizeLength; PrIndex++ ){
				if(document.forms[formname].ProductSize[PrIndex].value == "" || document.forms[formname].ProductSize[PrIndex].value == "N/A"){
					x=x+1;
				}
				if(document.forms[formname].ProductSize[PrIndex].value != "N/A" && document.forms[formname].ProductSize[PrIndex].value != "") {
				sum = parseInt(sum) + parseInt(document.forms[formname].ProductSize[PrIndex].value);
				}
			}
			
			if(x==ProductSizeLength){
			alert("Please enter the Quanitity");
			return false;
			}
			for(PrIndex = 0; PrIndex < ProductSizeLength; PrIndex++ ){
			
				if(document.forms[formname].ProductSize[PrIndex].value != "N/A"){
					if(isNaN(document.forms[formname].ProductSize[PrIndex].value) ){
						alert("Enter the quantity in numeric value");
						document.forms[formname].ProductSize[PrIndex].focus();
						return false;
					}
				}
				
			}
		}
		else{
			if(document.forms[formname].ProductSize.value=="") {
						alert("Please enter the Quanitity");
						document.forms[formname].ProductSize.focus();
						return false;
			}
			if(isNaN(document.forms[formname].ProductSize.value) ){
						alert("Enter the quantity in numeric value");
						document.forms[formname].ProductSize.focus();
						return false;
			}
		sum = parseInt(document.forms[formname].ProductSize.value);	
		}
		
	
		if(sum < 1){
			alert("Total number of quantity must not be less than 1");
			return false;
		}
			
	
}
function placeordervalidation()
{
		Minimumorder= parseInt(document.frm_placeorder.minimumorder.value);
		Quantity= parseInt(document.frm_placeorder.quantity.value);
		if(Quantity < Minimumorder){
			alert("Your order must be for a minimum of "+Minimumorder+" pieces using the exact same art and ink colors.  Please add more items to your cart to proceed");
			return false;
		}	
}
function emailquote(url)
{
	Minimumorder= parseInt(document.frm_placeorder.minimumorder.value);
	Quantity= parseInt(document.frm_placeorder.quantity.value);
	if(Quantity < Minimumorder){
		alert("Your order must be for a minimum of "+Minimumorder+" pieces using the exact same art and ink colors.  Please add more items to your cart to proceed");
		return false;
	}	
	newwindow=window.location.href=(url);
	//if (window.focus) {newwindow.focus()}
}

//function shipresi()
//{
//	document.frm_shipsubmit.submit();
//}
//Validate function for Order details
function validate_order(){
	if(document.orderdetails.name.value==""){
		alert("Please Enter your Name");
		document.orderdetails.name.focus();
		return false;
	}
	if(document.orderdetails.address1.value==""){
		alert("Please Enter your Address");
		document.orderdetails.address1.focus();
		return false;
	}
	if(document.orderdetails.city.value==""){
		alert("Please Enter your City");
		document.orderdetails.city.focus();
		return false;
	}
	if(document.orderdetails.state.value==""){
		alert("Please Enter your State");
		document.orderdetails.state.focus();
		return false;
	}
	if(document.orderdetails.zipcode.value==""){
		alert("Please Enter your Zipcode");
		document.orderdetails.zipcode.focus();
		return false;
	}
	zipcodelength = document.orderdetails.zipcode.value.length;
		if(zipcodelength != 5){
			alert("Please Enter your 5 digit zipcode");
			document.orderdetails.zipcode.focus();
			return false;
		}
	if(document.orderdetails.phone.value==""){
		alert("Please Enter your Phone number");
		document.orderdetails.phone.focus();
		return false;
	}
	phoneno = document.orderdetails.phone;
	if (checkInternationalPhone(phoneno.value)==false)
	{
		alert("Please Enter a Valid Phone Number")
		phoneno.value=""
		phoneno.focus()
		return false
	}
	if (!validateEmail(document.orderdetails.email.value,1,1)) 
	{
			document.orderdetails.email.focus();
			return false;
	}
	if(document.orderdetails.cc.value==""){
		alert("Please Enter your Credit Card Number");
		document.orderdetails.cc.focus();
		return false;
	}
	if(isNaN(document.orderdetails.cc.value)){
		alert("Credit Card value shoud be numeric");
		document.orderdetails.cc.focus();
		return false;
	}
	if(document.orderdetails.cardtype.value==""){
		alert("Please Enter your Credit Card type");
		document.orderdetails.cardtype.focus();
		return false;
	}
/*	if(document.orderdetails.BilltoState.value==""){
		alert("Please Select your State");
		document.orderdetails.BilltoState.focus();
		return false;
	}
	if(document.orderdetails.BilltoZipcode.value==""){
		alert("Please Enter your Zip Code");
		document.orderdetails.BilltoZipcode.focus();
		return false;
	}
*/
}
function doCheck(IndexValue){
	if(document.frm_productdisplay.rdo_imprint[IndexValue].checked){
		for(innercount=0; innercount < 6; innercount++){
			if(IndexValue != innercount){
			document.frm_productdisplay.ImprintAdditional[innercount].disabled = false;
			}
		}
		document.frm_productdisplay.ImprintAdditional[IndexValue].disabled = true;
	}
}


	function ProductOrderValidate(){

		ShirtColor = "";
		ProductSize = "";
		rdo_imprint="";
		ArtSource = "";
		ShirtColorLength = document.frm_productdisplay.ShirtColor.length;
		
		//InkColorLength = document.frm_productdisplay.InkColor.length;
		ProductSizeLength = document.frm_productdisplay.ProductSize.length;
		/*rdo_imprintlength = document.frm_productdisplay.rdo_imprint.length;
		ImprintAdditionallength = document.frm_productdisplay.ImprintAdditional.length;*/
		
		//Shirt Color validation
		var i=0;
		if(ShirtColorLength > 1){
			for(ShIndex = 0; ShIndex < ShirtColorLength; ShIndex++ ){
				if(document.frm_productdisplay.ShirtColor[ShIndex].checked == false){
					i=i+1;
				}
			}
		}
		if(i==ShirtColorLength)
		{
			alert("Please select the Shirt Color");
			return false;
		}
		
		//Ink color validation
		/*var j=0;
		if(InkColorLength > 1){
			for(InIndex = 0; InIndex < InkColorLength; InIndex++ ){
				if(document.frm_productdisplay.InkColor[InIndex].checked == false){
					j=j+1;
				}
			}
		}
		if(j==InkColorLength)
		{
			alert("Please select the Ink Color");
			return false;
		}*/
		
		//Product size validation
		var x=0;
		var sum=0;
		if(ProductSizeLength > 1){
			for(PrIndex = 0; PrIndex < ProductSizeLength; PrIndex++ ){
				if(document.frm_productdisplay.ProductSize[PrIndex].value == "" || document.frm_productdisplay.ProductSize[PrIndex].value == "N/A"){
					x=x+1;
				}
				if(document.frm_productdisplay.ProductSize[PrIndex].value != "N/A" && document.frm_productdisplay.ProductSize[PrIndex].value != "") {
				sum = parseInt(sum) + parseInt(document.frm_productdisplay.ProductSize[PrIndex].value);
				}
			}
		}
		if(x==ProductSizeLength)
		{
			alert("Please enter the number of shirts");
			return false;
		}
		for(PrIndex = 0; PrIndex < ProductSizeLength; PrIndex++ ){
		
			if(document.frm_productdisplay.ProductSize[PrIndex].value != "N/A"){
				if(isNaN(document.frm_productdisplay.ProductSize[PrIndex].value) ){
					alert("Enter the number of shirts in numeric value");
					document.frm_productdisplay.ProductSize[PrIndex].focus();
					return false;
				}
			}
			
		}
		if(sum < 1){
			alert("Total number of shirts must not be less than 1");
			return false;
		}
		

		
		if((document.frm_productdisplay.FrontLocation.value=="") && (document.frm_productdisplay.BackLocation.value=="") && (document.frm_productdisplay.RightLocation.value=="") && (document.frm_productdisplay.LeftLocation.value=="")) 
		{
			alert("Please select atleast one location");
			return false;
			
		}
		
		
		if(document.frm_productdisplay.FrontLocation.value!="")
		{
			if(document.frm_productdisplay.FrontColor.value=="0")
			{
				alert("Please select the front location color");
				document.frm_productdisplay.FrontColor.focus();
				return false;
			}
			
		}
		
		
		
		//validation for print location(Back)
		if(document.frm_productdisplay.BackLocation.value!="")
		{
			if(document.frm_productdisplay.BackColor.value=="0")
			{
				alert("Please select the Back location color");
				document.frm_productdisplay.BackColor.focus();
				return false;
			}
			
		}
		//validation for print location(Right)
		if(document.frm_productdisplay.RightLocation.value!="")
		{
			if(document.frm_productdisplay.RightColor.value=="0")
			{
				alert("Please select the Right sleeve color");
				document.frm_productdisplay.RightColor.focus();
				return false;
			}
			
		}
		//validation for print location(Left)
		if(document.frm_productdisplay.LeftLocation.value!="")
		{
			if(document.frm_productdisplay.LeftColor.value=="0")
			{
				alert("Please select the Left sleeve color");
				document.frm_productdisplay.LeftColor.focus();
				return false;
			}
			
		}
		
		//validation for Art source
		artsourcelength=document.frm_productdisplay.ArtSource.length
		
		var i=0;
		if(artsourcelength > 1){
			for(artIndex = 0; artIndex < artsourcelength; artIndex++ ){
				if(document.frm_productdisplay.ArtSource[artIndex].checked == false){
					i=i+1;
				}
			}
		}
		if(i==artsourcelength)
		{
			alert("Please select the Art Source Type");
			return false;
		}
		if(document.frm_productdisplay.ArtSource[2].checked == true)
		{
			
			if(document.frm_productdisplay.JobId.value=="")
			{
				alert("Please select the job id")
				document.frm_productdisplay.JobId.focus()
				return false;
				
			}
			
		}
		
		
		
		if(document.frm_productdisplay.ArtSource[1].checked == true)
		{
			
			if(document.frm_productdisplay.Artorderid.value=="")
			{
				alert("Please enter your Previous Order Id")
				document.frm_productdisplay.Artorderid.focus()
				return false;
				
			}
			
		}
		
		//validation for zip code
		if(document.frm_productdisplay.ShipToZip.value=="")
			{
				alert("Please enter the zip code")
				document.frm_productdisplay.ShipToZip.focus()
				return false;
				
			}
		
			
	}
	/*function PlaceOrderValidate()
	{
		if(document.frm_placeorder.ShipToZip.value=="")
			{
				alert("Please enter the zip code")
				document.frm_placeorder.ShipToZip.focus()
				return false;
				
			}
		
	}*/
	function UpdatePreview(ProductId){
		
	ShirtColor = "";
	InkColor = "";
	ShirtColorLength = document.frm_productdisplay.ShirtColor.length;
	InkColorLength = document.frm_productdisplay.InkColor.length;
	var i=0;
	if(ShirtColorLength > 1){
		for(ShIndex = 0; ShIndex < ShirtColorLength; ShIndex++ ){
			if(document.frm_productdisplay.ShirtColor[ShIndex].checked == false){
			 	i=i+1;
			}
			else
			{
				ShirtColor = document.frm_productdisplay.ShirtColor[ShIndex].value;
			}
		}
	}
	if(i==ShirtColorLength)
	{
		alert("Please select the Shirt Color");
		return false;
	}

	var j=0;
	if(InkColorLength > 1){
		for(InIndex = 0; InIndex < InkColorLength; InIndex++ ){
			if(document.frm_productdisplay.InkColor[InIndex].checked == false){
			 	j=j+1;
			}
			else
			{
				InkColor = document.frm_productdisplay.InkColor[InIndex].value;
			}
		}
	}
	if(j==InkColorLength)
	{
		alert("Please select the Ink Color");
		return false;
	}

	window.location.href = "productdisplay.asp?ShirtId="+ShirtColor+"&ColorId="+InkColor+"&productID="+ProductId
}
function UpdatePreviewpop(ProductId){
		
	ShirtColor = "";
	InkColor = "";
	ShirtColorLength = document.frm_productdisplay.ShirtColor.length;
	InkColorLength = document.frm_productdisplay.InkColor.length;
	var i=0;
	if(ShirtColorLength > 1){
		for(ShIndex = 0; ShIndex < ShirtColorLength; ShIndex++ ){
			if(document.frm_productdisplay.ShirtColor[ShIndex].checked == false){
			 	i=i+1;
			}
			else
			{
				ShirtColor = document.frm_productdisplay.ShirtColor[ShIndex].value;
			}
		}
	}
	if(i==ShirtColorLength)
	{
		alert("Please select the Shirt Color");
		return false;
	}

	var j=0;
	if(InkColorLength > 1){
		for(InIndex = 0; InIndex < InkColorLength; InIndex++ ){
			if(document.frm_productdisplay.InkColor[InIndex].checked == false){
			 	j=j+1;
			}
			else
			{
				InkColor = document.frm_productdisplay.InkColor[InIndex].value;
			}
		}
	}
	if(j==InkColorLength)
	{
		alert("Please select the Ink Color");
		return false;
	}

	window.location.href = "prodisp.asp?ShirtId="+ShirtColor+"&ColorId="+InkColor+"&productID="+ProductId
}
function UpdateSizes(ShirtColor,ProductId){
	window.location.href = "productdisplay.asp?ShirtId=" + ShirtColor + "&productID="+ProductId
}
function UpdateSizespop(ShirtColor,ProductId){
	window.location.href = "prodisp.asp?ShirtId=" + ShirtColor + "&productID="+ProductId
}
// copy
var ShippingFname;
var ShippingLname;
var ShippingCompany;
var ShippingAddress1;
var ShippingAddress2;
var ShippingCity;
var ShippingState
var ShippingZipCode;
var ShippingPhone1
var ShippingPhone2
var ShippingPhone3

function InitSaveVariables(form) {
		ShippingFname = form.varShipFirstName.value;
		ShippingLname = form.varShipLastName.value;
		ShippingCompany = form.varShipCompany.value;
		ShippingAddress1 = form.varShipAddress1.value;
		ShippingAddress2 = form.varShipAddress2.value;
        ShippingCity = form.varShipCity.value;
		ShippingStateIndex = form.varShipState.selectedIndex;
        ShippingState = form.varShipState[ShippingStateIndex].value;
        ShippingZipCode = form.varShipZip.value;
		ShippingPhone1 = form.varShipPhone1.value;
		ShippingPhone2 = form.varShipPhone2.value;
		ShippingPhone3 = form.varShipPhone3.value;
}

function ShipToBillPerson(form){
		if (form.Shipcheck.checked) {
                InitSaveVariables(form);
				form.varShipFirstName.value 	= form.varBFirstName.value;
				form.varShipLastName.value 		= form.varBLastName.value;
				form.varShipCompany.value   	= form.varBCompany.value;
				form.varShipAddress1.value   	= form.varBAddress1.value;
				form.varShipAddress2.value   	= form.varBAddress2.value;
				form.varShipCity.value      	= form.varBCity.value;
				form.varShipState.value     	= form.varBState.value;
				form.varShipZip.value     	 	= form.varBPostcode.value;
				form.varShipPhone1.value      	= form.varBPhoneNo1.value;
				form.varShipPhone2.value      	= form.varBPhoneNo2.value;
				form.varShipPhone3.value      	= form.varBPhoneNo3.value;
				form.varShipFirstName.disabled = true;
				form.varShipLastName.disabled = true;
				form.varShipCompany.disabled = true;
				form.varShipAddress1.disabled = true;
				form.varShipAddress2.disabled = true;
				form.varShipCity.disabled = true;
				form.varShipState.disabled = true;
				form.varShipZip.disabled = true;
				form.varShipPhone1.disabled = true;
				form.varShipPhone2.disabled = true;
				form.varShipPhone3.disabled = true;
				
		}
        else {
				form.varShipFirstName.value = ShippingFname;
				form.varShipLastName.value  = ShippingLname;
				form.varShipCompany.value   = ShippingCompany; 
				form.varShipAddress1.value   = ShippingAddress1; 
				form.varShipAddress2.value   = ShippingAddress2; 
				form.varShipCity.value	    = ShippingCity;
				form.varShipState.value     = ShippingState;
				form.varShipZip.value       = ShippingZipCode;
				form.varShipPhone1.value     = ShippingPhone1;
				form.varShipPhone2.value     = ShippingPhone2;
				form.varShipPhone3.value     = ShippingPhone3;
				
				form.varShipFirstName.disabled = false;
				form.varShipLastName.disabled = false;
				form.varShipCompany.disabled = false;
				form.varShipAddress1.disabled = false;
				form.varShipAddress2.disabled = false;
				form.varShipCity.disabled = false;
				form.varShipState.disabled = false;
				form.varShipZip.disabled = false;
				form.varShipPhone1.disabled = false;
				form.varShipPhone2.disabled = false;
				form.varShipPhone3.disabled = false;
   			}
}

//Check out
 function setValue(FieldValue,FieldName) {   
        var FieldObject = document.getElementById(FieldName);   
        FieldObject.value = FieldValue;   
        return false;  
 } 

//Validation For Check out
function checkout_validate()
{
	if (!validateEmail(document.checkout.b_email.value,1,1)) 
	{
			document.checkout.b_email.focus();
			return false;
	}
	if(document.checkout.b_fname.value==""){
		alert("Please Enter your First Name");
		document.checkout.b_fname.focus();
		return false;
	}
	if(document.checkout.b_lname.value==""){
		alert("Please Enter your Last Name");
		document.checkout.b_lname.focus();
		return false;
	}
	if(document.checkout.b_address1.value==""){
		alert("Please Enter Address1 field");
		document.checkout.b_address1.focus();
		return false;
	}
	if(document.checkout.b_city.value==""){
		alert("Please Enter your City");
		document.checkout.b_city.focus();
		return false;
	}
	if(document.checkout.b_state.value==""){
		alert("Please Enter your State");
		document.checkout.b_state.focus();
		return false;
	}
	if(document.checkout.b_zipcode.value==""){
		alert("Please Enter your City Zipcode");
		document.checkout.b_zipcode.focus();
		return false;
	}
	if(document.checkout.b_phone.value==""){
		alert("Please Enter your Phone number");
		document.checkout.b_phone.focus();
		return false;
	}
	phoneno = document.checkout.b_phone;
	if (checkInternationalPhone(phoneno.value)==false)
	{
		alert("Please Enter a Valid Phone Number")
		phoneno.value=""
		phoneno.focus()
		return false
	}
	if(document.checkout.s_fname.value==""){
		alert("Please Enter your First Name");
		document.checkout.s_fname.focus();
		return false;
	}
	if(document.checkout.s_lname.value==""){
		alert("Please Enter your Last Name");
		document.checkout.s_lname.focus();
		return false;
	}
	if(document.checkout.s_address1.value==""){
		alert("Please Enter Address1 field");
		document.checkout.s_address1.focus();
		return false;
	}
	if(document.checkout.s_city.value==""){
		alert("Please Enter your City");
		document.checkout.s_city.focus();
		return false;
	}
	if(document.checkout.s_state.value==""){
		alert("Please Enter your State");
		document.checkout.s_state.focus();
		return false;
	}
	if(document.checkout.s_zipcode.value==""){
		alert("Please Enter your City Zipcode");
		document.checkout.s_zipcode.focus();
		return false;
	}
	if(document.checkout.s_phone.value==""){
		alert("Please Enter your Phone number");
		document.checkout.s_phone.focus();
		return false;
	}
	phoneno = document.checkout.s_phone;
	if (checkInternationalPhone(phoneno.value)==false)
	{
		alert("Please Enter a Valid Phone Number")
		phoneno.value=""
		phoneno.focus()
		return false
	}
	if(document.checkout.cardtype.value==""){
		alert("Please select the Card type");
		document.checkout.cardtype.focus();
		return false;
	}
	if(document.checkout.cardnumber.value==""){
		alert("Please enter the Card Number");
		document.checkout.cardnumber.focus();
		return false;
	}
	if(isNaN(document.checkout.cardnumber.value)){
		alert("Card Number field must be numeric");
		document.checkout.cardnumber.focus();
		return false;
	}
	if(document.checkout.expmonth.value==""){
		alert("Please enter the Expiry Month");
		document.checkout.expmonth.focus();
		return false;
	}
	if(document.checkout.expyear.value==""){
		alert("Please enter the Expiry Year");
		document.checkout.expyear.focus();
		return false;
	}
	if(document.checkout.nameoncard.value==""){
		alert("Please enter the Card Name");
		document.checkout.nameoncard.focus();
		return false;
	}
	if(document.checkout.cardbilladdr1.value==""){
		alert("Please enter the Card Billing Address1");
		document.checkout.cardbilladdr1.focus();
		return false;
	}
	if(document.checkout.cardcity.value==""){
		alert("Please enter the Card Billing City");
		document.checkout.cardcity.focus();
		return false;
	}
	if(document.checkout.cardstate.value==""){
		alert("Please enter the Card Billing State");
		document.checkout.cardstate.focus();
		return false;
	}
	if(document.checkout.cardzipcode.value==""){
		alert("Please enter the Card Billing ZipCode");
		document.checkout.cardzipcode.focus();
		return false;
	}
}

var CardBillingAddress1;
var CardBillingAddress2;
var CardBillingCity;
var CardBillingState
var CardBillingZipCode;

function InitCSaveVariables(form) {
		CardBillingAddress1 = form.cardbilladdr1.value;
		CardBillingAddress2 = form.cardbilladdr2.value;
        CardBillingCity = form.cardcity.value;
		CardBillingState = form.cardstate.value;
        CardBillingZipCode = form.cardzipcode.value;
}

function ShipToCardBillPerson(form) {
        if (form.copyaddr.checked) {
                InitCSaveVariables(form);
                form.cardbilladdr1.value = form.b_address1.value;
                form.cardbilladdr2.value = form.b_address2.value;
                form.cardcity.value = form.b_city.value;
                form.cardstate.value = form.b_state.value;
                form.cardzipcode.value = form.b_zipcode.value;
		}
        else {
                form.cardbilladdr1.value = CardBillingAddress1;
                form.cardbilladdr2.value = CardBillingAddress2;
                form.cardcity.value = CardBillingCity;
                form.cardstate.value = CardBillingState;
                form.cardzipcode.value = CardBillingZipCode;
	   }
}


function MailQuoteValidate()
{
	quoteName=document.frm_quotemail.txtname;
	if(quoteName.value=="")
	{
		alert("Enter the your name");
		quoteName.focus();
		return false;
	}
	if(isWhitespace(quoteName.value)){
		alert("Please Enter your name without white spaces");
		quoteName.focus();
		return false;
	}
	if(!isString(quoteName.value)){
		alert("Please Enter your name without any special characters");
		quoteName.focus();
		return false;
	}
	
	if(document.frm_quotemail.txtemail.value==""){
		alert("Please enter your email");
		document.frm_quotemail.txtemail.focus();
		return false;
	}
	if (!validateEmail(document.frm_quotemail.txtemail.value,1,1)) 
	{
			document.frm_quotemail.txtemail.focus();
			return false;
	}
	if(document.frm_quotemail.txttoemail.value==""){
		alert("Please enter the To mail address ");
		document.frm_quotemail.txttoemail.focus();
		return false;
	}
	if (!validateEmail(document.frm_quotemail.txttoemail.value,1,1)) 
	{
			document.frm_quotemail.txttoemail.focus();
			return false;
	}
	/*if(document.frm_quotemail.txtcomments.value==""){
		alert("Please enter your comments");
		document.frm_quotemail.txtcomments.focus();
		return false;
	}	*/
}
function checkoutvalidity()
{
	cardtype=document.checkout_form.card_type;
	if(cardtype.value=="")
	{
		alert("Please select your credit card type");
		cardtype.focus();
		return false;
	}
	cardname=document.checkout_form.card_name;
	if(cardname.value=="")
	{
		alert("Enter the your name");
		cardname.focus();
		return false;
	}
	if(isWhitespace(cardname.value)){
		alert("Please Enter your name without white spaces");
		cardname.focus();
		return false;
	}
	if(!isString(cardname.value)){
		alert("Please Enter your name without any special characters");
		cardname.focus();
		return false;
	}
	cardnumber=document.checkout_form.card_number;
	if(cardnumber.value=="")
	{
		alert("Enter the your credit card number");
		cardnumber.focus();
		return false;
	}
	if(isWhitespace(cardnumber.value)){
		alert("Please Enter your credit card number without white spaces");
		cardnumber.focus();
		return false;
	}
	if(!isInteger(cardnumber.value)){
		alert("Please Enter your credit card number without any special characters");
		cardnumber.focus();
		return false;
	}
	if(cardnumber.value.length > 16){
		alert("Please Enter your correct credit card number");
		cardnumber.focus();
		return false;
	}
	cardexpiremonth=document.checkout_form.card_expire_Month;
	if(cardexpiremonth.value=="")
	{
		alert("Please select your credit card expiremonth");
		cardexpiremonth.focus();
		return false;
	}
	cardexpireyear=document.checkout_form.card_expire_Year;
	if(cardexpireyear.value=="")
	{
		alert("Please select your credit card expireyear");
		cardexpireyear.focus();
		return false;
	}
	Cardverifynumber=document.checkout_form.cardverifynumber;
	if(Cardverifynumber.value=="")
	{
		alert("Enter the your card verification number");
		Cardverifynumber.focus();
		return false;
	}
	if(isWhitespace(Cardverifynumber.value)){
		alert("Please Enter your card verification number without white spaces");
		Cardverifynumber.focus();
		return false;
	}
	if(!isInteger(Cardverifynumber.value)){
		alert("Please Enter your card verification number without any special characters");
		Cardverifynumber.focus();
		return false;
	}
	if(Cardverifynumber.value.length != 3){
		alert("Please Enter your 3 digit card verification number");
		Cardverifynumber.focus();
		return false;
	}
}
	



	
