var homePageContentURL="/utils/externalrequest?";
var actionId="actionId";
var actionIdConst="actionId=mhmprivatehome";
//var homePageAction="homePageAction";
var containerNamesParameter="containerNames";
var paramsParameter="params";
var clickIDParam="ClickID";
var clickTrackAction="mhmclicktracking";

function clickTrack(clickID){
	xmlreqGET(homePageContentURL+actionId+"="+clickTrackAction+"&"+clickIDParam+"="+clickID);
}

var containersArray=null; //a String of container names

/*body*/

var bodyRequestHome = null;
try {
	bodyRequestHome = new XMLHttpRequest();
}
catch (trymicrosoft) {
	try {
		bodyRequestHome = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch (othermicrosoft) {
		try {
			bodyRequestHome = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (failed) {
			bodyRequestHome = null;
		}
	}
}

/**
	Method to send the request to the servlet with a synchronous request.
*/
function sendRequestBodyHome(iContainersArray, additionalData){
	//alert(homePageContentURL+actionIdConst+"&"+containerNamesParameter+"="+containersArray+"&"+paramsParameter+"="+URLEncode(additionalData));
	asynchronous=false;
	bodyRequestHome.open("GET",homePageContentURL+actionIdConst+"&"+containerNamesParameter+"="+containersArray+"&"+paramsParameter+"="+additionalData,asynchronous);
	bodyRequestHome.onreadystatechange = updatePageBody;
	
	bodyRequestHome.send(null);
	
	//add for non-Win browsers, call the method directly
	try{
		if (!asynchronous && !bodyRequestHome.onreadystatechange) {
			//alert("updatePageBody called directly");
		 	updatePageBody();
		}
	}
	catch(e){
		//don't do anything since the exception is thrown by browsers that can't read onreadystatechange, like IE
		//alert(e.name + ", " + e.message);
		//code below for when Firebug is installed
		//breaks IE6 by causing two calls to updatePageBody(), so commented out
		//try{
		//	updatePageBody();
		//}
		//catch(e1){
		//}
	}
}

function updatePageBody(){
	if(bodyRequestHome.readyState ==4){
		var xmlDoc=parseDataAsXML(bodyRequestHome.responseText);
		executeUpdatePageBody(xmlDoc);
	}
}

function executeUpdatePageBody(xmlDoc){
	var fullOutput;
	for(i=0; i<containersArray.length; i++){
		var theTagName = containersArray[i];
		//alert(theTagName);
		if(xmlDoc.getElementsByTagName(theTagName)[0].childNodes[0].nodeValue){
			//alert((xmlDoc.getElementsByTagName(theTagName)[0].childNodes[0].nodeValue).length);
			var outputString = getXMLDocContent(xmlDoc, theTagName)
			//alert(outputString);
			document.getElementById(theTagName).innerHTML=outputString;
			//now launch any javascript that needs launching
			fullOutput += outputString;
			
		}
	}
/*
	//now call supersleight to reload pngs
	var version=0;
	if (navigator.appVersion.indexOf("MSIE")!=-1){
		var temp=navigator.appVersion.split("MSIE");
		version=parseFloat(temp[1]);
		if(version < 7){
			supersleight.limitTo('content');
			supersleight.run();
		}
	}
*/
	launchJavascript(fullOutput);
	launchJavascriptFiles(fullOutput);
}

/**
	Get content from the XML doc.  If the browser is firefox, we may have to normalize and get child nodes.
*/
function getXMLDocContent(xmlDoc, theTagName){
	var outputString = "";
	var theElement = xmlDoc.getElementsByTagName(theTagName)[0];
	outputString += getNodeText(theElement);
	//alert(outputString);
	return outputString;
}

/* function called by page elements */

/**
 * Request some content, delegating to a method that will send the AJAX request
 * @param containerNames CSV of container names
 * @param additionalData - any other data, such as which container to request data for,
 * named by containerNames[x]=CSV of sections, as well as other data
 */
function requestHomeContent(iContainerNames, additionalData){
	//set global var
	containersArray = parseCSVToArray(iContainerNames);
	//now set each element to processing
	for(i=0; i<containersArray.length; i++){
		document.getElementById(containersArray[i]).innerHTML="Processing...";
	}
	var additionalData = additionalData;
	sendRequestBodyHome(containersArray, additionalData);
	//now reset the timeout
	resetTimeout();
}

/**
	Take all the data names and values and put in a string to be name0=, value0=, name1=, value1=, etc.
*/
function createNameValuePairString(namesArray, valuesArray){
	var output = "";
	if(namesArray){
		for(i=0; i<namesArray.length; i++){
			if(namesArray[i]){
				output+="name"+i+"="+namesArray[i]+"&";
			}
		}	
	}
	if(valuesArray){
		for(i=0; i<valuesArray.length; i++){
			if(valuesArray[i]){
				output+="value"+i+"="+valuesArray[i]+"&";
			}
		}	
	}
	if(output.length > 0 && output.charAt(output.length-1) == "&"){
		output = output.slice(0, output.length-1);
	}
	return output;
}

/**
	Functions for hiding and showing program elements
*/

var pHome_progDisplayArray;  //global variable for array of programs
var pHome_progDisplayIndex = 0;

/**
	Show one element, the one passed in as elementIndex, and hide everything else in the array
	by setting CSS display.  Array is assumed to contain the suffix of elements that 
	can be retrieved by Id.
*/

function showOneProgramElementHideRest(elementIndex, elementArray, containerNamePrefix) {
	for(i=0; i<elementArray.length;i++){
		var thisElementString = containerNamePrefix+'_'+elementArray[i];
		var thisElement = null;
		if(document.getElementById(thisElementString)!=null){
				thisElement = document.getElementById(thisElementString);
		}
		if(thisElement != null){
			if(i != elementIndex){
				thisElement.style.display='none';
			}
			else {
				thisElement.style.display='block';
				pHome_progDisplayIndex=i;
			}
		}
	}
}

/**
	Show programName and hide the one designated by prefix
*/
function showOneProgramElementHideCurrentElement(elementArray, containerNamePrefix, programName){
	hideOneElement(containerNamePrefix+'_'+elementArray[eval(pHome_progDisplayIndex)]);
	//also hide the inner piece
	showOneProgramElement(elementArray, containerNamePrefix, programName);
}
/**
	Show one program element
	Set index based on what's found in passed in array
*/
function showOneProgramElement(elementArray, containerNamePrefix, programName){
	//loop through the array and match the programName, setting index
	for(i=0; i<elementArray.length; i++){
		if(programName == elementArray[i]){
			pHome_progDisplayIndex = i;
			break;
		}
	}
	
	showOneElement(containerNamePrefix+'_'+programName);
}

/**
	Change the display of one element to block
*/
function showOneElement(containerName) {
	var thisElement = null;
	//alert(containerName);
	if(document.getElementById(containerName)!=null){
		thisElement = document.getElementById(containerName);
	}
	//alert(thisElement);
	if(thisElement != null){
		thisElement.style.display='block';
	}
}

function hideOneElement(containerName) {
	//alert("Hide " + containerName);
	var thisElement = null;
	if(document.getElementById(containerName)!=null){
		thisElement = document.getElementById(containerName);
	}
	if(thisElement != null){
		thisElement.style.display='none';
	}
}

/**
	Show one element and hide another
*/

function showOneElementHideOneElement(elementToShow, elementToHide) {
	showOneElement(elementToShow);
	hideOneElement(elementToHide);
}

/**
	move the index down one to display a different element
*/
function changeHomeImageLeft(){
	var oneToDisplay = null;
	if(pHome_progDisplayIndex == 0){
		oneToDisplay = pHome_progDisplayArray.length-1;
	}
	else {
		oneToDisplay = pHome_progDisplayIndex - 1;
	}
	
	//get the program name to show
	var programName = pHome_progDisplayArray[oneToDisplay];
	showOneProgramElementHideCurrentElement(pHome_progDisplayArray, 'pHome_progDisplay', programName);
	//now reset the timeout
	resetTimeout();
}

/**
	move the index down one to display a different element
*/
function changeHomeImageRight(){
	var oneToDisplay = null;
	if(pHome_progDisplayIndex == pHome_progDisplayArray.length-1){
		oneToDisplay = 0;
	}
	else {
		oneToDisplay = pHome_progDisplayIndex + 1;
	}
	
	//get the program name to show
	var programName = pHome_progDisplayArray[oneToDisplay];
	showOneProgramElementHideCurrentElement(pHome_progDisplayArray, 'pHome_progDisplay', programName);
	//now reset the timeout
	resetTimeout();
}

/**
	Change the inner text of the plan navigation div to the current
	number in the list
*/
function setPlanNavDivInnerHTMLtoCurrent(){
	var outputString = pHome_progDisplayIndex+1
	document.getElementById('pHome_progDisplayNav').innerHTML=outputString;
}


var pHome_homeDisplayArray;  //global variable for array of home top items
var pHome_homeTextArray;	//global variable for array of bottom items
var pHome_homeDisplayIndex = 0;
var pHome_homeTextIndex = 0;


var pHome_homeDisplayTimeoutArray=new Array(); //array of timeouts in case they need to be canceled
var pHome_homeDisplayIntervalArray=new Array(); //array of timeouts in case they need to be canceled
/**
	Show one element, the one passed in as elementIndex, and hide everything else in the array
	by setting CSS display.  Array is assumed to contain the suffix of elements that 
	can be retrieved by Id.
	
	These are all done using the global variables, unfortunately
*/

function showOneHomeElementHideRest(elementIndex, containerNamePrefix) {
	for(i=0; i<pHome_homeDisplayArray.length;i++){
		var thisElementString = containerNamePrefix+'_'+pHome_homeDisplayArray[i];
		var thisElement = null;
		
		if(document.getElementById(thisElementString)!=null){
			thisElement = document.getElementById(thisElementString);
		}
		
		if(thisElement != null){
			if(i != elementIndex){
				thisElement.style.display='none';
				changeClass(containerNamePrefix+'Nav_'+pHome_homeDisplayArray[i],containerNamePrefix+'Nav');
			}
			else {
				//thisElement.style.display='block';
				showOneHomeElement(containerNamePrefix, pHome_homeDisplayArray[i]);
				//pHome_homeDisplayIndex=i;
				//also focus the nav
				changeClass(containerNamePrefix+'Nav_'+pHome_homeDisplayArray[i],containerNamePrefix+'Nav_on');
				//and bring up the opacity
				//thisElement.style.opacity=1;
			}
		}
	}
}

/**
	Show newElementName and hide the one designated by pHome_homeDisplayIndex
*/
function showOneHomeElementHideCurrentElement(containerNamePrefix, newElementName){
	//alert(containerNamePrefix+','+newElementName);
	hideOneElement(containerNamePrefix+'_'+pHome_homeDisplayArray[eval(pHome_homeDisplayIndex)]);
	//also hide the inner piece
	showOneHomeElement(containerNamePrefix, newElementName);
}
/**
	Show one home page element
*/
function showOneHomeElement(containerNamePrefix, newElementName){
	//loop through the array and match the programName, setting index
	for(i=0; i<pHome_homeDisplayArray.length; i++){
		if(newElementName == pHome_homeDisplayArray[i]){
			pHome_homeDisplayIndex = i;
			break;
		}
	}
	maxOpacity(containerNamePrefix+'_'+newElementName);
	//maxOpacityChildren(containerNamePrefix+'_'+newElementName);
	showOneElement(containerNamePrefix+'_'+newElementName);
}

/**
	Show newElementName and hide the one designated by pHome_homeDisplayIndex
*/
function showOneHomeBottomElementHideCurrentElement(containerNamePrefix, newElementName){
	//alert(containerNamePrefix+','+newElementName);
	hideOneElement(containerNamePrefix+'_'+pHome_homeDisplayArray[eval(pHome_homeTextIndex)]);
	//also hide the inner piece
	showOneHomeBottomElement(containerNamePrefix, newElementName);
}

/**
	Show one home page element
*/
function showOneHomeBottomElement(containerNamePrefix, newElementName){
	//loop through the array and match the programName, setting index
	for(i=0; i<pHome_homeDisplayArray.length; i++){
		if(newElementName == pHome_homeTextArray[i]){
			pHome_homeTextIndex = i;
			break;
		}
	}
	showOneElement(containerNamePrefix+'_'+newElementName);
}

function maxOpacity(containerName){
	changeOpac(100, containerName);
}

function minOpacity(containerName){
	changeOpac(0, containerName);
}

function maxOpacityChildren(containerName){
	changeOpac(100, containerName);
	var children = getElementChildrenRecursive(containerName);
	for(var i=0; i<children.length; i++){
		changeOpac(100, children[i]);
	}
}

function minOpacityChildren(containerName){
	changeOpac(0, containerName);
	var children = getElementChildrenRecursive(containerName);
	for(var i=0; i<children.length; i++){
		changeOpac(0, children[i]);
	}
}

/**
	setInterval to call rotateHomeElements from the first element, for time
	pHome_homeDisplayArray.length * rotateTime, in milliseconds.
*/
function kickOffHomeElementRotationFade(containerNamePrefix, startElement, rotateTime, fadeinTime, fadeoutTime) {
	//first, show the first element
	showOneHomeElement(containerNamePrefix, startElement);
	maxOpacity(containerNamePrefix+'_'+startElement);
	//maxOpacityChildren(containerNamePrefix+'_'+startElement);
	
	//Make sure the first element has right nav style
	changeClass(containerNamePrefix+'Nav_'+startElement,containerNamePrefix+'Nav_on');
	
	//now find a start element for the fading
	var thisElementIndex = 0;
	for(var i=0; i<pHome_homeDisplayArray.length; i++){
		if(startElement == pHome_homeDisplayArray[i]){
			thisElementIndex = i;
			break;
		}
	}
	
	var nextIndex = ++thisElementIndex;
	//now if nextIndex is == the length of the array-1, next is 0
	if(nextIndex == (pHome_homeDisplayArray.length)){
		nextIndex = 0;
	}
	
	var nextElement = pHome_homeDisplayArray[nextIndex];
	
	//Set the rotation interval after item has displayed long enough
	pHome_homeDisplayTimeoutArray[0] = setTimeout("setRotationInterval('"+containerNamePrefix+"','"+nextElement+"',"+ rotateTime+","+ fadeinTime+","+ fadeoutTime+")",rotateTime);
}

function setRotationInterval(containerNamePrefix, startElement, rotateTime, fadeinTime, fadeoutTime) {
	var rotateTimeTotal = (rotateTime+fadeinTime+fadeoutTime)*pHome_homeDisplayArray.length;
	//alert (rotateTimeTotal);
	//rotate the elements once and set an interval so they will rotate again when finished
	rotateHomeElementsFade(containerNamePrefix,startElement,rotateTime,fadeinTime,fadeoutTime);
	pHome_homeDisplayIntervalArray[0] = setInterval("rotateHomeElementsFade('"+containerNamePrefix+"','"+ startElement+"',"+ rotateTime+","+fadeinTime+","+fadeoutTime+")",rotateTimeTotal);
}

function rotateHomeElementsFade(containerNamePrefix, startElement, rotateTime, fadeinTime, fadeoutTime){
	var startElementName = containerNamePrefix+'_'+startElement;
	
	//figure out which element is displaying in terms of the array
	var thisElementIndex = 0;
	for(i=0; i<pHome_homeDisplayArray.length; i++){
		if(startElement == pHome_homeDisplayArray[i]){
			thisElementIndex = i;
			break;
		}
	}

	var nextIndex = thisElementIndex;
	var timer = 0;
	//alert(pHome_homeDisplayArray[nextIndex]);
	//clear the timeout array so that only the latest timeouts are captured
	pHome_homeDisplayTimeoutArray.length = 0;
	var rotateTimeTotal = rotateTime+fadeoutTime+fadeinTime;
	for(i=0; i<pHome_homeDisplayArray.length; i++){
		//fade out at time after any previous one has finished
		var newElementName = pHome_homeDisplayArray[nextIndex];
		pHome_homeDisplayTimeoutArray[pHome_homeDisplayTimeoutArray.length] = setTimeout("fadeOutOneElement('"+containerNamePrefix+"','"+ fadeoutTime+"')",(timer*rotateTimeTotal));
		//swap once the fade out is done
		pHome_homeDisplayTimeoutArray[pHome_homeDisplayTimeoutArray.length] = setTimeout("swapFadeElements('"+containerNamePrefix+"','"+ newElementName+"','"+ fadeoutTime+"')",((timer*rotateTimeTotal)+fadeoutTime));
		//fade in, offset by 10ms because of opacity finishing
		pHome_homeDisplayTimeoutArray[pHome_homeDisplayTimeoutArray.length] = setTimeout("fadeInOneElement('"+containerNamePrefix+"','"+ newElementName+"','"+ fadeinTime+"','"+ fadeoutTime+"')",((timer*rotateTimeTotal)+fadeoutTime+10));
		//now make sure the array isn't supposed to have looped
		if(++nextIndex==pHome_homeDisplayArray.length){
			nextIndex = 0;
		}
		timer++;
	}
}

function fadeOutOneElement(containerNamePrefix, fadeoutTime){
	//fade out the current element
	opacityHome(containerNamePrefix+'_'+pHome_homeDisplayArray[eval(pHome_homeDisplayIndex)], 100, 0, fadeoutTime);
	//and fade out its children
	//var children = getElementChildrenRecursive(containerNamePrefix+'_'+pHome_homeDisplayArray[eval(pHome_homeDisplayIndex)]);
	//for(var i=0; i<children.length; i++){
	//	if(children[i] && children[i].id){
	//		opacityHome(children[i].id, 100, 0, fadeoutTime);
	//	}
	//}
	//and set the nav item to original state
	changeClass(containerNamePrefix+'Nav_'+pHome_homeDisplayArray[eval(pHome_homeDisplayIndex)],containerNamePrefix+'Nav');
}

function fadeInOneElement(containerNamePrefix, newElementName, fadeinTime){
	//now fade in
	opacityHome(containerNamePrefix+'_'+newElementName, 0, 100, fadeinTime);
	//and fade in its children
	//var children = getElementChildrenRecursive(containerNamePrefix+'_'+newElementName);
	//for(var i=0; i<children.length; i++){
	//	opacityHome(children[i].id, 0, 100, fadeinTime);
	//}
	
	//and set the nav element
	changeClass(containerNamePrefix+'Nav_'+newElementName,containerNamePrefix+'Nav_on');
}

function swapFadeElements(containerNamePrefix, newElementName, fadeoutTime){
	//hide the element when this is finished, offset by 10 because changeOpac does
	showOneHomeElementHideCurrentElement(containerNamePrefix,newElementName);
	//make sure the new element has 0 opacity and show
	minOpacity(containerNamePrefix+'_'+newElementName);
	//same with the children
	//minOpacityChildren(containerNamePrefix+'_'+newElementName);
}

/* Used here so we can track the timeouts */
function opacityHome(id, opacStart, opacEnd, millisec) {
	//speed for each frame
	var speed = Math.round(millisec / 100);
	var timer = 0;

	//determine the direction for the blending, if start and end are the same nothing happens
	if(opacStart > opacEnd) {
		for(i = opacStart; i >= opacEnd; i--) {
			pHome_homeDisplayTimeoutArray[pHome_homeDisplayTimeoutArray.length] = setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	} else if(opacStart < opacEnd) {
		for(i = opacStart; i <= opacEnd; i++) {
			pHome_homeDisplayTimeoutArray[pHome_homeDisplayTimeoutArray.length] = setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	}
}
/**
	Clear the timeouts and intervals on the home homepage
*/
function clearFadeTimeoutsAndIntervals(){
	if(pHome_homeDisplayTimeoutArray){
		for(i=0; i<pHome_homeDisplayTimeoutArray.length; i++){
			clearTimeout(pHome_homeDisplayTimeoutArray[i]);
		}
	}
	if(pHome_homeDisplayIntervalArray){
		for(i=0; i<pHome_homeDisplayIntervalArray.length; i++){
			clearInterval(pHome_homeDisplayIntervalArray[i]);
		}
	}
}

/**
UTILITY METHODS
*/

/**
	Change the display of one element to visible.  Use visible/hidden rather
	than display = none/block so that the element will still take up space on 
	the page.
*/
function makeElementVisible(containerName) {
	var thisElement = null;
	if(document.getElementById(containerName)!=null){
		thisElement = document.getElementById(containerName);
	}
	if(thisElement != null){
		thisElement.style.visibility='visible';
	}
}

function makeElementInvisible(containerName) {
	var thisElement = null;
	if(document.getElementById(containerName)!=null){
		thisElement = document.getElementById(containerName);
	}
	if(thisElement != null){
		thisElement.style.visibility='hidden';
	}
}

function parseCSVToArray(inCSV) {
	var newArray = inCSV.split(",");
	return newArray;
}

/*
	Parse a text stream as XML returning an XML document
*/
function parseDataAsXML(data) {
	//alert(data);
	var xmlDoc = null;
	try //Internet Explorer
  	{
  		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async="false";
  		xmlDoc.loadXML(data);
  	}
	catch(e){
		try //Firefox, Mozilla, Opera, etc.
		{
			parser=new DOMParser();
    		xmlDoc=parser.parseFromString(data,"text/xml");
		}
		catch(e) {}
	}
 	return xmlDoc;
}

/**
	Get all text from an XML Node, including it's children.  FF requires this if node text is greater than 4096
*/
function getNodeText(xmlNode) {
	var output = "";
	for(var i=0; i<xmlNode.childNodes.length; i++){
		if(xmlNode.childNodes[i].hasChildNodes()){
			output += getNodeText(xmlNode.childNodes[i]);
		}
		else {
			
			output += xmlNode.childNodes[i].nodeValue;
		}
	}
	return output;
}

function URLEncode (clearString) {
  var output = '';
  var x = 0;
  clearString = clearString.toString();
  var regex = /(^[a-zA-Z0-9_.]*)/;
  while (x < clearString.length) {
    var match = regex.exec(clearString.substr(x));
    if (match != null && match.length > 1 && match[1] != '') {
    	output += match[1];
      x += match[1].length;
    } else {
      if (clearString[x] == ' ')
        output += '+';
      else {
        var charCode = clearString.charCodeAt(x);
        var hexVal = charCode.toString(16);
        output += '%' + ( hexVal.length < 2 ? '0' : '' ) + hexVal.toUpperCase();
      }
      x++;
    }
  }
  return output;
}

function URLDecode (encodedString) {
  var output = encodedString;
  var binVal, thisString;
  var myregexp = /(%[^%]{2})/;
  while ((match = myregexp.exec(output)) != null
             && match.length > 1
             && match[1] != '') {
    binVal = parseInt(match[1].substr(1),16);
    thisString = String.fromCharCode(binVal);
    output = output.replace(match[1], thisString);
  }
  return output;
}

function launchJavascriptFromXML(responseXML) {
    var scripts = responseXML.getElementsByTagName('script');
    var js = '';
    for(var s = 0; s < scripts.length; s++) {
        if(scripts[s].childNodes[0].nodeValue == null) continue;
           js += scripts[s].childNodes[0].nodeValue;
    }
    eval(js);
}

function launchJavascript(responseText) {
  // RegExp from prototype.sonio.net
  var ScriptFragment = '(?:<script.*?>)((\n|.)*?)(?:</script>)'; 
  var match    = new RegExp(ScriptFragment, 'img');
  var scripts  = responseText.match(match);

    if(scripts) {
        var js = '';
        for(var s = 0; s < scripts.length; s++) {
            var match = new RegExp(ScriptFragment, 'im');
            js += scripts[s].match(match)[1];
        }
        eval(js);
    }
}

function launchJavascriptFiles(responseText){
	// RegExp from prototype.sonio.net
  //var ScriptFragment = '(?:<script.*?>)((\n|.)*?)(?:</script>)'; 
  var ScriptFragment = '(?:<script.*?src.*?=")(.*?)(")(.*?>)'; 
  var match    = new RegExp(ScriptFragment, 'img');
  var scripts  = responseText.match(match);

    if(scripts) {
        var js = '';
        for(var s = 0; s < scripts.length; s++) {
            var match = new RegExp(ScriptFragment, 'im');
            js += scripts[s].match(match)[1];
			//now add the script to the document body?
			var headID = document.getElementsByTagName("head")[0];
			var newScript = document.createElement('script');
			newScript.type = 'text/javascript';
			newScript.src = js;
			headID.appendChild(newScript);
        }
		//alert(js);
    }
}



function openGenericPopUpWindow(windowName, windowFile, windowWidth, windowHeight) {
	var newPopupWindow = window.open(windowFile, windowName, 'width='+windowWidth+',height='+windowHeight+',location=no,toolbar=no,status=no,scrollbars=no,resizable=no,menubar=no,directories=no');
}

// write an entire movie and hide the nav, so the movie has the whole stage
function writeFlashMovieAndHideNav(theTagName, movieName, movieWidth, movieHeight, movieAlt, movieColor) {
	writeFlashMovieWithTransparencyToElement(theTagName, movieName, movieWidth, movieHeight, movieAlt, movieColor);
	hideOneElement('pHomeStageNav');
}

function displayStageNav() {
	showOneElement('pHomeStageNav');
}


