jQuery.noConflict();

jQuery(document).ready(function() {
						   
	// allow for separate colors of list bullets and text
	prepareLists();

	// create corner division
	jQuery(document).ready(function(){
		jQuery(".corner_container").filter(".tr").append("<div class=\"corner top_right\"><!-- --></div>");
		jQuery(".corner_container").filter(".br").append("<div class=\"corner bottom_right\"><!-- --></div>");
		jQuery(".corner_container").filter(".bl").append("<div class=\"corner bottom_left\"><!-- --></div>");
		jQuery(".corner_container").filter(".tl").append("<div class=\"corner top_left\"><!-- --></div>");
	 });

	// show-hide home page banner info
	jQuery(document).ready(function(){
		jQuery.cookie('show_hide', 'show', {expires: 365, path: '/', domain: 'buffalo.edu'});
		// do only for home page
		if (jQuery("body.home").length) {
			// make controls
			jQuery("#controls").append("<ul></ul>")
			jQuery("#controls ul").append("<li id='open' class='replace'>Open</li>").append("<li id='close' class='replace'>Close</li>");
			if (jQuery.cookie('show_hide') == 'show') {
				jQuery("#controls li").click(function(){
					jQuery("#info").toggle();
					jQuery("#controls li").toggle();
					jQuery.cookie('show_hide', 'hide');
				});
			} else if (jQuery.cookie('show_hide') == 'hide') {
				jQuery("#info").toggle();
				jQuery("#controls li").toggle();
				jQuery("#controls").click(function(){
					jQuery("#info").toggle();
					jQuery("#controls li").toggle();
					jQuery.cookie('show_hide', 'show');
				});
			}
		}
	});
	// Cookie Eraser
	// jQuery.cookie('show_hide', '', {expires: -1});

	// clear input value out of the box first time focused
	jQuery('#signup_field').addClass("inactive").one('focus', function() { jQuery(this).removeClass("inactive"); this.value = '' });


	// add external, document, download, etc. icon hints and tooltips to links
	jQuery('#sec_nav, #main_column').linkHints(
		jQuery('link[@rel=home]').attr('href'),
		function(){
			return !jQuery(this).parents().is('.events');
			}
		);

	// total hack
	jQuery('#student_video_link a').unbind('click').attr('onclick', '').click(function() { window.open(this.href,'student_video','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=750');return false});
	
});

function prepareLists() {
	var main = document.getElementById('main_column');
	var list_items = main.getElementsByTagName('li');
	for (var i=0; i < list_items.length; i++) {
		var content = list_items[i].innerHTML;
		list_items[i].className += " color_fix";
		list_items[i].innerHTML = "<div class=\"color_return\">" + content + "</div>";
	};
}
