<!-- to hide from older browsers
	var numb = '0123456789';
	var lwr = 'abcdefghijklmnopqrstuvwxyz';
	var upr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
				
				
	// uses the selected dialling code from the drop-down and write it to the  
	// text field in front of number. returns true if ok and false otherwise
	// assumes form for the page is named main_form
	function useSelectedCode() 
	{
		// find out which country code has been selected
		len = document.main_form.os0.length;
		i = 0;
		chosen = "none"	
		for (i = 0; i < len; i++) 
		{
			if (document.main_form.os0[i].selected) 
			{	chosen = document.main_form.os0[i].value;	}
		}
		
		// extract the country dialling code from the selected drop down choice. 
		// the 5th charcter of the drop down value is where the dialling code 
		// starts after the plus sign usually
		// e.g. GB: +44
		prefix = chosen.substr(5,chosen.length);
		
		// error check the form:
		// is it blank?
		if(document.main_form.os1.value=="")
		{
			alert("Please enter your mobile/cell phone number");
			return false; 
		}
		else	 
		{	// so now we know it's not blank e.g. gfdg8998
			// eat all whitespace
			while(containsWhiteSpace())
			{
				stripSpaces();
			}
			
			if(!isNum(document.main_form.os1.value) )
			{
				alert("Please enter a valid mobile/cell phone number");
				return false;
			}
		}
		
		// check for a leading 0 to strip from the number they enter 
		// e.g. 07731832131 -> 7731832131
		if( document.main_form.os1.value.charAt(0) =="0")
		{
			document.main_form.os1.value = document.main_form.os1.value.substr(1,document.main_form.os1.value.length);
		}
		// write the dialling codeprefix to the field before their entered number
		// e.g. 7731832131 --> 4487731832131
		document.main_form.os1.value= prefix+document.main_form.os1.value;
			
								
		return true;
	}				

// looks for white space within string and removes
function stripSpaces()
{
	
	var arg = document.main_form.os1.value;
	var head="";
	var tail="";
	
	for(i=0; i<arg.length; i++)
	{
		if(arg.charAt(i)==" ")
		{
			//alert("blank at "+i);
			head=arg.substring(0,i);
			tail=arg.substring(i+1,arg.length);
			arg=head+tail;
		}
	}
	// alert(arg);	
	document.main_form.os1.value=arg;
}
// boolean check for whitepace
function containsWhiteSpace()
{
	var arg = document.main_form.os1.value;
	for(i=0;i<arg.length;i++)
	{
		if(arg.charAt(i)==" ")
		{ 	
			//alert("yep");
			return true;	
		}
			
	}
	return false;
}

		// some useful string check functions below
							
		// checks if parm is a substring of val
	function isValid(parm,val) 
	{
		if (parm == "") 
		{	return true;	}
		for (i=0; i<parm.length; i++) 
		{
				if (val.indexOf(parm.charAt(i),0) == -1) 
				{	return false;	}
		}
		return true;
	}
	
		// contains a substring of numb
	function isNum(parm) 
	{	return isValid(parm,numb);	}
	
		// contains a substring of lwr+upr
	function isAlpha(parm) 
	{	return isValid(parm,lwr+upr);	}
	
	
-->
