function GetXmlHttpObject(){
	var xmlHttp=null;
	try{
		xmlHttp=new XMLHttpRequest();
	}
	catch (e){
		try{	
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e){
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}
function show(page){ 
xmlHttp=GetXmlHttpObject()	
if (xmlHttp==null){alert ("Browser does not support HTTP Request");return;} 
var url="scripts/changepage.php?page="+page+"&sid="+Math.random()
xmlHttp.onreadystatechange=displayPage
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function displayPage() { 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){document.getElementById("main_content").innerHTML=xmlHttp.responseText}
else{document.getElementById("main_content").innerHTML="Loading.  Please wait..."}
} 
var xmlReq;
var xmlDoc;
function loadXMLDoc(url){
xmlReq=null
xmlDoc=url
if (window.XMLHttpRequest){xmlReq=new XMLHttpRequest()}
else if (window.ActiveXObject){try{xmlReq=new ActiveXObject("Msxml2.XMLHTTP")} catch (e){xmlReq=new ActiveXObject("Microsoft.XMLHTTP")}}
if (xmlReq!=null){
xmlReq.onreadystatechange=onResponse
xmlReq.open("GET",url,true)
xmlReq.send(null)
}
else{alert("Your browser does not support XMLHTTP.")}
}
function onResponse(){
if(xmlReq.readyState!=4) return
if(xmlReq.status!=200){alert("Problem retrieving XML data!"); return;}
x=xmlReq.responseXML.documentElement.getElementsByTagName("photo");
output="<table border='0'><tr>";
for (i=0;i<x.length;i++){
output=output + "<td>";	
xx=x[i].getElementsByTagName("imagelink");
{try{output=output + "<a href='" + xx[0].firstChild.nodeValue + "' target='_blank'>";} catch (er){ output=output + " ";}}
xx=x[i].getElementsByTagName("thumbnail");
{try{output=output + "<img src='" + xx[0].firstChild.nodeValue + "' height='75' width='75' />"; output=output + "</a>";} catch (er){output=output + " ";}}
output=output + "<br />";
xx=x[i].getElementsByTagName("imagetitle");
{try{output=output + "<b>" + xx[0].firstChild.nodeValue + "</b>";} catch (er){output=output + " ";}}	
output=output + "<br />";
xx=x[i].getElementsByTagName("username");
{try{output=output + xx[0].firstChild.nodeValue;}catch (er){output=output + " ";}}
output=output + "<br />";
xx=x[i].getElementsByTagName("imagedate");
{try{ output=output + xx[0].firstChild.nodeValue;}catch (er){output=output + " ";}
}
output=output + "</td><td width='5'>&nbsp;</td>";
}
output=output + "</tr></table>";
document.getElementById('your_photos').innerHTML=output;
}
function popup(url){
var width=400;
var height=500;
var from_top=350;
var from_left=500;
var toolbar='no';
var location='no';
var directories='no';
var status='no';
var menubar='no';
var scrollbars='yes';
var resizable='yes';
var atts='width='+width+'show,height='+height+',top='+from_top+',screenY='+from_top+',left='+from_left+',screenX='+from_left+',toolbar='+toolbar+',location='+location+',directories='+directories+',status='+status+',menubar='+menubar+',scrollbars='+scrollbars+',resizable='+resizable;
window.open(url,'win_name',atts);
}
function getConditions(){
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null){alert ("Browser does not support HTTP Request"); return;} 
var url="conditions.php";
xmlHttp.onreadystatechange=updateWeather;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function updateWeather(){
if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete"){document.getElementById("inner_inner_current_conditions").innerHTML=xmlHttp.responseText;getBeachClosings();}
else{document.getElementById("inner_inner_current_conditions").innerHTML="Loading...";}
}
function getBeachClosings(){
xmlHttp=GetXmlHttpObject();	
if (xmlHttp==null){alert ("Browser does not support HTTP Request"); return;} 
var url="beaches.php";
xmlHttp.onreadystatechange=updateBeaches;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function updateBeaches(){
if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete"){document.getElementById("beach_cond").innerHTML=xmlHttp.responseText;}
else{document.getElementById("beach_cond").innerHTML = "Loading Beach Conditions...";}
}
function MM_preloadImages(){
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(){
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 MM_findObj(n, d){
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_swapImage(){
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];}
}