var calend;var station;function pageSetup(date)
{datePickerSetup(date);stationSetup();}
function datePickerSetup(start_)
{jQuery("#calendar-widget").datepicker({monthNames:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],dayNamesMin:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],nextText:"далее",prevText:"назад",selectOtherMonths:false,showOtherMonths:true,firstDay:1,maxDate:"+0d",onSelect:function(dateText,inst){jQuery(".archive_calendar").hide();var count=0;var str=location.href;var pos=str.indexOf("/");var pos5=0;while(pos!=-1){count++;pos5=pos;pos=str.indexOf("/",pos+1);}
if(count>4)
{str=str.slice(0,pos5);}
var sD="";var sM=""
if(inst.selectedDay/10>=1)sD=inst.selectedDay;else sD="0"+inst.selectedDay;if(inst.selectedMonth/9>=1)sM=inst.selectedMonth+1;else sM="0"+(inst.selectedMonth+1);location.href=str+"/"+inst.selectedYear+sM+sD;}});jQuery("#calendar-widget td").click(function(){jQuery(this).find("a").click();});var showDay=showingDay+"";jQuery("#calendar-widget").datepicker("setDate",showDay.substr(4,2)+"/"+showDay.substr(6,2)+"/"+showDay.substr(0,4));jQuery("a.archive-calendar").click(function(){jQuery(".archive_calendar #text-in").hide("fast").animate({opacity:0});jQuery("#calendar-widget").fadeIn("slow");jQuery(".archive_calendar").animate({top:"-15px"},"fast");return false;});jQuery(document).click(function(e){if((!jQuery(e.target).hasClass("ui-datepicker-next"))&&(!jQuery(e.target).hasClass("ui-datepicker-prev"))&&(!jQuery(e.target).hasClass("ui-state-default")))
if(jQuery(e.target).parents("#calendar-widget").length==0)
{jQuery(".archive_calendar #text-in").show().animate({opacity:1});jQuery("#calendar-widget").hide();jQuery(".archive_calendar").animate({top:"105px"},"fast");}});}
function stationSetup()
{for(var i=0;i<user_stations.length;i++)
if(user_stations[i])
favouriteSwitch(user_stations[i],1);}
function playerGoDay(url)
{document.location=url;}
function playerPlayFrom(time)
{openPlr('/play/'+stationId+'/'+showingDay+'/fromtime:'+time+':00/');}
function openAir(paramStr){if(paramStr==1){openPlr({href:'/play/'+stationId+'/translation'});}else{openPlr({href:'/play/'+stationId+'/online'});}}
