<!--

$(document).ready(function(){
    $("#nav-one li").hover(
        function(){ $("ul", this).fadeIn("fast"); }, 
        function() { } 
    );
if (document.all) {
        $("#nav-one li").hoverClass ("sfHover");
    }
});

$.fn.hoverClass = function(c) {
    return this.each(function(){
        $(this).hover( 
            function() { $(this).addClass(c);  },
            function() { $(this).removeClass(c); }
        );
    });
};


function PostUcNavLeftSearch(oForm, sNewFormAction, oMessage)
{
	
	var vTrim = trim(document.forms[oForm].elements["UcNavLeft1:txtSearch"].value);
	
	//alert("test: "+vTrim);
	
	
	if(vTrim=="" )
	{
		alert(oMessage);
		//return false;
	}
	else
	{
		noPostBackCheck(oForm,"UcNavLeft1:txtSearch", sNewFormAction);
	}
}		

function checkEnter(e,myrun)
{ 
	//e is event object passed from function invocation
	var characterCode; //literal character code will be stored in this variable

	if(e && e.which){ //if which property of event object is supported (NN4)
		e = e;
		characterCode = e.which; //character code is contained in NN4's which property
	}
	else
	{
		e = event;
		characterCode = e.keyCode ;//character code is contained in IE's keyCode property
	}

	if(characterCode == 13)
	{ //if generated character code is equal to ascii 13 (if enter key)
		eval(myrun);
		
	}
	else
	{
		return false;
	}

}

function hlresult(id, type){
	table = "table_" + id;
	tablecol = "tablecol_" + id;
	a = "link_" + id;
	
	tableElement = document.getElementById(table);
	tablecolElement = document.getElementById(tablecol);
	linkElement = document.getElementById(a);

	
	if (tableElement){
		if (tableElement.className == "bordercol"){

			tableElement.className = "bordercol" + type;
			if(tablecolElement)
				tablecolElement.className = "tablebgrcol" + type;
			if(linkElement)
				linkElement.className = "linkcol" + type;
			
		} else {
			
			tableElement.className = "bordercol";
			if(tablecolElement)
				tablecolElement.className = "tablebgrcol";
			if(linkElement)
				linkElement.className = "linkcol";
			
		}
	}
}

function fPopupPicFindImageFromControl(oPopupImgPath, controlID) { 
	var vImg = document.getElementById(controlID);
	var vImgName = vImg.src;
	vImgName = vImgName.substring(vImgName.lastIndexOf("/")+1);
	fPopupPic(oPopupImgPath + vImgName);
}


function switchBetweenDivs(activetab,deactivetab,activediv,deactivediv)
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
  {
	activetab = document.getElementById( activetab );
	deactivetab = document.getElementById( deactivetab );
	activediv = document.getElementById( activediv );
	deactivediv = document.getElementById( deactivediv );
  }
  else if( document.all ) // this is the way old msie versions work
  {
	activetab = document.all[activetab];
	deactivetab = document.all[deactivetab];
	activediv = document.all[activediv];
	deactivediv = document.all[deactivediv];
	
  }
  else if( document.layers ) // this is the way nn4 works
  {
	activetab = document.layers[activetab];
	deactivetab = document.layers[deactivetab];
	activediv = document.layers[activediv];
	deactivediv = document.layers[deactivediv];
  }

  if(activetab)
 	 activetab.className = 'active';
	 
  if(deactivetab)  
  	deactivetab.className = '';
	
  if(activediv)
 	 activediv.style.display = 'block';
  
  if(deactivediv)
  	deactivediv.style.display = 'none';
}


// STRIPE TABLES

 // this function is need to work around 
  // a bug in IE related to element attributes
  function hasClass(obj) {
     var result = false;
     if (obj.getAttributeNode("class") != null) {
         result = obj.getAttributeNode("class").value;
     }
     return result;
  }   

 function stripe(id) {

    // the flag we'll use to keep track of 
    // whether the current row is odd or even
    var even = false;
  
    // if arguments are provided to specify the colours
    // of the even & odd rows, then use the them;
    // otherwise use the following defaults:
    var evenColor = arguments[1] ? arguments[1] : "#F0F0F0";
    var oddColor = arguments[2] ? arguments[2] : "#FFF";
  
    // obtain a reference to the desired table
    // if no such table exists, abort
    var table = document.getElementById(id);
    if (! table) { return; }
    
    // by definition, tables can have more than one tbody
    // element, so we'll have to get the list of child
    // &lt;tbody&gt;s 
    var tbodies = table.getElementsByTagName("tbody");

    // and iterate through them...
    for (var h = 0; h < tbodies.length; h++) {
    
     // find all the &lt;tr&gt; elements... 
      var trs = tbodies[h].getElementsByTagName("tr");
      
      // ... and iterate through them
      for (var i = 0; i < trs.length; i++) {

	    // avoid rows that have a class attribute
        // or backgroundColor style
	    if (!hasClass(trs[i]) && ! trs[i].style.backgroundColor) {
 
            var mytr = trs[i];

            // avoid cells that have a class attribute
            // or backgroundColor style
	        if (! hasClass(mytr) && ! mytr.style.backgroundColor) {
        
		      mytr.style.backgroundColor = even ? evenColor : oddColor;
              
            }

        }
        // flip from odd to even, or vice-versa
        even =  ! even;
      }
    }
  }

//-->
