

// Add .hover for ie6
function InitNav()
{
	var bcgImagePath = $("ul#navList li.on").css("background-image").replace(/"/g,"").replace(/url\(|\)$/ig, "");
	$("ul#navList > li.off").hover(function() { //Hover over
		$(this).addClass("over");
		$("ul#navList li.on").css("background-image","none");
	}, function() { //on hover out...
		$(this).toggleClass("over");
		$("ul#navList li.on").removeAttr("style").css("background-image", bcgImagePath);
	});
	
	var hash = (document.location.toString().split('#')[1]);
    if ( hash )
        $('#navList li.on ul a[href$="#' + hash + '"]').attr('class', 'selected');
	
	$("#navList li.on ul a").click(function() { //highlight on click
		$("#navList li.on ul a").removeClass("selected");
		$(this).addClass("selected");
		
	});
}


// field Hints
jQuery.fn.fieldhint = function () {
  return this.each(function (){
    // get jQuery version of 'this'
    var t = jQuery(this); 
    // get it once since it won't change
    var title = t.attr('title'); 
    // only apply logic if the element has the attribute
    if (title) { 
      // on blur, set value to title attr if text is blank
      t.blur(function (){
        if (t.val() == '') {
          t.val(title);
          t.addClass('fieldhint_blur');
        }
      });
      // on focus, set value to blank if current value 
      // matches title attr
      t.focus(function (){
        if (t.val() == title) {
          t.val('');
          t.removeClass('fieldhint_blur');
        }
      });

      // clear the pre-defined text when form is submitted
      t.parents('form').submit(function(){ // THIS USED TO SAY form:first()
          if (t.val() == title) {
              t.val('');
              t.removeClass('fieldhint_blur');
          }
      });
                  // do the same when the window is unloaded
                  $(window).unload(function(){ // THIS USED TO SAY form:first()
          if (t.val() == title) {
              t.val('');
              t.removeClass('fieldhint_blur');
          }
      });

      // now change all inputs to title
      t.blur();
    }
  });
 }


// homepage equal height columns
function setEqualHeight(columns)  {  
	var tallestcolumn = 0;  
	columns.each(  
	function()  
{  
	currentHeight = $(this).height();  
	if(currentHeight > tallestcolumn)  
	{ tallestcolumn  = currentHeight; }}  
);  
	columns.height(tallestcolumn);  
		} $(document).ready(function() {  
	setEqualHeight($(".col_290  > .col_cont"));  
});  



function clearText(theField){
	if (theField.defaultValue == theField.value)
	theField.value = '';
}

function addText(theField){
	if (theField.value == '')
	theField.value = theField .defaultValue;
}



	 
