/**		checkout form validation
*/


function checkSpaces() 
{
var tmp=document.processform.elements["orCardNumber"].value;
if(tmp.match(" "))
{
var ne=tmp.replace(" ","");
document.processform.elements["orCardNumber"].value=ne;
}
}

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

function checkApostropheBilling() 
{
var tmp=document.processform.elements["orBillingAddress"].value;
if(tmp.match("'"))
{
var ne=tmp.replace("'","");
document.processform.elements["orBillingAddress"].value=ne;
}
}

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

function checkApostropheInputFN() 
{
var tmp=document.newdetailsform.elements["cuFirstName"].value;
if(tmp.match("'"))
{
var ne=tmp.replace("'","");
document.newdetailsform.elements["cuFirstName"].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 checkApostropheInputAdd1() 
{
var tmp=document.newdetailsform.elements["cuAddress1"].value;
if(tmp.match("'"))
{
var ne=tmp.replace("'","");
document.newdetailsform.elements["cuAddress1"].value=ne;
}
}

function checkApostropheInputAdd2() 
{
var tmp=document.newdetailsform.elements["cuAddress2"].value;
if(tmp.match("'"))
{
var ne=tmp.replace("'","");
document.newdetailsform.elements["cuAddress2"].value=ne;
}
}
function checkApostropheInputCity() 
{
var tmp=document.newdetailsform.elements["cuCity"].value;
if(tmp.match("'"))
{
var ne=tmp.replace("'","");
document.newdetailsform.elements["cuCity"].value=ne;
}
}
function checkApostropheInputCounty() 
{
var tmp=document.newdetailsform.elements["cuState"].value;
if(tmp.match("'"))
{
var ne=tmp.replace("'","");
document.newdetailsform.elements["cuState"].value=ne;
}
}
function checkApostropheInputPC() 
{
var tmp=document.newdetailsform.elements["cuPostcode"].value;
if(tmp.match("'"))
{
var ne=tmp.replace("'","");
document.newdetailsform.elements["cuPostcode"].value=ne;
}
}

function checkApostropheUpdateFN() 
{
var tmp=document.updatedetailsform.elements["cuFirstName"].value;
if(tmp.match("'"))
{
var ne=tmp.replace("'","");
document.updatedetailsform.elements["cuFirstName"].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 checkApostropheUpdateEmail() 
{
var tmp=document.updatedetailsform.elements["cuEmail"].value;
if(tmp.match("'"))
{
var ne=tmp.replace("'","");
document.updatedetailsform.elements["cuEmail"].value=ne;
}
var tmp=document.updatedetailsform.elements["cuEmail"].value;
if(tmp.match("/"))
{
var ne=tmp.replace("/","");
document.updatedetailsform.elements["cuEmail"].value=ne;
}
}

function checkApostropheUpdateAdd1() 
{
var tmp=document.updatedetailsform.elements["cuAddress1"].value;
if(tmp.match("'"))
{
var ne=tmp.replace("'","");
document.updatedetailsform.elements["cuAddress1"].value=ne;
}
}
function checkApostropheUpdateAdd2() 
{
var tmp=document.updatedetailsform.elements["cuAddress2"].value;
if(tmp.match("'"))
{
var ne=tmp.replace("'","");
document.updatedetailsform.elements["cuAddress2"].value=ne;
}
}
function checkApostropheUpdateCity() 
{
var tmp=document.updatedetailsform.elements["cuCity"].value;
if(tmp.match("'"))
{
var ne=tmp.replace("'","");
document.updatedetailsform.elements["cuCity"].value=ne;
}
}
function checkApostropheUpdateCounty() 
{
var tmp=document.updatedetailsform.elements["cuState"].value;
if(tmp.match("'"))
{
var ne=tmp.replace("'","");
document.updatedetailsform.elements["cuState"].value=ne;
}
}
function checkApostropheUpdatePC() 
{
var tmp=document.updatedetailsform.elements["cuPostcode"].value;
if(tmp.match("'"))
{
var ne=tmp.replace("'","");
document.updatedetailsform.elements["cuPostcode"].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 checkApostropheDelAdd1() 
{
var tmp=document.deliveryupdateform.elements["orAddress1"].value;
if(tmp.match("'"))
{
var ne=tmp.replace("'","");
document.deliveryupdateform.elements["orAddress1"].value=ne;
}
}
function checkApostropheDelAdd2() 
{
var tmp=document.deliveryupdateform.elements["orAddress2"].value;
if(tmp.match("'"))
{
var ne=tmp.replace("'","");
document.deliveryupdateform.elements["orAddress2"].value=ne;
}
}
function checkApostropheDelCity() 
{
var tmp=document.deliveryupdateform.elements["orCity"].value;
if(tmp.match("'"))
{
var ne=tmp.replace("'","");
document.deliveryupdateform.elements["orCity"].value=ne;
}
}
function checkApostropheDelState() 
{
var tmp=document.deliveryupdateform.elements["orState"].value;
if(tmp.match("'"))
{
var ne=tmp.replace("'","");
document.deliveryupdateform.elements["orState"].value=ne;
}
}
function	validateForm()
{
	if(document.processform.elements["orNameOnCard"].value.length == 0)
	{
		alert("Please enter the name on the card.");
		return false;
	}
		if(document.processform.elements["orBillingAddress"].value.length == 0)
	{
		alert("Please enter your credit card billing address.");
		return false;
	}
	if(document.processform.elements["orBillingPostcode"].value.length == 0)
	{
		alert("Please enter your credit card billing address postcode.");
		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' && document.selectform.elements["searchSkinType"].value == 'x')
	{
		alert("Please select either your hair or skin type.");
		return false;
	}
	return true;
}

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

