/**		checkout form validation
*/
function checkApostrophe() 
{
var tmp=document.processform.elements["orNameOnCard"].value;
if(tmp.match("'"))
{
var ne=tmp.replace("'","");
document.processform.elements["orNameOnCard"].value=ne;
}
}

function checkApostropheInput() 
{
	var tmp=document.newdetailsform.elements["cuLastName"].value;
	if(tmp.match("'"))
	{
	var ne=tmp.replace("'","");
	document.newdetailsform.elements["cuLastName"].value=ne;
	}
}

function checkAddress1Apostrophe() 
{
	var tmp=document.newdetailsform.elements["cuAddress1"].value;
	if(tmp.match("'"))
	{
	var ne=tmp.replace("'","");
	document.newdetailsform.elements["cuAddress1"].value=ne;
	}
}

function checkAddress2Apostrophe() 
{
	var tmp=document.newdetailsform.elements["cuAddress2"].value;
	if(tmp.match("'"))
	{
	var ne=tmp.replace("'","");
	document.newdetailsform.elements["cuAddress2"].value=ne;
	}
}

function checkCityApostrophe() 
{
	var tmp=document.newdetailsform.elements["cuCity"].value;
	if(tmp.match("'"))
	{
	var ne=tmp.replace("'","");
	document.newdetailsform.elements["cuCity"].value=ne;
	}
}

function checkApostropheUpdate() 
{
var tmp=document.updatedetailsform.elements["cuLastName"].value;
if(tmp.match("'"))
{
var ne=tmp.replace("'","");
document.updatedetailsform.elements["cuLastName"].value=ne;
}
}
function checkApostropheDel() 
{
var tmp=document.deliveryupdateform.elements["orName"].value;
if(tmp.match("'"))
{
var ne=tmp.replace("'","");
document.deliveryupdateform.elements["orName"].value=ne;
}
}
function	validateForm()
{
	if(document.processform.elements["orCardType"].value == 'x')
	{
		alert("Please select a card type.");
		return false;
	}
	if(document.processform.elements["orNameOnCard"].value.length == 0)
	{
		alert("Please enter the name on the card.");
		return false;
	}
	if(document.processform.elements["orNameOnCard"].value == '\'')
	{
		alert("Please enter the name on the card.");
		return false;
	}
	if(document.processform.elements["orCardType"].value != 'AMEX' && document.processform.elements["orCardNumber"].value.length != 16)
	{
		alert("Please enter your 16 digit Visa or Mastercard number.");
		return false;
	}
	if(document.processform.elements["orCardType"].value == 'AMEX' && document.processform.elements["orCardNumber"].value.length != 15)
	{
		alert("Please enter your 15 digit American Express card number.");
		return false;
	}
	else
	if(isNaN(document.processform.elements["orCardNumber"].value) == true)
	{
		alert("Your card number must be numeric.");
		return false;
	}
	if(document.processform.elements["orExpiryMonth"].value == 'x')
	{
		alert("Please enter your credit card expiry month.");
		return false;
	}
	if(document.processform.elements["orExpiryYear"].value == 'x')
	{
		alert("Please enter your credit card expiry year.");
		return false;
	}
	if(document.processform.elements["orCCV"].value.length == 0)
	{
		alert("Please enter your CCV number.");
		return false;
	}
	else
	if(isNaN(document.processform.elements["orCCV"].value) == true)
	{
		alert("Your CCV must be a number.");
		return false;
	}
return true;
}

function	validateSendFriendForm()
{
	if(document.processform.elements["name"].value.length == 0)
	{
		alert("Please enter your friend's name.");
		return false;
	}
	if(document.processform.elements["email"].value.length == 0)
	{
		alert("Please enter your friend's email address.");
		return false;
	}
	if(document.processform.elements["sendername"].value.length == 0)
	{
		alert("Please enter your name.");
		return false;
	}
	if(document.processform.elements["senderemail"].value.length == 0)
	{
		alert("Please enter your email address.");
		return false;
	}
	return true;
}
function	validateSelector()
{
	if(document.selectform.elements["searchHairType"].value == 'x')
	{
		alert("Please select your hair type.");
		return false;
	}
	if(document.selectform.elements["searchSkinType"].value == 'x')
	{
		alert("Please select your skin type.");
		return false;
	}	
	return true;
}


function	validateAdd()
{
	if(document.addtocart.elements["colour"].value == 'x')
	{
		alert("Please select a colour.");
		return false;
	}
	return true;
}
