
$(document).ready(function()
{$("#srvname").blur(function()
{$("#msgbox").removeClass().addClass('messagebox').text('Checking...').fadeIn("slow");$.post("srvname.php",{srvname:$(this).val()},function(data)
{if(data=='no')
{$("#msgbox").fadeTo(200,0.1,function()
{$(this).html('Server Name Already Exists').addClass('messageboxerror').fadeTo(900,1);});}
else
{$("#msgbox").fadeTo(200,0.1,function()
{$(this).html('Server Name Available ').addClass('messageboxok').fadeTo(900,1);});}});});});$(document).ready(function()
{$("#srv_ip").blur(function()
{$("#msgbox2").removeClass().addClass('messagebox').text('Checking...').fadeIn("slow");$.post("srv_ip.php",{srv_ip:$(this).val()},function(data)
{if(data=='no')
{$("#msgbox2").fadeTo(200,0.1,function()
{$(this).html('Login IP Already exists').addClass('messageboxerror').fadeTo(900,1);});}
else
{$("#msgbox2").fadeTo(200,0.1,function()
{$(this).html('Login IP is not in database ').addClass('messageboxok').fadeTo(900,1);});}});});});$(document).ready(function()
{$("#game_ip").blur(function()
{$("#msgbox3").removeClass().addClass('messagebox').text('Checking...').fadeIn("slow");$.post("game_ip.php",{game_ip:$(this).val()},function(data)
{if(data=='no')
{$("#msgbox3").fadeTo(200,0.1,function()
{$(this).html('Game IP Already exists').addClass('messageboxerror').fadeTo(900,1);});}
else
{$("#msgbox3").fadeTo(200,0.1,function()
{$(this).html('Game IP is not in database ').addClass('messageboxok').fadeTo(900,1);});}});});});
function bookmark_us(url, title){

	if (window.sidebar) // firefox
	    window.sidebar.addPanel(title, url, "");
	else if(window.opera && window.print){ // opera
	    var elem = document.createElement('a');
	    elem.setAttribute('href',url);
	    elem.setAttribute('title',title);
	    elem.setAttribute('rel','sidebar');
	    elem.click();
	}
	else if(document.all)// ie
	    window.external.AddFavorite(url, title);
	else {
        alert('Your browser does not support bookmarks Press ctrl+D (ctrl+T for old Opera);');}

	}

function popunder()
{
	// Check if the DOM is supported
	if(!document.getElementById || !document.createTextNode){return;}
	// Define variables
	var pa=document.getElementById('popad');
	var ft=document.getElementById('popad_footage');
	var closeLinkTitle='Activate to close';
	var closeLinkId='popad_close';
	var closeLinkText='';
	var dynamicClass='dynamic';
	// check if all elements are available
	if(!pa || !ft){return;}
	// set class to indicate dynamic functionality
	pa.className=dynamicClass;
	// function to remove the ad
	function killad(e)
	{
		// if the link is the close link, don't follow it.
		if(this.id==closeLinkId)
		{	
			stoplink(e);
		}
		// if the  link has a rel external, then open it in a new window
		if(this.rel=='external')
		{
			window.open(this.href);				
			stoplink(e);
		}
		pa.parentNode.removeChild(pa);
	}
	// create new link to close the ad, and set its attributes 			
	var closelink=document.createElement('a');
	closelink.setAttribute('href','#');
	closelink.setAttribute('title',closeLinkTitle);
	closelink.setAttribute('id',closeLinkId);
	closelink.appendChild(document.createTextNode(closeLinkText));
	ft.getElementsByTagName('a')[0]?ft.insertBefore(closelink,ft.firstChild):ft.appendChild(closelink);
	// append the kill ad function
	var popadlinks=pa.getElementsByTagName('a');
	for(var i=0;i<popadlinks.length;i++)
	{
		addEvent(popadlinks[i],'click',killad)
	}
}
function addEvent(obj,type,fn)
{
	if (obj.addEventListener) 
	{
		obj.addEventListener( type, fn, false );
	} else if (obj.attachEvent) {
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
	}
}
function stoplink(e)
{
	if (window.event) {
      window.event.cancelBubble = true;
      window.event.returnValue = false;
    }
    if (e && e.stopPropagation && e.preventDefault) {
      e.stopPropagation();
      e.preventDefault();
    }
}
addEvent(window,'load',popunder)
	
		
