function openPictureWindow_Fever(imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
	var imgW=eval(imageWidth)
	var imgH=eval(imageHeight)
	var winwidth = eval(imgW + 50);
	var winheight = eval(imgH + 50);
	var fwinheight= eval(winheight + 50);
	newWindow = window.open("","newWindow","width="+winwidth+",height="+fwinheight+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#4B694A" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	newWindow.document.write('<link href="wades.css" rel="stylesheet" type="text/css">');
	newWindow.document.write('<link href="scroll.css" rel="stylesheet" type="text/css">');
	newWindow.document.write('<table width='+winwidth+' height="50"  border="0" cellpadding="8" cellspacing="0"><tr>');
    newWindow.document.write('<td width="75%" background="images/dark_green.gif" class="map_heading">'+alt+'</td>');
    newWindow.document.write('<td width="25%" align="right" background="images/dark_green.gif" class="map_heading"><span class="bodytxt">');
    newWindow.document.write('<input name="Submit" type="submit" class="button" title="Click here to close window" onClick="window.opener.focus()" value="Close Window">');
    newWindow.document.write('</span></td></tr></table>');
    newWindow.document.write('<table width="100%"  border="0" cellpadding="0" cellspacing="0"><tr>');
    newWindow.document.write('<td width="100%" height='+winheight+' align="center" valign="middle" bgcolor="#4B694A">');
    newWindow.document.write('<img src='+imageName+' class="image_border" width='+imageWidth+' height='+imageHeight+' alt='+alt+'></td>');
    newWindow.document.write('</tr></table>');
	newWindow.document.write('</body></html>');
	
	newWindow.focus();
    var imgW="";
	var imgH="";
	var winwidth="";
	var winheight="";
	var fwinheight="";
	newWindow.document.close();
}
function openPhotowin(imageName,imageWidth,imageHeight,alt,posLeft,posTop){
	var imgW=eval(imageWidth)
	var imgH=eval(imageHeight)
	var winwidth = eval(imgW + 50);
	var winheight = eval(imgH + 50);
	var fwinheight = eval(winheight + 50);
	var dest = ("Photo_window.php?imgname=" + imageName + "&vimgW=" + imgW + "&vimgH=" + imgH + "&desctipt=" + alt + "&innertabH=" + winheight)
	var dims = ("width=" + winwidth + ",height=" + fwinheight)
	MM_openBrWindow(dest,'',dims)
}

function domenu(id){
id.className="activeMenu"

}
function undomenu(id){
id.className="nonActive"
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
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_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 getHeight(){
	return window.innerHeight ? window.innerHeight :(document.getBoxObjectFor ? Math.min(document.documentElement.clientHeight, document.body.clientHeight) : ((document.documentElement.clientHeight != 0) ? document.documentElement.clientHeight : (document.body ? document.body.clientHeight : 0)));
}
function getWidth(){
	return (document.layers||(document.getElementById&&!document.all)) ? window.outerWidth : (document.all ? document.body.clientWidth : 0);
}
function MM_findObj(n, d) { //v3.0
  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); 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];}
}
function BC_swapClass() {
   BC_swapClassRestore()
   var i,j=0,x,a=BC_swapClass.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.oClassName) x.oClassName=x.className; x.className=a[i+2];}
}
function BC_swapClassRestore() { //v3.0
  var i,x,a=document.MM_sr; 
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oClassName;i++) x.className=x.oClassName;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
function MM_changeProp(objName,x,theProp,theValue) { //v3.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
}
dayName = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")
monName = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
now = new Date

function addbookmark(){
bookmarkurl="http://www.whanganui.co.nz/"
bookmarktitle="Welcome to Wades Landing Outdoors"
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
function close_window() {
    window.close();
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function getwinheight(){
var th = document.getElementById('bigbox').height
alert(th)
}
function launchpopup(url,w,h){
	var width=w, height=h;
    var left = (screen.width/2) - width/2;
    var top = (screen.height/3) - height/3;
    MM_openBrWindow(url,'','top='+top+',left='+left+',width='+w+',height='+h)
}
//*****************Jet Boat Section
function jet_boat_info(theid){
var thepage = ("JetBoat_information.php?id=" + theid)
MM_openBrWindow(thepage,'','resizable=yes,scrollbars=no,width=600,height=350')
}
function jetboatbook(theid){
close_window()
var thepage = ("Jet_boat_request_info.php?id=" + theid)
MM_openBrWindow(thepage,'','resizable=yes,scrollbars=no,width=564,height=625')
}
//***************************End of jet boat section

//***************************Jet paddle section
function jet_paddle_info(theid){
var thepage = ("JetBoat_Paddle_information.php?id=" + theid)
MM_openBrWindow(thepage,'','resizable=yes,scrollbars=no,width=600,height=350')
}
function jetpaddlebook(theid){
close_window()
var thepage = ("Jet_boat_paddle_request_info.php?id=" + theid)
MM_openBrWindow(thepage,'','resizable=yes,scrollbars=no,width=564,height=625')
}
//***********************************End of jet paddle section

//************************************Canoe/Kayak section
function freedominfo(theid){
var thepage = ("Freedom_information.php?id=" + theid)
MM_openBrWindow(thepage,'','resizable=yes,scrollbars=no,width=600,height=350')
}
function freedombook(theid){
close_window()
var thepage = ("Freedom_request_info.php?id=" + theid)
MM_openBrWindow(thepage,'','resizable=yes,scrollbars=no,width=564,height=625')
}
function executiveinfo(theid){
var thepage = ("Executive_information.php?id=" + theid)
MM_openBrWindow(thepage,'','resizable=yes,scrollbars=no,width=600,height=350')
}
function executivebook(theid){
close_window()
var thepage = ("Executive_request_info.php?id=" + theid)
MM_openBrWindow(thepage,'','resizable=yes,scrollbars=no,width=564,height=625')
}
//***********************************end of Canoe/Kayak section

//Tramping charter************************************
function passtrackinfoone(){
close_window()
var thepage = ("Tramping_request_info.php?trackname=Mangapurua/Kaiwhakauku Track")
MM_openBrWindow(thepage,'','resizable=yes,scrollbars=no,width=564,height=575')
}
function passtrackinfotwo(){
close_window()
var thepage = ("Tramping_request_info.php?trackname=Matemateaonga Track")
MM_openBrWindow(thepage,'','resizable=yes,scrollbars=no,width=564,height=575')
}
//*****************************************************End of tramping charter
function tmt_formManager(f,c){
if(MM_findObj(f)){eval("MM_findObj('"+f+"')."+c);}
}
function tmt_formAction(f,p){
	if(MM_findObj(f)){eval("MM_findObj('"+f+"').action='"+p+"'");}
}
function dosearchcom(shstr) {
newplace=("Accommodation_Single.php?id=" + shstr)
document.location.href=newplace
}
function doscleft(str){
document.getElementById('manga').scrollLeft=str
}
function launchlocator(strnm){
document.getElementById('lockey').value=strnm
MM_openBrWindow('Whanganui_river_locator.htm','','width=600,height=600')
}
function ContactUs(){
	tmt_formAction('former','Contact.php');
	tmt_formManager('former','submit()')
}
//New Functions
function calmenutop(imgid){
	var TT = findObj(imgid)
	var yPos = eval(TT).offsetTop;
	var tempEl = eval(TT).offsetParent;
  	while (tempEl != null) {
  		yPos += tempEl.offsetTop;
  		tempEl = tempEl.offsetParent;
  	}
	return yPos;
}
function calmenuleft(imgid){
	var LL = findObj(imgid)
	var xPos = eval(LL).offsetLeft;
	var tempEl = eval(LL).offsetParent;
  	while (tempEl != null) {
  		xPos += tempEl.offsetLeft;
  		tempEl = tempEl.offsetParent;
  	}
	return xPos;
}
function findObj(theObj, theDoc){
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length){
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}
//Gallery Functions
function changeOutImage(imgname,width,height){
	 checkWindowSize(height);
	 sampleImage=("Photos/"+imgname);
	 if(width>500){
		 width=500;
	 }
	 if(height>500){
		 height=480;
	 }
     document.getElementById('ImgView').style.backgroundImage="url("+sampleImage+")";
	 document.getElementById('ImgView').width=width
	 document.getElementById('ImgView').height=height
}
function changeCat(str){
	if(!str){
		alert("No Category Selected!");
		return false;
	}
	MM_goToURL('parent',str);return document.MM_returnValue
}
function checkWindowSize(height){
	HM_UserAgent = navigator.userAgent;
    HM_IsSafari = (HM_UserAgent.indexOf("Safari")!=-1);
    HM_IsFireFox = (HM_UserAgent.indexOf("Firefox")!=-1);
	HM_IsIE = (HM_UserAgent.indexOf("MSIE")!=-1);
	if((height>410)&&(HM_IsIE)){
	    resizeTo(765,820)
	}
	if((height<410)&&(HM_IsIE)){
	    resizeTo(765,750)
	}
	if((height>410)&&(HM_IsSafari)){
	    resizeTo(759,810)
	}
	if((height<410)&&(HM_IsSafari)){
	    resizeTo(759,720)
	}
	if((height>410)&&(HM_IsFireFox)){
	    resizeTo(759,850)
	}
	if((height<410)&&(HM_IsFireFox)){
	    resizeTo(759,750)
	}
}
function turnOffScroll(){
	document.getElementById('GalleryScroller').innerHTML="<strong>Click on a thumbnail to enlarge</strong>";
}
//End of Gallery Functions
//SidePanelHeight
function adjustPanel(obj){
	var currentAvailAreal=getWidth();
	var adjusterPos=calmenutop(obj);
	alert(adjusterPos);
}