function ajaxFunction() {
	var ajax;
	try {
		ajax = new XMLHttpRequest();
	} catch (e) {
		try {
			ajax = new ActiveXObject('Msxml2.XMLHTTP');
		} catch (e) {
			try {
				ajax = new ActiveXObject('Microsoft.XMLHTTP');
			} catch (e) {alert('Your browser does not support AJAX!');
				return false;
			}
		}
	}
	return ajax;
}

if( window!= window.top ) {
top.location.href = location.href;
}

function addBookmark(url,name)
{
  if(window.sidebar && window.sidebar.addPanel) {
        window.sidebar.addPanel(name,url,'');
  } else if(window.opera && window.print) { 
          var e=document.createElement('a');
          e.setAttribute('href',url);
          e.setAttribute('title',name);
          e.setAttribute('rel','sidebar');
          e.click();
  } else if(window.external) {
          try {
              window.external.AddFavorite(url,name);
          }
          catch(e){}
  }
  else
          alert('To add our website to your bookmarks use CTRL+D on Windows and Linux and Command+D on the Mac.');
}

function adsenseResumeRequestedEvent()
	{
		document.write('Ad Complete Event Fired!');
	}
	
function removeAdSwf() {
  document.getElementById('afg-adloader').style.visibility = 'hidden';
}
var geoip_container = document.getElementById('geoip_container');

function closeGeo() {
	$('#geoip_container').css('display','none');
}

function like_itnew(event){event.preventDefault();var $val=$('div#ratethis').data('gameid');
if($val){$('a.icon.happy').css('display','none');
$('a.icon.sad').css('display','none');
$('div.shaddow_happy').css('display','none');
$('div.shaddow_sad').css('display','none');
$('div.shaddow_happy_text').css('display','none');
$('div.rating_bar').css('visibility','hidden');
$('div.shaddow_sad_text').css('display','none');
$('div.message').css('display','block');
$('div.rating_votes_total').css('visibility','hidden');
$.post('http://www.nx8.com/vote.php',{id:$val,like:1})}}


function hate_itnew(event){event.preventDefault();var $val=$('div#ratethis').data('gameid');if($val){$('a.icon.happy').css('display','none');
$('a.icon.sad').css('display','none');
$('div.shaddow_happy').css('display','none');
$('div.shaddow_sad').css('display','none');
$('div.shaddow_happy_text').css('display','none');
$('div.rating_bar').css('visibility','hidden');
$('div.shaddow_sad_text').css('display','none');
$('div.message').css('display','block');
$('div.rating_votes_total').css('visibility','hidden');
$('div.rating_votes_total').css('visibility','hidden');
$.post('http://www.nx8.com/vote.php',{id:$val,like:0})}}


function error_no_image(){$(this).attr('src',$imgPath+'noimage.gif')}

function maxWindow()
{
  window.moveTo(0,0);

  if (document.all)
  {
    top.window.resizeTo(screen.availWidth,screen.availHeight);
  }
  else if (document.layers||document.getElementById)
  {
    if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
    {
      top.window.outerHeight = screen.availHeight;
      top.window.outerWidth = screen.availWidth;
    }
  }
}
function mpersodis()
{
}
function closePreRollAd(kill)
{	if(kill)
	{document.getElementById('showGameLoadingBox').innerHTML = ''; document.getElementById('showGameLoadingBox').innerHTML = '';}
	else
	{document.getElementById('showGameLoadingBox').style.display = 'none'; document.getElementById('showGameLoadingBox').style.visibility = 'hidden';}
	document.getElementById('showGameLoadedBox').style.display = 'block'; document.getElementById('showGameLoadedBox').style.visibility = 'visible';}

    window.onload = maxWindow;

function maxWindow() {
        window.moveTo(0, 0);


        if (document.all) {
            top.window.resizeTo(screen.availWidth, screen.availHeight);
        }

        else if (document.layers || document.getElementById) {
            if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth) {
                top.window.outerHeight = screen.availHeight;
                top.window.outerWidth = screen.availWidth;
            }
        }
    }

