// JavaScript to interpolate random images into a page. 


var ic = 20;



var x=0;
var title = new Array(ic); 
var hp_img = new Array(ic); 
var hp_alt = new Array(ic);
var hp_text = new Array(ic);
var menu_img = new Array(ic);
var menu_alt = new Array(ic);
var teaser = new Array(ic); 
var url2 = new Array(ic); 

title[x]='The Mercersburg Classroom';
url2[x]='http://www.mercersburg.edu/spiff/spiff12020616.asp';
hp_img[x]='homepage_why2.gif';
hp_alt[x]='An image of a few Mercersburg students posing in the sun.';
hp_text[x]='Brilliant teachers, invaluable friendships, an unmatched education—and that’s just the beginning.';
menu_img[x]='spiff_why2.jpg';
menu_alt[x]='An image of a few Mercersburg students posing in the sun.';
teaser[x]='Brilliant teachers, invaluable friendships, an unmatched education—and that’s just the beginning.';
x++;title[x]='The Mercersburg Classroom';
url2[x]='http://www.mercersburg.edu/spiff/spiff12020615.asp';
hp_img[x]='Table_HomepageSpiff.gif';
hp_alt[x]='An image of a teacher sitting at the Harkness table with students.';
hp_text[x]='This is the place where everyone gets a chance to speak and be heard.';
menu_img[x]='spiff_table.jpg';
menu_alt[x]='An image of a teacher sitting at the Harkness table with students.';
teaser[x]='This is the place where everyone gets a chance to speak and be heard.';
x++;title[x]='The Mercersburg Classroom';
url2[x]='http://www.mercersburg.edu/spiff/spiff12020604.asp';
hp_img[x]='homepage_robotics_class.gif';
hp_alt[x]='An image of a Mercersburg student in robotics class.';
hp_text[x]='Mercersburg students go nuts (and bolts) over the new robotics class.';
menu_img[x]='spiff_robotics_class.jpg';
menu_alt[x]='An image of a Mercersburg student in robotics class.';
teaser[x]='Mercersburg students go nuts (and bolts) over the new robotics class.';
x++;title[x]='The Mercersburg Classroom';
url2[x]='http://www.mercersburg.edu/spiff/spiff12020603.asp';
hp_img[x]='homepage_chem_horton2.gif';
hp_alt[x]='An image of Chip Horton and a Mercersburg student.';
hp_text[x]='At Mercersburg, we’re preparing students for college, one elective at a time.';
menu_img[x]='spiff_chem_horton2.jpg';
menu_alt[x]='An image of Chip Horton and a Mercersburg student.';
teaser[x]='At Mercersburg, we’re preparing students for college, one elective at a time.';
x++;title[x]='The Mercersburg Classroom';
url2[x]='http://www.mercersburg.edu/spiff/spiff12020602.asp';
hp_img[x]='homepage_kosak_chinese_Clas.gif';
hp_alt[x]='An image of Fred Kosak teaching Chinese class.';
hp_text[x]='Students take on the challenge of learning one of the world’s most complex languages.';
menu_img[x]='spiff_kosak_chinese_Class.jpg';
menu_alt[x]='An image of Fred Kosak teaching Chinese class.';
teaser[x]='Students take on the challenge of learning one of the world’s most complex languages.';
x++;


function pickRandom(range) 
{ 
	if (Math.random) return Math.round(Math.random() * (range-1)); 
	else { var now = new Date(); 
	return (now.getTime() / 1000) % range; } } 
// Write out an IMG tag, using a randomly-chosen image name. 

var choice = pickRandom(x); 



<!-- MENU TEASER FUNCTIONS -->

function menu(){
document.write('<a href="'+url2[choice]+'"><img alt="'+menu_alt[choice]+'" class="intruder" src="/files/spiff_menu/'+menu_img[choice]+'" /></a>');
document.write('<div class="intruderHeader">'+title[choice]+'</div>');
document.write('<div class="intruderCaption">'+teaser[choice]+'</div>');
}

<!-- HOMEPAGE TEASER FUNCTIONS -->


function primary(){
document.write('<table><tr><td>');
document.write('<a href="'+url2[choice]+'"><img class="intruderHomePrimary" src="/files/homepage_spiff_image/'+hp_img[choice]+'"  alt="'+hp_alt[choice]+'"></a>');
document.write('<tr><td><div class="intruderHomePrimaryBottom"><span class="spifftitle">'+title[choice]+'</span>');
document.write('<br>'+hp_text[choice]+'<div></td></tr></table>');
}

function secondary(){
document.write('<table><tr><td>');
document.write('<a href="'+url2[choice]+'"><img class="intruderHomeSecondary" src="/files/homepage_spiff_image/'+hp_img[choice]+'"  alt="'+hp_alt[choice]+'"></a>');
document.write('<tr><td><div class="intruderHomeSecondaryBottom"><span class="spifftitle">'+title[choice]+'</span>');
document.write('<br>'+hp_text[choice]+'<div></td></tr></table>');
}

