 
//  (function () {
// 	var head = document.getElementsByTagName("head")[0];
// 	if (head) {
// 		var scriptStyles = document.createElement("link");
// 		scriptStyles.rel = "stylesheet";
// 		scriptStyles.type = "text/css";
// 		scriptStyles.href = "http://www.csus.edu/webpages/css/superfish.css";
// 		head.appendChild(scriptStyles);
// 	}
// }());
//  

 
$(document).ready(function(){ 
	$('#searchdiv').attr('role', 'search');
	$('#main_content').attr('role', 'main');
	$('#navbar').attr('role', 'navigation');
	$('#site_logo').attr('role', 'banner');
	$('#footer').attr('role', 'contentinfo');
	
	$("ul.sf-menu").superfish({ 
		animation:{opacity:'show'},
		speed:100,
		delay:50               
	}); 
}); 

var apply_selected = function(id, child) {
	var elem;
	if(child) {
		$(id + ' li:nth-child(' + child + ') a').addClass('selected').append('<span class="hidden">(selected)</span>');
	} else {
		$(id + ' a').addClass('selected').append('<span class="hidden">(selected)</span>');
	};
};

var show_selection = function(id, child) {
	apply_selected(id, child);
	$('.submenu ul li').hide();
	if(child) {
		$('.selected').parents('li').show().siblings().show();
	} else {
		$('.selected').children('li').show();
	};
};

function openWindow(newpage) {
    msgWindow = window.open('','newWin','scrollbars=yes,width=180,height=250,left=600,top=300');
	msgWindow.location.href = newpage;
	msgWindow.focus();
}

$(document).ready(function(){
	$('a[href^="../catcour.asp"]').each(function(){
		var href= $(this).attr('href');
		$(this).attr('href','javascript:openWindow("' + href + '");');
	});
});