function checkvalid (user)
{
	
	 xhr=createXMLHttpRequest();
if (xhr==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
    
var url="registration.php";
url=url+"?user="+user;
xhr.open("GET",url,true);
xhr.send(null);
xhr.onreadystatechange = onreadystatechange;
}
function onreadystatechange()
{ 
	var message=document.getElementById('emptyusername');
  if(xhr.readyState == 4) {
   if(xhr.status == OK) {
     message.innerHTML=xhr.responseText;
    }
  }
}
 
 function adddownloadcount(id,tablename)
{

	
	 xhr=createXMLHttpRequest();
if (xhr==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
    
var url="articles.php";
url=url+"?tbn="+tablename+"&id="+id;
xhr.open("GET",url,true);
xhr.send(null);

}
var newWindow;

function poptastic(url)
{

	newwindow=window.open(url,'name','height=400,width=200');
	if (window.focus) {newwindow.focus()}
}

