

function runit(){
shiftOpacity('box1', 1500);
var t=setTimeout("shiftOpacity('box2', 1500)",1000);
var t=setTimeout("shiftOpacity('optlist', 1500)",1000);

}

function linkcol(){

  var urlPath = window.location.pathname;
  var thisPage = urlPath.substring(urlPath.lastIndexOf('/') + 1);
  var pageName = thisPage.split('.');

  document.getElementById(pageName[0]).style.color = 'lightblue'; 
}



function validate(){
var brtype = " ";
if (document.getElementById && !document.all) 
  {brType = "n6";}
else if (document.layers) 
  {brType = "n4";}
else if (document.all) 
  {brType = "ie";}
  
     if (document.appt.DATE1.value.length == 0 || document.appt.TIME1.value.length == 0 ||
              document.appt.DATE2.value.length == 0 || document.appt.TIME2.value.length == 0) {
              alert("Please give us 2 dates and times for your appointment.");
              if (brType == "ie") {
                  event.returnValue = false;}
              else {return false;}
                             }  
     else if (document.appt.LNAME.value.length == 0 || document.appt.FNAME.value.length == 0) { 
         alert("Please enter both your first and last name.");
         if (brType == "ie") {
             event.returnValue = false;}
         else {return false;}
                             }
     else if (document.appt.HPHONE.value.length == 0 && document.appt.WPHONE.value.length == 0) {
             alert("Please enter either a home or a work telephone number, including area code.");
             if (brType == "ie") {
                  event.returnValue = false;}
             else {return false;}
                             } 
     else if (document.appt.HPHONE.value.length > 0 && document.appt.HPHONE.value.length < 10 ||
              document.appt.WPHONE.value.length > 0 && document.appt.WPHONE.value.length < 10) {
              alert("Please make sure you include the area code; the phone number should be 10 digits.");
              if (brType == "ie") {
                  event.returnValue = false;}
              else {return false;}
                             }
     else if (document.appt.EMAIL.value.length == 0) {
              alert("Please enter an e-mail address where we can contact you.");
              if (brType == "ie") {
                  event.returnValue = false;}
              else {return false;}
                             }           
                        }
function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 

function shiftOpacity(id, millisec) { 
    //if an element is invisible, make it visible, else make it ivisible 
    if(document.getElementById(id).style.opacity == 0) { 
        opacity(id, 0, 100, millisec); 
    } else { 
        opacity(id, 100, 0, millisec); 
    } 
} 