document.onkeydown=function(e){if(e==null){keycode=event.keyCode;}
else{keycode=e.which;}
if(keycode==27){$('#modal').remove();$('#game_embed').show();$("#mask").fadeOut(function()
{$(this).remove();});}};(function($){$.fn.extend
({buildModal:function(options)
{var default_opt={opacity:'0.8',background:'#000'}
var opt=$.extend(default_opt,options);return $(function(options)
{var winW=$(window).width();var winH=$(window).height()>$(document).height()?$(window).height():$(document).height();var mask=$("<div/>").attr("id","mask").css({'background':opt.background,'position':'absolute','z-index':'9999999999999999999','width':'100%','height':winH,'opacity':opt.opacity,'top':0});var modal=$("<div/>").attr("id","modal").css
({'background':'white','position':'absolute','z-index':'99999999999999999999','top':0,})
$('body').append(mask);$('body').append(modal);mask.click(function()
{$('#game_embed').show();$('#modal').remove();$(this).fadeOut(function()
{$(this).remove();});})});}})})(jQuery);(function($)
{jQuery.fn.extend({ItemOverlay:function(options)
{return this.each(function()
{var obj=$(this); 
   $(obj).hover(function(){   var h=15;   var diff=Math.floor($(this)[0].scrollHeight/h);   
 $(this).stop(true,true).animate({height:diff*h},500);   
       
   },function(){$(this).stop(true,true).animate({height:'15px'},500);   
   });})}})})(jQuery);$(document).ready(function()
{$.ajax({type:'post',url:siteurl+'home/ajaxTopStats',beforeSend:function(){$("<img/>").attr({"id":"loader_top_stats","src":siteurl.replace("frontend_dev.php/","")+"sfFormExtraPlugin/images/indicator.gif"}).css({}).appendTo($("#user_lvl"));},success:function(data,state){$("#loader_top_stats").remove();$("#user_lvl").html(data);},error:function(err,r){},dataType:'html'});$('.a_register').click(function()
{$('#game_embed').hide();$(document).buildModal();$.get(siteurl+'/register',function(data){$("#modal").css({'width':'400px','top':'50px','left':'35%','position':'fixed'})
$('#modal').html(data);});return false;});$('.a_login').click(function()
{$('#game_embed').hide();$(document).buildModal();$.get(siteurl+'/login',function(data){$("#modal").css({'width':'400px','top':'50px','left':'35%','position':'fixed'})
$('#modal').html(data);});return false;});$('#acc_password').click(function()
{$('#game_embed').hide();$(document).buildModal();$.get(siteurl+'/password',function(data){$("#modal").css({'width':'400px','top':'50px','left':'35%','position':'fixed'})
$('#modal').html(data);});return false;});})
