(function(b){b.fn.squares=function(d){if(typeof(d)=="object"){d=b.extend({"interval":null,"duration":1000},d);var c=[];for(i=0;i<=10;i++){for(j=0;j<=10;j++){c[i*10+j+i]=(i*10)+"% "+(j*10)+"%"}}}b(this).each(function(){var e=b(this);if(typeof(d)=="object"){e.css("opacity",0).data("freeBgPositions",c).children().append("<div></div>").children().mouseover(function(){a(b(this),d.duration)}).add(e.children()).each(function(){var f=Math.floor(Math.random()*e.data("freeBgPositions").length);b(this).css("background-position",c[f]).data("prevPosition",c[f]);e.data("freeBgPositions").splice(f,1)});e.css("opacity",1);if(d.interval!=null){e.data("interval",d.interval).data("duration",d.duration).data("intervalID",setInterval(function(){a(e.children().children().eq(Math.floor(Math.random()*e.children().size())),d.duration)},d.interval))}}else{if(d==false){clearInterval(e.data("intervalID"))}else{if(d==true){e.data("intervalID",setInterval(function(){a(e.children().children().eq(Math.floor(Math.random()*e.children().size())),e.data("duration"))},e.data("interval")))}}}});return b(this)};function a(c,g){if(!c.data("action")){c.data("action",true);var d=c.parent().parent().data("freeBgPositions"),f=Math.floor(Math.random()*d.length),e;if(c.data("transparent")){c.fadeTo(g,1,function(){b(this).parent().css("background-position",d[f]);e=d[f];d[f]=b(this).parent("div").data("prevPosition");b(this).data("transparent",false).data("action",false).parent().data("prevPosition",e)})}else{c.fadeTo(g,0,function(){b(this).css("background-position",d[f]);e=d[f];d[f]=b(this).data("prevPosition");b(this).data("prevPosition",e).data("transparent",true).data("action",false)})}c.parent().parent().data("freeBgPositions",d)}}})(jQuery);$(function(){var d=$("#kt"),c=$("#continiue");function b(){d.css("padding-bottom",0);if($(window).width()/2>=d.width()+600){d.data("positions")[Math.round(Math.random()*5)+1]()}else{if($(window).width()/2>=d.width()+350){d.data("positions")[Math.round(Math.random()*3)+1]()}else{if($(window).width()/2>=d.width()+150){d.data("positions")[Math.round(Math.random())+1]()}else{d.data("positions")[0]();d.css("padding-bottom",200)}}}}d.data("positions",[function(){d.css({"top":$("#squares").offset().top+$("#squares").height()+50,"left":($(window).width()-d.width())/2});c.css({"top":d.offset().top+75,"left":($(window).width()-c.width())/2})},function(){d.css({"top":$("#squares").offset().top+$("#squares").height()-7,"left":$(window).width()/2-d.width()-50});c.css({"top":$("#squares").offset().top+$("#squares").height()-(100+c.height())/2,"left":$(window).width()/2+100})},function(){d.css({"top":$("#squares").offset().top+$("#squares").height(),"left":$(window).width()/2+50});c.css({"top":$("#squares").offset().top+$("#squares").height()-(100+c.height())/2,"left":$(window).width()/2-c.width()-100})},function(){d.css({"top":$("#squares").offset().top-d.height(),"left":$(window).width()/2-d.width()-250+((/.com$/.test(location.host))?11:0)});c.css({"top":$("#squares").offset().top+(100-c.height())/2,"left":$(window).width()/2+300})},function(){d.css({"top":$("#squares").offset().top-d.height(),"left":$(window).width()/2+251});c.css({"top":$("#squares").offset().top+(100-c.height())/2,"left":$(window).width()/2-c.width()-300})},function(){d.css({"top":$("#squares").offset().top+200+(100-d.height())/2,"left":$("#squares").offset().left-d.width()-50});c.css({"top":$("#squares").offset().top+200+(100-c.height())/2,"left":$("#squares").offset().left+$("#squares").width()+50})},function(){d.css({"top":$("#squares").offset().top+200+(100-d.height())/2,"left":$("#squares").offset().left+$("#squares").width()+50});c.css({"top":$("#squares").offset().top+200+(100-c.height())/2,"left":$("#squares").offset().left-c.width()-50})}]);$("#squares").squares({interval:1000,duration:2000});function a(h,f,g){var e=setInterval(function(){if(h){f();clearInterval(e)}},g)}a(function(){return d.width()},function(){$(document).one("mousemove",function(){b();d.add($("#language")).animate({"opacity":1},3000,function(){$("#language").fadeOut(20000)});setTimeout(function(){c.animate({"opacity":1},2000,function(){$(this).fadeOut(10000)})},1000)}).one("click",function(){location.href="/main"})},250);$(window).resize(b)});
