
var submitcount=0; 



function validate_checkout() {

document.form.title.style.backgroundColor='ffffff';
document.form.name.style.backgroundColor='ffffff';
document.form.surname.style.backgroundColor='ffffff';
document.form.email.style.backgroundColor='ffffff';
document.form.phone.style.backgroundColor='ffffff';
document.form.address_one.style.backgroundColor='ffffff';
document.form.suburb.style.backgroundColor='ffffff';
document.form.postcode.style.backgroundColor='ffffff';
document.form.state.style.backgroundColor='ffffff';
document.form.country.style.backgroundColor='ffffff';
document.form.recipient_name.style.backgroundColor='ffffff';
document.form.saddress_one.style.backgroundColor='ffffff';
document.form.ssuburb.style.backgroundColor='ffffff';
document.form.spostcode.style.backgroundColor='ffffff';
document.form.sstate.style.backgroundColor='ffffff';
document.form.day.style.backgroundColor='ffffff';
document.form.month.style.backgroundColor='ffffff';
document.form.year.style.backgroundColor='ffffff';
document.form.year.shipping.backgroundColor='ffffff';
Fname=form.email_login.value;
if (Fname=='') {

Fname=form.title.value;
if (Fname=='') {
document.form.title.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.shipping.value;
if (Fname=='') {
document.form.shipping.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.name.value;
if (Fname=='') {
document.form.name.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.surname.value;
if (Fname=='') {
document.form.surname.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.email.value;
if (Fname=='') {
document.form.email.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.phone.value;
if (Fname=='') {
document.form.phone.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.address_one.value;
if (Fname=='') {
document.form.address_one.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.suburb.value;
if (Fname=='') {
document.form.suburb.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

if (form.country.value == 'Australia') {

Fname=form.postcode.value;
if (Fname=='') {
document.form.postcode.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.state.value;
if (Fname=='') {
document.form.state.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}
}



Fname=form.country.value;
if (Fname=='') {
document.form.country.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}




Fname=form.recipient_name.value;
if (Fname=='') {
document.form.recipient_name.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.saddress_one.value;
if (Fname=='') {
document.form.saddress_one.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.ssuburb.value;
if (Fname=='') {
document.form.ssuburb.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.spostcode.value;
if (Fname=='') {
document.form.spostcode.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.sstate.value;
if (Fname=='') {
document.form.sstate.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}


Fname=form.day.value;
if (Fname=='') {
document.form.day.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.month.value;
if (Fname=='') {
document.form.month.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.year.value;
if (Fname=='') {
document.form.year.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}


}

if (Alert =='yes') {
alert('You must complete all required entries.');
event.returnValue=false;
}

}



function billtoship() {

if (document.form.country.value == 'Australia') {

document.form.saddress_one.value = document.form.address_one.value;
document.form.saddress_two.value = document.form.address_two.value;
document.form.ssuburb.value = document.form.suburb.value;
document.form.sstate.value = document.form.state.value;
document.form.spostcode.value = document.form.postcode.value;
document.form.scountry.value = document.form.country.value;


document.form.recipient_name.focus();

}
else {
alert('You can only ship to an Australian Address.');
document.form.same.checked = false;

}

}


function limitText(limitField, limitCount, limitNum) {
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} else {
		limitCount.value = limitNum - limitField.value.length;
	}
}






function validate_login() {

document.form.email_login.style.backgroundColor='ffffff';
document.form.password_login.style.backgroundColor='ffffff';

Fname=form.password_login.value;
if (Fname=='') {
document.form.password_login.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.email_login.value;
if (Fname=='') {
document.form.email_login.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}


if (Alert =='yes') {
alert('Please enter both a valid email address and your password.');
event.returnValue=false;
}

}




function validate_register() {

document.form.title.style.backgroundColor='ffffff';
document.form.name.style.backgroundColor='ffffff';
document.form.surname.style.backgroundColor='ffffff';
document.form.email.style.backgroundColor='ffffff';
document.form.phone.style.backgroundColor='ffffff';
document.form.address_one.style.backgroundColor='ffffff';
document.form.suburb.style.backgroundColor='ffffff';
document.form.postcode.style.backgroundColor='ffffff';
document.form.state.style.backgroundColor='ffffff';
document.form.country.style.backgroundColor='ffffff';
document.form.password.style.backgroundColor='ffffff';
document.form.emailtwo.style.backgroundColor='ffffff';

Fname=form.emailtwo.value;
if (Fname=='') {
document.form.emailtwo.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.title.value;
if (Fname=='') {
document.form.title.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.name.value;
if (Fname=='') {
document.form.name.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.surname.value;
if (Fname=='') {
document.form.surname.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.email.value;
if (Fname=='') {
document.form.email.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.phone.value;
if (Fname=='') {
document.form.phone.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.address_one.value;
if (Fname=='') {
document.form.address_one.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.suburb.value;
if (Fname=='') {
document.form.suburb.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}



Fname=form.country.value;
if (Fname=='') {
document.form.country.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.password.value;
if (Fname=='') {
document.form.password.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}



if (Alert =='yes') {
alert('You must complete all required entries.');
event.returnValue=false;
}

}




function validate_register_modify() {

document.form.title.style.backgroundColor='ffffff';
document.form.name.style.backgroundColor='ffffff';
document.form.surname.style.backgroundColor='ffffff';
document.form.email.style.backgroundColor='ffffff';
document.form.phone.style.backgroundColor='ffffff';
document.form.address_one.style.backgroundColor='ffffff';
document.form.suburb.style.backgroundColor='ffffff';
document.form.postcode.style.backgroundColor='ffffff';
document.form.state.style.backgroundColor='ffffff';
document.form.country.style.backgroundColor='ffffff';
document.form.password.style.backgroundColor='ffffff';

Fname=form.title.value;
if (Fname=='') {
document.form.title.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}



Fname=form.name.value;
if (Fname=='') {
document.form.name.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.surname.value;
if (Fname=='') {
document.form.surname.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.email.value;
if (Fname=='') {
document.form.email.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.phone.value;
if (Fname=='') {
document.form.phone.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.address_one.value;
if (Fname=='') {
document.form.address_one.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.suburb.value;
if (Fname=='') {
document.form.suburb.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.postcode.value;
if (Fname=='') {
document.form.postcode.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.state.value;
if (Fname=='') {
document.form.state.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.country.value;
if (Fname=='') {
document.form.country.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.password.value;
if (Fname=='') {
document.form.password.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}




if (Alert =='yes') {
alert('You must complete all required entries.');
event.returnValue=false;
}

}






function validate_payment() {

document.form.type.style.backgroundColor='ffffff';
document.form.card_name.style.backgroundColor='ffffff';
document.form.card_number.style.backgroundColor='ffffff';
document.form.card_exp_year.style.backgroundColor='ffffff';
document.form.card_exp_month.style.backgroundColor='ffffff';


Fname=form.type.value;
if (Fname=='') {
document.form.type.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}
Fname=form.card_name.value;
if (Fname=='') {
document.form.card_name.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}
Fname=form.card_number.value;
if (Fname=='') {
document.form.card_number.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}
Fname=form.cvn.value;
if (Fname=='') {
document.form.cvn.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.card_exp_month.value;
if (Fname=='') {
document.form.card_exp_month.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.card_exp_year.value;
if (Fname=='') {
document.form.card_exp_year.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

if (Alert =='yes') {
alert('You must complete all required entries.');
event.returnValue=false;
}
else {
if (submitcount == 0) 
{ submitcount++; return true; } 
else 
{ alert('Please wait processing your payment.' ); return false; } 
}

}



function validate_register_event() {

document.form.day.style.backgroundColor='ffffff';
document.form.month.style.backgroundColor='ffffff';
document.form.name.style.backgroundColor='ffffff';
document.form.event.style.backgroundColor='ffffff';


Fname=form.title.value;
if (Fname=='') {
document.form.name.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}



Fname=form.name.value;
if (Fname=='') {
document.form.name.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.day.value;
if (Fname=='') {
document.form.day.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.month.value;
if (Fname=='') {
document.form.month.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}

Fname=form.event.value;
if (Fname=='') {
document.form.event.style.backgroundColor='FEE2F5';
var Alert = 'yes';
}


if (Alert =='yes') {
alert('You must complete all required entries.');
event.returnValue=false;
}

}


function copyover() {

document.form.shipping.value = document.form.phone.value;
document.form.saddress_one.value = document.form.address_one.value;
document.form.saddress_two.value = document.form.address_two.value;
document.form.ssuburb.value = document.form.suburb.value;
document.form.sstate.value = document.form.state.value;
document.form.spostcode.value = document.form.postcode.value;

}
