<!--

function validateit2(ourform){
		
	var good=true;
	
	//fix phone
	phone=ourform.custom_phone2.value;
	//alert(phone);
	//remove non numbers
	phone=NumOnly(phone);
	//check that 10 or 11 numbers left
	if (phone.length>11 || phone.length<10 ){
		//kill
		good=false;
		msg='Please enter a valid phone number.';
		formpart='custom_phone2';
	}
	//get rid of 1 
	if (phone.length==11){
	if (Left(phone,1)==1){
		phone=Right(phone,10);
	}else{
	//not a 1	
		good=false;
		msg='Please enter a valid phone number.';
		formpart='custom_phone2';
		}
	}
	
	ourform.custom_phone2.value=phone;
	
	if(good){
		ourform.submit();
		//alert('good');
	}else{
	
	alert(msg);
	ourform[formpart].focus()
	}
	
	
}

//----------------
function NumOnly(item){
	temp1=item.length;
	temp2='';
		for(x=0;x<temp1;x++){
		//remove non numbers
		tempitem=item.substr(x,1);
		//alert(tempitem + " " + ascii_value(tempitem) );
				if (ascii_value(tempitem)>47 && ascii_value(tempitem)<58){
					temp2=temp2+item.substr(x,1);
				}
		}
	return temp2;
}
function ascii_value (c)
{
	// restrict input to a single character
	c = c . charAt (0);

	// loop through all possible ASCII values
	var i;
	for (i = 0; i < 256; ++ i)
	{
		// convert i into a 2-digit hex string
		var h = i . toString (16);
		if (h . length == 1)
			h = "0" + h;

		// insert a % character into the string
		h = "%" + h;

		// determine the character represented by the escape code
		h = unescape (h);

		// if the characters match, we've found the ASCII value
		if (h == c)
			break;
	}
	return i;
}
function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}
function Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}