/* <![CDATA[ */

$(document).ready(function () {
/*
*
*
*/
$("span.icons span.wc").attr("title","Traditional Day Programs");
$("span.icons span.scd").attr("title","Evening & Weekend Programs");
$("span.icons span.on").attr("title","Online Programs");
$("span.icons span.grad").attr("title","Graduate Programs");

/*
*
*
*
*/
	$("div ul.menu li ul li").css("background-image", "none");

	$("ul.menu li#AdmissionRequirements a").click(function() {
	
		if($(this).parent().parent().parent().parent().attr("class") != "menu") {
		
			return false;
		
		}
		
	});	

	$("a.degrees-link").click(function() {
	
		if($(this).text() == "Click here for a list of degrees") {
		
			$(this).html("Click here to close list of degrees");
			$(this).parent().parent().find("div.degrees").slideDown("normal");
			$(this).css("color","#F00");
			return false;
		
		} else {
		
			$(this).html("Click here for a list of degrees");
			$(this).parent().parent().find("div.degrees").slideUp("normal");
			$(this).css("color","#102D69");
			return false;
		
		}
	
	});
	
	$(".view-display-id-block_1.view-news-events li").css("cursor","pointer");
	
	$(".view-display-id-block_1.view-news-events li").hover(function () {
	
		$(this).css("background","#999");
	
	}, function () { 
	
		$(this).css("background","#EEE");
	
	});
	
	$(".view-display-id-block_1.view-news-events  li").click(function () {
	
		location.href = $(this).find("a").attr("href");
	
	});
	
	$(".view-display-id-block_1.view-alumni-news-events li").css("cursor","pointer");
	
	$(".view-display-id-block_1.view-alumni-news-events li").hover(function () {
	
		$(this).css("background","#999");
	
	}, function () { 
	
		$(this).css("background","#EEE");
	
	});
	
	$(".view-display-id-block_1.view-alumni-news-events  li").click(function () {
	
		location.href = $(this).find("a").attr("href");
	
	});
	
	$(".minical div.calendar").hide();
	$(".minical div.calendar").css("position","absolute");
	
	$(".minical div.calendar-calendar table td").hover(function () {
	
		$(this).find("div.calendar.monthview").show();
	
	}, function () {
	
		$(this).find("div.calendar.monthview").hide();
	
	});

	// Handle photo gallery control
	var imgFeatured = $("div#gallery-wrap img.featured");
	var row1 = $("div#gallery-wrap div.views-row-1");
	var descBlock = $("div#gallery-wrap div.description-block");
	var titleBlock = descBlock.find("div.title");
	var bodyBlock = descBlock.find("div.body");

	var selectImage = function(container)
	{
		imgFeatured.attr("src",container.find("img.full").attr("src"));
		var title = container.find("div.description span.title").text();
		var desc = container.find("div.description p").text();
		if(desc.length)
		{
			titleBlock.html(title);
			bodyBlock.html(desc);
		}else{
			titleBlock.html('');
			bodyBlock.html('');
		}
	};

	// Set the default (first image)
	selectImage(row1.find("div.gallery-image"));

	// Listen for thumbnail clicks
	$("div#gallery-wrap img.thumb").click(function()
	{
		selectImage($(this).parent());
	});
	
	$("div#cart-form-products td.desc a").each(function () {
	
		if(
			$(this).attr("href") == "/node/1896" 
			|| 
			$(this).attr("href") == "/node/1897" 
			|| 
			$(this).attr("href") == "/node/1898" 
			|| 
			$(this).attr("href") == "/node/1899" 
		) {
		
			$("div#jshp").show();
		
		}
	
	});
	
	var imagefield = $("div.field-type-image").html();
	$("div.field-type-image").hide();
	if(imagefield) {
	
		$("div#content-area").append("<div class='field-type-image'><br/>" + imagefield + "</div>");
	
	}
	
	$("div#node-1896").prepend("<p><a href='http://www.midway.edu/alumni-giving/johnstephenhockensmith-prints'>&laquo; Click here to return to John Stephen Hockensmith Prints</a></p>");
	$("div#node-1897").prepend("<p><a href='http://www.midway.edu/alumni-giving/johnstephenhockensmith-prints'>&laquo; Click here to return to John Stephen Hockensmith Prints</a></p>");
	$("div#node-1898").prepend("<p><a href='http://www.midway.edu/alumni-giving/johnstephenhockensmith-prints'>&laquo; Click here to return to John Stephen Hockensmith Prints</a></p>");
	$("div#node-1899").prepend("<p><a href='http://www.midway.edu/alumni-giving/johnstephenhockensmith-prints'>&laquo; Click here to return to John Stephen Hockensmith Prints</a></p>");
	
	
	$("div#node-1901").prepend("<p><a href='http://www.midway.edu/alumni-giving/rayharm/print'>&laquo; Click here to return to main Ray Harm Eagle Print page</a></p>");

});

/* ]]> */