	/*
	AJAX
	*/
	var timerID;
	var txtSearhValue ;//=document.getElementById('search');
	
	function newXmlHttp(){
		//var xmlhttp = false;
		
		//try{
		//	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		//}catch(e){
		//	try{
		//		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		//	}catch(e){
		//		xmlhttp = false;
		//	}
		//}
	
		//if(!xmlhttp && document.createElement){
		//	xmlhttp = new XMLHttpRequest();
		//}
		//return xmlhttp;
		 var xmlObj;
    if (window.ActiveXObject)
    {
        try
        {
           xmlObj = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e)
        {
           xmlObj = new ActiveXObject("Msxml2.XMLHTTP");
        }
    }
    else
        xmlObj = new XMLHttpRequest();
      //alert('test');  
    return xmlObj;
	}
	
	/*
		getElementById
	*/
	function $(strIdName){
		return document.getElementById(strIdName);
	}
	function addEvent(obj, evType, fn){ 
	 if (obj.addEventListener){ 
	   obj.addEventListener(evType, fn, false); 
	   return true; 
	 } else if (obj.attachEvent){ 
	   var r = obj.attachEvent("on"+evType, fn); 
	   return r; 
	 } else { 
	   return false; 
	 } 
}

function NewEvent(strData){
	//alert(strData);
}

window.onload = function(){
	obj = document.getElementById("search");
	obj.onkeydown = null;
	
	addEvent(obj, 'keyup', function(){NewEvent(obj.value);});
}
	/*
	getContentLoad(strDivName,strUrl)
	*/
	

	
	function getContentLoad(strValue){
		
		var strValue = escape(_utf8_encode(document.getElementById("search").value));
		//strValue = escape(_utf8_encode(strValue));
		//alert(strValue)
		xmlhttp = newXmlHttp();
		xmlhttp.onreadystatechange=function(){
			if(xmlhttp.readyState == 4 && xmlhttp.status==200){
		     	//$("divContent").style.display = "";
		     	$("divContent").innerHTML = xmlhttp.responseText;
			}else {
			  $("divContent").innerHTML ="<IMG  src='../i_animated_loading_32_2.gif'>"
			}
		}
		xmlhttp.open("GET", "../Result.aspx?search="+strValue, true);
		//xmlhttp.setRequestHeader("Accept-Charset","windows-874");
		//alert(strValue)
		xmlhttp.send(null);
		//SetTimer();
		
	}
	

	
	/*
	getContentLoad(strDivName,strUrl)
	*/
	function getContentLoadAllResult(){
		var strValue = escape(_utf8_encode( document.getElementById("search").value));
		//strValue = escape(_utf8_encode(strValue));
		//alert(strValue)
		xmlhttp = newXmlHttp();
		xmlhttp.onreadystatechange=function(){
			if(xmlhttp.readyState == 4 && xmlhttp.status==200){
		     	//$("divContent").style.display = "";
		     	$("divContent").innerHTML = xmlhttp.responseText;
			}else {
			  $("divContent").innerHTML ="<IMG  src='i_animated_loading_32_2.gif'>"
			}
		}
		xmlhttp.open("GET", "Result.aspx?search="+strValue, true);
		//xmlhttp.setRequestHeader("Accept-Charset","windows-874");
		//alert(strValue)
		xmlhttp.send(null);
		//SetTimer();
		
	}
	
	 // public method for url encoding
     function encode(string) {
        return escape(this._utf8_encode(string));
    }
	 // private method for UTF-8 encoding
     function _utf8_encode(string) {
        string = string.replace(/\r\n/g,"\n");
        var utftext = "";

        for (var n = 0; n < string.length; n++) {

            var c = string.charCodeAt(n);

            if (c < 128) {
                utftext += String.fromCharCode(c);
            }
            else if((c > 127) && (c < 2048)) {
                utftext += String.fromCharCode((c >> 6) | 192);
                utftext += String.fromCharCode((c & 63) | 128);
            }
            else {
                utftext += String.fromCharCode((c >> 12) | 224);
                utftext += String.fromCharCode(((c >> 6) & 63) | 128);
                utftext += String.fromCharCode((c & 63) | 128);
            }

        }

        return utftext;
    }
   function SetTimer(){
       timerID = setTimeout(DisplayNone, 1000);
   }
   function ClearTimer(){
       clearTimeout(timerID);
   }
   function DisplayNone(){
		$("divContent").style.display = "none";
	}
function high(obj) { obj.style.background='#EEEEEE'; }
function low(obj) { obj.style.background='#E2E2E2'; }

