<!-- //browser checker 
//will return the browser, Opera, Netscape, Internet Explorer
function getBrowser(){
    var objBrowser = navigator.appName + navigator.appVersion + navigator.userAgent;
	 
    switch (navigator.appName){
        case "Netscape":
            if (objBrowser.indexOf("Opera 5", 0) != -1)                 {return "OP5"}
            else if (objBrowser.indexOf("Netscape4", 0) != -1)          {return "NN4"}
            else if (objBrowser.indexOf("Netscape6", 0) != -1)          {return "NN6"}
            else if (objBrowser.indexOf("Netscape/7", 0) != -1)         {return "NN7"}
            else if (objBrowser.indexOf("Firefox/1", 0) != -1)				{return "FF1"}
            //else                                                      {return "NN"} //unknown version of nn
            break;                  
    
        case "Microsoft Internet Explorer":
            if (objBrowser.indexOf("Opera 5", 0) != -1)                 {return "OP5"} 
            else if (objBrowser.indexOf("MSIE 5", 0) != -1)             {return "IE5"} 
            else if (objBrowser.indexOf("MSIE 6", 0) != -1)             {return "IE6"}
            //else                                                      {return "IE"} //unknown version of ie
            break;
    
        case "Opera":
            if (objBrowser.indexOf("Opera/5",0) !=-1)                   {return "OP5"}
            if (objBrowser.indexOf("Opera/6",0) !=-1)                   {return "OP6"}
            if (objBrowser.indexOf("Opera/7",0) !=-1)                   {return "OP7"}
            if (objBrowser.indexOf("Opera/8",0) !=-1)                   {return "OP8"}
            break;
    
      //  case "Mozilla":
        		
       	 //	break;
        
        default: return "OTHER";
    }
}

//Will return the platform for the computer. Either MAC or WIN

function getPlatform() {
    var objPlatform = navigator.platform;

    if (objPlatform.indexOf("Mac", 0) != -1) 
        return "MAC";
    else if (objPlatform.indexOf("Sun", 0) != -1)
        return "SUN";
    else if (objPlatform.indexOf("Win", 0) != -1) 
        return "WIN";
}

function getScreenRes() {
    var intScreenWidth = screen.width
    return intScreenWidth;
}

function getCss() {
    var objBrowserPlatform = getPlatform() + getBrowser();
    var intScreenWidth = getScreenRes();
    
    switch (objBrowserPlatform)
    {
        case "WINOP5":      document.write('<link href="css/ie.css" rel="styleSheet" type="text/css">'); break;
        case "WINOP6":      document.write('<link href="css/ie.css" rel="styleSheet" type="text/css">'); break;
        case "WINOP7":      document.write('<link href="css/ie.css" rel="styleSheet" type="text/css">'); break;
        case "WINOP8":      document.write('<link href="css/ie.css" rel="styleSheet" type="text/css">'); break;
        case "WINNN4":      document.write('<LINK HREF="css/ns.css" REL="styleSheet" TYPE="text/css">'); break;
        case "WINNN6":      document.write('<LINK HREF="css/ns6.css" REL="styleSheet" TYPE="text/css">'); break;
        case "WINNN7":      document.write('<LINK HREF="css/ns6.css" REL="styleSheet" TYPE="text/css">'); break;
        case "WINIE5":      document.write('<link href="css/ie.css" rel="styleSheet" type="text/css">'); break;
        case "WINIE6":      document.write('<link href="css/ie.css" rel="styleSheet" type="text/css">'); break;
        case "WINFF1":      document.write('<link href="css/ns6.css" rel="styleSheet" type="text/css">'); break;
        case "SUNNN4":      document.write('<LINK HREF="css/ns.css" REL="styleSheet" TYPE="text/css">'); break;
        case "SUNNN6":      document.write('<LINK HREF="css/ns6.css" REL="styleSheet" TYPE="text/css">'); break;
        case "SUNNN7":      document.write('<LINK HREF="css/ns6.css" REL="styleSheet" TYPE="text/css">'); break;
        
        // check mac for screen res. - 1280 is the normal res for G4
        //               - 1024 is the normal res for iMac
        
        case "MACOP5":      
            if (intScreenWidth == '1280')   document.write('<LINK HREF="css/mac.css" REL="styleSheet" TYPE="text/css">');
            else                document.write('<LINK HREF="css/ns.css" REL="styleSheet" TYPE="text/css">');
            break;
            
        case "MACNN4":      
            if (intScreenWidth == '1280')   document.write('<LINK HREF="css/mac.css" REL="styleSheet" TYPE="text/css">');
            else                document.write('<LINK HREF="css/ns.css" REL="styleSheet" TYPE="text/css">');
            break;
            
        case "MACNN6":      
            if (intScreenWidth == '1280')   document.write('<LINK HREF="css/mac.css" REL="styleSheet" TYPE="text/css">');
            else                document.write('<LINK HREF="css/ns6.css" REL="styleSheet" TYPE="text/css">');
            break;
            
        case "MACIE5":      
            if (intScreenWidth == '1280')   document.write('<LINK HREF="css/mac.css" REL="styleSheet" TYPE="text/css">');
            else                document.write('<LINK HREF="css/ns.css" REL="styleSheet" TYPE="text/css">');
            break;
            
        case "MACIE6":      
            if (intScreenWidth == '1280')   document.write('<LINK HREF="css/mac.css" REL="styleSheet" TYPE="text/css">');
            else                document.write('<LINK HREF="css/ns.css" REL="styleSheet" TYPE="text/css">');
            break;
        
        //will be used for other browser platform combinations
        case "WINOTHER":       document.write('<link href="css/ie.css" rel="styleSheet" type="text/css">');break;
        case "SUNOTHER":       document.write('<link href="css/ns.css" rel="styleSheet" type="text/css">');break;
        case "MACOTHER":       document.write('<link href="css/ns.css" rel="styleSheet" type="text/css">');break;

        default:       document.write('<link href="css/ns.css" rel="styleSheet" type="text/css">');break;
    }
}

getCss();

//Netscape Resize Fix ==>

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

MM_reloadPage(true);

function ReplaceTextOnLayer(WhichLayer, strText) {
    if (document.layers) {
        document.layers[WhichLayer].document.open();
        document.layers[WhichLayer].document.write("<span class='text'>"+unescape(strText)+"</span>");
        document.layers[WhichLayer].document.close();
    } else if (document.all) {
        //eval("document.all['" + WhichLayer + "'].innerHTML = '" + unescape(strText) + "';");
        document.all[WhichLayer].innerHTML = unescape(strText);
    } else if (document.getElementById) {
        document.getElementById(WhichLayer).innerHTML = unescape(strText);
    }
}

function preloadImage(strImage, strImageSrc) {
    var strImage = new Image(); 
    strImage.src = strImageSrc;
    return strImage;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];x.alt=a[i+1];}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

// ---------------------  ADDED BY EDDIE   -----------------------

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

// ---------------------  ADDED BY DON   -----------------------

// This function will populate a combo box (cBox) in the given Form (objForm)
// from the passed array of codes (selArray).

function populate_dropdown(objForm, cBox, selArray) 
{
  // reduce length of existing combo box to match that of selected array

  while (selArray.length < objForm.elements[cBox].options.length) 
    objForm.elements[cBox].options[(objForm.elements[cBox].options.length - 1)] = null;
	
  // replace existing options with details from selected array

  for (var i=0; i < selArray.length; i++) 
    eval("objForm.elements['" + cBox + "'].options[i]=" + "new Option" + selArray[i]);
}

// This function will set the default value on the passed combo box (cBox)
// to (saveOption) on the form (objForm)

function dropdown_setOption(objForm, cBox, saveOption) 
{
  if (saveOption != null && saveOption != '') 
  {
    for (var i = 0; i < objForm.elements[cBox].options.length; i++) 
    {
      if (objForm.elements[cBox].options[i].value == saveOption)
      {
        objForm.elements[cBox].options[i].selected=true;
        i = objForm.elements[cBox].options.length;
      }
    }
  }
}

// This function will return the currently selected value, or 0 if none are selected

function dropdown_getOption(objForm, cBox)
{
	for (var i=0; i < objForm.elements[cBox].options.length; i++) 
	{
		if (objForm.elements[cBox].options[i].selected == true) return (objForm.elements[cBox].options[i].value);
	}
	return (objForm.elements[cBox].options[0].value);
}

// This function will return the currently selected text label, or "" if none are selected

function dropdown_getOptionLabel(objForm, cBox)
{
	for (var i=0; i < objForm.elements[cBox].options.length; i++) 
	{
		if (objForm.elements[cBox].options[i].selected == true) return (objForm.elements[cBox].options[i].text);
	}
	return ("");
}

// These functions will show / hide divisions - used for allowing entry of 
// optional 'OTHER' codes in tech skills and also used by twisties


function getAllTags(tag) {
   var arr;
   if (document.getElementsByTagName)
      arr = document.getElementsByTagName(tag);
   else
      arr = document.all.tags(tag);

   if (getAllTags.arguments.length == 1) return arr;
   var ret = new Array();
   var i = 0;
   if (typeof arr.length == 'undefined') {
      if (arr.id.indexOf(getAllTags.arguments[1]) != -1) ret[0] = arr;
      return ret;
   }
   for (var j = 0; j < arr.length; j++) {
      if (arr[j].id.indexOf(getAllTags.arguments[1]) != -1) {
         ret[i] = arr[j];
         i++;
      }
   }
   return ret;
}

function getObj(id) {
   if (document.layers) return document.layers[id];
   if (document.getElementById) return document.getElementById(id);
   return document.all[id];
}

// DOM Node type constants
var NODE_ELEMENT_NODE                = 1;
var NODE_ATTRIBUTE_NODE              = 2;
var NODE_TEXT_NODE                   = 3;
var NODE_CDATA_SECTION_NODE          = 4;
var NODE_ENTITY_REFERENCE_NODE       = 5;
var NODE_ENTITY_NODE                 = 6;
var NODE_PROCESSING_INSTRUCTION_NODE = 7;
var NODE_COMMENT_NODE                = 8;
var NODE_DOCUMENT_NODE               = 9;
var NODE_DOCUMENT_TYPE_NODE          = 10;
var NODE_DOCUMENT_FRAGMENT_NODE      = 11;
var NODE_NOTATION_NODE               = 12;

/* DOM function to get a list of child elements matching the given tag type */
function getDescendants(parent, tag) {
   var result = [];
   if (!parent) return result;
   //var arr = parent.children || parent.childNodes;
   var arr = parent.childNodes;
   if (!arr) return result;
   for (var i = 0; i < arr.length; i++) {
      if (arr[i].nodeType && arr[i].nodeType != NODE_ELEMENT_NODE) continue; /* only element types */
      if (arr[i].tagName.toUpperCase() == tag.toUpperCase()) {
         result.push(arr[i]);
      }
   }
   return result;
}

/* DOM function to get the value of the text node child of the given element */
function getTextChildValue(element) {
   if (!element) return null;
   if (element.textContent) return element.textContent;

   if (!element.childNodes) return null;

   for (var i = 0; i < element.childNodes.length; i++) {
      if (element.childNodes[i].nodeType == NODE_TEXT_NODE)
         return element.childNodes[i].nodeValue;
   }
   return null;
}

/* Get a list of all elements matching the given tag type and style class */
function getElements(tagName, className) {
   var arr = getAllTags(tagName);
   var ret = new Array();
   for (var i = 0; i < arr.length; i++) {
      if (arr[i].className && arr[i].className.toUpperCase() == className.toUpperCase())
         ret[ret.length] = arr[i];
   }
   return ret;
}

/* Determine if the child object is a descendant of the parent object */
function isDescendant(parent, child) {
   while (child && child.parentNode) {
      if (parent == child.parentNode) return true;
      child = child.parentNode;
   }
   return false;
}

function hideDiv(id) {
	if (document.layers) {
		document.layers[id].visibility = "hide";
		arrange();
	}
	else if (document.getElementById) {
	   document.getElementById(id).style.visibility = "hidden";
	   document.getElementById(id).style.display = "none";
	}
	else {
		document.all[id].style.display = "none";
		document.all[id].style.visible = "hidden";
	}
}

function showDiv(id) {
	if (document.layers) {
		document.layers[id].visibility = "show";
		arrange();
	}
	else if (document.getElementById) {
	   document.getElementById(id).style.visibility = "visible";
	   document.getElementById(id).style.display = "block";
	}
	else {
		document.all[id].style.display = "block";
		document.all[id].style.visibility = "visible";
	}
}

/* equivalent to showDiv(), but for <tr> elements */
function showRow(id) {
   if (document.layers) {
      document.layers[id].visibility = "show";
      arrange();
   } else if (document.getElementById) {
      document.getElementById(id).style.visibility = "visible";
      try {
         // this is the right way to do it for <tr> elements...
         document.getElementById(id).style.display = "table-row";
      } catch (err) {
         // but internet explorer doesn't like it that way
         document.getElementById(id).style.display = "block";
      }
   } else {
      document.all[id].style.display = "table-row";
      document.all[id].style.visibility = "visible";
   }
}

/* equivalent to hideDiv(), but for <tr> elements */
function hideRow(id) {
   // actually, it's exactly the same
   hideDiv(id);
}

function toggleDiv(id, show) {
   if (show) {
      showDiv(id);
   } else {
      hideDiv(id);
   }
}

function toggle(id) {
   
    if (getDivStatus(id)) hideDiv(id)
    else showDiv(id);
    
}

function getDivStatus(id) {
   if (document.layers) {
        if (document.layers[id].visibility=="show") return 1;
		else return 0
	} else if (document.getElementById) {
       if (document.getElementById(id).style.visibility=="visible") return 1;
	   else return 0;
	} else {
  	   if (document.all[id].style.visible=="visible") return 1;
  	   else return 0;
	}
	return 0;
}


// Trim all lefthand whitespace

function ltrim ( s ) { return s.replace( /^\s*/, "" );} 

// Trim all righthand whitespace

function rtrim ( s ) { return s.replace( /\s*$/, "" );} 

// Trim all leading/trailing whitespace

function trim ( s ) { return rtrim(ltrim(s));} 

// Determines if any data has been entered into an input field

function isFieldSet(objForm, fieldname)
{
  var fieldValue = trim(objForm.elements[fieldname].value);
  
  if ( fieldValue == null || 
       fieldValue == "-1" ||
       fieldValue == ""    )
	return false;
  return true;
}

// Determines if ANY of the values in a CheckBox/Radio button group is selected

function isArraySet(objForm, fieldname)
{
  // ensure the field exists on the page
  
  if  (typeof objForm.elements[fieldname] == 'undefined') return false;

  // if the length is undefined, then there is only 1 checkbox on the screen

  var nbr_values = objForm.elements[fieldname].length;

  if  (typeof nbr_values  == 'undefined')
  {
     if (objForm.elements[fieldname].checked) return (true);
     else return (false);
  }

  // if multiple checkboxes, loop through to find out if any are checked

  var isSet = false;

  for (var i = 0; i < nbr_values; i++)
    if ( objForm.elements[fieldname][i].checked == true ) isSet = true;
  
  if ( isSet ) return true; else return false;
}

// returns the Radio Button value, or 'undefined' if nothing is selected..

function getRadioButtonValue(radio)
{  
  // if the length is undefined, then there is only 1 checkbox on the screen

  if  (typeof radio  == 'undefined') return 'undefined';

  if  (typeof radio.length  == 'undefined')
  {
     if (radio.checked) return radio.value;
     else return 'undefined';
  }

   // otherwise, look through the list..

   for (var i = 0; i < radio.length; i++)
   {   
	if (radio[i].checked) { return radio[i].value }
   }
   return 'undefined';
}

// returns the Radio Button value, or 'undefined' if nothing is selected..

function setRadioButtonValue(radio, value)
{  
  // if the length is undefined, then there is only 1 checkbox on the screen

  if  (typeof radio.length  == 'undefined')
  {
     if (radio.checked) return radio.value;
     else return 'undefined';
  }

   // otherwise, look through the list..

   for (var i = 0; i < radio.length; i++)
   {   
	if (radio[i].value == value) { 
	
	 radio[i].checked = true;
	 return value; 
    }
   }
   return 'undefined';
}


// Enables all the Checkboxes in a group

function enableChkArray(objForm, fieldname)
{
  var nbr_days = objForm.elements[fieldname].length;

  for (var i = 0; i < nbr_days; i++)
  {
    objForm.elements[fieldname][i].disabled=false;
  }
}

// Disables and unchecks all the Checkboxes in a group

function disableChkArray(objForm, fieldname)
{
  var nbr_days = objForm.elements[fieldname].length;

  for (var i = 0; i < nbr_days; i++)
  {
    objForm.elements[fieldname][i].checked=false;
    objForm.elements[fieldname][i].disabled=true;
  }
}

// Enables all the Checkboxes in a group

function tickChkArray(objForm, fieldname)
{
  var nbr_days = objForm.elements[fieldname].length;

  for (var i = 0; i < nbr_days; i++)
  {
    objForm.elements[fieldname][i].checked=true;
  }
}

// Disables and unchecks all the Checkboxes in a group

function untickChkArray(objForm, fieldname)
{
  var nbr_days = objForm.elements[fieldname].length;

  for (var i = 0; i < nbr_days; i++)
  {
    objForm.elements[fieldname][i].checked=false;

  }
}

// get the number of checkboxes selected
function getNumChecked(cbox) {
   if (typeof cbox == 'undefined') return 0;
   if (typeof cbox.length == 'undefined') return cbox.checked ? 1 : 0;
   var count = 0;
   for (var i = 0; i < cbox.length; i++) {
      if (cbox[i].checked) count++;
   }
   return count;
}

// Save the screen position for post-reload repositioning..
// requires an input parameter on the form called 'screenPosY'

function saveScreenPosition(objForm)
{
  // Determine browser type
  NS = (document.layers) ? 1 : 0;
  IE = (document.all) ? 1: 0;
  
  if (IE)
  {
    positionY=document.body.scrollTop;
  }
  else // Assume NS
  {
    positionY=self.pageYOffset;
  }
  objForm.screenPosY.value=positionY; // creates parameter of format 'screenPosY=9'
}

function goTo(ltag)
{
 // Determine browser type
  NS = (document.layers) ? 1 : 0;
  IE = (document.all) ? 1: 0;
  
  if (IE)
  {
    positionY=document.anchors(ltag).offsetTop;
  }
  else // Assume NS
  {
    positionY=document.anchors[ltag].pageYOffset; // may just be able to do anchors[xxx].y ?
  }
  window.scrollTo(0, positionY);
}

function textCounter(field, maxlimit) 
{
	if (field.value.length > maxlimit) // if too long...trim it!
		field.value = field.value.substring(0, maxlimit);

}

function changeImages()
{
   a = document;
   if (a.images)
   {
      var img;
      for (var i=0; i<changeImages.arguments.length; i+=2)
      {
         img = null;
         if (a.layers)
         {
           img = findElement(changeImages.arguments[i],0);
         }
         else
         {
           img = a.images[changeImages.arguments[i]];
         }
	if (img)
	{
	   img.src = changeImages.arguments[i+1];
	}
      }
   }
}

/* This function is a work around for firefox/netscape */
function dropDownMenuFix() {
   var arr = getElements('table', 'ddMenu');
   var x;
   for (var i = 0; i < arr.length; i++) {
      /* force firefox to re-render the menu */
      x = arr[i].lastChild;
      arr[i].removeChild(x);
      arr[i].appendChild(x);
   }
}

/* getAbsoluteTop() - gets the y-coordinate of the top of the  */
/*    object relative to the top of the page.                  */
function getAbsoluteTop(elem) {
   var topPosition = 0;
   while (elem) {
      if (elem.tagName.toUpperCase() == 'BODY') break;
      topPosition += elem.offsetTop;
      elem = elem.offsetParent;
   }
   return topPosition;
}

/* getAbsoluteLeft() - gets the x-coordinate of the left edge  */
/*    of the object relative to the left of the page.          */
function getAbsoluteLeft(elem) {
   var leftPosition = 0;
   while (elem) {
      if (elem.tagName.toUpperCase() == 'BODY') break;
      leftPosition += elem.offsetLeft;
      elem = elem.offsetParent;
   }
   return leftPosition;
}

/*
 * Adds an event to a given document object using attachEvent if
 * the browser is IE and addEventListener otherwise.  Usecapture
 * will always be set to true.
 */
 
function eventOnObject(obj, onEvent, handler) {
	if (obj.attachEvent) {
		obj.attachEvent("on" + onEvent, handler);
	} else {
		obj.addEventListener(onEvent, handler, true);
	}
}

function eventOffObject(obj, onEvent, handler) {
	if (obj.detachEvent) {
		obj.detachEvent("on" + onEvent, handler);
	} else {
		obj.removeEventListener(onEvent, handler, true);
	}
}


function disableEnterKey(e)
{
     var key;

     if(window.event) key = window.event.keyCode;     
     else key = e.which;    

     if(key == 13) return false;
     else return true;
}





//-->

