Cookies=new Object();Cookies.set=function(b,h,d,j,f,a){if((d)&&(d.toString().match(/\+(\d+)(h|d|m|y)/))){var e=new Date();var g=parseInt(RegExp.$1);var i=RegExp.$2;switch(i){case"y":e.setYear(e.getYear()+g);break;case"m":e.setMonth(e.getMonth()+g);break;case"d":e.setDate(e.getDate()+g);break;case"h":e.setHours(e.getHours()+g);break;}d=e.toGMTString();}document.cookie=b+"="+escape(h)+((d)?"; expires="+d:"")+((j)?"; path="+j:"")+((f)?"; domain="+f:"")+((a)?"; secure":"");};Cookies.get=function(b){var d=" "+document.cookie;var c=" "+b+"=";var e=null;var f=0;var a=0;if(d.length>0){f=d.indexOf(c);if(f!=-1){f+=c.length;a=d.indexOf(";",f);if(a==-1){a=d.length;}e=unescape(d.substring(f,a));}}return(e);};Browser=function(){var e=navigator.userAgent.toLowerCase();var a=/msie/.test(e)&&!/opera/.test(e);var d=/opera/.test(e);var b=/MSIE (5\.5|6).+Win/.test(navigator.userAgent);var c=/webkit/.test(e);return{isOpera:d,isMSIE:a,isWebKit:c,isIE6:b,getScrollBody:function(){return(c)?document.body:document.documentElement;}};}();if(!Array.indexOf){Array.prototype.indexOf=function(a,c){if(!c){c=0;}for(var b=c;b<this.length;b++){if(this[b]==a){return b;}}return -1;};}var __trimRegExp=/^(\s|\u00A0)+|(\s|\u00A0)+$/g;String.prototype.trim=function(){return this.replace(__trimRegExp,"");};window.mousePos=function(a){a=a||window.event;return{x:a.pageX||(a.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-document.documentElement.clientLeft),y:a.pageY||(a.clientY+(document.documentElement.scrollTop||document.body.scrollTop)-document.documentElement.clientTop)};};var __sizingRegExp=/iesizing\-(\w+)/;function fixPNG(d,a,e){if((Browser.isIE6)||(e)){a=a||"crop";var c=__sizingRegExp.exec(d.className);if(c){a=c[1];}var b;if(d.tagName=="IMG"){if(/\.png$/.test(d.src)){b=d.src;d.src="/i/ie/e.gif";}}else{b=d.currentStyle.backgroundImage.match(/url\(["']?(.+\.png).*?["']?\)/i);if(b){b=b[1];d.runtimeStyle.backgroundImage="none";}}if(b){d.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b+"',sizingMethod='"+a+"')";}else{d.runtimeStyle.filter="true";}}}$(function(){Echo.initAjax();Echo.Gallery();Echo.Today();Echo.MovingString();Echo.GuestHelpers.init();Echo.BlogCode.init();Echo.OpenInWindow();if(Echo.interfaceName==="contacts_group"){Echo.Contacts.init();}});Echo=new Object();Echo=function(a){return{undefined:a};}();Echo.AJAX_URI="/json/";Echo.overlayOpacity=0.6;Echo.overlayColor="#333333";Echo.SESS_ID="";if(window.location.toString().match(/SESS_ID=(\d+)/)){Echo.SESS_ID=RegExp.$1;}Echo.getJSON=function(b,a){if(Echo.SESS_ID){b.SESS_ID=Echo.SESS_ID;}$.post(Echo.AJAX_URI,b,a,"json");};Echo.initAjax=function(){var b=$(document.body);function a(c){if(c){b.addClass("waiting");}else{b.removeClass("waiting");}}$(document).ajaxStart(function(){a(true);}).ajaxStop(function(){a(false);}).ajaxError(function(f,e,c,d){alert("Произошла ошибка при загрузки данных. Попробуйте перезагрузить страницу.");a(false);});};Echo.Overlay=function(){var a=null;function c(){if(!a){a=$(document.createElement("div")).addClass("overlay").css({opacity:Echo.overlayOpacity}).hide().appendTo(document.body);}a.show();if(Browser.isIE6){a.css({position:"absolute",height:document.body.scrollHeight});}}function b(){a.hide();}return{show:function(){c();},hide:function(){b();},onclick:function(d){a.unbind("click");a.click(d);}};}();Echo.Gallery=function(){$(".gallery a, a.fancy").fancybox({overlayOpacity:Echo.overlayOpacity,overlayColor:Echo.overlayColor,titlePosition:"over"});};Echo.Today=function(){var c=$("#today");var b=["Воскресенье","Понедельник","Втор..ик","Среда","Четверг","Пятница","Суббота"];var a=["января","февраля","марта","aпреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"];var d=new Date();c.append("Сегодня: <span class='tdt'><strong>"+d.getDate()+"</strong> "+a[d.getMonth()]+" <strong>"+d.getFullYear()+" г.</strong></span> <span id='i-clocks'></span>");Echo.Clocks.init("i-clocks","+6");};Echo.MovingString=function(){var e=3;var h=90;var d,c=0;var f=0;var b=document.getElementById("marquee_text");c=b.offsetWidth;var a=document.getElementById("marquee_container");f=a.offsetWidth;function g(i){i=parseInt(i);if(d<(i+f)){d=d+e;}else{d=0;}b.style.left=parseInt(f-d)+"px";setTimeout(function(){g(i);},h);}g(c);};Echo.GuestHelpers=function(){function a(f){var h=$(f.parentNode).find(".hd");if(h.length>0){var d=50;var c=null;var g=false;var e=false;var b=$(document.createElement("div")).addClass("helper text").html(h.html()).appendTo($(document.body));$([f,b.get(0)]).mouseover(function(){if(c){clearTimeout(c);}if(g||e){return false;}else{var j=$(window).width();var m=$(window).height();g=false;e=true;var i=$(f).offset();var l=Math.round(i.left+f.offsetWidth-20);if((l+b.width())>j){l=Math.round(i.left-b.width()-f.offsetWidth/2+60);}var k=Math.round(i.top-b.height()+10);if((i.top-b.height()-f.offsetHeight/2-Browser.getScrollBody().scrollTop)<=0){k=Math.round(i.top+f.offsetHeight-10);}b.css({top:k+"px",left:l+"px",display:"block"});
}return false;}).mouseout(function(){if(c){clearTimeout(c);}c=setTimeout(function(){c=null;b.css("display","none");e=false;},d);return false;});}}return{init:function(){$("#hp-guests .gi a").each(function(){a(this);});}};}();Echo.Clocks=function(){var c=new Array();var e;var a;function d(){e=window.setInterval(b,500);}function b(){var k=new Date();var g=new Date(k.getTime()+(k.getTimezoneOffset()+a*60)*60000);var n=g.getHours();var f=g.getMinutes();if(n<10){n="0"+n;}if(f<10){f="0"+f;}var l=g.getSeconds();for(var j=0;j<c.length;j++){c[j].innerHTML=n+"<span>:</span>"+f;c[j].className=(l%2==0)?"sh":"";}}return{init:function(f,g){a=g;var h=document.getElementById(f);if(h){c.push(h);d();}},addElement:function(f){var g=document.getElementById(f);if(g){c.push(g);}}};}();Echo.OpenInWindow=function(){$("a.show-in-window").click(function(a){a.preventDefault();window.open(this.href,"addwin","status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no");});};Echo.Contacts=function(){var a=$(),e=$();var b;function c(){var f=a.find("label");f.each(function(){var g=this.getElementsByTagName("input")[0];this._input=g;if((g)&&(g.checked)){d(this);}}).click(function(){d(this);});if(!b){d(f.get(0));}}function d(f){if(b!=f){if(b){b._input.checked=false;$(b).removeClass("active");}b=f;$(b).addClass("active");b._input.checked=true;e.val(b._input.value);}}return{init:function(f){a=$("#contacts-cat");if(a.length){c();}}};}();Echo.BlogCode=function(){var c=$();var b=$();function a(){c.click(function(){b.toggleClass("hd");if(b.hasClass("hd")){c.html("Код для вставки в блог");}else{c.html("Скрыть код для вставки в блог");}return false;});}return{init:function(){c=$("#code-for-blog-but");b=$("#code-for-blog");if((c.length>0)&&(b.length>0)){a();}}};}();
