/* site/statistics.js */
$(function(){var dates=new Array();$(document).ready(function(){var tabs=$(".period_tab");tabs.each(function(){if($(this).attr("period")=='week'){$(this).addClass('current_period_tab');}});if($("#chart_type").val()==1){bind_datepicker();$("span.avaliable_date").each(function(){dates.push($(this).html());});}});function bind_datepicker(){$("input#caption_date").datepicker({dateFormat:'dd.mm.yy',showOn:'button',buttonImage:'http://static.weburg.ru/img/css//jquery/calendar.gif',buttonImageOnly:true,altField:'#actualDate',showOn:'both',firstDay:1,monthNames:['Январь','Февраль','Март','Апрель','Май','Июнь','Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],monthNamesShort:['Янв','Фев','Мар','Апр','Май','Июн','Июл','Авг','Сен','Окт','Ноя','Дек'],dayNames:['Воскресенье','Понедельник','Вторник','Среда','Четверг','Пятница','Суббота'],dayNamesMin:['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],prevText:'Пред.',nextText:'След.',closeText:'Закрыть',currentText:'Сегодня',maxDate:'-'+$("#avaliable_dates").attr("max")+'d',minDate:'-'+$("#avaliable_dates").attr("min")+'d',changeMonth:true,changeYear:true,beforeShowDay:leaveSomeDays,onSelect:anotherChart});}
function leaveSomeDays(date){var dt=date.getDate()+'.'+(parseInt(date.getMonth())+1)+'.'+date.getFullYear();if($.inArray(dt,dates)==-1){return[false,''];}
return[true,''];}
function anotherChart(dateText){$.ajax({url:document.location.pathname+'?forday='+dateText,beforeSend:function(){$("#statistics_content").css('cursor','progress');},success:function(data,statusText){$("#statistics_content").html(data);$("#statistics_content").css('cursor','default');bind_datepicker();}});}
$("#show_more").live("click",function(){var cur=$(this);$.ajax({url:document.location.pathname,type:"GET",data:"for-period="+cur.attr('period')+"&show-all=1",beforeSend:function(){cur.closest('td').html('<br><img src="http://static.weburg.ru/img/js//preload.gif" width="70" height="10" alt="идет отправка…" id="sending"/>');},success:function(data){$("#statistics_content").html(data);$("#period_"+cur.attr('period')).addClass('current_period_tab').focus();;},complete:function(){$("#sending").remove();}});});$(".period_tab").live("click",function(){var current=$(this);var curid=current.attr("id");$.ajax({url:document.location.pathname,type:"GET",data:"for-period="+current.attr("period"),beforeSend:function(){$("#statistics_content").css("cursor","progress");},success:function(data,textStatus){$("#statistics_content").html(data);$("#"+curid).addClass('current_period_tab').focus();$("#statistics_content").css("cursor","default");}});});$(".chart_tag").live("mouseover",function(){$(this).addClass("chart_tag_active");});$(".chart_tag").live("mouseout",function(){$(this).removeClass("chart_tag_active");});});
/* site/socialization_panel.js */
$(function(){var width=620;var height=450;var left=(screen.width-width)/2;var top=(screen.height-height)/3;var url=this._base_domain+'share.php';var popupParams='scrollbars=1, resizable=1, menubar=0, left='+left+', top='+top+', width='+width+', height='+height+', toolbar=0, status=0';$(".socnet_url").click(function(){window.open($(this).attr('href'),'Weburg.ru | '+$(this).attr('title'),popupParams);return false;});});
