
    function ci(p1, p2) { // changeimage
       document[p1].src = "res/img/" + p2;
    }

    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 ToggleGroup(vGroup) {
        vDisplay = getStyleObject(vGroup).display;
        if (vDisplay =='block' || vDisplay=='') {
            getStyleObject(vGroup).display = "none";
        } else if (vDisplay=='none') {
            getStyleObject(vGroup).display = "block";
        } else {
            alert("What the? vDisplay=[" + vDisplay + "]");
        }
    }
    
    function IsValidEmail(EmailAddr) {
        return (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(EmailAddr))
    }
    
    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) {
            styleObject.visibility = newVisibility;
            return true;
        } else {
            // we couldn't find the object, so we can't change its visibility
            return false;
        }
    }
   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 checksearchdata() { 
        var sSearchfor = document.fittsearch.searchfor.value;
        sSearchfor = sSearchfor.replace(/ /g, ""); // remove spaces
        if (sSearchfor.length ==0 || sSearchfor == "Search") {
            document.fittsearch.searchfor.value = "Search";
            return false;
        }
    }
    function blank() {
       return false;
    }
    
    function gotopage(sPage) {
        if (sPage.indexOf(".pdf") > 0) {
            // open pdfs in external window
            window.open(sPage);
            return false;
        } else {
            // anything else assume its a link so open in same window
            document.location.href = sPage;
        }
    }
    
    function showPanel2(PanelName,ImageName,xoffset,yoffset) {
        var menuPosition = imgXY(ImageName);                                    /* detect the coordinates of the specified image */
        showPanel(PanelName, menuPosition.x+xoffset, menuPosition.y+yoffset);   /* display the menu x-offset and y-offset from upper left corner of image */
    }

    function imgXY(imgID) {                                                     /* This function returns the upperleft x,y coordinates of the specified image */
        var XY = new Object();
        var imgObj = document.images[imgID];
        if (document.layers) {
            XY.x = eval(imgObj).x;
            XY.y = eval(imgObj).y;
        } else {
            var x,y, tempEl;
            x = eval(imgObj).offsetLeft;
            y = eval(imgObj).offsetTop;
            tempEl = eval(imgObj).offsetParent;
            while (tempEl != null) {
                x += tempEl.offsetLeft;
                y += tempEl.offsetTop;
                tempEl = tempEl.offsetParent;
            }
            XY.x = x;
            XY.y = y;
        }
        return XY;
    }

    // Calculate real offset values of elements
    function xgetOffset(el, offsetType) {
        var offset = 0;
        while(el) {
            offset += el[offsetType]; 
            el = el.offsetParent;
        }
        return offset;
    }
    function showPanel3(ezMenu,oCell,xAdjust,yAdjust) {
        var posy = xgetOffset(oCell, 'offsetTop') + oCell.offsetHeight;
        var posx = xgetOffset(oCell, 'offsetLeft');
        showPanel(ezMenu, posx+xAdjust, posy+yAdjust);
    }
    
    function boldit(oHref,bBold) {
        var oStyle = getStyleObject(oHref);
        if (bBold)
            oStyle.fontWeight="bold";
        else
            oStyle.fontWeight="normal";
    }
    
   
function SetPass() {
    var cPass = prompt("Well?",'');
    document.cookie="mdcc=" + escape(cPass) + ";path=/;";
    history.go(); 
} 

// bookmark the page
// urlAddress = "http://www.forsythes.com.au/fa.asp";
// pageName = "Forsythes Forensic Accounting Home Page";

function addToFavorites(urlAddress,pageName) {
   if (window.external) {
      window.external.AddFavorite(urlAddress,pageName)
   } else { 
      alert("Sorry! Your browser doesn't support this function.");
   }
}

function newwindow(cPage) {
        homewindow=window.open(cPage,'newwindow','width=400,height=270,left=110,top=110,scrollbars=no,toolbars=no,resizable=no,menubar=no')   
        homewindow.focus()
}
