var req;

function Initialize()
{
    try
    {
        req=new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e)
    {
        try
        {
            req=new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch(oc)
        {
            req=null;
        }
    }

    if(!req&&typeof XMLHttpRequest!="undefined")
    {
        req= new
    XMLHttpRequest();

}

} 
function SearchProperty(key)
    {
    //Initialize(); var url="http://www.objectgraph.com/dictionary/dict.aspx?k="+key;
Initialize(); var url='searchproperty.php?k='+key;
    if(req!=null)
    {
        req.onreadystatechange = Process;
        req.open("GET", url, true);
        req.send(null);
		
    }

}

function Process()
{
    if (req.readyState == 4)
        {
        // only if "OK"
            if (req.status == 200)
            {
                if(req.responseText=="")
                    HideDiv("autocomplete");
                else
                {
                    ShowDiv("autocomplete");
                    document.getElementById("autocomplete").innerHTML =req.responseText;
					
                }
            }
            else
            {
                document.getElementById("autocomplete").innerHTML=
					"There was no data:<br>"+req.statusText;
            }
        }
}


function ShowDiv(divid)
{
   if (document.layers) document.layers[divid].visibility="show";
   else document.getElementById(divid).style.visibility="visible";
}

function HideDiv(divid)
{
   if (document.layers) document.layers[divid].visibility="hide";
   else document.getElementById(divid).style.visibility="hidden";
}

function BodyLoad()
{
    
    document.form1.keyword.focus();
    document.form1.keyword.value='';

}

	var sTimeout = null;
		var search_before = '';
		
		
		function timeout_search()
				{
					if(search_before == document.getElementById("keyword").value) return;
					if(sTimeout != null)
						window.clearTimeout(sTimeout);
					loading_img("gif");
			
					sTimeout = window.setTimeout("_search();", 5000);
								
					
			
				}
	
	
	function _search(str, start)
			
			
				{
					var search = (!str) ? document.getElementById("keyword").value : str;
					
					loading_img("gif");
					
					if(search.length >= 1){
									
									loading_img("png");
								}
		
					
		}

	function loading_img(disp)


	{
		if(disp == "gif")
			var src = "./loading.gif";
			
		else if(disp == "png")
			var src = "./loader.gif"; //used to be png
			
		if(document.getElementById("loading").src.indexOf(src.replace('./', '')) == -1)
			document.getElementById("loading").src = src;
	}	
	

	
	
              	

function CheckAll()
  {
  for (var i=0;i<document.form.elements.length;i++)
    {
    var e = document.form.elements[i];
    if (e.name != 'allbox' )
      e.checked = document.form.allbox.checked;
    }
  }
  
function delete_checked()
	{

	var a = 0;
	for(var i=0;i<document.form.elements.length-1;i++)
	{
	if(document.form.elements[i].checked)
	a = a+1;
	}
	if(a==0)
	{
		alert("Please select an Item");
		return false;
	}
	
	return true;

	}
	

