function bCheckTheForm( form )
	{
	 var errormessage = new String();
	if(WithoutContent(form.name.value))
	  {errormessage += "\n\nPlease fill in the name field";}
	if(WithoutContent(form.email.value))
		 {errormessage += "\n\nPlease fill in the email field";}
	else
		{
		if(!OkEmail(form.email.value))
		  {errormessage += "\n\nThe entry for \"email\" does not appear to be a valid email address";}
		}

	formOk = ! (errormessage.length > 2);			
	if (! formOk)
		{alert('The Form was not completed :' + errormessage + '\n'); }
	else
		{alert('\nThanks for getting in touch.\n\nWe will get back to you as soon as possible.\n'); }
	return formOk;
	} // end of CheckTheForm()
	
function WithoutContent(ss)
	{
	return ( ss.length < 1 )
	}
	
	
function OkEmail(ss)
	{
	var retval = true;
	var split;
	
//Check the field is not too small	
// Use > not less-than to avoid a HTML warning from the W3C Validator
	if (5 > ss.length  )
		retval = false;

//Check the @ is present in the middle of some text, and split into name and domain			
	if ( retval )
      {
      var split = ss.match("^(.+)@(.+)$");
      if(split == null || split[1] == null || split[2] == null) 
         retval = false;
     	}

//Check the name
	if ( retval )
      {
	    var regexp_name=/^\"?[\w-_\.]*\"?$/;
	    if(split[1].match(regexp_name) == null) 
	      retval = false;
	  	}

//Check the domain
   if ( retval )
      {
	    var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
	    if(split[2].match(regexp_domain) == null)
	      retval=false;
	    }
	    
	return retval;
	}

function HideMail (sCode)
{
sStr = '<a href="mailto:';
sStr += Obscure(sCode);
sStr += '">';
sStr += Obscure(sCode);
sStr += "</a>";
return sStr;
}



function Obscure( sStr )
{
iLen = sStr.length;
aRet = new Array();

for ( i=0; i < iLen; i++ )
	aRet[i] = sStr.charAt(i);


for ( i=0; i < ( iLen/ 2 ); i += 2 )
	{
	
	sTemp = aRet[i];
	aRet[i] = aRet[iLen-i -1];
	aRet[iLen-i-1]=sTemp;
		}

return aRet.join('');
}

function setupMap() {	
	if (GBrowserIsCompatible()) 
		{ 		
		map_1 = new GMap2(document.getElementById("map"));
		map_1.addControl(new GMapTypeControl());
		map_1.addControl(new GLargeMapControl());
//		map_1.enableDoubleClickZoom();
		map_1.setCenter(new GLatLng(51.6928164, 0.3925144), 10);
		map_1.addMapType(G_NORMAL_MAP);
		map_1.setMapType(G_NORMAL_MAP);
		var marker = new GMarker(new GLatLng(51.6928164, 0.3925144))
		map_1.addOverlay(marker);
/*		var html = '<strong>Hippo Screenprinters</strong>';
		html = html + '<br>Give me directions starting from: <br /><form action="http://maps.google.com/maps" method="get" target="_blank">' +
           '<input type="text" SIZE=40 MAXLENGTH=40 name="saddr" id="saddr" value="" /><br>' +
           '<INPUT value="Get Directions" TYPE="SUBMIT">' +
           '<input type="hidden" name="daddr" value="51.6928164, 0.3925144"/>';
		marker.openInfoWindowHtml(html);
	GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(html); } );		*/
		}
	}
