try {
	document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}
function showAlert()
{
	document.getElementById('alert').style.display = '';
}
function hideAlert()
{
	document.getElementById('alert').style.display = 'none';
}

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;



function GetXmlHttpObject(handler)
{
    var objXMLHttp=null
    if (window.XMLHttpRequest)
    {
        objXMLHttp=new XMLHttpRequest()
    }
    else if (window.ActiveXObject)
    {
        objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
    }
    return objXMLHttp
}

function stateChanged() {
			document.getElementById("subcat").style.display = "none";
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		if(xmlHttp.responseText == '' || xmlHttp.responseText == '<option value="-1">-1</option>'){
			document.getElementById("subcat").style.display = "hidden";
		}else{
			document.getElementById("subcat").style.display = "block";
			document.getElementById("txtResult").innerHTML= xmlHttp.responseText;
		}
    }
    else {
            //alert(xmlHttp.status);
    }
}

// Will populate data based on input
function htmlData(url, qStr, sub)
{
    if (url.length==0)
    {
        document.getElementById("txtResult").innerHTML="";
        return;
    }
    xmlHttp=GetXmlHttpObject()
    if (xmlHttp==null)
    {
        alert ("Browser does not support HTTP Request");
        return;
    }

    url=url+"?"+qStr+"&sub="+sub;
    url=url+"&sid="+Math.random();
    xmlHttp.onreadystatechange=stateChanged;
    xmlHttp.open("GET",url,true) ;
    xmlHttp.send(null);
}