<!--
//-----------------Floating Objects-----------------------------
var menu;
var nav;
var detail;
var isDetail = 0;
var theTop = 0;
var old = theTop;
var MenuDie = 0;
var actHover = '';
var goingSomewhere = 0;
var menuInited = 0;
var actSub = 0;

// Move Layer section
var YPOS = 0;

IE4 = (document.all) ? 1 : 0;
NS4 = (document.layers) ? 1 : 0;
ver4 = (IE4 || NS4) ? 1 : 0;
var agt=navigator.userAgent;
var bad=false;
var isMac = 0;
if ((agt.indexOf("Mac")!=-1)) {
  isMac = 1;
  if (IE4) {bad=true;}
}

function getObj(objectId)
{
    if(document.getElementById && document.getElementById(objectId)) {
	this.obj = document.getElementById(objectId);
	this.style = document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	this.obj = document.all(objectId);
	this.style = document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	this.obj = document.layers[objectId];
	this.style = document.layers[objectId];
    } else {
	return false;
    }
}

function showMenu(whichMenu) {
	if (menuInited == 0) {
		actSub = whichMenu;
	} else {
		actHover = whichMenu;
		if (MenuDie != 0) {
			clearTimeout(MenuDie);
			MenuDie = 0;
		}
		for (i=1; i<7; i++) {
			nav[i].style.visibility = 'hidden';
			main[i].obj.className = '';
		}
		nav[Number(whichMenu)].style.visibility = 'visible';
		main[Number(whichMenu)].obj.className = 'mnOver';
	}
}

function menuKill(wMenu) {
	if (menuInited == 0) {
		actSub = 0;
	} else {
		if (theSect != wMenu) {
			if (MenuDie != 0) {
				clearTimeout(MenuDie);
				MenuDie = 0;
			}
			MenuDie = setTimeout('killMenu("'+wMenu+'")',1200);
		}
	}
}

function killMenu(whichMenu) {
	if (theSect != whichMenu) {
		nav[Number(whichMenu)].style.visibility = 'hidden'
		main[Number(whichMenu)].obj.className = '';
	}
	nav[Number(theSect)].style.visibility = 'visible'
	main[Number(theSect)].obj.className = 'mnOver';
	clearTimeout(MenuDie);
	MenuDie = 0;
}

function initMenu()
{
	shopCartLinkObj = new getObj('shopCartLink');
	
	buildScroller();
	
	nav = new Array();
	main = new Array();
	for (i=1; i<7; i++) {
		nav[i] = new getObj('sub'+i);
		main[i] = new getObj('mn'+i);
	}
	menuInited = 1;
	if (actSub != 0) {
		showMenu(actSub);
	}
}

function showShopCartLink(){
	shopCartLinkObj.style.visibility = 'visible';
	shopCartLinkObj.style.display = 'block'
}

function showShoppingCart(){
	myWindow = window.open('booking/book_3.php','bookonline','status=yes,width=680,height=600,scrollbars=1,resizable=1');
	myWindow.focus();
}




function MM_openBrWindow(theURL,winName,features) { //v2.0
	myWindow = window.open(theURL,winName,features);
	myWindow.focus();
}

function openImg(wID){
	myWindow = window.open('popup_img.php?id='+wID+'','popupimg','status=yes,width=200,height=200,scrollbars=1');
	myWindow.focus();
}

function openAudio(wFile){
	myWindow = window.open('audio_player.php?file='+wFile, 'audioPlayer', 'resizable=0,width=300,height=84,scrollbars=0');	
	myWindow.focus();
}

function openSubscribe(){
	myWindow = window.open('subscribe.php','popupform','status=yes,width=540,height=450,scrollbars=1');
	myWindow.focus();
}

function showPrivacy(){
	myWindow = window.open('/privacy.php','popuppriv','status=yes,width=540,height=450,scrollbars=1');
	myWindow.focus();
}

function showPurchasing(){
	myWindow = window.open('/purchasing.php','popuppriv','status=yes,width=540,height=450,scrollbars=1');
	myWindow.focus();
}

function showTerms(){
	myWindow = window.open('/terms.php','popuppriv','status=yes,width=540,height=450,scrollbars=1');
	myWindow.focus();
}

function bookOnline(wId){
	myWindow = window.open('booking/book_1.php?id='+wId,'bookonline','status=yes,width=680,height=600,scrollbars=1,resizable=1');
	myWindow.focus();
}

function openStat(wID, showLinks){
	if (showLinks == 1) {
		showLnks = "&sL=1";
	} else {
		showLnks = "";
	}
	myWindow = window.open('popup_static.php?id='+wID+showLnks,'popupstatic','status=yes,width=524,height=400,scrollbars=1');
	myWindow.focus();
}

function openStatW(wID){
	myWindow = window.open('popup_static.php?id='+wID+'&w=1','popupstatic','status=yes,width=524,height=400,scrollbars=1');
	myWindow.focus();
}

function openDyn(wID){
	myWindow = window.open('popup_dynamic.php?id='+wID+'','popupdynamic','status=yes,width=524,height=400,scrollbars=1');
	myWindow.focus();
}

function fileLinks() {
    var fileLink;
    if (document.getElementsByTagName('a')) {
        for (var i = 0; (fileLink = document.getElementsByTagName('a')[i]); i++) {
            if (fileLink.href.indexOf('.pdf') != -1) {
                //fileLink.setAttribute('target', '_blank');
                fileLink.className = 'pdfLink';
            }
            if (fileLink.href.indexOf('.doc') != -1) {
                //fileLink.setAttribute('target', '_blank');
                fileLink.className = 'docLink';
            }
            if (fileLink.href.indexOf('.zip') != -1) {
                //fileLink.setAttribute('target', '_blank');
                fileLink.className = 'zipLink';
            }
            if (fileLink.href.indexOf('.mp3') != -1) {
                //fileLink.setAttribute('target', '_blank');
				tmpHref = fileLink.href;
				if (tmpHref.indexOf('/Resources/') > -1) {
					tmpHref = tmpHref.substring(tmpHref.indexOf('/Resources/'), tmpHref.indexOf('.mp3'));
				}
                fileLink.href = "javascript:openAudio('"+tmpHref+"')"; 
                fileLink.target = ""; 
            }
			if (fileLink.name != "") {
				fileLink.id = fileLink.name;
			}
			if (fileLink.href.indexOf('#') != -1 || fileLink.href.indexOf('&a=') != -1) {
				currPage = document.location.href;
				
				if (currPage.indexOf('#') != -1) {
					currPage = currPage.substring(0, currPage.indexOf('#'));
				}
				if (currPage.indexOf('&a=') != -1) {
					currPage = currPage.substring(0, currPage.indexOf('&a='));
				}
				if (currPage.substring(currPage.length - 1) == '/') {
					currPage = currPage + '?page=1';
				}
				if (fileLink.href.indexOf('&') > -1) {
					linkPage = fileLink.href.substring(0, fileLink.href.indexOf('&'));
				} else {
					linkPage = fileLink.href;
				}
				if (linkPage == currPage) {
					if (fileLink.href.indexOf('#') != -1) {
						anchorID = fileLink.href.substring(fileLink.href.indexOf('#')+1);
					} else {
						anchorID = fileLink.href.substring(fileLink.href.indexOf('&a=')+3);
					}
					fileLink.href = "#";
					//fileLink.onClick = "dw_scrollObj.scrollToAnchor('"+anchorID+"', 'wn', 'lyr1'); return false;";
					//fileLink.onclick = "alert('"+anchorID+"')";
					fileLink.onclick = Function("dw_scrollObj.scrollToAnchor('"+anchorID+"', 'wn', 'lyr1'); return false;");
				}
			}
        }
    }
}


function resizeScript(){
	if (window.innerHeight)
	{
		pos = window.pageYOffset
		scrHt = window.innerHeight
	}
	else if (document.documentElement && document.documentElement.scrollTop)
	{
		pos = document.documentElement.scrollTop
		scrHt = document.documentElement.offsetHeight
	}
	else if (document.body)
	{
		pos = document.body.scrollTop
		if (isMac) {
			scrHt = document.body.clientHeight
		} else {
			scrHt = document.body.offsetHeight
		}
	}
	
	if (document.layers)
	{
		contHt = contDiv.style.clip.bottom;
	}
	else if (document.getElementById || document.all)
	{
		contHt = contDiv.obj.offsetHeight;
	}
	contSecHt = (scrHt - 153);
	
	scrollDiv.style.height = holdDiv.style.height = contSecHt + 'px';
	wnDiv.style.height = (contSecHt - 20) + 'px';
	
	if (isWide == 1) {
		extWidth = 140;
	} else {
		extWidth = 0;
	}
	scrollDiv.style.left = '' + (427 + extWidth) + 'px';
	holdDiv.style.left = '60px';
	loadDiv.style.visibility = 'hidden';
	upDiv.style.top = (contSecHt - 25) + 'px';
	dnDiv.style.top = (contSecHt - 12) + 'px';
	trkDiv.style.height = (contSecHt - 26) + 'px'; 
	
	if ((contHt + 20) > contSecHt) {
		scrollDiv.style.visibility = 'visible';
	} else {
		scrollDiv.style.visibility = 'hidden';
		if ((contHt + 80) > contSecHt) {
			holdDiv.style.height = (scrHt - 153) + 'px';
		} else {
			holdDiv.style.height = contHt + 80 + 'px';
		}
	}

	initScrollLayer();
	
}

function buildScroller() {	
	holdDiv = new getObj('hold');
	wnDiv = new getObj('wn');
	scrollDiv = new getObj('scrollLinks');
	loadDiv = new getObj('load');
	upDiv = new getObj('up');
	dnDiv = new getObj('down');
	trkDiv = new getObj('track');
	contDiv = new getObj('lyr1');
	resizeScript();
	
	fileLinks();
	
	initScrollLayer();
	
	currPage = document.location.href;
	if (currPage.indexOf('&a=') != -1) {
		theAnchor = currPage.substring(currPage.indexOf('&a=')+3);
		if (theAnchor != "") {
			if (scrollDiv.style.visibility == 'visible') {
				dw_scrollObj.scrollToAnchor(theAnchor, 'wn', 'lyr1');
			}
		}
	}
	
	
	window.onresize = function(){ resizeScript(); };
}




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_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { 
  test=args[i+2]; val=MM_findObj(args[i]); myName=args[i+1];
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { 
	    p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+myName+' must contain an e-mail address.\n';
      } else if (test!='R') {
	    num = parseFloat(val);
        if (isNaN(val)) errors+='- '+myName+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) {
		  p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+myName+' must contain a number between '+min+' and '+max+'.\n';
        } 
	  } 
	} else if (test.charAt(0) == 'R') errors += '- '+myName+' is required.\n'; 
	} 
  } 
  if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}





/** This is high-level function.
 * It must react to delta being more/less than zero.
 */
function handle(delta) {
        if (delta < 0)
			dw_scrollObj.scrollBy('wn', 0, -200, 100);
        else
			dw_scrollObj.scrollBy('wn', 0, 200, 100);
}

/** Event handler for mouse wheel event.
 */
function wheel(event){
        var delta = 0;
        if (!event) /* For IE. */
                event = window.event;
        if (event.wheelDelta) { /* IE/Opera. */
                delta = event.wheelDelta/120;
                /** In Opera 9, delta differs in sign as compared to IE.
                 */
                if (window.opera)
                        delta = -delta;
        } else if (event.detail) { /** Mozilla case. */
                /** In Mozilla, sign of delta is different than in IE.
                 * Also, delta is multiple of 3.
                 */
                delta = -event.detail/3;
        }
        /** If delta is nonzero, handle it.
         * Basically, delta is now positive if wheel was scrolled up,
         * and negative, if wheel was scrolled down.
         */
        if (delta)
                handle(delta);
        /** Prevent default actions caused by mouse wheel.
         * That might be ugly, but we handle scrolls somehow
         * anyway, so don't bother here..
         */
        if (event.preventDefault)
                event.preventDefault();
	event.returnValue = false;
}

/** Initialization code. 
 * If you use your own event management code, change it as required.
 */
if (window.addEventListener)
        /** DOMMouseScroll is for mozilla. */
        window.addEventListener('DOMMouseScroll', wheel, false);
/** IE/Opera. */
window.onmousewheel = document.onmousewheel = wheel;






//-->