
function change (box) {
  var itm = document.getElementById(box);
  itm.style.backgroundColor="D22924";
}
		
function change_back(box){
    document.getElementById(box).style.backgroundColor = "ffffff";
}
		
function subchange(box){
    document.getElementById(box).style.backgroundColor = "778FC8";
    document.getElementById(box).style.color = "ffffff";
}
		
function subchange_back(box){
		document.getElementById(box).style.background = "transparent";
		document.getElementById(box).style.color = "000000";
}

function imgchange(img,newimg) {
    if (document.layers)
    {
    document.Box.document.images[img].src=newimg;
    }
    else
    {
    document.images[img].src=newimg;
    } 
}

function preloadimages(){
    var myimages=new Array()
    for (i=0;i<preloadimages.arguments.length;i++){
	myimages[i]=new Image()
	myimages[i].src=preloadimages.arguments[i]
    }
}

isNS4 = (document.layers) ? 1 : 0;
isIE = (document.all) ? 1 : 0;
isW3C = (document.getElementById && !document.all) ? 1 : 0;

function setStyle(objName, property, val) {

    if (isIE) {
        var layer = document.all[objName];
        layer.style[property] = val;
        return;
    }
    if (isW3C) {
        var obj = document.getElementById( objName );
        if (obj != null) {
            var s = obj.style;
            s[ property ] = val;
            return;
        }
        return;
    }
    if (isNav4) {
        document[objName][property] = val;
        return;
    }
}

function getSpecifiedProperty(objName, property) {

     if (isIE) {
          str = eval("document.all."+objName+".currentStyle."+property);
          return str;
     }
}

function getCalculatedProperty(objName, property) {
     // thanks to Ian Grant, http://www.faqts.com/knowledge_base/view.phtml/aid/7157

     if (isW3C) {
        docObj = document.getElementById(objName);
          
        if (property == "visibility") {
              cssp = docObj.style.visibility;
               return (cssp == "") ? "inherit" : cssp;
          }
          if (property == "clip") {
              cssp = docObj.style.clip;

                 if (cssp == "") {
                    cssStr = "rect(0px ";
                    cssStr += getCalculatedProperty(objName, "width") + " ";
                    cssStr += getCalculatedProperty(objName, "height") + " ";
                    cssStr += "0px)";
                    return cssStr;
              }
              return cssp;
          }

          if (property == "zIndex") {
              cssp = docObj.style.zIndex;
              return (cssp == "") ? "inherit" : cssp;
          }

          cssp = document.defaultView.getComputedStyle(docObj, "").getPropertyValue(property);

          return (cssp == "") ? "unknown" : cssp;
    }

    // ***** Netscape Navigator 4+ DOM *****

    if (isNS4) {
          docObj = document.layers[objName];

          if (property == "visibility") {
              cssp = docObj.visibility;
              return (cssp == "hide") ? "hidden" : (cssp == "show") ? "visible" : "inherit";
          }
          if (property == "clip") {
                  cssStr = "rect(" + docObj.clip.top + "px ";
              cssStr += docObj.clip.right + "px ";
              cssStr += docObj.clip.bottom + "px ";
              cssStr += docObj.clip.left + "px)";
              return cssStr;
          }
          if ((property == "width") || (property == "height")) {
                   return eval("docObj.clip." + property) + "px";
          }
          if (property == "top") property = "pageY";
          if (property == "left") property = "pageX";
          
          cssp = eval("docObj." + property);
          if (property != "zIndex") cssp += "px";
          return cssp;
    }

    // ***** Internet Explorer 4+ DOM *****

    if (isIE) {
          if (property == "width") return eval(objName + ".offsetWidth") + "px";
          if (property == "height") return eval(objName + ".offsetHeight") + "px";
          if (property == "top") return eval(objName + ".offsetTop") + 'px';
          if (property == "left") return eval(objName + ".offsetLeft") + 'px';
          if (property == "clip") {
                cssp = eval(objName + ".style.clip");
              if (cssp == "") {
                    cssStr = "rect(0px ";
                    cssStr += getCalculatedProperty(objName, "width") + " ";
                    cssStr += getCalculatedProperty(objName, "height") + " ";
                    cssStr += "0px)";
                    return cssStr;
              }
              return cssp;
          }
          return eval(objName + ".currentStyle." + property);
    }
}


function pxval(valAsStr) {
     if ((i = valAsStr.indexOf("px")) != -1) {
          val = parseInt(valAsStr.substring(0,i));
     }
     else {
          val = 0;
          alert("problem parsing valAsStr:"+valAsStr);
     }
     return val;
}




