(function(D){var G=["log","debug","info","warn","error"],A,B,C,F,E=function(H,J,I){this.interval=H;
if(J&&I){this.push(J,I)
}};
for(C=G.length-1;
C>=0;
--C){D[G[C]]=function(){}
}A=function(){if("_Logger" in parent){return parent._Logger
}if("_Logger" in window){return window._Logger
}window._Logger=this;
var H;
for(C=G.length-1;
C>=0;
--C){H=G[C];
this[H]=this._log(H)
}};
A.prototype._log=function(H){if("console" in window&&H in console){return function(){window.console[H](arguments[0])
}
}else{return function(){var I=this._$debug||D('<div id="debuger"></div>').appendTo("body");
this._$debug=I;
I.append("<p><strong>"+(H!="log"?H+":":"")+"</strong> "+arguments[0]+"</p>")
}
}};
if(window.location.toString().indexOf("debug=true")>0){B=new A();
for(C=0;
C<G.length;
++C){D[G[C]]=B[G[C]]
}}D.info("Logging mechanism has been initalized");
E.prototype={queque:[],sync:function(){var I=this,H=I.queque;
setTimeout(function(){var K,J;
for(J=H.length;
J>0;
J--){K=H[J-1];
K.css(K.$placeholder.offsetcss())
}I.sync()
},I.interval)
},push:function(I,H){I.$placeholder=H;
this.queque.push(I);
D.log("BannerSync: Adding banner with placeholder: #"+H.attr("id")+"  to the queque");
if(this.queque.length==1){this.sync()
}}};
D.fn.setCurrent=function(){var I=window.location.toString(),H=I.substring(I.lastIndexOf("/list/")+6);
if(H.indexOf("?")>0){H=H.substring(0,H.indexOf("?"))
}this.each(function(L){var M=D(this),J,K=this.href.toString();
K=K.substring(K.lastIndexOf("/list/")+6);
if(H==K){if(M.parent().hasClass("menu-sub")){J=M.parent().attr("id").substring(4);
D("#"+J).addClass("current");
return false
}else{M.addClass("current");
return false
}}});
return this
};
D.fn.offsetcss=function(){var H=D(this).offset();
return{left:H.left+"px",top:H.top+"px"}
};
D.fn.setOpacity=function(H){if(D.browser.msie){this.css("filter","alpha(opacity="+(H*100)+")")
}else{this.css({opacity:H,"-moz-opacity":H})
}return this
};
window._gaq=[];
window._gaq.push(function(){var H=window._gaq._createAsyncTracker("UA-720559-5","pagetracker");
H._trackPageview();
D("a.ga_track").each(function(){H._trackEvent("LatestNewsAdImpression","Ad Impression with link "+this.href)
}).click(function(){H._trackEvent("TextLinks","LatestNewsAdClick","Ad click with link "+this.href)
})
});
D.fn.attachBanners=function(H){var J=D.extend({attachRetry:200,syncInterval:400},H?H:{}),I=new E(J.syncInterval);
return this.each(function(){var L=D(this),Q=this.id.replace("placeholder__",""),M=D("#banner__"+Q),P=M[0]?M.find(".banner, .textad"):null,K=false,N,O;
if(P&&P.length>0){if(P.is(".textad")){D.log("Attaching the textads '"+Q+"' to it's placeholder");
L.append(P);
return 
}N=P.width();
O=P.height();
if(N!==0&&O!==0){D.log("Attaching banner '"+Q+"' to it's placeholder with dim: "+N+"x"+O);
L.attr("class",function(){return this.className+" "+P.attr("class")
}).width(N).height(O);
P.css("position","absolute").css(L.offsetcss());
M.css("top","0px");
I.push(P,L)
}else{K=true
}}else{K=true
}if(K){setTimeout(function(){L.attachBanners()
},J.attachRetry)
}})
};
D.fn.fixPanelPosition=function(){D.log("Fixing panel position");
this.each(function(){var H=D(this),I=H.attr("rel");
if(I&&I.length>0){this.panel=D("#"+I).css("left",H.offsetcss().left)[0];
this.panel.button=this
}else{this.panel=false
}});
return this
};
F=function(){D.info("Initing sportfm statistics tracker");
var H=this;
this.trackVideo=function(){H.track("video",arguments[0])
};
this.trackArticle=function(){H.track("article",arguments[0])
};
this.track=function(){var J=arguments[0],L=arguments[1],I=_SFM_CONTEXTPATH+"/statistics/SPORTFM/"+J+"/"+L,K=Math.random()*100000000000000000;
D.getJSON(I,{nocache:K},function(O,M){var N=D("a[name='track_bound']").attr("rel");
if(isNaN(N)){N=0
}else{N=parseInt(N,10)
}D.log("Got counter ["+O.counter+"] with bound ["+N+"] response from: "+I);
if(O.counter&&O.token&&(parseInt(O.counter,10)>N)){D("#readBy").html("Διαβάστηκε <strong>"+O.counter+"</strong> "+O.token)
}})
};
return H
};
D.sfm=new F();
D.fn.rankings=function(J,I){var H=D(this);
D.get(J+"?ajax",function(K){H.replaceWith(K);
if(I){I()
}})
}
})(jQuery);
var _sfm=_sfm||{},prebanners_load=function(){var F=$("#menu-main li a"),D=$("form.randomize"),B=$("a[name='track_article']").attr("rel"),E=$(".hhoverable"),A=Math.random()*100000000000000000,I=$("#matches"),G=I.find("#championselect"),C,H=document.createElement("script");
$("#menu-top a, #menu-main a, .menu-sub a, #superleague a, .menu-site a").setCurrent();
$(".menu-sub").setOpacity(0.93);
F.fixPanelPosition().hover(function(){var J=this.panel?$(this.panel):null;
this.m_over=true;
if(J!==null){$(this).parent().addClass("selected");
J=$(this.panel).show(200).hover(function(){this.m_over=true
},function(){this.m_over=false;
var K=this;
setTimeout(function(){var L=typeof (K.button)!="undefined"&&typeof (K.button.m_over)!="undefined"&&K.button.m_over;
if(!L){$(K).hide(200);
$(K.button).parent().removeClass("selected")
}},150)
})
}},function(){this.m_over=false;
var J=this;
setTimeout(function(){if(J.panel&&!J.panel.m_over){$(J.panel).hide(200);
$(J).parent().removeClass("selected")
}},150)
});
$("#live-radio-button").click(function(){var J=606,L=576,K="alwaysRaised=yes,location=no,scrollbars=no,status=no,resizable=no,width="+J+",height="+L+",left="+(screen.width-J)/2+",top="+(screen.height-L)/2,M=window.open(this.href,"sportfmLiveRadio",K);
M.focus();
return false
});
$.get(_SFM_CONTEXTPATH+"/texts",function(J){$.log("Have this data to show: "+J);
if(J&&J!==""){$('<ul id="ticker"><li>'+J+"</li></ul>").insertBefore("#content");
$.getScript(_SFM_CONTEXTPATH+"/resrc/scripts/jquery.li-scroller.1.1-min__v100208.js",function(){var K=function(L){$.log("tryscroll attempt #"+L);
if("liScroll" in $.fn){$("#ticker").liScroll()
}else{setTimeout(function(){K(L++)
},300)
}};
K(1)
})
}});
$("a[href^='#submit']").click(function(){var J=$(this).attr("href"),K=J.indexOf(":")>0?J.split(":")[1]:this.rel;
return $("#"+K).submit()
});
$(".image-gallery a[href='#show-thumb']").click(function(){var M=$(this),L=M.attr("title"),N=M.children("img").attr("src"),J=new Image(),K=$("#article-photo img");
N=N.split("?")[0]+"?w=400";
N=N.toString();
K.parent().css("height",K.height());
K.fadeOut("slow");
$(J).load(function(){K.remove();
$("#article-photo-legend").html(L);
$(this).hide().appendTo("#article-photo").fadeIn(function(){$(this).parent().css("height",$(this).height())
})
}).attr("src",N).attr("alt",L);
return false
});
D.each(function(){var K=$(this),J=K.attr("action");
if(J.indexOf("?")>0){J+="&_r="+A
}else{J+="?_r="+A
}K.attr("action",J)
});
$("a[href='#incfonts'], a[href='#decfonts'], a[href='#originfonts']").click(function(){if(this.rel){var J=this;
$(this.rel).each(function(){var L=$(this),K=-1;
if(J.href.indexOf("#originfonts")>=0&&this.original_font_size){K=this.original_font_size
}else{K=parseInt(L.css("font-size").replace("px",""),10);
if(!this.original_font_size){this.original_font_size=K
}if(J.href.indexOf("#incfonts")>=0){K+=2
}else{if(J.href.indexOf("#decfonts")>=0){K-=2
}}if(Math.abs(this.original_font_size-K)>6){K=-1
}}if(K>0){L.css("font-size",K+"px")
}})
}return false
});
E.hover(function(){$(this).children().toggleClass("h")
});
$("#superleague a:not(.current)").hover(function(){$(this).toggleClass("current")
});
$("#master-article .bullet").html("&nbsp;");
if($.fn.pngFix){$.log("Fixing the png transparency");
$(".pngfix").parent().pngFix()
}H.src="http://www.google-analytics.com/ga.js";
H.setAttribute("async","true");
$("head").get(0).appendChild(H);
if(B){$.sfm.trackArticle(B)
}$("#facebookfan_placeholder").html('<iframe scrolling="no" frameborder="0" src="http://www.facebook.com/connect/connect.php?id=101659020789&connections=0&stream=0&css=&locale=el_GR" allowtransparency="true" style="border: none; width: 300px; height: 70px;"></iframe>');
$(".shownewspaper").click(function(){var J=820,K=750,L="alwaysRaised=yes,location=no,scrollbars=yes,status=no,resizable=yes,width="+J+",height="+K+",left="+(screen.width-J)/2+",top="+(screen.height-K)/2,M=window.open($(this).attr("href"),"sportfmNewspapers",L);
M.focus();
return false
});
if(G.size()>0){C=function(){$.log("onRankingsUpdate: Appending the champions select to the options...");
$("#matches .options").append(G)
};
G.live("change",function(){var J=$(this).val();
$("#matches").rankings(J,C)
})
}I.find(".controls a").live("click",function(){$(this).parent().html("Φόρτωση αποτελεσμάτων...");
$("#matches").rankings(this.href.toString(),C);
return false
});
$("div[id^='placeholder__']").attachBanners()
};
prebanners_load();
$(function(){var A=0;
$(".slider").each(function(B){var F=$(this),G=F.attr("id"),E=F.parent(),C=1,D=this.className.indexOf("slvisible_");
if(G===null||G===""){G="slider"+(A++)
}E.find(".controls a").each(function(){this.id=this.className+G;
$.info(this.id)
});
if(D>=0){D=this.className.substring(D+10,D+11)
}if(D<0||isNaN(D)){$.warn("Can not extract int from ["+this.className+"], using the default one: "+C)
}else{C=parseInt(D,10)
}F.find("li").removeClass("h").end().jCarouselLite({auto:7000,speed:250,visible:C,btnNext:"#next"+G,btnPrev:"#prev"+G});
$.info("slider: "+G+", visible slides: "+C)
});
$(".controls").show();
$("a.imgreplacement").each(function(){var E=$(this),D=this.title,F=this.href.replace("[timestamp]",Math.random()*100000000000000000),B=E.attr("class"),C='<img src="'+F+'" alt="'+D+'" class="'+B+'" />';
$.log("Replcacing "+this+" with "+C);
E.replaceWith(C)
})
});
(function(A){window.setArticle=function(){if(arguments[0]&&!isNaN(arguments[0])){var C="master-article:"+arguments[0],B=arguments[0];
A("#master-article div[id^='master-article:']").each(function(){var D=A(this);
if(D.attr("id")==C){D.css("display","block")
}else{D.css("display","none")
}});
if("_gaq" in window){window._gaq.push(function(){window._gaq._getAsyncTracker("pagetracker")._trackEvent("Homepage","mainNewsTonggle","User clicked the main news tab of article with id "+B)
})
}}}
})(jQuery);
$(function(){var F=null;
$("ul.tabs li").each(function(){var H=$(this);
if(H.hasClass("current")){F=H
}});
$("ul.tabs li").click(function(){var H=$(this);
if(H!=F){F.removeClass("current");
$("#"+F.attr("id")+"-panel").css("display","none");
F=H.css("outline","none").addClass("current");
$("#"+F.attr("id")+"-panel").css("display","block");
if("_gaq" in window){window._gaq.push(function(){window._gaq._getAsyncTracker("pagetracker")._trackEvent("Homepage","moreNewsTonggle","User clicked the more news tab with id "+F.attr("id"))
})
}}return false
});
if(_sfm.curr_poll_id){var C=((new Date()).getTime()+""+parseInt(Math.random()*10000,10)).substr(2),A=function(L){var K=$.cookie("sportfm-polls"),J,I,H;
if(K===null){return false
}else{K=K.split(",");
J=false;
for(I=0,H=K.length;
I<H;
I++){if(K[I]==L){J=true;
break
}}return J
}},G=function(I){var H=$.cookie("sportfm-polls");
if(H===null){$.cookie("sportfm-polls",I,{path:_sfm.contextpath+"/",expires:360})
}else{if(H!==null){H+=","+I;
$.cookie("sportfm-polls",H,{path:_sfm.contextpath+"/",expires:360})
}}return 
},B=$("#poll"),E=function(){$("#poll-results").remove();
B.css("display","block")
},D=function(){$("#poll-post-form").remove();
$("#poll-place-holder").load(_sfm.contextpath+"/poll/results/rtime:"+C,"",function(){B.css("display","block")
})
};
B.find("#btn_submit_vote").click(function(){var J=$(this),H=B.data("current"),I;
if(!(H)){alert("Πρέπει να επιλέξετε μια επιλογή για να ψηφίσετε.");
return false
}I=H.attr("href").split(":")[1];
$("#poll-place-holder").load(_sfm.contextpath+"/poll/vote/"+I+"/vote-time:"+C,"",function(){G(_sfm.curr_poll_id)
});
return false
}).end().find("#poll-post-form li a").click(function(){var H=$(this),I=B.data("current");
B.data("current",H);
if(I){I.removeClass("current")
}H.addClass("current");
return false
}).end().find("#btn_show_poll_results").click(function(){D();
return false
});
if(A(_sfm.curr_poll_id)){D()
}else{E()
}}$("#sportday_placeholder").load(_sfm.contextpath+"/specials/sdayarticles/",function(){$(this).find(".slider").jCarouselLite({auto:7000,speed:250,visible:2,btnNext:"#btn_sday_next_article",btnPrev:"#btn_sday_prev_article"})
})
});
