// opening windows fuctions 

	function openWin(url) {
		 window.location = url;
	}

	function newWindow(url,wid,ht) {
		var param = "directories=yes,scrollbars=yes,resizable=yes,status=yes,menubar=yes,location=yes,toolbar=yes";
		if (wid) { param = param + ",width=" + wid; } 
			else { param = param + ",width=500"; }
		if (ht) { param = param + ",height=" + ht ; } 
			else { param = param + ",height=500"; }
		smallWindow = window.open(url,'smallWin',param);
		smallWindow.focus();
	}
 
// header search function
		
	function jplSearch(terms) {
		var searchURL = "http://www.google.com/search?q=site%3A%20jaxpubliclibrary.org " + terms;
		window.location = searchURL;
	}

	
	function jaxcatBasic(searchterms) {
		var searchURL = "/web2/tramp2.exe/do_keyword_search/guest?setting_key=english&servers=1home&index=default&screen=hitlist.html&query=";
		searchURL = searchURL + searchterms;
		window.location = searchURL;
	}	

// Page last updated function

	function writeDateModified(time) {
	
		var days = new Array ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");                    
		var months = new Array ("January","February","March","April","May","June","July","August","September","October","November","December")
		
		// Assign date variables with document.lastModified 
		var modDate = new Date(Date.parse(document.lastModified));
		
		// If we have a valid date reformat it.
		if (modDate != 0) {
			var day = days[modDate.getDay()];
			var ndate = modDate.getDate();
			var month = months[modDate.getMonth()];
			var year = modDate.getYear();
			if (year < 1000) year = year + 1900;
			if (time) {
				var hour = modDate.getHours().toString();
				if (hour.length == 1) hour = "0" + hour; 
				var minute = modDate.getMinutes().toString();
				if (minute.length == 1) minute = "0" + minute;
				var second = modDate.getSeconds().toString();
				if (second.length == 1) second = "0" + second;
			}
			
			// Display date and time document was last updated.
			document.write(month + " "  + ndate + ", " + year+ "  ");
			if (time) {	document.write(hour + ":" + minute + ":" + second);	}	
		}
	}
	
// Timestamp 

	function display_todays_date() {
		var today = new Date();
		var num_day=today.getDay();
		var num_month=today.getMonth();
		var date=today.getDate();
		var year=today.getFullYear();
	
		dayName = new Array ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
		monName = new Array ("January","February","March","April","May","June","July","August","September","October","November","December");
	
		document.write('<strong>' + dayName[num_day] +', '+ monName[num_month] +' '+ date +', '+ year + '</strong>');
	}

/*------------------------------------------------------------
	Document Text Sizer- Copyright 2003 - Taewook Kang.  All rights reserved.
	Coded by: Taewook Kang (txkang.REMOVETHIS@hotmail.com)
	Web Site: http://txkang.com
	Script featured on Dynamic Drive (http://www.dynamicdrive.com)
	
	Please retain this copyright notice in the script.
	License is granted to user to reuse this code on 
	their own website if, and only if, 
	this entire copyright notice is included.
--------------------------------------------------------------*/

	//Specify affected tags. Add or remove from list:
	var tgs = new Array('td','tr','select','input','span','p','dt','dd','li','div','a');
	
	//Specify spectrum of different font sizes:
	var szs = new Array('13px','15px','17px');
	var fcnt = -1;
	var maxfont = szs.length - 1;
	
	function ifont() { //v3.0
		if(fcnt < maxfont) {
			fcnt = fcnt + 1;
		}else if(fcnt == maxfont) {
			location.reload();
		}else {
			fcnt = maxfont;
		}
		ts('body');
	}
	
	function ts( trgt ) {
		if (!document.getElementById) return
		var d = document,cEl = null,i,j,cTags;
			
		if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];
		cEl.style.fontSize = szs[ fcnt ];
	
		for ( i = 0 ; i < tgs.length ; i++ ) {
			cTags = cEl.getElementsByTagName( tgs[ i ] );
			for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ fcnt ];
		}
	}
	
	function changeFont(NewFont) {
		if (!document.getElementById) return
		var tags = new Array('td','tr','select','input','span','p','dt','dd','li','div','a');
		var cEl = null;
		var i,j,changedTags;
			
		if (!( cEl = document.getElementById('center_panel'))) 
			 cEl = document.getElementsByTagName('center_panel')[0]; 
		
		cEl.style.fontSize = NewFont;
	
		for ( i = 0 ; i < tags.length ; i++ ) {
			changedTags = cEl.getElementsByTagName( tags[ i ] );
			for ( j = 0 ; j < changedTags.length ; j++ ) 
				 changedTags[j].style.fontSize = NewFont; 
		}
	}

// rotating images functions

	function get_random(num)
	{
		var ranNum= Math.floor(Math.random()*num);
		return ranNum;
	}
	
	function hdrimgld() {
		imgNum = get_random(16);
		if (imgNum == 0) {imgNum = imgNum + 1;}
		imgSrc = "/pics/nav/top_bar/top_img_" + imgNum + ".jpg";
		imgAtt = 'width="225" height="85" align="right" alt="Rotating Image"';
		document.write('<img src="' + imgSrc + '" ' + imgAtt + ' />');
	}

