var xmlHttpfunction Start(){ try {  xmlhttp = new XMLHttpRequest();  document.getElementById("Content").innerHTML="<h1>Using XMLHttpRequest Object</h1>"; } catch (e) {  document.getElementById("Content").innerHTML="<h1>XMLHttp cannot be created!</h1>"; }  }function upl(){  document.getElementById("Content").innerHTML+="uploading...";  xmlHttp=GetXmlHttpObject();  if (xmlHttp==null)  {  alert ("Your browser does not support AJAX!");  return;  }   var url="time.php";  //url+=document.myForm.time.value  url=url+"&sid="+Math.random();  xmlHttp.open("GET", url, true);  xmlHttp.send(null);  document.getElementById("Content").innerHTML+="here";  xmlHttp.onreadystatechange=stateChanged;    //document.myForm.time.value=xmlHttp.responseText;  //ddocument.getElementById("Content").innerHTML="<h1>POO</h1>";}function stateChanged() {   if (xmlHttp.readyState==4)  {     document.getElementById("txtHint").innerHTML=xmlhttp.responseText;  }}function GetXmlHttpObject(){var xmlHttp=null;try  {  // Firefox, Opera 8.0+, Safari  xmlHttp=new XMLHttpRequest();  }catch (e)  {  // Internet Explorer  try    {    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    }  catch (e)    {    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");    }  }return xmlHttp;}function ajaxFunction(){var xmlHttp;try  {  // Firefox, Opera 8.0+, Safari  xmlHttp=new XMLHttpRequest();  }catch (e)  {  // Internet Explorer  try    {    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    }  catch (e)    {    try      {      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");      }    catch (e)      {      alert("Your browser does not support AJAX!");      return false;      }    }  }  xmlHttp.onreadystatechange=function()    {    if(xmlHttp.readyState==4)      {      //document.myForm.time.value=xmlHttp.responseText;	//ddocument.getElementById("Content").innerHTML="<h1>POO</h1>";	document.getElementById("Content").innerHTML+=xmlHttp.responseText;      }    }  xmlHttp.open("GET","time.php",true);  xmlHttp.send(null);  }function changeImage(img, total){ try {  xmlhttp = new XMLHttpRequest();  	var n;  	var p;	if(img<=0){		img = total;  		n = 1;  		p = img-1;	}else if(img==total){		n = 1;  		p = img-1;	}else{  		n = img+1;  		p = img-1;	}  document.getElementById("outof").innerHTML="Photo "+img+" / "+total+"";  document.getElementById("photo").innerHTML="<img src='../images/trucks/"+photoArray[img]+"'>";  document.getElementById("prev").innerHTML="<a href='javascript:changeImage("+p+","+total+")'>Previous</a> -";  document.getElementById("nex").innerHTML="- <a href='javascript:changeImage("+n+","+total+")'>Next</a>"; } catch (e) {  document.getElementById("Content").innerHTML="<h1>XMLHttp cannot be created!</h1>"; }  }
