function toggleDiv (divID) {
	thisDiv = document.getElementById(divID);
	if(thisDiv.style.display == "none"){
		thisDiv.style.display = "block";
	} else {
		thisDiv.style.display = "none";
	}
}
function toggleTopDiv () {
	thisDiv = document.getElementById("top-tab-content");
	thisButton = document.getElementById("top-tab-nav-button");
	if(thisDiv.style.display == "none"){
		thisDiv.style.display = "block";
		thisButton.style.backgroundImage = "url(/skins/new_tour/images/arrow-up.gif)";
	} else {
		thisDiv.style.display = "none";
		thisButton.style.backgroundImage = "url(/skins/new_tour/images/arrow-down.gif)";
	}
}
function toggleBottomDiv () {
	thisDiv = document.getElementById("bottom-tab-content");
	thisButton = document.getElementById("bottom-tab-nav-button");
	if(thisDiv.style.display == "none"){
		thisDiv.style.display = "block";
		thisButton.style.backgroundImage = "url(/skins/new_tour/images/arrow-down.gif)";
	} else {
		thisDiv.style.display = "none";
		thisButton.style.backgroundImage = "url(/skins/new_tour/images/arrow-up.gif)";
	}
}
function showPhotos () {
	thisDiv = document.getElementById("bottom-tab-content");
	thisButton = document.getElementById("bottom-tab-nav-button");
	photosDiv = document.getElementById('bottom-tab-photos');
	toursDiv = document.getElementById('bottom-tab-tours');
	featuresDiv = document.getElementById('bottom-tab-features');
	//thetour = document.getElementById('tour-body-tour');
	//thephoto = document.getElementById('tour-body-photo');
	
	thisDiv.style.display = "block";
	thisButton.style.backgroundImage = "url(/skins/new_tour/images/arrow-down.gif)";
	photosDiv.style.display = "block";
	toursDiv.style.display = "none";
	featuresDiv.style.display = "none";
	//thetour.style.display = "none";
	//thephoto.style.display = "block";
	loadPhoto('slideshow');
}
function showTours () {
	thisDiv = document.getElementById("bottom-tab-content");
	thisButton = document.getElementById("bottom-tab-nav-button");
	photosDiv = document.getElementById('bottom-tab-photos');
	toursDiv = document.getElementById('bottom-tab-tours');
	featuresDiv = document.getElementById('bottom-tab-features');
	//thetour = document.getElementById('tour-body-tour');
	//thephoto = document.getElementById('tour-body-photo');
	
	thisDiv.style.display = "block";
	thisButton.style.backgroundImage = "url(/skins/new_tour/images/arrow-down.gif)";
	photosDiv.style.display = "none";
	toursDiv.style.display = "block";
	featuresDiv.style.display = "none";
	//thetour.style.display = "block";
	//thephoto.style.display = "none";
	loadTour(0);
}
function showFeatures () {
	thisDiv = document.getElementById("bottom-tab-content");
	thisButton = document.getElementById("bottom-tab-nav-button");
	photosDiv = document.getElementById('bottom-tab-photos');
	toursDiv = document.getElementById('bottom-tab-tours');
	featuresDiv = document.getElementById('bottom-tab-features');
	
	thisDiv.style.display = "block";
	thisButton.style.backgroundImage = "url(/skins/new_tour/images/arrow-down.gif)";
	photosDiv.style.display = "none";
	toursDiv.style.display = "none";
	featuresDiv.style.display = "block";
}
function loadTour (tourSrc) {
	pauseSlideshow('true');
	themap = document.getElementById('tour-body-map');
	thetour = document.getElementById('tour-body-tour');
	thephoto = document.getElementById('tour-body-photo');
	thebutton = document.getElementById('bottom-tab-nav-button');
	//theX = document.getElementById('bottom-tab-nav-close');
	//theX.style.display = "block";
	themap.style.display = "none";
	thetour.style.display = "block";
	thephoto.style.display = "none";
	thebutton.style.display = "none";
}
function closeTour (tourSrc) {
	pauseSlideshow('true');
	thetour = document.getElementById('tour-body-tour');
	thephoto = document.getElementById('tour-body-photo');
	thebutton = document.getElementById('bottom-tab-nav-button');
	thetour.style.display = "none";
	thephoto.style.display = "block";
	thebutton.style.display = "block";
}
function loadPhoto (imageSrc) {
	themap = document.getElementById('tour-body-map');
	thetour = document.getElementById('tour-body-tour');
	thephoto = document.getElementById('tour-body-photo');
	thebutton = document.getElementById('bottom-tab-nav-button');
	theclosebutton = document.getElementById('bottom-tab-nav-close');
	themap.style.display = "none";
	thetour.style.display = "none";
	thephoto.style.display = "block";
	thebutton.style.display = "block";
	theclosebutton.style.display = "none";
	if (imageSrc == 'slideshow') {
		pauseSlideshow('false');
	} else {
		pauseSlideshow('true');
		document.images.imgMain.src = imageSrc;
	}
}
function loadMap () {
	pauseSlideshow('true');
	topNavDiv = document.getElementById("top-tab-content");
	topNavButton = document.getElementById("top-tab-nav-button");
	themap = document.getElementById('tour-body-map');
	thetour = document.getElementById('tour-body-tour');
	thephoto = document.getElementById('tour-body-photo');
	thebutton = document.getElementById('bottom-tab-nav-button');
	theclosebutton = document.getElementById('bottom-tab-nav-close');
	topNavDiv.style.display = "none";
	topNavButton.style.backgroundImage = "url(/skins/new_tour/images/arrow-down.gif)";
	themap.style.display = "block";
	thetour.style.display = "none";
	thephoto.style.display = "none";
	thebutton.style.display = "block";
	theclosebutton.style.display = "none";
}
function PopUpWindow(url, hWind, nWidth, nHeight, nScroll, nMenuBar) {
	var cToolBar = "toolbar=0,location=0,directories=0,status=1,menubar=" + nMenuBar + ",scrollbars=" + nScroll + ",resizable=1,width=" + nWidth + ",height=" + nHeight;
	var winFlyer = window.open(url, hWind, cToolBar);  	
	var iwide = (screen.availWidth-nWidth)/2;
  	var itall = (screen.availHeight-nHeight)/2;
  	winFlyer.moveTo(iwide,itall);
  	winFlyer.focus();
}

function openCenter(surl,sname,iwidth,iheight,sscrollbars) {
    var bvalue = window.open(surl, sname, "height=" + iheight.toString() + ",innerHeight=" + iheight.toString() + ",width=" + iwidth.toString() + ",innerWidth=" + iwidth.toString() + ",menubar=no,toolbar=no,location=no,status=no,scrollbars=" + sscrollbars.toString() + ",resizable=no");
  	var iwide = (screen.availWidth-iwidth)/2;
  	var itall = (screen.availHeight-iheight)/2;
  	//bvalue.moveTo(iwide,itall);
	//bvalue.focus();
}

var SoundIsOn = "true";
var tContent = "";
function toggleSound (fileName) {
	if (SoundIsOn == "true") { 
		SoundOff();
	} else { 
		SoundOn(fileName);
	}
}

function SoundOn (fileName) {
	var loadFile = "music1.wma";
	if (fileName != null) loadFile = fileName;
	speakerDiv = document.getElementById("bottom-tab-nav-sound");
	tSound = document.getElementById("tourSound");
	tContent = "<EMBED SRC='sound/" + loadFile + "' AUTOSTART='True' HIDDEN='True' LOOP='true' />";
	tSound.innerHTML = tContent;
	SoundIsOn = "true";
	setCookie('sound',1,120);
	speakerDiv.style.backgroundImage = "url(/skins/new_tour/images/speaker-on.gif)";
}

function SoundOff () {
	speakerDiv = document.getElementById("bottom-tab-nav-sound");
	tSound = document.getElementById("tourSound");
	tContent = "";
	tSound.innerHTML = tContent;
	SoundIsOn = "false";
	setCookie('sound',0,120);
	speakerDiv.style.backgroundImage = "url(/skins/new_tour/images/speaker-off.gif)";
}

function LoadSound (fileName) {
	var soundState = getCookie('sound');
	if (soundState == 1) {
		SoundOn(fileName);
	} else {
		SoundOff();
	}
}
function setCookie(c_name,value,expiredays) { 
	var exdate = new Date(); 

	exdate.setDate(exdate.getDate() + expiredays); 

	document.cookie = c_name + "=" + escape(value) + ((expiredays==null) ? "" : ";expires=" + exdate.toGMTString());
}

function getCookie(c_name) { 
	if ( document.cookie.length>0 ) { 
		c_start=document.cookie.indexOf(c_name + "=");  
		if (c_start!=-1) {   
			c_start = c_start + c_name.length + 1;  
			c_end = document.cookie.indexOf(";",c_start);  
			if (c_end==-1) c_end = document.cookie.length;  
			return unescape(document.cookie.substring(c_start,c_end)); 
		}  
	} 
	return 1; 
}
