/**
 * SWFObject v1.5.1: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License
 *
 */
if(typeof deconcept=="undefined"){var deconcept={};}if(typeof deconcept.util=="undefined"){deconcept.util={};}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil={};}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params={};this.variables={};this.attributes=[];if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10]||"";},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15]||"";},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=[];var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+(this.getAttribute("style")||"")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+(this.getAttribute("style")||"")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;



/* SEARCH BOX REPLACEMENT */

function selectReplacement(obj) {
  obj.className += ' replaced';
  var ul = document.createElement('ul');
  ul.className = 'selectReplacement';
  var opts = obj.options;
  var selectedOpt = (!obj.selectedIndex) ? 0 : obj.selectedIndex;
  for (var i=0; i<opts.length; i++) {
	var li = document.createElement('li');
	var txt = document.createTextNode(opts[i].text);
	li.appendChild(txt);
	li.selIndex = i;
	li.selectID = obj.id;
	li.onclick = function() {
	  selectMe(this);
	};
	if (i == selectedOpt) {
	  li.className = 'selected';
	  li.onclick = function() {
		this.parentNode.className += ' selectOpen';
		this.onclick = function() {
		  selectMe(this);
		};
	  };
	}
	if (window.attachEvent) {
	  li.onmouseover = function() {
		this.className += ' hover';
	  };
	  li.onmouseout = function() {
		this.className =
		  this.className.replace(new RegExp(" hover\\b"), '');
	  };
	}
	ul.appendChild(li);
  }
  obj.onfocus = function() {
	ul.className += ' selectFocused';
  };
  obj.onblur = function() {
	ul.className = 'selectReplacement';
  };
  obj.onchange = function() {
	var idx = this.selectedIndex;
	selectMe(ul.childNodes[idx]);
  };
  obj.onkeypress = obj.onchange;
  obj.parentNode.insertBefore(ul,obj);
}
function selectMe(obj) {
  var lis = obj.parentNode.getElementsByTagName('li');
  for (var i=0; i<lis.length; i++) {
	if (lis[i] != obj) {
	  lis[i].className='';
	  lis[i].onclick = function() {
		selectMe(this);
	  };
   } else {
	  setVal(obj.selectID, obj.selIndex);
	  obj.className='selected';
	  obj.parentNode.className =
		obj.parentNode.className.replace(new RegExp(" selectOpen\\b"), '');
	  obj.onclick = function() {
		obj.parentNode.className += ' selectOpen';
		this.onclick = function() {
		  selectMe(this);
		};
	  };
	}
  }
}
function setVal(objID,val) {
  var obj = document.getElementById(objID);
  obj.selectedIndex = val;
}
function setForm() {
  var s = document.getElementsByTagName('select');
  //for (var i=0; i<s.length; i++) selectReplacement(s[i]);
  selectReplacement(s[0]);
}

/* SCROLL FUNCTIONS */

var scrollInt;
var scrTime, scrSt, scrDist, scrDur, scrInt;

function scrollPage(){
	scrTime += scrInt;
	if (scrTime < scrDur) {
		window.scrollTo( 0, easeInOut(scrTime,scrSt,scrDist,scrDur) );
	}
	else{
		window.scrollTo( 0, scrSt+scrDist );
		clearInterval(scrollInt);
	}
}

function scrollToAnchor(aname){
	var anchors, i, ele;

	if (aname.length == 0) return;

	// get anchor
	ele = false;
	/*
	ele = document.getElementById(aname);
	if(!ele) ele = document.getElementsByName(aname);
	*/
	ele = document.getElementById(aname);
	if(!ele){ // in case we want to use it for <A NAME=""> anchors
		anchors = document.getElementsByTagName("a");
		for (i=0;i<anchors.length;i++) {
			if (anchors[i].name == aname) {
				ele = anchors[i];
				i = anchors.length; // exit loop
			}
		}
	}
	if(ele){
		// set scroll target
		if (window.scrollY)
			scrSt = window.scrollY;
		else if (document.documentElement.scrollTop)
			scrSt = document.documentElement.scrollTop;
		else
			scrSt = document.body.scrollTop;
	
		scrDist = ele.offsetTop - scrSt - 50;
		scrDur = 500;
		scrTime = 0;
		scrInt = 10;
	
		// set interval
		clearInterval(scrollInt);
		scrollInt = setInterval( scrollPage, scrInt );
		//return false;
	}
}

function scrollToAlphaAnchor(aname){
	var anchors, i, ele;

	if (aname.length == 0) return;
	
	var alphaDiv = document.getElementById("definitionList");
	
	// get anchor
	ele = false;
	anchors = alphaDiv.getElementsByTagName("a");
	
	var firstOffset = anchors[0].offsetTop;
	
	
	for (i=0;i<anchors.length;i++) {
		if (anchors[i].name == aname) {
			ele = anchors[i];
			i = anchors.length; // exit loop
		}
	}
	
	//ele = alphaDiv.getElementsByName(aname);
	if(ele){
		// set scroll target
		if (alphaDiv.scrollY)
			scrSt = alphaDiv.scrollY;
		else
			scrSt = alphaDiv.scrollTop;
		
		if(!scrSt) scrSt = 0;
		
		scrDist = ele.offsetTop - scrSt - firstOffset;
		if ((navigator.userAgent.indexOf("Firefox") > -1)) scrDist -= 20;

		scrDur = 500;
		scrTime = 0;
		scrInt = 10;
		
		// set interval
		clearInterval(scrollInt);
		scrollInt = setInterval( scrollAlphaDiv, scrInt );
		//return false;
	}
}

function scrollAlphaDiv(){
	var alphaDiv = document.getElementById("definitionList");
	scrTime += scrInt;
	if (scrTime < scrDur) {
		//alphaDiv.scrollTo( 0, easeInOut(scrTime,scrSt,scrDist,scrDur) );
		alphaDiv.scrollTop = easeInOut(scrTime,scrSt,scrDist,scrDur);
	}
	else{
		//alphaDiv.scrollTo( 0, scrSt+scrDist );
		alphaDiv.scrollTop = scrSt + scrDist;
		clearInterval(scrollInt);
	}
}

/* EASING */ function easeInOut(t,b,c,d){ return c/2 * (1 - Math.cos(Math.PI*t/d)) + b;}

var lastTarget = null;
//if ((navigator.userAgent.indexOf("Firefox") > -1))
// :target
function onTarget() {
	if(document.getElementById("contentColumn")){
		var sfEls = document.getElementById("contentColumn").getElementsByTagName("div");

		if(sfEls.length>0){

			var aEls = document.getElementById("menuDiv").getElementsByTagName("a");
			var anchorHash = decodeURI(location.hash);
			anchorHash = anchorHash.substring( anchorHash.indexOf("#")+1 );

			var jobsPage = false;
			var jobAnchor = "";

			if(anchorHash.indexOf("|") > 0){
				var temp = new Array();
				temp = anchorHash.split('|');
				anchorHash = temp[0];
				jobAnchor = anchorHash + "|" + temp[1].toUpperCase();
				jobsPage = true;
			}

			var sftarget = "selectedChunk";
			for (var i=0; i<sfEls.length; i++) {
				if (sfEls[i].id) {
					if (anchorHash == sfEls[i].id) {
						sfEls[i].className += " " + sftarget;
						lastTarget=sfEls[i];
					}

					if (jobsPage){
						if (jobAnchor == sfEls[i].id) sfEls[i].className += " selectedJob";
					}

					if(sfEls[i].className.indexOf("headlinedContentChunk") > -1) {
						for (var j=0; j<aEls.length; j++) {
							var fullLink = aEls[j].href;
							var linkHash = "";
							var linkMaster = "";
							if(fullLink.indexOf("#") > -1) {
								fullLink = decodeURI(fullLink).split("#");
								linkHash = fullLink[1];
								linkMaster = fullLink[0].substring( fullLink[0].indexOf("?")+1 );
								linkMaster = linkMaster.substring( linkMaster.indexOf(":")+1 );
								linkMaster = linkMaster.substring( linkMaster.indexOf("=")+1 );
							}

							if ((aEls[j].className.indexOf("jobsHt") < 0) && (aEls[j].className.indexOf("ccHeadTitle") < 0) && (linkHash==sfEls[i].id) && (linkMaster == currentMasterSection)) {
								aEls[j].targetEl = sfEls[i];
								aEls[j].onclick = function() {
									if (lastTarget) lastTarget.className = lastTarget.className.replace(new RegExp(" "+sftarget+"\\b", "g"), "");
									if (this.targetEl){
										this.targetEl.className+=" "+sftarget;
										lastTarget=this.targetEl;
									}
									return true;
								}
							}
						}
					}
				}
			}
			if (jobsPage) scrollToAnchor(jobAnchor);
			else scrollToAnchor(anchorHash);

		}
	}
}
// End :target

var flaVer = deconcept.SWFObjectUtil.getPlayerVersion();
var flashVersion = flaVer["major"];
var flashOK = false;
if(flaVer["major"] >=9 ) flashOK = true;

function showAnswer(thisLink, answer){
	var newNode=document.createTextNode("Correct answer: "+answer);
	thisLink.replaceChild(newNode,thisLink.childNodes[0]);
	thisLink.className = "asvabsqaV";
}

function flashOn(){

	if(document.getElementById("logo")){
		var logoHeader = new SWFObject("swf/header.swf", "logoHeaderFlash", "500", "175", "9", "transparent", "high");
		logoHeader.addParam("align","t");
		logoHeader.addParam("salign", "tl");
		logoHeader.addParam("play", "true");
		logoHeader.addParam("loop", "true");
		logoHeader.addParam("scale", "noorder");
		logoHeader.addParam("wmode", "transparent");
		logoHeader.addParam("menu", "false");
		logoHeader.addParam("allowFullScreen", "false");
		logoHeader.addParam("allowScriptAccess","sameDomain");
		logoHeader.setAttribute("style", "");
		logoHeader.write("logo");
	}
	if(document.getElementById("ants")){
		var antsHeader = new SWFObject("swf/ants.swf", "antsHeaderFlash", "800", "14", "9", "transparent", "high");
		antsHeader.addParam("align","t");
		antsHeader.addParam("salign", "tl");
		antsHeader.addParam("play", "true");
		antsHeader.addParam("loop", "true");
		antsHeader.addParam("scale", "noorder");
		antsHeader.addParam("wmode", "transparent");
		antsHeader.addParam("menu", "false");
		antsHeader.addParam("allowFullScreen", "false");
		antsHeader.addParam("allowScriptAccess","sameDomain");
		antsHeader.setAttribute("style", "");
		antsHeader.write("ants");
	}

}

function contentCollapse(thisElement){
	var selClass = "selectedChunk";
	if(thisElement.className.indexOf(selClass) == -1){
		var centerDiv = document.getElementById("contentColumn").getElementsByTagName("div");
		var eachElement;
		for (eachElement in centerDiv){
			centerDiv[eachElement].className = centerDiv[eachElement].className.replace(new RegExp(" "+selClass+"\\b"), '');
		}
		thisElement.className += " " + selClass;
	}
}

function collapseMenus(currentOpen){
	var selClass = "current";
	createCSS("ul div.subMenuDiv", "display:none;");
	if(document.getElementById(currentOpen)) document.getElementById(currentOpen).className += " " + selClass;
}

function expandCollapse(currentMI){
	var selClass = "current";
	if(currentMI.parentNode.className.indexOf(selClass) == -1){
		var menuCategories = document.getElementById("menuDiv").getElementsByTagName("ul");
		var eachUL;
		for(eachUL=0; eachUL < menuCategories.length; eachUL++){ //for (eachUL in menuCategories)
			if(menuCategories[eachUL].id == currentMI.parentNode.id) {
				if(menuCategories[eachUL].className.indexOf(selClass) == -1) menuCategories[eachUL].className += " " + selClass;
			}
			else {
				if(menuCategories[eachUL].className.indexOf(selClass) > -1) menuCategories[eachUL].className = menuCategories[eachUL].className.replace(new RegExp(" "+selClass+"\\b"), '');
			}
		}
	}
}

function expandCollapseCC(clickedItem){
	var selClass = "selectedChunk";
	if(clickedItem.parentNode.className.indexOf(selClass) < 0){
		var contentDivs = document.getElementById("contentColumn").getElementsByTagName("div");
		var eachDIV;
		for(eachDIV=0; eachDIV < contentDivs.length; eachDIV++){
			if(contentDivs[eachDIV].className.indexOf(selClass) > -1) contentDivs[eachDIV].className = contentDivs[eachDIV].className.replace(new RegExp(" "+selClass+"\\b"), '');
		}
		clickedItem.parentNode.className += " " + selClass;
		lastTarget = clickedItem.parentNode;
	}
	else {
		clickedItem.parentNode.className = clickedItem.parentNode.className.replace(new RegExp(" "+selClass+"\\b"), '');
		lastTarget = null;
		document.location.hash="";
	}
	if(typeof checkHPanchor == 'function') checkHPanchor();
}

function expandCollapseCCjobs(clickedItem){
	var selClass = "selectedJob";
	if(clickedItem.parentNode.className.indexOf(selClass) < 0){
		var contentDivs = clickedItem.parentNode.parentNode.getElementsByTagName("div");
		var eachDIV;
		for(eachDIV=0; eachDIV < contentDivs.length; eachDIV++){
			if(contentDivs[eachDIV].className.indexOf(selClass) > -1) contentDivs[eachDIV].className = contentDivs[eachDIV].className.replace(new RegExp(" "+selClass+"\\b"), '');
		}
		clickedItem.parentNode.className += " " + selClass;
	}
	else clickedItem.parentNode.className = clickedItem.parentNode.className.replace(new RegExp(" "+selClass+"\\b"), '');
}

// 											-= vplayer.js =-

var vlinks=new Array();
var vicons=new Array();
var vtitle=new Array();
var videocnt;
var filesadded="";

var scrolldelay = '';

function flashvPlayer(input) {
	var splashFlash = new SWFObject("swf/player.swf", "player", "400", "300", "9", "transparent", "high");
	splashFlash.addParam("align","middle");
	splashFlash.addParam("salign", "");
	splashFlash.addParam("play", "true");
	splashFlash.addParam("loop", "true");
	splashFlash.addParam("scale", "noscale");
	splashFlash.addParam("wmode", "transparent");
	splashFlash.addParam("bgcolor", "#060606");
	splashFlash.addParam("menu", "false");
	splashFlash.addParam("allowScriptAccess","sameDomain");
	splashFlash.addParam("FlashVars", "file="+input);
	splashFlash.write("videoWind");
}

function flashfPlayer(input,htmltext) {
	var splashFlash = new SWFObject(input, "player", "400", "300", "9", "transparent", "high");
	splashFlash.addParam("align","middle");
	splashFlash.addParam("salign", "");
	splashFlash.addParam("play", "true");
	splashFlash.addParam("loop", "true");
	splashFlash.addParam("scale", "noscale");
	splashFlash.addParam("wmode", "transparent");
	splashFlash.addParam("bgcolor", "transparent");
	splashFlash.addParam("menu", "false");
	splashFlash.addParam("allowScriptAccess","sameDomain");
	splashFlash.write("videoWind");
	document.getElementById("videoWind").innerHTML += htmltext;
}

function flashiPlayer(input,text) {
	var objDiv = document.getElementById("videoWind");
	var temp = '<div id="video_fimg" style="background-image:url('+ input +'); background-position:center center"/><div id="video_text"/>' + text + '</div>';
	objDiv.innerHTML = temp;
}

function vmenuup() {
	var objDiv = document.getElementById("videoMenu");
	objDiv.scrollTop -= 20;
	scrolldelay = setTimeout('vmenuup()',100);
}

function vmenudw() {
	var objDiv = document.getElementById("videoMenu");
	objDiv.scrollTop += 20;
	scrolldelay = setTimeout('vmenudw()',100);
}

function vmenuclr() {
	clearTimeout(scrolldelay);
}

function vmenuwin() {
	document.getElementById("system_player").innerHTML = '';
	document.getElementById("system_player").style.height = "1px";
	document.getElementById("clickToClose").onclick = function() {};
	document.getElementById("clickToClose").style.height = "1px";
	document.getElementById("clickToClose").style.width = "1px";
}

//------------------------------- Write Windows -------------------------------//
function write_vplayer(thefile) {
	loadjscssfile('/_js_loadvplayer.php?id='+thefile + '&x=1');
}

function write_iplayer(thefile) {
	loadjscssfile('/_js_loadvplayer.php?id='+ thefile + '&x=0');
}

function write_fplayer(thefile) {
	loadjscssfile('/_js_loadvplayer.php?id='+thefile + '&x=4');
}

function write_player(isvid) {

	if (!document.getElementById("clickToClose"))  {
		var clickdiv = document.createElement('div');
		clickdiv.setAttribute('id','clickToClose');
		document.body.appendChild(clickdiv);
	}
	else clickdiv = document.getElementById("clickToClose");

	if (!document.getElementById("system_player"))  {
		var newdiv = document.createElement('div');
		newdiv.setAttribute('id','system_player');
		document.body.appendChild(newdiv);
	}
	else newdiv = document.getElementById("system_player");

	clickdiv.onclick = vmenuwin;

	var sp_width, sp_height;

	if (navigator.appName == 'Microsoft Internet Explorer') {
		sp_width = parseInt(document.documentElement.clientWidth);
		sp_height = parseInt(document.documentElement.clientHeight);
	} else if (navigator.appName == 'Opera') {
		// the width and height will include scrollbar space we can't really use.
		// If there is NOT a scrollbar this will be 16 pixels off from the bottom of the window in Opera. I can live with that.
		sp_width = parseInt(window.innerWidth) - 16;
		sp_height = parseInt(window.innerHeight) - 16;
	} else {
		// Other non-IE browsers properly render 100% x 100% div
		sp_width = "100%";
		sp_height = "100%";
	}

	if (navigator.appName != 'Microsoft Internet Explorer') clickdiv.style.position = "fixed";
	else clickdiv.style.minHeight = sp_height;
	clickdiv.style.height = sp_height;
	clickdiv.style.width = sp_width;

	if ((navigator.appName != 'Microsoft Internet Explorer')&&(navigator.appName != 'Opera')) {
		sp_width = clickdiv.scrollWidth;
		sp_height = clickdiv.scrollHeight;
	}

	if (navigator.appName != 'Microsoft Internet Explorer') newdiv.style.position = "fixed";
	/*
	else newdiv.style.minHeight = sp_height;
	newdiv.style.height = sp_height;
	newdiv.style.width = sp_width;
	*/
	newdiv.style.width = "661px";
	// newdiv.style.marginLeft = floor((sp_width-661)/2);
	newdiv.style.left = String(Math.floor((sp_width-661)/2))+'px';

	var temp  = '<div id="videoFrame">';
	temp += '<div id="videoPlayer"><div id="videoWind"></div></div>';
	temp += '<div id="videoMfrm">';
	temp += '<div><a class="varrowbox" id="vid_up" onmouseover="javascript:vmenuup()" onmouseout="javascript:vmenuclr()">&nbsp;</a></div>';
	temp += '<div id="videoMenu">';


	for(var i=0; i < videocnt; i++) {
		var clink = "";
		
		if(isvid == 1) {
			if(vlinks[i].indexOf("loadvplayer")==-1) clink = "javascript:flashiPlayer(\""+vlinks[i]+"\", \"\");";
			else clink = "javascript:flashvPlayer(\""+vlinks[i]+"\")";
		}
		else if(isvid == 4) var clink = "javascript:flashfPlayer(\""+ vlinks[i]+"\",\"" + vtitle[i] +"\")";
		else {
			var clink = "javascript:flashiPlayer(\""+ vlinks[i] + "\",\"" + vtitle[i] +"\")";
		}

		temp += '<div class=\'videoLFrm\'><a class=\'videoLink\' href=\'' + clink + '\'><img src=\''+ vicons[i] +'\' width=\'100\' /></a></div>';
	}

	temp += '</div>';
	temp += '<div><div class="varrowbox" id="vid_dw" onmouseover="javascript:vmenudw()" onmouseout="javascript:vmenuclr()" /></div>';
	temp += '</div>';
	temp += '<div id="vid_x" onclick="javascript:vmenuwin(false)"></div>';
	temp += '</div>';
	
	var vTitle0UnEscaped;
	
	eval("vTitle0UnEscaped = \""+vtitle[0]+"\";");
	
	document.getElementById("system_player").innerHTML = temp;
	if(isvid == 1) flashvPlayer(vlinks[0]);
	else if(isvid == 4) flashfPlayer(vlinks[0], vTitle0UnEscaped);
	else flashiPlayer(vlinks[0], vTitle0UnEscaped);

	if (navigator.appName == 'Microsoft Internet Explorer') scroll(0,0);
}

function write_map() {
	if (!document.getElementById("system_player")) {
		var newdiv = document.createElement('div');
		newdiv.setAttribute('id','system_player');
		document.body.appendChild(newdiv);
	}

	var temp  = '<div id="mapFrame"><div id="mapWind"/></div><div id="map_x" onclick="javascript:vmenuwin(false)" /></div>';
	document.getElementById("system_player").innerHTML = temp;

	var splashFlash = new SWFObject("swf/mini_map.swf", "player", "890", "400", "9", "transparent", "high");
	splashFlash.addParam("align","middle");
	splashFlash.addParam("salign", "");
	splashFlash.addParam("play", "true");
	splashFlash.addParam("loop", "true");
	splashFlash.addParam("scale", "noscale");
	splashFlash.addParam("wmode", "transparent");
	splashFlash.addParam("bgcolor", "#060606");
	splashFlash.addParam("menu", "false");
	splashFlash.addParam("allowScriptAccess","sameDomain");
	splashFlash.write("mapWind");

	if (navigator.appName == 'Microsoft Internet Explorer') scroll(0,0);
}

function write_imgpop(image,size) {
	if(!size) size=800;
	if (!document.getElementById("clickToClose"))  {
		var clickdiv = document.createElement('div');
		clickdiv.setAttribute('id','clickToClose');
		document.body.appendChild(clickdiv);
	}
	else clickdiv = document.getElementById("clickToClose");

	if (!document.getElementById("system_player"))  {
		var newdiv = document.createElement('div');
		newdiv.style.zIndex = 950;
		newdiv.setAttribute('id','system_player');
		document.body.appendChild(newdiv);
	}

	var temp  = '<div id="imgFrame" style="width:'+ size +'px"><div id="imgWind"><img src="'+image+'" /></div><div id="img_x" style="left:'+(size-42)+'px" onclick="javascript:vmenuwin(false)" /></div>';
	document.getElementById("system_player").innerHTML = temp;

	if (navigator.appName == 'Microsoft Internet Explorer') scroll(0,0);
}

//--------------------------- Load Array Files ---------------------------//
function loadjscssfile(filename){
	var fileref=document.createElement('script')
	fileref.setAttribute("type","text/javascript");
	fileref.setAttribute("src", filename);

	if (typeof fileref!="undefined") document.getElementsByTagName("head")[0].appendChild(fileref);
}

function checkloadjscssfile(filename, filetype){
	if (filesadded.indexOf("["+filename+"]")==-1){
		loadjscssfile(filename, filetype)
		filesadded+="["+filename+"]"
	}
	//else alert("file already added!")
}
// 											end of vplayer.js

function newWin(url,name,width,height,left,top,resize,menu,dir,scrolling,locate,stat,tool,depend) {
	if (! url)			url="/";
	if (! name)			name="new_win";
	if (! width)		width=550;
	if (! height)		height=350;
	if (! left)			left=20;
	if (! top)			top=20;
	if (! resize)		resize=1;
	if (! menu)			menu=0;
	if (! dir)			dir=0;
	if (! scrolling)	scrolling=0;
	if (! locate)		locate=0;
	if (! stat)			stat=0;
	if (! tool)			tool=0;
	if (! depend)		depend=1;

	var remote=window.open(url,name,'resizable='+resize+',menubar='+menu+',scrollbars='+scrolling+',location='+locate+',status='+stat+',toolbar='+tool+',dependent='+depend+',width='+width+',height='+height+',left='+left+',screenX='+left+',top='+top+',screenY='+top+',directories='+dir+'');
	remote.focus();
	return false;
}

function highlightAlpha(clickedItem){
	var selClass = "hlAlpha";
	if(clickedItem.className.indexOf(selClass) < 0){
		var elsA = clickedItem.parentNode.getElementsByTagName("a");
		var eachA;
		for(eachA=0; eachA < elsA.length; eachA++){
			if(elsA[eachA].className.indexOf(selClass) > -1) elsA[eachA].className = elsA[eachA].className.replace(new RegExp(" "+selClass+"\\b"), '');
		}
		clickedItem.className += " " + selClass;
	}
}

var ttuChatFolder;
//ttuChatFolder = "http://66.209.90.149/chat";
ttuChatFolder = "http://66.209.95.13/livechat";

function popUpEmail() {
	day = new Date();
	id = day.getTime();
	targetPage = "livehelp.php?page=leavemessage.php&department=1&tab=2";
	eval("page" + id + " = window.open(ttuChatFolder+'/'+targetPage, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=580,height=450');");
}


function popUpChat() {
	day = new Date();
	id = day.getTime();
	targetPage = "livehelp.php?page=livehelp.php&department=1&tab=1";
	eval("page" + id + " = window.open(ttuChatFolder+'/'+targetPage, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=580,height=450');");
}
