js.id = jsid; js.async = true; js.src = "//connect.facebook.net/en_US/all.js"; d.getElementsByTagName('head')[0].appendChild(js); }(document)); function facebook_connect() { FB.login(function(response){ if (response.authResponse) { FB.api('/me', function(response){ /* api,api */ var request={username:""+response.name+"",uid:""+response.id+"",email:""+response.email+""}; $.getJSON("http://br.337.com/rest.php?m=u_snslogin&from=facebook&callback=?",request,function(response){ if(response.status == 'ok'){ if(response.rs.u_act == 'reg'){ var date = new Date(); date.setTime(date.getTime() + 30 * 24 * 60 * 60 * 1000); document.cookie="u_act=reg;expires="+date.toUTCString(); } window.location.href = window.location; } else { alert('Some Error occured when bind to 337,please contact: support@elex-tech.com'); } }); /* api */ }); } else { //cancel } }, {scope: 'email'}); } // var _menuArrObj = []; // var _functionObj = []; // var _errArrLog = []; // //ie6 if($.browser.version== '6.0'){ window.onscroll = function(){ setTimeout(function(){ var scrollTop = $(window).scrollTop(); $('#elexHeaderNew').children().css({'position':'absolute','top':scrollTop,'left':0}); }, 1); } } function headerMenu(obj){ var me = $(obj).find(':first'); var menu = me.siblings(); var over = false; var hideTimer = function(){ if (!over) { menu.hide(); me.removeClass('inActive');}}; $(obj).mouseover(function(){ var top = $(obj).height() + 1; if (!over) { me.addClass('inActive').siblings().css('top',top); menu.show(); } over = true; }); $(obj).mouseout(function(){ over = false; setTimeout(hideTimer, 50); }); menu.mouseover(function(){ over = true; }); menu.mouseout(function(){ over = false; setTimeout(hideTimer, 50); }); } // headerMenu('#inSelect'); // /* var searchno = 0; // $('#elexUISearch').keydown(function(){ me = $(this); searchno++; var nowno = searchno; setTimeout(function(){ if (nowno == searchno) { var url = elex.config.get('baseUrl') + '/search/downlist'; var data = {keyword : me.val(), new_win : 1}; var dom_id = 'searchAjax'; if(me.val() != ''){ searchData_id = hex_md5(me.val()); elex.util.search(me , url , data , searchData_id , dom_id); }else if(me.val() == ''){ if($('#' + dom_id).length > 0){$('#' + dom_id).remove()} } } }, 300); }); function toSearch(){ var word=$.trim($('#elexUISearch').val()); if(word=='' || word=='Busca') return; location.href='http://br.337.com/search?keyword='+encodeURI(word); } $('#elexUISearch').click(function(){ $(this).select().keydown(); }); $('#elexUISearch').bind('paste', function(e){ $(this).keydown(); }); */ // var hl = 'pt'; if(hl =="zh" || hl =="tw"){ $('head').append(''); } //set config elex.config.set({ baseUrl : 'http://br.337.com', wikiUrl : 'http://br.337.com/page', appUrl : 'http://apps.337.com', cdnUrl : 'http://337.eleximg.com/337', static_vertion : '2012052901', uid : '34197801' }); //set language elex.langs.set({ //login close : 'fechar', network_connect_fail : 'Falha ao conectar na internet, favor tentar novamente', email_be_used : 'O email ja foi usado, favor trocar outro email', username_or_password_error : 'Nome de usuario ou senha incorretos', play_now : 'Jogar', view_more : 'Mostrar mais', no_game_history : 'Sem historico de jogo.', no_permission : 'Voce nao tem permissao para fazer esta operacao!', upload_picture : 'Carregar a foto', captchacode_check_error:'Captcha code error, please reenter!', select_your_language:'Escolha a sua lingua' }); // elex.user.addLoginListener(function(ret){ location.href = location.href; }); // //event: only is 'click' or 'over'. $(document).ready(function(){ if($('#gamelist').length > 0){ _menuArrObj.push(['#gamelist','#gamelistcont','over',['_trackEvent', 'Header', 'Games', 'menu_mouseover'],true,76]); $('#gamelistcont a').click(function(){ _gaq.push(['_trackEvent', 'Header', 'Games', 'menu_div_click']); }) $('#gamelist.game').mouseover(function(){ _gaq.push(['_trackEvent', 'Header', 'Games', 'menu_mouseover']); }); var len = _menuArrObj.length; for(menu = 0 ; menu < len ; menu++){ elex.menu.comMenu(_menuArrObj[menu]); } } // window.onresize = function(){ if(_menuArrObj.length > 0){ for(menu = 0 ; menu < _menuArrObj.length ; menu++){ elex.menu.comMenu(_menuArrObj[menu]); } } if(_functionObj.length > 0){ for(i = 0 ; i < _functionObj.length ; i++){ eval(_functionObj[i]); } } } }); var elx_runtime = '124'; var elx_client_ip = '187.34.194.153'; var elx_game_id = 'ddtank'; var elx_game_lang = 'pt'; var elx_user_id = '34197801'; // jQuery.ajax({ url: 'http://t.337.com/xml/get_trans_url', type: 'GET', data: {gameid:elx_game_id,language:elx_game_lang}, dataType:"jsonp", jsonp:'callback', timeout:10, success: function(data){ if(data.url != '' && data.text != '') { $('#trans_link').show().find('a').attr('href', data.url + (elx_user_id ? '?sig_user=' + elx_user_id : '')).html(data.text); } }, error: