
	subject_id = '';
	function handleHttpResponse() {
		if (http.readyState == 4) { 
			if (subject_id != '') {
				document.getElementById("ajax_div").style.display="none";
				document.getElementById(subject_id).innerHTML = http.responseText;
			}
		}
	}
	function getHTTPObject() {
		var xmlhttp;
		
		if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
			try {
				xmlhttp = new XMLHttpRequest();
			} catch (e) {
				xmlhttp = false;
			}
		}	

		return xmlhttp;
	}
	var http = getHTTPObject(); // We create the HTTP Object

	function getScriptPage(div_id,content_id)
	{
		subject_id = div_id;
		content = document.getElementById(content_id).value;	
		document.getElementById("ajax_div").style.display="block";
		http.open("GET", "index2.php?option=com_search&task=getResult&searchword=" + escape(content), true);
		http.onreadystatechange = handleHttpResponse;
		http.send(null);
		if(content.length>0)
		{
			box('1');

			//mouse_is_inside='true';
		}
		else
		{
			box('0');
			document.getElementById("ajax_div").style.display="none";

			//mouse_is_inside='false';
		}

	}	

	function highlight(action,id)
	{
	  if(action)	
	  {
		document.getElementById('word'+id).bgColor = "#408fd5";		
	  }
	  else
		document.getElementById('word'+id).bgColor = "#76b4ed";
	}
	function display(word)
	{
		document.getElementById('text_content').value = word;
		document.getElementById('box').style.display = 'none';
		document.getElementById('text_content').focus();
	}
	function box(act)
	{
	  if(act=='0')	
	  {
		document.getElementById('box').style.display = 'none';

	  }
	  else
		document.getElementById('box').style.display = 'block';
	}
