<!--
// Global Variables
var useStandards=(document.getElementById);
var NS6=(document.getElementbyId && !document.all);
var IE=(document.all);
var NS=(navigator.appName=="Netscape" && navigator.appVersion.charAt(0)=='4');
var preloadFlag = false;
var  noIm=1; 
//----------------------------------------------------------------------------------
function valid(f) {
	if (!/^\d*$/.test(f.value)) {
		alert("Only numbers allowed!");
		f.value = f.value.replace(/[^\d]/g,"");
	}
} 
//----------------------------------------------------------------------------------
function CheckValidInfo() {
	var str=E_MailSubmission.ClientEMail.value
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	 if ((E_MailSubmission.ClientName.value.length>0) && 
		(E_MailSubmission.ClientTel.value.length>0)&& 
		(E_MailSubmission.ClientEMail.value.length>0)){	
		if (str.indexOf(at)==-1){
		   alert("Invalid Email Address")
		   return false
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid Email Address")
		   return false
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid Email Address")
		    return false
		}
		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid Email Address")
		    return false
		 }
		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid Email Address")
		    return false
		 }
		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid Email Address")
		    return false
		 }
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid Email Address")
		    return false
		 }
		if(document.getElementById("humansonly").value.length>0){
			if (confirm ("We have detected you might no be a real person. If you are please click OK") == true){
				document.getElementById("humansonly").value = "";
				return true;
			} else {
				return false;
			}
		}
		if (document.getElementById("ClientEMail").value != document.getElementById("Email2").value){
			alert("Your Email Addresses dont match. Please check and retype")
		  return false
		}
		return true
	}
	else
	{
		alert('Please complete required fields');
		return false;
	}					
}
//----------------------------------------------------------------------------------	
function showOther(id) { 
	var obj = document.getElementById(id).value;
	if (obj == "Other") { 
		courseother.style.display = "block";
	} else {
		courseother.style.display = "none";
	}
}
//----------------------------------------------------------------------------------		
function howOther(id) { 
	var obj = document.getElementById(id).value;
	if (obj == "Other") { 
		howother.style.display = "table-row";
	} else {
		howother.style.display = "none";
	}
}
//----------------------------------------------------------------------------------	
function CheckSubmitData() {
	var str=submitData.Email.value
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	 if ((submitData.Name.value.length>0) && 
		(submitData.Surname.value.length>0)&& 
		(submitData.Company.value.length>0)&& 
		(submitData.Tel.value.length>0)&& 
		(submitData.Cell.value.length>0)&&
		(submitData.How.value.length>0)&& 
		(submitData.Email.value.length>0)){	
		if (str.indexOf(at)==-1){
		   alert("Invalid Email Address")
		   return false
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid Email Address")
		   return false
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid Email Address")
		    return false
		}
		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid Email Address")
		    return false
		 }
		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid Email Address")
		    return false
		 }
		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid Email Address")
		    return false
		 }
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid Email Address")
		    return false
		 }
		if (document.getElementById("Email").value != document.getElementById("Email2").value){
			alert("Your Email Addresses dont match. Please check and retype")
		  return false
		}
		return true
	} else {
		alert('Please complete required fields');
		return false;
	}					
}
//----------------------------------------------------------------------------------
function CheckSubmitComp() {
	var at="@"
	var dot="."
	var str=submitData.Email.value
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	var strA=submitData.email1.value
	var latA=strA.indexOf(at)
	var lstrA=strA.length
	var ldotA=strA.indexOf(dot)
	 if ((submitData.Name.value.length>0) && 
		(submitData.Surname.value.length>0)&& 
		(submitData.Company.value.length>0)&& 
		(submitData.Tel.value.length>0)&& 
		(submitData.Cell.value.length>0)&&
		(submitData.Email.value.length>0)&& 
		(submitData.email1.value.length>0))
	{	
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr || strA.indexOf(at)==-1 || strA.indexOf(at)==0 || strA.indexOf(at)==lstrA){
		   alert("Invalid Email Address")
		   return false
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr || strA.indexOf(dot)==-1 || strA.indexOf(dot)==0 || strA.indexOf(dot)==lstrA){
		    alert("Invalid Email Address")
		    return false
		}
		 if (str.indexOf(at,(lat+1))!=-1 || strA.indexOf(at,(latA+1))!=-1){
		    alert("Invalid Email Address")
		    return false
		 }
		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot || strA.substring(latA-1,latA)==dot || strA.substring(latA+1,latA+2)==dot){
		    alert("Invalid Email Address")
		    return false
		 }
		 if (str.indexOf(dot,(lat+2))==-1 || strA.indexOf(dot,(latA+2))==-1){
		    alert("Invalid Email Address")
		    return false
		 }
		 if (str.indexOf(" ")!=-1 || strA.indexOf(" ")!=-1){
		    alert("Invalid Email Address")
		    return false
		 }
		return true
	}
	else
	{
		ChangeColor()
		alert('Please complete Required Fields');
		return false;
	}					
}
//----------------------------------------------------------------------------------
function ChangeColor() {
	if (submitData.Name.value.length<1) {document.getElementById('Name').style.background = "#ff9999"} else {document.getElementById('Name').style.background = "#ffffff"};
	if (submitData.Surname.value.length<1) {document.getElementById('Surname').style.background = "#ff9999"} else {document.getElementById('Surname').style.background = "#ffffff"};
	if (submitData.Company.value.length<1) {document.getElementById('Company').style.background = "#ff9999"} else {document.getElementById('Company').style.background = "#ffffff"};
	if (submitData.Tel.value.length<1) {document.getElementById('Tel').style.background = "#ff9999"} else {document.getElementById('Tel').style.background = "#ffffff"};
	if (submitData.Cell.value.length<1) {document.getElementById('Cell').style.background = "#ff9999"} else {document.getElementById('Cell').style.background = "#ffffff"};
	if (submitData.Email.value.length<1) {document.getElementById('Email').style.background = "#ff9999"} else {document.getElementById('Email').style.background = "#ffffff"};
	if (submitData.email1.value.length<1) {document.getElementById('email1').style.background = "#ff9999"} else {document.getElementById('email1').style.background = "#ffffff"};
}
//----------------------------------------------------------------------------------	
function CheckSubmitEmail() {
	var at="@"
	var dot="."
	var str=remove.txtremove.value
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	 if (remove.txtremove.value.length>0)
	{	
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid Email Address")
		   return false
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid Email Address")
		    return false
		}
		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid Email Address")
		    return false
		 }
		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid Email Address")
		    return false
		 }
		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid Email Address")
		    return false
		 }
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid Email Address")
		    return false
		 }
		return true
	}
	else
	{
		alert('Please fill in your Email Address');
		return false;
	}					
}
//----------------------------------------------------------------------------------
function CheckSubmitFax() {
	var myNumber = (Number(remove.txtArea.value)*1)&&(Number(remove.txtNumber.value)*1)
	 if (remove.txtArea.value.length>0 || remove.txtNumber.value.length>0)
	{	
		if (remove.txtArea.value.length<3){
		   alert("Please fill in your area code")
		   return false
		}
		if (remove.txtNumber.value.length<7){
		   alert("Please fill in your phone number")
		   return false
		}
		if (String(myNumber)=="NaN" ) { 
			alert("You must enter a valid number")
		  return false
		}
		return true
	}
	else
	{
		alert('Please fill in your Fax number');
		return false;
	}					
}
//----------------------------------------------------------------------------------
function showCourse(id) { 
	var obj = document.getElementById(id);
	var objValue = document.getElementById(id).value;
	if (obj.style.display == 'none')
		{obj.style.display = "block";} 
	else 
		{obj.style.display = "none";}
}
//----------------------------------------------------------------------------------	
function ChangeRef() {
	parent.document.location.href="comments.asp?ourCourseName=" + document.forms[0].ourCourseName.value;
}
//----------------------------------------------------------------------------------	
function ChangeStatus(id,usedStatus,TheNo,usedRefs,whichForm,CommentsOrder){
	var tId = id;
	var tTheCourseName = document.forms[0].ourCourseName.value;
	var tcomStatus = usedStatus;
	var tusedNos = TheNo;
	var tusedRefs = usedRefs;
	var theForm = whichForm+tId
	var tBooked = document.forms[theForm].thestatus.value;
	parent.document.location.href="comments.asp?ourCourseName=" + tTheCourseName + "&TheStatus=" + tcomStatus + "&TheNo=" + tusedNos + "&TheRefs=" + tusedRefs + "&TheID=" + tId + "-&updateStatus=" + tBooked + "&toBeUpdate=Yes&CommentsOrder=" + CommentsOrder;
}
//----------------------------------------------------------------------------------
function ChangeRefNo(id,usedStatus,TheNo,usedRefs,whichForm){
	var tId = id;
	var tTheCourseName = document.forms[0].ourCourseName.value;
	var tcomStatus = usedStatus;
	var tusedNos = TheNo;
	var tusedRefs = usedRefs;
	var theForm = whichForm+tId
	var tRefNo = document.forms[theForm].theRefNo.value;
	parent.document.location.href="comments.asp?ourCourseName=" + tTheCourseName + "&TheStatus=" + tcomStatus  + "&TheNo=" + tusedNos + "&TheRefs=" + tusedRefs + "&theId=" + tId + "&updateRefNo=" + tRefNo + "&ReftoBeUpdate=Yes";
}
//----------------------------------------------------------------------------------
function theAction(theCrs,theRef,theSta,theCnt,No,status,CommentsOrder){
	var theAction = document.getElementById('sendAction'+No).value;
	//alert(theAction);	
	if (theAction != 'do_nothing'){
		var theCourse = theCrs ;
		var theStatus = theSta ;
		var theRefs = theRef ;
		var theCount = theCnt ;
		var msg = "";
		var msgNo = 0 ;		
		for (var x = 1; x <= theCount; x++){
			var checkboxes = document.getElementById("Email"+status+x); 
			if (checkboxes.checked){
				msg = msg + checkboxes.value + "-";
				msgNo = msgNo + 1;
			}
		}
		if (msgNo==0){
			switch (No){
				case '1':
					document.myform1.sendAction1.options[0].selected = true;
					break	
				case '2':
					document.myform2.sendAction2.options[0].selected = true;
					break	
				case '3':
					document.myform3.sendAction3.options[0].selected = true;
					break	
				case '4':
					document.myform4.sendAction4.options[0].selected = true;
					break
			}
			alert("Please choose a delegate");
			return false;
		}
		switch (theAction){
			case 'status_booked':
				parent.document.location.href="comments.asp?toBeUpdate=Yes&updateStatus=Booked&ourCourseName=" + theCourse + "&TheStatus=" + theStatus + "&TheRefs=" + theRefs + "&TheID=" + msg + "&TheCount=" + msgNo + "&CommentsOrder=" + CommentsOrder;
			break	
			case 'status_pending':
				parent.document.location.href="comments.asp?toBeUpdate=Yes&updateStatus=Pending&ourCourseName=" + theCourse + "&TheStatus=" + theStatus + "&TheRefs=" + theRefs + "&TheID=" + msg + "&TheCount=" + msgNo + "&CommentsOrder=" + CommentsOrder;
			break	
			case 'status_next_course':
				parent.document.location.href="comments.asp?toBeUpdate=Yes&updateStatus=Next%20Course&ourCourseName=" + theCourse + "&TheStatus=" + theStatus + "&TheRefs=" + theRefs + "&TheID=" + msg + "&TheCount=" + msgNo + "&CommentsOrder=" + CommentsOrder;
			break	
			case 'status_not_interested':
				parent.document.location.href="comments.asp?toBeUpdate=Yes&updateStatus=Not%20Interested&ourCourseName=" + theCourse + "&TheStatus=" + theStatus + "&TheRefs=" + theRefs + "&TheID=" + msg + "&TheCount=" + msgNo + "&CommentsOrder=" + CommentsOrder;
			break	
			case 'delete':
				parent.document.location.href="comments.asp?theAction=delete&ourCourseName=" + theCourse + "&TheStatus=" + theStatus + "&TheRefs=" + theRefs + "&ToDelete=" + msg + "&TheCount=" + msgNo;
			break	
			case 'print_certificate':
				parent.document.location.href="comments.asp?theAction=print_certificate&ourCourseName=" + theCourse + "&TheStatus=" + theStatus + "&TheRefs=" + theRefs + "&ToPrint=" + msg + "&TheCount=" + msgNo;
			break		
			case 'resend_booked':
				parent.document.location.href="comments.asp?theAction=resendBooked&ourCourseName=" + theCourse + "&TheStatus=" + theStatus + "&TheRefs=" + theRefs + "&ToResend=" + msg + "&TheCount=" + msgNo;
			break		
			case 'resend_info_html':
				parent.document.location.href="comments.asp?theAction=resend_info_html&ourCourseName=" + theCourse + "&TheStatus=" + theStatus + "&TheRefs=" + theRefs + "&ToResend=" + msg + "&TheCount=" + msgNo;
			break;		
			case 'resend_info_text':
				parent.document.location.href="comments.asp?theAction=resend_info_text&ourCourseName=" + theCourse + "&TheStatus=" + theStatus + "&TheRefs=" + theRefs + "&ToResend=" + msg + "&TheCount=" + msgNo;
			break;	
			case 'booking_form':
				parent.document.location.href="comments.asp?theAction=booking_form&ourCourseName=" + theCourse + "&TheStatus=" + theStatus + "&TheRefs=" + theRefs + "&ToBookingForm=" + msg + "&TheCount=" + msgNo;
			break;
			case 'paid':
				parent.document.location.href="comments.asp?theAction=paid&ourCourseName=" + theCourse + "&TheStatus=" + theStatus + "&TheRefs=" + theRefs + "&ToPaid=" + msg + "&TheCount=" + msgNo;
			break;
			case 'send_sms':
				document.cookie = 'sendsms='+msg;
				parent.document.location.href="sendsms.asp?theAction=send_sms&ourCourseName=" + theCourse + "&TheStatus=" + theStatus + "&TheRefs=" + theRefs + "&TheCount=" + msgNo;
			break;
		}		
	}
}
//----------------------------------------------------------------------------------	
function changependingdate(theCrs,theRef,theSta,theOrd){
	var theDate = document.getElementById('pendingdate').value;
	parent.document.location.href="comments.asp?theAction=changePDate&ourCourseName=" + theCrs + "&TheStatus=" + theSta + "&TheRefs=" + theRef + "&pendingdate=" + theDate + "&CommentsOrder=" + theOrd;	
}
//----------------------------------------------------------------------------------	
function ChangeTr(id) {	
	if (document.getElementById("statsover"+id).style.backgroundColor == "#11fcff"){
		document.getElementById("statsover"+id).style.backgroundColor="#ccccff"; 
	} else {
		document.getElementById("statsover"+id).style.backgroundColor="#11fcff"; 
	}
	return true;
}
//----------------------------------------------------------------------------------
function ChangeTrBooked(id,value) {	
	if (document.getElementById("statsover"+id).style.backgroundColor == "#11fcff"){
		document.getElementById("statsover"+id).style.backgroundColor="#"+value; 
	} else {
		document.getElementById("statsover"+id).style.backgroundColor="#11fcff"; 
	}
	return true;
}
//----------------------------------------------------------------------------------	
function ChangeStats(id) {	
	var theid = id;
	document.location.href="coursestats.asp?Status1=" + theid;
}
//----------------------------------------------------------------------------------	
function ChangeAddClient() {
	parent.document.location.href="clientAdd.asp?ourRef=" + document.forms[0].txtReferenceNo.value;
}
//----------------------------------------------------------------------------------
function clearOne() {
	document.getElementById('Name1').value="";
	document.getElementById('Surname1').value="";
	document.getElementById('Email1').value="";
	document.getElementById('IDno1').value="";
}
//----------------------------------------------------------------------------------
function replaceOne() {
	document.getElementById('Name1').value=document.getElementById('Name').value;
	document.getElementById('Surname1').value=document.getElementById('Surname').value;
	document.getElementById('Email1').value=document.getElementById('Email').value;
	document.getElementById('IDno1').value=document.getElementById('IDno').value;
}
//----------------------------------------------------------------------------------
function changeHowMany(id) { 
	var objValue = document.getElementById(id).value;
	for (var x = 2; x <= 15; x++)
		{
			document.getElementById("del"+x).style.display = "none"; 
		}	
	if (objValue > 1) {
		for (var x = 2; x <= objValue; x++)
			{
				document.getElementById("del"+x).style.display = ""; 
			}	
		}
	}
//----------------------------------------------------------------------------------
function checkResponse() {
	var str=(register.Email.value).replace(/^\s*|\s*$/g,'');
	var str2=(register.EmailInvoice.value).replace(/^\s*|\s*$/g,'');
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lat2=str2.indexOf(at)
	var lstr=str.length
	var lstr2=str2.length
	var ldot=str.indexOf(dot)
	var ldot2=str2.indexOf(dot)
	if (register.yesTerms.checked)
	{
	 if ((register.Name.value.length>0) && 
		(register.Surname.value.length>0)&& 
		(register.Company.value.length>0)&& 
		(register.IDno.value.length>0)&& 
		(register.Position.value.length>0)&& 
		(register.Address.value.length>0)&& 
		(register.Tel.value.length>0)&& 
		(register.Fax.value.length>0)&& 
		(register.Cell.value.length>0)&&
		(register.VatNo.value.length>0)&& 
		(register.HowMany.value.length>0)&& 
		(register.How.value.length>0)&& 
		(register.Name1.value.length>0)&& 
		(register.Surname1.value.length>0)&& 
		(register.Email1.value.length>0)&& 
		(register.Email.value.length>0)&& 
		(register.EmailInvoice.value.length>0))
		{	
			if (str.indexOf(at)==-1 || str2.indexOf(at)==-1){
				alert("Invalid Email Address")
				ChangeColor1()
				return false
			}
			if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr || str2.indexOf(at)==-1 || str2.indexOf(at)==0 || str2.indexOf(at)==lstr2){
			   alert("Invalid Email Address")
				ChangeColor1()
			   return false
			}
			if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr || str2.indexOf(dot)==-1 || str2.indexOf(dot)==0 || str2.indexOf(dot)==lstr2){
			    alert("Invalid Email Address")
				ChangeColor1()
			    return false
			}
			 if (str.indexOf(at,(lat+1))!=-1 || str2.indexOf(at,(lat2+1))!=-1){
			    alert("Invalid Email Address")
				ChangeColor1()
			    return false
			 }
			 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot || str2.substring(lat2-1,lat2)==dot || str2.substring(lat2+1,lat2+2)==dot){
			    alert("Invalid Email Address")
				ChangeColor1()
			    return false
			 }
			 if (str.indexOf(dot,(lat+2))==-1 || str2.indexOf(dot,(lat2+2))==-1){
			    alert("Invalid Email Address")
				ChangeColor1()
			    return false
			 }
			 if (str.indexOf(" ")!=-1 || str2.indexOf(" ")!=-1){
			    alert("Invalid Email Address")
				ChangeColor1()
			    return false
			 }
			return true
		}
		else
		{
			ChangeColor1()
			alert('Please complete All fields');
			return false;
		}	
	}else {	
			alert('Please accept Terms & Conditions');
			return false;	
	}		
}
//----------------------------------------------------------------------------------
function ChangeColor1() {
	if (register.Name.value.length<1) {document.getElementById('Name').style.background = "#ff9999"} else {document.getElementById('Name').style.background = "#ffffff"};
	if (register.Surname.value.length<1) {document.getElementById('Surname').style.background = "#ff9999"} else {document.getElementById('Surname').style.background = "#ffffff"};
	if (register.Company.value.length<1) {document.getElementById('Company').style.background = "#ff9999"} else {document.getElementById('Company').style.background = "#ffffff"};
	if (register.IDno.value.length<1) {document.getElementById('IDno').style.background = "#ff9999"} else {document.getElementById('IDno').style.background = "#ffffff"};
	if (register.Position.value.length<1) {document.getElementById('Position').style.background = "#ff9999"} else {document.getElementById('Position').style.background = "#ffffff"};
	if (register.Address.value.length<1) {document.getElementById('Address').style.background = "#ff9999"} else {document.getElementById('Address').style.background = "#ffffff"};
	if (register.Tel.value.length<1) {document.getElementById('Tel').style.background = "#ff9999"} else {document.getElementById('Tel').style.background = "#ffffff"};
	if (register.Fax.value.length<1) {document.getElementById('Fax').style.background = "#ff9999"} else {document.getElementById('Fax').style.background = "#ffffff"};
	if (register.Cell.value.length<1) {document.getElementById('Cell').style.background = "#ff9999"} else {document.getElementById('Cell').style.background = "#ffffff"};
	if (register.VatNo.value.length<1) {document.getElementById('VatNo').style.background = "#ff9999"} else {document.getElementById('VatNo').style.background = "#ffffff"};
	if (register.HowMany.value.length<1) {document.getElementById('HowMany').style.background = "#ff9999"} else {document.getElementById('HowMany').style.background = "#ffffff"};
	if (register.How.value.length<1) {document.getElementById('How').style.background = "#ff9999"} else {document.getElementById('How').style.background = "#ffffff"};
	if (register.Email.value.length<1) {document.getElementById('Email').style.background = "#ff9999"} else {document.getElementById('Email').style.background = "#ffffff"};
	if (register.EmailInvoice.value.length<1) {document.getElementById('EmailInvoice').style.background = "#ff9999"} else {document.getElementById('EmailInvoice').style.background = "#ffffff"};
	if (register.Name1.value.length<1) {document.getElementById('Name1').style.background = "#ff9999"} else {document.getElementById('Name1').style.background = "#ffffff"};
	if (register.Surname1.value.length<1) {document.getElementById('Surname1').style.background = "#ff9999"} else {document.getElementById('Surname1').style.background = "#ffffff"};
	if (register.Email1.value.length<1) {document.getElementById('Email1').style.background = "#ff9999"} else {document.getElementById('Email1').style.background = "#ffffff"};
}
//----------------------------------------------------------------------------------
function onlyDigits(e) {
	var isIE = document.all?true:false;
	var isNS = document.layers?true:false;
	var _ret = true;
	if (isIE) {
		if (window.event.keyCode < 46 || window.event.keyCode > 57) {
			window.event.keyCode = 0;
			_ret = false;
		}
	}
	if (isNS) {
		if (e.which < 46 || e.which > 57) {
			e.which = 0;
			_ret = false;
		}
	}
	return (_ret); 
}
//----------------------------------------------------------------------------------
function checkAll(Tstatus,value){
	var theCount = document.getElementById('theCount_'+Tstatus).value;
	for (var x = 1; x <= theCount; x++)
		{
			if (document.getElementById('SelectAll_'+Tstatus).checked == true)
			{
 				document.getElementById(value+Tstatus+x).checked = true;
 			}else {
 				document.getElementById(value+Tstatus+x).checked = false;
 			}
 		}
}
//----------------------------------------------------------------------------------
function attendanceRegister() {
	parent.document.location.href="register_form.asp?TheCourseName=" + document.forms[0].TheCourseName.value;
}
//----------------------------------------------------------------------------------
function enrolledForm() {
	parent.document.location.href="enrolled_form.asp?TheCourseName=" + document.forms[0].TheCourseName.value;
}
//----------------------------------------------------------------------------------
function PrintDiv(id){ 
	var disp_setting="width=1000, height=600, left=100, top=25"; 
	var content_vlue = document.getElementById(id).innerHTML; 
	var docprint=window.open("","",disp_setting); 
		docprint.document.open(); 
		docprint.document.write('<html><head><title>Enrolled Form<\/title>'); 
		docprint.document.write('<link rel="stylesheet" type="text/css" href="../data/stylesheet.css">'); 
		docprint.document.write('<\/head><body style="background-color:#ffffff"><center>');          
		docprint.document.write(content_vlue);          
		docprint.document.write('<\/center><\/body><\/html>'); 
		docprint.document.close(); 
		docprint.focus(); 
		docprint.print();
		docprint.close();
}
//----------------------------------------------------------------------------------
function dropdown(sel){ 
	var theNum =  sel.options[sel.selectedIndex].value
	for (var x = 2; x <= 10; x++)
  	{
    	var id ="f" + x
			var obj = document.getElementById(id);
			obj.style.display = "none";
		}
	for (var x = 2; x <= theNum; x++)
  	{
    	var id ="f" + x
			var obj = document.getElementById(id);
			if (IE) {
				obj.style.display = "block";
			} else {
				obj.style.display = "table-row";
			}
		}
} 
//----------------------------------------------------------------------------------
function CheckFriends() {
	var at="@"
	var dot="."
	var str=submitData.email1.value
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	 if ((submitData.friend1.value.length>0)&& 
		(submitData.email1.value.length>0))
	{	
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid Email Address")
		   return false
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid Email Address")
		    return false
		}
		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid Email Address")
		    return false
		 }
		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid Email Address")
		    return false
		 }
		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid Email Address")
		    return false
		 }
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid Email Address")
		    return false
		 }
		return true
	}
	else
	{
		ChangeColor2()
		alert('Please complete Required Fields');
		return false;
	}					
}
//----------------------------------------------------------------------------------
function ChangeColor2() {
	if (submitData.friend1.value.length<1) {document.getElementById('friend1').style.background = "#ff9999"} else {document.getElementById('friend1').style.background = "#ffffff"};
	if (submitData.email1.value.length<1) {document.getElementById('email1').style.background = "#ff9999"} else {document.getElementById('email1').style.background = "#ffffff"};
}
//----------------------------------------------------------------------------------
function copyalldays(){
	if (confirm ('Are you sure you want to copy to all days? \nExisting content will be overwritten.') == true){
		return true
	} else {
		return false
	}
}
//----------------------------------------------------------------------------------
function copyallcourses(){
	if (confirm ('Are you sure you want to copy to all courses? \nExisting content will be overwritten.') == true){
		return true
	} else {
		return false
	}
}
//----------------------------------------------------------------------------------
function resizeIframe(theid,thepos){
	document.getElementById(theid).style.height=100
	document.getElementById(theid).style.height=window.frames[theid].document.body.scrollHeight + 20 + "px"
	parent.location.hash=thepos
}
//----------------------------------------------------------------------------------
function PrintCourses(id,value){ 
	var disp_setting="width=500, height=300, left=50, top=50"; 
	var content_vlue = document.getElementById(id).innerHTML;  
	var content2_vlue = document.getElementById(value).innerHTML; 
	var docprint=window.open("","",disp_setting); 
		docprint.document.open(); 
		docprint.document.write('<html><head><title>Courses<\/title>'); 
		docprint.document.write('<link rel="stylesheet" type="text/css" href="../data/stylesheet.css">'); 
		docprint.document.write('<\/head><body style="background-color:#ffffff">');          
		docprint.document.write(content_vlue);                   
		docprint.document.write(content2_vlue);          
		docprint.document.write('<\/body><\/html>'); 
		docprint.document.close(); 
		docprint.focus(); 
		docprint.print();
		docprint.close();
}
//----------------------------------------------------------------------------------
function printSchedule(id){ 
	var disp_setting="width=500, height=300, left=50, top=50"; 
	var content_vlue = document.getElementById(id).innerHTML;  
	var docprint=window.open("","",disp_setting); 
		docprint.document.open(); 
		docprint.document.write('<html><head><title>Courses Schedule<\/title>'); 
		docprint.document.write('<link rel="stylesheet" type="text/css" href="../data/stylesheet.css">'); 
		docprint.document.write('<\/head><body style="background-color:#ffffff">');          
		docprint.document.write(content_vlue);           
		docprint.document.write('<\/body><\/html>'); 
		docprint.document.close(); 
		docprint.focus(); 
		docprint.print();
		docprint.close();
}
//----------------------------------------------------------------------------------
function printStats(id,thename){ 
	var disp_setting="width=500, height=300, left=50, top=50"; 
	var content_vlue = document.getElementById(id).innerHTML;  
	var docprint=window.open("","",disp_setting); 
		docprint.document.open(); 
		docprint.document.write('<html><head><title>'+thename+'<\/title>'); 
		docprint.document.write('<link rel="stylesheet" type="text/css" href="../data/stylesheet.css">'); 
		docprint.document.write('<\/head><body style="background-color:#ffffff">');          
		docprint.document.write(content_vlue);           
		docprint.document.write('<\/body><\/html>'); 
		docprint.document.close(); 
		docprint.focus(); 
		docprint.print();
		docprint.close();
}
//----------------------------------------------------------------------------------
function checkSchedule() {
	 if (document.getElementById("newDate").value.length>0){
		return true
	} else {
		alert('Please add a Date');
		return false;
	}					
}
//----------------------------------------------------------------------------------	
function CheckSendEmail() {
	var str=submitData.Email.value
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	 if (submitData.Email.value.length>0){	
		if (str.indexOf(at)==-1){
		   alert("Invalid Email Address")
		   return false
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid Email Address")
		   return false
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid Email Address")
		    return false
		}
		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid Email Address")
		    return false
		 }
		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid Email Address")
		    return false
		 }
		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid Email Address")
		    return false
		 }
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid Email Address")
		    return false
		 }
		return true
	} else {
		alert('Please fill in the email address');
		return false;
	}					
}
//----------------------------------------------------------------------------------	
