	
	subject_id = '';
	function handleHttpResponse() {
		if (http.readyState == 4) {
			if (subject_id != '') {
				document.getElementById(subject_id).innerHTML = http.responseText;
			}
		}
	}
	
	function getHTTPObject() {
		var xmlHttp;
		try{
			xmlHttp = new XMLHttpRequest(); // Intenta crear el objeto
		}
		catch(e){
			// Para IE6 o versiones anteriores
			var XmlHttpVersions = new Array("MSXML2.XMLHTTP.6.0",
											"MSXML2.XMLHTTP.5.0",
											"MSXML2.XMLHTTP.4.0",
											"MSXML2.XMLHTTP.3.0",
											"MSXML2.XMLHTTP",
											"Microsoft.XMLHTTP");
			
			for (var i=0; i<XmlHttpVersions.length && !xmlHttp; i++) {
			  try { 
				xmlHttp = new ActiveXObject(XmlHttpVersions[i]);
			  } 
			  catch (e) {}
			}
		}
		
		if (!xmlHttp) alert("Error creando Objeto XMLHttpRequest.");
		else return xmlHttp;
	}		
	var http = getHTTPObject(); // We create the HTTP Object

	function getScriptPage(div_id, content_id, SubRubroID){
		subject_id = div_id;
		content = document.getElementById(content_id).value;
		
		if(content.length >= 3){		
			SeccionID = document.getElementById(SubRubroID).value;
			http.open("GET", "suggest/script_page.php?SeccionID="+SeccionID+"&content=" + escape(content), true);		
			http.onreadystatechange = handleHttpResponse;
			http.send(null);
		}

	}	

	function highlight(action,id){
		if(action) document.getElementById('word'+id).bgColor = "#C2B8F5";
		else document.getElementById('word'+id).bgColor = "#F8F8F8";
	}
	
	function display(word){
		document.getElementById('claves').value = word;
		document.getElementById('box').style.display = 'none';
		document.getElementById('claves').focus();
	}
	
	function box(act){
		if(act=='0'){
			document.getElementById('box').style.display = 'none';
		}else document.getElementById('box').style.display = 'block';
	}