$(document).ready(function() {

	$("#topnav li.has_subnav").hover(function() {
		var $t = $(this); 
		var id = $t.attr('id').substring(7); 
		$nav = $("#footer_" + id).clone();
		$nav.attr('id', 'subnav_' + id).addClass('subnav'); 
		$nav.append("<br class='c' />"); 
		$nav.addClass('r'); 
		$t.append($nav); 
		$t.addClass('hovered'); 
		$t.siblings('li').addClass('off'); 
		//$t.children('a').attr('href', '#'); 
	}, function() {
		$(this).removeClass('hovered');
		$(this).siblings().removeClass('off');
		$(this).find('.subnav').remove();
	}); 

	var $sidebar = $("#sidebar_left"); 	
	if($sidebar.size() && $sidebar.height() > $("#bodycopy").height()) {
		//$("#bodycopy").height($sidebar.height()+250); 
		$("#bodycopy").height($sidebar.height()); 
	}

	$("select.autojump").change(function() {
		if($(this).val().length > 0) window.location = page.url + $(this).val() + '/';
	}); 

	$("#content ul.PageArray li a").each(function() {
		if($(this).attr('href') == page.url) $(this).addClass('on'); 
	}); 

	$("#cover_photo.cycle").cycle({
		delay: 2000,
		speed: 1000
	}); 

	$("#subscribe_form_top_email").focus(function() {
		if($(this).val() == 'your@email.com') $(this).val(''); 
	}); 
	

}); 

