//LIST OF RESOURCES ARRAY
var resourceTitle = new Array(); //THE RESOURCE TITLE
var resource = new Array();	 //THE RESOURCE LINK

function pageData() {
	//THIS FUNCTION FILLS IN DATA THAT WILL SPAN THE ENTIRE SITE... IE. COPYRIGHT.
	
	//THE COPYRIGHT INFORMATION...
	var x = document.getElementById("copyrightSpan");
	if (x != null) { x.innerHTML = "&copy; Copyright 2010 <b>edCetraTraining</b><br>All rights reserved."; }
}



//THE RESOURCE LAUNCHER FUNCTION................
function launchResource1(form) {
	
	//Get the form info...
	currentForm = document.getElementById(form.id);
	//Get the position of the selected item...
	currentResource = (currentForm.elements[0].value) - 1;
	
	//If nothing was changed / selected in the form, take the first one on the list...
	if(currentResource == "") { currentResource = 0; }

	//DEBUG//
	//alert("currentResource : " + currentResource );
	//alert("resourceTitle: " + resourceTitle[currentResource] + " and the resource is: " + resource[currentResource]);
	//alert("resource: " + resource);
	//DEBUG//

	//Launch the resource in a new window...
	//window.open(resource[currentResource],resourceTitle[currentResource],'scrollbars=0,height=100%,width=100%,menubar=0,toolbars=0');
	//window.open("" + resource[currentResource] + "");
	
	//For some reason I can't switch pages within the site!!! Requires Investigation!!!
	//Gina, it because you're using a form element and the event is occuring wihtin it.  You can't use the location setting element there. :)
	//Among other things.
	if (resource[currentResource].substring(0,5) == "name=") {
		var x = location.href.split("?");
		form.action = x[0] + "?" + resource[currentResource];
		form.submit();
	} else {
		window.open(resource[currentResource],"_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes")
	}
	
}

function randomNumberGenerator(clientCount) {

	var ranNum= getRandomNum(1, clientCount);
	document.getElementById("quote_"+ranNum).style.display="block";
	
}

function getRandomNum(nvFrom, nvTo) {
	// generates a random number between 2 numbers (including those numbers).
	// ex. From 1 to 5 could be (1,2,3,4 or 5). Equal probablilty of each.
	var ranNum= Math.floor(Math.random()*((nvTo+1)-nvFrom))+nvFrom;
	return ranNum;
	
}

function writeFlash(pFile, pID, pWidth, pHeight, pVars) {
	var x = "";
	x += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="'+pID+'" width="'+pWidth+'" height="'+pHeight+'">';
	x += '<param name="movie" value="'+pFile+'"/>';
	x += '<param name="quality" value="high"/>';
	x += '<param name="wmode" value="transparent"/>';
	x += '<param name="menu" value="false"/>';
	x += '<param name="flashvars" value="&amp;'+pVars+'"/>';
	x += '<embed src="'+pFile+'" flashvars="&amp;'+pVars+'" width="'+pWidth+'" height="'+pHeight+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" menu="false" name="'+pID+'"/>';
	x += '</object>';
	document.writeln(x);
}

function openPopup(pURL,pW,pH,pType) {
	var x=screen.availWidth, y=screen.availHeight;
	x = (x-pW)/2; y = (y-pH)/2;
	
	myWin = window.open('../widgetList/assets/launchwindow.asp?assetInfo='+pURL+'|'+pType+'|'+pW+'|'+pH+'','widget','height='+pH+',width='+pW+',top='+y+',left='+x+',status=no,toolbar=no,menubar=no,location=no');
	myWin.focus();
}

var currentOpenEvent;

function showEvent(nvNum) {
	if (typeof(currentOpenEvent)!="undefined") { killEvent(currentOpenEvent) }
	seeEvent(nvNum);
	currentOpenEvent = nvNum;
}

function killEvent(nvNum) {
	var y = document.getElementById('teaser_'+nvNum);
	var x = document.getElementById('event_'+nvNum);
	if (y!=null) { y.style.display = 'block' }
	if (x!=null) { x.style.display = 'none' }
}

function seeEvent(nvNum) {
	var y = document.getElementById('teaser_'+nvNum);
	var x = document.getElementById('event_'+nvNum);
	if (y!=null) { y.style.display = 'none' }
	if (x!=null) { x.style.display = 'block' }
}




