	function Validate(){
	
		if(document.frmMember.txtFirstName.value ==""){
			alert("Please your first name.");
			document.frmMember.txtFirstName.focus();
			return false;
		}
	
		if(document.frmMember.txtSurname.value ==""){
			alert("Please your surname.");
			document.frmMember.txtSurname.focus();
			return false;
		}
	
		if(document.frmMember.txtEmailAddress.value ==""){
			alert("Please enter a valid email address");
			document.frmMember.txtEmailAddress.focus();
			return false;
		}
		
		myOption = -1;
		for (i=document.frmMember.rdoGender.length-1; i > -1; i--) {
			if (document.frmMember.rdoGender[i].checked) {
			myOption = i; i = -1;
			}
		}
		if (myOption == -1) {
			alert("Please select your gender");
			return false;
		}
		
		myOption2 = -1;
		for (i=document.frmMember.rdoUpdates.length-1; i > -1; i--) {
			if (document.frmMember.rdoUpdates[i].checked) {
			myOption2 = i; i = -1;
			}
		}
		if (myOption2 == -1) {
			alert("Would you like to receive updates and special offers from www.christopherchronis.com.au?");
			return false;
		}
	
		myOption3 = -1;
		for (i=document.frmMember.rdoAgree.length-1; i > -1; i--) {
			if (document.frmMember.rdoAgree[i].checked) {
			myOption3 = i; i = -1;
			}
		}
		if (myOption3 == -1) {
			alert("Do you agree with the site privacy policy and legal disclaimer from www.christopherchronis.com.au?");
			return false;
		}
		
		if (myOption3 == 1) {
			alert("To register for updates from www.christopherchronis.com.au you must agree with the site privacy policy and legal disclaimer.");
			return false;
		}
	document.frmMember.submit();
	}

	function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}

	function ValidateForm(){
		var emailID = document.frmNewsletter.txtEmailAddress
	
		if ((emailID.value==null)||(emailID.value=="")){
			alert("Please Enter your Email ID")
			emailID.focus()
			return false
		}
		if (echeck(emailID.value)==false){
			emailID.value=""
			emailID.focus()
			return false
		}
	document.frmNewsletter.submit();
	}


//-----------------------------------------------------------------
// START CODE FOR PHOTO DISPLAY
//-----------------------------------------------------------------
if (document.images)
   {
     photo_btn_on= new Image(20,14);
     photo_btn_on.src="images/photo_btn_on.gif";
     photo_btn_off= new Image(20,14);
     photo_btn_off.src="images/photo_btn_off.gif";

     image_off= new Image(300,199);
     image_off.src="photos/01.jpg";

     image1= new Image(300,199);
     image1.src="images/01.jpg";
     image2= new Image(300,199);
     image2.src="images/02.jpg";
     image3= new Image(300,199);
     image3.src="images/03.jpg";
     image4= new Image(300,199);
     image4.src="images/04.jpg";
     image5= new Image(300,199);
     image5.src="images/05.jpg";
   }

function changepic(picName,imgName)
 {
   if (document.images)
    {
      imgOn=eval(imgName + ".src");
      document[picName].src= imgOn;
    }
 }
//-----------------------------------------------------------------
// END CODE FOR PHOTO DISPLAY
//-----------------------------------------------------------------


