var intrebare = "Я с перепугу по экрану ударил :)";var oponent1 = "Весело";var oponent2 = "Понравилось";var img1 = "
http://img-fotki.yandex.ru/get/5634/53772298.2/0_977f1_11a0b185_XS";var img2 = "
http://img-fotki.yandex.ru/get/5634/53772298.2/0_977f1_11a0b185_XS";var com1 = "Проголосовал за Весело ! Друзья проголосуйте тоже!";var com2 = "Проголосовал за Понравилось ! Друзья проголосуйте тоже!";var adresa = "
http://letsvote.ru/view_230";var title = oponent1+" vs "+oponent2+" | "+intrebare;function getVote(int){if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else {// code for IE6, IE5, IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("poll").innerHTML=xmlhttp.responseText; } }xmlhttp.open("GET","/vote.php?id=230&ips=94.179.112.239xmlhttp.send();}function pause(n){ today=new Date() today2=today while((today2-today)<=n){ today2=new Date() }}function godd(){pause(3000);window.location=adresa;}var id_brand = 0;var iterations = 0;var total_count = new Array();total_count[1] = 0;total_count[2] = 0;var texts = new Object();texts.facebook = new Array();texts.facebook[1] = new Object();texts.facebook[1].summary = com1;texts.facebook[1].title=title;texts.facebook[1].url = adresa;texts.facebook[1].image = img1;texts.facebook[2] = new Object();texts.facebook[2].summary= com2;texts.facebook[2].title=title;texts.facebook[2].url = adresa;texts.facebook[2].image = img2;texts.twitter = new Array();texts.twitter[1] = new Object();texts.twitter[1].title = com1;texts.twitter[1].url = adresa;texts.twitter[2] = new Object();texts.twitter[2].title = com2;texts.twitter[2].url = adresa;texts.odnoklassniki = new Array();texts.odnoklassniki[1] = new Object();texts.odnoklassniki[1].title = com1;texts.odnoklassniki[1].url = adresa;texts.odnoklassniki[2] = new Object();texts.odnoklassniki[2].title = com2;texts.odnoklassniki[2].url = adresa;function voteFacebook(){ var url = "
http://www.facebook.com/sharer.php?s=100&p[title]="+encodeURIComponent(texts.facebook[id_brand].title)+"&p[summary]="+encodeURIComponent(texts.facebook[id_brand].summary)+"&p[url]="+encodeURIComponent(texts.facebook[id_brand].url)+" window.open(url,'','toolbar=0,status=0,width=626,height=436'); $.modal.close();}function voteOdnoklassniki(){ var url = "
http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st._surl="+encodeURIComponent(texts.odnoklassniki[id_brand].url)+" window.open(url,'','toolbar=0,status=0,width=626,height=436'); $.modal.close();}function voteTwitter(){ var url = "
http://twitter.com/share?text="+encodeURIComponent(texts.twitter[id_brand].title)+"&url="+encodeURIComponent(texts.twitter[id_brand].url)+" window.open(url,'','toolbar=0,status=0,width=626,height=436'); $.modal.close();}function calculateFB(idbrand){ var facebook = 'https://api.facebook.com/method/fql.query?query=select total_count from link_stat where url="' +encodeURIComponent(texts.facebook[idbrand].url) + '"&format=json $.getJSON(facebook, function(data) { upCounter([idbrand],data[0].total_count); }); }function calculateTwitter(idbrand){ var twitter = '
http://urls.api.twitter.com/1/urls/count.json?url=' +encodeURIComponent(texts.twitter[idbrand].url) + ' $.getJSON(twitter, function(data) { upCounter([idbrand],data.count); }); }function calculateodnoklassniki(idbrand){ var odnoklassniki = '
http://odnoklassniki.ru/share.php?act=count&index='+idbrand+'&url=' +encodeURIComponent(texts.odnoklassniki[idbrand].url) + ' VK = new Object(); VK.Share = {}; VK.Share.count = function(index, count) { upCounter([index],count); } $.getJSON(odnoklassniki, function(data) { }); }function calculateStart(){ calculateFB(1); calculateFB(2); calculateTwitter(1); calculateTwitter(2); calculateodnoklassniki(1); calculateodnoklassniki(2);}function upCounter(id,count){ total_count[id]+=count; $('#counter-'+id).html(total_count[id]); iterations++; if(iterations == 12){ //$.post("/en/ajax",{action:"update-points",id_battle:10,points_1:total_count[15], points_2:total_count[16]}); //$.post("/en/ajax",{action:"update-points",id_battle:17,points_1:total_count[30], points_2:total_count[29]}); }}var lang = { years: ['an', 'ani'], months: ['luna', 'luni'], days: ['zi', 'zile'], hours: ['ora', 'ore'], minutes: ['minut', 'minute'], seconds: ['secunda', 'secunde'], plurar: function(n) { return (n == 1 ? 0 : 1); } }$(document).ready(function(){ $("#countdown").countdown(new Date(2011, 2, 20, 23, 59, 59), {suffix:'',prefix:'A ramas:', finish: '',lang:lang}); calculateStart();});function iwant(){ $.post("/en/ajax",{action:"iwant",brand_1: $('#br_1').val(), brand_2:$('#br_2').val()}); $('#submit').html('Thank you!');}function showLogin1(b){ id_brand = b; $('#login-window').modal({});}function showLogin2(b){ id_brand = b; $('#login-window2').modal({});}
| | Список Битв Следующая битва | | |
|
| |
| |
|
| |
| |
| | | | |
$(document).ready(function() { $("#tabs").tabs(); }); new BackCounter([$('countdown')]).addEvent('completed', function(){ $('battle-ended').setStyle('display','block'); $('battle-timer').setStyle('display','none'); }).start();