var site_root = 'http://www.webrangers.us/';

//	Browser d-tect
var w3c = (document.getElementById) ? true : false;
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;


/* SWFObject v2.1 <http://code.google.com/p/swfobject/>
	Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
	This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return }if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return }}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return }var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return }var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return }AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();



//	Init variables - set to true on page to have them execute
var is_flash = false;
var is_flashnav = false;
var is_index = false;
var pw_key;
var pw_form;

// Variables for certificate
var certName;
var certDate;
var medalNum;

// Variable for activity & station
var swf_vars;
if (!swf_vars)
	swf_vars = '';
var stationInfo;
if (!stationInfo)
	stationInfo = '';

var is_comm_form = false;
var is_photo_page = false;

// Generate styles that need to be applied via document.write
if (w3c) {
	//var write_in_styles = '';
	//write_in_styles += '<style type="text/css">';
	
	if (location.href.indexOf('community/index.cfm') != -1) {
		//write_in_styles += '#communitySearch, #commSearchParams { display: none; }';
		swfobject.createCSS('#communitySearch', 'display: none;');
		swfobject.createCSS('#commSearchParams', 'display: none;');
		is_comm_form = true;
	}
	if (location.href.indexOf('community/photo_full.cfm?') != -1) {
		//write_in_styles += '#fullImage { visibility: hidden; }';
		swfobject.createCSS('#fullImage', 'visibility: hidden;');
		is_photo_page = true;
	}
	
	//write_in_styles += '#activitySWF, #entryGateSWF, #cardSWF { visibility: hidden; height: 450px; }';
	swfobject.createCSS('#activitySWF', 'visibility: hidden; height: 450px;');
	swfobject.createCSS('#entryGateSWF', 'visibility: hidden; height: 450px;');
	swfobject.createCSS('#cardSWF', 'visibility: hidden; height: 450px;');
	//write_in_styles += '#introSWF, #searchSWF, #rangerStationSWF, #activitiesCompletedSWF  { visibility: hidden; }';
	swfobject.createCSS('#introSWF', 'visibility: hidden;');
	swfobject.createCSS('#searchSWF', 'visibility: hidden;');
	swfobject.createCSS('#rangerStationSWF', 'visibility: hidden;');
	swfobject.createCSS('#activitiesCompletedSWF', 'visibility: hidden;');
	//write_in_styles += '#content  { visibility: hidden; }';
	
	//write_in_styles += '</style>';
	//document.write(write_in_styles);
	
	//	If browser is good, run init function
	swfobject.addDomLoadEvent(init);
}



var flash_pages = new Array();
// [Folder+PageName],[SWFFilePath],[ElementID],[SWFHeight],[SWFWidth]
flash_pages.push(new Array('/','intro.swf','introSWF',343,582));
flash_pages.push(new Array('index.cfm','intro.swf','introSWF',343,582));
flash_pages.push(new Array('station.cfm','rangerStationPreloader.swf?' + location.search.substring(1),'rangerStationSWF',550,720));
flash_pages.push(new Array('station2.cfm','activitiesCompleted.swf','activitiesCompletedSWF',600,750));
flash_pages.push(new Array('search.cfm','search.swf','searchSWF',600,775));
flash_pages.push(new Array('search.cfm','searchSmallHeader.swf?' + location.search.substring(1),'searchSmallSWF',122,800));
flash_pages.push(new Array('card.cfm','card.swf','cardSWF',260,550));
flash_pages.push(new Array('arrowhead.cfm','activities/arrowhead/arrow_head_04.swf' + swf_vars,'activitySWF',390,550));
flash_pages.push(new Array('instructions.cfm','instructions1.swf','activitySWF',390,550));

// Climate Community - 12.27.2010
flash_pages.push(new Array('sitewide','/activities/climate3/climate_community.swf','communityStats',360,733));

flash_pages.push(new Array('acadians/','acadians.swf' + swf_vars,'activitySWF',390,550));
flash_pages.push(new Array('alphacodes/','alpha_02.swf' + swf_vars,'activitySWF',370,550));
flash_pages.push(new Array('arewethere/','arewethere.swf' + swf_vars,'activitySWF',390,550));
flash_pages.push(new Array('arrowhead/','arrow_head_04.swf' + swf_vars,'activitySWF',390,550));
flash_pages.push(new Array('artifact/','artifact.swf' + swf_vars,'activitySWF',390,550));
flash_pages.push(new Array('baldeagles/','baldeagles.swf' + swf_vars,'activitySWF',390,550));
flash_pages.push(new Array('civilwar/','civilwar.swf' + swf_vars,'activitySWF',345,490));
flash_pages.push(new Array('darksky/','darksky.swf' + swf_vars,'activitySWF',390,550));
flash_pages.push(new Array('dendrochronology/','dendrochronology.swf' + swf_vars,'activitySWF',400,550));
flash_pages.push(new Array('dinodiets/','dinodiets.swf' + swf_vars,'activitySWF',400,550));
flash_pages.push(new Array('edison/','edison.swf' + swf_vars,'activitySWF',345,490));
flash_pages.push(new Array('essentials/','essentials.swf' + swf_vars,'activitySWF',400,550));
flash_pages.push(new Array('fire/','fire.swf' + swf_vars,'activitySWF',390,550));
flash_pages.push(new Array('firetools/','firetools.swf' + swf_vars,'activitySWF',400,550));
flash_pages.push(new Array('georgewashcode/','georgewashcode.swf' + swf_vars,'activitySWF',350,550));
flash_pages.push(new Array('helpranger/','helpranger.swf' + swf_vars,'activitySWF',400,550));
flash_pages.push(new Array('independence/','independence.swf' + swf_vars,'activitySWF',400,550));
flash_pages.push(new Array('mapmatch/','mapmatch.swf' + swf_vars,'activitySWF',400,550));
flash_pages.push(new Array('packdogsled/','packdogsled.swf' + swf_vars,'activitySWF',400,550));
flash_pages.push(new Array('parkjeopardy/','parkjeopardy.swf' + swf_vars,'activitySWF',390,550));
flash_pages.push(new Array('patriot/','patriotSpy.swf' + swf_vars,'activitySWF',345,490));
flash_pages.push(new Array('photo/','photoexplore.swf' + swf_vars,'activitySWF',390,550));
flash_pages.push(new Array('powdermonkey/','powdermonkey.swf' + swf_vars,'activitySWF',390,550));
flash_pages.push(new Array('protectharbor/','defend04_mute.swf' + swf_vars,'activitySWF',345,490));
flash_pages.push(new Array('puma/','pumaMain.swf' + swf_vars,'activitySWF',390,550));
flash_pages.push(new Array('readingmap/','readingmap.swf' + swf_vars,'activitySWF',345,490));
flash_pages.push(new Array('rockpark/','rockpark.swf' + swf_vars,'activitySWF',345,490));
flash_pages.push(new Array('semaphore/','semaphore.swf' + swf_vars,'activitySWF',400,550));
flash_pages.push(new Array('signalflag/','signalflag.swf' + swf_vars,'activitySWF',400,550));
flash_pages.push(new Array('sleddog/','sleddog.swf' + swf_vars,'activitySWF',390,550));
flash_pages.push(new Array('smokeymountian/','smokeymountian.swf' + swf_vars,'activitySWF',400,550));
flash_pages.push(new Array('starspangled/','starspangled.swf' + swf_vars,'activitySWF',390,550));
flash_pages.push(new Array('storiespast/','storiespast.swf' + swf_vars,'activitySWF',400,550));
flash_pages.push(new Array('superintendent/','superintendent.swf' + swf_vars,'activitySWF',390,550));
flash_pages.push(new Array('swimhome/','swimhome.swf' + swf_vars,'activitySWF',320,400));
flash_pages.push(new Array('tidepool/','tidepool03.swf' + swf_vars,'activitySWF',345,490));
flash_pages.push(new Array('trashtalk/','trashtalk.swf' + swf_vars,'activitySWF',390,550));
flash_pages.push(new Array('turtlehurdles/','turtlehurdles.swf' + swf_vars,'activitySWF',400,550));
flash_pages.push(new Array('waterquality/','waterqualityshell.swf' + swf_vars,'activitySWF',400,550));
flash_pages.push(new Array('whattopack/','whattopack.swf' + swf_vars,'activitySWF',400,550));
flash_pages.push(new Array('whitesands/','whitesands.swf' + swf_vars,'activitySWF',400,550));
flash_pages.push(new Array('who/','who.swf' + swf_vars,'activitySWF',400,550));
flash_pages.push(new Array('whoarewe/','whoarewe.swf' + swf_vars,'activitySWF',390,550));
flash_pages.push(new Array('whosaid/','whosaid.swf' + swf_vars,'activitySWF',400,550));
flash_pages.push(new Array('yellowstonewinter/','yellowstonewinter.swf' + swf_vars,'activitySWF',390,550));
flash_pages.push(new Array('yesterdaytoday/','yesterdaytoday.swf' + swf_vars,'activitySWF',400,550));
flash_pages.push(new Array('entry_gate.cfm','entryGate.swf','entryGateSWF',500,585));
flash_pages.push(new Array('share_station.cfm','entryGate.swf','entryGateSWF',500,585));
flash_pages.push(new Array('namethatpark/for_word.cfm','namethatpark.swf' + swf_vars,'activitySWF',390,550));
flash_pages.push(new Array('uniforms/','uniforms.swf' + swf_vars,'activitySWF',390,550));

// Railroad connections
flash_pages.push(new Array('rrc/','rrc1.swf' + swf_vars,'activitySWF',390,550));
flash_pages.push(new Array('rrc/','rrcCertificate.swf','rrcSWF',390,550));

// Scavenger Hunt
flash_pages.push(new Array('scavenger_cert.cfm','scavenger.swf','scavengerSWF',442,580));
flash_pages.push(new Array('scavenger_intro.cfm','scavengerHuntIntro.swf','scavengerIntroSWF',284,536));

// Reprinting card
flash_pages.push(new Array('card_reprint.cfm','card.swf','cardSWF',260,550));

// Certificate(s)
flash_pages.push(new Array('certificate.cfm','blank_certificate.swf?certName=' + certName + '&certDate=' + certDate + '&medalNum=' + medalNum,'blankCert',400,550));

// Presidents
flash_pages.push(new Array('presidents/','presidents.swf' + swf_vars,'activitySWF',400,550));


flash_pages.push(new Array('abelincoln/','abelincoln.swf' + swf_vars,'activitySWF',390,550));
flash_pages.push(new Array('newbedwhale/','mainstage.swf' + swf_vars,'activitySWF',400,550));
flash_pages.push(new Array('stationNEW.cfm','rangerStationREVIEW.swf','rangerStationSWF',550,720));

flash_pages.push(new Array('lincoln2/','lincoln2.swf' + swf_vars,'activitySWF',390,695));
flash_pages.push(new Array('global_connect/','climate_change.swf' + swf_vars,'activitySWF',390,695));

// Added 6/3/2010
flash_pages.push(new Array('seagrasses/','seagrass.swf' + swf_vars,'activitySWF',390,695));
flash_pages.push(new Array('oceans_matching/','oceans_matching.swf' + swf_vars,'activitySWF',390,695));

// Added 6/7/2010
flash_pages.push(new Array('bandelier/','bandelier.swf' + swf_vars,'activitySWF',390,695));

// Added 7/21/2010
flash_pages.push(new Array('share_station.cfm','rangerStationPreloader.swf?' + stationInfo,'rangerStationSWF',550,720));

// Added 9/24/10
flash_pages.push(new Array('watersafety/','waterSafety.swf' + swf_vars,'activitySWF',390,695));

// Added 11/23/10
flash_pages.push(new Array('climate2/','climate2.swf' + swf_vars,'activitySWF',390,695));
flash_pages.push(new Array('climate2/com_test.cfm','climate_community.swf' + swf_vars,'activitySWF',360,733));

flash_pages.push(new Array('george/','george.swf','activitySWF',550,775));

//Added 1/22/11
flash_pages.push(new Array('ripcurrents/','ripcurrents.swf' + swf_vars,'activitySWF',390,695));
flash_pages.push(new Array('waterexploration/','waterexploration.swf' + swf_vars,'activitySWF',390,695));

//Added 4/22/11
flash_pages.push(new Array('climate3/','climate3.swf' + swf_vars,'activitySWF',390,695));




var body_tag;
//	Init function
function init() {
	
	body_tag = document.getElementsByTagName('BODY')[0];
	
	
	if (swfobject.hasFlashPlayerVersion("10")) {
		runFlash();
	}
	
	if (is_comm_form) {
		document.getElementById('pictures').onclick = function () {
			document.getElementById('commSearchParams').style.display = 'block';
		}
		document.getElementById('stories').onclick = function () {
			document.getElementById('commSearchParams').style.display = 'block';
		}
		document.getElementById('communitySearch').style.display = 'block';
	}
	if (is_photo_page) {
		reSizePhoto();
	}
	
	
	
	
	
	
	if (location.href.indexOf('levels.html') != -1) {
		setCookie('passedIntro','true');
	}
	
	if (is_index && getCookie('passedIntro') == 'true') {
		insertSkipIntroButton();
	}
	
	if (document.getElementById('moreInfoRight')) {
		addFeedbackListItem();
		var email_friend_link = document.getElementById('moreInfoRight').getElementsByTagName('A')[0];
		if (email_friend_link.lastChild.nodeValue = 'Email this activity to your friends') {
			var email_li = email_friend_link.parentNode;
			//document.getElementById('moreInfoRight').removeChild(email_li);
			var activity_name = document.getElementsByTagName('H1')[0].firstChild.nodeValue;
			//var html_2_php = email_friend_link.href.replace('.html','.php');
			//email_friend_link.href = html_2_php+'?activity_url='+location.href+'&activity_name='+activity_name;
			activity_name = activity_name.replace(/'/g,'');
			email_friend_link.href = 'http://data2.itc.nps.gov/rangers/emailfriend.cfm'+'?activity_url='+location.href+'&activity_name='+activity_name;
		}
	}
	
	// Insert dialog box
	insertDialog ();

	
	if (document.getElementById('moreInfoLeft')) {
		setRelatedLinks();		
	}
	
	setLinks();
	
	setAbeReadMores('historicalNotes');
	setAbeReadMores('youngAbeLincolnInfo');
	
	// Show me the money
	var aInvisibles = new Array();
	aInvisibles[0] = "activitySWF";
	aInvisibles[1] = "entryGateSWF";
	aInvisibles[2] = "cardSWF";
	aInvisibles[3] = "searchSWF";
	aInvisibles[4] = "rangerStationSWF";
	aInvisibles[5] = "activitiesCompletedSWF";
	aInvisibles[6] = "introSWF";
	
	for(var i = 0; i < aInvisibles.length; i++)
	{
		if(document.getElementById(aInvisibles[i]))
		{
			document.getElementById(aInvisibles[i]).style.visibility = 'visible';
		}
	}
	
}



function setAbeReadMores(the_ul_id) {
	var abe_list = document.getElementById(the_ul_id);
	var abe_list_full_lis;
	var abe_list_full_lis_stored;
	var abe_list_short_lis;
	var short_text = new Array();

	
	if (abe_list) {
		abe_list_full_lis = abe_list.getElementsByTagName('LI');
		abe_list_short_as = new Array(abe_list_full_lis.length);
		
		short_text['historicalNotes'] = [
			'Abraham Lincoln was born on February 12, 1809 in a one-room log cabin, near what is now Hodgenville, Kentucky. ',
			'The Lincoln family moved to Indiana when Abe was 7 years old. When he was 9 years old, his mother died from "milk sickness." ',
			];
		short_text['youngAbeLincolnInfo'] = [
			'Abe was naturally anti-slavery. His family did not own slaves, but there were over a 1000 slaves in Hardin County, KY, when Abe lived there.',
			'As a child, Abe may have played "stick horses" with boyhood friend , Austin Gallagher. Another game common during those years was playing with clay marbles.',
			'It is said that his favorite toy was a child\'s wagon, bought by his father when Abe was 6 years old. Abe was also interested in playing sports. Wrestling, running foot races, pitching quoits and tossing a copper were activities that won Abe praise.',
			'Abe measured six feet, four inches in height as a fully-grown man, but while growing up, was always "taller than most boys who were two years older."',
			'Abe was large for his age and one his chores was using an ax to chop wood. When he had some free time, his choice was always to read a book.',
			'Abe\'s favorite book was the Bible with Webster\'s Speller one of the few other books available for him to read. Abe was also known to pen a piece of poetry now and then. ',
			'School and learning were always important to Abe. Readin\', writin\', and cipherin\' to the rule of three was all that was taught in school during those days. Abe went to a "blab school" where children read their lessons out loud, usually because there were no writing supplies ',
			'',
			'',
			'Many of Abe\'s friends and relatives spoke about his love of animals. During his lifetime, he had dogs, cats, goats, and horses. It is said that as a young boy, he preached sermons to his family declaring that he was against cruelty to animals.'
			];
		
		for (var i=0; i<abe_list_full_lis.length; i++) {
			
			if (short_text[the_ul_id][i] != '') {
				
				abe_list_full_lis[i].className = 'readMoreItem';
				// Create a short list item
				var short_p = document.createElement('P');
				var short_p_text = document.createTextNode(short_text[the_ul_id][i]);
				var short_br = document.createElement('BR');
				var short_a = document.createElement('A');
				short_a.href = '#';
				var short_hover_text = document.createTextNode('Read More...');
				
				short_p.appendChild(short_p_text);
				short_p.appendChild(short_br);
				short_p.appendChild(short_a);
				short_a.appendChild(short_hover_text);
				
				abe_list_short_as[i] = short_a;
				abe_list_short_as[i].assoc_div = abe_list_full_lis[i].getElementsByTagName('DIV')[0];
				abe_list_short_as[i].parent_li = abe_list_full_lis[i];
				var c2c_p = document.createElement('P');
				var c2c_p_text = document.createTextNode('(click to close)');
				c2c_p.appendChild(c2c_p_text);
				abe_list_short_as[i].assoc_div.appendChild(c2c_p);
				abe_list_short_as[i].assoc_div.onclick = function () {
					this.style.display = 'none';
					this.style.zIndex = '1';
				}
				abe_list_short_as[i].assoc_div.style.display = 'none';
				abe_list_short_as[i].onclick = function() {
					for (var j=0; j<abe_list_short_as.length; j++) {
						if (abe_list_short_as[j]) {
							abe_list_short_as[j].assoc_div.style.display = 'none';
							abe_list_short_as[j].assoc_div.style.zIndex = '1';
							abe_list_short_as[j].parent_li.style.position = 'static';
						}
					}
					this.parent_li.style.position = 'relative';
					this.assoc_div.style.display = 'block';
					this.assoc_div.style.zIndex = '100';
					return false;
				}
				
				
				abe_list_full_lis[i].insertBefore(short_p, abe_list_full_lis[i].firstChild);
				
			} // End if (short_text[i] != '')
		} // End for loop
	} // End if (abe_list)
} // End function






function reSizePhoto() {
	var fullImage_p = document.getElementById('fullImage');
	var main_img = fullImage_p.getElementsByTagName('IMG')[0];
	//alert(main_img.width);
	var main_img_w = main_img.width;
	var main_img_h = main_img.height;
	var main_img_removed = fullImage_p.removeChild(main_img);
	if (main_img_w > 740) {
		var the_adjustment = 740 / main_img_w;
		var new_height = Math.round(main_img_h * the_adjustment);
		main_img.width = 740;
		main_img.height = new_height;
	}
	//fullImage_p.style.position = 'static';
	fullImage_p.style.visibility = 'visible';
	fullImage_p.appendChild(main_img_removed);
}

var times_up = false;
function tickTock() {
	if (times_up == false) {
		t = window.setTimeout('tickTock()',10000);//600000
		times_up = true;
	} else {
		window.clearTimeout(t);
		popupWindow(site_root+'session_expire.cfm', 'SessionExpired', 'height=400,width=500,status=yes,resizable=yes,scrollbars=yes');
		times_up = false;
		t = window.setTimeout('tickTock()',10000);
	}
}

//	Print code
function doPrint() {
	if (window.print) {
		window.print();
	} else {
		alert('To print this page, click on the File menu and choose Print \nor press Cntrl + P on your keyboard.');
	}
}

var bod_width;
var bod_height;
var rightv;
var r_inc;
var bottomv;
var b_inc;
var the_counter;
var page_blackout;
var dialog_div;
var num_steps = 20;

function getBodyHeight() {
	if (window.innerHeight) { // all except Explorer
		return window.innerHeight;
		//return document.body.offsetHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		return document.documentElement.clientHeight;
	}
	else if (document.body) { // other Explorers
		return document.body.clientHeight;
	}
}
function getBodyWidth() {
	if (window.innerHeight) { // all except Explorer
		return window.innerWidth;
		//return document.body.offsetWidth;
	}
	else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		return document.documentElement.clientWidth;
	}
	else if (document.body) { // other Explorers
		return document.body.clientWidth;
	}
}

var blackout_img = new Image();
blackout_img.src = site_root+'images/fadeout_bg.gif';

var dialog_img = new Image();
dialog_img.src = site_root+'images/alert_dialog_bg.jpg';

var dclose_img = new Image();
dclose_img.src = site_root+'images/close_dialog.gif';

function animateBlackout() {
	page_blackout.style.visibility = 'visible';
	if (the_counter < num_steps) {
		rightv = rightv + r_inc;
		bottomv = bottomv + b_inc;
		if (document.all) {
			clip_value = 'rect(0px '+rightv+'px '+bottomv+'px 0px)';
		} else {
			clip_value = 'rect(0px, '+rightv+'px, '+bottomv+'px, 0px)';
		}
		page_blackout.style.clip = clip_value;
		the_counter++;
		anim = setTimeout("animateBlackout()",10);
	} else {
		clearTimeout(anim);
		page_blackout.appendChild(dialog_div);
	}
}
	
function insertDialog () {
	bod_width = document.body.offsetWidth;
	bod_height = document.body.offsetHeight;
	rightv = 0;
	r_inc = bod_width/num_steps;
	bottomv = 0;
	b_inc = bod_height/num_steps;
	the_counter = 0;
	page_blackout;


	var content_div = document.getElementById('content');
	var all_content_elems = content_div.getElementsByTagName('DIV');
	for (var zz=0; zz<all_content_elems.length; zz++) {
		if (all_content_elems[zz].className == 'alertDialog') {
			all_content_elems[zz].className = 'alertDialogStyled';
			
			page_blackout = document.createElement('DIV');
			page_blackout.id = 'pageBlackOut';
			page_blackout.style.width = getBodyWidth()+'px';
			page_blackout.style.height = getBodyHeight()+'px';
			
			var body_tag = document.getElementsByTagName('BODY')[0];
			body_tag.insertBefore(page_blackout, body_tag.firstChild);
			
			
			var close_button_p = document.createElement('P');
			close_button_p.className = 'closeDialogButton';
			var close_button = document.createElement('IMG');
			close_button.src = [site_root]+'images/close_dialog.gif';
			close_button.asscElem = all_content_elems[zz];
			close_button.onclick = function() {
				//alert('yo!');
				page_blackout.style.display = 'none';	
			}
			close_button_p.appendChild(close_button);
			//all_content_elems[zz].insertBefore(close_button, all_content_elems[zz].firstChild);
			all_content_elems[zz].appendChild(close_button_p);
			dialog_div = content_div.removeChild(all_content_elems[zz]);
			setTimeout('animateBlackout()',2000);
			
			//all_content_elems[zz].style.clip = 'rect(40px 40px 40px 40px)';
		}
	}
}





//	Check password on welcome.html
function loginCheck() {
	var login_field = document.getElementById('login');
	var pee_dub = 'park';
	if (login_field.value.toLowerCase() == pee_dub) {
		return true;
	} else {
		alert('Sorry, that password is incorrect!');
		login_field.value = '';
		login_field.focus();
		return false;
	}
}

//	Check form on emailfriend.cfm
function checkSpecialChars(string_obj) {
	var special_chars = new Array('#','&','"','\'',';');
	
	var special_chars_list = "";
	for (var cc=0; cc<special_chars.length; cc++) {
		if (cc == (special_chars.length-1)) {
			special_chars_list += special_chars[cc];
		} else {
			special_chars_list += special_chars[cc]+', ';
		}
	}
	
	for (var aa=0; aa<string_obj.length; aa++) {
		for (var bb=0; bb<special_chars.length; bb++) {
			if (string_obj[aa].value.indexOf(special_chars[bb]) != -1) {
				alert('Please remove special characters ('+special_chars_list+') from all entries.');
				return false;
			}
		}
	}
	return true;
	
}
function removeSpecialChars() {
	var input_fields = document.getElementsByTagName('INPUT');
	var textarea_fields = document.getElementsByTagName('TEXTAREA');
	
	if (checkSpecialChars(input_fields) && checkSpecialChars(textarea_fields)) {
		return true;
	} else {
		return false;
	}
}

function insertSkipIntroButton() {
	
	var infoBar_div = document.getElementById('infoBar');
	var infoBar_firstChild = infoBar_div.firstChild;
	//var infoBar_parent = infoBar_div.parentNode;
	
	//var new_infoBar = document.createElement('DIV');
	//new_infoBar.id = 'infoBar';
	
	var return_p = document.createElement('P');
	var return_text = document.createTextNode('Welcome back to WebRangers! You can review the introduction section again or go straight to the Levels page by clicking the button below.');
	
	return_p.appendChild(return_text);
	infoBar_div.insertBefore(return_p, infoBar_firstChild);
	
	var preed_elem = document.createElement('P');
	preed_elem.className = 'proceed';
	
	var skip_link = document.createElement('A');
	skip_link.href = 'levels.html';
	preed_elem.appendChild(skip_link);
	
	var link_text = document.createTextNode('Skip Intro Pages');
	skip_link.appendChild(link_text);
	
	//	var skip_img = document.createElement('IMG');
	//	skip_img.src = 'images/skip_intro.gif';
	//	skip_img.alt = 'Skip Intro Pages';
	//	skip_link.appendChild(skip_img);

	
	//infoBar_parent.replaceChild(new_infoBar,infoBar_div);
	
	//infoBar_div.appendChild(preed_elem);
	
	infoBar_div.insertBefore(preed_elem, infoBar_firstChild);
}

function setCookie(cookie_name,cookie_value) {
	
	//format expiry date
	cookie_date = new Date();
	cookie_date.setTime(cookie_date.getTime() + ( 365 *24*60*60*1000));

	document.cookie = cookie_name + '=' + cookie_value
		+ '; expires=' + cookie_date.toGMTString() 
		+ '; path=/';
}


function getCookie(cookie_name) {
	this_cookie = null;	

	
	if (document.cookie && document.cookie.indexOf(cookie_name) != -1) {
		this_cookie = document.cookie.split(cookie_name+'=');
		this_cookie = this_cookie[1].split(';');
		this_cookie = this_cookie[0];
	}
	
	return this_cookie;
}

function setLinks() {
	var all_links = document.getElementsByTagName('A');
	var default_params = 'toolbar=yes,status=yes,scrollbars=yes,resizable=yes,width=780,height=550';
	
	for (var bb=0; bb<all_links.length; bb++) {		
		if (all_links[bb].target.toLowerCase() == 'webrangerslink') {
			all_links[bb].onclick = function() {
				if (this.firstChild.nodeValue.toLowerCase() == 'how to use this site') {
					popupWindow(this.href, this.target, 'status=yes,scrollbars=yes,resizable=yes,width=675,height=400');
					return false;
				} else {
					popupWindow(this.href, this.target, default_params);
					return false;
				}
			}
		}
		if (all_links[bb].target.toLowerCase() == 'externallink') {
			all_links[bb].onclick = function() {
				if (confirm('You are about visit a page outside of the WebRangers website. Are you sure you want to continue?')) {
					popupWindow(this.href, this.target, default_params);
				}
				return false;
			}			
		}
		if (all_links[bb].target.toLowerCase() == 'abelincolngallery') {
			all_links[bb].onclick = function() {
					popupWindow(this.href, this.target, 'status=yes,scrollbars=yes,resizable=yes,width=675,height=650');
					return false;
			}			
		}
	}
}

//	Create JavaScript pop-ups for related links at the bottom of pages
function setRelatedLinks() {
	var related_links_list = document.getElementById('moreInfoLeft');
	var related_links = related_links_list.getElementsByTagName('A');
	var window_params = 'location=yes,menubar=no,toolbar=yes,status=yes,scrollbars=yes,resizable=yes,width=740,height=450';
	
	for (var aa=0; aa<related_links.length; aa++) {
		related_links[aa].onclick = function() {
			popupWindow(this.href, this.target, window_params);
		}
	}
}

//	Popup window code
function popupWindow(url, target, features) {
	var page_position = (parseInt(navigator.appVersion) > 3) ? 'left=0,top=0,screenX=0,screenY=0,' : "";
	var popup_features = 'menubar=yes,status=yes,toolbar=yes,scrollbars=yes,resizable=yes,width=785,height=480';

	if (isUndefined(features)) {
		features = popup_features;
	}
	if (isUndefined(target)) {
		target = '_blank';
	}
	var the_window = window.open(url, target, page_position+features);
	the_window.focus();
	//return the_window;
}

function linkPopup(src, features) {
	return popupWindow(src.getAttribute('href'),src.getAttribute('target') || '_blank',features);
}

//	Utility function [currently used in popupWindow()]
function isUndefined(v) { 
	//	Returns true if [v] is not defined, false otherwise
	//	IE 5.0 does not support the undefined keyword, so we cannot 
	//	do a direct comparison such as v===undefined.
	var undef;
	return v===undef;
}
//	End Popup window code






function runFlash() {
	
	
	var this_url = location.href;
	var swf_url;
	var swf_name;
	var swf_height;
	var swf_width;
	var swf_element_id;
	var swf_element;
	//var swf_wmode;
	
	for (var aa=0; aa<flash_pages.length; aa++) {
		
		// [Folder+PageName],[SWFFilePath],[ElementID],[SWFHeight],[SWFWidth]
		swf_url = flash_pages[aa][0];
		swf_name = flash_pages[aa][1];
		swf_element_id = flash_pages[aa][2];
		swf_height = flash_pages[aa][3];
		swf_width = flash_pages[aa][4];
		//swf_wmode = flash_pages[aa][5];
		swf_element = document.getElementById(swf_element_id);
		
		if ((this_url.indexOf(swf_url) != -1  || swf_url == 'sitewide') && swf_element) {
			
			if (swf_width < 690 && location.href.indexOf('activities/') != -1) {
				//swf_element.style.width = '100%';
				var class_name_str = swf_element.className.toString();
				if (class_name_str.length > 0) {
					swf_element.className += ' ';
				}
				swf_element.className += 'oldFormat';
				
			} else {
				swf_element.style.width = swf_width + 'px';
			}
			
			swf_element.style.height = swf_height + 'px';
			insertFlash(swf_name,swf_element_id,swf_height,swf_width);
			
		}
	}
		/* *************************************************** */
	/* ****************** Flash Control ****************** */
		/*
		for (var aa=0; aa<flash_pages.length; aa++) {
			if(top.location.href.indexOf(flash_pages[aa][0]) != -1 && document.getElementById(flash_pages[aa][2])) {
				insertFlash(flash_pages[aa][1],flash_pages[aa][2],flash_pages[aa][3],flash_pages[aa][4]);
			}
		}
		*/
		// Insert personalPanel.swf
	var infoBar = document.getElementById('infoBar');
	var introPage = document.getElementById('introPage');
	var introPage1 = document.getElementById('introPage1');
	var introPage2 = document.getElementById('introPage2');
	var introPage3 = document.getElementById('introPage3');
	var introPage4 = document.getElementById('introPage4');
	var introPage5 = document.getElementById('introPage5');
	var indexPage = document.getElementById('indexPage');
	var loginPage = document.getElementById('loginPage');
	var signUp = document.getElementById('signUp');
	var mutePersonalPanel = document.getElementById('mutePersonalPanel');
	var privacyInfo = document.getElementById('privacyInfo');
	var communityPage = document.getElementById('communityPage');
	if (infoBar) {
		var pp_div = document.createElement('DIV');
		pp_div.id = 'personalPanelSWF';
		for (var ee=0; ee<infoBar.childNodes.length; ee++) {
			if (infoBar.childNodes[ee].nodeName == 'IMG') {
				var insertPoint = ee+1;
				break;
			}
		}
		if (insertPoint) {
			infoBar.insertBefore(pp_div, infoBar.childNodes[insertPoint]);
		}


		if(indexPage) {
			//insertFlash(site_root + 'mainPagePanel.swf','personalPanelSWF',390,160);
		} else if (introPage) {
			insertFlash(site_root + 'personalPanel.swf?disabled=true','personalPanelSWF',190,160,'transparent');	
		} else if (introPage1) {
			insertFlash(site_root + 'personalPanel.swf?disabled=true&step=1','personalPanelSWF',190,160,'transparent');	
		} else if (introPage2) {
			insertFlash(site_root + 'personalPanel.swf?disabled=true&step=2','personalPanelSWF',190,160,'transparent');	
		} else if (introPage3) {
			insertFlash(site_root + 'personalPanel.swf?disabled=true&step=3','personalPanelSWF',190,160,'transparent');	
		} else if (introPage4) {
			insertFlash(site_root + 'personalPanel.swf?disabled=true&step=4','personalPanelSWF',190,160,'transparent');		
		} else if (introPage5) {
			insertFlash(site_root + 'personalPanel.swf?disabled=true&step=5','personalPanelSWF',190,160,'transparent');		
		} else if (signUp) {
			//don't insert the personal panel
		} else if (privacyInfo) {
			//don't insert the personal panel
		} else if (communityPage && communityPage.className == 'noLeft') {	
			//don't insert the personal panel
		} else if (loginPage) {
			//don't insert the personal panel
		} else if (mutePersonalPanel) {
			insertFlash(site_root + 'personalPanel.swf?mute=true','personalPanelSWF',190,160,'transparent');	
		} else {
			
			insertFlash(site_root + 'personalPanel.swf','personalPanelSWF',190,160,'transparent');
		}
	}
}






//	var site_bg = '#fdfaf3';
//	This function returns the <object> and <embed> tags in variable [oeTags]
function makeFlashTags(the_swf,the_height,the_width,w_mode) {
	var flashTag = '';
	if (isIE && isWin) {
		flashTag = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
		+ 'width="'+the_width+'" height="'+the_height+'" '
		+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
		+ '<param name="movie" value="'+the_swf+'" />'
		+ '<param name="play" value="true" />'
		+ '<param name="quality" value="high" />'
		+ '<param name="menu" value="false" />'
		+ '<param name="wmode" value="'+w_mode+'" />'
		//	+ '<param name="loop" value="false" />'
		//+ '<param name="bgcolor" value="#FDFAF3" />'
		+ '</object>';
	} else {
		flashTag = '<embed src="'+the_swf+'"'
		+ ' width="'+the_width+'" height="'+the_height+'"'
		+ ' wmode="'+w_mode+'"'
		//+ ' bgcolor="#000000"'
		+ ' play="true"'
		+ ' quality="high"'
		//+ ' scale="noscale"'
		+ ' menu="false"'
		+ ' type="application/x-shockwave-flash"'
		+ ' pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">'
		//	+ 'loop="false"'
		+ '</embed>';
	}
	return flashTag;
}
//	This function swaps innerHTML of [the_container] with makeOETags()
function insertFlash(the_swf,the_container,the_height,the_width,w_mode) {
		if (!w_mode) w_mode = 'window';
		//document.getElementById(the_container).style.height = the_height+'px';
		document.getElementById(the_container).innerHTML = makeFlashTags(the_swf,the_height,the_width,w_mode);
		//document.getElementById(the_container).style.visibility = 'hidden';
		//document.getElementById(the_container).style.visibility = 'visible';
}

//	Needed to create a "parameter-less" function to use setTimeout() in the init() function
function runActivity() {
	insertFlash(the_swf,the_height,the_width,the_container);
}


function addFeedbackListItem() {
	//Create Elements
	var the_li = document.createElement('LI');
	var the_a = document.createElement('A');
	var the_img = document.createElement('IMG');
	var the_text = document.createTextNode('What do you think of this activity?');
	
	var activity_name = document.getElementsByTagName('H1')[0].firstChild.nodeValue;
	
	//Set Element Attributres
	ml_strg = 'mai'
	+ 'lto'
	+ ':nps_webra'
	+ 'ngers'
	+ '@'
	+ 'np'
	+ 's.go'
	+ 'v';
	the_a.href = ml_strg+'?subject=Feedback About ' + activity_name;
	the_img.src = site_root + 'images/email_question.gif';
	the_img.className = 'picLeftNoMargin';
	
	//Append 'em
	the_li.appendChild(the_a);
	the_a.appendChild(the_img);
	the_a.appendChild(the_text);
	
	document.getElementById('moreInfoRight').appendChild(the_li);
}



var form1_1 = new Array('can','run','ship','sand'); //,'deck'
var form1_2 = new Array('ask','Line','wind','hold','leaf');
var form1_3 = new Array('salt','key','pot','fur','spark');


var form2_1 = new Array('honor','habitat','hunt','trust','preserve');
var form2_2 = new Array('Hoist','case','study','cover'); //,'view'
var form2_3 = new Array('survive','Path','place','change','travel');

var form3_1 = new Array('wonder','manage','leader','choice','rights');
var form3_2 = new Array('protect','word','books','layer'); //,'pride'
var form3_3 = new Array('volt','glare','school','story'); // 'walls'

var form1_0 = new Array('salmon','eagle','bear');
var form2_0 = new Array('fox','rabbit','moose');
var form3_0 = new Array('horse','buffalo','owl');



//Quickfill!! Click on the '.....'!!
function fillFields(level_number,tour_number) {
	var pw_form = document.getElementById('pwForm');
	var pw_inputs = pw_form.getElementsByTagName('INPUT');
	
	var check_these = eval('form'+level_number+'_'+tour_number);	
	
	for (var aa=0; aa<check_these.length; aa++) {
		pw_inputs[aa].value = check_these[aa];
	}
}

function passportForm(level_number,tour_number) {
	
	var pw_form = document.getElementById('pwForm');
	var pw_inputs = pw_form.getElementsByTagName('INPUT');
	
	var check_these = eval('form'+level_number+'_'+tour_number);
	var all_correct = 0;
	
	
	for (var aa=0; aa<check_these.length; aa++) {
		for (var bb=0; bb<pw_inputs.length; bb++) {
		//alert(pw_inputs[bb].value.toLowerCase()+' == '+check_these[aa]);
			if (pw_inputs[bb].value.toLowerCase() == check_these[aa].toLowerCase()) {
				all_correct++;
			}
		}				
	}
	
	if (all_correct == check_these.length) {
		return true;
	} else {
		var error_message = 'Sorry, one or more of your Secret Words is incorrect. Please review and try again.  \n\n'
		+ 'Common errors are: \n'		
		+ '- Misspelling \n'
		+ '- Missing Words \n'
		+ '- Duplicated Words \n'
		+ '- Entering Secret Words from other tours \n';

		alert(error_message);
		return false;
	}	
}







// The next two functions (attempt to) position the sponsors' logos at the lower left of the page
// They aren't being used right now
function getWindowHeight() {
	var windowHeight=0;
	
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
		
	} else if (document.documentElement && document.documentElement.clientHeight) {
		windowHeight = document.documentElement.clientHeight;
		
	} else if (document.body && document.body.clientHeight) {
		windowHeight=document.body.clientHeight;
	}
	return windowHeight;
}

function setFooter() {		
	//var windowHeight = getWindowHeight();
	alert(getWindowHeight());

	var footerElement = document.getElementById('sponsorsLogos');
	var footerHeight = footerElement.offsetHeight;
	
	footerElement.style.position = 'absolute';
	footerElement.style.top = (getWindowHeight() - footerHeight) + 'px';

}









//  Added by Vijay for older HTML Name the Park
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

