// JavaScript Document

function clearBox(box) 
{
            if(box.value==box.defaultValue) 
           {
                        box.value = "";
            }
}

function validate_required(field,alerttxt)
{
with (field)
{

if(value==null||value=="")
  {alert(alerttxt);return false}

else {return true}
}
}

function validate_form(thisform)
{
with (thisform)
{
if (validate_required(rname,"Name must be filled out!")==false)
  {rname.focus();return false}
if (validate_remail(remail,"Not a valid e-mail address!")==false)
  {remail.focus();return false}
if (validate_phone(rtelephonee, "Not a valid Phone Number!")==false)
  {rtelephonee.focus();return false}
if (validate_required(procedure, "Procedure must be filled out!")==false)
  {website.focus();return false}
}
}
function validate_remail(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@")
dotpos=value.lastIndexOf(".")
if (apos<1||dotpos-apos<2) 
  {alert(alerttxt);return false}
else {return true}
}
}


// Declaring required variables
var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 10;

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkInternationalPhone(strPhone){
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}
function validate_phone(field, alerttxt) 
{
with (field)
{
	if ((value==null)||(value=="")){
		alert("Please Enter your Phone Number")
		focus()
		return false
	}
	if (checkInternationalPhone(value)==false){
		alert("Please Enter a Valid Phone Number")
		value=""
		focus()
		return false
	}
	return true
}
}


<!--
  if(window.attachEvent)
    window.attachEvent("onload",setListeners);

  function setListeners(){
    inputList = document.getElementsByTagName("INPUT");
    for(i=0;i<inputList.length;i++){
      inputList[i].attachEvent("onpropertychange",restoreStyles);
      inputList[i].style.backgroundColor = "";
    }
    selectList = document.getElementsByTagName("SELECT");
    for(i=0;i<selectList.length;i++){
      selectList[i].attachEvent("onpropertychange",restoreStyles);
      selectList[i].style.backgroundColor = "";
    }
  }

  function restoreStyles(){
    if(event.srcElement.style.backgroundColor != "")
      event.srcElement.style.backgroundColor = "";
  }//-->


function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('http://www.californiasurgicalinstitute.com',url);
	elem.setAttribute('California Surgical Institute',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}



<!--
// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com

var message = "Print this Page";

function printpage() {
window.print();  
}

document.write("");

//-->

