

    // preload all the menu mouseovers
    var image1 = new Image();
    image1.src = "res/img/aboutusover.jpg";
    var image2 = new Image();
    image2.src = "res/img/ourservicesover.jpg";
    var image3 = new Image();
    image3.src = "res/img/ourpeopleover.jpg";
    var image4 = new Image();
    image4.src = "res/img/latestnewsover.jpg";
    var image5 = new Image();
    image5.src = "res/img/clientloginover.jpg";
    
    function ci(p1, p2) { // changeimage
       document[p1].src = "res/img/" + p2;
    }
    

    function checkdata() { 
        var sSearchfor = document.ngsearch.searchfor.value;
        sSearchfor = sSearchfor.replace(/ /g, ""); // remove spaces
        if (sSearchfor.length ==0 || sSearchfor == "Search") {
            document.ngsearch.searchfor.value = "Search";
            return false;
        }
    }

         
   function IsValidEmail(EmailAddr) {
        return (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(EmailAddr))
    }
    
   function IsNumeric(strString) {      //  check for valid numeric strings   

      var strValidChars = "0123456789";
      var strChar;
      var blnResult = true;
      
      strString = strString.replace(/ /g, ""); // remove spaces
      if (strString.length == 0) return false;
   
      //  test strString consists of valid characters listed above
      for (i = 0; i < strString.length && blnResult == true; i++) {
         strChar = strString.charAt(i);
         if (strValidChars.indexOf(strChar) == -1) blnResult = false;
      }
      return blnResult;
   }   
       
    function changeObjectVisibility(objectId, newVisibility) {
        // first get a reference to the cross-browser style object 
        // and make sure the object exists
        var styleObject = getStyleObject(objectId);
        if(styleObject) {
            //alert("setting "+objectId+" "+newVisibility);
               styleObject.visibility = newVisibility;
               return true;
        } else {
               // we couldn't find the object, so we can't change its visibility
               return false;
       }
    }
    function getStyleObject(objectId) {
        // checkW3C DOM, then MSIE 4, then NN 4.
        if(document.getElementById && document.getElementById(objectId)) {
               return document.getElementById(objectId).style;
        }
        else if (document.all && document.all(objectId)) {  
            return document.all(objectId).style;
        } 
        else if (document.layers && document.layers[objectId]) { 
               return document.layers[objectId];
        } else {
               return false;
      }
    }  
    
    function ShowPic(sFileName,sDimensions, sNote) {
        var pop_win = window.open("", "win2", sDimensions);
        pop_win.document.open("text/html", "replace");
        pop_win.document.write("<HTML><HEAD><title>" + sFileName + "</title></HEAD>");
        pop_win.document.write("<body leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0 marginwidth=0 marginheight=0>");
        pop_win.document.write("<a href='javascript:self.close();'><img src='" + sFileName + "' alt='Click to close' border=0></a>");
        pop_win.document.write("<br><center><font face=verdana size=1>" + sNote + "</font></center>");
        pop_win.document.write("</body></HTML>");
        pop_win.focus();
    }

