
function DynamicUpdate() {
var list = document.form1.selectTerm1;
var listValue = list.options[list.selectedIndex].value;
var listText = list.options[list.selectedIndex].text;
if (listValue!=null) document.form2.term2.value = listText ;
}

function DynamicUpdate2() {
var list = document.form1.poolSite1;
var listValue = list.options[list.selectedIndex].value;
var listText = list.options[list.selectedIndex].text;
if (listValue!=null) document.form2.poolSite2.value = listText ;
}

function DynamicUpdate3() {
var list = document.form1.day1;
var listValue = list.options[list.selectedIndex].value;
var listText = list.options[list.selectedIndex].text;
if (listValue!=null) document.form2.day2.value = listText ;
}


function DynamicUpdate4() {
var list = document.form1.time1;
var listValue = list.options[list.selectedIndex].value;
var listText = list.options[list.selectedIndex].text;
if (listValue!=null) document.form2.time2.value = listText ;
}

function updatechildname() {
var srcName = document.forms['form1'].elements['childName'].value;
var srcSurname = document.forms['form1'].elements['childSurName'].value;
if (srcName!=null) document.forms['form2'].elements['printbabyname'].value = srcName+' '+ srcSurname ;
}

function updateparentname() {
var srcName = document.forms['form1'].elements['parentName'].value;
var srcSurname = document.forms['form1'].elements['childSurName'].value;
if (srcName!=null) document.forms['form2'].elements['printparentsname'].value = srcName+' '+ srcSurname ;
}


function PopupCentrer(page,winName,largeur,hauteur,options) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  window.open(page,winName,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

//tac arf coc
// childName childSurName dob parentName area-code 

function checkformOK ()
{
var form1 = document.forms['form1'];
var form2 = document.forms['form2'];

//var srcHDYHAUs = ;


	if (form1.childName.value == "") {
    alert( "The field \"Child\'s name\" cannot be empty." );
    form1.childName.focus();
    return false ;
  	}
	if (form1.childSurName.value == "") {
    alert( "The field \"Child\'s Surname\" cannot be empty." );
    form1.childSurName.focus();
    return false ;
  	}
	if (form1.dob.value == "" || form1.dob.value == "dd/mm/yyyy") {
    alert( "The field \"Child\'s D.O.B.\" cannot be empty." );
    form1.dob.focus();
    return false ;
  	}
	if (form1.parentName.value == "") {
    alert( "The field \"Your name\" cannot be empty." );
    form1.parentName.focus();
    return false ;
  	}
	if (form1.areacode.value == "") {
    alert( "The field \"Telephone no.\" cannot be empty." );
    form1.areacode.focus();
    return false ;
  	}
	// phone2 mobile nextOfKin nextOfKin_phone address1 address2 address3 
	if (form1.phone2.value == "") {
    alert( "The field \"Telephone no.\" cannot be empty." );
    form1.phone2.focus();
    return false ;
  	}
	if (form1.mobile.value == "") {
    alert( "The field \"Mobile no.\" cannot be empty." );
    form1.mobile.focus();
    return false ;
  	}
	if (form1.nextOfKin.value == "") {
    alert( "The field \"Next of Kin\" cannot be empty." );
    form1.nextOfKin.focus();
    return false ;
  	}
	if (form1.nextOfKin_phone.value == "") {
    alert( "The field \"Next of Kin Tel\" cannot be empty." );
    form1.nextOfKin_phone.focus();
    return false ;
  	}
	if (form1.address1.value == "") {
    alert( "The field \"Address 1\" cannot be empty." );
    form1.address1.focus();
    return false ;
  	}
	if (form1.address2.value == "") {
    alert( "The field \"Address 2\" cannot be empty." );
    form1.address2.focus();
    return false ;
  	}
	if (form1.address3.value == "") {
    alert( "The field \"Address 3\" cannot be empty." );
    form1.address3.focus();
    return false ;
  	}
	
	if (form1.postCode.value == "") {
    alert( "The field \"Post Code\" cannot be empty." );
    form1.postCode.focus();
    return false ;
  	}
	
	/*
	if (form1.hdyhau.options[form1.hdyhau.selectedIndex].value == 0) {
    alert( "Please tell us how did your hear about us." );
    form1.hdyhau.focus();
    return false ;
  	}
	*/
	
  	if (form1.tac.checked == false) {
    alert( "Please thick the box to agree the Terms and Conditions." );
    form1.selectTerm1.focus();
    return false ;
  	}
  	if (form1.arf.checked == false) {
    alert( "Please thick the box to agree the Agreement of Risk Agreement." );
    form1.selectTerm1.focus();
    return false ;
 	 }
 	 if (form1.coc.checked == false) {
    alert( "Please thick the box to agree the Code of Conduct." );
    form1.selectTerm1.focus();
    return false ;
 	 }
	 if (form2.printparentsname.value == "") {
    alert( "The field \"Parent/Guardian \/ Appointed Representative (Print)\" cannot be empty." );
    form2.printparentsname.focus();
    return false ;
  	}
	if (form2.printbabyname.value == "") {
    alert( "The field \"Baby\'s Name (Print)\" cannot be empty." );
    form2.printbabyname.focus();
    return false ;
  	}
 	else {
  	window.print();
  	return true ;
  	}  
}


// ae_prompt function sources

function hw1()
{
if (document.form1.hdyhau.options[document.form1.hdyhau.selectedIndex].value == 2){
    ae_prompt( hw2, 'Please specify then click OK.', '');
	}
}
function hw2(n)
{
 
	if (n!=null)  document.form1.hdyhau.options[document.form1.hdyhau.selectedIndex].text = n
}
 
var ae_cb = null;
function ae$(a) { return document.getElementById(a); } 
function ae_prompt(cb, q, a) {
ae_cb = cb;
ae$('aep_t').innerHTML = document.domain;
ae$('aep_prompt').innerHTML = q;
ae$('aep_text').value = a; 
ae$('aep_ovrl').style.display = ae$('aep_ww').style.display = ''; 
ae$('aep_text').focus(); 
ae$('aep_text').select(); 
}
function ae_clk(m) { 
ae$('aep_ovrl').style.display = ae$('aep_ww').style.display = 'none'; 
if (!m) ae_cb(null); else ae_cb(ae$('aep_text').value);
}
// ae_prompt function sources

