$(document).ready(function() {
	jQuery.preloadImages = function()
	{
	  for(var i = 0; i<arguments.length; i++)
	  {
		jQuery("<img>").attr("src", arguments[i]);
	  }
	}

	$('#homepage_slideshow')
		.cycle({ 
			speed:    700, 
			timeout:  5000 
		});
	$('#homepage_slideshow li')
		.show();
	$('#homepage_taglines').cycle({ 
		speed:    700, 
		timeout:  5000,
		nowrap: 1
	});
	$('#homepage_taglines li')
		.show();

	$("#main_menu ul li")
		.hover(menuFocus, menuBlur);

	function menuFocus() {
		$(this).addClass('hover');
		$(this).children('.submenu')
			.css('filter', 'progid:DXImageTransform.Microsoft.Alpha(opacity=93)')
			.show();
	}
	function menuBlur() {
		$(this).removeClass('hover');
		$(this).children('.submenu').hide();
	}

	$("#content p:first").addClass('first_paragraph');

	$("a.resource, a[href^='http://'], a[href^='https://'], a[href$='.pdf'], a[href$='.doc']")
		.attr('target', '_blank');

	if ($("#search_input_field").val().length==0){
		$("#search_input_field")
			.addClass('prompt')
			.val('search »')
			.focus(function(){
				$("#search_input_field")
					.val('')
					.removeClass('prompt')
			});
	}

	$(".sidebar_item:last").css('margin-bottom', '6px');

	$(".showlink").click(function() {
		$(this).hide();
		$(this).parent().children('.hidden').toggle();
		return false;
	});


});
