//JQuery Timers Plugin
jQuery.fn.extend({everyTime:function(interval,label,fn,times,belay){return this.each(function(){jQuery.timer.add(this,interval,label,fn,times,belay)})},oneTime:function(interval,label,fn){return this.each(function(){jQuery.timer.add(this,interval,label,fn,1)})},stopTime:function(label,fn){return this.each(function(){jQuery.timer.remove(this,label,fn)})}});jQuery.extend({timer:{guid:1,global:{},regex:/^([0-9]+)\s*(.*s)?$/,powers:{'ms':1,'cs':10,'ds':100,'s':1000,'das':10000,'hs':100000,'ks':1000000},timeParse:function(value){if(value==undefined||value==null)return null;var result=this.regex.exec(jQuery.trim(value.toString()));if(result[2]){var num=parseInt(result[1],10);var mult=this.powers[result[2]]||1;return num*mult}else{return value}},add:function(element,interval,label,fn,times,belay){var counter=0;if(jQuery.isFunction(label)){if(!times)times=fn;fn=label;label=interval}interval=jQuery.timer.timeParse(interval);if(typeof interval!='number'||isNaN(interval)||interval<=0)return;if(times&&times.constructor!=Number){belay=!!times;times=0}times=times||0;belay=belay||false;if(!element.$timers)element.$timers={};if(!element.$timers[label])element.$timers[label]={};fn.$timerID=fn.$timerID||this.guid++;var handler=function(){if(belay&&this.inProgress)return;this.inProgress=true;if((++counter>times&&times!==0)||fn.call(element,counter)===false)jQuery.timer.remove(element,label,fn);this.inProgress=false};handler.$timerID=fn.$timerID;if(!element.$timers[label][fn.$timerID])element.$timers[label][fn.$timerID]=window.setInterval(handler,interval);if(!this.global[label])this.global[label]=[];this.global[label].push(element)},remove:function(element,label,fn){var timers=element.$timers,ret;if(timers){if(!label){for(label in timers)this.remove(element,label,fn)}else if(timers[label]){if(fn){if(fn.$timerID){window.clearInterval(timers[label][fn.$timerID]);delete timers[label][fn.$timerID]}}else{for(var fn in timers[label]){window.clearInterval(timers[label][fn]);delete timers[label][fn]}}for(ret in timers[label])break;if(!ret){ret=null;delete timers[label]}}for(ret in timers)break;if(!ret)element.$timers=null}}}});if(jQuery.browser.msie)jQuery(window).one("unload",function(){var global=jQuery.timer.global;for(var label in global){var els=global[label],i=els.length;while(--i)jQuery.timer.remove(els[i],label)}});
//END.JQuery Timers Plugin
//KeyMask
(function(a){var c=(a.browser.msie?"paste":"input")+".mask";var b=(window.orientation!=undefined);a.mask={definitions:{"9":"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"}};a.fn.extend({caret:function(e,f){if(this.length==0){return}if(typeof e=="number"){f=(typeof f=="number")?f:e;return this.each(function(){if(this.setSelectionRange){this.focus();this.setSelectionRange(e,f)}else{if(this.createTextRange){var g=this.createTextRange();g.collapse(true);g.moveEnd("character",f);g.moveStart("character",e);g.select()}}})}else{if(this[0].setSelectionRange){e=this[0].selectionStart;f=this[0].selectionEnd}else{if(document.selection&&document.selection.createRange){var d=document.selection.createRange();e=0-d.duplicate().moveStart("character",-100000);f=e+d.text.length}}return{begin:e,end:f}}},unmask:function(){return this.trigger("unmask")},mask:function(j,d){if(!j&&this.length>0){var f=a(this[0]);var g=f.data("tests");return a.map(f.data("buffer"),function(l,m){return g[m]?l:null}).join("")}d=a.extend({placeholder:"_",completed:null},d);var k=a.mask.definitions;var g=[];var e=j.length;var i=null;var h=j.length;a.each(j.split(""),function(m,l){if(l=="?"){h--;e=m}else{if(k[l]){g.push(new RegExp(k[l]));if(i==null){i=g.length-1}}else{g.push(null)}}});return this.each(function(){var r=a(this);var m=a.map(j.split(""),function(x,y){if(x!="?"){return k[x]?d.placeholder:x}});var n=false;var q=r.val();r.data("buffer",m).data("tests",g);function v(x){while(++x<=h&&!g[x]){}return x}function t(x){while(!g[x]&&--x>=0){}for(var y=x;y<h;y++){if(g[y]){m[y]=d.placeholder;var z=v(y);if(z<h&&g[y].test(m[z])){m[y]=m[z]}else{break}}}s();r.caret(Math.max(i,x))}function u(y){for(var A=y,z=d.placeholder;A<h;A++){if(g[A]){var B=v(A);var x=m[A];m[A]=z;if(B<h&&g[B].test(x)){z=x}else{break}}}}function l(y){var x=a(this).caret();var z=y.keyCode;n=(z<16||(z>16&&z<32)||(z>32&&z<41));if((x.begin-x.end)!=0&&(!n||z==8||z==46)){w(x.begin,x.end)}if(z==8||z==46||(b&&z==127)){t(x.begin+(z==46?0:-1));return false}else{if(z==27){r.val(q);r.caret(0,p());return false}}}function o(B){if(n){n=false;return(B.keyCode==8)?false:null}B=B||window.event;var C=B.charCode||B.keyCode||B.which;var z=a(this).caret();if(B.ctrlKey||B.altKey||B.metaKey){return true}else{if((C>=32&&C<=125)||C>186){var x=v(z.begin-1);if(x<h){var A=String.fromCharCode(C);if(g[x].test(A)){u(x);m[x]=A;s();var y=v(x);a(this).caret(y);if(d.completed&&y==h){d.completed.call(r)}}}}}return false}function w(x,y){for(var z=x;z<y&&z<h;z++){if(g[z]){m[z]=d.placeholder}}}function s(){return r.val(m.join("")).val()}function p(y){var z=r.val();var C=-1;for(var B=0,x=0;B<h;B++){if(g[B]){m[B]=d.placeholder;while(x++<z.length){var A=z.charAt(x-1);if(g[B].test(A)){m[B]=A;C=B;break}}if(x>z.length){break}}else{if(m[B]==z[x]&&B!=e){x++;C=B}}}if(!y&&C+1<e){r.val("");w(0,h)}else{if(y||C+1>=e){s();if(!y){r.val(r.val().substring(0,C+1))}}}return(e?B:i)}if(!r.attr("readonly")){r.one("unmask",function(){r.unbind(".mask").removeData("buffer").removeData("tests")}).bind("focus.mask",function(){q=r.val();var x=p();s();setTimeout(function(){if(x==j.length){r.caret(0,x)}else{r.caret(x)}},0)}).bind("blur.mask",function(){p();if(r.val()!=q){r.change()}}).bind("keydown.mask",l).bind("keypress.mask",o).bind(c,function(){setTimeout(function(){r.caret(p(true))},0)})}p()})}})})(jQuery);
//END.KeyMask

/**
 * --------------------------------------------------------------------
 * jQuery-Plugin "pngFix"
 * Version: 1.1, 11.09.2007
 * by Andreas Eberhard, andreas.eberhard@gmail.com
 *                      http://jquery.andreaseberhard.de/
 *
 * Copyright (c) 2007 Andreas Eberhard
 * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([237-9n-zA-Z]|1\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(s(m){3.fn.pngFix=s(c){c=3.extend({P:\'blank.gif\'},c);8 e=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 5.5")!=-1);8 f=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 6.0")!=-1);p(3.browser.msie&&(e||f)){3(2).B("img[n$=.C]").D(s(){3(2).7(\'q\',3(2).q());3(2).7(\'r\',3(2).r());8 a=\'\';8 b=\'\';8 g=(3(2).7(\'E\'))?\'E="\'+3(2).7(\'E\')+\'" \':\'\';8 h=(3(2).7(\'F\'))?\'F="\'+3(2).7(\'F\')+\'" \':\'\';8 i=(3(2).7(\'G\'))?\'G="\'+3(2).7(\'G\')+\'" \':\'\';8 j=(3(2).7(\'H\'))?\'H="\'+3(2).7(\'H\')+\'" \':\'\';8 k=(3(2).7(\'V\'))?\'float:\'+3(2).7(\'V\')+\';\':\'\';8 d=(3(2).parent().7(\'href\'))?\'cursor:hand;\':\'\';p(2.9.v){a+=\'v:\'+2.9.v+\';\';2.9.v=\'\'}p(2.9.w){a+=\'w:\'+2.9.w+\';\';2.9.w=\'\'}p(2.9.x){a+=\'x:\'+2.9.x+\';\';2.9.x=\'\'}8 l=(2.9.cssText);b+=\'<y \'+g+h+i+j;b+=\'9="W:X;white-space:pre-line;Y:Z-10;I:transparent;\'+k+d;b+=\'q:\'+3(2).q()+\'z;r:\'+3(2).r()+\'z;\';b+=\'J:K:L.t.M(n=\\\'\'+3(2).7(\'n\')+\'\\\', N=\\\'O\\\');\';b+=l+\'"></y>\';p(a!=\'\'){b=\'<y 9="W:X;Y:Z-10;\'+a+d+\'q:\'+3(2).q()+\'z;r:\'+3(2).r()+\'z;">\'+b+\'</y>\'}3(2).hide();3(2).after(b)});3(2).B("*").D(s(){8 a=3(2).11(\'I-12\');p(a.A(".C")!=-1){8 b=a.13(\'url("\')[1].13(\'")\')[0];3(2).11(\'I-12\',\'none\');3(2).14(0).15.J="K:L.t.M(n=\'"+b+"\',N=\'O\')"}});3(2).B("input[n$=.C]").D(s(){8 a=3(2).7(\'n\');3(2).14(0).15.J=\'K:L.t.M(n=\\\'\'+a+\'\\\', N=\\\'O\\\');\';3(2).7(\'n\',c.P)})}return 3}})(3);',[],68,'||this|jQuery||||attr|var|style||||||||||||||src|navigator|if|width|height|function|Microsoft|appVersion|border|padding|margin|span|px|indexOf|find|png|each|id|class|title|alt|background|filter|progid|DXImageTransform|AlphaImageLoader|sizingMethod|scale|blankgif|appName|Internet|Explorer|parseInt|MSIE|align|position|relative|display|inline|block|css|image|split|get|runtimeStyle'.split('|'),0,{}))

/* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Andrew Stromnov (stromnov@gmail.com). */
/*jQuery(function($){
    $.datepicker.regional['ru'] = {
        closeText: 'Закрыть',
        prevText: '&#x3c;Пред',
        nextText: 'След&#x3e;',
        currentText: 'Сегодня',
        monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',
        'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
        monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
        'Июл','Авг','Сен','Окт','Ноя','Дек'],
        dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
        dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
        dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
        weekHeader: 'Не',
        dateFormat: 'dd.mm.yy',
        firstDay: 1,
        isRTL: false,
        showMonthAfterYear: false,
        yearSuffix: ''};
    $.datepicker.setDefaults($.datepicker.regional['ru']);
});
*/
//Rater
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('9.15.12=s(f,E){e(f==M)k;7 3={f:f,4:5,d:0};e(E){9.C(3,E)};9.C(3,{13:(3.4>1)?S:x});7 c=9(m);9.C(c,{T:3.d,f:3.f});e(!3.b||3.b==M||3.b==\'14\'){7 h=3.4*U;7 l=\'<D g="8-6" b="j:\'+h+\'r">\'}e(3.b==\'y\'){7 h=3.4*10;7 l=\'<D g="8-6 y-8" b="j:\'+h+\'r">\'}e(3.b==\'P\'){7 h=3.4*10;7 l=\'<B g="P-6"><D g="8-6 y-8" b="j:\'+h+\'r">\'}c.A(l);7 v,w,o=\'\';7 H=J.K(q/3.4*3.d);X(7 i=0;i<=3.4;i++){e(i==0){o+=\'<p g="G-6" b="j:\'+H+\'%;">\'+3.d+\'/\'+3.4+\'</p>\'}I{v=J.K(q/3.4*i);w=(3.4-i)+2;o+=\'<p g="8"><a O="#\'+i+\'" Y="\'+i+\'/\'+3.4+\'" b="j:\'+v+\'%;z-N:\'+w+\'">\'+i+\'</a></p>\'}}c.u(\'.8-6\').A(o);e(3.4>1){c.A(\'<B g="8-6-R"></B>\')}7 t=9(c).u(\'.8-6\').n(\'.8\');t.11(s(){e(3.4==1){3.d=(3.d==0)?1:0;9(c).u(\'.8-6\').n(\'.G-6\').V({j:(3.d*q)+\'%\'});9.Q(c.f,{"6":3.d});k x}I{3.d=t.N(m)+1;F=9(m).n(\'a\')[0].O.Z(\'#\')[1];9.Q(c.f,{"6":F},s(L){c.n(\'.8-6-R\').W(L)});k x}k S});k m}',62,68,'|||settings|maxvalue||rating|var|star|jQuery||style|container|curvalue|if|url|class|raterwidth||width|return|ratingparent|this|children|listitems|li|100|px|function|stars|find|starWidth|starIndex|false|small||append|span|extend|ul|options|raterValue|current|curvalueWidth|else|Math|floor|response|null|index|href|inline|post|result|true|averageRating|25|css|html|for|title|split||click|rater|cancel|basic|fn'.split('|'),0,{}))
//END.Rater
//jQueryCorners
jQuery.fn.corner=function(o){function hex2(s){var s=parseInt(s).toString(16);return(s.length<2)?'0'+s:s};function gpc(node){for(;node&&node.nodeName.toLowerCase()!='html';node=node.parentNode){var v=jQuery.css(node,'backgroundColor');if(v.indexOf('rgb')>=0){rgb=v.match(/\d+/g);return'#'+hex2(rgb[0])+hex2(rgb[1])+hex2(rgb[2])}if(v&&v!='transparent')return v}return'#ffffff'};function getW(i){switch(fx){case'round':return Math.round(width*(1-Math.cos(Math.asin(i/width))));case'cool':return Math.round(width*(1+Math.cos(Math.asin(i/width))));case'sharp':return Math.round(width*(1-Math.cos(Math.acos(i/width))));case'bite':return Math.round(width*(Math.cos(Math.asin((width-i-1)/width))));case'slide':return Math.round(width*(Math.atan2(i,width/i)));case'jut':return Math.round(width*(Math.atan2(width,(width-i-1))));case'curl':return Math.round(width*(Math.atan(i)));case'tear':return Math.round(width*(Math.cos(i)));case'wicked':return Math.round(width*(Math.tan(i)));case'long':return Math.round(width*(Math.sqrt(i)));case'sculpt':return Math.round(width*(Math.log((width-i-1),width)));case'dog':return(i&1)?(i+1):width;case'dog2':return(i&2)?(i+1):width;case'dog3':return(i&3)?(i+1):width;case'fray':return(i%2)*width;case'notch':return width;case'bevel':return i+1}};o=(o||"").toLowerCase();var keep=/keep/.test(o);var cc=((o.match(/cc:(#[0-9a-f]+)/)||[])[1]);var sc=((o.match(/sc:(#[0-9a-f]+)/)||[])[1]);var width=parseInt((o.match(/(\d+)px/)||[])[1])||10;var re=/round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/;var fx=((o.match(re)||['round'])[0]);var edges={T:0,B:1};var opts={TL:/top|tl/.test(o),TR:/top|tr/.test(o),BL:/bottom|bl/.test(o),BR:/bottom|br/.test(o)};if(!opts.TL&&!opts.TR&&!opts.BL&&!opts.BR)opts={TL:1,TR:1,BL:1,BR:1};var strip=document.createElement('div');strip.style.overflow='hidden';strip.style.height='1px';strip.style.backgroundColor=sc||'transparent';strip.style.borderStyle='solid';return this.each(function(index){var pad={T:parseInt(jQuery.css(this,'paddingTop'))||0,R:parseInt(jQuery.css(this,'paddingRight'))||0,B:parseInt(jQuery.css(this,'paddingBottom'))||0,L:parseInt(jQuery.css(this,'paddingLeft'))||0};if(jQuery.browser.msie)this.style.zoom=1;if(!keep)this.style.border='none';strip.style.borderColor=cc||gpc(this.parentNode);var cssHeight=jQuery.curCSS(this,'height');for(var j in edges){var bot=edges[j];strip.style.borderStyle='none '+(opts[j+'R']?'solid':'none')+' none '+(opts[j+'L']?'solid':'none');var d=document.createElement('div');var ds=d.style;bot?this.appendChild(d):this.insertBefore(d,this.firstChild);if(bot&&cssHeight!='auto'){if(jQuery.css(this,'position')=='static')this.style.position='relative';ds.position='absolute';ds.bottom=ds.left=ds.padding=ds.margin='0';if(jQuery.browser.msie)ds.setExpression('width','this.parentNode.offsetWidth');else ds.width='100%'}else{ds.margin=!bot?'-'+pad.T+'px -'+pad.R+'px '+(pad.T-width)+'px -'+pad.L+'px':(pad.B-width)+'px -'+pad.R+'px -'+pad.B+'px -'+pad.L+'px'}for(var i=0;i<width;i++){var w=Math.max(0,getW(i));var e=strip.cloneNode(false);e.style.borderWidth='0 '+(opts[j+'R']?w:0)+'px 0 '+(opts[j+'L']?w:0)+'px';bot?d.appendChild(e):d.insertBefore(e,d.firstChild)}}})};
//END.jQueryCorners

/**
 * jQuery lightBox plugin
 * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
 * and adapted to me for use like a plugin from jQuery.
 * @name jquery-lightbox-0.5.js
 * @author Leandro Vieira Pinho - http://leandrovieira.com
 * @version 0.5
 * @date April 11, 2008
 * @category jQuery plugin
 * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
 * @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US
 * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
 */
 eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){$.2C.2D=6(4){4=1H.2E({1I:\'#2F\',1J:0.8,19:G,1K:\'/o/z//5/5-2G-R.16\',1m:\'/o/z//5/5-1n-2H.16\',1o:\'/o/z//5/5-1n-2I.16\',1L:\'/o/z//5/5-1n-2J.16\',1a:\'/o/z//5/5-2K.16\',1b:10,1M:2L,1N:\'Фото\',1O:\'из\',1P:\'c\',1Q:\'p\',1R:\'n\',h:[],7:0},4);f H=I;6 1S(){1T(I,H);v G}6 1T(1c,H){$(\'1U, 1V, 1W\').j({\'1X\':\'2M\'});1Y();4.h.A=0;4.7=0;9(H.A==1){4.h.1Z(w 1d(1c.17(\'J\'),1c.17(\'20\')))}k{2N(f i=0;i<H.A;i++){4.h.1Z(w 1d(H[i].17(\'J\'),H[i].17(\'20\')))}}21(4.h[4.7][0]!=1c.17(\'J\')){4.7++}B()}6 1Y(){$(\'m\').2O(\'<e g="q-S"></e><e g="q-5"><e g="5-r-b-y"><e g="5-r-b"><z g="5-b"><e 2P="" g="5-l"><a J="#" g="5-l-T"></a><a J="#" g="5-l-U"></a></e><e g="5-R"><a J="#" g="5-R-22"><z V="\'+4.1K+\'"></a></e></e></e><e g="5-r-b-o-y"><e g="5-r-b-o"><e g="5-b-C"><1e g="5-b-C-1p"></1e><1e g="5-b-C-1f"></1e></e><e g="5-1q"><a J="#" g="5-1q-23"><z V="\'+4.1L+\'"></a></e></e></e></e>\');f D=1r();$(\'#q-S\').j({2Q:4.1I,2R:4.1J,W:D[0],X:D[1]}).24();f Y=1s();$(\'#q-5\').j({25:Y[1]+(D[3]/10),1g:Y[0]}).K();$(\'#q-S,#q-5\').E(6(){1h()});$(\'#5-R-22,#5-1q-23\').E(6(){1h();v G});$(L).2S(6(){f D=1r();$(\'#q-S\').j({W:D[0],X:D[1]});f Y=1s();$(\'#q-5\').j({25:Y[1]+(D[3]/10),1g:Y[0]})})}6 B(){$(\'#5-R\').K();9(4.19){$(\'#5-b,#5-r-b-o-y,#5-b-C-1f\').1i()}k{$(\'#5-b,#5-l,#5-l-T,#5-l-U,#5-r-b-o-y,#5-b-C-1f\').1i()}f Z=w 1t();Z.26=6(){$(\'#5-b\').2T(\'V\',4.h[4.7][0]);28(Z.W,Z.X);Z.26=6(){}};Z.V=4.h[4.7][0]};6 28(1u,1v){f 29=$(\'#5-r-b-y\').W();f 2a=$(\'#5-r-b-y\').X();f 1w=(1u+(4.1b*2));f 1x=(1v+(4.1b*2));f 2b=29-1w;f 2c=2a-1x;$(\'#5-r-b-y\').2U({W:1w,X:1x},4.1M,6(){2d()});9((2b==0)&&(2c==0)){9($.2V.2W){1y(2X)}k{1y(2Y)}}$(\'#5-r-b-o-y\').j({W:1u});$(\'#5-l-T,#5-l-U\').j({X:1v+(4.1b*2)})};6 2d(){$(\'#5-R\').1i();$(\'#5-b\').24(6(){2e();2f()});2g()};6 2e(){$(\'#5-r-b-o-y\').2Z(\'30\');$(\'#5-b-C-1p\').1i();9(4.h[4.7][1]){$(\'#5-b-C-1p\').2h(4.h[4.7][1]).K()}9(4.h.A>1){$(\'#5-b-C-1f\').2h(4.1N+\' \'+(4.7+1)+\' \'+4.1O+\' \'+4.h.A).K()}}6 2f(){$(\'#5-l\').K();$(\'#5-l-T,#5-l-U\').j({\'M\':\'1z N(\'+4.1a+\') O-P\'});9(4.7!=0){9(4.19){$(\'#5-l-T\').j({\'M\':\'N(\'+4.1m+\') 1g 15% O-P\'}).11().1j(\'E\',6(){4.7=4.7-1;B();v G})}k{$(\'#5-l-T\').11().2i(6(){$(I).j({\'M\':\'N(\'+4.1m+\') 1g 15% O-P\'})},6(){$(I).j({\'M\':\'1z N(\'+4.1a+\') O-P\'})}).K().1j(\'E\',6(){4.7=4.7-1;B();v G})}}9(4.7!=(4.h.A-1)){9(4.19){$(\'#5-l-U\').j({\'M\':\'N(\'+4.1o+\') 2j 15% O-P\'}).11().1j(\'E\',6(){4.7=4.7+1;B();v G})}k{$(\'#5-l-U\').11().2i(6(){$(I).j({\'M\':\'N(\'+4.1o+\') 2j 15% O-P\'})},6(){$(I).j({\'M\':\'1z N(\'+4.1a+\') O-P\'})}).K().1j(\'E\',6(){4.7=4.7+1;B();v G})}}2k()}6 2k(){$(d).31(6(12){2l(12)})}6 1A(){$(d).11()}6 2l(12){9(12==2m){13=32.2n;1B=27}k{13=12.2n;1B=12.33}18=34.35(13).36();9((18==4.1P)||(18==\'x\')||(13==1B)){1h()}9((18==4.1Q)||(13==37)){9(4.7!=0){4.7=4.7-1;B();1A()}}9((18==4.1R)||(13==39)){9(4.7!=(4.h.A-1)){4.7=4.7+1;B();1A()}}}6 2g(){9((4.h.A-1)>4.7){2o=w 1t();2o.V=4.h[4.7+1][0]}9(4.7>0){2p=w 1t();2p.V=4.h[4.7-1][0]}}6 1h(){$(\'#q-5\').2q();$(\'#q-S\').38(6(){$(\'#q-S\').2q()});$(\'1U, 1V, 1W\').j({\'1X\':\'3a\'})}6 1r(){f s,t;9(L.1k&&L.2r){s=L.2s+L.3b;t=L.1k+L.2r}k 9(d.m.2t>d.m.2u){s=d.m.3c;t=d.m.2t}k{s=d.m.3d;t=d.m.2u}f F,Q;9(14.1k){9(d.u.1l){F=d.u.1l}k{F=14.2s}Q=14.1k}k 9(d.u&&d.u.1C){F=d.u.1l;Q=d.u.1C}k 9(d.m){F=d.m.1l;Q=d.m.1C}9(t<Q){1D=Q}k{1D=t}9(s<F){1E=s}k{1E=F}2v=w 1d(1E,1D,F,Q);v 2v};6 1s(){f s,t;9(14.2w){t=14.2w;s=14.3e}k 9(d.u&&d.u.1F){t=d.u.1F;s=d.u.2x}k 9(d.m){t=d.m.1F;s=d.m.2x}2y=w 1d(s,t);v 2y};6 1y(2z){f 2A=w 2B();1G=2m;3f{f 1G=w 2B()}21(1G-2A<2z)};v I.11(\'E\').E(1S)}})(1H);',62,202,'||||settings|lightbox|function|activeImage||if||image||document|div|var|id|imageArray||css|else|nav|body||data||jquery|container|xScroll|yScroll|documentElement|return|new||box|img|length|_set_image_to_view|details|arrPageSizes|click|windowWidth|false|jQueryMatchedObj|this|href|show|window|background|url|no|repeat|windowHeight|loading|overlay|btnPrev|btnNext|src|width|height|arrPageScroll|objImagePreloader||unbind|objEvent|keycode|self||gif|getAttribute|key|fixedNavigation|imageBlank|containerBorderSize|objClicked|Array|span|currentNumber|left|_finish|hide|bind|innerHeight|clientWidth|imageBtnPrev|btn|imageBtnNext|caption|secNav|___getPageSize|___getPageScroll|Image|intImageWidth|intImageHeight|intWidth|intHeight|___pause|transparent|_disable_keyboard_navigation|escapeKey|clientHeight|pageHeight|pageWidth|scrollTop|curDate|jQuery|overlayBgColor|overlayOpacity|imageLoading|imageBtnClose|containerResizeSpeed|txtImage|txtOf|keyToClose|keyToPrev|keyToNext|_initialize|_start|embed|object|select|visibility|_set_interface|push|title|while|link|btnClose|fadeIn|top|onload||_resize_container_image_box|intCurrentWidth|intCurrentHeight|intDiffW|intDiffH|_show_image|_show_image_data|_set_navigation|_preload_neighbor_images|html|hover|right|_enable_keyboard_navigation|_keyboard_action|null|keyCode|objNext|objPrev|remove|scrollMaxY|innerWidth|scrollHeight|offsetHeight|arrayPageSize|pageYOffset|scrollLeft|arrayPageScroll|ms|date|Date|fn|lightBox|extend|000|ico|prev|next|close|blank|400|hidden|for|append|style|backgroundColor|opacity|resize|attr|animate|browser|msie|250|100|slideDown|fast|keydown|event|DOM_VK_ESCAPE|String|fromCharCode|toLowerCase||fadeOut||visible|scrollMaxX|scrollWidth|offsetWidth|pageXOffset|do'.split('|'),0,{}))
 
// ColorBox v1.3.16 - a full featured, light-weight, customizable lightbox based on jQuery 1.3+
// Copyright (c) 2011 Jack Moore - jack@colorpowered.com
// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(5($,f,g){E h={1t:"3r",28:2s,j:k,2t:"3s",1u:k,29:k,6:k,2u:"3t",1i:k,2a:k,2v:q,1L:q,2w:k,V:k,C:k,2x:q,m:k,Q:k,R:k,13:k,1v:0.9,2y:q,W:"фото {W} из {14}",2z:"назад",t:"вперед",S:"закрыть",F:k,2A:q,1b:q,K:k,2B:q,2b:3u,2C:"Старт слайдшоу",2D:"Остановить слайдшоу",2E:k,2F:k,2c:k,2G:k,2H:k,2d:q,2I:q,2J:q},G=\'G\',r=\'3v\',2e=r+\'3w\',1M=r+\'3x\',1N=r+\'3y\',1w=r+\'3z\',2f=r+\'3A\',1x=r+\'3B\',1j=$.2K.3C&&!$.3D.1v,1y=1j&&$.2K.3E<7,1z=r+\'3F\',$X,$u,$15,$I,$1O,$1P,$1Q,$1R,$o,$B,$v,$1k,$1l,$R,$W,$K,$t,$16,$S,$1S,3={},17,18,Y,Z,z,n,m,F,1m,1A=k,l,1n=r+\'3G\';5 $8(a,b){E c=f.3H(\'8\');4(a){c.2L=r+a}c.p.3I=b||k;J $(c)}5 H(a,b){b=b===\'x\'?$B.j():$B.6();J(2g a===\'2M\')?1T.3J((/%/.2N(a)?(b/2O)*2P(a,10):2P(a,10))):a}5 1U(a){J 3.m||/\\.(3K|3L|3M|3N|3O)(?:\\?([^#]*))?(?:#(\\.*))?$/i.2N(a)}5 2h(a){3P(E i 3Q a){4($.1V(a[i])&&i.3R(0,2)!==\'2i\'){a[i]=a[i].1B(z)}}a.13=a.13||z.13||\'2Q\';a.Q=$.3S(a.Q||$(z).2R(\'Q\'));a.R=a.R||z.R}5 T(a,b){4(b){b.1B(z)}$.3T.T(a)}5 K(){E a,1C=r+"3U",D="D."+r,1W,1D,2j;4(3.K&&$o[1]){1W=5(){$K.1X(3.2D).1Y(D).1o(1N,5(){4(n<$o.1c-1||3.1b){a=1E(l.t,3.2b)}}).1o(1M,5(){2S(a)}).1p(D+\' \'+1w,1D);$u.1F(1C+"2T").1d(1C+"2i");a=1E(l.t,3.2b)};1D=5(){2S(a);$K.1X(3.2C).1Y([1N,1M,1w,D].3V(\' \')).1p(D,1W);$u.1F(1C+"2i").1d(1C+"2T")};4(3.2B){1W()}L{1D()}}}5 2k(b){4(!1A){z=b;2h($.2l(3,$.1e(z,G)));$o=$(z);n=0;4(3.13!==\'2Q\'){$o=$(\'.\'+1n).1Z(5(){E a=$.1e(A,G).13||A.13;J(a===3.13)});n=$o.n(z);4(n===-1){$o=$o.11(z);n=$o.1c-1}}4(!F){F=1m=q;$u.U();4(3.2A){2U{z.3W();$(z).1p(2f,5(){2U{A.3X()}2V(e){}})}2V(e){}}$X.M({"1v":+3.1v,"2m":3.2d?"2W":"20"}).U();3.w=H(3.2t,\'x\');3.h=H(3.2u,\'y\');l.1f(0);4(1y){$B.1o(\'1G.\'+1z+\' 3Y.\'+1z,5(){$X.M({j:$B.j(),6:$B.6(),2X:$B.2Y(),1H:$B.2Z()})}).T(\'1G.\'+1z)}T(2e,3.2E);$1S.11($R).N();$S.V(3.S).U()}l.1g(q)}}l=$.3Z[G]=$[G]=5(a,b){E c=A,1q;4(!c[0]&&c.30){J c}a=a||{};4(b){a.2c=b}4(!c[0]||c.30===31){c=$(\'<a/>\');a.F=q}c.40(5(){$.1e(A,G,$.2l({},$.1e(A,G)||h,a));$(A).1d(1n)});1q=a.F;4($.1V(1q)){1q=1q.1B(c)}4(1q){2k(c[0])}J c};l.32=5(){$B=$(g);$u=$8().2R({2L:G,\'41\':1j?r+(1y?\'42\':\'43\'):\'\'});$X=$8("44",1y?\'1f:33\':\'\').N();$15=$8("45");$I=$8("46").1r($v=$8("34",\'j:0; 6:0; 2n:1I\'),$1l=$8("47").11($8("48")),$R=$8("49"),$W=$8("4a"),$t=$8("4b"),$16=$8("4c"),$K=$8("4d").1o(2e,K),$S=$8("4e"));$15.1r($8().1r($8("4f"),$1O=$8("4g"),$8("4h")),$8(k,\'2j:1H\').1r($1P=$8("4i"),$I,$1Q=$8("4j")),$8(k,\'2j:1H\').1r($8("4k"),$1R=$8("4l"),$8("4m"))).1h().1h().M({\'35\':\'1H\'});$1k=$8(k,\'1f:33; j:36; 21:1I; 4n:22\');$(\'4o\').4p($X,$u.1r($15,$1k));$I.1h().1J(5(){$(A).1d(\'1J\')},5(){$(A).1F(\'1J\')}).1d(\'1J\');17=$1O.6()+$1R.6()+$I.38(q)-$I.6();18=$1P.j()+$1Q.j()+$I.3a(q)-$I.j();Y=$v.38(q);Z=$v.3a(q);$u.M({"3b-4q":17,"3b-4r":18}).N();$t.D(5(){l.t()});$16.D(5(){l.16()});$S.D(5(){l.S()});$1S=$t.11($16).11($W).11($K);$I.1h().1F(\'1J\');$(\'.\'+1n).4s(\'D\',5(e){4(!((e.3c!==0&&2g e.3c!==\'31\')||e.4t||e.4u||e.4v)){e.23();2k(A)}});$X.D(5(){4(3.2d){l.S()}});$(f).1o(\'4w.\'+r,5(e){E a=e.4x;4(F&&3.2I&&a===27){e.23();l.S()}4(F&&3.2J&&$o[1]){4(a===37){e.23();$16.D()}L 4(a===39){e.23();$t.D()}}})};l.24=5(){$u.11($X).24();$(\'.\'+1n).4y(\'D\').4z(G).1F(1n)};l.1f=5(b,c){E d,3d=1T.2o(f.4A.4B-3.h-Y-17,0)/2+$B.2Y(),3e=1T.2o($B.j()-3.w-Z-18,0)/2+$B.2Z();d=($u.j()===3.w+Z&&$u.6()===3.h+Y)?0:b;$15[0].p.j=$15[0].p.6="36";5 2p(a){$1O[0].p.j=$1R[0].p.j=$I[0].p.j=a.p.j;$1l[0].p.6=$1l[1].p.6=$I[0].p.6=$1P[0].p.6=$1Q[0].p.6=a.p.6}$u.4C().4D({j:3.w+Z,6:3.h+Y,2X:3d,1H:3e},{4E:d,1s:5(){2p(A);1m=k;$15[0].p.j=(3.w+Z+18)+"2q";$15[0].p.6=(3.h+Y+17)+"2q";4(c){c()}},4F:5(){2p(A)}})};l.1G=5(a){4(F){a=a||{};4(a.j){3.w=H(a.j,\'x\')-Z-18}4(a.1u){3.w=H(a.1u,\'x\')}$v.M({j:3.w});4(a.6){3.h=H(a.6,\'y\')-Y-17}4(a.1i){3.h=H(a.1i,\'y\')}4(!a.1i&&!a.6){E b=$v.4G("<8 p=\'2n:20\'></8>").1h();3.h=b.6();b.3f(b.1h())}$v.M({6:3.h});l.1f(3.1t==="22"?0:3.28)}};l.12=5(b){4(!F){J}E c=3.1t==="22"?0:3.28;$B.1Y(\'1G.\'+r);$v.24();$v=$8(\'34\').V(b);5 3g(){3.w=3.w||$v.j();3.w=3.O&&3.O<3.w?3.O:3.w;J 3.w}5 3h(){3.h=3.h||$v.6();3.h=3.P&&3.P<3.h?3.P:3.h;J 3.h}$v.N().3i($1k.U()).M({j:3g(),2n:3.1L?\'20\':\'1I\'}).M({6:3h()}).4H($I);$1k.N();$(m).M({\'35\':\'22\'});4(1y){$(\'3j\').3k($u.4I(\'3j\')).1Z(5(){J A.p.21!==\'1I\'}).M({\'21\':\'1I\'}).1p(1w,5(){A.p.21=\'4J\'})}5 2r(s){l.1f(s,5(){E a,19,t,1a,14=$o.1c,C,1s;4(!F){J}1s=5(){$1l.N();T(1N,3.2c)};4(1j){4(m){$v.4K(2O)}}$R.V(3.R).11($v).U();4(14>1){4(2g 3.W==="2M"){$W.V(3.W.3l(/\\{W\\}/,n+1).3l(/\\{14\\}/,14)).U()}$t[(3.1b||n<14-1)?"U":"N"]().V(3.t);$16[(3.1b||n)?"U":"N"]().V(3.2z);a=n?$o[n-1]:$o[14-1];t=n<14-1?$o[n+1]:$o[0];4(3.K){$K.U()}4(3.2y){1a=$.1e(t,G).Q||t.Q;19=$.1e(a,G).Q||a.Q;1a=$.1V(1a)?1a.1B(t):1a;19=$.1V(19)?19.1B(a):19;4(1U(1a)){$(\'<3m/>\')[0].1K=1a}4(1U(19)){$(\'<3m/>\')[0].1K=19}}}L{$1S.N()}4(3.C){C=$(\'<C/>\').1d(r+\'4L\')[0];4(3.2x){1s()}L{$(C).1g(1s)}C.4M=r+(+3n 4N());C.1K=3.Q;4(!3.1L){C.1L="4O"}4(1j){C.4P=0;C.4Q="q"}$(C).3i($v).1p(1x,5(){C.1K="//4R:4S"})}L{1s()}4(3.1t===\'3o\'){$u.25(c,1,5(){$u[0].p.1Z=""})}L{$u[0].p.1Z=""}$B.1o(\'1G.\'+r,5(){l.1f(0)})})}4(3.1t===\'3o\'){$u.25(c,0,5(){2r(0)})}L{2r(c)}};l.1g=5(d){E e,26,12=l.12;1m=q;m=k;z=$o[n];4(!d){2h($.2l(3,$.1e(z,G)))}T(1x);T(1M,3.2F);3.h=3.6?H(3.6,\'y\')-Y-17:3.1i&&H(3.1i,\'y\');3.w=3.j?H(3.j,\'x\')-Z-18:3.1u&&H(3.1u,\'x\');3.O=3.w;3.P=3.h;4(3.29){3.O=H(3.29,\'x\')-Z-18;3.O=3.w&&3.w<3.O?3.w:3.O}4(3.2a){3.P=H(3.2a,\'y\')-Y-17;3.P=3.h&&3.h<3.P?3.h:3.P}e=3.Q;$1l.U();4(3.2w){$8().N().4T($(e)[0]).1p(1x,5(){$(A).3f($v.1h())});12($(e))}L 4(3.C){12(" ")}L 4(3.V){12(3.V)}L 4(1U(e)){$(m=3n 4U()).1d(r+\'4V\').3p(5(){3.R=k;12($8(\'3q\').1X(\'4W 4X 4Y 3k 4Z v\'))}).1g(5(){E a;m.50=51;4(3.2v){26=5(){m.6-=m.6*a;m.j-=m.j*a};4(3.O&&m.j>3.O){a=(m.j-3.O)/m.j;26()}4(3.P&&m.6>3.P){a=(m.6-3.P)/m.6;26()}}4(3.h){m.p.52=1T.2o(3.h-m.6,0)/2+\'2q\'}4($o[1]&&(n<$o.1c-1||3.1b)){m.p.2m=\'2W\';m.53=5(){l.t()}}4(1j){m.p.54=\'55\'}1E(5(){12(m)},1)});1E(5(){m.1K=e},1)}L 4(e){$1k.1g(e,5(a,b,c){12(b===\'3p\'?$8(\'3q\').1X(\'56 57: \'+c.58):$(A).59())})}};l.t=5(){4(!1m&&$o[1]&&(n<$o.1c-1||3.1b)){n=n<$o.1c-1?n+1:0;l.1g()}};l.16=5(){4(!1m&&$o[1]&&(n||3.1b)){n=n?n-1:$o.1c-1;l.1g()}};l.S=5(){4(F&&!1A){1A=q;F=k;T(1w,3.2G);$B.1Y(\'.\'+r+\' .\'+1z);$X.25(5a,0);$u.1D().25(2s,0,5(){$u.11($X).M({\'1v\':1,2m:\'20\'}).N();T(1x);$v.24();1E(5(){1A=k;T(2f,3.2H)},1)})}};l.z=5(){J $(z)};l.3=h;$(l.32)}(5b,5c,A));',62,323,'|||settings|if|function|height||div|||||||||||width|false|publicMethod|photo|index|related|style|true|prefix||next|box|loaded||||element|this|window|iframe|click|var|open|colorbox|setSize|content|return|slideshow|else|css|hide|mw|mh|href|title|close|trigger|show|html|current|overlay|loadedHeight|loadedWidth||add|prep|rel|total|wrap|prev|interfaceHeight|interfaceWidth|prevSrc|nextSrc|loop|length|addClass|data|position|load|children|innerHeight|isIE|loadingBay|loadingOverlay|active|boxElement|bind|one|autoOpen|append|complete|transition|innerWidth|opacity|event_cleanup|event_purge|isIE6|event_ie6|closing|call|className|stop|setTimeout|removeClass|resize|left|hidden|hover|src|scrolling|event_load|event_complete|topBorder|leftBorder|rightBorder|bottomBorder|groupControls|Math|isImage|isFunction|start|text|unbind|filter|auto|visibility|none|preventDefault|remove|fadeTo|setResize||speed|maxWidth|maxHeight|slideshowSpeed|onComplete|overlayClose|event_open|event_closed|typeof|process|on|clear|launch|extend|cursor|overflow|max|modalDimensions|px|setPosition|300|initialWidth|initialHeight|scalePhotos|inline|fastIframe|preloading|previous|returnFocus|slideshowAuto|slideshowStart|slideshowStop|onOpen|onLoad|onCleanup|onClosed|escKey|arrowKey|browser|id|string|test|100|parseInt|nofollow|attr|clearTimeout|off|try|catch|pointer|top|scrollTop|scrollLeft|selector|undefined|init|absolute|LoadedContent|float|9999px||outerHeight||outerWidth|padding|button|posTop|posLeft|replaceWith|getWidth|getHeight|appendTo|select|not|replace|img|new|fade|error|Error|elastic|600|450|2500|cbox|_open|_load|_complete|_cleanup|_closed|_purge|msie|support|version|_IE6|Element|createElement|cssText|round|gif|png|jpg|jpeg|bmp|for|in|substring|trim|event|Slideshow_|join|blur|focus|scroll|fn|each|class|IE6|IE|Overlay|Wrapper|Content|LoadingOverlay|LoadingGraphic|Title|Current|Next|Previous|Slideshow|Close|TopLeft|TopCenter|TopRight|MiddleLeft|MiddleRight|BottomLeft|BottomCenter|BottomRight|display|body|prepend|bottom|right|live|ctrlKey|shiftKey|altKey|keydown|keyCode|die|removeData|documentElement|clientHeight|dequeue|animate|duration|step|wrapInner|prependTo|find|inherit|fadeIn|Iframe|name|Date|no|frameBorder|allowTransparency|about|blank|insertBefore|Image|Photo|This|image|could|be|onload|null|marginTop|onclick|msInterpolationMode|bicubic|Request|unsuccessful|statusText|contents|200|jQuery|document'.split('|'),0,{}))

function select_sort(element){var $dd=$(element);if($dd.length>0){var selectedVal=$dd.val();var lb=$dd[0];arrTexts=new Array();arrTexts2={};for(i=0;i<lb.length;i++){arrTexts[i]=lb.options[i].text;arrTexts2[lb.options[i].text]=lb.options[i].value}arrTexts.sort();for(i=0;i<lb.length;i++){lb.options[i].text=arrTexts[i];lb.options[i].value=arrTexts2[arrTexts[i]]}$dd.val(selectedVal)}}

function getBrowserInfo() {
 var t,v = undefined;
 if (window.opera) t = 'Opera';
 else if (document.all) {
  t = 'IE';
  var nv = navigator.appVersion;
  var s = nv.indexOf('MSIE')+5;
  v = nv.substring(s,s+1);
 }
 else if (navigator.appName) t = 'Netscape';
 return {type:t,version:v};
}
 
function bookmark(a){
 var url = window.document.location;
 var title = window.document.title;
 var b = getBrowserInfo();
 if (b.type == 'IE' && 7 > b.version && b.version >= 4) window.external.AddFavorite(url,title);
 else if (b.type == 'Opera') {
  a.href = url;
  a.rel = "sidebar";
  a.title = url+','+title;
  return true;
 }
 else if (b.type == "Netscape") window.sidebar.addPanel(title,url,"");
 else alert("Нажмите CTRL+D, чтобы добавить страницу в закладки.");
 return false;
}

////////////////////////////////
// alerts.js
////////////////////////////////
function setCookie(name, value, expires, path, domain, secure) 
{
    try {
        document.cookie = 
            name + "=" + escape(value) +
            ((expires) ? "; expires=" + expires : "") +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            ((secure) ? "; secure" : "");
    } catch (err)
    {
        alert('---setCookie---\n'+err);
    }
}

function getCookie(name) 
{
    var cookie = " " + document.cookie;
    var search = " " + name + "=";
    var setStr = null;
    var offset = 0;
    var end = 0;
    try {
        if (cookie.length > 0) 
        {
            offset = cookie.indexOf(search);
            if (offset != -1) 
            {
                offset += search.length;
                end = cookie.indexOf(";", offset)
                if (end == -1) 
                {
                    end = cookie.length;
                }
                setStr = unescape(cookie.substring(offset, end));
            }
        }
    } catch (err)
    {
        alert('---getCookie---\n'+err);
    }
    return(setStr);
}

/*
Значение 1 кука c_name или отсутствие такого кука говорят о том, что надо показывать
*/

/*
Содержимое того, что должно быть в d.innerHTML. Берем, копируем туда и удаляем пробелы - ява не понимает многострочные переменные.

<a href='' onclick='return alert_confirm_st(1);'>ok</a><br>
<a href='' onclick='return alert_confirm_st();'>no</a><br><br>
Поставьте галочку, если вы не хотите, чтобы это предупреждение появлялось<br>
<input type='checkbox' id='oq34h6w8t_no'><br>

*/
var alert_confirm_id = "oq34h6w8t";
var alert_confirm_id_no = "oq34h6w8t_no";
var alert_confirm_func_ok = null;
var alert_confirm_cname = null;

function alert_confirm(c_name,code,func_ok)
{
    try {
        var cook = getCookie(c_name);
        if ( cook == null || cook == 1 )
        {
            alert_confirm_cname = c_name;
            alert_confirm_func_ok = func_ok;
            
            if ( code != null ) { code(); }
        } else {
            if ( func_ok != null ) { func_ok(); }
        }
    } catch (err)
    {
        alert('---alert_confirm---\n'+err);
    }
    return true;
}
function alert_confirm_st(st,par)
{
    try {
        var finded = $(par).find('#oq34h6w8t_no');
        if ( $(finded)[0] != null && $(finded)[0].checked == true )
        {
            alert('1');
            setCookie(alert_confirm_cname,2,"Mon, 01-Jan-2101 00:00:00 GMT");       
        }

        if ( 'undefined' != st && st == 1 && alert_confirm_func_ok != null ) 
        {
            var aa = alert_confirm_func_ok;
            alert_confirm_func_ok = null;
            alert_confirm_cname = null;
            aa();
        }
        
        $.fn.fancybox.close();
        
        alert_confirm_func_ok = null;
        alert_confirm_cname = null;
    } catch (err)
    {
        alert('---alert_confirm_st---\n'+err);
    }
    return false;
}
////////////////////////////////
// END.alerts.js
////////////////////////////////

//// ScrollTo
(function(c){var a=c.scrollTo=function(f,e,d){c(window).scrollTo(f,e,d)};a.defaults={axis:"xy",duration:parseFloat(c.fn.jquery)>=1.3?0:1};a.window=function(d){return c(window)._scrollable()};c.fn._scrollable=function(){return this.map(function(){var e=this,d=!e.nodeName||c.inArray(e.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!d){return e}var f=(e.contentWindow||e).document||e.ownerDocument||e;return c.browser.safari||f.compatMode=="BackCompat"?f.body:f.documentElement})};c.fn.scrollTo=function(f,e,d){if(typeof e=="object"){d=e;e=0}if(typeof d=="function"){d={onAfter:d}}if(f=="max"){f=9000000000}d=c.extend({},a.defaults,d);e=e||d.speed||d.duration;d.queue=d.queue&&d.axis.length>1;if(d.queue){e/=2}d.offset=b(d.offset);d.over=b(d.over);return this._scrollable().each(function(){var l=this,j=c(l),k=f,i,g={},m=j.is("html,body");switch(typeof k){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(k)){k=b(k);break}k=c(k,this);case"object":if(k.is||k.style){i=(k=c(k)).offset()}}c.each(d.axis.split(""),function(q,r){var s=r=="x"?"Left":"Top",u=s.toLowerCase(),p="scroll"+s,o=l[p],n=a.max(l,r);if(i){g[p]=i[u]+(m?0:o-j.offset()[u]);if(d.margin){g[p]-=parseInt(k.css("margin"+s))||0;g[p]-=parseInt(k.css("border"+s+"Width"))||0}g[p]+=d.offset[u]||0;if(d.over[u]){g[p]+=k[r=="x"?"width":"height"]()*d.over[u]}}else{var t=k[u];g[p]=t.slice&&t.slice(-1)=="%"?parseFloat(t)/100*n:t}if(/^\d+$/.test(g[p])){g[p]=g[p]<=0?0:Math.min(g[p],n)}if(!q&&d.queue){if(o!=g[p]){h(d.onAfterFirst)}delete g[p]}});h(d.onAfter);function h(n){j.animate(g,e,d.easing,n&&function(){n.call(this,f,d)})}}).end()};a.max=function(j,i){var h=i=="x"?"Width":"Height",e="scroll"+h;if(!c(j).is("html,body")){return j[e]-c(j)[h.toLowerCase()]()}var g="client"+h,f=j.ownerDocument.documentElement,d=j.ownerDocument.body;return Math.max(f[e],d[e])-Math.min(f[g],d[g])};function b(d){return typeof d=="object"?d:{top:d,left:d}}})(jQuery);(function(d){var a=location.href.replace(/#.*/,"");var c=d.localScroll=function(e){d("body").localScroll(e)};c.defaults={duration:1000,axis:"y",event:"click",stop:true,target:window,reset:true};c.hash=function(f){if(location.hash){f=d.extend({},c.defaults,f);f.hash=false;if(f.reset){var g=f.duration;delete f.duration;d(f.target).scrollTo(0,f);f.duration=g}b(0,location,f)}};d.fn.localScroll=function(e){e=d.extend({},c.defaults,e);return e.lazy?this.bind(e.event,function(g){var h=d([g.target,g.target.parentNode]).filter(f)[0];if(h){b(g,h,e)}}):this.find("a,area").filter(f).bind(e.event,function(g){b(g,this,e)}).end().end();function f(){return !!this.href&&!!this.hash&&this.href.replace(this.hash,"")==a&&(!e.filter||d(this).is(e.filter))}};function b(i,p,g){var q=p.hash.slice(1),o=document.getElementById(q)||document.getElementsByName(q)[0];if(!o){return}if(i){i.preventDefault()}var n=d(g.target);if(g.lock&&n.is(":animated")||g.onBefore&&g.onBefore.call(g,i,o,n)===false){return}if(g.stop){n.stop(true)}if(g.hash){var m=o.id==q?"id":"name",l=d("<a> </a>").attr(m,q).css({position:"absolute",top:d(window).scrollTop(),left:d(window).scrollLeft()});o[m]="";d("body").prepend(l);location=p.hash;l.remove();o[m]=q}n.scrollTo(o,g).trigger("notify.serialScroll",[o])}})(jQuery);
//// ScrollTo.End

/* 
 * flowplayer.js 3.1.4. The Flowplayer API
 * 
 * Copyright 2009 Flowplayer Oy
 * 
 * This file is part of Flowplayer.
 * 
 * Flowplayer is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Flowplayer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Flowplayer.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * Date: 2009-02-25 21:24:29 +0000 (Wed, 25 Feb 2009)
 * Revision: 166 
 */
(function(){function g(o){console.log("$f.fireEvent",[].slice.call(o))}function k(q){if(!q||typeof q!="object"){return q}var o=new q.constructor();for(var p in q){if(q.hasOwnProperty(p)){o[p]=k(q[p])}}return o}function m(t,q){if(!t){return}var o,p=0,r=t.length;if(r===undefined){for(o in t){if(q.call(t[o],o,t[o])===false){break}}}else{for(var s=t[0];p<r&&q.call(s,p,s)!==false;s=t[++p]){}}return t}function c(o){return document.getElementById(o)}function i(q,p,o){if(typeof p!="object"){return q}if(q&&p){m(p,function(r,s){if(!o||typeof s!="function"){q[r]=s}})}return q}function n(s){var q=s.indexOf(".");if(q!=-1){var p=s.substring(0,q)||"*";var o=s.substring(q+1,s.length);var r=[];m(document.getElementsByTagName(p),function(){if(this.className&&this.className.indexOf(o)!=-1){r.push(this)}});return r}}function f(o){o=o||window.event;if(o.preventDefault){o.stopPropagation();o.preventDefault()}else{o.returnValue=false;o.cancelBubble=true}return false}function j(q,o,p){q[o]=q[o]||[];q[o].push(p)}function e(){return"_"+(""+Math.random()).substring(2,10)}var h=function(t,r,s){var q=this;var p={};var u={};q.index=r;if(typeof t=="string"){t={url:t}}i(this,t,true);m(("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop").split(","),function(){var v="on"+this;if(v.indexOf("*")!=-1){v=v.substring(0,v.length-1);var w="onBefore"+v.substring(2);q[w]=function(x){j(u,w,x);return q}}q[v]=function(x){j(u,v,x);return q};if(r==-1){if(q[w]){s[w]=q[w]}if(q[v]){s[v]=q[v]}}});i(this,{onCuepoint:function(x,w){if(arguments.length==1){p.embedded=[null,x];return q}if(typeof x=="number"){x=[x]}var v=e();p[v]=[x,w];if(s.isLoaded()){s._api().fp_addCuepoints(x,r,v)}return q},update:function(w){i(q,w);if(s.isLoaded()){s._api().fp_updateClip(w,r)}var v=s.getConfig();var x=(r==-1)?v.clip:v.playlist[r];i(x,w,true)},_fireEvent:function(v,y,w,A){if(v=="onLoad"){m(p,function(B,C){if(C[0]){s._api().fp_addCuepoints(C[0],r,B)}});return false}A=A||q;if(v=="onCuepoint"){var z=p[y];if(z){return z[1].call(s,A,w)}}if(y&&"onBeforeBegin,onMetaData,onStart,onUpdate,onResume".indexOf(v)!=-1){i(A,y);if(y.metaData){if(!A.duration){A.duration=y.metaData.duration}else{A.fullDuration=y.metaData.duration}}}var x=true;m(u[v],function(){x=this.call(s,A,y,w)});return x}});if(t.onCuepoint){var o=t.onCuepoint;q.onCuepoint.apply(q,typeof o=="function"?[o]:o);delete t.onCuepoint}m(t,function(v,w){if(typeof w=="function"){j(u,v,w);delete t[v]}});if(r==-1){s.onCuepoint=this.onCuepoint}};var l=function(p,r,q,t){var s={};var o=this;var u=false;if(t){i(s,t)}m(r,function(v,w){if(typeof w=="function"){s[v]=w;delete r[v]}});i(this,{animate:function(y,z,x){if(!y){return o}if(typeof z=="function"){x=z;z=500}if(typeof y=="string"){var w=y;y={};y[w]=z;z=500}if(x){var v=e();s[v]=x}if(z===undefined){z=500}r=q._api().fp_animate(p,y,z,v);return o},css:function(w,x){if(x!==undefined){var v={};v[w]=x;w=v}r=q._api().fp_css(p,w);i(o,r);return o},show:function(){this.display="block";q._api().fp_showPlugin(p);return o},hide:function(){this.display="none";q._api().fp_hidePlugin(p);return o},toggle:function(){this.display=q._api().fp_togglePlugin(p);return o},fadeTo:function(y,x,w){if(typeof x=="function"){w=x;x=500}if(w){var v=e();s[v]=w}this.display=q._api().fp_fadeTo(p,y,x,v);this.opacity=y;return o},fadeIn:function(w,v){return o.fadeTo(1,w,v)},fadeOut:function(w,v){return o.fadeTo(0,w,v)},getName:function(){return p},getPlayer:function(){return q},_fireEvent:function(w,v,x){if(w=="onUpdate"){var y=q._api().fp_getPlugin(p);if(!y){return}i(o,y);delete o.methods;if(!u){m(y.methods,function(){var A=""+this;o[A]=function(){var B=[].slice.call(arguments);var C=q._api().fp_invoke(p,A,B);return C==="undefined"||C===undefined?o:C}});u=true}}var z=s[w];if(z){z.apply(o,v);if(w.substring(0,1)=="_"){delete s[w]}}}})};function b(o,t,z){var E=this,y=null,x,u,p=[],s={},B={},r,v,w,D,A,q;i(E,{id:function(){return r},isLoaded:function(){return(y!==null)},getParent:function(){return o},hide:function(F){if(F){o.style.height="0px"}if(y){y.style.height="0px"}return E},show:function(){o.style.height=q+"px";if(y){y.style.height=A+"px"}return E},isHidden:function(){return y&&parseInt(y.style.height,10)===0},load:function(F){if(!y&&E._fireEvent("onBeforeLoad")!==false){m(a,function(){this.unload()});x=o.innerHTML;if(x&&!flashembed.isSupported(t.version)){o.innerHTML=""}flashembed(o,t,{config:z});if(F){F.cached=true;j(B,"onLoad",F)}}return E},unload:function(){if(x.replace(/\s/g,"")!==""){if(E._fireEvent("onBeforeUnload")===false){return E}try{if(y){y.fp_close();E._fireEvent("onUnload")}}catch(F){}y=null;o.innerHTML=x}return E},getClip:function(F){if(F===undefined){F=D}return p[F]},getCommonClip:function(){return u},getPlaylist:function(){return p},getPlugin:function(F){var H=s[F];if(!H&&E.isLoaded()){var G=E._api().fp_getPlugin(F);if(G){H=new l(F,G,E);s[F]=H}}return H},getScreen:function(){return E.getPlugin("screen")},getControls:function(){return E.getPlugin("controls")},getConfig:function(F){return F?k(z):z},getFlashParams:function(){return t},loadPlugin:function(I,H,K,J){if(typeof K=="function"){J=K;K={}}var G=J?e():"_";E._api().fp_loadPlugin(I,H,K,G);var F={};F[G]=J;var L=new l(I,null,E,F);s[I]=L;return L},getState:function(){return y?y.fp_getState():-1},play:function(G,F){function H(){if(G!==undefined){E._api().fp_play(G,F)}else{E._api().fp_play()}}if(y){H()}else{E.load(function(){H()})}return E},getVersion:function(){var G="flowplayer.js 3.1.4";if(y){var F=y.fp_getVersion();F.push(G);return F}return G},_api:function(){if(!y){throw"Flowplayer "+E.id()+" not loaded when calling an API method"}return y},setClip:function(F){E.setPlaylist([F]);return E},getIndex:function(){return w}});m(("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut").split(","),function(){var F="on"+this;if(F.indexOf("*")!=-1){F=F.substring(0,F.length-1);var G="onBefore"+F.substring(2);E[G]=function(H){j(B,G,H);return E}}E[F]=function(H){j(B,F,H);return E}});m(("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,toggleFullscreen,reset,close,setPlaylist,addClip,playFeed").split(","),function(){var F=this;E[F]=function(H,G){if(!y){return E}var I=null;if(H!==undefined&&G!==undefined){I=y["fp_"+F](H,G)}else{I=(H===undefined)?y["fp_"+F]():y["fp_"+F](H)}return I==="undefined"||I===undefined?E:I}});E._fireEvent=function(O){if(typeof O=="string"){O=[O]}var P=O[0],M=O[1],K=O[2],J=O[3],I=0;if(z.debug){g(O)}if(!y&&P=="onLoad"&&M=="player"){y=y||c(v);A=y.clientHeight;m(p,function(){this._fireEvent("onLoad")});m(s,function(Q,R){R._fireEvent("onUpdate")});u._fireEvent("onLoad")}if(P=="onLoad"&&M!="player"){return}if(P=="onError"){if(typeof M=="string"||(typeof M=="number"&&typeof K=="number")){M=K;K=J}}if(P=="onContextMenu"){m(z.contextMenu[M],function(Q,R){R.call(E)});return}if(P=="onPluginEvent"){var F=M.name||M;var G=s[F];if(G){G._fireEvent("onUpdate",M);G._fireEvent(K,O.slice(3))}return}if(P=="onPlaylistReplace"){p=[];var L=0;m(M,function(){p.push(new h(this,L++,E))})}if(P=="onClipAdd"){if(M.isInStream){return}M=new h(M,K,E);p.splice(K,0,M);for(I=K+1;I<p.length;I++){p[I].index++}}var N=true;if(typeof M=="number"&&M<p.length){D=M;var H=p[M];if(H){N=H._fireEvent(P,K,J)}if(!H||N!==false){N=u._fireEvent(P,K,J,H)}}m(B[P],function(){N=this.call(E,M,K);if(this.cached){B[P].splice(I,1)}if(N===false){return false}I++});return N};function C(){if($f(o)){$f(o).getParent().innerHTML="";w=$f(o).getIndex();a[w]=E}else{a.push(E);w=a.length-1}q=parseInt(o.style.height,10)||o.clientHeight;if(typeof t=="string"){t={src:t}}r=o.id||"fp"+e();v=t.id||r+"_api";t.id=v;z.playerId=r;if(typeof z=="string"){z={clip:{url:z}}}if(typeof z.clip=="string"){z.clip={url:z.clip}}z.clip=z.clip||{};if(o.getAttribute("href",2)&&!z.clip.url){z.clip.url=o.getAttribute("href",2)}u=new h(z.clip,-1,E);z.playlist=z.playlist||[z.clip];var F=0;m(z.playlist,function(){var H=this;if(typeof H=="object"&&H.length){H={url:""+H}}m(z.clip,function(I,J){if(J!==undefined&&H[I]===undefined&&typeof J!="function"){H[I]=J}});z.playlist[F]=H;H=new h(H,F,E);p.push(H);F++});m(z,function(H,I){if(typeof I=="function"){if(u[H]){u[H](I)}else{j(B,H,I)}delete z[H]}});m(z.plugins,function(H,I){if(I){s[H]=new l(H,I,E)}});if(!z.plugins||z.plugins.controls===undefined){s.controls=new l("controls",null,E)}s.canvas=new l("canvas",null,E);t.bgcolor=t.bgcolor||"#000000";t.version=t.version||[9,0];t.expressInstall="http://www.flowplayer.org/swf/expressinstall.swf";function G(H){if(!E.isLoaded()&&E._fireEvent("onBeforeClick")!==false){E.load()}return f(H)}x=o.innerHTML;if(x.replace(/\s/g,"")!==""){if(o.addEventListener){o.addEventListener("click",G,false)}else{if(o.attachEvent){o.attachEvent("onclick",G)}}}else{if(o.addEventListener){o.addEventListener("click",f,false)}E.load()}}if(typeof o=="string"){flashembed.domReady(function(){var F=c(o);if(!F){throw"Flowplayer cannot access element: "+o}else{o=F;C()}})}else{C()}}var a=[];function d(o){this.length=o.length;this.each=function(p){m(o,p)};this.size=function(){return o.length}}window.flowplayer=window.$f=function(){var p=null;var o=arguments[0];if(!arguments.length){m(a,function(){if(this.isLoaded()){p=this;return false}});return p||a[0]}if(arguments.length==1){if(typeof o=="number"){return a[o]}else{if(o=="*"){return new d(a)}m(a,function(){if(this.id()==o.id||this.id()==o||this.getParent()==o){p=this;return false}});return p}}if(arguments.length>1){var r=arguments[1];var q=(arguments.length==3)?arguments[2]:{};if(typeof o=="string"){if(o.indexOf(".")!=-1){var t=[];m(n(o),function(){t.push(new b(this,k(r),k(q)))});return new d(t)}else{var s=c(o);return new b(s!==null?s:o,r,q)}}else{if(o){return new b(o,r,q)}}}return null};i(window.$f,{fireEvent:function(){var o=[].slice.call(arguments);var q=$f(o[0]);return q?q._fireEvent(o.slice(1)):null},addPlugin:function(o,p){b.prototype[o]=p;return $f},each:m,extend:i});if(typeof jQuery=="function"){jQuery.prototype.flowplayer=function(q,p){if(!arguments.length||typeof arguments[0]=="number"){var o=[];this.each(function(){var r=$f(this);if(r){o.push(r)}});return arguments.length?o[arguments[0]]:new d(o)}return this.each(function(){$f(this,k(q),p?k(p):{})})}}})();(function(){var e=typeof jQuery=="function";var i={width:"100%",height:"100%",allowfullscreen:true,allowscriptaccess:"always",quality:"high",version:null,onFail:null,expressInstall:null,w3c:false,cachebusting:false};if(e){jQuery.tools=jQuery.tools||{};jQuery.tools.flashembed={version:"1.0.4",conf:i}}function j(){if(c.done){return false}var l=document;if(l&&l.getElementsByTagName&&l.getElementById&&l.body){clearInterval(c.timer);c.timer=null;for(var k=0;k<c.ready.length;k++){c.ready[k].call()}c.ready=null;c.done=true}}var c=e?jQuery:function(k){if(c.done){return k()}if(c.timer){c.ready.push(k)}else{c.ready=[k];c.timer=setInterval(j,13)}};function f(l,k){if(k){for(key in k){if(k.hasOwnProperty(key)){l[key]=k[key]}}}return l}function g(k){switch(h(k)){case"string":k=k.replace(new RegExp('(["\\\\])',"g"),"\\$1");k=k.replace(/^\s?(\d+)%/,"$1pct");return'"'+k+'"';case"array":return"["+b(k,function(n){return g(n)}).join(",")+"]";case"function":return'"function()"';case"object":var l=[];for(var m in k){if(k.hasOwnProperty(m)){l.push('"'+m+'":'+g(k[m]))}}return"{"+l.join(",")+"}"}return String(k).replace(/\s/g," ").replace(/\'/g,'"')}function h(l){if(l===null||l===undefined){return false}var k=typeof l;return(k=="object"&&l.push)?"array":k}if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}function b(k,n){var m=[];for(var l in k){if(k.hasOwnProperty(l)){m[l]=n(k[l])}}return m}function a(r,t){var q=f({},r);var s=document.all;var n='<object width="'+q.width+'" height="'+q.height+'"';if(s&&!q.id){q.id="_"+(""+Math.random()).substring(9)}if(q.id){n+=' id="'+q.id+'"'}if(q.cachebusting){q.src+=((q.src.indexOf("?")!=-1?"&":"?")+Math.random())}if(q.w3c||!s){n+=' data="'+q.src+'" type="application/x-shockwave-flash"'}else{n+=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'}n+=">";if(q.w3c||s){n+='<param name="movie" value="'+q.src+'" />'}q.width=q.height=q.id=q.w3c=q.src=null;for(var l in q){if(q[l]!==null){n+='<param name="'+l+'" value="'+q[l]+'" />'}}var o="";if(t){for(var m in t){if(t[m]!==null){o+=m+"="+(typeof t[m]=="object"?g(t[m]):t[m])+"&"}}o=o.substring(0,o.length-1);n+='<param name="flashvars" value=\''+o+"' />"}n+="</object>";return n}function d(m,p,l){var k=flashembed.getVersion();f(this,{getContainer:function(){return m},getConf:function(){return p},getVersion:function(){return k},getFlashvars:function(){return l},getApi:function(){return m.firstChild},getHTML:function(){return a(p,l)}});var q=p.version;var r=p.expressInstall;var o=!q||flashembed.isSupported(q);if(o){p.onFail=p.version=p.expressInstall=null;m.innerHTML=a(p,l)}else{if(q&&r&&flashembed.isSupported([6,65])){f(p,{src:r});l={MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title};m.innerHTML=a(p,l)}else{if(m.innerHTML.replace(/\s/g,"")!==""){}else{m.innerHTML="<h2>Flash version "+q+" or greater is required</h2><h3>"+(k[0]>0?"Your version is "+k:"You have no flash plugin installed")+"</h3>"+(m.tagName=="A"?"<p>Click here to download latest version</p>":"<p>Download latest version from <a href='http://www.adobe.com/go/getflashplayer'>here</a></p>");if(m.tagName=="A"){m.onclick=function(){location.href="http://www.adobe.com/go/getflashplayer"}}}}}if(!o&&p.onFail){var n=p.onFail.call(this);if(typeof n=="string"){m.innerHTML=n}}if(document.all){window[p.id]=document.getElementById(p.id)}}window.flashembed=function(l,m,k){if(typeof l=="string"){var n=document.getElementById(l);if(n){l=n}else{c(function(){flashembed(l,m,k)});return}}if(!l){return}if(typeof m=="string"){m={src:m}}var o=f({},i);f(o,m);return new d(l,o,k)};f(window.flashembed,{getVersion:function(){var m=[0,0];if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){var l=navigator.plugins["Shockwave Flash"].description;if(typeof l!="undefined"){l=l.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var n=parseInt(l.replace(/^(.*)\..*$/,"$1"),10);var r=/r/.test(l)?parseInt(l.replace(/^.*r(.*)$/,"$1"),10):0;m=[n,r]}}else{if(window.ActiveXObject){try{var p=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(q){try{p=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");m=[6,0];p.AllowScriptAccess="always"}catch(k){if(m[0]==6){return m}}try{p=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(o){}}if(typeof p=="object"){l=p.GetVariable("$version");if(typeof l!="undefined"){l=l.replace(/^\S+\s+(.*)$/,"$1").split(",");m=[parseInt(l[0],10),parseInt(l[2],10)]}}}}return m},isSupported:function(k){var m=flashembed.getVersion();var l=(m[0]>k[0])||(m[0]==k[0]&&m[1]>=k[1]);return l},domReady:c,asString:g,getHTML:a});if(e){jQuery.fn.flashembed=function(l,k){var m=null;this.each(function(){m=flashembed(this,l,k)});return l.api===false?this:m}}})();

/**
 * @author Alexander Farkas
 * v. 1.02
 */
(function($) {
    $.extend($.fx.step,{
        backgroundPosition: function(fx) {
            if (fx.state === 0 && typeof fx.end == 'string') {
                var start = $.curCSS(fx.elem,'backgroundPosition');
                start = toArray(start);
                fx.start = [start[0],start[2]];
                var end = toArray(fx.end);
                fx.end = [end[0],end[2]];
                fx.unit = [end[1],end[3]];
            }
            var nowPosX = [];
            nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0];
            nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1];
            fx.elem.style.backgroundPosition = nowPosX[0]+' '+nowPosX[1];

           function toArray(strg){
               strg = strg.replace(/left|top/g,'0px');
               strg = strg.replace(/right|bottom/g,'100%');
               strg = strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");
               var res = strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);
               return [parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]];
           }
        }
    });
})(jQuery);

function IsNumeric(sText)
{
   var ValidChars = "-0123456789.";
   var IsNumber=true;
   var Char;

   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
}

function open_modal(id){
    var maskHeight = $(document).height();
    var maskWidth = $(window).width();
    $('#mask').css({'width':maskWidth,'height':maskHeight,'opacity':0.5});
    $('#mask').fadeIn(500);            
    var winH = $(window).height()/2+$(window).scrollTop();
    var winW = $(window).width();

    $(id).css('top', winH-$(id).height()/2);
    $(id).css('left', winW/2-$(id).width()/2);
    $(id).find(".close").css({'top':winH-$(id).height()/2 + 5,'left':winW/2+$(id).width()/2-5})
    $(id).fadeIn(1000);
    return false;
}
function close_modal(){
    $('#mask').fadeOut("slow");
    $('.window').fadeOut("slow");
    return false;
}

(function($){
    $.snowfall = function(element, options){
        var    defaults = {
                flakeCount : 35,
                flakeColor : '#ffffff',
                flakeIndex: 999999,
                minSize : 1,
                maxSize : 3,
                minSpeed : 2,
                maxSpeed : 3
            },
            options = $.extend(defaults, options),
            random = function random(min, max){
                return Math.round(min + Math.random()*(max-min)); 
            };
            
            $(element).data("snowfall", this);            
            
            // Snow flake object
            function Flake(_x, _y, _size, _speed, _id)
            {
                // Flake properties
                this.id = _id; 
                this.x  = _x;
                this.y  = _y;
                this.size = _size;
                this.speed = _speed;
                this.step = 0,
                this.stepSize = random(1,10) / 100;
                                                                                                                                                //options.flakeColor                                                //options.flakeColor
                var flakeMarkup = $(document.createElement("div")).attr({'class': 'snowfall-flakes', 'id' : 'flake-' + this.id}).css({'width' : '16px', 'height' : '16px', 'background' : 'url(/data/img/sneg.gif) no-repeat center', 'position' : 'absolute', 'top' : this.y, 'left' : this.x, 'fontSize' : 0, 'zIndex' : options.flakeIndex});
                
                if($(element).get(0).tagName === $(document).get(0).tagName){
                    $('body').append(flakeMarkup);
                    element = $('body');
                }else{
                    $(element).append(flakeMarkup);
                }
                
                this.element = document.getElementById('flake-' + this.id);
                
                // Update function, used to update the snow flakes, and checks current snowflake against bounds
                this.update = function(){
                    this.y += this.speed;
                    
                    if(this.y > (elHeight) - 6){
                        this.reset();
                    }
                    
                    this.element.style.top = this.y + 'px';
                    this.element.style.left = this.x + 'px';
                    
                    this.step += this.stepSize;
                    this.x += Math.cos(this.step);
                    
                    if(this.x > (elWidth) - 6 || this.x < 6){
                        this.reset();
                    }
                }
                
                // Resets the snowflake once it reaches one of the bounds set
                this.reset = function(){
                    this.y = 0;
                    this.x = random(0, elWidth);
                    this.stepSize = random(1,10) / 100;
                    this.size = random((options.minSize * 100), (options.maxSize * 100)) / 100;
                    this.speed = random(options.minSpeed, options.maxSpeed);
                }
            }
        
            // Private vars
            var flakes = [],
                flakeId = 0,
                i = 0,
                elHeight = $(element).height(),
                elWidth = $(element).width();
            
            // Bind the window resize event so we can get the innerHeight again
            $(window).bind("resize", function(){  
                elHeight = $(element).height();
                elWidth = $(element).width();
            }); 
            

            // initialize the flakes
            for(i = 0; i < options.flakeCount; i+=1){
                flakeId = flakes.length;
                flakes.push(new Flake(random(0,elWidth), random(0, elHeight), random((options.minSize * 100), (options.maxSize * 100)) / 100, random(options.minSpeed, options.maxSpeed), flakeId));
            }
        
            // this controls flow of the updating snow
            function snow(){
                for( i = 0; i < flakes.length; i += 1){
                    flakes[i].update();
                }
                
                setTimeout(function(){snow()}, 30);
            }
            
            snow();
        
        // Public Methods
        
        // clears the snowflakes
        this.clear = function(){
                        $(element).children('.snowfall-flakes').remove();
                        flakes = [];
                    };
    };
    
    // Initialize the options and the plugin
    $.fn.snowfall = function(options){
        if(typeof(options) == "object" || options == undefined){        
                 return this.each(function(i){
                    (new $.snowfall(this, options)); 
                });    
        }else if (typeof(options) == "string") {
            return this.each(function(i){
                var snow = $(this).data('snowfall');
                if(snow){
                    snow.clear();
                }
            });
        }
    };
})(jQuery);

//Global Options 
$(function(){
    $("a[name='modal']").click(function(e){e.preventDefault();var id=$(this).attr('href');open_modal(id);});
    $('.window .close').click(function(e){e.preventDefault();close_modal()});
    $('#mask').click(function (){$(this).fadeOut('slow');$('.window').hide();});    
    if ( $("#log_in input").val() == "" ) $("#log_in label").show();
    if ( $("#search_top input").val() == "" ) $("#search_top label").show();
    $("#log_in input").prev("label").click(function(){
        $(this).next("input").focus();
    })
    $("#log_in input,#search_top input").focus(function(){
        $(this).prev("label").hide();
    });
    $("#log_in input,#search_top input").blur(function(){
        if ( $(this).val() == "" ) $(this).prev("label").show();
    });
    $("#select_event a").click(function(){
        var evtype = $(this).attr("rel");
        $("#kino,.events_block").hide();
        $("#" + evtype).show();
        if ( evtype != "kino") $("#afisha_date").hide(); else $("#afisha_date").show();
        $("#select_event li").removeClass("active");
        $(this).parent().addClass("active");
        return false;
    })
    $("#desk_type_select").change(function(){
        var sort = $(this).find("option:selected").val();
        if (sort != "") location = sort;
    })
    $("input[name='reg_num']").attr("autocomplete","off");
    $("#comment_form").submit(function(){$("#loading_img").fadeIn();})
    $("#afisha_preview li a,#article_preview li a,.label_poster, a.onlightbox,#desk_preview a,#pages_preview a").colorbox();
    if ( $("#auto_desk").length ) $("#auto_desk").tablesorter();
    $("#auto_desk tbody tr,#my_list tbody tr").hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")});
    $("#auto_desk").bind("sortEnd",function(){
        $("#auto_desk tr").removeClass("odd_background");
        $("#auto_desk tbody tr:odd").addClass("odd_background");
    });
    
    var cur = 1;
    var cnt = $("#select_event a").length;
    $("#select_event").everyTime(3500,'cnter',function(){
        $("#select_event a:eq("+cur+")").click();

        if (cur < (cnt-1)) cur++;
        else cur = 0;
    });
    $(".events_block,#select_event").hover(function(){$("#select_event").stopTime('cnter')},function(){
        $("#select_event").everyTime(3500,'cnter',function(){
            $("#select_event a:eq("+cur+")").click();
            if (cur < (cnt-1)) cur++;
            else cur = 0;
        });
    })
    
    //$('#snowflakes').snowfall();
    
    $(document).pngFix();
    $("a.log_exit").click(function(){log_exit();return false;});
})
