 

var receiveReq=getXmlHttpRequestObject();
function doSearch(_1){
url="phpscripts/search.php?q="+_1;
dvr="precontent";
document.getElementById("precontent").innerHTML="<span style=\"background:#F00;color:#FFF;\">Searching...</span>";
if(document.getElementById("precontent").style.display=="none"){
new Effect.BlindDown("precontent");
}
if(receiveReq.readyState==4||receiveReq.readyState==0){
receiveReq.open("GET",url,true);
receiveReq.onreadystatechange=dotheXML;
receiveReq.send(null);
}
}
submitc="<strong>Enter the url of the news:</strong><br /><br /> <input type=\"text\" class=\"quicknavform\" style=\"width:11em;\" value=\"http://domain.com/energy.html\" id=\"submitid\" onfocus=\"if(this.value=='http://domain.com/energy.html') this.value='http://';\" /> <input type=\"button\" class=\"quicknavbut\" value=\"Submit\" onclick=\"submitNews();\" />";
function submitNews(){
url="phpscripts/newsmail.php?val="+document.getElementById("submitid").value;
dvr="precontent";
document.getElementById("precontent").innerHTML="<span style=\"background:#F00;color:#FFF;\">Submitting...</span>";
if(receiveReq.readyState==4||receiveReq.readyState==0){
receiveReq.open("GET",url,true);
receiveReq.onreadystatechange=dotheXML;
receiveReq.send(null);
}
}
newsletterc="<strong>To receive the newsletter, please enter your email:</strong><br /><br /> <input type=\"text\" class=\"quicknavform\" style=\"width:11em;\" value=\"name@domain.com\" id=\"newsid\" onfocus=\"if(this.value=='name@domain.com') this.value='';\" /> <input type=\"button\" class=\"quicknavbut\" value=\"Join\" onclick=\"newsletterAdd();\" /><br /><br />(No spam guaranteed!)";
function newsletterAdd(){
url="phpscripts/insert.php?val="+document.getElementById("newsid").value;
dvr="precontent";
document.getElementById("precontent").innerHTML="<span style=\"background:#F00;color:#FFF;\">Processing...</span>";
if(receiveReq.readyState==4||receiveReq.readyState==0){
receiveReq.open("GET",url,true);
receiveReq.onreadystatechange=dotheXML;
receiveReq.send(null);
}
}
function gasPrices(){
url="phpscripts/gpwget.php";
dvr="precontent";
document.getElementById("precontent").style.display="none";
document.getElementById("precontent").innerHTML="<span style=\"background:#F00;color:#FFF;\">Loading...</span>";
new Effect.BlindDown("precontent");
if(receiveReq.readyState==4||receiveReq.readyState==0){
receiveReq.open("GET",url,true);
receiveReq.onreadystatechange=dotheXML;
receiveReq.send(null);
}
}
function getXmlHttpRequestObject(){
if(window.XMLHttpRequest){
return new XMLHttpRequest();
}else{
if(window.ActiveXObject){
return new ActiveXObject("Microsoft.XMLHTTP");
}else{
alert("Your browser doesn't support XmlHttpRequest or ActiveX objects.  Better upgrade to Firefox.");
}
}
}
function dotheXML(){
if(receiveReq.readyState==4){
if(receiveReq.responseText=="close __SEARCH"){
document.getElementById(dvr).style.display="none";
}else{
document.getElementById(dvr).innerHTML=receiveReq.responseText;
}
}
}