//
//==== JAVASCRIPT FOR HSS WEBSITE =====
//


//loads on page load
function init() {
	//add mouse events to top level toolbar
	var Box = document.getElementById("Header_College_Toolbar");
	for(var i=0; i<Box.firstChild.childNodes.length; i++) {
		Box.firstChild.childNodes[i].firstChild.firstChild.onmouseover = function(e) {this.src='/pics/_template/'+this.id+'-o.png';}
		Box.firstChild.childNodes[i].firstChild.firstChild.onmouseout = function(e) {(this.id == "toolbar_"+Content)?this.src='/pics/_template/'+this.id+'-a.png':this.src='/pics/_template/'+this.id+'-i.png'};
	}
	
	//create splash content
	if(Content=="home") {
		var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
		if(hasRightVersion) {BuildFlashObject('splash','/pics/home/splash_'+SplashImageGenerator()+'.swf','878','284');} else {document.getElementById("Content_SplashBox").innerHTML = '<img src="/pics/home/splash_building.jpg" width="878" height="284" alt="A world of Opportunity awaits..." />'}
	//	if(hasRightVersion) {BuildFlashObject('splash','/pics/home/splash_beggs3.swf','878','300');} else {document.getElementById("Content_SplashBox").innerHTML = '<img src="/pics/home/splash_building.jpg" width="878" height="284" alt="A world of Opportunity awaits..." />'}
	}
}

//generates random words on login
function SplashImageGenerator() {
	splashName = new Array(
										 "new-phd3",
										 "high-expectations",
										 "on-the-move",
										 "high-expectations",
										 "on-the-move",
										 "new-phd3"
										 );
	
	return splashName[Math.floor(Math.random() * splashName.length)];	
}

//builds flash object on page
function BuildFlashObject(who,what,width,height) {
	//build flash object
	document.getElementById("Content_SplashBox").innerHTML = ''+
		'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" id="'+who+'" align="middle">' +
		'<param name="allowScriptAccess" value="sameDomain" />'+
		'<param name="movie" value="'+what+'" />'+
		'<param name="loop" value="false" />'+
		'<param name="menu" value="false" />'+
		'<param name="quality" value="high" />'+
		'<param name="wmode" value="transparent" />'+
		'<embed src="'+what+'" loop="false" menu="false" quality="high" wmode="transparent" width="'+width+'" height="'+height+'" name="'+who+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+
		'</object>';
}

onload=init;