var xmlHttp_ln

function decode_link()
{

	if (document.getElementById("link").value.length==0){ 
		document.getElementById("txtDecode").innerHTML="";
		return;	
	}

xmlHttp_ln=GetXmlHttpObject()
if (xmlHttp_ln==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
document.body.style.cursor="wait";
document.getElementById("txtDecode").style.display="block";
document.getElementById("txtDecode").style.visibility="visible";  
document.getElementById("txtDecode").innerHTML="<img src='http://szabloniki.com/sliwek/mp4/lib/html/images/loader_mini.gif'>";

pause(1000);
var url="lib/php/decode_link.php";
var poststr = "link=" + encodeURI( document.getElementById("link").value );
xmlHttp_ln.onreadystatechange=stateChanged_ln;
xmlHttp_ln.open("POST",url,true);
xmlHttp_ln.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp_ln.setRequestHeader("Content-length", poststr.length);
xmlHttp_ln.setRequestHeader("Connection", "close");
xmlHttp_ln.send(poststr);

} 

function stateChanged_ln() 
{ 
	if (xmlHttp_ln.readyState==4)
	{ 
		document.getElementById("txtDecode").innerHTML=xmlHttp_ln.responseText;
		document.body.style.cursor = "default";
	}
}

function GetXmlHttpObject()
{
	var xmlHttp_ln=null;
	try{
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp_ln=new XMLHttpRequest();
	}
	catch (e){
	  // Internet Explorer
	  try{
		xmlHttp_ln=new ActiveXObject("Msxml2.XMLHTTP");
	  }
	  catch (e){
		xmlHttp_ln=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	}
return xmlHttp_ln;
}


