//Author: Bryan Black
//Created: June 6, 2008 
//Notes: The initialize function accepts one argument that is attended to be the name & id of the flash player. This will dictate if we are in windows using the id of the object or in a good browser
//using the name of the embed tag 

//This function will just get the flash object so we can invokes its function 
function initializeVideo(videoID) {
        /* Check whether the browser is IE. If so, flashVideoPlayer is
window.videoPlayer. Otherwise, it's document.videoPlayer. The
videoPlayer is the ID assigned to the <object> and <embed> tags. */
        var isIE = navigator.appName.indexOf("Microsoft") != -1;
        flashVideoPlayer = (isIE) ? window[videoID] : document[videoID];
    }


function setLinks(){
	if(httpObj.readyState == 4){
		var links = document.getElementById('links'); 
		links.innerHTML = httpObj.responseText; 
	//	new Effect.Highlight('links', {startcolor: '#ffff99', endcolor:'#A8D5EA'}); 
	}
}

function org_links(){
	var orginalLinks = document.getElementById('links'); 

	orginalLinks.innerHTML = '<span><a href="http://www.etsu.edu/militaryscience/rotc/" target="_blank">Military Science</a> | <a href="http://business.etsu.edu/acct/" target="_blank">Accountancy</a><br/> <a href="http://www.cs.etsu.edu/" target="_blank">Computer and Information Sciences</a><br/> <a href="http://www.etsu.edu/cbat/efus/index.jsp" target="_blank">Economics and  Finance</a> | <a href="http://www.etsu.edu/cbat/efus/urbanstudies.jsp" target="_blank">Urban Studies</a><br/> <a href="http://www.etsu.edu/cbat/facs/" target="_blank">Family and Consumer Sciences</a><br/> <a href="http://business.etsu.edu/mgmtmkt/" target="_blank">Management and Marketing</a><br/> <a href="http://www.etsu.edu/scitech/entc/index.htm" target="_blank">Technology and Geomatics</a></span>';
}

//This will invoke the ActionScript function and send it the path name of the video 
//This function is updated to take two parameters the second is used to get the relative link information for the current video that is playing 
	function loadFLV(url,_linkName){
		var linkName = _linkName;
		httpObj = getHttpObject(); 
		if(httpObj != null && linkName != null){
			httpObj.open("GET","loadLink.php?link="+linkName,true); 
			httpObj.send(null); 
			httpObj.onreadystatechange = setLinks; 
		}
		return flashVideoPlayer.vplay(url); 
		
	}
	


var httpObj = null; 

//This function will load either the splash_main or one of the others. It has a 60% chance to load the splash_main flv and a 40% chance to load one of the other ones 

function loadSplash() {
	flashPlayer = document.getElementById('VPlayer');
	Vplayer = document.VPlayer; 
	
	if(flashPlayer != null || Vplayer != null){
		//Load the splash videos 
		loadFLV('videos/logo.flv');
		clearInterval(lashInterval); 
	}
}



	