/*
 
	marcel_192002@yahoo.com
 
*/

var xmlHttp

function showResult(str) {
	
	Initialize();
	
	if (str.length > 0) {
	
		var url="cauta.php?q=" + str
	
		xmlHttp.onreadystatechange = Process;
		xmlHttp.open("GET", url , true)
        xmlHttp.send(null);
	
	} else {
		
		document.getElementById("result").innerHTML="<br><b>Welcome!</b><ul><li>Pentru a traduce un cuvant nu trebuie decat sa-l tastati si rezultatul va aparea imediat.</li><li>Daca javascript este dezactivat sau browserul nu este compatibil atunci apasati <a href=\"roman-englez/online\">aici</a>.</li></ul>"
	}
}

function WordFocus() {
	
		document.getElementById('word').focus();
		//showResult(str="");
	
}



function Process()
{
	if (xmlHttp.readyState == 4)
        {
			if (xmlHttp.status == 200)
			{
				document.getElementById("result").innerHTML=xmlHttp.responseText
			}
			else
			{
				document.getElementById("result").innerHTML="A intervenit o eroare! Va rugam reveniti mai tarziu!"
			}
		}
}


function Initialize()
{
	try
	{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			xmlHttp=null;
		}
	}

	if(!xmlHttp&&typeof XMLHttpRequest!="undefined")
	{
		xmlHttp=new XMLHttpRequest();
	}

}

