if (document.images) {

var services1 = new Image(); services1.src = "images/services-off.jpg";
var services2 = new Image(); services2.src = "images/services-on.jpg";

var servicearea1 = new Image(); servicearea1.src = "images/service-area-off.jpg";
var servicearea2 = new Image(); servicearea2.src = "images/service-area-on.jpg";

var about1 = new Image(); about1.src = "images/about-proworks-off.jpg";
var about2 = new Image(); about2.src = "images/about-proworks-on.jpg";

var bookonline1 = new Image(); bookonline1.src = "images/book-online-off.jpg";
var bookonline2 = new Image(); bookonline2.src = "images/book-online-on.jpg";
   
}


function turnOn(imageName) {
  if (document.images) {
    document[imageName].src = eval(imageName + "2.src");
  }
}

function turnOff(imageName) {
  if (document.images) {
    document[imageName].src = eval(imageName + "1.src");
  }
}


function popUp(page,PWidth,PHeight,id) {
 eval("village"+id+"=window.open('"+page+"','gallery','toolbar=0,scrollbars=0,location=0,status=0,menubars=0,resizable=0,width="+PWidth+",height="+PHeight+"')")
eval("village"+id+".window.moveTo((screen.width/2)-(PWidth/2),(screen.height/2)-(PHeight/2))")
}

function swap(ontop, onbottom) {
   document.getElementById(ontop).style.zIndex = '9';
   document.getElementById(onbottom).style.zIndex = '5';
}


function ParseUSNumber(PhoneNumberInitialString)
  {
    var FmtStr="";
    var index = 0;
    var LimitCheck;

    LimitCheck = PhoneNumberInitialString.length;
    while (index != LimitCheck)
      {
        if (isNaN(parseInt(PhoneNumberInitialString.charAt(index))))
          { }
        else
          { FmtStr = FmtStr + PhoneNumberInitialString.charAt(index); }
        index = index + 1;
      }
    if (FmtStr.length == 10)
      {
        FmtStr = "(" + FmtStr.substring(0,3) + ") " + FmtStr.substring(3,6) + "-" + FmtStr.substring(6,10);
      }
    return FmtStr;
  }


function placeFocus() {
 if (document.forms.length > 0) {
  var field = document.forms[0];
  for (i = 0; i < field.length; i++) {
   if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
    document.forms[0].elements[i].focus();
    break;
   }
  }
 }
}



function openPage()
      {
window.open('click-to-call.html','callwin','height=330,width=530,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no, status=no');
     }
