/* THIS PORTION OF CODE IS USED IN CONJUNCTION WITH THE FILE js/ieFlashFix.js IN ORDER TO PREVENT THE
   IE6 MESSAGE "CLICK TO ACTIVATE AND USE THIS CONTROL" FOR FLASH MOVIES - USED ON THE FLASH SLIDESHOW ON THE HOMEPAGE */
var plugin = 0;
var activeX = 0;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
	plugin = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 6;
} 
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && navigator.userAgent.indexOf("Windows")>=0) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('activeX = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n');
	document.write('<' + '/SCRIPT>');
}

/* NOTIFIES THE USER THAT THEY ARE OPENING A PDF AND PROMPTS THEM TO BE REDIRECTED TO THE ADOBE SITE TO DOWNLOAD ACROBAT */
function getPDF(){
	if (confirm("Clicking on the red PDF images on the School of Law website will take you to the Adobe Reader download page where you can download the software to open .PDF documents for free.  If you already have Adobe Reader and want to open the document instead, press Cancel and click the link to the left of the PDF icon. CONTINUE TO ADOBE.COM?"))
		document.location.href = "http://www.adobe.com/products/acrobat/readstep2.html";
}

/* OPENS THE LIBRARY MAP WINDOW */
function openMap(url){
	var newWin = open(url, 'MAP', 'directories=no,location=no,menubar=no,status=no,scrollbars=no,width=790,height=545,resizeable=no');
	newWin.moveTo(0,0);
}

/* OPENS A NEW WINDOW USING THE PARAMETERS */
function openImg(url,w,h){
	var newWin = open(url, 'IMG', 'directories=no,location=no,menubar=no,status=no,scrollbars=no,width=' + w.toString() + ',height=' + h.toString() + ',resizeable=no');
	newWin.moveTo(0,0);
}

/* PASS A TEXT BOX OBJECT TO THIS FUNCTION TO CLEAR IT'S VALUE - USED FOR SEARCH BOXES THAT HAVE A DEFAULT VALUE OF "search >>>" */
function cs(obj){
	if (obj.value == "search >>>")
		obj.value = "";
}

/* CREATE A FUNCTION TO OPEN A NEW BROWSER WINDOW USING THE PARAMETERS */
function openWindow( URL, dir, loc, men, sta, scr, w, h, r ){
	var winStr = "";
	winStr += "directories=" + dir + ",";
	winStr += "location=" + loc + ",";
	winStr += "menubar=" + men + ",";
	winStr += "status=" + sta + ",";
	winStr += "scrollbars=" + scr + ",";
	winStr += "width=" + w + ",";
	winStr += "height=" + h + ",";
	winStr += "resizeable=" + r + ";";
	var newWin = open(URL, '', winStr);
}

/* SHOW THE INFO BOX ON THE LEGAL SUBJECTS LIBRARY PAGE */
var edbTimeout;
var edbInfo;
function showInfo(note){
	if (document.getElementById)
		edbInfo = document.getElementById("edbInfo");
	else if (document.all)
		edbInfo = document.all["edbInfo"];
		
	var yOffset = 0;
	if (document.documentElement.scrollTop){
		yOffset = document.documentElement.scrollTop;
	}
	else{
		yOffset = document.body.scrollTop;
	}
	
	/* IF MOUSEOUT ON INFO IMAGE, SET TIMEOUT TO HIDE THE BOX, ELSE DISPLAY THE CONTANTS OF THE PARAMETER NOTE
	   IN THE EBB DIV AND CLEAR ANY POTENTIAL TIMEOUT ALREADY SET */
	if (note == "hide"){
		clearTimeout(edbTimeout);
		edbTimeout = setTimeout( "clearEDB()", 1000 );			
	}
	else{
		edbInfo.innerHTML = note;
		edbInfo.style.left = eval(mouseX + 5).toString() + "px";
		edbInfo.style.top = eval(mouseY - 5 + yOffset).toString() + "px";

		clearTimeout(edbTimeout);
		edbInfo.style.visibility = "visible";
	}
}

/* CLEAR THE INFO BOX ON THE LEGAL SUBJECTS LIBRARY PAGE */
function clearEDB(){
	edbInfo.style.visibility = "hidden";
}

function nothing(){}

/* REDIRECT USER TO CREIGHTON SEARCH AND PASS THE TERM IN THE QUERY STRING */
function search(){
	var tSearch = document.getElementById("tSearch");
	document.location.href = "http://www.googlesyndicatedsearch.com/u/creighton?q=" + tSearch.value + "&domains=creighton.edu&sitesearch=creighton.edu";
}

/* STORE THE MOUSE X AND Y POSITIONS FOR THE MOUSEMOVE EVENT ON THE PAGE */
/* USED FOR INSTANCES LIKE THE INFORMATINO POPUP ON THE LEGAL SUBJECTS LIBRARY PAGE */
var mouseX, mouseY;
function getMousePos(e){
	if (!e){
		var e = window.event||window.Event;
	}
	
	if('undefined'!=typeof e.pageX)
	{
		mouseX = e.pageX;
		mouseY = e.pageY;
	}
	else
	{
		mouseX = e.clientX;
		mouseY = e.clientY;
	}
}

if(window.Event && document.captureEvents)
	document.captureEvents(Event.MOUSEMOVE);

document.onmousemove = getMousePos;