var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); /*------------------------------------------------------------------------ # plg_extravote - ExtraVote Plugin # ------------------------------------------------------------------------ # author Jesús Vargas Garita # Copyright (C) 2010 www.joomlahill.com. All Rights Reserved. # @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL # Websites: http://www.joomlahill.com # Technical Support: Forum - http://www.joomlahill.com/forum -------------------------------------------------------------------------*/ function JVXVote(id,i,total,total_count,xid,show_counter,show_rating,rating_mode){ var currentURL = window.location; var live_site = currentURL.protocol+'//'+currentURL.host+ev_basefolder; var info = document.getElementById('extravote_'+id+'_'+xid); var text = info.innerHTML; if (info.parentNode.className.indexOf('voted')==-1) { info.innerHTML=' '+''+extravote_text[1]+''; var ajax=new XMLHttpRequest(); ajax.onreadystatechange=function() { var response; if(ajax.readyState==4){ setTimeout(function(){ response = ajax.responseText; if(response=='thanks') info.innerHTML=''+extravote_text[2]+''; if(response=='login') info.innerHTML=''+extravote_text[3]+''; if(response=='voted') info.innerHTML=''+extravote_text[4]+''; },500); setTimeout(function(){ if(response=='thanks'){ text = ''; var newtotal = total_count+1; var newrating = ((total + i)/(newtotal)).toFixed(2); if(show_rating!=0){ if(rating_mode==1) { text+=extravote_text[7].replace('%s', newrating ); } else { text+=extravote_text[7].replace('%s', Math.round(newrating*20)+'%' ); } } if(show_counter!=0){ if(newtotal!=1) text+=extravote_text[5].replace('%s', newtotal ); else text+=extravote_text[6].replace('%s', newtotal ); } document.getElementById('rating_'+id+'_'+xid).style.width=parseInt(newrating*20)+'%'; } info.innerHTML=text; },2000); } } ajax.open("GET",live_site+"/index.php?option=com_ajax&format=raw&plugin=extravote&user_rating="+i+"&cid="+id+"&xid="+xid,true); ajax.send(null); info.parentNode.className = info.parentNode.className + ' voted'; } } }