// JavaScript Document
function HR(){
	dv = document.getElementById("ReSuLt").style;
	dv.display="none";		
}

function EM(){
	 document.getElementById("search").value="";	
}

function LS(v){
		if(v=="1"){
			dv = document.getElementById("livesearch").style;
			dv.display="block";
		}else if(v=="2"){			
				if(document.getElementById("corner").value==""){
					document.getElementById("search").value="Please Select Category";
					return;
				}

			le = document.getElementById("search").value;
			co = document.getElementById("corner").value
			if(le.length>2){
				sw = screen.width
				if(navigator.appName=="Microsoft Internet Explorer")
					sw = (sw/2) - 105;
				else
					sw = (sw/2) - 100;
				dv = document.getElementById("ReSuLt").style;
				dv.left=sw;
				dv.display="block";	
				SEARCH(co,le);
			}else{
				dv = document.getElementById("ReSuLt").style;
				dv.display="none";		
			}
		}else{
			dv = document.getElementById("livesearch").style;
			dv.display="none";		
			dv = document.getElementById("ReSuLt").style;
			dv.display="none";		
			document.getElementById("search").value="";
			document.getElementById("corner").value="";
		}
}


function SEARCH(co,sv){ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="kccss/getlivesearchresult.php";
url=url+"?search="+sv+"&corner="+co;
//alert(url);
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged() 
{ 
	if (xmlHttp.readyState==4){ 
		document.getElementById("ReSuLt").innerHTML=xmlHttp.responseText;
	}
}

function ULOADSUBCAT(cid,sid)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="../kccss/getsubcat.php";
url=url+"?cid="+cid+"&sid="+sid;
document.getElementById("subcat").innerHTML="<img src='../images/loading.gif' width='25' height='20'>";
xmlHttp.onreadystatechange=stateChanged1;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged1(){ 
	if (xmlHttp.readyState==4){ 
		document.getElementById("subcat").innerHTML=xmlHttp.responseText;
	}
}

function GETWEATHER(){
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null){
  alert ("Your browser does not support AJAX!");
  return;
  } 
document.getElementById("weather").innerHTML="<center><img src='images/loading.gif'><br><span class='kc_black'>Loading...</span>";
var url="kccss/weather.php";
xmlHttp.onreadystatechange=stateChanged2;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged2(){ 
	if (xmlHttp.readyState==4){ 
		document.getElementById("weather").innerHTML=xmlHttp.responseText;
	}
}


function GETUPDATEDWEATHER(lo){
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null){
  alert ("Your browser does not support AJAX!");
  return;
  } 
document.getElementById("weather").innerHTML="<table border='0' cellpadding='3' cellspacing='0' class='box1' width='95%'><tr><td height='200' align='center'><img src='../images/loading.gif'><br><span class='kc_black'>Loading...</span></td></tr></table>";
var url="../kccss/weathercorner.php?lo="+lo;
xmlHttp.onreadystatechange=stateChanged2;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

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 QSD(){
		if(document.getElementById("quicklinks").style.display=="none"){
			document.getElementById("quicklinks").style.display="block";
		}else{
			document.getElementById("quicklinks").style.display="none"
		}
}