
function displayMonth(month){switch(month){case 0:return"Ιανουαρίου";break;case 1:return"Φεβρουαρίου";break;case 2:return"Μαρτίου";break;case 3:return"Απριλίου";break;case 4:return"Μαΐου";break;case 5:return"Ιουνίου";break;case 6:return"Ιουλίου";break;case 7:return"Αυγούστου";break;case 8:return"Σεπτέμβρίου";break;case 9:return"Οκτωβρίου";break;case 10:return"Νοεμβρίου";break;case 11:return"Δεκεμβρίου";break;}}
$(document).ready(function(){$("#dialog-form").dialog("destroy");$("#dialog-form").dialog({autoOpen:false,height:350,width:350,modal:true,resizable:false,closeOnEscape:true,buttons:{'Αποστολή σε φίλο/η':function(){$('#emailform').submit();},'Άκυρο':function(){$("#dialog-form").dialog("close");}},close:function(){$('#emailform')[0].reset();}});$('.emailIcon').click(function(){$('#dialog-form').dialog('open');});});function dialogClose(){$("#dialog-form").dialog("close");}
function isTvOpen(){return $(".pagination_tags li.tv").hasClass('active');}
function isLiveOpen(){return $(".pagination_tags li.live").hasClass('active');}
function fixEnableAgendaGroups(groupContent){var agendaItems=$(groupContent).find(".agenda-item");if(agendaItems.length==1){return;}
$(agendaItems[0]).hide();for(var i=1;i<agendaItems.length;i++){$(agendaItems[i]).show();if(!$(agendaItems[i]).hasClass('inner')&&i<(agendaItems.length-1)){$(agendaItems[i]).addClass('inner');}}}
function fixEnableAgendaItems(tagString){var agendaGroups=$(".agenda-content-group");for(var i=0;i<agendaGroups.length;i++){var agendaItems=$(agendaGroups[i]).find(".agenda-item."+tagString);if(agendaItems.length==0){continue;}
for(var j=0;j<agendaItems.length;j++){$(agendaItems[j]).show();}}
recalculateAgendaGroups();}
function fixDisableAgendaItems(tagString){var agendaGroups=$(".agenda-content-group");for(var i=0;i<agendaGroups.length;i++){var agendaItems=$(agendaGroups[i]).find(".agenda-item."+tagString);if(agendaItems.length==0){continue;}
for(var j=0;j<agendaItems.length;j++){if((isTvOpen()&&$(agendaItems[j]).hasClass("tagppotv"))||(isLiveOpen()&&$(agendaItems[j]).hasClass("tagppolive")))
continue;$(agendaItems[j]).hide();if(tagString=="tagppolive"||tagString=="tagppotv"){if($(".pagination_tags li.soccer").hasClass("active")){fixEnableAgendaItems('tagpposoccer');}
if($(".pagination_tags li.basket").hasClass("active")){fixEnableAgendaItems('tagppobasket');}
if($(".pagination_tags li.volley").hasClass("active")){fixEnableAgendaItems('tagppovolley');}
if($(".pagination_tags li.polo").hasClass("active")){fixEnableAgendaItems('tagppopolo');}}}}
recalculateAgendaGroups();}
function recalculateAgendaGroups(){var agendaGroups=$(".agenda-content-group");for(var i=0;i<agendaGroups.length;i++){var agendaItems=$(agendaGroups[i]).find(".agenda-item:visible");if(agendaItems.length==0){var agendaItemsFault=$(agendaGroups[i]).find(".agenda-item")
$(agendaItemsFault[0]).show();continue;}
if(agendaItems.length==1&&$(agendaItems[0]).hasClass("noEvents")){continue;}
for(var j=0;j<agendaItems.length;j++){if(j==0&&$(agendaItems[j]).hasClass("noEvents")){$(agendaItems[j]).hide();continue;}
if(j<agendaItems.length-1&&!$(agendaItems[j]).hasClass("inner"))
$(agendaItems[j]).addClass("inner");else if(j==agendaItems.length-1&&$(agendaItems[j]).hasClass("inner")){$(agendaItems[j]).removeClass("inner");}}}}
function clearOlaItemsPage(){if(!$(".pagination_tags li.ola").hasClass("active"))
return;$(".pagination_tags li.ola").removeClass("active");$(".agenda-content-group .agenda-item").hide();$(".agenda-content-group .noEvents").show();}
$(document).ready(function(){$(".pagination_tags li.ola").click(function(){if($(this).hasClass('active')){$(".pagination_tags li").removeClass("active");$(".agenda-content-group .agenda-item").hide();$(".agenda-content-group .noEvents").show();}else{$(".pagination_tags li").removeClass("active");$(this).addClass("active");var agendaGroups=$(".agenda-content-group");for(var i=0;i<agendaGroups.length;i++){fixEnableAgendaGroups(agendaGroups[i]);}}});$(".pagination_tags li.soccer").click(function(){clearOlaItemsPage();if($(this).hasClass('active')){$(this).removeClass("active");fixDisableAgendaItems('tagpposoccer');}else{$(this).addClass("active");fixEnableAgendaItems('tagpposoccer');}});$(".pagination_tags li.basket").click(function(){clearOlaItemsPage();if($(this).hasClass('active')){$(this).removeClass("active");fixDisableAgendaItems('tagppobasket');}else{$(this).addClass("active");fixEnableAgendaItems('tagppobasket');}});$(".pagination_tags li.volley").click(function(){clearOlaItemsPage();if($(this).hasClass('active')){$(this).removeClass("active");fixDisableAgendaItems('tagppovolley');}else{$(this).addClass("active");fixEnableAgendaItems('tagppovolley');}});$(".pagination_tags li.polo").click(function(){clearOlaItemsPage();if($(this).hasClass('active')){$(this).removeClass("active");fixDisableAgendaItems('tagppopolo');}else{$(this).addClass("active");fixEnableAgendaItems('tagppopolo');}});$(".pagination_tags li.tv").click(function(){clearOlaItemsPage();if($(this).hasClass('active')){$(this).removeClass("active");fixDisableAgendaItems('tagppotv');}else{$(this).addClass("active");fixEnableAgendaItems('tagppotv');}});$(".pagination_tags li.live").click(function(){clearOlaItemsPage();if($(this).hasClass('active')){$(this).removeClass("active");fixDisableAgendaItems('tagppolive');}else{$(this).addClass("active");fixEnableAgendaItems('tagppolive');}});});function initSlides(slides,clickers,hideNow){if(hideNow){slides.slice(1).hide();}
for(var i=0;i<clickers.length;i++){var clicker=$(clickers[i]);clicker.data('index',i);clicker.children().data('index',i);var slide=$(slides[i]);clicker.click(function(evt){$(slides).hide();$('.multipleTypeVideo').html('');$(".slide").removeClass("active");$(this).addClass("active");var index=$(evt.target).data('index');var videoItem=$(slides[index]).find(".videoId");if(videoItem.length>0){var videoId=$(videoItem).attr("id");var autoPlay=0;if(index>0){autoPlay=1;}
$(slides[index]).find(".multipleTypeVideo").html('');$(slides[index]).find(".multipleTypeVideo").append('<iframe frameborder="0" width="620" height="350" src="http://www.dailymotion.com/embed/video/'+videoId+'?width=620&autoPlay='+autoPlay+'"></iframe>');}
$(slides[index]).show();});}}
jQuery.fn.extend({getUrlParam:function(strParamName){strParamName=escape(unescape(strParamName));var returnVal=new Array();var qString=null;if($(this).attr("nodeName")=="#document"){if(window.location.search.search(strParamName)>-1){qString=window.location.search.substr(1,window.location.search.length).split("&");}}else if($(this).attr("src")!="undefined"){var strHref=$(this).attr("src")
if(strHref.indexOf("?")>-1){var strQueryString=strHref.substr(strHref.indexOf("?")+1);qString=strQueryString.split("&");}}else if($(this).attr("href")!="undefined"){var strHref=$(this).attr("href")
if(strHref.indexOf("?")>-1){var strQueryString=strHref.substr(strHref.indexOf("?")+1);qString=strQueryString.split("&");}}else{return null;}
if(qString==null)return null;for(var i=0;i<qString.length;i++){if(escape(unescape(qString[i].split("=")[0]))==strParamName){returnVal.push(qString[i].split("=")[1]);}}
if(returnVal.length==0)return null;else if(returnVal.length==1)return returnVal[0];else return returnVal;}});
