//handmade javascripts for mid klamath watershed council site


//mouseover image swap script (used to change the main menu graphics from one color to another color when the mouse is placed over them).  your images for the menu need to be in the /template/images folder and named such that the image you want displayed ends with "_off" then the file extension (e.g., .png or .gif) and the image you want displayed when the mouse is over it ends in "_on" then the file extension. an example would be MenuAboutUs_off.png and MenuAboutUs_on.png; you would see the _off image on the screen until you put the mouse over it and then you'll see the _on image.  in order to make this all work you must have the following code placed in the HTML line with the images: onmouseover="imgSwap(this)" onmouseout="imgSwap(this)".  an example is: <img src="images/MenuAboutUs_off.png" width="76" height="30" alt="about us" style="cursor:pointer" onmouseover="imgSwap(this)" onmouseout="imgSwap(this)">

function imgSwap(oImg){
   var strOver  = "_on"; // image to be used with mouse over must end in _on then extension (.png or .gif, for example)
   var strOff = "_off";  // normal image (the one usually seens) must end in _off then extension (.png or .gif, for example)
   var strImg = oImg.src
   if (strImg.indexOf(strOver) != -1) 
      oImg.src = strImg.replace(strOver,strOff)
   else
      oImg.src = strImg.replace(strOff,strOver)}

//clear form field text on focus (clears word "required" for text boxes in forms when the user clicks on the box to enter info -- see your contact page; must have onfocus="clearText()" in code for form box)

function clearText(thefield){if (thefield.defaultValue==thefield.value)
thefield.value = ""}

