// JavaScript Document


function urlJump( selectMenu ) {
	if( selectMenu.selectedIndex > 0 )
		window.location = selectMenu[selectMenu.selectedIndex].value;
}

/* "Go Back" links */
// Copyright 2001 Idocs.com      
// Distribute this script freely, but keep this notice in place

// backlink object initializer
function backlink() {
	this.text = 'Go Back';
	this.type = 'link';
	this.write = backlink_write;
	this.form = true;
}


// write method
function backlink_write() {
	if (! window.history) return;
	if (window.history.length == 0)return;

	this.type = this.type.toLowerCase();
	if (this.type == 'button') {
		if (this.form)
			document.write('<FORM>');
		document.write('<INPUT TYPE=BUTTON onClick="history.back(-1)" VALUE="', this.text, '"');
		if (this.otheratts) document.write(' ', this.otheratts);
		document.write('>');
		if (this.form)document.write('<\/FORM>');
	} else {
		document.write('<A HREF="javascript:history.back(-1)"');
		if (this.otheratts)
			document.write(' ', this.otheratts);
		document.write('>');
		if (this.type == 'image' || this.type == 'img') {
			document.write('<img SRC="', this.src, '" ALT="', this.text, '"');
			if (this.width) document.write(' WIDTH=', this.width);
			if (this.height) document.write(' HEIGHT=', this.height);
			if (this.otherimgatts) document.write(' ', this.otherimgatts);
			document.write(' BORDER=0 />');
		}
		else
			document.write(this.text);
		document.write('<\/A>');
	}
}


/* popup window */
function popup(mylink, windowname) {
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
   	href=mylink;
	else
   	href=mylink.href;
	window.open(href, windowname, 'width=450,height=265,scrollbars=no');
	return false;
}

function targetopener(mylink, closeme, closeonly) {
	if (! (window.focus && window.opener))return true;
	window.opener.focus();
	if (! closeonly)window.opener.location.href=mylink.href;
	if (closeme)window.close();
	return false;
}

function success_handler(o) {
	replace_html('content', o.responseText);
}
 
function failure_handler(o) {
	replace_html('content', 'Server or your connection is death');
}
 
function replace_html(id, content) {
	document.getElementById(id).innerHTML = content;
}
 
function show_progressbar(id) {
	replace_html(id, '<p>Loading calendar, please wait...</p><br/><img src="http://library.iit.edu/images/wait.gif" border="0" alt="Loading, please wait..." />');
}
 
function send_request(file) {
	show_progressbar('content');
	var callback = { success:success_handler,	failure:failure_handler, timeout: 60000 };
	YAHOO.util.Connect.asyncRequest('GET', file, callback);
}
 
function test_failure() {
	show_progressbar('content');
	var callback = { success:success_handler,	failure:failure_handler, timeout: 10000 };
	YAHOO.util.Connect.asyncRequest('GET', 'Xview_hours_galvin.php', callback);
}


function showRefCalendar() {
	window.open( "http://library.iit.edu/calendar/refCalendar.php","ReferenceCalendar","width=250,height=450,left=200,top=200");
}



