function share_this(c){var a="",b=window.document.location.href;if(b.charAt(b.length-1)=="#")b=b.substring(0,b.length-1);var d=encodeURIComponent(window.document.title);if(c=="meneame")a="http://meneame.net/submit.php?url="+b;else if(c=="delicious")a="http://delicious.com/post?title="+d+"&url="+b;else if(c=="digg")a="http://digg.com/submit?phase=2&url="+b+"&title="+d;else if(c=="facebook")a="http://www.facebook.com/sharer.php?u="+b;else if(c=="twitter")a="http://twitter.com/home?status="+d+"+-+"+
b;else if(c=="tuenti")a="http://www.tuenti.com/?m=Share&func=index&url="+b;a!=""&&window.open(a);return false}function logged_in(){return $(".logged").html()!=null}
function display_reply_form(c){if(logged_in()){var a='<br class="vacio" />';a+='<form id="comment_reply" action="/comments/'+c+'/reply" method="post">';a+='<input type="hidden" value="'+window._token+'" name="authenticity_token" />';a+='<div class="title"><b>Escribe aqu\u00ed tu respuesta al comentario:</b></div>';a+='<div class="body bluebox"><textarea name="comment_reply" cols="60" rows="10" class="campos2"></textarea>';a+='<br /><input name="Responder" type="submit" value="Responder" class="button" /></div></form>';
$("#comentario-"+c+" .comment-form").html(a);$("#comentario-"+c+" .comment-form").show()}else jConfirm("Responder a comentario","Para poder responder a un comentario debes ser usuario registrado. \u00bfDeseas registrarte ahora?",function(){document.location.href="/signup"});return false}
function display_status_reply_form(c,a){if(logged_in()){var b='<br class="vacio" />';b+='<form id="comment_reply" action="/perfil/'+c+"/statuses/"+a+'/reply" method="post">';b+='<input type="hidden" value="'+window._token+'" name="authenticity_token" />';b+='<div class="title"><b>Escribe aqu\u00ed tu respuesta al mensaje de estado:</b></div>';b+='<div class="body bluebox"><textarea name="comment_reply" cols="60" rows="10" class="campos2"></textarea>';b+='<br /><input name="Responder" type="submit" value="Responder" class="button" /></div></form>';
$("#comentario-"+a+" .comment-form").html(b);$("#comentario-"+a+" .comment-form").show()}else jConfirm("Responder a mensaje de estado","Para poder responder a un mensaje de estado debes ser usuario registrado. \u00bfDeseas registrarte ahora?",function(){document.location.href="/signup"});return false}function report_abuse(c){jConfirm("Denunciar comentario","\u00bfEst\u00e1 seguro de querer denunciar este comentario?",function(){document.location.href=c})}
function switch_panel(c,a){var b="#li_"+a,d="#li_"+c,h="#"+a,f="#"+c,g=$("#li_"+a).html(),i=$("#li_"+c+" > a").html();$(d).addClass("current");$(d).html(i);$(b).removeClass("current");$(b).html('<a href="#" onclick="switch_panel(\''+a+"', '"+c+"'); return false;\">"+g+"</a>");$(h).slideUp("fast");$(f).slideDown("fast")}function check_all(c,a){$("#"+a+" :checkbox").attr("checked",$("#"+c).is(":checked"))}
function toggle_chat(c,a){var b="";if($("#chatbutton").hasClass("active")){$(".chat_container").slideUp("slow");$(".chat").html(b);$("#chatbutton").html("Entrar al chat");$("#chatbutton").removeClass("active")}else{b='<iframe width="100%" height="400" src="http://futbol.irc-hispano.es?canal='+c+"&nick=";if(a!=null)b+=a;b+='" frameborder="0"></iframe>';$(".chat").html(b);$(".chat_container").slideDown("slow");$("#chatbutton").html("Salir del chat");$("#chatbutton").addClass("active")}}
function scroll_to(c){c=$(c).offset().top;$("html:not(:animated),body:not(:animated)").animate({scrollTop:c},1200)}
function valorizar(){jQuery.each($(".ctrl_valorizar"),function(){var c=this.id.split("_"),a=c[1]+"_"+c[2],b=' disabled="disabled"';$(this).attr("ratecount");var d=Math.round($(this).attr("rateavg")),h=this.innerHTML,f="";if(logged_in()){b="";f='<input type="hidden" name="model_id"   value="'+c[2]+'"/>';f+='<input type="hidden" name="model_type" value="'+c[1]+'"/>'}c='<form action ="/rateit/'+c[2]+'" method="POST" name="valoracion_'+a+'">';for(var g=1;g<6;g++){var i="";if(g==d)i=' checked="checked"';
c+='<input name="usrrate_'+a+'" value="'+g+'" type="radio" class="usrrate_'+a+'"'+i+b+"/>"}c+=f;c+="</form>";this.innerHTML=c+h;if(logged_in())rateit(a,"true");else{rateit(a,"false");ratestarmsg(0)}})}function ratestarmsg(c){var a=[];a[0]="Debe estar logueado para votar";jQuery.each($("div.star-rating-readonly a"),function(){this.title=a[c];this.html=a[c]})}
function rateit(c,a){$(".usrrate_"+c).rating({required:"hide"});a=="true"&&$(".usrrate_"+c).click(function(){var b=$(this).parents("form");$.ajaxSetup({beforeSend:function(d){d.setRequestHeader("Accept","text/javascript")}});$.ajax({type:"POST",url:b.attr("action"),data:b.serialize(),dataType:"script"})})}
$(document).ready(function(){$("#comentarios .pagination a").live("click",function(){scroll_to("#comentarios");$(".pagination").html('<img src="/images/common/ajax-loader.gif" alt="Cargando..." />');$.getScript(this.href);try{_gaq.push(["_trackPageview",url]);_gaq.push(["b._trackPageview",url])}catch(c){}return false});$(".timeago").timeago();$.getScript("/javascripts/star-rating/jquery.rating.js",function(){valorizar()});$("table.admin_table tr:odd").css("background-color","#fbfbfb")});
function remove_fields(c){$(c).prev("input[type=hidden]").val("1");$(c).closest(".fields").hide()}function add_fields(c,a,b,d){var h=(new Date).getTime(),f=new RegExp("new_"+a+"_image","g");b=b.replace(f,h+"_image");f=new RegExp("new_"+a,"g");b=b.replace(f,h);$(c).parent().before(b);tinyMCE.execCommand("mceAddControl",false,d+"_"+a+"_attributes_"+h+"_excerpt")};(function(c){c.saeta={okText:"Aceptar",cancelText:"Cancelar",confirm:function(a,b,d){a='<div id="dialog" title="'+a+'">';a+='<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>'+b+"</p></div>";c("#dialog").remove();c("body").after(a);c(function(){c("#dialog").dialog({bgiframe:true,resizable:false,height:180,modal:true,overlay:{backgroundColor:"#000",opacity:0.5},buttons:{Aceptar:function(){c(this).dialog("close");d()},Cancelar:function(){c(this).dialog("close")}}})});
return false}};jConfirm=function(a,b,d){c.saeta.confirm(a,b,d)}})(jQuery);(function(c){c.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/({.*})/,single:"metadata"},setType:function(a,b){this.defaults.type=a;this.defaults.name=b},get:function(a,b){var d=c.extend({},this.defaults,b);if(!d.single.length)d.single="metadata";var h=c.data(a,d.single);if(h)return h;h="{}";var f=function(j){if(typeof j!="string")return j;return j=eval("("+j+")")};if(d.type=="html5"){var g={};c(a.attributes).each(function(){var j=this.nodeName;if(j.match(/^data-/))j=j.replace(/^data-/,
"");else return true;g[j]=f(this.nodeValue)})}else{if(d.type=="class"){var i=d.cre.exec(a.className);if(i)h=i[1]}else if(d.type=="elem"){if(!a.getElementsByTagName)return;i=a.getElementsByTagName(d.name);if(i.length)h=c.trim(i[0].innerHTML)}else if(a.getAttribute!=undefined)if(i=a.getAttribute(d.name))h=i;g=f(h.indexOf("{")<0?"{"+h+"}":h)}c.data(a,d.single,g);return g}}});c.fn.metadata=function(a){return c.metadata.get(this[0],a)}})(jQuery);(function(c){function a(){var f=h.parse(this.title);isNaN(f)||c(this).text(b(f));return this}function b(f){return h.inWords((new Date).getTime()-f.getTime())}function d(f,g){return(c.isFunction(f)?f(g):f).replace(/%d/i,g)}c.timeago=function(f){return f instanceof Date?b(f):typeof f=="string"?b(c.timeago.parse(f)):b(c.timeago.parse(c(f).attr("title")))};var h=c.timeago;c.extend(c.timeago,{settings:{refreshMillis:6E4,allowFuture:false,strings:{prefixAgo:"hace",prefixFromNow:"dentro de",suffixAgo:"",
suffixFromNow:"",seconds:"menos de un minuto",minute:"un minuto",minutes:"unos %d minutos",hour:"una hora",hours:"%d horas",day:"un d\u00eda",days:"%d d\u00edas",month:"un mes",months:"%d meses",year:"un a\u00f1o",years:"%d a\u00f1os"}},inWords:function(f){var g=this.settings.strings,i=g.prefixAgo,j=g.suffixAgo||g.ago;if(this.settings.allowFuture){if(f<0){i=g.prefixFromNow;j=g.suffixFromNow||g.fromNow}f=Math.abs(f)}f=f/1E3;var m=f/60,n=m/60,l=n/24,o=l/365;g=f<45&&d(g.seconds,Math.round(f))||f<90&&
d(g.minute,1)||m<45&&d(g.minutes,Math.round(m))||m<90&&d(g.hour,1)||n<24&&d(g.hours,Math.round(n))||n<48&&d(g.day,1)||l<30&&d(g.days,Math.floor(l))||l<60&&d(g.month,1)||l<365&&d(g.months,Math.floor(l/30))||o<2&&d(g.year,1)||d(g.years,Math.floor(o));return c.trim([i,g,j].join(" "))},parse:function(f){f=c.trim(f);f=f.replace(/-/,"/").replace(/-/,"/");f=f.replace(/T/," ").replace(/Z/," UTC");f=f.replace(/([\+-]\d\d)\:?(\d\d)/," $1$2");return new Date(f)}});c.fn.timeago=function(){var f=this;f.each(a);
var g=h.settings;g.refreshMillis>0&&setInterval(function(){f.each(a)},g.refreshMillis);return f};document.createElement("abbr")})(jQuery);(function(c){c.ajaxSettings.accepts._default="text/javascript, text/html, application/xml, text/xml, */*"})(jQuery);(function(c){c.fn.reset=function(){return this.each(function(){if(typeof this.reset=="function"||typeof this.reset=="object"&&!this.reset.nodeType)this.reset()})};c.fn.enable=function(){return this.each(function(){this.disabled=false})};c.fn.disable=function(){return this.each(function(){this.disabled=true})}})(jQuery);
(function(c){c.extend({fieldEvent:function(a,b){var d=a[0]||a,h="change";if(d.type=="radio"||d.type=="checkbox")h="click";else if(b&&(d.type=="text"||d.type=="textarea"||d.type=="password"))h="keyup";return h}});c.fn.extend({delayedObserver:function(a,b){var d=c(this);if(typeof window.delayedObserverStack=="undefined")window.delayedObserverStack=[];if(typeof window.delayedObserverCallback=="undefined")window.delayedObserverCallback=function(f){var g=window.delayedObserverStack[f];g.timer&&clearTimeout(g.timer);
g.timer=setTimeout(function(){g.timer=null;g.callback(g.obj,g.obj.formVal())},g.delay*1E3);g.oldVal=g.obj.formVal()};window.delayedObserverStack.push({obj:d,timer:null,delay:a,oldVal:d.formVal(),callback:b});var h=window.delayedObserverStack.length-1;d[0].tagName=="FORM"?c(":input",d).each(function(){var f=c(this);f.bind(c.fieldEvent(f,a),function(){var g=window.delayedObserverStack[h];g.obj.formVal()!=g.oldVal&&window.delayedObserverCallback(h)})}):d.bind(c.fieldEvent(d,a),function(){var f=window.delayedObserverStack[h];
f.obj.formVal()!=f.oldVal&&window.delayedObserverCallback(h)})},formVal:function(){var a=this[0];if(a.tagName=="FORM")return this.serialize();return a.type=="checkbox"||a.type=="radio"?this.filter("input:checked").val()||"":this.val()}})})(jQuery);
(function(c){c.fn.extend({visualEffect:function(a,b){speed=b?b.duration*1E3:null;e=a.replace(/\_(.)/g,function(d,h){return h.toUpperCase()});return eval("$(this)."+e+"("+speed+")")},appear:function(a,b){return this.fadeIn(a,b)},blindDown:function(a,b){return this.show("blind",{direction:"vertical"},a,b)},blindUp:function(a,b){return this.hide("blind",{direction:"vertical"},a,b)},blindRight:function(a,b){return this.show("blind",{direction:"horizontal"},a,b)},blindLeft:function(a,b){this.hide("blind",
{direction:"horizontal"},a,b);return this},dropOut:function(a,b){return this.hide("drop",{direction:"down"},a,b)},dropIn:function(a,b){return this.show("drop",{direction:"up"},a,b)},fade:function(a,b){return this.fadeOut(a,b)},fadeToggle:function(a,b){return this.animate({opacity:"toggle"},a,b)},fold:function(a,b){return this.hide("fold",{},a,b)},foldOut:function(a,b){return this.show("fold",{},a,b)},grow:function(a,b){return this.show("scale",{},a,b)},highlight:function(a,b){return this.show("highlight",
{},a,b)},puff:function(a,b){return this.hide("puff",{},a,b)},pulsate:function(a,b){return this.show("pulsate",{},a,b)},shake:function(a,b){return this.show("shake",{},a,b)},shrink:function(a,b){return this.hide("scale",{},a,b)},squish:function(a,b){return this.hide("scale",{origin:["top","left"]},a,b)},slideUp:function(a,b){return this.hide("slide",{direction:"up"},a,b)},slideDown:function(a,b){return this.show("slide",{direction:"up"},a,b)},switchOff:function(a,b){return this.hide("clip",{},a,b)},
switchOn:function(a,b){return this.show("clip",{},a,b)}})})(jQuery);JSOC=function(){var c={};return{get:function(a){var b={},d=c[a];if(b[a]=d)return b},getMulti:function(a){var b=[];for(var d in a)b.push(this.get(a[d]));return b},getType:function(a){var b=[];for(var d in c)typeof c[d]==a&&b.push(this.get(d));return b},getMultiType:function(a){var b=[];for(var d in a)for(var h in c)typeof c[h]==d&&b.push(this.get(h));return b},set:function(a,b,d){c[a]&&delete c[a];c[a]=b;if(d)if(b=d.ttl||null){var h=this;setTimeout(function(){h.remove(a)},b)}return c[a]?1:0},add:function(a,
b,d){if(!c[a]){c[a]=b;if(d)if(b=d.ttl||null){var h=this;setTimeout(function(){h.remove(a)},b)}return c[a]?1:0}},replace:function(a,b,d){if(c[a]){delete c[a];c[a]=b;if(d)if(b=d.ttl||null){var h=this;setTimeout(function(){h.remove(a)},b)}return c[a]?1:0}},remove:function(a){delete c[a];return!c[a]?1:0},flush_all:function(){for(k in c)delete c[k];return 1}}};function parseUri(c){var a=parseUri.options;c=a.parser[a.strictMode?"strict":"loose"].exec(c);for(var b={},d=14;d--;)b[a.key[d]]=c[d]||"";b[a.q.name]={};b[a.key[12]].replace(a.q.parser,function(h,f,g){if(f)b[a.q.name][f]=g});return b}
parseUri.options={strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};
Array.prototype.index=function(c){for(var a=0,b=this.length;a<b;a++)if(this[a]==c)return a;return null};Array.prototype.include=function(c){return this.index(c)!==null};
