var http_request = false; function setCookie(CookieName,CookieValue)
{ var expireDate = new Date (); var offset = 1 / 1; expireDate.setYear(expireDate.getFullYear()+offset); document.cookie = escape(CookieName ) + "=" + escape(CookieValue) + "; expires=" + expireDate.toGMTString() + "; path=/";}
function makeRequest(url, parameters, message) { http_request = false; if (window.XMLHttpRequest) { http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/html');}
} else if (window.ActiveXObject) { try { http_request = new ActiveXObject("Msxml2.XMLHTTP");} catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP");} catch (e) {}
}
}
if (!http_request) { alert('Cannot create XMLHTTP instance'); return false;}
http_request.onreadystatechange = function(){alertContents(message);};; http_request.open('GET', url + parameters, true); http_request.send(null);}
function alertContents(message) { if (http_request.readyState == 4) { if (http_request.status == 200) { document.getElementById('rate').innerHTML = message;} else { alert('Connection Failure - Please try after sometime');}
}
}
function getAndSetRateSearchParameter(obj, message) { var getstr = "?"; for (i=0; i<obj.childNodes.length; i++) { if (obj.childNodes[i].tagName == "INPUT") { if (obj.childNodes[i].type == "radio") { if (obj.childNodes[i].checked) { getstr += obj.childNodes[i].name + "=" + obj.childNodes[i].value + "&";}
}
if (obj.childNodes[i].name == "q") { getstr += obj.childNodes[i].name + "=" + obj.childNodes[i].value + "&";}
if (obj.childNodes[i].name == "type") { getstr += obj.childNodes[i].name + "=" + obj.childNodes[i].value + "&";}
if (obj.childNodes[i].name == "hl") { getstr += obj.childNodes[i].name + "=" + obj.childNodes[i].value;}
}
}
makeRequest('/ratesearch', getstr, message);}
function rpc(title,summary,tell,type)
{ var url=""; switch(type){ case "moreinfo":url="http://dir.guruji.com/local/detail?";break; case "vcard":url="http://dir.guruji.com/misc/vcard.php?";break; default:break;}
var a=window.encodeURIComponent?encodeURIComponent:escape; var urlstr = url + "title="+ a(title) + "&desc="+ a(summary) + "&tel=" + a(tell) + ""; window.location.href = urlstr; return;}
function printIt(record)
{ var _ifrm = document.createElement("IFRAME"); document.body.appendChild(_ifrm); if (_ifrm.contentDocument) { _d = _ifrm.contentDocument;} else if (_ifrm.contentWindow) { _d = _ifrm.contentWindow.document;} else if (_ifrm.document) { _d = _ifrm.document;}
_d.write(document.getElementById(record).innerHTML); _d.close(); _ifrm.contentWindow.focus(); _ifrm.contentWindow.print(); document.body.removeChild(_ifrm);}
function errorwin(title,desc,tel)
{ var windowleft = parseInt((screen.width/2) - 250); var windowtop = parseInt((screen.height/2) - 200); var a=window.encodeURIComponent?encodeURIComponent:escape; var URL = "http://dir.guruji.com/local/reporterror.php?title="+ a(title) + "&desc=" + a(desc) + "&tel=" + a(tel); try{ window.open(URL,'errorwindow','scrollbars=yes,width=500,height=400,left='+windowleft+',top='+windowtop+',screenX='+windowleft+',screenY='+windowtop+'');}
catch(e){ alert(e);}
}