var request=false;try{request=new XMLHttpRequest();}catch(trymicrosoft){try{request=new ActiveXObject("Msxml2.XMLHTTP");}catch(othermicrosoft){try{request=new ActiveXObject("Microsoft.XMLHTTP");}catch(failed){request=false;}}}
function update_status_message(){if(request.readyState<4){document.getElementById('submitbtn').src='/ibpimages/124.gif'}else if(request.readyState==4){document.getElementById('submitbtn').src='/ibpimages/123.gif'}}
function request_call_local(){if(!request){Alert("sorry, click to call will not work with your browser");}
else
{var phone=document.getElementById("npa").value.concat(document.getElementById("nnx").value).concat(document.getElementById("line").value);if(validate_phone(phone)){var url="clickto_proxy.php?phone_to_call="+escape(phone);request.onreadystatechange=update_status_message;request.open("GET",url,true);request.send(null);}}}
function validate_phone(phone){if(phone.length!=10){alert("Sorry, the phone number you entered does not have 10 digits! ");return 0;}
return 1;}
function autofocus(field,limit,next,evt){evt=(evt)?evt:event;var charCode=(evt.charCode)?evt.charCode:((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0));if(charCode>31&&field.value.length==limit){field.form.elements[next].focus();}}
