var tabs = [
	//first tab Books
	[
		//tab image when unselected
		'images/tab1-bookoff.jpg',
		//tab image when selected
		'images/tab1-bookon.jpg',
		//tab data
		'<div id=tab1><div id=tabs><center><form name=searchForm action=http://voyager.jccc.edu:7008/vwebv/search? method=get><input type=text size=30 value="Enter your QuickSearch here" name=searchArg maxlength=100 onFocus=this.value=""> <select name=searchCode size=1><option selected=selected value=FT*>Keyword</option><option value=TALL>Title</option><option value=NAME+>Author (last, first)</option><option value=SUBJ+>Subject</option></select><input type=hidden name=searchType value=1><input type=submit class=searchbutton value=Go><br><br><a href=http://library.jccc.edu/catalog/>Search the Catalog</a> | <a href=http://voyager.jccc.edu:7008/vwebv/enterCourseReserve.do>Course Reserve Search</a></form></center></div></div>'],
	//second tab Articles
	[
		'images/tab2-articleoff.jpg',
		'images/tab2-articleon.jpg',
		'<div id=tab2><div id=tabs><table width="100%"><tr><td width="33%" valign="top" align="left"><a href="http://library.jccc.edu/dataref/ar-subj.html#gene">General</a><br><a href="http://library.jccc.edu/dataref/ar-subj.html#art">Art</a><br><a href="http://library.jccc.edu/dataref/ar-subj.html#biog">Biography</a><br><a href="http://library.jccc.edu/dataref/ar-subj.html#busi">Business</a><br><a href="http://library.jccc.edu/dataref/ar-subj.html#coun">Country Studies</a><br><a href="http://library.jccc.edu/dataref/ar-subj.html#curr">Current Issues</a></td><td width="33%" valign="top" align="left"><a href="http://library.jccc.edu/dataref/ar-subj.html#educ">Education</a><br><a href="http://library.jccc.edu/dataref/ar-subj.html#heal">Health</a><br><a href="http://library.jccc.edu/dataref/ar-subj.html#hist">History</a><br><a href="http://library.jccc.edu/dataref/ar-subj.html#law">Law</a><br><a href="http://library.jccc.edu/dataref/ar-subj.html#lite">Literature</a><br><a href="http://library.jccc.edu/dataref/ar-subj.html#musi">Music</a></td><td width="33%" valign="top" align="left"><a href="http://library.jccc.edu/dataref/ar-subj.html#news">News Sources</a><br><a href="http://library.jccc.edu/dataref/ar-subj.html#psyc">Psychology</a><br><a href="http://library.jccc.edu/dataref/ar-subj.html#scie">Science</a><br><a href="http://library.jccc.edu/dataref/ar-subj.html#soci">Social Science</a><br><a href="http://library.jccc.edu/dataref/ar-subj.html#tech">Technology</a></td><br></tr></table><br><center><a href=http://library.jccc.edu/dataref/db-alpha.html>Databases A-Z</a> | <a href="http://ezproxy.jccc.edu/login?url=http://ub5he7kv4q.cs.serialssolutions.com">Multi-Database Search</a> | <a href="http://ezproxy.jccc.edu/login?url=http://www.refworks.com/refworks/">RefWorks</a> | <a href=journals.html>JCCC Periodicals</a></center></div></div>'],
	//fourth tab EReference
	[
		'images/tab3-refshelfoff.jpg',
		'images/tab3-refshelfon.jpg',
		'<div id="tab3"><div id="tabs"><table width="100%"><tr><td width="33%" valign="top" align="left"><a href="http://library.jccc.edu/dataref/rs-subj.html#art">Art</a><br><a href="http://library.jccc.edu/dataref/rs-subj.html#auto">Auto, Home & Small Engine Repair</a><br><a href="http://library.jccc.edu/dataref/rs-subj.html#biog">Biography &amp; Genealogy</a><br><a href="http://library.jccc.edu/dataref/rs-subj.html#buil">Building &amp; Fire Codes</a><br><a href="http://library.jccc.edu/dataref/rs-subj.html#busi">Business &amp; Economics</a><br><a href="http://library.jccc.edu/dataref/rs-subj.html#coun">Country Studies</a></td><td width="33%" valign="top" align="left"><a href="http://library.jccc.edu/dataref/rs-subj.html#educ">Education</a><br><a href="http://library.jccc.edu/dataref/rs-subj.html#ency">Encyclopedias</a><br><a href="http://library.jccc.edu/dataref/rs-subj.html#hlth">Health</a><br><a href="http://library.jccc.edu/dataref/rs-subj.html#hist">History</a><br><a href="http://library.jccc.edu/dataref/rs-subj.html#law">Law</a><br><a href="http://library.jccc.edu/dataref/rs-subj.html#libr">Library-Publishing</a><br><a href="http://library.jccc.edu/dataref/rs-subj.html#lite">Literature</a><br><a href="http://library.jccc.edu/dataref/rs-subj.html#cult">Multicultural Sources</a></td><td width="33%" valign="top" align="left"><a href="http://library.jccc.edu/dataref/rs-subj.html#lang">Multilingual Sources</a><br><a href="http://library.jccc.edu/dataref/rs-subj.html#musi">Music</a><br><a href="http://library.jccc.edu/dataref/rs-subj.html#onli">Online Books</a><br><a href="http://library.jccc.edu/dataref/rs-subj.html#reli">Religion</a><br><a href="http://library.jccc.edu/dataref/rs-subj.html#scie">Science</a><br><a href="http://library.jccc.edu/dataref/rs-subj.html#soci">Social Science</a><br><a href="http://library.jccc.edu/dataref/rs-subj.html#tech">Technology</a><br><a href="http://library.jccc.edu/dataref/rs-subj.html#vdeo">Video Resources</a><br></tr></table><br><center><a href="dataref/db-alpha.html">Databases A-Z</a> | <a href="dataref/rs-index.html">E-Reference Index</a> | <a href="http://ezproxy.jccc.edu/login?url=http://www.refworks.com/refworks/">RefWorks</a></div></div>'],
	//fourth tab Videos
	[
		'images/tab4-videooff.jpg',
		'images/tab4-videoon.jpg',
		'<div id="tab4"><div id="tabs"><center><form name="searchForm" action="http://voyager.jccc.edu:7008/vwebv/search?" method="get"><input type="text" size="40" name="searchArg" maxlength="100" value="Enter your QuickSearch here" onFocus=this.value=""> <input type="hidden" name="limitTo" value="LOCA=AudioVisual"><select name="searchCode" size="1"><option value="FT*">Keyword</option><option value="TALL">Title</option></select><input type="hidden" name="recCount" value="25"><input type="hidden" name="searchType" value="1"> <input type="submit" value="Go"><br><br></a></form></center></div></div>']];
	//you can have more tabs if you want

//if you have empty space between your tabs, adjust this to a lower number
var width = 10;

function preloadImages() {
	for (var y = 0; y < 2; y++) {
		for (var x = 0; x < tabs.length; x++) {
			image = new Image();
			image.src = tabs[x][y];
		}
	}
}

function drawTabs() {
	document.write("<table cellspacing=0 cellpadding=0 border=0><tr>");
	for (var x = 0; x < tabs.length; x++) {
		document.write("<td width="+width+"><a href='javascript:switchTab("+x+")'><img name='tab"+x+"' border=0 src="+tabs[x][0]+"></a></td>");
	}
	document.write("</td><td></td></tr><tr><td id=currentTab colspan="+(tabs.length+1)+">");
	document.write(tabs[0][2]);
	document.write("</td></tr></table>");
	document.images["tab0"].src = tabs[0][1];
}

function switchTab(tab) {
	for (var x = 0; x < tabs.length; x++) {
		if (x != tab)
			document.images["tab"+x].src = tabs[x][0];
	}
	document.images["tab"+tab].src = tabs[tab][1];
	document.getElementById("currentTab").innerHTML = tabs[tab][2];
}

preloadImages();

