
var is_chrome = false, chrome_version = false;
if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {
       is_chrome = true;
       chrome_version = navigator.userAgent.replace(/^.*Chrome\/([\d\.]+).*$/i, '$1')
}

// Колличество комментариев на странице
function Change (count,id,sub,news) {
setCookie('ccom', '', TTL(), '/');
setCookie('ccom', count.value, TTL(), '/');

jQuery.get('/protect/comment.php', {'id': id,'sub':sub,'news':news}, function(data) {
jQuery("#intro").html(data);
});

}

// Сортировка на странице
function Change2 (count,id,sub,news) {
setCookie('sort', '', TTL(), '/');
setCookie('sort', count.value, TTL(), '/');

jQuery.get('/protect/comment.php', {'id': id,'sub':sub,'news':news}, function(data) {
jQuery("#intro").html(data);
});

}


// Колличество комментариев на странице
function Changeauto (count,id,sub,news) {
setCookie('ccom', '', TTL(), '/');
setCookie('ccom', count.value, TTL(), '/');

jQuery.get('/protect/comment5.php', {'id': id,'sub':sub,'news':news}, function(data) {
jQuery("#intro").html(data);
});

}

// Сортировка на странице
function Change2auto (count,id,sub,news) {
setCookie('sort', '', TTL(), '/');
setCookie('sort', count.value, TTL(), '/');

jQuery.get('/protect/comment5.php', {'id': id,'sub':sub,'news':news}, function(data) {
jQuery("#intro").html(data);
});

}

// Колличество комментариев на странице
function Changew (count,id,sub,news) {
setCookie('ccom', '', TTL(), '/');
setCookie('ccom', count.value, TTL(), '/');

jQuery.get('/protect/comment4.php', {'id': id,'sub':sub,'news':news}, function(data) {
jQuery("#intro").html(data);
});

}

// Сортировка на странице
function Change2w (count,id,sub,news) {
setCookie('sort', '', TTL(), '/');
setCookie('sort', count.value, TTL(), '/');

jQuery.get('/protect/comment4.php', {'id': id,'sub':sub,'news':news}, function(data) {
jQuery("#intro").html(data);
});

}


// Колличество комментариев на странице
function Changebl (count,id,sub,news) {
setCookie('ccom', '', TTL(), '/');
setCookie('ccom', count.value, TTL(), '/');

jQuery.get('/protect/comment2.php', {'id': id,'sub':sub,'news':news}, function(data) {
jQuery("#intro").html(data);
});

}

// Сортировка на странице
function Change2bl (count,id,sub,news) {
setCookie('sort', '', TTL(), '/');
setCookie('sort', count.value, TTL(), '/');

jQuery.get('/protect/comment2.php', {'id': id,'sub':sub,'news':news}, function(data) {
jQuery("#intro").html(data);
});

}


// Колличество комментариев на странице
function Changebl2 (count,id,sub,news) {
setCookie('ccom', '', TTL(), '/');
setCookie('ccom', count.value, TTL(), '/');

jQuery.get('/protect/comment3.php', {'id': id,'sub':sub,'news':news}, function(data) {
jQuery("#intro").html(data);
});

}

// Сортировка на странице
function Change2bl2 (count,id,sub,news) {
setCookie('sort', '', TTL(), '/');
setCookie('sort', count.value, TTL(), '/');

jQuery.get('/protect/comment3.php', {'id': id,'sub':sub,'news':news}, function(data) {
jQuery("#intro").html(data);
});

}

// Смена авто картинок

function change_auto(img,height) {
document.getElementById('change_foto').style.backgroundImage = 'url(/images/uploads/'+img+')'
document.getElementById('change_foto').style.height=height+'px';
}

function catday (img)  {
document.getElementById('a_m_t18').style.backgroundImage = 'url(/images/uploads/'+img+')'
}



//function on (par) {

//if (par == 1) this.className == "aaa"); } else { this.className == "sss"); }

//}



    // Function is called when we need to calculate MD5.
    function europa() {
        JsHttpRequest.query(
            '/protect/europa.php', // backend
            {
                // pass a text value 
                'str': 'не задан'  
            },
            // Function is called when an answer arrives. 
            function(result, errors) {
                // Write errors to the debug div.
                //document.getElementById("debug").innerHTML = errors; 
                // Write the answer.
                if (result) {
                    document.getElementById("ans").innerHTML = result["str"]+' ';
                }
            },
            false  // do not disable caching
        );
    }


    // Function is called when we need to calculate MD5.
    function europa2() {
        JsHttpRequest.query(
            '/protect/1009.php', // backend
            {
                // pass a text value 
                'str': 'не задан'  
            },
            // Function is called when an answer arrives. 
            function(result, errors) {
                // Write errors to the debug div.
                //document.getElementById("debug").innerHTML = errors; 
                // Write the answer.
                if (result) {
                    document.getElementById("ans2").innerHTML = result["str"]+' ';
                }
            },
            false  // do not disable caching
        );
    }



function compute(url) {
parent.location="/catalog/catalog-"+url+".html"; 
}


function userauth(r) {

document.auth.submit();

}



function sms (sms)  {
 window.open (sms,"sms"); 
}


function rekinsert2 (q,z) {
  jQuery.get('/protect/mainreklama.php', {'rubrek': q}, function(data) {
  jQuery("#rekinsert").html(data);
  });
  document.getElementById('rekroots').value=z;
}


function rekinsert (q,z) {
//  jQuery.get('/protect/mainreklama.php', {'rubrek': q}, function(data) {
//  jQuery("#rekinsert").html(data);
//  });
jQuery(document).ready(function() {

        //alert(q);
	jQuery('#rekinsert').load('/protect/mainreklama.php?rubrek='+q);

});
  document.getElementById('rekroots').value=z;
}


function rekinsertnews (q,z) {
//  jQuery.get('/protect/mainreklama.php', {'rubrek': q}, function(data) {
//  jQuery("#rekinsert").html(data);
//  });
jQuery(document).ready(function() {

	jQuery('#rekinsertnews').load('/protect/mainreklama2.php?rubrek='+q);

});
  document.getElementById('rekrootsnews').value=z;
}



function finish(rots) {

 if (document.getElementById('rekroots').value=="1"){
     rekinsert(54);
     document.getElementById('rekroots').value="2";
 } else if (document.getElementById('rekroots').value=="2"){
     rekinsert(55);
     document.getElementById('rekroots').value="3";

 } else if (document.getElementById('rekroots').value=="3"){
     rekinsert(56);
     document.getElementById('rekroots').value="1";

 } else {
     rekinsert(54);
     document.getElementById('rekroots').value="1";
    ///alert('4');

 }

}

function finish2(rots) {
 if (document.getElementById('rekrootsnews').value=="1"){
     rekinsertnews(111);
     document.getElementById('rekrootsnews').value="2";
 } else if (document.getElementById('rekrootsnews').value=="2"){
     rekinsertnews(112);
     document.getElementById('rekrootsnews').value="3";
 } else if (document.getElementById('rekrootsnews').value=="3"){
     rekinsertnews(66);
     document.getElementById('rekrootsnews').value="1";
 } else {
     rekinsertnews(111);
     document.getElementById('rekrootsnews').value="1";
    //alert('4');
 }

}


function finish2old() {

 if (document.getElementById('rek66').style.display=="block"){
 document.getElementById('rek66').style.display="none";
 document.getElementById('rek111').style.display="block";
 document.getElementById('rek112').style.display="none";
 } else if (document.getElementById('rek111').style.display=="block"){
 document.getElementById('rek66').style.display="none";
 document.getElementById('rek111').style.display="none";
 document.getElementById('rek112').style.display="block";
 } else if (document.getElementById('rek112').style.display=="block"){
 document.getElementById('rek66').style.display="block";
 document.getElementById('rek111').style.display="none";
 document.getElementById('rek112').style.display="none";
 } else {
 document.getElementById('rek66').style.display="block";
 document.getElementById('rek111').style.display="none";
 document.getElementById('rek112').style.display="none";
 }

}

function finish3() {

 if (document.getElementById('rek151').style.display=="block"){
 document.getElementById('rek151').style.display="none";
 document.getElementById('rek152').style.display="block";
 document.getElementById('rek153').style.display="none";
 } else if (document.getElementById('rek152').style.display=="block"){
 document.getElementById('rek151').style.display="none";
 document.getElementById('rek152').style.display="none";
 document.getElementById('rek153').style.display="block";
 } else if (document.getElementById('rek153').style.display=="block"){
 document.getElementById('rek151').style.display="block";
 document.getElementById('rek152').style.display="none";
 document.getElementById('rek153').style.display="none";
 } else {
 document.getElementById('rek151').style.display="block";
 document.getElementById('rek152').style.display="none";
 document.getElementById('rek153').style.display="none";
 }

}


function fn() {
setInterval(finish, 10800 ); 
setInterval(finish3, 10000 ); 
}
function fn2() {
setInterval(finish2, 13000 ); 
}

function prav38(vch)
{  


if (document.forms[1].elements['4'].checked) { return true;
//if (document.GetElementByName("agree").checked) { return true;
} else { alert('Вы ознакомлены с нашими правилами?'); }

return false;
}


function prav(vch)
{  


if (document.forms[1].elements['3'].checked) { return true;
//if (document.GetElementByName("agree").checked) { return true;
} else { alert('Вы ознакомлены с нашими правилами?'); }

return false;
}

function prav_vid(vch)
{  


if (document.forms[1].elements['2'].checked) { return true;
//if (document.GetElementByName("agree").checked) { return true;
} else { alert('Вы ознакомлены с нашими правилами?'); }

return false;
}


function prav_news(vch)
{  


if (document.forms[2].elements['3'].checked) { return true;
//if (document.GetElementByName("agree").checked) { return true;
} else { alert('Вы ознакомлены с нашими правилами?'); }

return false;
}


function Form_vtb() {


required = new Array("title","email","phone","text");
required_show = new Array ("ваше имя","E-mail","контактный телефон","вопрос");

var i, j;

for(j=0; j<required.length; j++) {

    for (i=0; i<document.forms[1].length; i++) {

        if (document.forms[1].elements[i].name == required[j] && document.forms[1].elements[i].value == "" ) {
            alert('Пожалуйста, укажите: ' + required_show[j]);
            document.forms[1].elements[i].focus();
            return false;
        }
     }
  }
}



function Form() {


required = new Array("title","email","text");
required_show = new Array ("Имя или организацию","E-mail или URL","Объявление");

var i, j;

for(j=0; j<required.length; j++) {

    for (i=0; i<document.forms[1].length; i++) {

        if (document.forms[1].elements[i].name == required[j] && document.forms[1].elements[i].value == "" ) {
            alert('Пожалуйста, укажите: ' + required_show[j]);
            document.forms[1].elements[i].focus();
            return false;
        }
     }
  }
}


// Редирект
function redirect (url) {
parent.location=""+url+""; 
}


function _setclass(obj, cl){

obj.setAttribute("className", cl); 
obj.className= cl;

}

// Смена картинок "Вертикаль власти"
function change(name) {
document.mainpic.src="images/test/"+name;
}

var wingalery=null;
function GalleryWin(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
wingalery=window.open(mypage,myname,settings);}



var helpWnd=null;

function isEmpty(form,field)
{
	var txt = form[field].value;
	if(txt=="")return true
	for(var i=0; i<txt.length; i++)
		if(txt.charAt(i)!=" ")
			return false
	 
	return true;
}

	var d = document;
	var isNS = (d.layers)?true:false;
	var isIE = (d.all)?true:false;
	var isDom = (!isIE&&d.getElementById)?true:false;
	var isOpera=navigator.userAgent.indexOf("Opera")!=-1;
	var vis = false;
	
/*

function checkBrowser()
{
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	
	return this
}

bw=new checkBrowser()

*/
function showLayer(text)
{
	var ver = navigator.userAgent;
	
	if(ver.search('MSIE') != -1 && ver.search('Opera') == - 1)
	{
		var top_ = document.body.scrollTop+120;
		var left_ = document.body.clientWidth-250;
	}
	else
	{
		var top_ = window.pageYOffset + 90 + 'px';
		var left_ = window.innerWidth - 250 + 'px';
	}
//	document.getElementById("hint").style.top= top_;
//	document.getElementById("hint").style.left= left_
	if(isDom)
	{
//		alert("this")
		var doc = document.getElementById('hint');
//		doc.style.top= top_;
//		doc.style.left= left_;
		eval("doc.style.visibility=\'visible\'");
		doc.innerHTML="<table cellspacing=0 cellpadding=2 border=0 width=240><tr><td STYLE=\"padding-left:70px; padding-top:35px;\"><div id=\"vizbg\"><div id=\"vizbg2\">"+text+"</div></div></td></tr></table>";
	}
	if(isIE)
	{
		eval("d.all.hint.style.visibility=\'visible\'");
//		d.all.hint.style.top = top_;
//		d.all.hint.style.left = left_;
		d.all.hint.innerHTML="<table cellspacing=0 cellpadding=2 border=0 width=240><tr><td STYLE=\"padding-left:0px; padding-top:0px;\"><div id=\"vizbg\"><div id=\"vizbg2\">"+text+"</div></div></td></tr></table>";
	}
	if(isNS)
	{
//		d['hint'].style.top = top_;
//		d['hint'].style.left = left_;
		d['hint'].visibility = 'show';
		d['hint'].innerHTML = "<table cellspacing=0 cellpadding=2 border=0 width=240><tr><td STYLE=\"padding-left:70px; padding-top:35px;\"><div id=\"vizbg\"><div id=\"vizbg2\">"+text+"</div></div></td></tr></table>";
	}
	
}

function hideLayer()
{
	if(isDom)
	{
		var doc = document.getElementById('hint');
		eval("doc.style.visibility=\'hidden\'");
	}
	
	if(isIE)
	{
		eval("d.all.hint.style.visibility=\'hidden\'");
	}
	
	if(isNS)
	{
		if (vis == false) setTimeout('d[\'hint\'].visibility = \'hide\';',1500);
		else setTimeout('d[\'hint\'].visibility = \'show\';',1500);
	}
}



if(typeof Common=="undefined"){
var Common={};
}
Common.version="1.2.2_draft";
Common.env={IE:!!(window.attachEvent&&!window.opera)&&function(){
var ua=navigator.userAgent;
var o=ua.indexOf("MSIE ");
return parseFloat(ua.substring(o+5,ua.indexOf(";",o)));
}(),Opera:!!window.opera&&parseFloat(navigator.appVersion),WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1&&parseFloat(navigator.appVersion),Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1&&function(){
var ua=navigator.userAgent;
var o=ua.indexOf("rv:");
return parseFloat(ua.substring(o+3,ua.indexOf(")",o)));
}()};
function $(_5){
if(arguments.length>1){
for(var i=0,_7=[],_8=arguments.length;i<_8;i++){
_7.push($(arguments[i]));
}
return _7;
}
if(typeof _5=="string"){
_5=document.getElementById(_5);
}
return _5;
}
function $A(_9){
if(!_9){
return [];
}
var _a=[];
for(var i=0,_c=_9.length;i<_c;i++){
_a.push(_9[i]);
}
return _a;
}
Function.prototype.bind=function(){
var _d=this,_e=$A(arguments),_f=_e.shift();
return function(){
return _d.apply(_f,_e.concat($A(arguments)));
};
};
Function.prototype.bindAsEventListener=function(){
var _10=this,_11=$A(arguments),_12=_11.shift();
return function(_13){
return _10.apply(_12,[(_13||window.event)].concat(_11).concat($A(arguments)));
};
};
Object.extend=function(_14,_15){
for(var _16 in _15){
_14[_16]=_15[_16];
}
return _14;
};
Common.CSSClasses={regexps:[],buildRegexp:function(_17){
if(!this.regexps[_17]){
this.regexps[_17]=new RegExp("(^|\\s+)"+_17+"($|\\s+)");
}
return this.regexps[_17];
},has:function(_18,_19){
if(typeof _19!="string"){
return this.hasAll(_18,[_19]);
}
return _18&&this.buildRegexp(_19).test(_18.className);
},hasAll:function(_1a,_1b){
if(!_1a){
return;
}
for(var i=0,l=_1b.length;i<l;i++){
if(!this.buildRegexp(_1b[i]).test(_1a.className)){
return false;
}
}
return true;
},add:function(_1e,_1f){
this.replace(_1e,"",_1f);
},remove:function(_20,_21){
this.replace(_20,_21,"");
},replace:function(_22,_23,_24){
if(!_22){
return;
}
var _25=_22.className;
if(typeof _23=="string"){
_23=[_23];
}
if(typeof _24=="string"){
_24=[_24];
}
var _26=this._toHash(_25);
for(var i=0,l=_23.length;i<l;i++){
_26[_23[i]]=false;
}
for(var i=0,l=_24.length;i<l;i++){
_26[_24[i]]=true;
}
var tmp=this._fromHash(_26);
if(tmp!=_25){
_22.className=tmp;
}
},switchName:function(_2a,_2b,_2c){
if(this.match(_2a,_2b)){
this.replace(_2a,_2b,_2c);
}else{
this.replace(_2a,_2c,_2b);
}
},_toArray:function(_2d){
return _2d&&_2d.split(/\s+/)||[];
},_fromArray:function(_2e){
return _2e.join(" ");
},_toHash:function(_2f){
_2f=this._toArray(_2f);
var _30=[];
for(var i=0,_32=_2f.length;i<_32;i++){
_30[_2f[i]]=true;
}
return _30;
},_fromHash:function(_33){
var _34=[];
for(var i in _33){
if(!i){
continue;
}
if(!_33.hasOwnProperty(i)){
continue;
}
if(!_33[i]){
continue;
}
_34.push(i);
}
return this._fromArray(_34);
}};
Common.CSSClasses.match=Common.CSSClasses.has;
Common.Class=Common.CSSClasses;
Common.Event={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,element:function(_36){
return _36.target||_36.srcElement;
},isLeftClick:function(_37){
return (((_37.which)&&(_37.which==1))||((_37.button)&&(_37.button==1)));
},pointerX:function(_38){
return _38.pageX||(_38.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
},pointerY:function(_39){
return _39.pageY||(_39.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
},stop:function(_3a){
if(_3a.preventDefault){
_3a.preventDefault();
_3a.stopPropagation();
}else{
_3a.returnValue=false;
_3a.cancelBubble=true;
}
return false;
},findElement:function(_3b,_3c){
var _3d=Common.Event.element(_3b);
while(_3d.parentNode&&(!_3d.tagName||(_3d.tagName.toUpperCase()!=_3c.toUpperCase()))){
_3d=_3d.parentNode;
}
return _3d;
},observers:false,_observeAndCache:function(_3e,_3f,_40,_41){
if(!this.observers){
this.observers=[];
}
if(_3e.addEventListener){
this.observers.push([_3e,_3f,_40,_41]);
_3e.addEventListener(_3f,_40,_41);
}else{
if(_3e.attachEvent){
this.observers.push([_3e,_3f,_40,_41]);
_3e.attachEvent("on"+_3f,_40);
}
}
},unloadCache:function(){
if(!Common.Event.observers){
return;
}
for(var i=0,_43=Common.Event.observers.length;i<_43;i++){
Common.Event.stopObserving.apply(this,Common.Event.observers[i]);
Common.Event.observers[i][0]=null;
}
Common.Event.observers=false;
},observe:function(_44,_45,_46,_47){
_44=$(_44);
_47=!!_47;
if(_45=="keypress"&&(Common.env.WebKit||_44.attachEvent)){
_45="keydown";
}
Common.Event._observeAndCache(_44,_45,_46,_47);
},stopObserving:function(_48,_49,_4a,_4b){
_48=$(_48);
_4b=!!_4b;
if(_49=="keypress"&&(Common.env.WebKit||_48.attachEvent)){
_49="keydown";
}
if(_48.removeEventListener){
_48.removeEventListener(_49,_4a,_4b);
}else{
if(_48.detachEvent){
try{
_48.detachEvent("on"+_49,_4a);
}
catch(e){
}
}
}
}};
Common.Event.target=Common.Event.element;
Common.Event.cancel=Common.Event.stop;
Common.Event.add=Common.Event.observe;
Common.Event.remove=Common.Event.stopObserving;
Common.Event.getAbsoluteCoords=function(_4c){
return {iLeft:Common.Event.pointerX(_4c),iTop:Common.Event.pointerY(_4c)};
};
if(Common.env.IE==6){
Common.Event.observe(window,"unload",Common.Event.unloadCache,false);
}
Common.DOM={_attributeTranslations:{names:{colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",datetime:"dateTime",accesskey:"accessKey",tabindex:"tabIndex",enctype:"encType",maxlength:"maxLength",readonly:"readOnly",longdesc:"longDesc"},values:{style:function(_4d,_4e){
if(_4e){
_4d.style.cssText=_4e;
}
return _4d.style.cssText.toLowerCase();
},title:function(_4f,_50){
var _51=_4f.getAttributeNode("title");
if(_51.specified){
if(_50){
_51.nodeValue=_50;
}
return _51.nodeValue;
}
return null;
}}},offset:function(_52){
var _53=0,_54=0;
do{
_53+=_52.offsetTop||0;
_54+=_52.offsetLeft||0;
_52=_52.offsetParent;
}while(_52);
return [_54,_53];
},findElementsByClassName:function(_55,_56,_57,_58){
var _59=[];
_56=typeof _56=="string"?[_56]:_56;
for(var i=0,_5b=_56.length;i<_5b;i++){
_56[i]={name:_56[i],regexp:Common.CSSClasses.buildRegexp(_56[i])};
if(_58){
_59[_56[i].name]=[];
}
}
if(!_55){
return _59;
}
var _5c=_57?_55.childNodes:_55.getElementsByTagName("*");
for(var j=0,_5b=_5c.length;j<_5b;j++){
var _5e=_5c[j];
if(_5e.nodeType!=1){
continue;
}
for(var i=0,li=_56.length;i<li;i++){
if(_56[i].regexp.test(_5e.className)){
if(_58){
_59[_56[i].name].push(_5e);
}else{
_59.push(_5e);
}
}
}
}
return _59;
},getPositionedElementNode:function(_60,_61,_62){
_61=_61||"";
_62=_62||0;
for(var i=0,_64=_60.childNodes,l=_64.length;i<l;i++){
if(_64[i].nodeType==1&&(!_61||_64[i].nodeName==_61)){
if(!_62--){
return _64[i];
}
}
}
return null;
},getFirstElementNode:function(_66,_67){
return Common.DOM.getPositionedElementNode(_66,_67,0);
},getElementNodes:function(_68,_69){
_69=_69||"*";
if(typeof _69=="string"){
_69=[_69];
}
var _6a=[];
for(var i=0,_6c=_68.childNodes,l=_6c.length;i<l;i++){
if(_6c[i].nodeType!=1){
continue;
}
if(!_69){
_6a.push(_6c[i]);
continue;
}
for(var j=0,lj=_69.length;j<lj;j++){
if(_69[j]=="*"||_69[j]==_6c[i].nodeName){
_6a.push(_6c[i]);
}
}
}
return _6a;
},getAttribute:function(_70,_71){
_70=$(_70);
if(Common.env.IE){
var t=Common.DOM._attributeTranslations;
if(t.values[_71]){
return t.values[_71](_70,_71);
}
if(t.names[_71]){
_71=t.names[_71];
}
var _73=_70.attributes[_71];
if(_73){
return _73.nodeValue;
}
}
return _70.getAttribute(_71);
},setAttribute:function(_74,_75,_76){
_74=$(_74);
if(Common.env.IE){
var t=Common.DOM._attributeTranslations;
if(t.values[_75]){
return t.values[_75](_74,_75,_76);
}
if(t.names[_75]){
_75=t.names[_75];
}
var _78=_74.attributes[_75];
if(_78){
_78.nodeValue=_76;
}
}
_74.setAttribute(_75,_76);
}};
Common.DOM.getElementsByClassName=Common.DOM.findElementsByClassName;
Common.DOM.getAttribute=Common.DOM.readAttribute;
Common.DOM.getAbsoluteCoords=function(_79){
var tmp=Common.DOM.offset(element);
return {iLeft:tmp[0],iTop:tmp[1]};
};
Common.Cookie={set:function(_7b,_7c,_7d,_7e){
var d=new Date();
d.setTime(d.getTime()+(86400000*parseFloat(_7d||0)));
document.cookie=_7b+"="+encodeURI(_7c)+((_7d==null)?"":("; expires="+d.toGMTString()))+((_7e==null)?"":("; path="+_7e));
},get:function(_80){
var _81=document.cookie.match(new RegExp("(^|;)\\s*"+escape(_80)+"=([^;\\s]*)"));
return (_81?decodeURI(_81[2]):null);
}};
Common.Utils={oPopupDefaults:{iWidth:540,iHeight:600,sToolbar:"no",sMenubar:"no",sResizeable:"yes",sScrollbars:"yes",sStatus:"yes"},popup:function(_82,_83,_84,_85){
_84=Object.extend(Common.Utils.oPopupDefaults,_84);
var _86=screen.availWidth/2-_84.iWidth/2;
var _87=screen.availHeight/2-_84.iHeight/2;
oNewWindow=window.open(_82,_83,"left="+_86+", "+"top = "+_87+", "+"width="+_84.iWidth+", "+"height="+_84.iHeight+", "+"menubar="+_84.sMenubar+", "+"toolbar="+_84.sToolbar+", "+"resizable="+_84.sResizeable+", "+"scrollbars="+_84.sScrollbars+", "+"status="+_84.sStatus);
if(_82.match(/\.(gif|jpe?g|png)$/i)){
oNewWindow.document.open();
oNewWindow.document.write("<html><head></head><body style=\"background: #FFF; margin: 0px; padding: 0px;\">"+"<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" height=\"100%\"><tr><td align=\"center\">"+"<img src=\""+_82+"\" />"+"</td></tr></table></body></html>");
oNewWindow.document.close();
}
oNewWindow.focus();
return false;
}};
if(!Object.prototype.hasOwnProperty){
Object.prototype.hasOwnProperty=function(_88){
return this[_88]!="undefined"&&this.constructor.prototype[_88]!==this[_88];
};
}
if(!Array.prototype.push){
Array.prototype.push=function(){
for(var i=0;i<arguments.length;i++){
this[this.length]=arguments[i];
}
};
}
if(!Array.prototype.splice){
Array.prototype.splice=function(_8a,_8b){
if(_8a>this.length){
return;
}
_8b=_8b&&Math.min(_8b,this.length-_8a)||(this.length-=_8a+1)&&0;
if(_8b>0){
for(var i=0;i<_8b;i++){
this[i+_8a]=this[i+_8a+_8b];
}
this.length=this.length-_8b;
}
var _8d=arguments.length-2;
if(_8d>0){
var _8e=this.length-_8a;
var _8f=_8a+_8e-1;
for(var i=0;i<_8e;i++){
this[_8f+_8d-i]=this[_8f-i];
}
for(var i=0;i<_8d;i++){
this[i+_8a]=arguments[i+2];
}
}
};
}
Array.prototype.indexOf=function(_90){
for(var i=0,l=this.length;i<l;i++){
if(this[i]==_90){
return i;
}
}
return -1;
};
var js={version:"1.1.7_als",rootUrl:"/f/js/",context:this,versioninig:false};
js.getXHTTPTransport=function(){
var _93=false;
var _94=[function(){
return new XMLHttpRequest();
},function(){
return new ActiveXObject("Msxml2.XMLHTTP");
},function(){
return new ActiveXObject("Microsoft.XMLHTTP");
}];
for(var i=0;i<_94.length;i++){
try{
_93=_94[i]();
break;
}
catch(e){
}
}
return _93;
};
js.evalProperty=function(_96,_97,_98,_99){
if(_96){
if(!_96[_97]||_99){
_96[_97]=_98||true;
}
return _96[_97];
}
return null;
};
js.evalPath=function(_9a,_9b,_9c,_9d){
_9b=_9b||js.context;
var pos=_9a.indexOf(".");
if(pos==-1){
return js.evalProperty(_9b,_9a,_9c,_9d);
}else{
var _9f=_9a.substring(0,pos);
_9a=_9a.substring(pos+1);
var obj=js.evalProperty(_9b,_9f,_9c);
return js.evalPath(_9a,obj,_9c,_9d);
}
};
js.pathToUrl=function(_a1,_a2){
return js.rootUrl+_a1.replace(/\./g,"/")+(js.versioninig?".v"+_a2:"")+".js";
};
js.loadedModules={};
js.module=function(_a3,_a4){
_a4=_a4||1;
js.loadedModules[_a3]=js.loadedModules[_a3]?Math.max(js.loadedModules[_a3],_a4):_a4;
return js.evalPath(_a3,null,{});
};
js.include=function(_a5,_a6){
_a6=_a6||1;
if(js.loadedModules[_a5]&&js.loadedModules[_a5]>=_a6){
return false;
}
var _a7=js.getXHTTPTransport();
_a7.open("GET",js.pathToUrl(_a5,_a6),false);
_a7.send(null);
var _a8=_a7.responseText;
(typeof execScript!="undefined")?execScript(_a8):(js.context.eval?js.context.eval(_a8):eval(_a8));
return true;
};
js.load=js.include;
js.extend=function(_a9,_aa,_ab){
var _ac=[];
if(_aa instanceof Array||typeof _aa=="array"){
_ac=_aa;
_aa=_ac.shift();
}
if(typeof _a9=="string"){
_a9=js.evalPath(_a9,null,js.createClass(),1);
}else{
return;
}
if(_aa){
var _ad=function(){
};
_ad.prototype=_aa.prototype;
_a9.prototype=new _ad();
_a9.superClass=_aa.prototype;
}
for(var i=0;i<_ac.length;i++){
Object.extend(_a9.prototype,_ac[i].prototype);
}
_a9.mixins=_ac;
Object.extend(_a9.prototype,_ab||{});
_a9.prototype.constructor=_a9;
};
js.define=js.extend;
js.createClass=function(){
return function(){
var _af=arguments.callee.prototype;
_af.init.apply(this,arguments);
for(var i=0,_b1=_af.constructor.mixins,_b2=_b1.length;i<_b2;i++){
_b1[i].init.apply(this);
}
};
};
js.dump=function(_b3){
};
js.error=function(_b4){
};
restorejs=function(obj){
return function(){
obj.context.js=obj;
};
}(js);
Common.Event.observe(window,"load",restorejs);
var lang=js;
js.module("js.Event");
js.Event={observe:function(obj,_b7,_b8){
if(arguments.length>3){
_b8=[_b8,arguments[3]];
}else{
_b8=[null,_b8];
}
if(!obj.__observers){
obj.__observers=[];
}
if(!obj.__observers[_b7]){
var _b9=obj[_b7];
var _ba=obj;
obj[_b7]=function(){
var _bb=[this];
for(var i=0;i<arguments.length;i++){
_bb.push(arguments[i]);
}
for(i=0;i<this.__observers[_b7].length;i++){
var _bd=this.__observers[_b7][i];
_bd[1].apply(_bd[0],_bb);
}
return _b9.apply(_ba,arguments);
};
obj.__observers[_b7]=[];
}
obj.__observers[_b7].push(_b8);
},stopObserving:function(obj,_bf,_c0){
if(!obj.__observers||!obj.__observers[_bf]){
return;
}
if(arguments.length>3){
_c0=[_c0,arguments[3]];
}else{
_c0=[null,_c0];
}
var _c1=obj.__observers[_bf];
for(var i=0;i<_c1.length;i++){
if(_c1[i][0]==_c0[0]&&_c1[i][1]==_c0[1]){
_c1.splice(i,1);
break;
}
}
}};
js.module("animation.Process");
js.define("animation.Process",null,{init:function(){
this.rules=new Array();
},start:function(){
},stop:function(){
},pause:function(){
},resume:function(){
},addRule:function(_c3,_c4){
this.rules.push({func:_c3,action:_c4});
return this;
},removeRule:function(_c5,_c6){
var idx;
for(var i=0;i<this.rules.length;i++){
if(this.rules[i].func==_c5&&this.rules[i].action==_c6){
idx=i;
break;
}
}
this.rules.splice(idx,1);
return this;
},clearRules:function(){
this.rules=new Array();
},_executeActions:function(_c9){
for(var i=0;i<this.rules.length;i++){
var _cb=this.rules[i];
_cb.action(_cb.func(_c9));
}
},executeFirst:function(){
this._executeActions(0);
},onStop:function(){
},isExecuting:function(){
}});
js.define("animation.Process.Time",animation.Process,{init:function(_cc,_cd){
animation.Process.Time.superClass.init.call(this);
_cd=_cd||30;
this.duration=_cc;
this.desiredFrameDuration=1000/_cd;
this.position=0;
},start:function(){
this.startTime=new Date().getTime();
this.startPosition=0;
this.interval=setInterval(this._run.bind(this),this.desiredFrameDuration);
},stop:function(){
if(this.interval){
clearInterval(this.interval);
this.interval=null;
this.onStop();
}
},isExecuting:function(){
return !!this.interval;
},pause:function(){
this.stop();
},resume:function(){
this.startTime=new Date().getTime();
this.startPosition=this.position;
this.interval=setInterval(this._run.bind(this),this.desiredFrameDuration);
},_run:function(){
var _ce=new Date().getTime();
this.position=Math.min(1,(_ce-this.startTime)/this.duration);
this._executeActions(this.position);
if(this.position==1){
this.stop();
}
}});
js.define("animation.Process.Step",animation.Process,{init:function(_cf,_d0){
animation.Process.Step.superClass.init.call(this);
this.stepsNumber=_cf;
this.stepDuration=_d0;
this.step=0;
},start:function(){
this.step=0;
this.interval=setInterval(this._run.bind(this),this.stepDuration);
},stop:function(){
if(this.interval){
clearInterval(this.interval);
this.interval=null;
this.onStop();
}
},isExecuting:function(){
return !!this.interval;
},pause:function(){
this.stop();
},resume:function(){
this.interval=setInterval(this._run.bind(this),this.stepDuration);
},_run:function(){
var _d1=this.step/this.stepsNumber;
this._executeActions(_d1);
if(this.step++==this.stepsNumber){
this.stop();
}
}});
js.module("animation.ActionFactory");
animation.ActionFactory={createCallFunctionAction:function(obj,_d3,_d4,to,_d6,pos){
_d4=typeof _d4=="undefined"?0:_d4;
to=typeof to=="undefined"?1:to;
if(_d6){
pos=pos||0;
if(typeof _d6[pos]=="function"){
var _d8=_d6[pos];
return function(x){
_d6[pos]=_d8((to-_d4)*x+_d4);
_d3.apply(obj,_d6);
};
}else{
return function(x){
_d6[pos]=(to-_d4)*x+_d4;
_d3.apply(obj,_d6);
};
}
}else{
return function(x){
_d3.call(obj,(to-_d4)*x+_d4);
};
}
},createSetAttributeAction:function(obj,_dd,_de,to){
_de=typeof _de=="undefined"?0:_de;
to=typeof to=="undefined"?1:to;
return function(x){
obj[_dd]=(to-_de)*x+_de;
};
},createSafeSetAttributeAction:function(obj,_e2,_e3,to){
_e3=typeof _e3=="undefined"?0:_e3;
to=typeof to=="undefined"?1:to;
return function(x){
try{
obj[_e2]=(to-_e3)*x+_e3;
}
catch(e){
}
};
},createSetCSSPropertyAction:function(obj,_e7,_e8,to,_ea){
_e8=typeof _e8=="undefined"?0:_e8;
to=typeof to=="undefined"?1:to;
_ea=_ea||"";
if(_e7=="opacity"&&obj.filters){
var _eb=obj.filters.length>0?obj.filters.item("DXImageTransform.Microsoft.Alpha"):false;
if(!_eb){
obj.style.filter=(obj.style.filter||"")+" progid:DXImageTransform.Microsoft.Alpha(opacity="+_e8*100+")";
_eb=obj.filters.item(obj.filters.length-1);
}
return _eb?animation.ActionFactory.createSafeSetAttributeAction(_eb,"Opacity",_e8*100,to*100):function(){
};
}
return function(x){
obj.style[_e7]=((to-_e8)*x+_e8)+_ea;
};
}};
js.module("animation.TransitionFactory");
animation.TransitionFactory={createLinearTransition:function(){
return function(x){
return x;
};
},createPowTransition:function(pow){
pow=pow||2;
switch(pow){
case 2:
return function(x){
return x*x;
};
case 3:
return function(x){
return x*x*x;
};
case 4:
return function(x){
return x*x*x*x;
};
default:
return function(x){
return Math.pow(x,pow);
};
}
},createReversePowTransition:function(pow,_f4){
pow=pow||2;
switch(pow){
case 2:
return function(x){
return 1-(1-x)*(1-x);
};
case 3:
return function(x){
return 1-(1-x)*(1-x)*(1-x);
};
case 4:
return function(x){
return 1-(1-x)*(1-x)*(1-x)*(1-x);
};
default:
return function(x){
return 1-Math.pow((1-x),pow);
};
}
},createExponentialBounse:function(_f9,_fa){
_f9=_f9||2;
_fa=_fa||2;
var _fb=Math.PI/2*_fa;
return function(x){
return Math.exp(-x*_f9)*Math.sin(x*_fb);
};
},createExponentialBounsingMovement:function(_fd,_fe,_ff,_100){
_fd=_fd||2;
_ff=_ff||2;
_fe=_fe||0.5;
_fe=_100||0.1;
var _101=1-_fe;
var _102=Math.PI/2*_ff;
return function(x){
if(x==1){
return 1;
}
return (x<_fe?x/_fe:1)+_100*Math.exp(-x*_fd)*Math.sin(x*_102);
};
}};
js.module("mk.Zodiac");
js.define("mk.Zodiac",null,{init:function(_104,end,_106){
_104.setHours(0,0,0);
end.setHours(23,59,59);
this.startDate=_104.getTime();
this.endDate=end.getTime();
this.className=_106;
},isCurrent:function(){
return ((mk.Zodiac._dt1>=this.startDate&&mk.Zodiac._dt1<=this.endDate)||(mk.Zodiac._dt2>=this.startDate&&mk.Zodiac._dt2<=this.endDate));
}});
mk.Zodiac.add=function(obj){
this._stack.push(obj);
};
mk.Zodiac.setCurrent=function(){
var elem=$("zodiac");
var _109=this._stack;
var _10a;
for(var i=0;i<_109.length;i++){
if(_109[i].isCurrent()){
_10a=_109[i];
break;
}
}
if(_10a&&elem){
Common.CSSClasses.add(elem,_10a.className);
}
};
mk.Zodiac.init=function(){
if(mk.Zodiac._stack){
return;
}
var _10c=new Date();
mk.Zodiac._dt1=new Date(_10c.getFullYear(),_10c.getMonth(),_10c.getDate()).getTime();
mk.Zodiac._dt2=new Date(_10c.getFullYear()+1,_10c.getMonth(),_10c.getDate()).getTime();
mk.Zodiac._stack=[];
var yr=_10c.getFullYear();
mk.Zodiac.add(new mk.Zodiac(new Date(yr,1,21),new Date(yr,2,20),("pisces")));
mk.Zodiac.add(new mk.Zodiac(new Date(yr,2,21),new Date(yr,3,20),("aries")));
mk.Zodiac.add(new mk.Zodiac(new Date(yr,3,21),new Date(yr,4,20),("taurus")));
mk.Zodiac.add(new mk.Zodiac(new Date(yr,4,21),new Date(yr,5,21),("gemini")));
mk.Zodiac.add(new mk.Zodiac(new Date(yr,5,22),new Date(yr,6,22),("cancer")));
mk.Zodiac.add(new mk.Zodiac(new Date(yr,6,23),new Date(yr,7,23),("leo")));
mk.Zodiac.add(new mk.Zodiac(new Date(yr,7,24),new Date(yr,8,23),("virgo")));
mk.Zodiac.add(new mk.Zodiac(new Date(yr,8,24),new Date(yr,9,23),("libra")));
mk.Zodiac.add(new mk.Zodiac(new Date(yr,9,24),new Date(yr,10,22),("scorpio")));
mk.Zodiac.add(new mk.Zodiac(new Date(yr,10,23),new Date(yr,11,21),("sagittarius")));
mk.Zodiac.add(new mk.Zodiac(new Date(yr,11,22),new Date(yr+1,0,20),("capricorn")));
mk.Zodiac.add(new mk.Zodiac(new Date(yr,0,21),new Date(yr,1,20),("aquarius")));
};
js.module("mk.Logo");
js.define("mk.Logo",null,{init:function(node){
this.node=node;
this.logoThreshold=1300;
this.widthMin=1000;
this.widthMax=1600;
this.fontSizeMin=90;
this.fontSizeMax=150;
},getWindowWidth:function(){
if(document.documentElement&&document.documentElement.clientWidth){
return document.documentElement.clientWidth;
}else{
if(document.body){
return document.body.clientWidth;
}
}
},onResize:function(){
var w=this.getWindowWidth();
w=Math.min(this.widthMax,Math.max(this.widthMin,w));
var d=(w-this.widthMin)/(this.widthMax-this.widthMin);
var _111=Math.round(this.fontSizeMin+(this.fontSizeMax-this.fontSizeMin)*d);
this.node.style.fontSize=_111+"%";
if(w>=this.logoThreshold){
Common.CSSClasses.add(this.node,"big-logo");
}else{
Common.CSSClasses.remove(this.node,"big-logo");
}
},bindEvents:function(){
this.resizeObserver=this.onResize.bind(this);
Common.Event.observe(window,"resize",this.resizeObserver);
},unbindEvents:function(){
Common.Event.observe(window,"resize",this.resizeObserver);
}});
mk.Logo.getInstance=function(node){
if(!mk.Logo.instance){
mk.Logo.instance=new mk.Logo(node);
}
return mk.Logo.instance;
};
js.module("mk.Favorites");
js.define("mk.Favorites",null,{items:[],baseUrl:"",init:function(_113){
this.baseUrl=_113;
},parse:function(node){
node=node||document.body;
var _115=node.getElementsByTagName("a");
for(var i=0;i<_115.length;i++){
if(Common.CSSClasses.match(_115[i],"heart")){
var tmp=mk.Favorites.Item.parseUrl(_115[i].href);
var url=tmp.url;
if(!this.items[url]){
this.items[url]=[];
}
var _119=false;
for(var j=0;j<this.items[url].length;j++){
if(_115[i]==this.items[url][j]){
_119=true;
break;
}
}
if(!_119){
var item=new mk.Favorites.Item(this,_115[i]);
this.items[url].push(item);
}
}
}
},cloneItemState:function(item){
var _11d=this.items[item.url];
for(var i=0;i<_11d.length;i++){
if(_11d[i]==item){
continue;
}
_11d[i].setSelected(item.isSelected);
_11d[i].setLoading(item.isLoading);
}
}});
mk.Favorites.instance=null;
mk.Favorites.getInstance=function(_11f){
if(!mk.Favorites.instance){
mk.Favorites.instance=new mk.Favorites(_11f);
}
return mk.Favorites.instance;
};
js.define("mk.Favorites.Item",null,{favorites:null,node:null,isSelected:false,isLoading:false,id:"",mode:"",url:"",init:function(_120,node){
this.favorites=_120;
this.node=node;
this.isSelected=!Common.CSSClasses.match(this.node,"heart-broken");
var tmp=mk.Favorites.Item.parseUrl(this.node.href);
this.url=tmp.url;
this.id=tmp.id;
this.mode=tmp.mode;
this._bindEvents();
},_bindEvents:function(){
Common.Event.observe(this.node,"click",this.onClick.bindAsEventListener(this));
},onClick:function(_123){
Common.Event.stop(_123);
this.toogle();
return false;
},toogle:function(){
if(this.isLoading){
return;
}
var url=this.url;
var _125=this.mode.charAt(0).toUpperCase()+this.mode.substring(1);
this.setLoading(true);
this.favorites.cloneItemState(this);
if(!this.isSelected){
url+="&favorite=add"+_125;
}else{
url+="&favorite=remove"+_125;
}
url+="&rnd="+Math.random();
var _126=new AJAXRequestClass();
var _127=this;
var _128=!this.isSelected;
_126.Load(url,"get",null,function(xhr){
_127.onLoad(xhr,_128);
});
},onLoad:function(xhr,_12b){
this.setSelected(_12b);
this.setLoading(false);
this.favorites.cloneItemState(this);
},setSelected:function(_12c){
if(this.isSelected==_12c){
return;
}
if(_12c){
Common.CSSClasses.remove(this.node,"heart-broken");
}else{
Common.CSSClasses.add(this.node,"heart-broken");
}
this.isSelected=_12c;
this.updateLabel();
},updateLabel:function(){
this.node.title=this.isSelected?"\u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0438\u0437 \xab\u043b\u044e\u0431\u0438\u043c\u043e\u0433\u043e\xbb":"\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \xab\u043b\u044e\u0431\u0438\u043c\u043e\u0435\xbb";
var _12d=this.node.getElementsByTagName("span");
if(_12d.length){
_12d[0].innerHTML=this.isSelected?"\u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0438\u0437 \xab\u043b\u044e\u0431\u0438\u043c\u043e\u0433\u043e\xbb":"\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \xab\u043b\u044e\u0431\u0438\u043c\u043e\u0435\xbb";
}
var imgs=this.node.getElementsByTagName("img");
if(imgs.length){
imgs[0].alt=this.isSelected?"\u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0438\u0437 \xab\u043b\u044e\u0431\u0438\u043c\u043e\u0433\u043e\xbb":"\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \xab\u043b\u044e\u0431\u0438\u043c\u043e\u0435\xbb";
}
},setLoading:function(_12f){
if(this.isLoading==_12f){
return;
}
if(_12f){
Common.CSSClasses.add(this.node,"heart-loading");
}else{
Common.CSSClasses.remove(this.node,"heart-loading");
}
this.isLoading=_12f;
}});
mk.Favorites.Item.parseUrl=function(url){
var _131=url.match(/[?&]([a-z]+)=([0-9]+)/i);
var mode=_131[1];
var id=_131[2];
url=url.replace(/[?&]favorite=[a-z]+/i,"");
url=url.replace(/\/&/,"/?");
return {url:url,mode:mode,id:id};
};
js.module("mk.Container");
js.define("mk.Container",null,{init:function(_134,_135){
this.bKeep=false;
var me=this;
if(_134){
this.oContainer=_134;
Common.Event.add(this.oContainer,"click",function(evt){
me.keep(evt);
});
}
if(_135){
this.oLink=_135;
Common.Event.add(this.oLink,"click",function(evt){
me.toggle(evt);
Common.Event.cancel(evt);
});
}
},toggle:function(evt){
if(Common.CSSClasses.match(this.oContainer,"hidden")){
this.show(evt);
}else{
this.hide(evt);
}
},show:function(evt){
Common.CSSClasses.remove(this.oContainer,"hidden");
var me=this;
me.documentClickHandler=function(evt){
me.hide(evt);
};
me.documentKeyDownHandler=function(evt){
me.cancel(evt);
};
Common.Event.add(document,"click",me.documentClickHandler);
Common.Event.add(document,"keydown",me.documentKeyDownHandler);
},keep:function(evt){
this.bKeep=true;
},hide:function(evt){
if(this.bKeep){
this.bKeep=false;
return;
}
Common.CSSClasses.add(this.oContainer,"hidden");
var me=this;
Common.Event.remove(document,"click",me.documentClickHandler);
Common.Event.remove(document,"keydown",me.documentKeyDownHandler);
},cancel:function(evt){
if(window.event){
evt=window.event;
}
var code=evt.keyCode?evt.keyCode:evt.which?evt.which:null;
if(code==27){
this.hide(evt);
}
}});


// Анализ новых коментов

// Куки
/*****************************
**   Common cookie methods
******************************/

// Functions from Netscape's JavaScript Guide
// http://developer.netscape.com/docs/manuals/js/client/jsguide/

function setCookie(name, value, expire, path) {
	document.cookie = name + '=' + escape(value)
		+ ((expire == null)? '' : ('; expires=' + expire.toUTCString()))
		+ ((path == null)? '' : ('; path=' + path));
}



function getCookie(Name) {
	var search = Name + '='
	if (document.cookie.length > 0) { // if there are any cookies
		offset = document.cookie.indexOf(search) 
		if (offset != -1) { // if cookie exists 
			offset += search.length 
			// set index of beginning of value
			end = document.cookie.indexOf(';', offset) 
			// set index of end of cookie value
			if (end == -1) 
				end = document.cookie.length
			return unescape(document.cookie.substring(offset, end))
		}
	}
	return '';
}


function TTL () {
	var dt=new Date();
        var iTTL=300;

	if(iTTL){
		dt.setHours(dt.getHours() + iTTL);
		return dt;
	}
	else
		return null;
}


// Обновление счетчиков коментов

function adcomnew(name,value) {

var baskets = "";
var baskets2 = "";
var  nameselect = "";

baskets = getCookie('comment');
var x = baskets;
bask = name+'='+value;

if (x != "") { 
values = x.split("|");
for (var i = 0; i<=values.length-1; i++) {
if (values[i] != '') {
valuesc = values[i].split("=");
if (valuesc[0] != name) {
bask2 = valuesc[0]+'='+valuesc[1];
if (baskets2 != "") baskets2 = baskets2+'|'+bask2; else baskets2 = bask2;
  } else bask = name+'='+value;
 }
}
var baskets = baskets2;
}

if (baskets != "") baskets = baskets+'|'+bask; else baskets = bask;

setCookie('comment', '', TTL(), '/');
setCookie('comment', baskets, TTL(), '/');

//alert(baskets);
return null;

}



function adcom(name,value) {

baskets = getCookie('comment');
var x = baskets;


values = x.split("|");
for (var i = 0; i<=values.length-1; i++) {
if (values[i] != '') {
valuesc = values[i].split("=");
if (valuesc[0] == name) {
//
//alert(valuesc[1]);
var rez = (value-valuesc[1]);

if (value > 1) {
if (value == rez) var rez = 0;
}

if (rez > 0) { 
if(document.getElementById(name))document.getElementById(name).innerHTML = "<font color='red'>+ "+rez+"</font>";
}

    
//
  }
 }
}

return null;
}


var limit="4:20"

if (document.images){
var parselimit=limit.split(":")
parselimit=parselimit[0]*60+parselimit[1]*1
}
function beginrefresh(){
if (!document.images)
return
if (parselimit==1)
window.location.reload()
else{ 
parselimit-=1
curmin=Math.floor(parselimit/60)
cursec=parselimit%60
//if (curmin!=0)
//curtime=curmin+" minutes and "+cursec+" seconds left until page refresh!"
//else
//curtime=cursec+" seconds left until page refresh!"
//window.status=curtime
//setTimeout("beginrefresh()",1000)
}
}


