
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover"; 
			} // end sfEls function	
		sfEls[i].onmouseout=function() { 
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			} // end sfEls function
	} // end for loop
} 

if (window.attachEvent) window.attachEvent("onload", sfHover);

sfHover2 = function() { 
	var sfEls = document.getElementById("sidebar").getElementsByTagName("LI"); 
	for (var i=0; i<sfEls.length; i++) { 
		sfEls[i].onmouseover=function() 
		{ 
			this.className+=" sfhover2";
		} // end sfEls
		sfEls[i].onmouseout=function() 
		{ 
			this.className=this.className.replace(new RegExp(" sfhover2\\b"), "");
		} // end sfEls
	} // end for loop
}// end sfhover2
if (window.attachEvent) window.attachEvent("onload", sfHover2);

function showlayer(layer){
var myLayer = document.getElementById(layer).style.display;
if(myLayer=="none"){
document.getElementById(layer).style.display="block";
} else {
document.getElementById(layer).style.display="none";
}
}

var urlArray = new Array();
var imgArray = new Array();
var altArray = new Array();
urlArray[1] = 'http://libdata.macalester.edu/azlink.php?resource_id=1265';  
imgArray[1] = 'http://www.macalester.edu/library/images/highlights/eresources80/gvrl.jpg';
altArray[1] = 'Gale Virtual Reference Library';
urlArray[2] = 'http://libdata.macalester.edu/azlink.php?resource_id=1306'; 
imgArray[2] = 'http://www.macalester.edu/library/images/highlights/eresources80/economist_lg.jpg'; 
altArray[2] = 'The Economist Historical Archive';
urlArray[3] = 'http://libdata.macalester.edu/azlink.php?resource_id=1281'; 
imgArray[3] = 'http://www.macalester.edu/library/images/highlights/eresources80/expaca.jpg'; 
altArray[3] = 'Expanded Academic ASAP';
urlArray[4] = 'http://libdata.macalester.edu/azlink.php?resource_id=1291';  
imgArray[4] = 'http://www.macalester.edu/library/images/highlights/eresources80/ecco.jpg';
altArray[4] = 'Eighteenth Century Collections Online';
urlArray[5] = 'http://libdata.macalester.edu/azlink.php?resource_id=1016'; 
imgArray[5] = 'http://www.macalester.edu/library/images/highlights/eresources80/bltc.jpg';
altArray[5] = 'Black Thought and Culture';
urlArray[6] = 'http://libdata.macalester.edu/azlink.php?resource_id=210'; 
imgArray[6] = 'http://www.macalester.edu/library/images/highlights/eresources80/informe.jpg'; 
altArray[6] = 'Informe!';
urlArray[7] = 'http://libdata.macalester.edu/azlink.php?resource_id=1204';  
imgArray[7] = 'http://www.macalester.edu/library/images/highlights/eresources80/litcrit.jpg'; 
altArray[7] = 'Literature Criticism Online';
urlArray[8] = 'http://libdata.macalester.edu/azlink.php?resource_id=352';  
imgArray[8] = 'http://www.macalester.edu/library/images/highlights/eresources80/profcoll.jpg';
altArray[8] = 'Professional Collection';
 urlArray[9] = 'http://libdata.macalester.edu/azlink.php?resource_id=1018'; 
imgArray[9] = 'http://www.macalester.edu/library/images/highlights/eresources80/shakespeare.jpg'; 
altArray[9] = 'The Shakespeare Collection';
urlArray[10] = 'http://libdata.macalester.edu/azlink.php?resource_id=1290'; 
imgArray[10] = 'http://www.macalester.edu/library/images/highlights/eresources80/sata.jpg'; 
altArray[10] = 'Something About the Author';
urlArray[11] = 'http://libdata.macalester.edu/azlink.php?resource_id=1292'; 
imgArray[11] = 'http://www.macalester.edu/library/images/highlights/eresources80/times.jpg'; 
altArray[11] = 'The Times Digital Archive';
urlArray[12] = 'http://libdata.macalester.edu/azlink.php?resource_id=1376'; 
imgArray[12] = 'http://www.macalester.edu/library/images/highlights/eresources80/ahiv.jpg';
altArray[12] = 'American History in Video'; 


// imgArray[12] = 'http://www.macalester.edu/library/images/highlights/eresources80/empty.jpg';


function loadHighlightsImages() {
	
var imagenumber = 4 ;
var randomnumber = Math.random() ;
var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1 ;

i = rand1;		
second = i * 3 -1; third = i * 3; first = second - 1; 
document.getElementById('image13').src = imgArray[third];
document.getElementById('imgurl13').href = urlArray[third];
document.getElementById('image12').src = imgArray[second];
document.getElementById('imgurl12').href = urlArray[second];
document.getElementById('image11').src = imgArray[first];
document.getElementById('imgurl11').href = urlArray[first];
document.image11.alt = altArray[first];
document.image12.alt = altArray[second];
document.image13.alt = altArray[third];
	
var code2 = '<div align="center"><img style="margin-left: 5px; margin-right: 5px;" id="5" src="/library/images/highlights/dots_blue.jpg" onclick="img_set2(\'5\')" border="0"/><img style="margin-left: 5px; margin-right: 5px;" id="6" src="/library/images/highlights/dots_grey.jpg" onclick="img_set2(\'6\')" border="0"/><img style="margin-left: 5px; margin-right: 5px;" id="7" src="/library/images/highlights/dots_grey.jpg" onclick="img_set2(\'7\')" border="0"/><img style="margin-left: 5px; margin-right: 5px;" id="8" src="/library/images/highlights/dots_grey.jpg" onclick="img_set2(\'8\')" border="0"/></div>';
document.getElementById('buttons_set2').innerHTML = code2;
var code1 = ' <div align="center"><img style="margin-left: 5px; margin-right: 5px;" id="1" src="" onclick="img_set(\'1\')" border="0"/><img style="margin-left: 5px; margin-right: 5px;" id="2" src="" onclick="img_set(\'2\')" border="0"/><img style="margin-left: 5px; margin-right: 5px;" id="3" src="" onclick="img_set(\'3\')" border="0"/><img style="margin-left: 5px; margin-right: 5px;" id="4" src="" onclick="img_set(\'4\')" border="0"/></div>';
document.getElementById('buttons_set1').innerHTML = code1;

for (n=1;n<=4;n=n+1)
{
	if (n==rand1) {
		document.getElementById(n).src = "/library/images/highlights/dots_blue.jpg";
	} else {
		document.getElementById(n).src = "/library/images/highlights/dots_grey.jpg";	
	}
}

var code3 = '<a href="#" onclick="javascript:showlayer(\'chatLayer\')"><img src="/library/images/openchat.png" border="0" id="openbutton" alt="Chat with a library staff member"/></a>';document.getElementById('chatbubble').innerHTML = code3;}

var urlArray = new Array();
var imgArray = new Array();
var altArray = new Array();
urlArray[1] = 'http://libdata.macalester.edu/azlink.php?resource_id=1265';  
imgArray[1] = 'http://www.macalester.edu/library/images/highlights/eresources80/gvrl.jpg';
altArray[1] = 'Gale Virtual Reference Library';
urlArray[2] = 'http://libdata.macalester.edu/azlink.php?resource_id=1306'; 
imgArray[2] = 'http://www.macalester.edu/library/images/highlights/eresources80/economist_lg.jpg'; 
altArray[2] = 'The Economist Historical Archive';
urlArray[3] = 'http://libdata.macalester.edu/azlink.php?resource_id=1281'; 
imgArray[3] = 'http://www.macalester.edu/library/images/highlights/eresources80/expaca.jpg'; 
altArray[3] = 'Expanded Academic ASAP';
urlArray[4] = 'http://libdata.macalester.edu/azlink.php?resource_id=1291';  
imgArray[4] = 'http://www.macalester.edu/library/images/highlights/eresources80/ecco.jpg';
altArray[4] = 'Eighteenth Century Collections Online';
urlArray[5] = 'http://libdata.macalester.edu/azlink.php?resource_id=1016'; 
imgArray[5] = 'http://www.macalester.edu/library/images/highlights/eresources80/bltc.jpg';
altArray[5] = 'Black Thought and Culture';
urlArray[6] = 'http://libdata.macalester.edu/azlink.php?resource_id=210'; 
imgArray[6] = 'http://www.macalester.edu/library/images/highlights/eresources80/informe.jpg'; 
altArray[6] = 'Informe!';
urlArray[7] = 'http://libdata.macalester.edu/azlink.php?resource_id=1204';  
imgArray[7] = 'http://www.macalester.edu/library/images/highlights/eresources80/litcrit.jpg'; 
altArray[7] = 'Literature Criticism Online';
urlArray[8] = 'http://libdata.macalester.edu/azlink.php?resource_id=352';  
imgArray[8] = 'http://www.macalester.edu/library/images/highlights/eresources80/profcoll.jpg';
altArray[8] = 'Professional Collection';
 urlArray[9] = 'http://libdata.macalester.edu/azlink.php?resource_id=1018'; 
imgArray[9] = 'http://www.macalester.edu/library/images/highlights/eresources80/shakespeare.jpg'; 
altArray[9] = 'The Shakespeare Collection';
urlArray[10] = 'http://libdata.macalester.edu/azlink.php?resource_id=1290'; 
imgArray[10] = 'http://www.macalester.edu/library/images/highlights/eresources80/sata.jpg'; 
altArray[10] = 'Something About the Author';
urlArray[11] = 'http://libdata.macalester.edu/azlink.php?resource_id=1292'; 
imgArray[11] = 'http://www.macalester.edu/library/images/highlights/eresources80/times.jpg'; 
altArray[11] = 'The Times Digital Archive';
urlArray[12] = 'http://libdata.macalester.edu/azlink.php?resource_id=1376'; 
imgArray[12] = 'http://www.macalester.edu/library/images/highlights/eresources80/ahiv.jpg';
altArray[12] = 'American History in Video'; 

function img_set(set) { // Image swap function for Resource Highlights
		var i = set;
		for (i=1;i<=4;i++) {
			if (i == set) { document.getElementById(i).src = '/library/images/highlights/dots_blue.jpg'; } 
			else { document.getElementById(i).src = '/library/images/highlights/dots_grey.jpg'; }
		}
		i = set;		
		second = i * 3 -1; third = i * 3; first = second - 1; 
		document.getElementById('image13').src = imgArray[third];
		document.getElementById('imgurl13').href = urlArray[third];
		document.getElementById('image12').src = imgArray[second];
		document.getElementById('imgurl12').href = urlArray[second];
		document.getElementById('image11').src = imgArray[first];
		document.getElementById('imgurl11').href = urlArray[first];
		document.image11.alt = altArray[first];
		document.image12.alt = altArray[second];
		document.image13.alt = altArray[third];
} // end function

var urlArray2 = new Array();
var imgArray2 = new Array();
var altArray2 = new Array();
urlArray2[1] = 'http://libdata.macalester.edu/azlink.php?resource_id=1014'; 
imgArray2[1] = 'http://www.macalester.edu/library/images/highlights/eresources80/bldr.jpg';
altArray2[1] = 'Black Drama'; 
urlArray2[2] = 'http://libdata.macalester.edu/azlink.php?resource_id=1383'; 
imgArray2[2] = 'http://www.macalester.edu/library/images/highlights/eresources80/daiv.jpg';
altArray2[2] = 'Dance in Video'; 
urlArray2[3] = 'http://libdata.macalester.edu/azlink.php?resource_id=793'; 
imgArray2[3] = 'http://www.macalester.edu/library/images/highlights/eresources80/glnd.jpg'; 
altArray2[3] = 'The Garland Encyclopedia of World Music Online'; 
urlArray2[4] = 'http://libdata.macalester.edu/azlink.php?resource_id=1385'; 
imgArray2[4] = 'http://www.macalester.edu/library/images/highlights/eresources80/clmr.jpg'; 
altArray2[4] = 'Classical Music Reference Library'; 
urlArray2[5] = 'http://libdata.macalester.edu/azlink.php?resource_id=1388'; 
imgArray2[5] = 'http://www.macalester.edu/library/images/highlights/eresources80/cwm.jpg';
altArray2[5] = 'Contemporary World Music';  
urlArray2[6] = 'http://libdata.macalester.edu/azlink.php?resource_id=1386'; 
imgArray2[6] = 'http://www.macalester.edu/library/images/highlights/eresources80/clsc.jpg'; 
altArray2[6] = 'Classical Scores Library'; 
urlArray2[7] = 'http://libdata.macalester.edu/azlink.php?resource_id=1382'; 
imgArray2[7] = 'http://www.macalester.edu/library/images/highlights/eresources80/opiv.jpg';
altArray2[7] = 'Opera in Video'; 
urlArray2[8] = 'http://libdata.macalester.edu/azlink.php?resource_id=1389'; 
imgArray2[8] = 'http://www.macalester.edu/library/images/highlights/eresources80/jazz.jpg'; 
altArray2[8] = 'Jazz Music Library'; 
urlArray2[9] = 'http://libdata.macalester.edu/azlink.php?resource_id=1381'; 
imgArray2[9] = 'http://www.macalester.edu/library/images/highlights/eresources80/muso.jpg'; 
altArray2[9] = 'Music Online'; 
urlArray2[10] = 'http://libdata.macalester.edu/azlink.php?resource_id=1384'; 
imgArray2[10] = 'http://www.macalester.edu/library/images/highlights/eresources80/aamr.jpg';
altArray2[10] = 'African-American Music Reference'; 
urlArray2[11] = 'http://libdata.macalester.edu/azlink.php?resource_id=1387'; 
imgArray2[11] = 'http://www.macalester.edu/library/images/highlights/eresources80/amso.jpg'; 
altArray2[11] = 'American Song'; 
urlArray2[12] = 'http://libdata.macalester.edu/azlink.php?resource_id=1198'; 
imgArray2[12] = 'http://www.macalester.edu/library/images/highlights/eresources80/clmu.jpg'; 
altArray2[12] = 'Classical Music Library';




function img_set2(set2){ // count down, left...
		for (i=5;i<=8;i++) {
			if (i == set2) { // 1, 2, 3
				document.getElementById(i).src = '/library/images/highlights/dots_blue.jpg'; 
			} else {
				document.getElementById(i).src = '/library/images/highlights/dots_grey.jpg'; 
			}
		}
		if (set2 == 5) { set2 = 1; }
		if (set2 == 6) { set2 = 2; }
		if (set2 == 7) { set2 = 3; }
		if (set2 == 8) { set2 = 4; }
		i = set2;
		second = i * 3 -1; // 1-2 2-5 3-8 4-11
		third = i * 3;
		first = second - 1; 
		document.getElementById('image4').src = imgArray2[first];
		document.getElementById('url4').href = urlArray2[first];
		document.getElementById('image5').src = imgArray2[second];
		document.getElementById('url5').href = urlArray2[second];
		document.getElementById('image6').src = imgArray2[third];
		document.getElementById('url6').href = urlArray2[third];
		document.image4.alt = altArray2[first];
		document.image5.alt = altArray2[second];
		document.image6.alt = altArray2[third];
	
	
	} // end function