(function ($) {
$(document).ready(function() {
try {
var lang = "en";
var host = window.location.hostname;
var hostArr = host.split('.');
if(hostArr[0].length == 2){
lang = hostArr[0];
}
//PopUp by country
if(Cookies["showed_popup"] == undefined){
var yandex = ['AM', 'AZ', 'BY', 'GE', 'KG', 'KZ', 'MD', 'RU', 'TJ', 'TM', 'UA', 'UZ'];
if(yandex.indexOf(countryCode()) >= 0){
var $div = $('
');
$div.attr('id', 'lightbox_popup');
var $img = $('
').attr('id', 'popup_img').css('cursor', 'pointer');
if(isDepositor()){
$img.attr('src', 'http://downloads.scratchmania.com/theme/images/dep.png');
} else {
$img.attr('src', 'http://downloads.scratchmania.com/theme/images/non_dep.png');
}
$div.append($img);
$('body').append($div);
$('#popup_img').load(function(){
$('#lightbox_popup').lightbox();
$('#lightbox_popup').parent().attr('class', 'poli_popup');
});
$('#popup_img').click(function(){OpenGamesWindow();});
Cookies.create("showed_popup",'yes',1);
}
}
} catch(e) {
console.debug(e);
}
});
}(jQuery));