var httpPictChanging=null; var xmlhttpPict; function loadXMLPict(url) { xmlhttpPict=null; if (window.XMLHttpRequest) {// code for Firefox, Opera, IE7, etc. xmlhttpPict=new XMLHttpRequest(); } else if (window.ActiveXObject) {// code for IE6, IE5 xmlhttpPict=new ActiveXObject("Microsoft.XMLHTTP"); } if (xmlhttpPict!=null) { xmlhttpPict.open("GET",url,true); xmlhttpPict.onreadystatechange=state_Change_Pict; xmlhttpPict.send(null); } else { alert("Your browser does not support XMLHTTP."); } } function state_Change_Pict() { if (xmlhttpPict.readyState==4) {// 4 = "loaded" if (xmlhttpPict.status==200) {// 200 = "OK" httpPictChanging.innerHTML=xmlhttpPict.responseText; httpPictChanging.focus(); httpPictChanging = null; StartPhotoTimer(); } else { alert("Problem retrieving data:" + xmlhttp.statusText); } } } var showdelay=10000; var photopath="experiences"; function SetPhotoTimer() { if (httpPictChanging != null) { changephototimerId = setTimeout("SetPhotoTimer()",showdelay); } else { httpdocchanging= document.getElementById('MR-Experience-Random-Photo'); changephototimerId = setTimeout("randomPhoto()",showdelay); } } function StartPhotoTimer() { changephototimerId = setTimeout("SetPhotoTimer()",10000); } function randomPhoto() /* , Path) */ { var url = "http://www.theintertwine.org/" + photopath + "experiences-random-photo-gen1.php?ExpPath=experiences/"; httpPictChanging = document.getElementById('MR-Experience-Random-Photo'); loadXMLPict(url); }