// JavaScript Document

function clearDefault(el) {
  if (el.defaultValue==el.value) {
	  el.value = "";
	  el.className='regform_clickin';
  }
}
function Select_Option(el) {
	el.className='regform_clickin';
}
function Prefix(el) {
  if (el.value=="") {
	  el.className='regform_clickout';
  }
  else {
	  el.className='regform_clickin';
  }
}
function P_Other(el) {
  if (el.value=="") {
	  el.value = "Other Prefix";
	  el.className='regform_clickout';
  }
  else {
	  el.className='regform_clickin';
  }
}
function F_Name(el) {
  if (el.value=="") {
	  el.value = "First Name";
	  el.className='regform_clickout';
  }
  else {
	  el.className='regform_clickin';
  }
}
function L_Name(el) {
  if (el.value=="") {
	  el.value = "Last Name";
	  el.className='regform_clickout';
  }
  else {
	  el.className='regform_clickin';
  }
}
function Name(el) {
  if (el.value=="") {
	  el.value = "Name";
	  el.className='regform_clickout';
  }
  else {
	  el.className='regform_clickin';
  }
}
function Address_Line_1(el) {
  if (el.value=="") {
	  el.value = "Address Line 1";
	  el.className='regform_clickout';
  }
  else {
	  el.className='regform_clickin';
  }
}
function Address_Line_2(el) {
  if (el.value=="") {
	  el.value = "Address Line 2";
	  el.className='regform_clickout';
  }
  else {
	  el.className='regform_clickin';
  }
}
function City(el) {
  if (el.value=="") {
	  el.value = "City";
	  el.className='regform_clickout';
  }
  else {
	  el.className='regform_clickin';
  }
}
function State(el) {
  if (el.value=="") {
	  el.value = "State/Province/Region";
	  el.className='regform_clickout';
  }
  else {
	  el.className='regform_clickin';
  }
}
function P_Code(el) {
  if (el.value=="") {
	  el.value = "Postal/Zip Code";
	  el.className='regform_clickout';
  }
  else {
	  el.className='regform_clickin';
  }
}
function Country(el) {
  if (el.value=="") {
	  el.className='regform_clickout';
  }
  else {
	  el.className='regform_clickin';
  }
}
function Email(el) {
  if (el.value=="") {
	  el.value = "Email Address";
	  el.className='regform_clickout';
  }
  else {
	  el.className='regform_clickin';
  }
}
function H_Phone_No(el) {
  if (el.value=="") {
	  el.value = "Home Phone No";
	  el.className='regform_clickout';
  }
  else {
	  el.className='regform_clickin';
  }
}
function M_Phone_No(el) {
  if (el.value=="") {
	  el.value = "Mobile Phone No";
	  el.className='regform_clickout';
  }
  else {
	  el.className='regform_clickin';
  }
}
function Age_Group(el) {
  if (el.value=="") {
	  el.className='regform_clickout';
  }
  else {
	  el.className='regform_clickin';
  }
}
function Gnan_Centre(el) {
  if (el.value=="") {
	  el.className='regform_clickout';
  }
  else {
	  el.className='regform_clickin';
  }
}


function validatechkp(chk){
  if (chk.checked == 1) {
	document.getElementById("postalc").className = "registration_checkboxtext_in";
  }
  else {
	document.getElementById("postalc").className = "registration_checkboxtext_out"; 
  }
}

function validatechkt(chk){
  if (chk.checked == 1) {
	document.getElementById("telephonec").className = "registration_checkboxtext_in";
  }
  else {
	document.getElementById("telephonec").className = "registration_checkboxtext_out"; 
  }
}

function validatechke(chk){
  if (chk.checked == 1) {
	document.getElementById("emailc").className = "registration_checkboxtext_in";
  }
  else {
	document.getElementById("emailc").className = "registration_checkboxtext_out"; 
  }
}

function Checkbox() {
	var l = document.getElementById("postalcomms").getElementsByTagName("label")[0];
	l.firstChild.data="My Text";
	alert('hello');
}

function checkGV(gnancentre) {
	if (document.forms.registration.gnancentre.value != ""){
		return true;
	}
	else {
		return false;
	}
}

function validateForm(registration)
{
	
	if("First Name"==document.forms.registration.fname.value){
		alert("Please fill in your First Name.");
		document.forms.registration.fname.focus();
		return false;
	}
	
	if("Last Name"==document.forms.registration.lname.value){
		alert("Please fill in your Last Name.");
		document.forms.registration.lname.focus();
		return false;
	}
	
	if("Address Line 1"==document.forms.registration.addressline1.value){
		alert("Please fill in your Address Line 1.");
		document.forms.registration.addressline1.focus();
		return false;
	}
	
	if("City"==document.forms.registration.city.value){
		alert("Please fill in your City.");
		document.forms.registration.city.focus();
		return false;
	}
	
	if("Postal/Zip Code"==document.forms.registration.postcode.value){
		alert("Please fill in your Postal/Zip Code.");
		document.forms.registration.postcode.focus();
		return false;
	}
	
	if (""==document.forms.registration.country.value){
		alert("Please select your Country.");
		document.forms.registration.country.focus();
		return false;
	}
	
	if("Home Phone No"==document.forms.registration.phone.value){
		alert("Please fill in your Home Phone No.");
		document.forms.registration.phone.focus();
		return false;
	}
	
	if (""==document.forms.registration.agegroup.value){
		alert("Please select your Age Group.");
		document.forms.registration.agegroup.focus();
		return false;
	}
	
	if (""==document.forms.registration.gnancentre.value){
		alert("Please select your Gnan Centre.");
		document.forms.registration.gnancentre.focus();
		return false;
	}
}

function Validate() {
	var chkc = document.getElementsByName('coach[]');
	var checkCount = 0;
	for (var i = 0; i < chkc.length; i++){
		if (chkc[i].checked == 1) {
			document.getElementById("cgc"+i).className = "registration_checkboxtext_in";
		}
		else{			
			document.getElementById("cgc"+i).className = "registration_checkboxtext_out";			
		}
	}
}

function validateFormCoach(registration)
{
	var chks = document.getElementsByName('coach[]');
	var checkCount = 0;
	for (var i = 0; i < chks.length; i++){
		if (chks[i].checked){
			checkCount++;
		}
	}
	if (checkCount < 1){
		alert("Please select at least one coach.");
		return false;
	}
	
	if("Name"==document.forms.registration.name.value){
		alert("Please fill in your Name.");
		document.forms.registration.name.focus();
		return false;
	}
	
	if("Address Line 1"==document.forms.registration.addressline1.value){
		alert("Please fill in your Address Line 1.");
		document.forms.registration.addressline1.focus();
		return false;
	}
	
	if("City"==document.forms.registration.city.value){
		alert("Please fill in your City.");
		document.forms.registration.city.focus();
		return false;
	}
	
	if("Postal/Zip Code"==document.forms.registration.postcode.value){
		alert("Please fill in your Postal/Zip Code.");
		document.forms.registration.postcode.focus();
		return false;
	}
	
	if (""==document.forms.registration.country.value){
		alert("Please select your Country.");
		document.forms.registration.country.focus();
		return false;
	}
	
	if("Phone No"==document.forms.registration.phone.value){
		alert("Please fill in your Phone No.");
		document.forms.registration.phone.focus();
		return false;
	}
	
}
