$(document).ready(function() {
 
//remove link on sign-in
 $("#signin-link a").attr("href", "#");
 
// toggles the slickbox on clicking the noted link
  $('#signin-link a').click(function() {
 	$('#block-block-22').slideToggle(200);
 	return false;
  });
  
//add sequential classes to blocks in sidebar
   $('#sidebar .block').each(function (i) {
		$(this).addClass('sideblock' + (++i));
		});

//modify text for search box
	$('#edit-search-block-form-keys').val = 'search';
	
	$('#edit-search-block-form-keys').click(
	function() {
			if (this.value == this.defaultValue) {
			this.value = '';
			}
		}
	);
	
	$('#edit-search-block-form-keys').blur(
		function() {
		if (this.value == '') {
			this.value = this.defaultValue;
			}
		}
	);
	
	// wrap a span around legend contents for styling
	$("legend").wrapInner("<span></span>");
	

//show the graphics on mouseover
	var showChrome = function() {
		return function() {
			$("#menutray .chrome").removeClass("hideMe");
		};
	};

	//show the right tab info
	
	var hideIt = function() {
		return function() {
			
		
		};
	
	};
	
	var showIt = function(curTab) {
		    return function() {
		      //first hide any currently visible tabs, defs or subnavs
		      $(".menu-lvl1 dt").removeClass("active");
		      $(".menu-lvl1 dd").removeClass("active");
		      $(".menu-lvl2").addClass("hideMe");
		      
		      //then show the right one
		      $("#tab"+curTab).addClass("active");
		      $("#desc"+curTab).addClass("active");
		      $("#subnav"+curTab).removeClass("hideMe");
			};
		};
	
	//hide everything on mouseout
	var hideChrome = function() {
		return function() {
			$("#menutray .chrome").addClass("hideMe");
			$(".menu-lvl1 dt").removeClass("active");
			$(".menu-lvl1 dd").removeClass("active");
			$(".menu-lvl2").addClass("hideMe");
		};
	};
	
		
		$("#menutray").hover(showChrome(),hideChrome());
		$("#tab1 a").hover(showIt("1"),hideIt());
		$("#tab2 a").hover(showIt("2"),hideIt());
		$("#tab3 a").hover(showIt("3"),hideIt());
		$("#tab4 a").hover(showIt("4"),hideIt());
		$("#tab5 a").hover(showIt("5"),hideIt());
		$("#tab6 a").hover(showIt("6"),hideIt());

});


// replace headline text with Aller font
	// Cufon.replace('#mainCol h2, #sidebar #footer h3, #sidebar h3, #mainCol h3');
	Cufon.replace('#mainCol h2, #sidebar #footer h3, #sidebar .block-block h3, #mainCol h3');







