// JavaScript Document


/*---------------abseiling description goes here --------------------*/
var Title1 = "Abseiling";
var Description1 = "We have a 6-metre high purpose-built abseiling tower.  A qualified staff member will run abseiling for your group.";

/*--------------abseiling image goes here-----------------*/

var Picture1 = "images/facilities/abseiling.jpg";






/*---------------Auditorium description goes here --------------------*/
var Title2 = "Auditorium";
var Description2 = "Our large indoor gymnasium has a full-sized basketball court, or can be set up for four badminton courts, a full volleyball court, indoor soccer, indoor hockey or indoor bowls.  The auditorium can seat over 900 people, and also has a mezzanine level and a stage.";

/*--------------Auditorium image goes here-----------------*/

var Picture2 = "images/facilities/audi.jpg";






/*---------------aviary description goes here --------------------*/
var Title3 = "Aviary";
var Description3 = "The Aviary has a variety of birds and even a wallaby!  Enjoy a relaxing stroll through the in-flight area.";

/*--------------aviary image goes here-----------------*/

var Picture3 = "images/facilities/aviary.jpg";






/*---------------cabins description goes here --------------------*/
var Title4 = "Cabins";
var Description4 = "Each cabin sleeps 12 comfortably, on double bunks with foam mattresses. Ablutions are located at the end of each cabin block. Cabins are heated in the winter.";

/*--------------cabins image goes here-----------------*/

var Picture4 = "images/facilities/cabins.jpg";






/*---------------canoes description goes here --------------------*/
var Title5 = "Canoes";
var Description5 = "Canoe on the Mangawhero stream in one of our 12 canoes.";

/*--------------canoes image goes here-----------------*/

var Picture5 = "images/facilities/canoe.jpg";






/*---------------Conference description goes here --------------------*/
var Title6 = "Conference Centre";
var Description6 = "The Totara Springs conference centre is fully self-contained, so guests receive the level of service they expect. It has its own dining room, lounge, and large lecture theatre that can seat up to 350 people.";

/*--------------conference image goes here-----------------*/

var Picture6 = "images/facilities/conference.jpg";






/*---------------dining hall description goes here --------------------*/
var Title7 = "Dining Hall";
var Description7 = "The dining hall can seat up to 450 people for meals together, prepared by our catering team and served by our Totara Springs staff off our serveries. All cutlery and crockery is provided and washed and sterilized by Totara Springs staff at the end of the meal.";

/*--------------dining image goes here-----------------*/

var Picture7 = "images/facilities/dining.jpg";






/*---------------hydroslide description goes here --------------------*/
var Title8 = "HydroSlide";
var Description8 = "Our 138-metre long hydroslide is rumoured to be the second longest warm water slide in the southern hemisphere! The hydroslide is fed by our warm water spring and winds its way through the native bush.";

/*--------------hydroslide image goes here-----------------*/

var Picture8 = "images/facilities/hydroslide.jpg";






/*---------------kowhai lodge description goes here --------------------*/
var Title9 = "Kowhai Lodge";
var Description9 = "<ul><li>25 rooms</li><li>Lounge</li><li>Microwave</li><li>Refrigerator</li><li>Television</li><li>Electric Jug</li><li>Tea/Coffee</li>";

/*--------------kowhai image goes here-----------------*/

var Picture9 = "images/facilities/kowhai.jpg";






/*---------------motels description goes here --------------------*/
var Title10 = "Motels";
var Description10 = "Each of our 27 motel units (10 upstairs and 17 downstairs), located next to the conference centre, have their own refrigerator, electric jug, and coffee and tea is available to you. Linen is provided, and each motel has at least 2 beds, while some have trundler beds, and / or bunk beds.";

/*--------------motels image goes here-----------------*/

var Picture10 = "images/facilities/motel.jpg";






/*---------------bush description goes here --------------------*/
var Title11 = "Native Bush";
var Description11 = "Enjoy a stroll through our native bush - or, if you're feeling daring, have a jump in one of our swimming holes, either the junior or senior grotto.";

/*--------------bush image goes here-----------------*/

var Picture11 = "images/facilities/grotto.jpg";






/*---------------office description goes here --------------------*/
var Title12 = "Office";
var Description12 = "The office is the administrative centre of camp, and can be reached for bookings, payment, change for vending machines, or for general information. If you require any further information, please <a style=\"color:#666666;\" href=\"contact.html\">contact</a> us.";

/*--------------office image goes here-----------------*/

var Picture12 = "images/facilities/office.jpg";






/*---------------pool description goes here --------------------*/
var Title13 = "Pool";
var Description13 = "One of the highlights of camp, the warm spring-fed pool is a great place to relax, and is just the right temperature to enjoy a swim - especially nice in the winter! The pool is constantly being filled with filtered, chlorinated warm water, refilling itself every 5 hours. Attached as well are changing sheds with ablutions, and a drying room to hang wet items on rainy days.";

/*--------------pool image goes here-----------------*/

var Picture13 = "images/facilities/pool.jpg";






/*---------------rimu seminar room description goes here --------------------*/
var Title14 = "Rimu Seminar Room";
var Description14 = "Suitable for small seminars & seats up to 60 people. ";

/*--------------rimu image goes here-----------------*/

var Picture14 = "images/facilities/rimu.jpg";






/*---------------sports description goes here --------------------*/
var Title15 = "Sports Fields";
var Description15 = "Our fields are always mown and available for your use - our hockey field (in front of the Auditorium), softball diamond, soccer field, rugby field (either smaller for younger participants or full-sized for challenge matches) - and can also be divided into multiple touch rugby fields.  A croquet green can also be made available if requested in advance.";

/*--------------sports image goes here-----------------*/

var Picture15 = "images/facilities/sports.jpg";






/*---------------swimming description goes here --------------------*/
var Title16 = "Swimming Holes";
var Description16 = "Enjoy a stroll through our native bush - or, if you're feeling daring, have a jump in one of our swimming holes, either the junior or senior grotto.";

/*--------------swimming image goes here-----------------*/

var Picture16 = "images/facilities/grotto.jpg";
































/*---------------------- do not alter below this line--------------------------*/
var J = jQuery.noConflict();

//this function will only show the selected facilites, the picture variable decided whether or not a picture is wanted
function changeCat(tab, picture) {
	
	try {
		var divHeight = document.getElementById('loader').offsetHeight;
	} catch (e) {
		//do nothing
	}
	
	
	document.getElementById('catDescript').innerHTML = "<p>"+eval("Description"+tab)+"</p><br /><div id=\"loader\" class=\"loading\"></div>";
	document.getElementById('catTitle').innerHTML = eval("Title"+tab);
	document.getElementById('catTitle').style.display = "block";
	
	if (picture == "no") {
		document.getElementById('loader').style.height = "0px";
		document.getElementById('loader').innerHTML = "";
	} else {
		document.getElementById('loader').style.height = divHeight + "px";
		document.getElementById('loader').innerHTML = "";
		loadImage(tab, divHeight);
	}
}

//Function to show all facilities
function showAll() {
	document.getElementById('catDescript').innerHTML = "";
	document.getElementById('catTitle').style.display = "none";
	
	
	for(var i=1; i<=16;i++) {
		var imageDiv = "<div id=\"loader" + i + "\" class=\"loading\"></div>";
		var insertHTML = "<h1 id=\"catTitle\">"+eval("Title"+i)+"</h1><p>"+eval("Description"+i)+"</p>" + imageDiv;
		document.getElementById('catDescript').innerHTML = document.getElementById('catDescript').innerHTML + insertHTML;
		
		loadAllImages(i);
	
	}	
}


//this function gets call when the show all is wanted
function loadAllImages(tab) {
	var img = new Image();
	J(img).load(function () {			  
		if (BrowserDetect.browser == "Safari") {
			J(this).css('display', 'none'); // .hide() doesn't work in Safari when the element isn't on the DOM already
		} else {
			J(this).hide();
		}
		J('#loader'+tab).removeClass('loading').append(this);
		document.getElementById("loader"+tab).style.height = "auto";
		J(this).fadeIn('slow');
	}).error(function () {
		// notify the user that the image could not be loaded.			
		//document.getElementById("loader"+tab).innerHTML = "<p>Sorry the image could be loaded. Please try again</p>";
	}).attr('src', eval("Picture"+tab));
}









function loadImage(tab, divHeight, whichDiv) {
	var img = new Image();
	J(img).load(function () {
		if (BrowserDetect.browser == "Safari") {
			J(this).css('display', 'none'); // .hide() doesn't work in Safari when the element isn't on the DOM already
		} else {
			J(this).hide();
		}
		J('#loader').removeClass('loading').append(this);
	document.getElementById('loader').style.height = "auto";
		J(this).fadeIn('slow');
	}).error(function () {
		// notify the user that the image could not be loaded.			
		document.getElementById('loader').innerHTML = "<p>Sorry the image could be loaded. Please try again</p>";
	}).attr('src', eval("Picture"+tab));
}