function checkContactUs() {
	error="false";
	emailError="false";
	phoneError="false";
	if (error=="false" && document.theForm.name.value.length<3) 			{window.alert("Please enter your name.");							document.theForm.name.focus();			error="true";}
	if (error=="false" && document.theForm.email.value.indexOf(".")<1)		{window.alert("Please enter a valid email address.");				document.theForm.email.focus();			error="true";}
	if (error=="false" && document.theForm.email.value.indexOf("@")<1)		{window.alert("Please enter a valid email address.");				document.theForm.email.focus();			error="true";}
	if (error=="false" && document.theForm.comment.value=="")				{window.alert("Please select what your contact is regarding.");		document.theForm.comment.focus();		error="true";}
	if (error=="false" && document.theForm.enquiry.value.length<10)			{window.alert("Please enter your enquiry.");						document.theForm.enquiry.focus();		error="true";}
	if (error=="false") {} else {return false;}
}

function checkNewsletterSubscription() {
	error="false";
	if (error=="false" && document.theForm.name.value.length<3) 			{window.alert("Please enter your name.");				document.theForm.name.focus();		error="true";}
	if (error=="false" && document.theForm.surname.value.length<3) 			{window.alert("Please enter your surname.");			document.theForm.surname.focus();	error="true";}
	if (error=="false" && document.theForm.email.value.indexOf(".")<1)		{window.alert("Please enter a valid email address.");	document.theForm.email.focus();		error="true";}
	if (error=="false" && document.theForm.email.value.indexOf("@")<1)		{window.alert("Please enter a valid email address.");	document.theForm.email.focus();		error="true";}
	if (error=="false" && document.theForm.group.value=="")					{window.alert("Please select your group of interest.");	document.theForm.group.focus();		error="true";}
	if (error=="false") {} else {return false;}
}

function checkForwardNewsletter() {
	error="false";
	if (error=="false" && document.theForm.fromname.value.length<3) 		{window.alert("Please enter your name.");				document.theForm.fromname.focus();	error="true";}
	if (error=="false" && document.theForm.toname.value.length<3) 			{window.alert("Please enter the recipients name.");		document.theForm.toname.focus();	error="true";}
	if (error=="false" && document.theForm.email.value.indexOf(".")<1)		{window.alert("Please enter a valid email address.");	document.theForm.email.focus();		error="true";}
	if (error=="false" && document.theForm.email.value.indexOf("@")<1)		{window.alert("Please enter a valid email address.");	document.theForm.email.focus();		error="true";}
	if (error=="false") {} else {return false;}
}

function changeLarge(a,b,c) {
	elm="<img src=\"images/current collections/collections/items/variations/"+a+"_"+b+".jpg\" width=\"300\" height=\"440\" />";
	document.getElementById("large").innerHTML=elm;
	elm=c+"px";
	document.getElementById("coverOne").style.top=elm;
	elm=eval(c+5)+"px";
	document.getElementById("coverTwo").style.top=elm;
}

function addToCart(a,b,c) {
	elm="index.asp?section=shopping-cart&action=add&collectionID="+a+"&itemID="+b+"&variationID="+c;
	location.href=elm;
}

function calcTotal()
{
	theTotal = 0;
	for(i=0; i<document.theForm.elements.length; i++)
	{
		if(document.theForm.elements[i].type == 'text')
		{
			var elName = document.theForm.elements[i].name;
			if(elName!='theTotal')
			{
				elValue=document.theForm.elements[i].value;
				elValue=elValue.replace("$","");
				elValue=elValue.replace(".","");
				elValue=elValue/100;
				elValue=parseInt(elValue);
				theTotal += elValue;
			}
		}
	}
//	updateTotal(theTotal);
}

function updateTotal(a)
{
	hey=a.toFixed(2);
	kel=document.theForm.theTotal;
	kel.value="$"+hey;
}

function showCVVHelp()
{
	window.open("cvv.htm",null,"height=350,width=300,status=no,toolbar=no,menubar=no,location=no");
}

function showShippingHelp()
{
	window.open("shipping.htm",null,"height=300,width=300,status=no,toolbar=no,menubar=no,location=no");
}

function updateCartTotals260607(a,b,c) {
	elm=eval("document.theForm.quantity"+a+"000"+b);
	goo=eval("document.theForm.total"+a+"000"+b);
	fub=eval(elm.value*c).toFixed(2);
	goo.value="$"+fub;
	calcTotal();
}

function updateCartTotals(a,b)
{
	itemID=a;
	variationID=b;
	elm="index.asp?section=shopping-cart&action=update&itemID="+itemID+"&variationID="+variationID;
	document.theForm.action=elm;
	document.theForm.submit();
}
function proceed()
{
	elm="index.asp?section=shopping-cart&action=proceed"
	document.theForm.action=elm;
	document.theForm.submit();
}
function proceedFromShipping()
{
	var inputArray=new Array("firstName","secondName","address","suburb","postcode","state","country","phoneNumber","email","hear","creditCardHolder","cardType","creditCardNumber","cvv","month","year");
	error=false;
	for (x=0; x<inputArray.length; x++)
	{
		if (document.theForm.elements[inputArray[x]].value.length<2)
		{
			document.theForm.elements[inputArray[x]].focus();
			alert("The '"+inputArray[x]+"' field must be entered.");
			error=true;
			break;
		}
	}
	document.theForm.phoneNumber.value=document.theForm.phoneNumber.value.replace(/ /g,"");
	if (error==false&&!IsNumeric(document.theForm.phoneNumber.value)) {document.theForm.phoneNumber.focus();alert("The 'phone number' field must be a number.");error=true;}

	if (error==false&&document.theForm.email.value.indexOf("@")<0) {document.theForm.email.focus();alert("The 'email' field must be valid.");error=true;}
	if (error==false&&document.theForm.email.value.indexOf(".")<0) {document.theForm.email.focus();alert("The 'email' field must be valid.");error=true;}

	document.theForm.creditCardNumber.value=document.theForm.creditCardNumber.value.replace(/ /g,"");
	if (error==false&&!IsNumeric(document.theForm.creditCardNumber.value)) {document.theForm.creditCardNumber.focus();alert("The 'credit card number' field must be a number.");error=true;}

	if (error==false&&!IsNumeric(document.theForm.cvv.value)) {document.theForm.cvv.focus();alert("The 'cvv' field must be a number.");error=true;}
	if (error==false)
	{
		elm="index.asp?section=shopping-cart&action=proceedFromShipping"
		document.theForm.action=elm;
		document.theForm.submit();
	}
}

function IsNumeric(sText)
{
	var ValidChars = "0123456789";
	var IsNumber=true;
	var Char;

	for (i = 0; i < sText.length && IsNumber == true; i++) 
	{
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1)
		{
			IsNumber = false;
		}
	}
	return IsNumber;
}