$(document).ready(function()
{
	$("#srvname").blur(function()
	{
		//remove all the class add the messagebox classes and start fading
		$("#msgbox").removeClass().addClass('messagebox').text('Checking...').fadeIn("slow");
		//check the username exists or not from ajax
		$.post("srvname.php",{ srvname:$(this).val() } ,function(data)
        {
		  if(data=='no') //if username not avaiable
		  {
		  	$("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
			{ 
			  //add message and change the class of the box and start fading
			  $(this).html('Server Name Already Exists').addClass('messageboxerror').fadeTo(900,1);
			});		
          }
		  else
		  {
		  	$("#msgbox").fadeTo(200,0.1,function()  //start fading the messagebox
			{ 
			  //add message and change the class of the box and start fading
			  $(this).html('Server Name Available ').addClass('messageboxok').fadeTo(900,1);	
			});
		  }
				
        });
 
	});
});

$(document).ready(function()
{
	$("#srv_ip").blur(function()
	{
		//remove all the class add the messagebox classes and start fading
		$("#msgbox2").removeClass().addClass('messagebox').text('Checking...').fadeIn("slow");
		//check the username exists or not from ajax
		$.post("srv_ip.php",{ srv_ip:$(this).val()} ,function(data)
        {
		  if(data=='no') //if username not avaiable
		  {
		  	$("#msgbox2").fadeTo(200,0.1,function() //start fading the messagebox
			{ 
			  //add message and change the class of the box and start fading
			  $(this).html('Login IP Already exists').addClass('messageboxerror').fadeTo(900,1);
			});		
          }
		  else
		  {
		  	$("#msgbox2").fadeTo(200,0.1,function()  //start fading the messagebox
			{ 
			  //add message and change the class of the box and start fading
			  $(this).html('Login IP is not in database ').addClass('messageboxok').fadeTo(900,1);	
			});
		  }
				
        });
 
	});
});


$(document).ready(function()
{
	$("#game_ip").blur(function()
	{
		//remove all the class add the messagebox classes and start fading
		$("#msgbox3").removeClass().addClass('messagebox').text('Checking...').fadeIn("slow");
		//check the username exists or not from ajax
		$.post("game_ip.php",{ game_ip:$(this).val()} ,function(data)
        {
		  if(data=='no') //if username not avaiable
		  {
		  	$("#msgbox3").fadeTo(200,0.1,function() //start fading the messagebox
			{ 
			  //add message and change the class of the box and start fading
			  $(this).html('Game IP Already exists').addClass('messageboxerror').fadeTo(900,1);
			});		
          }
		  else
		  {
		  	$("#msgbox3").fadeTo(200,0.1,function()  //start fading the messagebox
			{ 
			  //add message and change the class of the box and start fading
			  $(this).html('Game IP is not in database ').addClass('messageboxok').fadeTo(900,1);	
			});
		  }
				
        });
 
	});
});
