// Global image preloader
if (document.images) {
	var sRoot = "assets/images/";

	img01on = new Image();
	img01off = new Image();
	img02on = new Image();
	img02off = new Image();
	img03on = new Image();
	img03off = new Image();
	img04on = new Image();
	img04off = new Image();
	img05on = new Image();
	img05off = new Image();
	img06on = new Image();
	img06off = new Image();
	img07on = new Image();
	img07off = new Image();
	
	
	img01on.src = sRoot + "AboutBover.gif";
	img01off.src = sRoot + "AboutB.gif";
	img02on.src = sRoot + "BirthdayBover.gif";
	img02off.src = sRoot + "BirthdayB.gif";
	img03on.src = sRoot + "EventBover.gif";
	img03off.src = sRoot + "EventB.gif";
	img04on.src = sRoot + "PricingBover.gif";
	img04off.src = sRoot + "PricingB.gif";
	img05on.src = sRoot + "PhotosBover.gif";
	img05off.src = sRoot + "PhotosB.gif";
	img06on.src = sRoot + "EmploymentBover.gif";
	img06off.src = sRoot + "EmploymentB.gif";
	img07on.src = sRoot + "HomeBover.gif";
	img07off.src = sRoot + "HomeB.gif";
}

// Function to 'activate' images.
function imgOn(imgName) {
	if (document.images && !(navigator.appName.indexOf("Explorer") > 0 && navigator.appVersion.indexOf("3.0") == 0)) {
		document[imgName].src = eval(imgName + "on.src");
	}
}

// Function to 'deactivate' images.
function imgOff(imgName) {
	if (document.images && !(navigator.appName.indexOf("Explorer") > 0 && navigator.appVersion.indexOf("3.0") == 0)) {
		document[imgName].src = eval(imgName + "off.src");
	}
}

// Drop Down Meu Functionality Start
/* Editting needed here if adding more links to global navigation */
// Contents for About Us menu
var menu1=new Array()
menu1[0]='<a href="hours_operation.html"><span class="dropmenusubnav">Hours of Operation</span></span></a>'
menu1[1]='<a href="contact_us.html"><span class="dropmenusubnav">Contact Us</span></a>'
menu1[2]='<a href="directions.html"><span class="dropmenusubnav">Directions</span></a>'
menu1[3]='<a href="faq.html"><span class="dropmenusubnav">FAQ</span></a>'
menu1[4]='<a href="missions.html"><span class="dropmenusubnav">Missions</span></a>'
menu1[5]='<a href="fieldmap.html"><span class="dropmenusubnav">Field Map</span></a>'
menu1[6]='<a href="http://ui.constantcontact.com/d.jsp?m=1101462388170&p=oi" target="_blank"><span class="dropmenusubnav">Mailing List</span></a>'
menu1[7]='<a href="testimonials.html"><span class="dropmenusubnav">Testimonials</span></a>'
menu1[8]='<a href="forms/Brochure.pdf" target="blank"><span class="dropmenusubnav">Brochure</span></a>'

// Contents for Brithday Parties menu
var menu2=new Array()
menu2[0]='<a href="birthdays.html"><span class="dropmenusubnav">Birthday Packages</span></a>'
menu2[1]='<a href="addons.html"><span class="dropmenusubnav">Add Ons</span></a>'

// Contents for Event Planning menu
var menu3=new Array()
menu3[0]='<a href="birthdays.html"><span class="dropmenusubnav">Birthday Packages</span></a>'
menu3[1]='<a href="http://www.combatsportsteam.com" target="blank"><span class="dropmenusubnav">Corporate Team Building</span></a>'
menu3[2]='<a href="inflatable.html"><span class="dropmenusubnav">Off-Site Inflatable Field</span></a>'
menu3[3]='<a href="summercamp.html"><span class="dropmenusubnav">Summer Camp</span></a>'
menu3[4]='<a href="youthcamp.html"><span class="dropmenusubnav">Youth Group</span></a>'
menu3[5]='<a href="event.html"><span class="dropmenusubnav">Upcoming Events</span></a>'

// Contents for Pricing menu
var menu4=new Array()
menu4[0]='<a href="individual.html"><span class="dropmenusubnav">Individual Rate</span></a>'
menu4[1]='<a href="birthdays.html"><span class="dropmenusubnav">Birthday Packages</span></a>'
menu4[2]='<a href="group.html"><span class="dropmenusubnav">Group Rates</span></a>'
menu4[3]='<a href="addons.html"><span class="dropmenusubnav">Add Ons</span></a>'
menu4[4]='<a href="foodpackage.html"><span class="dropmenusubnav">Food Packages</span></a>'

// Contents for Photos menu
var menu5=new Array()
//menu5[0]='<a href="video.html"><span class="dropmenusubnav">Video</span></a>'
menu5[0]='<a href="photo_gallery.html"><span class="dropmenusubnav">Photos</span></a>'
menu5[1]='<a href="gallery/equipment/index.htm" target="blank"><span class="dropmenusubnav">Equipment</span></a>'
menu5[2]='<a href="gallery/field/index.htm" target="blank"><span class="dropmenusubnav">Field Photos</span></a>'
menu5[3]='<a href="video.html" target="blank"><span class="dropmenusubnav">See Our Videos</span></a>'
menu5[4]='<a href="video/outdoor_field_project_01HD.wmv" target="blank"><span class="dropmenusubnav">Take it Outside</span></a>'
menu5[5]='<a href="video/Newton_Final.wmv" target="blank"><span class="dropmenusubnav">Indoors Rocks</span></a>'



// Contents for Employment menu
var menu6=new Array()
menu6[0]='<a href="now_hiring.html"><span class="dropmenusubnav">Now Hiring</span></a>'
menu6[1]='<a href="company/index.html"><span class="dropmenusubnav">Employee Info</span></a>'

// Contents for Home (BLANK) menu
var menu7=new Array()

// Drop Down Meu Functionality End

// No further editting needed here
// Default menu width		
var menuwidth='165px' 

// No further editting needed here
// Menu background color
var menubgcolor='#663399' 

// No further editting needed here
// Menu disappear speed onMouseout (in miliseconds) 
var disappeardelay=250

// No further editting needed here
// Hide menu when user clicks within menu?
var hidemenu_onclick="yes" 

// No further editting needed here
var ie4=document.all
var ns6=document.getElementById&&!document.all

// No further editting needed here
if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

// No further editting needed here
function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

// No further editting needed here
function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

// No further editting needed here
function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

// No further editting needed here
function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

// No further editting needed here
function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}

// No further editting needed here
function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)
/* SAM ADDED THIS - START */
// imgOn('img01'); // To turn mouseover effect on for About Us button
/* SAM ADDED THIS - END */

// No further editting needed here
if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

// No further editting needed here
return clickreturnvalue()
}

// No further editting needed here
function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

// No further editting needed here
function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

// No further editting needed here
function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

// No further editting needed here
function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
/* Editting needed here if adding more links to global navigation */
imgOff('img01'); // To turn mouseover effect off for buttons
imgOff('img02');
imgOff('img03');
imgOff('img04');
imgOff('img05');
imgOff('img06');
imgOff('img07');
// imgOff('img08'); // This would be needed if adding a 6th item to the global navigation
/* end of editting */
}

// No further editting needed here
function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay);
}

// No further editting needed here
function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

// No further editting needed here
if (hidemenu_onclick=="yes")
document.onclick=hidemenu

/* Editting needed here if adding more links to global navigation */
function allimg1(){
imgOn('img01');
imgOff('img02');
imgOff('img03');
imgOff('img04');
imgOff('img05');
imgOff('img06');
imgOff('img07');
// imgOff('img08'); // This would be needed if adding a 6th item to the global navigation
//window.status='> Home';
return true;
}

function allimg2(){
imgOff('img01');
imgOn('img02');
imgOff('img03');
imgOff('img04');
imgOff('img05');
imgOff('img06');
imgOff('img07');
// imgOff('img06'); // This would be needed if adding a 6th item to the global navigation
//window.status='> About Us'; 
return true;
}

function allimg3(){
imgOff('img01');
imgOff('img02');
imgOn('img03');
imgOff('img04');
imgOff('img05');
imgOff('img06');
imgOff('img07');
// imgOff('img06'); // This would be needed if adding a 6th item to the global navigation
//window.status='> Birthday Parties'; 
return true;
}

function allimg4(){
imgOff('img01');
imgOff('img02');
imgOff('img03');
imgOn('img04');
imgOff('img05');
imgOff('img06');
imgOff('img07');
// imgOff('img06'); // This would be needed if adding a 6th item to the global navigation
//window.status='> Event Planning'; 
return true;
}

function allimg5(){
imgOff('img01');
imgOff('img02');
imgOff('img03');
imgOff('img04');
imgOn('img05');
imgOff('img06');
imgOff('img07');
// imgOff('img06'); // This would be needed if adding a 6th item to the global navigation
//window.status='> Pricing'; 
return true;
}

function allimg6(){
imgOff('img01');
imgOff('img02');
imgOff('img03');
imgOff('img04');
imgOff('img05');
imgOn('img06');
imgOff('img07');
// imgOff('img06'); // This would be needed if adding a 6th item to the global navigation
//window.status='> PhotosVideo'; 
return true;
}

function allimg7(){
imgOff('img01');
imgOff('img02');
imgOff('img03');
imgOff('img04');
imgOff('img05');
imgOff('img06');
imgOn('img07');
// imgOff('img06'); // This would be needed if adding a 6th item to the global navigation
//window.status='> PhotosVideo'; 
return true;
}
/* end of editting */