var xmlHttp = createXmlHttp();

function copy_t( to_copy) { 
window.clipboardData.setData("Text", to_copy);
}

function createXmlHttp()
{
  var xmlHttp;
  
  // IE
  if ( window.ActiveXObject )
  {
    try
    {
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    
    catch ( e )
    {
      xmlHttp = false;
    }
    
  } else {
    
    try 
    {
      xmlHttp = new XMLHttpRequest();
    }
    
    catch ( e )
    {
      xmlHttp = false;
    }
  
  }
  
  if ( ! xmlHttp )
    alert("XML HTTP REQUEST didn't create");
  else
    return xmlHttp;
}


function sendForm ( forma )
{

  if ( xmlHttp.readyState == 4 || xmlHttp.readyState == 0 )
  {
   xmlHttp.open("GET","checkpositino.php?link="+document.getElementById('link').value+"&key="+document.getElementById('key').value, true);
	 xmlHttp.onreadystatechange = serverResponse;
	 xmlHttp.send(null);
	 xmlHttp.overrideMimeType('text/html; charset=iso-8859-2');
    
   }
  
}

function serverResponse ()
{
  if ( xmlHttp.readyState == 4 )
  {
    if ( xmlHttp.status == 200 )
    {
      response = xmlHttp.responseText;
      document.getElementById("out").innerHTML = response;
	

    }
  } else {
      document.getElementById("out").innerHTML = '<img src="ajax-loader.gif"/>';
  }
}
