/*
This script is written by Eric (Webcrawl@usa.net)
For full source code, installation instructions,
100's more DHTML scripts, and Terms of Use, 
visit dynamicdrive.com
*/
var NS = (navigator.appName == "Netscape");
var VERSION = parseInt(navigator.appVersion);
//nav is returned as false by Internet Explorer, returned as true by Netscape and Firefox
var nav=window.Event  ? true:false;
//alert(nav);

function printit() {
if (NS) {
    window.print() ;
} else {
    //var webBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 //CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
//document.body.insertAdjacentHTML('beforeEnd', webBrowser);
   // WebBrowser1.ExecWB(6,2); //Use a 1 vs, a 2 for a prompting dialog box
//WebBrowser1.outerHTML= "";
window.print();
}
}
//-----------------------------------------------------------------
// sect form
	    function validt()
	      {
			var b=1;
			var the_text;
			var regexpn=/[a-z,A-Z,0-9,-]*@[a-z,A-Z,0-9,-]*\.[a-z,A-Z]*/;
			the_text=window.document.form1.em.value;
			
			//alert(+the_text);
			if(the_text=="")
			  {
				alert("Please enter a valid email address into the email box");
				b=0;
				return b;
			  }
			  //res=the_text.match(regexpn);
			  //alert("the result="+res);
			if(the_text.match(regexpn)==null )
			  {
					alert("Please enter a valid email address (of the form xxxx@xxxx.xxx) into the email box");
					b=0;
					return b;
			  }
			  if(window.document.form1.sub.value=="")
			     {
					alert("Please enter something into the Subject box");
					b=0;
					return b;
				}
			if(window.document.form1.mes.value=="")
			   {
				alert("Please enter something into the Message box");
				b=0;
				return b;
			}
		  }
//-----------------------------------------------------------------
//contwho form
function validts()
	      {
			var b=1;
			var the_text;
			var regexpn=/[a-z,A-Z,0-9,-]*@[a-z,A-Z,0-9,-]*\.[a-z,A-Z]*/;
			the_text=window.document.form1.em.value;
			
			//alert(+the_text);
			if(the_text=="")
			  {
				alert("Please enter a valid email address into the email box");
				b=0;
				return b;
			  }
			  //res=the_text.match(regexpn);
			  //alert("the result="+res);
			if(the_text.match(regexpn)==null )
			  {
					alert("Please enter a valid email address (of the form xxxx@xxxx.xxx) into the email box");
					b=0;
					return b;
			  }
			  if(window.document.form1.sub.value=="")
			     {
					alert("Please enter something into the Subject box");
					b=0;
					return b;
				}
			if(window.document.form1.mes.value=="")
			   {
				alert("Please enter something into the Message box");
				b=0;
				return b;
			}
		  }
//-----------------------------------------------------------------
//contrm form
function validte()
	      {
			var b=1;
			var the_text;
			var regexpn=/[a-z,A-Z,0-9,-]*@[a-z,A-Z,0-9,-]*\.[a-z,A-Z]*/;
			the_text=window.document.form1.em.value;
			
			//alert(+the_text);
			if(the_text=="")
			  {
				alert("Please enter a valid email address into the email box");
				b=0;
				return b;
			  }
			  //res=the_text.match(regexpn);
			  //alert("the result="+res);
			if(the_text.match(regexpn)==null )
			  {
					alert("Please enter a valid email address (of the form xxxx@xxxx.xxx) into the email box");
					b=0;
					return b;
			  }
			  if(window.document.form1.sub.value=="")
			     {
					alert("Please enter something into the Subject box");
					b=0;
					return b;
				}
			if(window.document.form1.mes.value=="")
			   {
				alert("Please enter something into the Message box");
				b=0;
				return b;
			}
		  }
//-----------------------------------------------------------------
//this function prevents user from submitting form until they click on the Submit button
function KeyDown(e)

   {
   var code;
   var b=1;
   if(nav)
{
  code=e.which;
//alert(code);
}
else
{
   code=event.keyCode;
//alert(code);
}
   //window.alert("keycode"+code);
   if (code==13)
   {
   b=0;
//alert('b='+b);
   return false;
   }
   if (b=1)
   {
   return true;
   }
   } 
//----------------------------------------------------------------
//new members form
//this function checks some of the input fields for entries when the user clicks on the Submit button	
function nmvalidat()
{
 var b=1;
   if (window.document.form1.initials.value=='')
     {
	  alert("You need to type something into the Initial(s) box");
	  b=0;
	  return b;
	 }
  if (window.document.form1.firstnames.value=='')
    {
                alert("You need to type something into the Forename(s) box");
	  b=0;
	  return b;
                 }
  if (window.document.form1.surname.value=='')
    {
                alert("You need to type something into the Surname box");
	  b=0;
	  return b;
                 }
  if (window.document.form1.address1.value=='')
    {
                alert("You need to type something into the Address1 box");
	  b=0;
	  return b;
                 }
  if (window.document.form1.address4.value=='')
    {
                alert("You need to type something into the Postal Town box");
  	  b=0;
  	  return b;
                 }
  if (window.document.form1.postzip.value=='')
    {
                alert("You need to type something into the Post or Zip Code box");
	  b=0;
	  return b;
                 }
  if(window.document.form1.dob.value=='')
    {
       alert("You need to select something into the Date of birth box");
	  b=0;
	  return b;
              }
  dob=window.document.form1.dob.value;
  //alert('dob='+dob);
  day=Number((dob.slice(0,2)));
  //alert('day='+day);
  mon=Number((dob.slice(3,5)));
  //alert('mon='+mon);
  yer=Number((dob.slice(6,10)));
  //alert('yer='+yer);
  if(day<1 || day>31 || isNaN(day))
   {
   alert("Enter a day between 01 and 31 into the Date of Birth box");
   b=0;
   return b;
   }
  if(mon<1 || mon>12 || isNaN(mon))
   {
   alert("Enter a month between 01 and 12 into the Date of Birth box");
   b=0;
   return b;
   }
  if(yer<1900 || yer>2050)
   {
   alert("Enter a year between 1900 and 2008 into the Date of Birth box");
   b=0;
   return b;
   }
  if(window.document.form1.email.value=='')
    {
	alert("You need to type a number into the e-mail box");	
	b=0;
	return b;            
	}
  if(window.document.form1.phonenoday.value=='')
    {
	alert("You need to type a number into the Phone no. day box, without spaces");
	b=0;
	return b;
	}
  if(isNaN(window.document.form1.phonenoday.value))
	{
	alert("You need to type a number into the Phone no. day box, without spaces");
	b=0;
	return b; 
	}
if(window.document.form1.elements[16].checked==false && window.document.form1.elements[17].checked==false)
	{
	     alert("You need to click on the Joining for the next 5 years or Joining for 1 year");
		 b=0;
		 return b;
	}
//alert(document.form1.country.VALUE);
//  if (typeof(window.document.form1.country.value)=='undefined')
//    {
//                alert("you need to select something into the Country box");
//	  b=0;
//	  return b;
//                 }
//alert(window.document.form1.elements[17].value);
// if(window.document.form1.elements[27].checked)
//   {

//     }
     //alert(window.document.form1.chkbx1.checked);
 
 }

//---------------------------------------------------------------
function callBack(val)
   {
        //alert(val);
        window.location.replace("membform1.php?SearchIn="+val);
   }
//---------------------------------------------------------------	
 //----------------------------------------------------------------
//this function gets the value of address4 field and copies it to
//the state boc forther down the form
function getadd4()
{
	var add4="";
	if(window.document.form1.address4.value!=''){
		add4=window.document.form1.address4.value;
		window.document.form1.state.value=add4;
	}
	return add4;
}  
//----------------------------------------------------------------
//new members application form 2
//this function checks some of the input fields for entries when the user clicks on the Submit button	
function nm2validat()
{
	var b=1;
	var f1,s1,d1,f2,s2,d2,f3,s3,d3,f4,s4,d4;
	if(window.document.form1.nomfmem1.value==''){
		f1=0;
		}else{
		f1=1;
		}
	if(window.document.form1.nomsmem1.value==''){
		s1=0;
		}else{
		s1=1;
		}
	if(window.document.form1.dob2.value==''){
		d1=0;
		}else{
		d1=1;
		}
	if(f1==1){
		if(s1==0){
			alert('you must type something into the surname for Nominated member 1');
			b=0;
			return b;
		}
	}
	if(s1==1){
		if(f1==0){
			alert('you must type something into the forename for Nominated member 1');
			b=0;
			return b;
		}
	}
	if((s1==1) && (f1==1)){
		if(d1==0){
			alert('you must type something into the date of birth box opposite Nominated member 1');
			b=0;
			return b;
		}else{
	
                dob=window.document.form1.dob2.value;
               //alert('dob='+dob);
                day=Number((dob.slice(0,2)));
               //alert('day='+day);
                mon=Number((dob.slice(3,5)));
               //alert('mon='+mon);
                yer=Number((dob.slice(6,10)));
               //alert('yer='+yer);
                if(day<1 || day>31 || isNaN(day))
                {
                   alert("enter a day between 01 and 31 into the Date of birth box opposite Nominated member 1");
                   b=0;
                   return b;
                }
                if(mon<1 || mon>12 || isNaN(mon))
                {
                   alert("enter a month between 01 and 12 into the Date of birth box opposite Nominated member 1");
                   b=0;
                   return b;
                }
                if(yer<1900 || yer>2050)
                {
                   alert("enter a year between 1900 and 2050 into the Date of birth box opposite Nominated member 1");
                   b=0;
                   return b;
                }
        }
	}
	if(window.document.form1.nomfmem2.value==''){
		f2=0;
		}else{
		f2=1;
		}
	if(window.document.form1.nomsmem2.value==''){
		s2=0;
		}else{
		s2=1;
		}
	if(window.document.form1.dob3.value==''){
		d2=0;
		}else{
		d2=1;
		}
	if(f2==1){
		if(s2==0){
			alert('you must type something into the surname for Nominated member 2');
			b=0;
			return b;
		}
	}
	if(s2==1){
		if(f2==0){
			alert('you must type something into the forename for Nominated member 2');
			b=0;
			return b;
		}
	}
	if((s2==1) && (f2==1)){
		if(d2==0){
			alert('you must type something into the date of birth box opposite Nominated member 2');
			b=0;
			return b;
		}else{
	
	
                dob=window.document.form1.dob3.value;
               //alert('dob='+dob);
                day=Number((dob.slice(0,2)));
               //alert('day='+day);
                mon=Number((dob.slice(3,5)));
               //alert('mon='+mon);
                yer=Number((dob.slice(6,10)));
               //alert('yer='+yer);
                if(day<1 || day>31 || isNaN(day))
                {
                   alert("enter a day between 01 and 31 into the Date of birth box opposite Nominated member 2");
                   b=0;
                   return b;
                }
                if(mon<1 || mon>12 || isNaN(mon))
                {
                   alert("enter a month between 01 and 12 into the Date of birth box opposite Nominated member 2");
                   b=0;
                   return b;
                }
                if(yer<1900 || yer>2050)
                {
                   alert("enter a year between 1900 and 2050 into the Date of birth box opposite Nominated member 2");
                   b=0;
                   return b;
                }
        }
	}
	if(window.document.form1.nomfmem3.value==''){
		f3=0;
		}else{
		f3=1;
		}
	if(window.document.form1.nomsmem3.value==''){
		s3=0;
		}else{
		s3=1;
		}
	if(window.document.form1.dob4.value==''){
		d3=0;
		}else{
		d3=1;
		}
	if(f3==1){
		if(s3==0){
			alert('you must type something into the surname for Nominated member 3');
			b=0;
			return b;
		}
	}
	if(s3==1){
		if(f3==0){
			alert('you must type something into the forename for Nominated member 3');
			b=0;
			return b;
		}
	}
	if((s3==1) && (f3==1)){
		if(d3==0){
			alert('you must type something into the date of birth box opposite Nominated member 3');
			b=0;
			return b;
		}else{
	
	
                dob=window.document.form1.dob4.value;
               //alert('dob='+dob);
                day=Number((dob.slice(0,2)));
               //alert('day='+day);
                mon=Number((dob.slice(3,5)));
               //alert('mon='+mon);
                yer=Number((dob.slice(6,10)));
               //alert('yer='+yer);
                if(day<1 || day>31 || isNaN(day))
                {
                   alert("enter a day between 01 and 31 into the Date of birth box opposite Nominated member 3");
                   b=0;
                   return b;
                }
                if(mon<1 || mon>12 || isNaN(mon))
                {
                   alert("enter a month between 01 and 12 into the Date of birth box opposite Nominated member 3");
                   b=0;
                   return b;
                }
                if(yer<1900 || yer>2050)
                {
                   alert("enter a year between 1900 and 2050 into the Date of birth box opposite Nominated member 3");
                   b=0;
                   return b;
         }       }
	}
	if(window.document.form1.nomfmem4.value==''){
		f4=0;
		}else{
		f4=1;
		}
	if(window.document.form1.nomsmem4.value==''){
		s4=0;
		}else{
		s4=1;
		}
	if(window.document.form1.dob5.value==''){
		d4=0;
		}else{
		d4=1;
		}
	if(f4==1){
		if(s4==0){
			alert('you must type something into the surname for Nominated member 4');
			b=0;
			return b;
		}
	}
	if(s4==1){
		if(f4==0){
			alert('you must type something into the forename for Nominated member 4');
			b=0;
			return b;
		}
	}
	if((s4==1) && (f4==1)){
		if(d4==0){
			alert('you must type something into the date of birth box opposite Nominated member 4');
			b=0;
			return b;
		}else{
	
        
                dob=window.document.form1.dob5.value;
               //alert('dob='+dob);
                day=Number((dob.slice(0,2)));
               //alert('day='+day);
                mon=Number((dob.slice(3,5)));
               //alert('mon='+mon);
                yer=Number((dob.slice(6,10)));
               //alert('yer='+yer);
                if(day<1 || day>31 || isNaN(day))
                {
                   alert("enter a day between 01 and 31 into the Date of birth box opposite Nominated member 4");
                   b=0;
                   return b;
                }
                if(mon<1 || mon>12 || isNaN(mon))
                { 
                   alert("enter a month between 01 and 12 into the Date of birth box opposite Nominated member 4");
                   b=0;
                   return b;
                }
                if(yer<1900 || yer>2050)
                {
                   alert("enter a year between 1900 and 2050 into the Date of birth box opposite Nominated member 4");
                   b=0;
                   return b;
                }
		}        
	}
	if(window.document.form1.famfmem1.value==''){
		f1=0;
		}else{
		f1=1;
		}
	if(window.document.form1.famsmem1.value==''){
		s1=0;
		}else{
		s1=1;
		}
	if(window.document.form1.dob6.value==''){
		d1=0;
		}else{
		d1=1;
		}
	if(f1==1){
		if(s1==0){
			alert('you must type something into the surname for Family member 1');
			b=0;
			return b;
		}
	}
	if(s1==1){
		if(f1==0){
			alert('you must type something into the forename for Family member 1');
			b=0;
			return b;
		}
	}
	if((s1==1) && (f1==1)){
		if(d1==0){
			alert('you must type something into the date of birth box opposite Family member 1');
			b=0;
			return b;
		}else{
	
                dob=window.document.form1.dob6.value;
               //alert('dob='+dob);
                day=Number((dob.slice(0,2)));
               //alert('day='+day);
                mon=Number((dob.slice(3,5)));
               //alert('mon='+mon);
                yer=Number((dob.slice(6,10)));
               //alert('yer='+yer);
                if(day<1 || day>31 || isNaN(day))
                {
                   alert("enter a day between 01 and 31 into the Date of birth box opposite Family member 1");
                   b=0;
                   return b;
                }
                if(mon<1 || mon>12 || isNaN(mon))
                {
                   alert("enter a month between 01 and 12 into the Date of birth box opposite Family member 1");
                   b=0;
                   return b;
                }
                if(yer<1900 || yer>2050)
                {
                   alert("enter a year between 1900 and 2050 into the Date of birth box opposite Family member 1");
                   b=0;
                   return b;
                }
        }
	}
	if(window.document.form1.famfmem2.value==''){
		f2=0;
		}else{
		f2=1;
		}
	if(window.document.form1.famsmem2.value==''){
		s2=0;
		}else{
		s2=1;
		}
	if(window.document.form1.dob7.value==''){
		d2=0;
		}else{
		d2=1;
		}
	if(f2==1){
		if(s2==0){
			alert('you must type something into the surname for Family member 2');
			b=0;
			return b;
		}
	}
	if(s2==1){
		if(f2==0){
			alert('you must type something into the forename for Family member 2');
			b=0;
			return b;
		}
	}
	if((s2==1) && (f2==1)){
		if(d2==0){
			alert('you must type something into the date of birth box opposite Family member 2');
			b=0;
			return b;
		}else{
	
                dob=window.document.form1.dob7.value;
               //alert('dob='+dob);
                day=Number((dob.slice(0,2)));
               //alert('day='+day);
                mon=Number((dob.slice(3,5)));
               //alert('mon='+mon);
                yer=Number((dob.slice(6,10)));
               //alert('yer='+yer);
                if(day<1 || day>31 || isNaN(day))
                {
                   alert("enter a day between 01 and 31 into the Date of birth box opposite Family member 2");
                   b=0;
                   return b;
                }
                if(mon<1 || mon>12 || isNaN(mon))
                {
                   alert("enter a month between 01 and 12 into the Date of birth box opposite Family member 2");
                   b=0;
                   return b;
                }
                if(yer<1900 || yer>2050)
                {
                   alert("enter a year between 1900 and 2050 into the Date of birth box opposite Family member 2");
                   b=0;
                   return b;
                }
        }
	}
	if(window.document.form1.famfmem3.value==''){
		f3=0;
		}else{
		f3=1;
		}
	if(window.document.form1.famsmem3.value==''){
		s3=0;
		}else{
		s3=1;
		}
	if(window.document.form1.dob8.value==''){
		d3=0;
		}else{
		d3=1;
		}
	if(f3==1){
		if(s3==0){
			alert('you must type something into the surname for Family member 3');
			b=0;
			return b;
		}
	}
	if(s3==1){
		if(f3==0){
			alert('you must type something into the forename for Family member 3');
			b=0;
			return b;
		}
	}
	if((s3==1) && (f3==1)){
		if(d3==0){
			alert('you must type something into the date of birth box opposite Family member 3');
			b=0;
			return b;
		}else{
	
                dob=window.document.form1.dob8.value;
               //alert('dob='+dob);
                day=Number((dob.slice(0,2)));
               //alert('day='+day);
                mon=Number((dob.slice(3,5)));
               //alert('mon='+mon);
                yer=Number((dob.slice(6,10)));
               //alert('yer='+yer);
                if(day<1 || day>31 || isNaN(day))
                {
                   alert("enter a day between 01 and 31 into the Date of birth box opposite Family member 3");
                   b=0;
                   return b;
                }
                if(mon<1 || mon>12 || isNaN(mon))
                {
                   alert("enter a month between 01 and 12 into the Date of birth box opposite Family member 3");
                   b=0;
                   return b;
                }
                if(yer<1900 || yer>2050)
                {
                   alert("enter a year between 1900 and 2050 into the Date of birth box opposite Family member 3");
                   b=0;
                   return b;
                }
        }
	}
	if(window.document.form1.famfmem4.value==''){
		f4=0;
		}else{
		f4=1;
		}
	if(window.document.form1.famsmem4.value==''){
		s4=0;
		}else{
		s4=1;
		}
	if(window.document.form1.dob9.value==''){
		d4=0;
		}else{
		d4=1;
		}
	if(f4==1){
		if(s4==0){
			alert('you must type something into the surname for Family member 3');
			b=0;
			return b;
		}
	}
	if(s4==1){
		if(f4==0){
			alert('you must type something into the forename for Family member 3');
			b=0;
			return b;
		}
	}
	if((s4==1) && (f4==1)){
		if(d4==0){
			alert('you must type something into the date of birth box opposite Family member 4');
			b=0;
			return b;
		}else{
	
                dob=window.document.form1.dob9.value;
               //alert('dob='+dob);
                day=Number((dob.slice(0,2)));
               //alert('day='+day);
                mon=Number((dob.slice(3,5)));
               //alert('mon='+mon);
                yer=Number((dob.slice(6,10)));
               //alert('yer='+yer);
                if(day<1 || day>31 || isNaN(day))
                {
                   alert("enter a day between 01 and 31 into the Date of birth box opposite Family member 4");
                   b=0;
                   return b;
                }
                if(mon<1 || mon>12 || isNaN(mon))
                {
                   alert("enter a month between 01 and 12 into the Date of birth box opposite Family member 4");
                   b=0;
                   return b;
                }
                if(yer<1900 || yer>2050)
                {
                   alert("enter a year between 1900 and 2050 into the Date of birth box opposite Family member 4");
                   b=0;
                   return b;
                }
        }
	}
	
}
 //----------------------------------------------------------------
 //new members application form 3 mod
function nm3validat()
{
	var b=1;

	if(window.document.form1.elements[0].checked==false)
	  { 
	  if (window.document.form1.elements[1].checked==false)
	    {
		alert("Please select Yes or No");
		b=0;
		return b;
	    }
	  }
	  if(window.document.form1.elements[0].checked==true)
	     {
		  if(window.document.form1.prefname.value=='')
		  {
			alert("type something into the Preferred name box");
			b=0;
			return b;
		  }	
		  if(window.document.form1.phone1.value=='')
		  {
			alert("Type a number into the Contact 1 box");
			b=0;
			return b;
		  }
		  if(window.document.form1.town.value=='')
		  {
			alert("Type something into the Location box");
			b=0;
			return b;			
		  }                      
                  if(window.document.form1.country2.value=='UK')
                  {
			if(window.document.form1.state.value=='')
			{
				alert("Type something into the County box");
				b=0;
				return b;
			}
		  }
		  if(window.document.form1.elements[8].checked==false)
		    {
			 if(window.document.form1.elements[9].checked==false)
			 {
				alert("Select one or both of the Emergency help and Social calls radio buttons");
				b=0;
				return b;
			 }	
		    }
		}
                if(window.document.form1.elements[1].checked)
                {
                   if(window.document.form1.country2.value=='UK')
                  {
			if(window.document.form1.state.value=='')
			{
				alert("Type something into the County box");
				b=0;
				return b;
			}
		  }
                }
}
//new members application 5
 //----------------------------------------------------------------
function nm5validat()
{
 var b=1;
 if(window.document.form1.chkbx1.checked==false)
    {
	  alert("you need to check the I/we Apply for Membership checkbox");
	  b=0;
	  return b;
	}
}
//-----------------------------------------------------------------
//this function calculates the total cost
function total()
{
var subtot=0.0;
var tot=0.0;
var surcharge=0.0;
//alert(window.document.form1.elements[24].value);
subtot=Number(window.document.form1.membfees.value);
//alert('subtot='+subtot);
if(window.document.form1.voluntary.value!='')
{
subtot=subtot+Number(window.document.form1.voluntary.value);
}
surcharge=0.0*subtot;
//alert('surcharge='+surcharge);
surcharge=(surcharge*100)/100;
//surcharge=Math.ceil(surcharge*100)/100;
//alert('2surcharge='+surcharge);
tot=subtot + surcharge;
//alert('tot='+tot);
tot100=tot*100;
inttot=parseInt(tot);
inttot100=inttot*100;
remaindr=parseInt(tot100-inttot100);
//alert('tot100='+tot100+' inttot='+inttot+' inttot100='+inttot100+' remaindr='+remaindr);
if(remaindr==0){
   tot=parseInt(inttot) + '.00';
}else{
	if(parseInt(remaindr)>9){
        tot=parseInt(inttot) + '.' + parseInt(remaindr);
    }else{
    	tot=parseInt(inttot) + '.0' +parseInt(remaindr);
    }
}
return tot;
}
//-------------------------------------------------------------
//this function calculates the credit card surcharge
function tot()
{
var subtot=0.0;
var tot=0.0;
var surcharge=0.0;

subtot=Number(window.document.form1.membfees.value);
if(window.document.form1.voluntary.value!='')
{
subtot=subtot+Number(window.document.form1.voluntary.value);
}
surcharge=0.0*subtot;
surcharge=(surcharge*100)/100;
//surcharge=Math.ceil(surcharge*100)/100;
tot=surcharge;
tot100=tot*100;
inttot=parseInt(tot);
inttot100=inttot*100;
remaindr=tot100-inttot100;
//alert('tot100='+tot100+' inttot='+inttot+' inttot100+'+inttot100+' remaindr='+remaindr);
if(remaindr==0){
   tot=parseInt(inttot) + '.00';
}else{
	if(parseInt(remaindr)>9){
        tot=parseInt(inttot) + '.' + parseInt(remaindr);
    }else{
    	tot=parseInt(inttot) + '.0' +parseInt(remaindr);
    }
}
return tot;
}
//--------------------------------------------------------
// contact us form
function cmvalidat()
{
	var b=1;
        var the_text;
	var regexpn=/[a-z,A-Z,0-9,-]*@[a-z,A-Z,0-9,-]*\.[a-z,A-Z]*/;
	the_text=window.document.form1.em.value;
	if(window.document.form1.elements[0].checked==false)
	  { 
	  if (window.document.form1.elements[1].checked==false)
	    {
		alert("Please select one of the catagories, UK or Overseas");
		b=0;
		return b;
	    }
	  }
	  if(the_text=="")
			  {
				alert("Please enter a valid email address into the email box");
				b=0;
				return b;
			  }
			  //res=the_text.match(regexpn);
			  //alert("the result="+res);
	  if(the_text.match(regexpn)==null )
			  {
				alert("Please enter a valid email address (of the form xxxx@xxxx.xxx) into the email box");
				b=0;
				return b;
			  }
	  if(window.document.form1.sub.value=='')
	  {
		alert("Please enter the subject");
		b=0;
		return b;
	  }
	  if(window.document.form1.mes.value=='')
	  {
		alert("Please enter a message");
		b=0;
		return b;
	  }
}
//------------------------------------------------------------------
//form renew_choice
//this function checks some of the input fields for entries when the user clicks on the Submit button	
function rvalidat()
{
 var b=1;
// x=window.document.form1.elements[0].checked;
//alert(x);
//y=window.document.form1.elements[1].checked;
//alert(y);
 if(window.document.form1.elements[0].checked==false && window.document.form1.elements[1].checked==false)
    {
          alert("You need to click the Firstname box either Yes or No");
          b=0;
          return b;
        } 
 if(window.document.form1.elements[2].checked==false && window.document.form1.elements[3].checked==false)
    {
          alert("You need to click the Surname box either Yes or No");
          b=0;
          return b;
        } 
 if(window.document.form1.elements[4].checked==false && window.document.form1.elements[5].checked==false)
    {
          alert("You need to click the Address box either Yes or No");
          b=0;
          return b;
        } 
 if(window.document.form1.elements[6].checked==false && window.document.form1.elements[7].checked==false)
    {
          alert("You need to click the Date of Birth box either Yes or No");
          b=0;
          return b;
        }  
 if(window.document.form1.elements[8].checked==false && window.document.form1.elements[9].checked==false)
    {
          alert("You need to click the Telephone box either Yes or No");
          b=0;
          return b;
        }  
 if(window.document.form1.elements[10].checked==false && window.document.form1.elements[11].checked==false)
    {
          alert("You need to click the Email box either Yes or No");
          b=0;
          return b;
        }  
 if(window.document.form1.elements[12].checked==false && window.document.form1.elements[13].checked==false)
    {
          alert("You need to click the Nominated Member box either Yes or No");
          b=0;
          return b;
        }    
 if(window.document.form1.elements[14].checked==false && window.document.form1.elements[15].checked==false)
    {
          alert("You need to click the Family Member box either Yes or No");
          b=0;
          return b;
        }    
 if(window.document.form1.elements[16].checked==false && window.document.form1.elements[17].checked==false)
    {
          alert("You need to click the Section box either Yes or No");
          b=0;
          return b;
        } 
 if(window.document.form1.elements[18].checked==false && window.document.form1.elements[19].checked==false)
    {
          alert("You need to click the Rider's Contact List box either Yes or No");
          b=0;
          return b;
        }  
 if(window.document.form1.elements[20].checked==false && window.document.form1.elements[21].checked==false)
    {
          alert("You need to click the Machine Registration details box either Yes or No");
          b=0;
          return b;
        }  
 if(window.document.form1.elements[25].checked==false && window.document.form1.elements[26].checked==false)
	{
	     alert("You need to click on the Renewing for the next 5 years or Renewing for 1 year");
		 b=0;
		 return b;
	}
 if(window.document.form1.chkbx1.checked==false)
    {
	  alert("You need to check the I want to continue checkbox");
	  b=0;
	  return b;
	}
}
 
//------------------------------------------------------------------
//form renew_entry
//this function checks some of the input fields for entries when the user clicks on the Submit button	
function r2validat()
{
 var b=1;
 dob=window.document.form1.datebirth.value;
               //alert('dob='+dob);
                day=Number((dob.slice(0,2)));
               //alert('day='+day);
                mon=Number((dob.slice(3,5)));
               //alert('mon='+mon);
                yer=Number((dob.slice(6,10)));
               //alert('yer='+yer);
                if(day<1 || day>31 || isNaN(day))
                {
                   alert("enter a day between 01 and 31 into the Date of birth box opposite Family member 4");
                   b=0;
                   return b;
                }
                if(mon<1 || mon>12 || isNaN(mon))
                {
                   alert("enter a month between 01 and 12 into the Date of birth box opposite Family member 4");
                   b=0;
                   return b;
                }
                if(yer<1900 || yer>2050)
                {
                   alert("enter a year between 1900 and 2050 into the Date of birth box opposite Family member 4");
                   b=0;
                   return b;
           }
 if(window.document.form1.chkbx1.checked==false)
    {
	  alert("you need to check the I want to continue checkbox");
	  b=0;
	  return b;
	}
}
//------------------------------------------------------------------
//form renewal2
//this functions checks the renewal2 input fields
function renewalvalidat()
{
 var b=1;
 var the_text;
 var regexpn=/[a-z,A-Z,0-9,-]*@[a-z,A-Z,0-9,-]*\.[a-z,A-Z]*/;
 if(window.document.form1.f1.value=="")
 {
    alert("enter a membership number into the membership no. box");
	b=0;
	return b;	
 }
 if(window.document.form1.f2.value=="")
 {
	alert("enter a document nunber into the document no. box");
	b=0;
	return b;
 }
 if(window.document.form1.f3.value=="")
 {
	alert("enter a phone number into the Phone no. box");
	b=0;
	return b;
 }
 var phon=window.document.form1.f3.value;
 if(isNaN(phon))
 {
	alert("enter a valid phone number (digits between 0 and 9, without any spaces, or slashes)");
	b=0;
	return b;
}
 the_text=window.document.form1.f4.value;
	  if(the_text=="")
			  {
				alert("Please enter a valid email address into the email box");
				b=0;
				return b;
			  }
			  //res=the_text.match(regexpn);
			  //alert("the result="+res);
	  if(the_text.match(regexpn)==null )
			  {
				alert("Please enter a valid email address (of the form xxxx@xxxx.xxx) into the email box");
				b=0;
				return b;
			  }	
}
 
//------------------------------------------------------------------
function showPage()
{
     width = 480 - 8
     height = 640 - 30
     wPatent = window.open('menu.pdf', '', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+width+',height='+height+',top=0,left=0');
     wPatent.focus();
}		