$(document).ready( function() {
	var dropin = function() {
		var parentid = $(this).parent().attr("id");
		var kid = this;

		$("#" + parentid + " ul").slideToggle( "normal" , function() {
			//alert( this.id );
			//alert( parentid );
			$(kid).stop();
			$(this).bind( "mouseleave", dropout );
		});
	};

	var dropout = function() {
	/*
		$(this).animate({
			opacity: 1
		}, 500, "linear", function() {
			$(this).slideUp();
		});
	*/

		$(this).slideUp();
	};

	var arrowclick = function(){
		$("#campus_drop_down_list").slideToggle();
	}

	// Makes "Search" text go away
	var searchfocus = function() {
		if ( $(this).val() == "Search" )
		{
			$(this).val("");
		}
	};

	// Brings "Search" text back
	var searchblur = function() {
		if ( $(this).val() == "" )
		{
			$(this).val("Search");
		}
	};

	var dltoggle = function() {
		$(this).next().toggle();
	};

	$("#search").bind("focus", searchfocus);
	$("#search").bind("blur", searchblur);

	$("dl.droppable dt").click( dltoggle );

	
	$("#campus_drop_down_name").click( arrowclick );
	$("#section .name").click( dropin );
	//$("#section .item").bind( "mouseleave", dropout );
});

var openwindow = false;

function openIntegrationWindow(url)
{					
	window.open(url,"manager3","toolbar=0, directories=0, location=0, status=yes, menubar=0, resizable=1, scrollbars=1, width=620px, height=575px");
}

function autowindow() {
	openIntegrationWindow(openwindow);
	document.getElementById('content').onmouseover = '';
}
