// JavaScript Document

function chechUserValid(username)
{
	
	 $.ajax({
			  url: 'userAjaxController.php?do=checkusername&username='+username,
			   success: function(data) {
				  
				   if(data == 'true')
				   {
					    document.getElementById("submit").disabled=false;
						document.getElementById("usernamedata").style.display="none";
					
					  
					   }
				   else
				   {
					   document.getElementById("submit").disabled= true;
					  document.getElementById("usernamedata").style.display="block";
					 }
			   }
	
		  }); 

}



function chechUserValidById(username)
{
	var userid = document.getElementById("userid").value;
	
	 $.ajax({
			  url: 'userAjaxController.php?do=checkusernameAnduserid&username='+username+'&useridsearch='+userid,
			   success: function(data) {
				  
				   if(data == 'true')
				   {
					    document.getElementById("submit").disabled=false;
					 document.getElementById("usernamedata").style.display="none";
					  
					   }
				   else
				   {
					   document.getElementById("submit").disabled= true;
					    document.getElementById("usernamedata").style.display="block";
					 }
			   }
	
		  }); 

}