/*
New suckerfish menu
*/
$(document).ready(function(){
	$("#nav-one li").hover(
		function(){ $("ul", this).fadeIn("fast"); }, 
		function() { } 
	);

  	if (document.all) {
		$("#nav-one li").hoverClass ("sfHover");
	}
	
	rollovers();
	
	if($('div.scroller').length)
		$('div.scroller').jScrollPane({showArrows:true, scrollbarWidth: 15, arrowSize: 16});
});
	  
$.fn.hoverClass = function(c) {
	return this.each(function(){
		$(this).hover( 
			function() { $(this).addClass(c);  },
			function() { $(this).removeClass(c); }
		);
	});
};


function rollovers()
{
	$(".rollover").hover(
		function () {
			imgSrc = $(this).attr("src");
			newImgSrc = imgSrc.replace("_off","_on");
			
			$(this).attr("src",newImgSrc);
		}, 
		function () {
			imgSrc = $(this).attr("src");
			newImgSrc = imgSrc.replace("_on","_off");
			
			$(this).attr("src",newImgSrc);
		}
	);
}

function clearField(el, str)
{
	el = $(el);

	if(el.val() == str)
		el.val("");
}

function switchField(el, str)
{
	el = $(el);

	if(el.val() == str)
	{
		el.css("display","none");
		el.parent().find("input[type='password']").css("display","block").focus().val("");
	}
}

//Get cookie routine by Shelley Powers
function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    // if cookie exists
    if (offset != -1) {
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1) end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}