function jumpURL ( urlno )
{
	switch ( urlno ) {
		case 0 :
			document.location.href = 'http://www.dvla.gov.uk/';
			break;
		case 1 :
			document.location.href = 'http://www.dsa.gov.uk/';
			break;
		case 2 :
			document.location.href = 'http://www.passplus.org.uk/';
			break;
		case 3 :
			document.location.href = 'http://www.direct.gov.uk/Motoring/fs/en';
			break;
	}			
}

function MailFormTag()
{
	var encurl = "<399908=92=?919>929:<2=89<90918;9>9<8;;9908=92=8=?9>9<8;969091<2=8978;8;8?<5=0=0888888=18<929:988<968;9:=19<90=18:94=09>8=938<9<97909093909992908;908=969198=0929>9693=19>8<8?=8=?929:8;97909;<2=8:?;0:<:;=8=?8<8;86939:<2=89<9093908=<5=?=<<9<6<9<6<9<6<4=?9990918;=28<96859:<5=?<78?8;=8<1";
	var out = "";
	for(i = 0 ; i < encurl.length ; i+=2)
	{
		hx = ((encurl.charCodeAt(i) - 48) * 16 + (encurl.charCodeAt(i + 1) - 48)) ^ 255;
		out += String.fromCharCode(hx);
	}
	document.write(out);
}

function MailFormEndTag()
{
	document.write("</form>");
}

function check_email(e) 
{
	ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";

	for(i=0; i < e.length ;i++)
	{
    	if(ok.indexOf(e.charAt(i))<0)  return (false);
  	} 

  	if (document.images) 
  	{
  		re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
  	  	re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
  	  	if(!e.match(re) && e.match(re_two)) return (true);		
    } 

	return false;
}

function CheckForm( theform  )
{
 	var strFields = "";
	
	if( theform.Name.value == '' )
 	{
	   alert( "You don't seem to have entered a name" );
	   return;
	}
	
 
  	if(!check_email(theform.Email.value))
    {
      alert( "You don't seem to have entered a valid email address" );
      return;
    }
    
	theform.submit();    
}

function ResetForm( theForm )
{
	theForm.reset();
}
	 