<!--

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// MouseOver Image Change
//<img src="images/normal.gif" overSrc="images/over.gif" width="16" height="16" border="0">
document.onmouseover = handleOver;
document.onmouseout  = handleOut;

function handleOver() {
	el = window.event.srcElement;
	if (el.tagName == "IMG") { //Check if over image
		if ((el.overSrc != null) && (el.overSrc != "")) { //check if valid overSrc
			el.srcBackup = el.src;		//Back up the src
			el.src = el.overSrc;
		}
	}
}

function handleOut() {
	el = window.event.srcElement;
	if (el.tagName == "IMG") { //Check if over image
		if ((el.overSrc != null) && (el.overSrc != "") && (el.srcBackup != null)) { //Also check for valid backup
			el.src = el.srcBackup;
		}
	}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Error Override	
function blockError(){return true;}
window.onerror = blockError;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//  select Element Type-Ahead for IE/Windows 
// global storage object for type-ahead info, including reset() method
var typeAheadInfo = {last:0, 
                     accumString:"", 
                     delay:500,
                     timeout:null, 
                     reset:function() {this.last=0; this.accumString=""}
                    };
// function invoked by select element's onkeydown event handler
function typeAhead() {
   // limit processing to IE event model supporter; don't trap Ctrl+keys
   if (window.event && !window.event.ctrlKey) {
      // timer for current event
      var now = new Date();
      // process for an empty accumString or an event within [delay] ms of last
      if (typeAheadInfo.accumString == "" || now - typeAheadInfo.last < typeAheadInfo.delay) {
         // make shortcut event object reference
         var evt = window.event;
         // get reference to the select element
         var selectElem = evt.srcElement;
         // get typed character ASCII value
         var charCode = evt.keyCode;
         // get the actual character, converted to uppercase
         var newChar =  String.fromCharCode(charCode).toUpperCase();
         // append new character to accumString storage
         typeAheadInfo.accumString += newChar;
         // grab all select element option objects as an array
         var selectOptions = selectElem.options;
         // prepare local variables for use inside loop
         var txt, nearest;
         // look through all options for a match starting with accumString
         for (var i = 0; i < selectOptions.length; i++) {
            // convert each item's text to uppercase to facilitate comparison
            // (use value property if you want match to be for hidden option value)
            txt = selectOptions[i].text.toUpperCase();
            // record nearest lowest index, if applicable
            nearest = (typeAheadInfo.accumString > txt.substr(0, typeAheadInfo.accumString.length)) ? i : nearest;
            // process if accumString is at start of option text
            if (txt.indexOf(typeAheadInfo.accumString) == 0) {
               // stop any previous timeout timer
               clearTimeout(typeAheadInfo.timeout);
               // store current event's time in object 
               typeAheadInfo.last = now;
               // reset typeAhead properties in [delay] ms unless cleared beforehand
               typeAheadInfo.timeout = setTimeout("typeAheadInfo.reset()", typeAheadInfo.delay);
               // visibly select the matching item
               selectElem.selectedIndex = i;
               // prevent default event actions and propagation
               evt.cancelBubble = true;
               evt.returnValue = false;
               // exit function
               return false;   
            }            
         }
         // if a next lowest match exists, select it
         if (nearest != null) {
            selectElem.selectedIndex = nearest;
         }
      } else {
         // not a desired event, so clear timeout
         clearTimeout(typeAheadInfo.timeout);
      }
      // reset global object
      typeAheadInfo.reset();
   }
   return true;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// createHR(start Function
/* <SCRIPT>
  document.write(createHR("000000","FFFFFF",32,150,3, true, false, "center"))
 </SCRIPT>
The createHR() function returns an HTML table that represents the rule. If you are reusing the same rule multiple times in your document, you should cache the return value in a variable and write the variable into the document. This will improve performance as the table only needs to be calculated once. For example: 

 <SCRIPT>
  blendToWhite = createHR("000000","FFFFFF",32,150,3, true, false, "center")
  document.write(blendToWhite)
  document.write(blendToWhite)
 </SCRIPT>
The createHR() function has 5 required arguments representing the start and end colors, the number of steps, and the size. In addition there are three optional arguments for creating a cross browser rule, the rule's direction, and the rule's alignment. Below is the complete prototype and description of arguments for the createHR() function: 

  createHR(startColor, endColor, steps, width, height 
           [, crosGeminiGrouprowser, direction [, align ]]])
*/

function prefix(s) {
  // Make sure the hex# is 2 characters
  if (1==s.length)
    s="0"+s
  return s
}

function breakApart(start) {
  // Split the hex # into the RGB components
  var temp = new Array()
  temp[0] = parseInt(start.substring(0,2),16)
  temp[1] = parseInt(start.substring(2,4),16)
  temp[2] = parseInt(start.substring(4,6),16)
  return temp
}

function diffParts(startInt, endInt, steps) {
  // Determine the increment amount for each step
  var temp = new Array()
  for (var i=0; i<3; i++)
    temp[i] = Math.round((endInt[i] - startInt[i]) / steps)
  return temp
}


function createHR(start, end, steps, width, height) {
  var startInt = breakApart(start)
  var endInt = breakApart(end)
  var stepList = diffParts(startInt, endInt, steps)
  str = "<TABLE width="+width + " height="+height
  var alignment = arguments[7] // Optional alignment argument
  if (null!=alignment) {
    alignment.toLowerCase()
    // Ignore values other than left, right, and center
    if ("left"==alignment)
      str+=" align=left"
    else if ("right"==alignment)
      str+=" align=right"
    else if ("center"==alignment)
      str+=" align=center"
  }
  str+=" cellspacing=0 cellpadding=0 border=0><TR>"
  for (var r=0; r < steps; r++) {
      var hr = prefix(startInt[0].toString(16))
      var hg = prefix(startInt[1].toString(16))
      var hb = prefix(startInt[2].toString(16))
      // increment color
      for (var i=0; i < 3; i++)
        startInt[i]+=stepList[i]

      str+="<TD BGCOLOR="+hr + hg + hb+">"
      // Cross-browser version
      // Make sure to point the image to a valid
      // location on your server
      if (arguments[5]==true) str+="<IMG SRC='/gifs/s.gif' WIDTH=1 HEIGHT=1>"
      str+="</TD>"
      // Vertical rule
      if ((arguments[6]==true) && (r < steps-1))
        str+="<TR>"

  }
  str+="</TABLE>"
  return str
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////





// -->





