﻿/* cScript ver 1.3. © Stroyteh 2009. Author: Shusharin Nikolay. Right to use StroyTeh*/

var nGUID='00000000-0000-0000-0000-000000000000';
var _isIE_value=null;
function _isIE(){if(_isIE_value!==null)return _isIE_value;if(navigator.appName=='Microsoft Internet Explorer'){var aVer=navigator.appVersion.split("MSIE");if(aVer.length>1){_isIE_value=parseFloat(aVer[1]);return _isIE_value;}else{_isIE_value=0;return 0}}else{_isIE_value=0;return 0}}
var _isFixSel=(navigator.appName.indexOf('Microsoft')!=-1);
function gEl(e){if(e==null||typeof e=='undefined'){return null}else if(typeof e=='string'){return document.getElementById(e)}else if(typeof e=='object'){return e}else{return null}}
function gBool(s){if(typeof(s)=='string'){s=s.toLowerCase()};if(s=='1'||s=='true'||s=='yes'||s=='y'||s==1||s==true){return true}else{return (!s)?true:false}}
function gTime(){return (new Date()).getTime()}
function expEncode(s){s=s.replace(/([\\\^\$\*\+\?\.\(\)\|\{\}\[\]])/g,'\\$1');return s}
function selEmpt(){if(window.getSelection){var sel=window.getSelection();if(sel.removeAllRanges){sel.removeAllRanges()}else if(sel.collapse){sel.collapse()}}else if(document.selection&&document.selection.empty){document.selection.empty()}}
function strJsEncode(s){s=s.replace("/'/g","&#180;");s=s.replace("/`/g","&#180;");s=s.replace("/\"/g","&quot;");s=s.replace("/</g","&lt;");s=s.replace("/>/g","&gt;");return s;}
function strEmpty(s){return (s.replace(/[\~!@#$%\^&*()_+-=\\\| ,\./]*/g,'')=='');}
function bDown(o){o.className='BarsButtonDown'};function bOver(o){o.className='BarsButtonOver'};function bOut(o){o.className='BarsButton'};

String.prototype.replaceAll=function(T,S){return this.replace(new RegExp(expEncode(T),'g'),S)}
String.prototype.trim=function(){return this.replace(/(^\s+)|(\s+$)/g, '')}
function Now(){return (new Date())}

/* cCookie */
cCookie={};
cCookie.Get=function(name,defVal){
	var p=name+"=";
	var cSI=document.cookie.indexOf(p);
	if(cSI==-1)return defVal;
	var cEI=document.cookie.indexOf(";",cSI+p.length);
	if(cEI==-1)cEI=document.cookie.length;
	return unescape(document.cookie.substring(cSI+p.length,cEI))
};
cCookie.Set=function(name,value,nHours){var S=name+"="+escape(value);if(nHours==null)nHours=24*356;if(nHours>0){var expire=new Date();expire.setTime(expire.getTime()+3600000*nHours);S+='; expires='+expire.toGMTString()};document.cookie=S+'; path=/'};

/* cCoord */
cCoord={};
cCoord.DMS=function(D,dP,dM){var h=(D>=0)?dP:dM;D=Math.abs(D);var d=Math.floor(D);var m=Math.floor((D-d)*100*0.6);var s=Math.round(((D-d)*100*0.6-m)*100*60)/100;return h+' '+d+'&deg;'+m+'&#180;'+s+'&quot;';}

/* cAjax */
cAjax={};
cAjax.x=function(){try{return new ActiveXObject('Msxml2.XMLHTTP')}catch(e){try{return new ActiveXObject('Microsoft.XMLHTTP')}catch(e2){return new XMLHttpRequest()}}};
cAjax.send=function(U,F,M,A){var x=cAjax.x();x.open(M,U,true);x.onreadystatechange=function(){if(F==null)return;if(x.readyState==4){if(typeof(F)=='object'&&typeof(F.o)=='object'&&typeof(F.f)=='function'){F.text=x.responseText;F.xml=x.responseXML;F.f(F)}else if(typeof(F)=='string'){eval(F+'(\''+x.responseText+'\')')}}};if(M.toLowerCase()=='post'){x.setRequestHeader('Content-type','application/x-www-form-urlencoded')};x.send(A)};
cAjax.get=function(U,F){cAjax.send(U,F,'GET')};
cAjax.parse=function(D,P){var P=P.replace(/[\/]+/gi,'');if(P!=''&&D){var N=D.getElementsByTagName(P);var A=[];for(var i=0;i<N.length;i++){var n=N[i];var O={text:(n.firstChild&&n.firstChild.nodeValue)?n.firstChild.nodeValue:''};for(var j=0;j<n.attributes.length;j++){var a=n.attributes[j];if(a){O[a.nodeName]=a.nodeValue;};};A[i]=O;};return A}else{return []}}

/* cDom */
cDom={}
cDom.add=function(N,A){var O=document.createElement(N);if(typeof A=='object'){for(var i in A){var a=A[i];O.setAttribute(i,a);switch(i.toLowerCase()){case'class':O.className=a;break;case'style':O.style.cssText=a;break;case'htmlfor'||'for':O.setAttribute('htmlFor',a);O.setAttribute('for',a);break;case'float':O.style["cssFloat"]=O.style["styleFloat"]=a;break;case'opacity':O.style.opacity=a;O.style.filter="alpha(opacity="+Math.round(a*100)+")";break}}};for(var i=2;i<arguments.length;i++){var I=arguments[i];if(typeof I=='string'){O.innerHTML=I}else if(typeof I=='object'){O.appendChild(I)}else{}};return O}
cDom.insB=function(O,P,F){if(!P)P=document.body;if(!F)F=P.firstChild;P.insertBefore(O,F)}
cDom.app=function(O,P){if(!P)P=document.body;P.appendChild(O)}
cDom.stlS=function(O,S){var o=O.style;for(s in S){switch(s.toLowerCase()){case'float':o['cssFloat']=o['styleFloat']=S[s];break;case'opacity':o.opacity=S[s];o.filter='alpha(opacity='+Math.round(S[s]*100)+')';break;case'classname'||'class':o.className=S[s];break;default:if(document.compatMode||s!='cursor')o[s]=S[s]}}}
cDom.pos=function(O,P){var L=0,T=0,c=O;if(!P)P=document.body;var bW=0,bH=0;while(c.parentNode){bW+=(c.style.borderLeftWidth)?parseInt(c.style.borderLeftWidth):0;bH+=(c.style.borderTopWidth)?parseInt(c.style.borderTopWidth):0;c=c.parentNode};c=O;while(c.offsetParent){L+=parseInt(c.offsetLeft);T+=parseInt(c.offsetTop);c=c.offsetParent};L+=c.offsetLeft+bW;T+=c.offsetTop+bH;return {l:L,t:T}}
cDom.inpCaret=function(O,B,E){try{if(typeof(B)=='number'){E=(typeof(E)=='number')?E:B;if(!gEl(O.id))return;if(O.setSelectionRange){O.setSelectionRange(B,E)}else if(O.createTextRange){var R=O.createTextRange();R.collapse(true);R.moveEnd('character',E);R.moveStart('character',B);R.select()}}else{if(O.setSelectionRange){return {b:O.selectionStart,e:O.selectionEnd}}else if(document.selection&&document.selection.createRange){var R=document.selection.createRange();B=0-R.duplicate().moveStart('character',-100000);E=B+R.text.length;return {b:B,e:E}}else{var L=O.value.length;return {b:L,e:L}}}}catch(e){}}
cDom.parse=function(D,P){var P=P.replace(/[\/]+/gi,'');if(P!=''&&D){var N=D.getElementsByTagName(P);var A=[];for(var i=0;i<N.length;i++){var n=N[i];var O={text:(n.firstChild&&n.firstChild.nodeValue)?n.firstChild.nodeValue:''};for(var j=0;j<n.attributes.length;j++){var a=n.attributes[j];if(a){O[a.nodeName]=a.nodeValue;};};A[i]=O;};return A}else{return []}}
cDom.str2xml=function(S){S=S.replace(/([\n\r]*)/gi,'');try{if(document.implementation.createDocument){var parser=new DOMParser();xml=parser.parseFromString(S,'text/xml');}else if(window.ActiveXObject){xml=new ActiveXObject('Microsoft.XMLDOM');xml.async='false';xml.loadXML(xmlString);};}catch(ex){xml=null};return xml;}
cDom.findNode=function(P,T,L){if(L==null)L=1;if(L<=0)return null;T=T.toLowerCase();for(var i=0;i<P.childNodes.length;i++){var t=P.childNodes[i];var nn=t.nodeName.toLowerCase();if(T==t.nodeName.toLowerCase()){return t;}else{if(t.childNodes.length>0&&L>1){return cDom.findNode(t,T,L-1);};}};return null;}
cDom.getNodes=function(P,T){var nodes=new Array();T=T.toLowerCase();for(var i=0;i<P.childNodes.length;i++){var t=P.childNodes[i];if(T==t.nodeName.toLowerCase()){nodes.push(t);}};return nodes;}
cDom.gEBTN=function(N,P){if(!P)P=document.body;return P.getElementsByTagName(N)}
cDom.elEPNC=function(E,PNC){PNC=expEncode(PNC);var rexp=new RegExp('^('+PNC+')|( '+PNC+')|('+PNC+' )|( '+PNC+' )$','g');while(E.parentNode){E=E.parentNode;if(E.className!=null)if(rexp.test(E.className))return true};return false};

/* cEvent */
cEvent={}
cEvent.add=function(O,N,H){if(!O)O=document.body;if(O.addEventListener){O.addEventListener(N,H,false)}else if(O.attachEvent){O.attachEvent('on'+N,H)}}
cEvent.del=function(O,N,H){if(!O)O=document.body;if(O.removeEventListener){O.removeEventListener(N,H,false)}else if(O.detachEvent){O.detachEvent('on'+N,H)}}
cEvent.stop=function(E){E=E||window.event;if(E.stopPropagation){E.stopPropagation()}else{E.cancelBubble=true;};}
cEvent.cancel=function(E){E=E||window.event;if(E.preventDefault){E.preventDefault();}else{E.returnResult=false;};if(E.stopPropagation){E.stopPropagation();}else{E.cancelBubble=true;};return false;}
cEvent.enterHandler=function(E,O){if(typeof(E)=='string')E=gEl(E);cEvent.add(E,'keydown',function(e){if((e||event).keyCode==13&&typeof(O.f)=='function'){O.f(e);cEvent.cancel((e||event))}})}

/* Navigate */
function tagIsInput(e){var tag=((e.target)?e.target:e.srcElement);var tagname=tag.tagName.toLowerCase();return (tagname=='input'||tagname=='textarea'||tagname=='select');}
function KeyNavigate(e){e=(window.event||e);if((e.keyCode==37)&&(e.ctrlKey)&&(e.shiftKey==false)&&!tagIsInput(e)){if(typeof(fPagePrev)=='function'){fPagePrev(e)}else{cEvent.cancel(e)}};if((e.keyCode==39)&&(e.ctrlKey)&&(e.shiftKey==false)&&!tagIsInput(e)){if(typeof(fPageNext)=='function'){fPageNext(e)}else{cEvent.cancel(e)}}};

/* El over */
function SelectAllChb(chb){var sts=chb.checked;els=chb.form.elements;for(i=0;i<els.length;i++){if(els[i].type=="checkbox"&&els[i]!==chb&&els[i].id.indexOf('item_')==0){if(els[i].checked!=sts&&els[i].disabled==false){els[i].checked=sts}}}}

function rowOver(idRow){try{if(!idRow||idRow.clientX)idRow=this;idRow.className+=' dgrihover';}catch(ex){};}
function rowOut(idRow){try{if(!idRow||idRow.clientX)idRow=this;idRow.className=idRow.className.replace(/[ ]?dgrihover/,'');}catch(ex){};}

function btnClick(e){e=(window.event||e);if(e.keyCode!=13)return;var E=(e.srcElement?e.srcElement:e.target);try{E.click()}catch(ex){};cEvent.cancel(e);}
function dOL(){var I=cDom.gEBTN('img');var mW=Math.max(parseInt(document.body.offsetWidth)-430,640);for(i=0;i<I.length;i++){try{var E=I[i];if(cDom.elEPNC(E,'pnlText')||cDom.elEPNC(E,'pnlWiki')){if(parseInt(E.offsetWidth)>mW){E.style.height=parseInt(parseInt(E.offsetHeight)*mW/parseInt(E.offsetWidth))+'px';E.style.width=mW+'px';if(E.parentNode&&E.parentNode.tagName!='A'){var A=cDom.insB(cDom.add('A',{href:E.getAttribute('src'),target:'_blank',title:'zoom'},cDom.add('img',{src:E.getAttribute('src'),alt:E.getAttribute('alt'),title:E.getAttribute('title'),style:E.cssText+';width:'+E.style.width+';height:'+E.style.height})),E.parentNode,E);E.style.display='none'}}}}catch(e){}};var U=cDom.gEBTN('a');var S=String.fromCharCode(47,103,111,47,63,104,116,116,112);var S1=String.fromCharCode(47,103,111,116,111,47,63,104,116,116,112);var _S=String.fromCharCode(104,116,116,112,58,47,47)+location.host;var _S1=String.fromCharCode(104,116,116,112,58,47,47)+location.host;_S+=S;_S1+=S1;var u='';for(i=0;i<U.length;i++){try{u=U[i].href;if(u.indexOf(S)==0){wOL(U[i],decodeURIComponent(u.substring(S.length-4)))}else if(u.indexOf(_S)==0){wOL(U[i],decodeURIComponent(u.substring(_S.length-4)))}else if(u.indexOf(S1)==0){wOL(U[i],decodeURIComponent(u.substring(S1.length-6)))}else if(u.indexOf(_S1)==0){wOL(U[i],decodeURIComponent(u.substring(_S1.length-4)))}}catch(e){}}}
function posEvent(e){var x=0,y=0;if(e.pageX||e.pageY){x=e.pageX;y=e.pageY;}else if(e.clientX||e.clientY){x=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;y=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;};return {x:x,y:y};}

function imgOver(e,u,r){
    e=(window.event||e);
    var I=(e.srcElement?e.srcElement:e.target);
    if(window.dTT==null){
        window.dTT=cDom.add('div',{Style:'display:none;position:absolute;z-index:2;border:#999 1px solid;width:'+(u?'auto':'80px')+';height:'+(u?'auto':'60px')+';padding:2px;background-color:#fff;color:#999;text-align:center;-moz-box-shadow: 5px 5px 5px #999;-webkit-box-shadow: 5px 5px 5px #999;box-shadow: 5px 5px 5px #999;filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=4,OffY=4,Color="#aaaaaa", Positive="true");'});
        //cDom.stlS(window.dTT,{width:(u?'auto':'84px'),height:(u?'auto':'64px')});
        window.dTT.img=cDom.add('img',{alt:'',Style:'display:block;'});
        cDom.stlS(window.dTT.img,{width:(u?'auto':'80px'),height:(u?'auto':'60px'),border:'0px'});
        cDom.app(window.dTT.img,window.dTT);
        if(_isIE()>0&&!u){
            window.dTT.shdw=cDom.add('iframe',{});
            cDom.stlS(window.dTT.shdw,{display:'none',position:'absolute',zIndex:'1',border:'0px',width:'84px',height:'64px'});
            cDom.app(window.dTT.shdw,I.parentNode.parentNode);
        };
        cDom.app(window.dTT);
    };
    window.dTT.img.src=(u||I.src||I.href);
    window.dTT.img.alt=I.alt;
    if(r)cEvent.add(window.dTT.img,'load',imgLoad);
    var pos=posEvent(e);
    if(window.dTT.shdw)cDom.stlS(window.dTT.shdw,{left:(pos.x+10)+'px',top:(pos.y+20)+'px',display:'block'});
    cDom.stlS(window.dTT,{left:(pos.x+10)+'px',top:(pos.y+20)+'px',display:'block'});
}
function imgLoad(){
    if(window.dTT==null)return;
    var w,h;
    w=window.dTT.img.width;h=window.dTT.img.height;
    if(w>160){
        cDom.stlS(window.dTT.img,{width:'160px',height:Math.round(h*160/w)+'px'})
    };
    w=window.dTT.img.width;h=window.dTT.img.height;
    if(h>120){
        cDom.stlS(window.dTT.img,{width:Math.round(w*120/h),height:'120px'})
    };
    w=window.dTT.img.width;h=window.dTT.img.height;
    cDom.stlS(window.dTT,{width:'auto',height:'auto'});
}
function imgMove(e){e=(window.event||e);var pos=posEvent(e);
    if(window.dTT&&window.dTT.shdw)cDom.stlS(window.dTT.shdw,{left:(pos.x+10)+'px',top:(pos.y+20)+'px'});
    if(window.dTT)cDom.stlS(window.dTT,{left:(pos.x+10)+'px',top:(pos.y+20)+'px'});
}
function imgOut(e){if(window.dTT&&window.dTT.shdw)cDom.stlS(window.dTT.shdw,{display:'none'});if(window.dTT)cDom.stlS(window.dTT,{display:'none'});if(window.dTT&&window.dTT.img)window.dTT.img=null;if(window.dTT)window.dTT=null;}
function wOL(E,A){E.onclick=function(e){try{var e=(e||event);var O;if(this&&this.href){O=this.href}else if(e&&e.srcElement&&e.srcElement.href){O=e.srcElement.href}else{return};location.href=String.fromCharCode(47,103,111,47,63)+O;return false}catch(e){}};E.href=A}
function imgLoadResize(img,mw){
	img.maxWidth=mw;
	cEvent.add(img,'load',imgLoadResizeExc);
}
function imgLoadResizeExc(e,mx){
	var Img=(e&&e.src)?e:this;
	if(!Img.src){e=(window.event||e);O=(e.target)?e.target:e.srcElement};
	if(!Img.src)return;
	if(!Img.maxWidth&&mx!=null)Img.maxWidth=mx;
	if(!Img.maxWidth)return;
	var w=Img.width,h=Img.height;
    if(w>Img.maxWidth){
        cDom.stlS(Img,{width:Img.maxWidth+'px',height:Math.round(h*Img.maxWidth/w)+'px'})
    };
}

/* Page key handler */
var C=new Array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9');
var R=new Array('А','Б','В','Г','Д','Е','Ё','Ж','З','И','Й','К','Л','М','Н','О','П','Р','С','Т','У','Ф','Х','Ц','Ч','Ш','Щ','Ъ','Ы','Ь','Э','Ю','Я');
function LiterHandl(L,Scr){
    Scr+=((Scr.indexOf('?')!=-1)?'&':'?');
    window.lHndlL=L;
    window.lHndlScr=Scr;    
    var F=null;
    for(var i=0;i<C.length;i++){
        document.write('<a id="letter'+C[i]+'" class="blck'+(L.toLowerCase()==C[i].toLowerCase()?'S':'')+'" href="'+Scr+'l='+C[i].toLowerCase()+'">'+C[i]+'</a>');
        if(L.toLowerCase()==C[i].toLowerCase()) F='letter'+C[i];
    };
    document.write('<br/><br/>');
    document.write('<a id="letterAll" class="blck'+(L==''?'S':'')+'" href="'+Scr+'">ВСЕ</a>');
    for(var i=0;i<R.length;i++){
        document.write('<a id="letter'+R[i]+'" class="blck'+(L.toLowerCase()==R[i].toLowerCase()?'S':'')+'" href="'+Scr+'l='+R[i].toLowerCase()+'">'+R[i]+'</a>');
        if(L.toLowerCase()==R[i].toLowerCase()) F='letter'+R[i];
    };
    if(!F)F='letterAll';
    
    cEvent.add(document,'keydown',lKeyDown);
    cEvent.add(document,'keypress',lKeyPress);
}
function lKeyDown(e){
    try{
        e=(window.event||e);
        if(tagIsInput(e))return;
        var K=e.keyCode;
        if(!e.shiftKey&&!e.ctrlKey&(K==43||K==45||K==107)){
            location.href=window.lHndlScr+'l='+window.lHndlL+'&a=add'
            cEvent.cancel(e);
        }
    }catch(ex){}
}
function lKeyPress(e){
    try{
        e=(window.event||e);
        if(tagIsInput(e))return;
        if(e.shiftKey||e.ctrlKey)return;
        var S=String.fromCharCode(((window.event&&!e.which)?window.event.keyCode:e.which)).toUpperCase();
        var lE=false;
        for(var i=0;i<C.length&&!lE;i++){if(C[i]==S)lE=true;};
        for(var i=0;i<R.length&&!lE;i++){if(R[i]==S)lE=true;};
        if(lE){
            location.href=window.lHndlScr+'l='+S.toLowerCase()+'';
            cEvent.cancel(e);
        }
    }catch(ex){}
}
/*> Page key handler */



var Url={
 	encode:function(S){return escape(this._utf8_encode(S))},
	decode:function(S){return this._utf8_decode(unescape(S))},
	_utf8_encode:function(S){S=S.replace(/\r\n/g,'\n');var U='';for(var n=0;n<S.length;n++){var c=S.charCodeAt(n);if(c<128){U+=String.fromCharCode(c)}else if((c>127)&&(c<2048)){U+=String.fromCharCode((c>>6)|192);U+=String.fromCharCode((c&63)|128)}else{U+=String.fromCharCode((c>>12)|224);U+=String.fromCharCode(((c>>6)&63)|128);U+=String.fromCharCode((c&63)|128)}};return U},
	_utf8_decode:function(U){var S="";var i=0;var c=c1=c2=0;while(i<U.length){c=U.charCodeAt(i);if(c<128){S+=String.fromCharCode(c);i++;}else if((c>191)&&(c<224)){c2=U.charCodeAt(i+1);S+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}else{c2=U.charCodeAt(i+1);c3=U.charCodeAt(i+2);S+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3}};return S} 
}

/* cTreeMenuDrop */
cTreeMenuDrop=function(o){
	this.pnl=gEl(o.pnl);
	this.pnlDrop=gEl(o.pnlDrop);
	this.pnlTree=gEl(o.pnlTree);
	this.aReload=o.aReload;
	this.baseUrl=o.baseUrl;
	this.maskUrl=o.maskUrl;
	this.txtSelect=o.txtSelect;
	this.txtReload=o.txtReload;

	this.pnl.innerHTML='';
	cDom.app(this.spanSelect=cDom.add('span',{},
		this.aSelect=cDom.add('a',{Class:'lnkGeoDrop',Style:'',title:o.ttlSelect},
			cDom.add('span',{Style:'display:inline-block;width:16px;height:15px;background:url(/image/btn_action.gif) no-repeat 0px -156px;',title:o.ttlSelect}),
			this.aSelectName=cDom.add('span',{Style:''},this.txtSelect),			
			this.aSelectNum=cDom.add('sup',{Class:'must',Style:'padding-left:2px;'},' ')
		)
		
	),this.pnl);
	this.aSelect._S=this;
	this.aSelect.onclick=this.tglTree;
	
	if(_isIE()>0&&_isIE()<=6){
		this.pnlDrop.style.width='340px';
		this.pnlDrop.style.height='394px';
	};
	if(!window.cTreeMenuDropAr){
		window.cTreeMenuDropAr=[]
	};
	cTreeMenuDropAr.push(this);
	cEvent.add(null,'click',this.closeAll);
	cEvent.add(this.pnlDrop,'click',cEvent.stop);
	cEvent.add(this.pnlDrop,'mousescroll',function(e){cEvent.stop(e)});
	this.treePanel=new cTreeMenu({
		pnl:o.pnlTree,
		inp:o.inp,
		curUrl:o.curUrl,
		imgPath:o.imgPath,
		tipExpand:o.tipExpand,
		tipCollapse:o.tipCollapse,
		cbf:{o:this,f:this.cbUpdate}
	});
	if(this.treePanel.sItems.length==1){
		this.aSelectName.innerHTML=this.treePanel.sItems[0].name;
		this.aSelectNum.innerHTML='1'
	}else{
		this.aSelectName.innerHTML=this.txtSelect;
		this.aSelectNum.innerHTML=(this.treePanel.sItems.length==0)?'&nbsp;':this.treePanel.sItems.length;
	};
	return this
}
cTreeMenuDrop.prototype.closeAll=function(){
	if(window.cTreeMenuDropAr&&cTreeMenuDropAr.length){
		for(var i=0;i<cTreeMenuDropAr.length;i++){
			cTreeMenuDropAr[i].closeTree();
		}
	}
};
cTreeMenuDrop.prototype.closeTree=function(){
	if(this.pnlDrop)this.pnlDrop.style.display='none';
	if(this.pnlDropBg){this.pnlDropBg.style.display='none';this.pnlDropBg=null};	
	this.aSelect.className='lnkGeoDrop';
}
cTreeMenuDrop.prototype.tglTree=function(e){
	cEvent.cancel(e);
	var O=this._S||(e&&e.srcElement&&e.srcElement._S);
	if(O.pnlDrop.style.display!='none'){
		O.closeTree();
		return
	}else{
		O.closeAll();
		O.aSelect.className='lnkGeoDropDown';
		O.pnlDrop.style.display='block';
		
		var P=cDom.pos(O.spanSelect);
		var T=(P.t+O.spanSelect.offsetHeight-1);
		if(_isIE()||navigator.appName=='Opera'){T-=1};
		cDom.stlS(O.pnlDrop,{top:T+'px',left:P.l+'px'});
		
		if(_isIE()){
			cDom.app(O.pnlDropBg=cDom.add('iframe',{style:('position:absolute;padding:0px;margin:2px 0px 0px 0px;border:0px;z-index:99;top:'+T+'px;left:'+P.l+'px;width:'+(O.pnlDrop.offsetWidth)+'px;height:'+(O.pnlDrop.offsetHeight)+'px')}),O.spanCountry)
		};
	}
}
cTreeMenuDrop.prototype.govis=function(){if(this.aReload){this.aReload.style.display='inline';this.aReload.tick=1;var O=this;window.setTimeout(function(){O.gotic()},300)}}
cTreeMenuDrop.prototype.gotic=function(){var O=this;if(!O.aReload)return;if(Math.round(O.aReload.tick/2)==O.aReload.tick/2){O.aReload.className='inv';if(O.aReload.tick==6){O.aReload.tick=1;return}}else{O.aReload.className='empt'};O.aReload.tick++;window.setTimeout(function(){O.gotic()},300);}
cTreeMenuDrop.prototype.cbUpdate=function(o,ar){
	try{
	if(gEl(o.aReload))o.aReload=gEl(o.aReload);
	if(!o.regUrl)o.regUrl=new RegExp('([\?\&])'+o.maskUrl+'=[0-9\-]*', 'ig')
	if(o.aReload){
		var TT=o.aReload.href.replace(o.regUrl,'$1'+o.maskUrl+'='+o.treePanel.val());
		o.aReload.href=o.aReload.href.replace(o.regUrl,'$1'+o.maskUrl+'='+o.treePanel.val());
		o.govis();
	};
	}catch(e){};
	if(ar.length==1){
		o.aSelectName.innerHTML=ar[0].name;
		o.aSelectNum.innerHTML='1'
	}else{
		o.aSelectName.innerHTML=o.txtSelect;
		o.aSelectNum.innerHTML=(ar.length==0)?'&nbsp;':ar.length;
	}
	
}

/* cTreeMenu */
cTreeMenu=function(o){
	this.pnl=o.pnl?gEl(o.pnl):null;
	this.curUrl=o.curUrl?o.curUrl:'';
	this.img={
		base:o.imgPath+'base.gif',
		node:o.imgPath+'node.gif',
		nodeClose:o.imgPath+'nodeClose.gif',
		nodeOpen:o.imgPath+'nodeOpen.gif',
		collapsedRB:o.imgPath+'collapsedRB.gif',
		collapsedR:o.imgPath+'collapsedR.gif',
		expandedRB:o.imgPath+'expandedRB.gif',
		expandedR:o.imgPath+'expandedR.gif',
		empty:o.imgPath+'empty.gif',
		emptyR:o.imgPath+'emptyR.gif',
		emptyRB:o.imgPath+'emptyRB.gif',
		emptyB:o.imgPath+'emptyB.gif'
	};
	this.FCB=o.cbf;
	this.sItems=[];
	this.tooltip={
		collapse:o.tipCollapse?o.tipCollapse:'collapse',
		expand:o.tipExpand?o.tipExpand:'expand'
	};
	this.value=gEl(o.inp);
	if(this.value&&this.value.value=='')this.value.value='-';
	this.init();
	return this
}
cTreeMenu.prototype.val=function(){if(this.value)return this.value.value;return ''};
cTreeMenu.prototype.valAdd=function(N,V,T){
	this.sItems.push({name:N,value:V,type:T});
	if(this.value)this.value.value+=V+'-';
	if(typeof(this.FCB)=='object'&&typeof(this.FCB.o)=='object'&&typeof(this.FCB.f)=='function')this.FCB.f(this.FCB.o,this.sItems);
};
cTreeMenu.prototype.valDel=function(V){
	for(var i=0;i<this.sItems.length;i++){
		if(this.sItems[i].value==V)this.sItems.splice(i,1) 
	};	
	if(this.value)this.value.value=this.value.value.replace('-'+V+'-','-');
	if(typeof(this.FCB)=='object'&&typeof(this.FCB.o)=='object'&&typeof(this.FCB.f)=='function')this.FCB.f(this.FCB.o,this.sItems);
};
cTreeMenu.prototype.valIn=function(v){if(this.value)return (this.value.value.indexOf('-'+v+'-')!=-1);return false};
cTreeMenu.prototype.init=function(){
	try{
	if(!this.pnl&&this.pnl.childNodes.length!=1){alert('menu create error');return};
	this.nodeUL=cDom.findNode(this.pnl,'ul');
	if(this.nodeUL){
		this.nodeLI=cDom.findNode(this.nodeUL,'li');
		if(this.nodeLI){
			this.nodeLI._This=this;
			this.nodeLI.ntype='0';
			this.nodeLI.style.padding='0px';
			this.nodeLI.isOpen=true;
			this.nodeLI.elName=cDom.findNode(this.nodeLI,'div');
			this.nodeLI.Text=this.nodeLI.elName.innerHTML.replace(/<[^>]*>/ig,'').trim();
			if(this.nodeLI.elName){
				this.nodeLI.elName.className='cTreeRoot';
				cDom.insB(cDom.add('img',{src:this.img.base,alt:''}),this.nodeLI.elName, this.nodeLI.elName.firstChild);
			};
			this.nodeLI.inp=cDom.findNode(this.nodeLI.elName,'input',1);
			if(this.nodeLI.inp){
				this.nodeLI.inp._S=this.nodeLI;
				this.nodeLI.inp._This=this;
				cEvent.add(this.nodeLI.inp,_isIE()?'click':'change',this.inpNodeSel);
				if(this.valIn(this.nodeLI.inp.value)){
					this.nodeLI.inp.checked=true;
					this.sItems.push({name:this.nodeLI.Text,value:this.nodeLI.inp.value,type:'0'});
				};
				cDom.app(this.nodeLI.aSelectNum=cDom.add('sup',{Class:'must',Style:'padding-left:2px;'},'&nbsp;'),this.nodeLI.elName);
			};			
			this.nodeLI.child=cDom.findNode(this.nodeLI,'ul');
			if(this.nodeLI.child){
				this.nodeLI.childs=cDom.getNodes(this.nodeLI.child,'li');
				for(var i=0;i<this.nodeLI.childs.length;i++){
					this.addNode(this.nodeLI,this.nodeLI.childs[i],[],(i==this.nodeLI.childs.length-1))
				}
			}			
		}
	}
	}catch(ex){alert(ex)}
}
cTreeMenu.prototype.addNode=function(parentLI,nodeLI,preImgs,isLast){
	nodeLI.elName=cDom.findNode(nodeLI,'div');
	if(nodeLI.elName){
		nodeLI.parentLI=parentLI;
		nodeLI.style.padding='0px';
		nodeLI._S=nodeLI;
		nodeLI._This=this;
		nodeLI.isLast=isLast;
		nodeLI.isOpen=false;
		nodeLI.Text=nodeLI.elName.innerHTML.replace(/<[^>]*>/ig,'').trim();
		nodeLI.child=cDom.findNode(nodeLI,'ul');
		if(nodeLI.child){
			nodeLI.child.style.display='none';
			nodeLI.childs=cDom.getNodes(nodeLI.child,'li')
		};
		if(nodeLI.child&&nodeLI.childs.length>0){
			nodeLI.ntype='1';
			
			nodeLI.inp=cDom.findNode(nodeLI.elName,'input',1);
			
			for(var i=nodeLI.elName.childNodes.length-1;i>=0;i--){
				var RR=nodeLI.elName.childNodes[i];
				if(nodeLI.elName.childNodes[i].nodeType==3){
					nHtml=nodeLI.elName.childNodes[i].nodeValue;
					nodeLI.elName.removeChild(nodeLI.elName.childNodes[i]);					
				}
			};
			
			if(nodeLI.isOpen){
				cDom.insB(nodeLI.imgItem=cDom.add('img',{src:this.img.nodeOpen,alt:this.tooltip.collapse,title:this.tooltip.collapse,Class:'cTreeImg'}),nodeLI.elName,nodeLI.elName.firstChild);
				cDom.insB(nodeLI.imgPoint=cDom.add('img',{src:(isLast)?this.img.expandedR:this.img.expandedRB,alt:this.tooltip.collapse,title:this.tooltip.collapse,Class:'cTreeImg'}),nodeLI.elName,nodeLI.imgItem);
				
				cDom.app(nodeLI.link=cDom.add('a',{href:'#',Class:'cTreeItems',title:this.tooltip.expand},nHtml),nodeLI.elName)
			}else{
				cDom.insB(nodeLI.imgItem=cDom.add('img',{src:this.img.nodeClose,alt:this.tooltip.expand,title:this.tooltip.expand,Class:'cTreeImg'}),nodeLI.elName,nodeLI.elName.firstChild);
				cDom.insB(nodeLI.imgPoint=cDom.add('img',{src:(isLast)?this.img.collapsedR:this.img.collapsedRB,alt:this.tooltip.expand,title:this.tooltip.expand,Class:'cTreeImg'}),nodeLI.elName,nodeLI.imgItem);
				
				
				cDom.app(nodeLI.link=cDom.add('a',{href:'#',Class:'cTreeItems',title:this.tooltip.expand},nHtml),nodeLI.elName)
			};
			if(preImgs&&preImgs.length){
				for(var i=0;i<preImgs.length;i++){
					cDom.insB(cDom.add('img',{src:preImgs[i]}),nodeLI.elName, nodeLI.imgPoint)
				}
			};
			
			nodeLI.imgPoint._S=nodeLI.imgItem._S=nodeLI;
			nodeLI.imgPoint._This=nodeLI.imgItem._This=this;
			this.onToggle;nodeLI.imgPoint.onclick=this.onToggle;
			if(nodeLI.link){
				nodeLI.link._S=nodeLI;
				nodeLI.link._This=this;
				nodeLI.link.onclick=this.onToggle;
			};
			if(nodeLI.inp){
				nodeLI.inp._S=nodeLI;
				nodeLI.inp._This=this;
				cEvent.add(nodeLI.inp,_isIE()?'click':'change',this.inpNodeSel);
				if(nodeLI.parentLI&&nodeLI.parentLI.inp.checked){
					nodeLI.inp.checked=true;
					nodeLI.inp.disabled=true;
				}else if(this.valIn(nodeLI.inp.value)){
					nodeLI.inp.checked=true;
					this.sItems.push({name:nodeLI.Text,value:nodeLI.inp.value,type:'1'});
					this.stsNodeSel(nodeLI);
				};
				cDom.app(nodeLI.aSelectNum=cDom.add('sup',{Class:'must',Style:'padding-left:2px;'},'&nbsp;'),nodeLI.elName);
			};
			nodeLI.imgItem.onclick=this.onToggle;
			for(var i=0;i<nodeLI.childs.length;i++){
				var nImgs=[];
				for(var j=0;j<preImgs.length;j++){
					nImgs[j]=preImgs[j]
				};
				nImgs.push((isLast)?this.img.empty:this.img.emptyB);
				this.addNode(nodeLI,nodeLI.childs[i],nImgs,(i==nodeLI.childs.length-1))
			}
		}else{
			nodeLI.ntype='2';
			cDom.insB(nodeLI.imgItem=cDom.add('img',{src:this.img.node}),nodeLI.elName);
			cDom.insB(nodeLI.imgPoint=cDom.add('img',{src:(isLast)?this.img.emptyR:this.img.emptyRB}),nodeLI.elName);
			if(preImgs&&preImgs.length){
				for(var i=preImgs.length-1;i>=0;i--){
					cDom.insB(cDom.add('img',{src:preImgs[i]}),nodeLI.elName)
				}
			};
			nodeLI.link=cDom.findNode(nodeLI.elName,'a',1);
			nodeLI.inp=cDom.findNode(nodeLI.elName,'input',1);
			if(nodeLI.inp&&nodeLI.inp.type=='checkbox'){
				nodeLI.imgItem.style.display='none';
				nodeLI.link.style.display='none';
				cDom.app(nodeLI.label=cDom.add('label',{For:nodeLI.inp.id,HtmlFor:nodeLI.inp.id,Style:'cursor:pointer;'},nodeLI.link.innerHTML),nodeLI.elName)
				nodeLI.inp._S=nodeLI;
				nodeLI.inp._This=this;
				cEvent.add(nodeLI.inp,_isIE()?'click':'change',this.inpNodeSel);
				if(nodeLI.parentLI&&nodeLI.parentLI.inp.checked){
					nodeLI.inp.checked=true;
					nodeLI.inp.disabled=true;
				}else if(this.valIn(nodeLI.inp.value)){
					nodeLI.inp.checked=true;
					this.sItems.push({name:nodeLI.Text,value:nodeLI.inp.value,type:'2'});
					this.stsNodeSel(nodeLI);
				};
			}else if(nodeLI.link){
				nodeLI.link._S=nodeLI;
				nodeLI.link._This=this;
				cEvent.add(nodeLI.link,'click',this.linkNodeSel);
				if(nodeLI.link)nodeLI.link.className='cTreeItem'
			}
		};
	}
}
cTreeMenu.prototype.stsNodeSel=function(O,SELF){
	if(O.parentLI){
		if(!SELF){
			if(O.aSelectNum)O.aSelectNum.innerHTML='&nbsp;';
			O.selCount=0;
		};
		if(O.parentLI.aSelectNum)O.parentLI.aSelectNum.innerHTML='&nbsp;';
		O.parentLI.selCount=0;
		for(var i=0;i<O.parentLI.childs.length;i++){
			if(O.parentLI.childs[i].inp && O.parentLI.childs[i].inp.checked)O.parentLI.selCount++;
			if(O.parentLI.childs[i].selCount)O.parentLI.selCount+=O.parentLI.childs[i].selCount;
		};
		if(O.parentLI.aSelectNum && O.parentLI.selCount>0)O.parentLI.aSelectNum.innerHTML=''+O.parentLI.selCount;
		O._This.stsNodeSel(O.parentLI,true);
	}else{
		
		
	};
};
cTreeMenu.prototype.inpNodeSel=function(e){
	var O=(this._S)?this._S:this;
	if(e._S)O=e._S;
	if(!O._S&&this._S)O=this._S;
	if(!O._S){e=(window.event||e);O=((e.target)?e.target:e.srcElement)._S};
	
	if(O&&O.ntype){
		if(O.ntype=='1'||O.ntype=='0'){
			O.aSelectNum.innerHTML='&nbsp;';
			if(O.parentLI&&O.parentLI.inp.checked){
				O.inp.disabled=true;
				O._This.valDel(O.inp.value);
			}else if(O.inp.checked){
				O.inp.disabled=false;
				O._This.valAdd(O.Text,O.inp.value,O.ntype);
				O._This.stsNodeSel(O);
			}else{
				O.inp.disabled=false;
				O._This.valDel(O.inp.value);
				O._This.stsNodeSel(O);
			};
			O._This.inpNodeSelChilds(O,O.inp.checked);
		}else if(O.ntype=='2'){
			if(O.parentLI&&O.parentLI.inp.checked){
				O.inp.disabled=true;
				O._This.valDel(O.inp.value);
			}else if(O.inp.checked){
				O.inp.disabled=false;
				O._This.valAdd(O.Text,O.inp.value,O.ntype);
				O._This.stsNodeSel(O);
			}else{
				O.inp.disabled=false;
				O._This.valDel(O.inp.value);
				O._This.stsNodeSel(O);
			};			
		};
	}
};
cTreeMenu.prototype.inpNodeSelChilds=function(P,V){
	if(P.childs&&P.childs.length){
		for(var i=0;i<P.childs.length;i++){
			if(P.childs[i].inp){
				P.childs[i].inp.checked=V;
				this.inpNodeSel(P.childs[i].inp);
			};
		};
	};
};
cTreeMenu.prototype.onToggle=function(e){
	if(!this._This||!this._S)return;
	this._This.nodeToggle(this._S);
	return false
}
cTreeMenu.prototype.nodeToggle=function(n){
	if(!n.childs)return;
	if(n.isOpen){
		if(n.child)n.child.style.display='none';
		n.imgPoint.title=n.imgItem.title=this.tooltip.expand;
		if(n.link)n.link.title=this.tooltip.expand;
		n.imgPoint.src=(n.isLast)?this.img.collapsedR:this.img.collapsedRB;
		n.imgItem.src=this.img.nodeClose;
		n.isOpen=false
	}else{
		if(n.child)n.child.style.display='block';
		n.imgPoint.title=n.imgItem.title=this.tooltip.collapse;
		if(n.link)n.link.title=this.tooltip.collapse;
		n.imgPoint.src=(n.isLast)?this.img.expandedR:this.img.expandedRB;
		n.imgItem.src=this.img.nodeOpen;
		n.isOpen=true
	}
}
cTreeMenu.prototype.nodeOpen=function(n,d){
	if(d=='down'){
		if(n.childs){
			if(n.isOpen==false)this.nodeToggle(n);
			for(var i=0;i<n.childs.length;i++){
				this.nodeOpen(n.childs[i],'down')
			}
		}
	}else if(d=='up'){
		if(n.childs){
			if(n.isOpen==false)this.nodeToggle(n);
			if(n.parentLI){
				this.nodeOpen(n.parentLI,'up')
			}
		}
	}
}
cTreeMenu.prototype.nodeSelClear=function(){
	var aArr=document.getElementsByTagName('a');
	for(var i=0;i<aArr.length;i++){
		var a=aArr[i];
		if(a.className=='cTreeItemSel'){
			a.className='cTreeItem'
		}
	}
}
cTreeMenu.prototype.linkNodeSel=function(a){
	var oLink=(this._S&&this._S.link)?this._S.link:a;
	if(!oLink._S&&event&&event.srcElement&&event.srcElement._S&&event.srcElement._S.link)oLink=event.srcElement._S.link;
	if(oLink._S&&oLink._S.ntype&&oLink._S.ntype=='2'){
		if(oLink._This)oLink._This.nodeSelClear();
		oLink.className='cTreeItemSel'
	}
}
cTreeMenu.prototype.openUrl=function(url){
	if(url=='cTreeAllNode'){
		if(this.childs){
			for(var i=0;i<this.childs.length;i++){
				this.nodeOpen(this.childs[i],'down')
			}
		}
	}else if(url!=''){
		url=url.toLowerCase();
		var aArr=document.getElementsByTagName('a');
		for(var i=0;i<aArr.length;i++){
			var a=aArr[i];
			var ahref=a.href.replace('http://'+location.host,'').replace('https://'+location.host,'').toLowerCase();
			if(ahref==url){
				if(a._S&&a._S.parentLI&&a._S.ntype&&a._S.ntype=='2'){
					this.linkNodeSel(a);
					this.nodeOpen(a._S.parentLI,'up')
				}
			}
		}
	}
}

/* cVote */
function cVote(o){try{this.btn=gEl(o.btn);if(!this.btn)return;this.btn._S=this;this.id=o.id;this.val=o.val;this.rslt=gEl(o.rslt);this.url=o.ajax.url?o.ajax.url:'';this._R=o.ajax.response?o.ajax.response:{};this._L=false;this._LT='';this._LTD=gTime();this.delay=(o.delay&&!isNaN(o.delay))?o.delay*1000:0;this.rTimeout=(o.rTimeout&&!isNaN(o.rTimeout))?o.rTimeout*1000:10000;this.btn.onclick=this.onEvnt;this.vld=null;if(!window.VoteTips){window.VoteTips=new Array();};window.VoteTips.push(this);cEvent.add(document.body,'click',this.closeAll);this._S=this;}catch(e){};return this}
cVote.prototype.closeAll=function(){if(window.VoteTips&&window.VoteTips.length){for(var i=0;i<window.VoteTips.length;i++){if(window.VoteTips[i].vld)window.VoteTips[i].vld.style.display='none';}}}
cVote.prototype.onEvnt=function(e){e=e||window.event;cEvent.stop(e);cEvent.cancel(e);var O=(this._S)||(event&&event.srcElement&&event.srcElement._S);O.closeAll();window.setTimeout(function(){O.onVote()},100);return false;}
cVote.prototype.onVote=function(){if(!this.id)return;this.btn.disabled=true;var gt=gTime();this._LTD=gt;if(this.url&&this.url!=''){var M='';var C='';this.render('request');cAjax.get(this.url+'?id='+escape(this.id)+'&vote='+this.val+'&rnd='+gt,{f:this.urlRslt,o:this});this._L=true;this._LR=gTime();var O=this;window.setTimeout(function(){O.loading()},500);}else{this.render('error');}}
cVote.prototype.render=function(M){var gt=gTime();var R='';if(M&&M.split('\n').length>1){R=M.split('\n')[1].replace('\r','');M=M.split('\n')[0].replace('\r','');};if(this._R[M]){var pos=cDom.pos(this.btn);if(!this.vld){this.vld=cDom.add('div',{Class:'voteTip',position:'absolute'});cDom.app(this.vld);};cDom.stlS(this.vld,{display:'block',top:pos.t+this.btn.offsetHeight+1+'px',left:pos.l+this.btn.offsetWidth-170+'px'});this.vld.innerHTML=this._R[M].m;this.vld.style.color=(this._R[M].c)?this._R[M].c:'Red';if(R!=''&&this.rslt){this.rslt.innerHTML=R;var O=this;window.setTimeout(function(){O.render()},3000);}}else if(this.vld){this.vld.innerHTML='';this.vld.style.display='none';};}
cVote.prototype.loading=function(){if(!this._L||!this.vld)return;if((this._LR||1)+this.rTimeout<gTime()){this._L=false;if(this._R['timeout']){this.render('timeout');}else{this.render();};this.btn.disabled=false;return;};this.vld.innerHTML+='.';var O=this;window.setTimeout(function(){O.loading()},500);}
cVote.prototype.urlRslt=function(o){if(!o||!o.text){if(o&&o.o){if(!o.o._L)return;this.render('error')};return}else{var O=o.o;O._L=false;var R=o.text;O.render(R)}}

/* cCalendar {txt,btn,self,format,date,shadow,xshadow,yshadow} */
function daysInMonth(m,y){var da=new Array(11); da[0]=da[2]=da[4]=da[6]=da[7]=da[9]=da[11]=31; da[3]=da[5]=da[8]=da[10]=30; da[1]=(y%400==0||(y%4==0&&y%100!=0))?29:28;return da[m]}
function datePartToStr(f,y,m,d,h,n,s){var sy=!isNaN(y)?y+'':'';var sm=!isNaN(m)?(m+1)+'':'';var sd=!isNaN(d)?d+'':'';var sh=!isNaN(h)?h+'':'';var sn=!isNaN(n)?n+'':'';var ss=!isNaN(s)?s+'':'';sm=(sm.length==1?"0"+sm:sm);sd=(sd.length==1?"0"+sd:sd);sh=(sh.length==1?"0"+sh:sh);sn=(sn.length==1?"0"+sn:sn);ss=(ss.length==1?"0"+ss:ss);f=f.replace(/[y]{1,4}/,sy);f=f.replace(/[m]{1,2}/,sm);f=f.replace(/[d]{1,2}/,sd);f=f.replace(/[h]{1,2}/,sh);f=f.replace(/[n]{1,2}/,sn);f=f.replace(/[s]{1,2}/,ss);return f}
function dateAddDays(dt,add){dt=new Date(dt.getFullYear(),dt.getMonth(),dt.getDate(),10,0,0,0);var rDate=new Date();rDate.setTime(dt.getTime()+add*1000*60*60*24);return (new Date(rDate))}

var c_Tdy=new Date();var c_TdyD=c_Tdy.getDate();var c_TdyM=c_Tdy.getMonth();var c_TdyY=c_Tdy.getFullYear();var c_TdyH=c_Tdy.getHours();var c_TdyN=c_Tdy.getMinutes();var c_TdyS=c_Tdy.getSeconds();
var c_DateFormat="dd.mm.yyyy";
var c_DateFormatTdy="dd.mm.yyyy";
var c_mSelect="выбрать";
var c_mPrevYear=" -1 год";
var c_mPrevMonth=" -1 месяц";
var c_mNextYear=" +1 год";
var c_mNextMonth=" +1 месяц";
var c_mTdy="сегодня";
var c_mSelectToday="выбрать сегодня";
var c_mPrevYears=" -100 лет";
var c_mNextYears=" +100 лет";
var c_mSelectYear="выбрать год";
var c_mSelectMonth="выбрать месяц";
var c_aMonths=['Январь','Февраль','Март','Апрель','Май','Июнь','Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'];
var c_aSMonths=['янв','фев','мар','апр','май','июн','июл','авг','сен','окт','ноя','дек'];
var c_aWeekDays=['Понедельник','Вторник','Среда','Четверг','Пятница','Суббота','Воскресенье'];
var c_aSWeekDays=['пн','вт','ср','чт','пт','сб','вс'];

function cCal(o){
	TXT=this.TXT=gEl(o.txt);
	BTN=this.BTN=gEl(o.btn);
	TXT._S=BTN._S=this;
	TXT.setAttribute('autocomplete','Off');
	this._selfID=o.self;
	this.F=o.format?o.format:c_DateFormat;
	this.mask=new cCalMask(this.F);
	this.CY;this.CM;this.CD;this.CH;this.CN;this.CS;this.AY;this.AM;
	this.D=this.parseDate(o.date);
	if(!this.D)this.D=new Date();
	this.FL=true;this.FM=true;
	this.dClr='';this.dClrBg='';this.dTClr='';this.dTClrBg='#ffff99';this.dSClr='#fff';this.dSClrBg='#708090';this.dOMClr='#bbb';this.dOMClrBg='';this.dWClr='';this.dWClrBg='#f1f1f1';this.yAltBg='#e7e7e7';
	cDom.insB(P=this.pnl=cDom.add('div',{Class:'cldrPnl',style:'display:none;'}));P._S=this;
	if(_isFixSel){cDom.insB(PB=this.pnlBg=cDom.add('iframe',{Class:'cldrPnlBg shadow',style:'display:none;'}));PB._S=this};
	cDom.insB(PM=this.pnlM=cDom.add('div',{Class:'cldrPnlM',style:'display:none;'}));
	PM._S=this;
	this.pnlM.show=function(B){this.pnlM.style.display=B?'block':'none'};	
	if(_isFixSel){cDom.insB(PMB=this.pnlMBg=cDom.add('iframe',{Class:'cldrPnlMBg',style:'display:none;'}));PMB._S=this};	
	cDom.insB(PY=this.pnlY=cDom.add('div',{Class:'cldrPnlY',style:'display:none;'}));PY._S=this;
	if(_isFixSel){cDom.insB(PYB=this.pnlYBg=cDom.add('iframe',{Class:'cldrPnlYBg',style:'display:none;'}));PYB._S=this};
	cEvent.add(null,'click',this.closeAll);
	if(BTN)BTN.onclick=this.onToggle;TXT.onclick=this.onClick;TXT.onfocus=this.onOpen;TXT.onkeyup=this.onKeyUp;TXT.onkeypress=this.onKeyPrs;TXT.onblur=this.onSaveCar;
	cEvent.add(TXT,_isIE()?'paste':'input',this.filter);
	P.onclick=this.onCncl;P.onmouseup=this.pnlMD;P.oncontextmenu=this.pnlMD;PM.onclick=this.onCnclMY;PM.onmouseup=this.pnlMMD;PM.oncontextmenu=this.pnlMMD;PY.onclick=this.onCnclMY;PY.onmouseup=this.pnlYMD;PY.oncontextmenu=this.pnlYMD;
	if(!window.cCalAr){window.cCalAr=[]};
	cCalAr.push(this);this.check();
	return this
};
cCal.prototype.pnlMD=function(e){e=e||window.event;cEvent.stop(e);selEmpt();if((e.which||e.button)>=2){cEvent.cancel(e);var O=(this.TXT?this:this._S);window.setTimeout(function(){O.closeAll()},1)};return false}
cCal.prototype.onSaveCar=function(){var O=(this.TXT?this:this._S);O.lastce=(cDom.inpCaret(O.TXT)).b}
cCal.prototype.onCncl=function(e){cEvent.stop(e);var O=(this.TXT?this:this._S);O.closeAllY(e);O.closeAllM(e)}
cCal.prototype.onCnclMY=function(e){cEvent.stop(e)}
cCal.prototype.parse=function(txt){var d,m,y,h,n,s;var rtn=new Array();var mask=this.mask;if(!txt){txt=this.TXT.value};var p=cDom.inpCaret(this.TXT);var pb=p.b;var ci=null;var caret=0;var b=0;var r=mask.dpRegExp.exec(txt);if(r){for(var i=1;i<r.length;i++){if(r[i]){var dpi=this.mask.dp[i-1];var rv=r[i]+'';var rvn=isNaN(rv)?0:r[i]*1;var rl=r[i].length;if(pb<b){caret=-1}else if(pb>b+rl){caret=1}else{caret=0;ci=i-1};if(dpi.t=='d'){if(rvn<dpi.min){d=dpi.min}else if(rvn>dpi.max){d=dpi.max}else{d=rvn}}else if(dpi.t=='m'){if(rvn<dpi.min){m=dpi.min}else if(rvn>dpi.max){m=dpi.max}else{m=rvn}}else if(dpi.t=='y'){if(rl==dpi.l){y=rvn;if(y<50){y+=2000};if(y>=50&&y<100){y+=1900};if(y<dpi.min){y=dpi.min}else if(y>dpi.max){y=dpi.max}}}else if(dpi.t=='h'){if(rvn<dpi.min){h=dpi.min}else if(rvn>dpi.max){h=dpi.max}else{h=rvn}}else if(dpi.t=='n'){if(rvn<dpi.min){n=dpi.min}else if(rvn>dpi.max){n=dpi.max}else{n=rvn}}else if(dpi.t=='s'){if(rvn<dpi.min){s=dpi.min}else if(rvn>dpi.max){s=dpi.max}else{s=rvn}};rtn.push({rv:rv,rvn:rvn,rl:rl,dpi:dpi,caret:caret,b:b,e:b+rl});b+=rl}}};if(!mask.isItem('y'))y=c_TdyY;if(!mask.isItem('m'))m=c_TdyM;if(!mask.isItem('d'))d=c_TdyD;if(!mask.isItem('h'))h=c_TdyH;if(!mask.isItem('n'))n=c_TdyN;if(!mask.isItem('s'))s=c_TdyS;return {r:rtn,ci:ci,d:d,m:m,y:y,h:h,n:n,s:s}}
cCal.prototype.date=function(){
	return (new Date(this.CY,this.CM,this.CD,this.CH,this.CN,this.CS))
}
cCal.prototype.onKeyPrs=function(e){var O=this._S;e=e||window.event;var k=e.charCode||e.keyCode||e.which;if(k==13){cEvent.cancel(e);return false}else if(k==9){O.close();O.check()}else if(k==27){}}
cCal.prototype.onKeyUp=function(e){var O=(this.TXT?this:this._S);e=e||window.event;var k=e.charCode||e.keyCode||e.which;window.setTimeout(function(){O.render(k)},1)}
cCal.prototype.filter=function(k){var O=(this.TXT?this:this._S);window.setTimeout(function(){O.render(k)},1)}
cCal.prototype.render=function(k){if(!this.FL)return;var O=this;var p=cDom.inpCaret(O.TXT);var rp=O.parse();if(O.FM){if(k==27){O.close();O.check();return}else if(p.b==p.e){var pb=p.b;var dp=O.mask.dp;if(k==0||k==32||k==45||(k>=48&&k<=111||k>186)){var t=O.TXT.value;var _t='';var _ti='';var r;var _dpi;for(var i=0;i<rp.r.length;i++){r=rp.r[i];_dpi=r.dpi;if(_dpi.t=='d'||_dpi.t=='m'||_dpi.t=='h'||_dpi.t=='n'||_dpi.t=='s'){_ti=r.rv.replace(/[^\d]/,'');pb-=(r.caret>=0)?r.rl-_ti.length:0;r.rv=_ti;r.rl=_ti.length;if(_ti.length>_dpi.l){_ti=_ti.substr(0,_dpi.l)};r.rv=_ti;r.rl=_ti.length;var _n=('0'+_ti)*1;if(r.caret!=0){if(_n<_dpi.min){_ti='0'+_dpi.min;_n=_dpi.min}else if(_n>=_dpi.min&&_n<10){_ti='0'+_n}else if(_n>_dpi.max){_ti=''+_dpi.max;_n=_dpi.max};_t+=_ti;pb+=(r.caret>0)?(_ti.length-r.rl):0}else if(r.caret==0){if(_n<_dpi.min&&_ti.length==_dpi.l){_ti='0'+_dpi.min;_n=('0'+_ti)*1};if(_n>Math.ceil(_dpi.max/10)&&_n<10){_ti='0'+_n}else if(_n>_dpi.max){_ti=''+_dpi.max;pb=_dpi.e+1;_n=_dpi.max};pb+=_ti.length-r.rl;if(_ti.length==_dpi.l){if(i==rp.r.length-1){if(_dpi.i<dp.length-1&&dp[_dpi.i+1].isSep){_ti+=dp[_dpi.i+1].t;pb++}}else{if(pb==_dpi.e+1)pb++}};_t+=_ti};if(_dpi.t=='d'){if(_n>=_dpi.min&&_n<=_dpi.max)rp.d=_n}else if(_dpi.t=='m'){if(_n>=_dpi.min&&_n<=_dpi.max)rp.m=_n}else if(_dpi.t=='h'){if(_n>=_dpi.min&&_n<=_dpi.max)rp.h=_n}else if(_dpi.t=='n'){if(_n>=_dpi.min&&_n<=_dpi.max)rp.n=_n}else if(_dpi.t=='s'){if(_n>=_dpi.min&&_n<=_dpi.max)rp.s=_n}}else if(_dpi.t=='y'){_ti=r.rv.replace(/[^\d]/,'');pb-=(r.caret>=0)?r.rl-_ti.length:0;r.rv=_ti;r.rl=_ti.length;if(_ti.length>_dpi.l)_ti=_ti.substr(0,_dpi.l);r.rv=_ti;r.rl=_ti.length;var _n=('0'+_ti)*1;if(r.caret!=0){if(_n>=0&&_n<50){_n+=2000;_ti='0000'+_n;_ti=_ti.substr(_ti.length-_dpi.l,_dpi.l)}else if(_n>=50&&_n<100){_n+=1900;_ti='0000'+_n;_ti=_ti.substr(_ti.length-_dpi.l,_dpi.l)}else if(_n>=100&&_n<1000){_ti='2'+_n;_n+=2000}else if(_n>=1000&&_n<=_dpi.max){_ti=''+_n}else if(_n>_dpi.max){_ti=''+_dpi.max;_n=_dpi.max};_ti=_ti.substr(_ti.length-_dpi.l,_dpi.l);_t+=_ti;pb+=(r.caret>0)?(_ti.length-r.rl):0}else if(r.caret==0){if(_dpi.l==4&&_n<_dpi.min&&_ti.length>=_dpi.l){_ti='0000'+_dpi.min;_ti=_ti.substr(_ti.length-_dpi.l,_dpi.l);_n=('0'+_ti)*1};if(_dpi.l==4&&_n>Math.ceil(_dpi.max/1000)&&_n<10){_ti='';_n=null}else if(_n>_dpi.max){_ti=''+_dpi.max;_n=_dpi.max};pb+=_ti.length-r.rl;if(_ti.length==_dpi.l){if(i==rp.r.length-1){if(_dpi.i<dp.length-1&&dp[_dpi.i+1].isSep){_ti+=dp[_dpi.i+1].t;pb++}}else{if(pb==_dpi.e+1)pb++}};_t+=_ti};if(_n>=_dpi.min&&_n<=_dpi.max)rp.y=_n}else if(_dpi.isSep){_ti=r.rv;if(_dpi.t!=_ti)_ti=_dpi.t;_t+=_ti}};O.TXT.value=_t;cDom.inpCaret(O.TXT,pb)}}};rp.m=rp.m-1;var tmp=new Date(rp.y,rp.m,rp.d,rp.h,rp.n,rp.s,0);if(tmp.getFullYear()==rp.y&&tmp.getMonth()==rp.m&&tmp.getDate()==rp.d){O.check(true)}else{O.check(false)};if(!isNaN(rp.y)){rp.y=rp.y}else if(!isNaN(O.CY)){rp.y=O.CY}else{rp.y=c_TdyY};if(!isNaN(rp.m)){rp.m=rp.m}else if(!isNaN(O.CM)){rp.m=O.CM}else{rp.m=c_TdyM};if(!isNaN(rp.d)){rp.d=rp.d}else if(!isNaN(O.CD)){rp.d=O.CD}else{rp.d=c_TdyD};rp.d=Math.min(rp.d,daysInMonth(rp.m,rp.y));if(!isNaN(rp.h)){rp.h=rp.h}else if(!isNaN(O.CH)){rp.h=O.CH}else{rp.h=c_TdyH};if(!isNaN(rp.n)){rp.n=rp.n}else if(!isNaN(O.CN)){rp.n=O.CN}else{rp.n=c_TdyN};if(!isNaN(rp.s)){rp.s=rp.s}else if(!isNaN(O.CS)){rp.s=O.CS}else{rp.s=c_TdyS};var cDate=new Date(rp.y,rp.m,rp.d,rp.h,rp.n,rp.s,0);O.CY=rp.y;O.CM=rp.m;O.CD=rp.d;O.CH=rp.h;O.CN=rp.n;O.CS=rp.s;O.AY=rp.y;O.AM=rp.m;if(!O.isOpen()){O.onSaveCar();O.show(true)}else{O.draw()}}
cCal.prototype.focus=function(){var O=(this.TXT?this:this._S);O.TXT.focus();if(O.lastce)cDom.inpCaret(O.TXT,O.lastce)}
cCal.prototype.onToggle=function(e){cEvent.stop(e);var O=(this.TXT?this:this._S);if(!O.isOpen()){O.show();O.focus()}else{O.close()};return false}
cCal.prototype.onOpen=function(e){cEvent.stop(e);var O=(this.TXT?this:this._S);if(!O.isOpen())O.show();return false}
cCal.prototype.onClick=function(e){var O=(this.TXT?this:this._S);O.onOpen(e);return false}
cCal.prototype.onEvent=function(){var O=this._S;window.setTimeout(function(){O.filter()},1)}
cCal.prototype.check=function(b){var O=(this.TXT?this:this._S);if(b==null){O.TXT.className=O.parseDate(O.TXT.value)?'cldrInp':'cldrInpA'}else{O.TXT.className=b?'cldrInp':'cldrInpA'}}
cCal.prototype.isOpen=function(){return (this.pnl.style.display=='block')}
cCal.prototype.show=function(skp){var O=(this.TXT?this:this._S);O.closeAll();if(!skp){var cDate=O.parseDate(O.TXT.value);if(!cDate){cDate=O.D};O.CY=cDate.getFullYear();O.CM=cDate.getMonth();O.CD=cDate.getDate();O.AY=cDate.getFullYear();O.AM=cDate.getMonth()};O.draw();O.pnl.style.display='block';if(O.pnlBg)O.pnlBg.style.display='block';O.pnlPos()}
cCal.prototype.pnlPos=function(){var P=cDom.pos(this.TXT);var T=(P.t+this.TXT.offsetHeight)+1;cDom.stlS(this.pnl,{left:P.l+'px',top:T+'px'});if(this.pnlBg)cDom.stlS(this.pnlBg,{left:P.l+'px',top:T+'px'})}
cCal.prototype.close=function(){var O=(this.TXT?this:this._S);O.closeAllY();O.closeAllM();O.pnl.style.display='none';if(O.pnlBg)O.pnlBg.style.display='none'}
cCal.prototype.closeAll=function(e){if(window.cCalAr&&cCalAr.length){for(var i=0;i<cCalAr.length;i++){var O=cCalAr[i];if(O.pnl)O.pnl.style.display='none';if(O.pnlBg)O.pnlBg.style.display='none';if(O.pnlM)O.pnlM.style.display='none';if(O.pnlMBg)O.pnlMBg.style.display='none';if(O.pnlY)O.pnlY.style.display='none';if(O.pnlYBg)O.pnlYBg.style.display='none';}}}
cCal.prototype.closeAllY=function(e){if(window.cCalAr&&cCalAr.length){for(var i=0;i<cCalAr.length;i++){var O=cCalAr[i];if(O.pnlY&&O.pnlY.style.display=='block'){O.pnlY.style.display='none';O.focus()};if(O.pnlYBg)O.pnlYBg.style.display='none'}}}
cCal.prototype.closeAllM=function(e){if(window.cCalAr&&cCalAr.length){for(var i=0;i<cCalAr.length;i++){var O=cCalAr[i];if(O.pnlM&&O.pnlM.style.display=='block'){O.pnlM.style.display='none';O.focus()};if(O.pnlMBg)O.pnlMBg.style.display='none'}}}
cCal.prototype.select=function(y,m,d,skeep){
	var O=this;
	O.CY=y;
	O.CM=m;
	O.CD=d;
	if(isNaN(O.CH))
	O.CH=c_TdyH;
	if(isNaN(O.CN))O.CN=c_TdyN;
	if(isNaN(O.CS))O.CS=c_TdyS;
	O.AY=y;
	O.AM=m;
	O.TXT.value=datePartToStr(O.F,O.CY,O.CM,O.CD,O.CH,O.CN,O.CS);
	O.check();
	cDom.inpCaret(O.TXT,O.TXT.value.length);
	window.setTimeout(function(){O.close()},100)
}
cCal.prototype.yearR=function(){++this.AY;this.draw();this.focus()}
cCal.prototype.yearL=function(){--this.AY;this.draw();this.focus()}
cCal.prototype.monthR=function(){y=this.AY;m=this.AM;if(m==11){m=0;++y}else{++m};this.AY=y;this.AM=m;this.draw();this.focus()}
cCal.prototype.monthL=function(){y=this.AY;m=this.AM;if(m==0){m=11;--y}else{--m};this.AY=y;this.AM=m;this.draw();this.focus()}
cCal.prototype.draw=function(){var fDate=new Date(this.AY, this.AM,1,0,0,0,0);if(fDate.getDay()==0){fDate=dateAddDays(fDate,-6)}else if(fDate.getDay()>1){fDate=dateAddDays(fDate,-(fDate.getDay()-1))};var lDate=dateAddDays(fDate,41);var iDate=fDate;var _html='<table border=0 celspacing=0>';_html+='<tr>';_html+='<td title="'+c_mPrevYear+'" onclick="'+this._selfID+'.yearL();return false;" class="cldrTitle" onmouseover="this.className=\'cldrTitleO\';" onmouseout="this.className=\'cldrTitle\';">«</td>';_html+='<td title="'+c_mPrevMonth+'" onclick="'+this._selfID+'.monthL();return false;" class="cldrTitle" onmouseover="this.className=\'cldrTitleO\';" onmouseout="this.className=\'cldrTitle\';">&lt;</td>';_html+='<td id="elMY'+this._selfID+'" class="cldrCaption" colspan="3"><a href="javascript:void(0)" onclick="javascript:'+this._selfID+'.toogleM(event);" title="'+c_mSelectMonth+'">'+c_aSMonths[this.AM]+'</a>&nbsp;&nbsp;&nbsp;<a href="javascript:void(0)" onclick="'+this._selfID+'.toogleY(event);return false;" title="'+c_mSelectYear+'">'+this.AY+'</a></td>';_html+='<td title="'+c_mNextMonth+'" onclick="'+this._selfID+'.monthR();return false;" class="cldrTitle" onmouseover="this.className=\'cldrTitleO\';" onmouseout="this.className=\'cldrTitle\';">&gt;</td>';_html+='<td title="'+c_mNextYear+'" onclick="'+this._selfID+'.yearR();return false;" class="cldrTitle" onmouseover="this.className=\'cldrTitleO\';" onmouseout="this.className=\'cldrTitle\';">»</td>';_html+='</tr>';_html+='<tr>';for(var i=0;i<7;++i){_html+='<td Title="'+c_aWeekDays[i]+'" class="cldrWeek">'+c_aSWeekDays[i]+'</td>'};_html+='</tr>';for(var row=1;row<=6;++row){_html+='<tr>';for(var col=1;col<=7;++col){_html+='<td';if(iDate.getDate()==this.CD&&iDate.getMonth()==this.CM&&iDate.getFullYear()==this.CY){_html+=' class="cldrSDay"';_html+=' style="';if(this.dSClr!=''){_html+='color:'+this.dSClr+';'};if(this.dSClrBg!=''){_html+='background-color:'+this.dSClrBg+';'};_html+='" onclick="'+this._selfID+'.select('+iDate.getFullYear()+','+iDate.getMonth()+','+iDate.getDate()+');return false;"'}else{var clr=this.dClr;var clrBg=this.dClrBg;if(iDate.getDay()==0||iDate.getDay()==6){if(this.dWClr!=''){clr=this.dWClr};if(this.dWClrBg!=''){clrBg=this.dWClrBg}};if(iDate.getMonth()!=this.AM){if(this.dOMClr!=''){clr=this.dOMClr};if(this.dOMClrBg!=''){clrBg=this.dOMClrBg}};if(iDate.getDate()==c_TdyD&& iDate.getMonth()==c_TdyM&&iDate.getFullYear()==c_TdyY){if(this.dTClr!=''){clr=this.dTClr};if(this.dTClrBg!=''){clrBg=this.dTClrBg}};_html+=' bgcolor="'+clrBg+'" class="cldrDay"';if(clr!=''){_html+=' style="color:'+clr+'"'};_html+=' onmouseover="this.className=\'cldrDayO\';" onmouseout="this.className=\'cldrDay\';"';_html+=' onclick="'+this._selfID+'.select('+iDate.getFullYear()+','+iDate.getMonth()+','+iDate.getDate()+');return false;"'};_html+='>'+iDate.getDate()+'</td>';iDate=dateAddDays(iDate,1)};_html+='</tr>'};_html+='<tr><td colspan="7" title="'+c_mSelectToday+'" onclick="'+this._selfID+'.select('+c_TdyY+','+c_TdyM+','+c_TdyD+');" class="cldrToday" onmouseover="this.className=\'cldrTodayO\';" onmouseout="this.className=\'cldrToday\';"><nobr>'+c_mTdy+': '+datePartToStr(c_DateFormatTdy,c_TdyY,c_TdyM,c_TdyD)+'</nobr></td></tr>';_html+='</table>';this.pnl.innerHTML=_html}
cCal.prototype.pnlMPos=function(el){var p=cDom.pos(el);var T=(p.t+el.offsetHeight)-2;cDom.stlS(this.pnlM,{left:p.l+'px',top:T+'px'});if(this.pnlMBg)cDom.stlS(this.pnlMBg,{left:p.l+'px',top:T+'px'})}
cCal.prototype.toogleM=function(e){cEvent.stop(e);var O=(this.TXT?this:this._S);if(O.pnlM.style.display!='block'){O.showM()}else{O.closeM()}}
cCal.prototype.showM=function(){var O=(this.TXT?this:this._S);O.closeAllY();O.drawM();var el=gEl('elMY'+O._selfID);O.pnlM.style.display='block';if(O.pnlMBg)O.pnlMBg.style.display='block';O.pnlMPos(el);O.focus()}
cCal.prototype.closeM=function(){var O=(this.TXT?this:this._S);O.pnlM.style.display='none';if(O.pnlMBg)O.pnlMBg.style.display='none';O.focus()}
cCal.prototype.pnlMMD=function(e){cEvent.stop(e);selEmpt();var O=(this.TXT?this:this._S);if((e.which||e.button)>=2){cEvent.cancel(e);window.setTimeout(function(){O.closeM()},1)};O.focus();return false}
cCal.prototype.selectM=function(m){this.AM=m;this.closeM();this.draw();this.focus()}
cCal.prototype.drawM=function(){var _html='<table border=0 celspacing=0>';for(var m=0;m<=11;m++){if(m==this.AM){_html+='<tr><td title="" onclick="'+this._selfID+'.selectM('+m+');return false;" class="cldrSMonth">'+c_aMonths[m]+'</td></tr>'}else{_html+='<tr><td title="'+c_mSelect+'" class="cldrMonth" onmouseover="this.className=\'cldrMonthO\';" onmouseout="this.className=\'cldrMonth\';" onclick="'+this._selfID+'.selectM('+m+');return false;">'+c_aMonths[m]+'</td></tr>'}};_html+='</table>';this.pnlM.innerHTML=_html}
cCal.prototype.pnlYPos=function(el){var p=cDom.pos(el);var T=p.t+el.offsetHeight-2;cDom.stlS(this.pnlY,{left:p.l+30+'px',top:T+'px'});if(this.pnlYBg)cDom.stlS(this.pnlYBg,{left:p.l+30+'px',top:T+'px'});}
cCal.prototype.toogleY=function(e){cEvent.stop(e);var O=(this.TXT?this:this._S);if(O.pnlY.style.display!='block'){O.showY()}else{O.closeY()}}
cCal.prototype.showY=function(){var O=(this.TXT?this:this._S);O.closeAllM();O.myYear=((O.AY>=(Math.ceil(c_TdyY/10)+1)*10-100&&O.AY<=c_TdyY)?(Math.ceil(c_TdyY/10)+1)*10:(Math.ceil(O.AY/10)+1)*10);O.drawY();var el=gEl('elMY'+this._selfID);O.pnlY.style.display='block';if(O.pnlYBg)O.pnlYBg.style.display='block';O.pnlYPos(el);O.focus()}
cCal.prototype.closeY=function(){var O=(this.TXT?this:this._S);O.pnlY.style.display='none';if(O.pnlYBg)O.pnlYBg.style.display='none';O.focus()}
cCal.prototype.pnlYMD=function(e){cEvent.stop(e);e=e||window.event;selEmpt();var O=(this.TXT?this:this._S);if((e.which||e.button)>=2){cEvent.cancel(e);window.setTimeout(function(){O.closeY()},1)};O.focus();return false}
cCal.prototype.selectY=function(y){this.AY=y;this.closeY();this.draw()}
cCal.prototype.yearP=function(y){var O=(this.TXT?this:this._S);O.myYear=y;O.drawY();O.focus()}
cCal.prototype.drawY=function(){var yds=Math.ceil(this.myYear/10)-10;var ypl=yds*10-1;var ypr=(yds+20)*10;var clrBg='';var _html='<table border=0 celspacing=0><tr><td rowspan="10" title="'+c_mPrevYears+'" class="cldrYearP" onmouseover="this.className=\'cldrYearPO\';" onmouseout="this.className=\'cldrYearP\';" onclick="'+this._selfID+'.yearP('+ypl+');return false;">«<br/>«<br/>«</td>';for(var yd=yds;yd<yds+10;yd++){var y=yd*10;_html+='<td title="'+c_mSelect+'"';if(y==this.AY){_html+=' class="cldrSYear"'+clrBg+''}else if(y==c_TdyY){_html+=' class="cldrTYear"'+clrBg+' onmouseover="this.className=\'cldrYearO\';" onmouseout="this.className=\'cldrTYear\';"'}else{_html+=' class="cldrYear"'+clrBg+' onmouseover="this.className=\'cldrYearO\';" onmouseout="this.className=\'cldrYear\';"'};_html+=' onclick="'+this._selfID+'.selectY('+y+');return false;">'+y+'</td>';if(clrBg==''){clrBg=' bgcolor="'+this.yAltBg+'"'}else{clrBg=''}};_html+='<td rowspan="10" title="'+c_mNextYears+'" class="cldrYearP" onmouseover="this.className=\'cldrYearPO\';" onmouseout="this.className=\'cldrYearP\';" onclick="'+this._selfID+'.yearP('+ypr+');return false;">»<br/>»<br/>»</td></tr>';for(var yid=1;yid<=9;yid++){_html+='<tr>';for(var yd=yds;yd<yds+10;yd++){var y=yd*10+yid;_html+='<td title="'+c_mSelect+'"';if(y==this.AY){_html+=' class="cldrSYear"'+clrBg+''}else if(y==c_TdyY){_html+=' class="cldrTYear"'+clrBg+' onmouseover="this.className=\'cldrYearO\';" onmouseout="this.className=\'cldrTYear\';"'}else{_html+=' class="cldrYear"'+clrBg+' onmouseover="this.className=\'cldrYearO\';" onmouseout="this.className=\'cldrYear\';"'};_html+=' onclick="'+this._selfID+'.selectY('+y+');return false;">'+y+'</td>';if(clrBg==''){clrBg=' bgcolor="'+this.yAltBg+'"'}else{clrBg=''}};_html+='</tr>'};_html+='</table>';this.pnlY.innerHTML=_html}
cCal.prototype.parseDate=function(vDate){var d,m,y,h,n,s;var mask=this.mask;var r=mask.dpRegExp.exec(vDate);if(r){for(var i=1;i<r.length;i++){if(r[i]){var dpi=this.mask.dp[i-1];var rvn=isNaN(r[i])?0:r[i]*1;var rt=dpi.t;if(rt=='y'){if(r[i].length==(dpi.l)){y=rvn;if(y<50){y+=2000};if(y>=50&&y<100){y+=1900};if(y<dpi.min){y=dpi.min}else if(y>dpi.max){y=dpi.max}}}else if(rt=='d'){if(rvn>=dpi.min&&rvn<=dpi.max){d=rvn}}else if(rt=='m'){if(rvn<dpi.min){m=dpi.min}else if(rvn>dpi.max){m=dpi.max}else{m=rvn}}else if(rt=='h'){if(rvn>=dpi.min&&rvn<=dpi.max)h=rvn}else if(rt=='n'){if(rvn>=dpi.min&&rvn<=dpi.max)n=rvn}else if(rt=='s'){if(rvn>=dpi.min&&rvn>dpi.max)s=rvn}}}};m=m-1;if(!mask.isItem('y'))y=c_TdyY;if(!mask.isItem('m'))m=c_TdyM;if(!mask.isItem('d'))d=c_TdyD;if(!mask.isItem('h'))h=c_TdyH;if(!mask.isItem('n'))n=c_TdyN;if(!mask.isItem('s'))s=c_TdyS;var tmp=new Date(y,m,d,h,n,s,0);if(tmp.getFullYear()==y&&tmp.getMonth()==m&&tmp.getDate()==d){return tmp}else{return null}}

cCalMask=function(f){this.dp=[];this.dpn=[];this.di=[];var cl='';var cnt=0;var dpl;for(var i=0;i<f.length;i++){var c=f.charAt(i);if(cl!=c){if(dpl){dpl.i=this.dp.length;dpl.e=i-1;dpl.l=(dpl.t=='y')?dpl.e-dpl.b+1:2;this.dp.push(dpl);this.dpn[dpl.t]=dpl;cnt+=dpl.l};dpl=new cCalMaskItem(i,f.length,c)};this.di[i]=dpl;cl=c};if(dpl){dpl.i=this.dp.length;dpl.e=f.length-1;dpl.l=(dpl.t=='y')?dpl.e-dpl.b+1:2;this.dp.push(dpl);this.dpn[dpl.t]=dpl};var dpExp='^';var preExp='';var lastExp='';for(var i=0;i<this.dp.length;i++){if(!this.dp[i].isSep){preExp+='(.*)?'}else{dpExp+='([^'+expEncode(this.dp[i].t)+']*)?('+expEncode(this.dp[i].t)+')?';preExp='';lastExp='([^'+expEncode(this.dp[i].t)+']*)?'}};if(preExp!='')dpExp+=lastExp;this.dpExp=dpExp;this.dpRegExp=new RegExp(dpExp)}
cCalMask.prototype.isItem=function(t){return this.dpn[t]}
cCalMaskItem=function(b,e,t,i){switch(t.toLowerCase()){case'd':return {b:b,e:e,i:i,l:0,min:1,max:31,t:t,isSep:false};case'm':return {b:b,e:e,i:i,l:0,min:1,max:12,t:t,isSep:false};case'y':return {b:b,e:e,i:i,l:0,min:1900,max:2900,t:t,isSep:false};case'h':return {b:b,e:e,i:i,l:0,min:0,max:23,t:t,isSep:false};case'n':return {b:b,e:e,i:i,l:0,min:0,max:59,t:t,isSep:false};case's':return {b:b,e:e,i:i,l:0,min:0,max:59,t:t,isSep:false};default:return {b:b,e:e,i:i,l:0,min:0,max:0,t:t,isSep:true}}}

/* cCombo {txt,val,cache,excEmpty,url,size,rTimeout} */
function cCombo(o){
   /* try{ */
        var T=this.TXT=(typeof(o.txt)=='string')?gEl(o.txt):o.txt;
        if(!T)return;T._S=this;
		if(_isIE()){
	        if(o.excFunc){
		        T.excFunc=o.excFunc;
		        T.onkeydown=function(e){e=(window.event||e);if(e.keyCode==13||e.keyCode==10){var O=this;window.setTimeout(function(){O.excFunc(O.value,'')},1);cEvent.stop(e);}};
	        };
	        return;
		};
        T.setAttribute('autocomplete','Off');
        var V=this.VAL=gEl(o.val);
        if(V){V._S=this};
        if(o.url){this._url=o.url};
        if(o.filterField!=null){this._FF=o.filterField};
        if(o.cache){
            this._C=[];
            /*this.Clng=(o.cache!==true&&!isNaN(o.cache))?Math.max(o.cache,0):100;*/
        };
        this.autoStuff=o.autoStuff;
        this._I=[];
        this._E=(o.excEmpty)?true:false;
        this._EF=o.excFunc;
        this._item=new cComboItem();
        this._D=false;
        this.size=(o.size!=null)?o.size:15;
        this.rTimeout=(o.rTimeout!=null)?o.rTimeout:10000;
        this.iSeld=null;
        this.aCrr=false;
        this.lastT='';this.lastK=gTime();this.lOver=false;this.cmbTxtUp();this.QH=[];var W=((T.offsetWidth||200)-(_isIE()?0:2))+'px';cDom.insB(this.lI=cDom.add('div',{Class:'oComboList',style:'width:'+W+';display:none;'}));this.lI._S=this._S=this;if(_isFixSel)cDom.insB(this.lIBg=cDom.add('iframe',{Class:'oComboList',style:'border:0px;width:'+W+';display:none;'}));
        T.onkeydown=this._onKDwn;
        T.onkeypress=this._onKPrs;
        /*cEvent.add(T,'keydown',this._onKDwn);
        cEvent.add(T,'keypress',this._onKPrs);*/
        T.onblur=this._onBlur;
        T.onresize=this.lIReS;
        T.onclick=this.lITggl;
        cEvent.add(T,_isIE()?'paste':'input',this._onPaste);
        this.lI.onclick=this._onLISel;
        this.lI.onmouseover=this._onLIOvr;
        if(!window.oCmbArr){
			window.oCmbArr=[];
			cEvent.add(null,'click',this.lIClsAll);
			cEvent.add(null,'keydown',function(e){
				try{
					if((e||event).keyCode==9){
						window.oCmbArr[0].lIClsAll()
					}
				}catch(e){};
				return true
			})
		};
		oCmbArr.push(this);
    /*}catch(e){};*/
    return this;}
cCombo.prototype.disable=function(B){var B=gBool(B);if(this._D==B)return;this.TXT.disabled=B;this._D=B;}
cCombo.prototype.readonly=function(B){this.TXT.readOnly=B?true:false;}
cCombo.prototype.values=function(){return {name:this.TXT.value,id:this.VAL.value};}
cCombo.prototype.focus=function(){this.TXT.focus();}
cCombo.prototype.cmbTxt=function(){return this.TXT.value;}
cCombo.prototype.cmbTxtLc=function(){return this.TXT.value.toLowerCase();}
cCombo.prototype.cmbTxtLcF=function(){var T=this.TXT.value.toLowerCase();var S=T.length;if(this.setSelectionRange){S=this.selectionStart;}else if(document.selection&&document.selection.createRange){var R=document.selection.createRange();b=0-R.duplicate().moveStart('character',-100000);};return T.substr(0,S);}
cCombo.prototype.cmbTxtUp=function(){this.text=this.TXT.value.toLowerCase();}
cCombo.prototype.cmbTxtUpd=function(T){this.TXT.value=T;}
cCombo.prototype.cmbTxtUpdSel=function(T,S,E){var O=this;if(O.QH.length)return;if(!T){T=O.cmbTxt()};var L=T.length;if((!S)||(!E)){S=L;E=L};O.TXT.value=T;O.focus();if(S<0||S>E||S>L){S=0};if(E>L){E=L};if(O.TXT.setSelectionRange){O.TXT.setSelectionRange(S,E)}else if(O.TXT.createTextRange){var R=O.TXT.createTextRange();R.moveStart('character',S);R.moveEnd('character',E-L);R.select();};}
cCombo.prototype._onLISel=function(e){
	cEvent.stop(e);
	var N=(_isIE()?event.srcElement:e.target);var O=this._S;while(!N._S){N=N.parentNode;if(!N)return;};var CHN=O.lI.childNodes;var I=0;for(I=0;I<CHN.length;I++){if(CHN[I]==N)break;};O.lISel(I);O.lIClsAll();O.focus();O.cmbTxtUpdSel();O.cmbTxtUp();}
cCombo.prototype._onLIOvr=function(e){cEvent.stop(e);var N =(_isIE()?event.srcElement:e.target);var O=this._S;if(O.lOver)return;if(N.parentNode==O.lI){O.lIUnSel();var CHN=O.lI.childNodes;var I=0;for(I=0;I<CHN.length;I++){if(CHN[I]==N)break;};this.aCrr=true;var z=O._I[I];O.iSeld=z;O.iSeld.select();}else{O.focus()}}
cCombo.prototype._onKPrs=function(e){
    e=(window.event||e);
    if(!e)return;
    var K=e.keyCode;
    if((K==13||K==10)){cEvent.stop(e);return false;}
}
cCombo.prototype._onKDwn=function(e){
    e=(window.event||e);
    var O=this._S;
    gt=gTime();
    if(gt-O.lastK<10)return;
    O.lastK=gt;
    var K=e.keyCode;
    if((K==13||K==10)){
        cEvent.stop(e);
    };
    if((K==13||K==10||K==27)&&(O.lIIsOpn())){
        O.lIClsAll();
        O.cmbTxtUpdSel();
        if(O._EF)O._EF(O.TXT.value,(O.VAL)?O.VAL.value:'',O.TXT);
        return false;
    };
    if(K==13&&O._EF){O._EF(O.TXT.value,(O.VAL)?O.VAL.value:'',O.TXT);return};
    if((K==13||K==10)&&(!O.lIIsOpn())){
        if(O.cmbTxt()!=''||O._E){
            O.aCrr=false;
            O.lIUnSel();
            O.lIOpn();
            O.lISelChk();
        };
        return false;
    };
    O.QH.push(K);
    window.setTimeout(function(){O._onKHndl(K)},1);
    return true;
}
cCombo.prototype._onPaste=function(e){var O=this._S||(event&&event.srcElement&&event.srcElement._S);gt=gTime();if(gt-O.lastK<10)return;O.lastK=gt;	O.QH.push(1);window.setTimeout(function(){O._onKHndl(1);},1);}
cCombo.prototype._onKHndl=function(K){
    var O=this;
    O.aCrr=false;
    t=O.text=O.cmbTxtLcF();
    O.QH.shift();
    if(!O.lIIsOpn()&&(t!=''||O._E)&&((K==9||(K>=16&&K<=27)||(K>=33&&K<=39)||K==44||(K>=91&&K<=93)||(K>=112&&K<=135)||K==144||K==145)))return;
    if(K==33){
        if(O.lIIsOpn()){
            if(O._I.length>0){
                O.lILock(true);
                O.aCrr=true;
                var _curIndex=O.iSelInd();
                if(_curIndex-O.size>=0){
                    O.lISel(_curIndex-O.size)
                }else{
                    O.lISel(0)
                };
                O.lILock(false);
            }
        }else{return};
    }else if(K==34){
        if(O.lIIsOpn()){
            if(O._I.length>0){
                O.lILock(true);
                O.aCrr=true;
                var I=O.iSelInd();
                if(I+O.size<O._I.length){
                    O.lISel(I+O.size);
                }else{
                    O.lISel(O._I.length-1);
                };
                O.lILock(false);
            }
        }else{
            return
        };
    }else if(K==38){
        O.lILock(true);
        O.lISelNxt(-1);
        O.lILock(false);
    }else if(K==40){
        if(O.lIIsOpn()){
            O.lILock(true);
            O.lISelNxt(1);
            O.lILock(false);
        }else{
            if(t!=''||O._E){
                O.lIOpn();
                O.lISelChk();
            };
            return
        }
    }else if(K==1||K==8||K==32||(K>=45&&K<=90)||(K>=96&&K<=111)||(K>=186&&K<=192)||(K>=219&&K<=222)){
        if((K==8)||(K==46)){
            O.aCrr=false
        }else{
            O.aCrr=O.autoStuff
        };
        if(!O.lIIsOpn()&&(t!=''||O._E)){
            O.lIClear();
            O.lIRdrw();
            O.lIReW();
            O.lIReH();
            O.lIOpn();
            return
        }else{
            O.lIRndr();
            return
        };
        for(var i=0;i<O._I.length;i++){
            if(O._I[i].data()[1].toLowerCase()==t){
                O.lISel(i);
                return
            }
        };
        O.lIUnSel();
    }else{
        return
    }
}
cCombo.prototype._onBlur=function(){
    var O=this._S;
    if(!O)return;
    var Z=O.iTxt(O.cmbTxtLc());
    if(O.VAL){O.VAL.value=Z?Z.value:0};
    O.cmbTxtUp();
}
cCombo.prototype.iTxt=function(T){var A=this._I;for(var I=0;I<A.length;I++){if(A[I].text.toLowerCase()==T){return A[I]}};return null}
cCombo.prototype.iSelInd=function(){var A=this._I;for(var i=0;i<A.length;i++){if(A[i]==this.iSeld){return i}};return -1;}
cCombo.prototype.iAdd=function(I){N=new cComboItem();this._I.push(N);N.setValue.apply(N,[I])}
cCombo.prototype.lILock=function(B){O=this;if(B){O.lOver=true}else{window.setTimeout(function(){O.lOver=false},1);}}
cCombo.prototype.lISel=function(I,F){
    var O=this;
    O.aCrr=true;
    O.lIUnSel();
    var Z=O._I[I];
    if(!Z)return;
    O.iSeld=Z;
    O.iSeld.select();
    var C=O.iSeld.content.offsetTop+O.iSeld.content.offsetHeight-O.lI.scrollTop-O.lI.offsetHeight+2;
    if(C>0){O.lI.scrollTop+=C};
    C=O.lI.scrollTop-O.iSeld.content.offsetTop;
    if(C>0){O.lI.scrollTop-=C};
    var D=O.iSeld.data();
    if(O.VAL){O.VAL.value=D[0]};
    if(F){
        var T=O.cmbTxtLc();
        if(T!=D[1].toLowerCase()){
            O.cmbTxtUpdSel(D[1],T.length,D[1].length)
        }
    }else{
        O.cmbTxtUpd(D[1])
    };
    O.iSeld.RdrwH(O)
}
cCombo.prototype.lIUnSel=function(){if(this.iSeld){this.iSeld.deselect()};this.iSeld=null}
cCombo.prototype.lISelCrct=function(){
    if(this.aCrr){
        var A=this._I;
        for(var I=0;I<A.length;I++){
            if(!A[I].isHidden()){
                return this.lISel(I,true)
            }
        }
    }
}
cCombo.prototype.lISelChk=function(){var A=this._I;for(var I=0;I<A.length;I++){if(!A[I].isHidden()){if(A[I].text.toLowerCase()==this.cmbTxtLc()){this.lISel(I,true)}}}}
cCombo.prototype.lISelNxt=function(S){var Z=this.iSelInd()+S;var A=this._I;while(A[Z]){if(!A[Z].isHidden()){return this.lISel(Z)};Z+=S}this.cmbTxtUp();}
cCombo.prototype.lIRdrw=function(){
	var L=this.lI;
	for(var I=L.childNodes.length-1;I>=0;I--){
		L.removeChild(L.childNodes[I])
	};
	var A=this._I;
	for(var I=0;I<A.length;I++){
		L.appendChild(A[I].item())
	}
}
cCombo.prototype.lIClear=function(){this._I=[]}
cCombo.prototype.lIRndr=function(){
    var O=this;
    if(O._D)return;
    /*var T=O.text;*/
    var T=O.cmbTxt();
    if(O._url){
        if(O.lastT==T.toLowerCase())return;
        O.lastT=T.toLowerCase();
        if(T==''&&!O._E){
            O.lIClear();
            O.lIRdrw();
            O.lIClsAll();
            O.lIReH();
            return
        };
        O.lILoad(T);
        return
    }else{
        var A=O._I;
        for(var i=0;i<A.length;i++){
            A[i].hide(A[i].text.toLowerCase().indexOf(T)!=0)
        };
        if(O.aCrr){
            if(O.autoStuff)O.lISelCrct()
        };
        return
    }
}
cCombo.prototype.fltrPre=function(){
	var _CN='';
	if(this._FF){
		for(var i=0;i<this._FF.length;i++){
			try{
				_CN+=this._FF[i].id+':'+gEl(this._FF[i].id).value+String.fromCharCode(0);
			}catch(e){};
		}
    };
    return _CN;
}
cCombo.prototype.fltrUrl=function(){
	var FU='';
	if(this._FF){
		for(var i=0;i<this._FF.length;i++){
			try{
				FU+='&'+this._FF[i].name+'='+escape(gEl(this._FF[i].id).value);
			}catch(e){};
		}
    };
    return FU;
}
cCombo.prototype.loading=function(b){}
cCombo.prototype.lILoad=function(T){
    var O=this;
    if(O.cmbTxtLc()!=T.toLowerCase())return;
    var url=O._url+((O._url.indexOf('?')!=-1)?'&':'?')+'mask='+escape(T)+O.fltrUrl();
    var gt=gTime();
    var _CN=O.fltrPre();
    if(O._C){
        if(O._C[_CN+T]&&O._C[_CN+T]._L){
            O.lIFill({o:O,_C:O._C[_CN+T]});
            return
        };
        if((T.length==0&&O._E)||(T.length==1)){
            var t=(T=='')?' ':T;
            if(O._C[_CN+t]){
                if(O._C[_CN+t]._L){
                    O.lIFill({o:O,_C:O._C[_CN+t]});
                    return;
                }else if((gt-O._C[_CN+t]._D)<=O.rTimeout){
                    return
                }else{
                    O._C[_CN+t]=null;
                    O.lIRqst(T);
                    return;
                }
            }else{
                O.lIRqst(T);
                return
            }
        }else{
            var uT='';
            var uC=null;
            /*var mL=Math.max(T.length-this.Clng,0);*/
            for(var i=T.length-1;i>0;i--){
                uT=T.substr(0,i);
                if(O._C[_CN+uT]){
                    uC=O._C[_CN+uT];
                    if(uC._L){
                        var _A=[];
                        var _a=uC._A;
                        for(var w=0;w<_a.length;w++){
                            if(_a[w].text.toLowerCase().indexOf(T)==0){
                                _A.push(_a[w])
                            }
                        };
                        O._C[_CN+T]={_A:_A,_D:(gTime()),_L:true};
                        O.lIFill({o:O,_C:O._C[_CN+T]});
                        return
                    }else{
                        if((gt-uC._D)<=O.rTimeout){
                            return
                        }else{
                            O._C[_CN+uT]=null;
                            O.lIRqst(T);
                            return
                        }
                    }
                }
            };
            O.lIRqst(T)
        }
    }else{
        O.lIRqst(T)
    }
}
cCombo.prototype.lIRqst=function(T){
    var O=this;
    var gt=gTime();
    var U=''+O._url+((O._url.indexOf('?')==-1)?'?':'&')+'mask='+escape(T)+O.fltrUrl()+((!O._C)?('&rnd='+gt):'');
    var _CN=O.fltrPre();
    O.lastR=U;
    O.loading(true);
    var t=(T==''&&O._E)?' ':T;
    if(O._C&&!O._C[_CN+t]){
        O._C[_CN+t]={_A:[],_D:gt,_L:false};
    };
    try{cAjax.get(U,{f:O.lIFill,o:O,p:U});}catch(e){};}
cCombo.prototype.lIFill=function(F){
    var O=F.o;
    var T=O.cmbTxtLcF();
    var _CN=O.fltrPre();
    if(F._C){
        O.lIClear();
        O.lIRdrw();
        for(var i=0;i<F._C._A.length;i++){
            O.iAdd(F._C._A[i])
        };
        O.lIRdrw();
        O.lIReW();
        O.lIReH();
        if(O.aCrr)O.lISelCrct();
    }else{
        var D=F.xml;
        var P=F.p.replace(/[?|&]{1}rnd=[\d]*$/i,'');
        if(O.lastR&&O.lastR==P)O.loading(false);
        var c=cDom.parse(D,'c');
        if(c.length==1&&c[0]['value']){
            var t=c[0]['value'].toLowerCase();
            var _R=(T==t);
            if(_R){
                O.lIClear();
                O.lIRdrw();
                O.lIReH();
            };
            var _a=cDom.parse(D,'o');
            for(var i=0;i<_a.length;i++){
                if(_R){O.iAdd(_a[i]);};
            };
            if(O._C){
                if(O._C[_CN+t]){
                    O._C[_CN+t]._A=_a;
                    O._C[_CN+t]._L=true;
                }else{
                    O._C[_CN+t]={_A:_a,_L:true,_D:gTime()};
                };
            };
            if(_R){
                O.lIRdrw();
                O.lIReW();
                O.lIReH();
                if(O.aCrr){O.lISelCrct();};
            }else{
                T=O.cmbTxtLc();
                var uT='';
                var uC=null;
                for(var i=T.length-1;i>0;i--){
                    uT=T.substr(0,i);
                    if(uT==t){
                        O.lIClear();
                        O.lIRdrw();
                        var j=-1;
                        var _A=[];
                        for(var w=0;w<_a.length;w++){
                            if(_a[w].text.toLowerCase().indexOf(T)==0){
                                _A.push(_a[w]);
                                O.iAdd(_a[w]);
                            };
                        };
                        if(!O._C)O._C=new Array();
                        O._C[_CN+T]={_A:_A,_L:true,_D:gTime()};
                        O.lIRdrw();
                        O.lIReW();
                        O.lIReH();
                        if(O.aCrr){
                            O.lISelCrct();
                        };
                        return;
                    };
                };
            };
        }else{
            return;
        };
    };
}
cCombo.prototype.lIClsAll=function(){if(window.oCmbArr){for(var i=0;i<oCmbArr.length;i++){var O=oCmbArr[i];if(O.lI.style.display=='block'){O.lI.style.display='none'};if(O.lIBg){O.lIBg.style.display='none'}}}}
cCombo.prototype.lICls=function(){this.lI.style.display='none';if(_isFixSel){this.lIBg.style.display='none'}}
cCombo.prototype.lIOpn=function(){var O=this;if(O._D)return;O.lIPos();O.lI.style.display='block';if(_isFixSel){O.lIBg.style.display='block'};O.lIRndr();O.lIReW();O.lIReH()}
cCombo.prototype.lIIsOpn=function(){return (this.lI.style.display=='block')}
cCombo.prototype.lITggl=function(e){var O=this._S;O.aCrr=false;cEvent.stop(e);if(O.lIIsOpn()){O.lICls()}else{if(O.cmbTxt()==''&&!O._E)return;O.lIUnSel();O.lIOpn();O.lISelChk()}}
cCombo.prototype.lIPos=function(){var P=cDom.pos(this.TXT);var T=(P.t+this.TXT.offsetHeight-1);cDom.stlS(this.lI,{top:T+'px',left:P.l+'px'});if(this.lIBg)cDom.stlS(this.lIBg,{top:T+'px',left:P.l+'px'});}
cCombo.prototype.lIReH=function(){var O=this;var I=O.lI.childNodes;if(I.length>0){var H=0;var S=I.length>O.size?O.size:I.length;O.lI.className='oComboList';for(var j=0;j<S;j++){H+=(I[j].offsetHeight||20);};H-=-(_isIE()?2:0);O.lI.style.height=H+'px';if(O.lIBg){O.lIBg.style.height=H+'px';if(O.lIIsOpn)O.lIBg.style.display='block';}}else{O.lI.style.height='0px';O.lI.className='oComboListEmpty';if(O.lIBg)O.lIBg.style.display='none';}}
cCombo.prototype.lIReW=function(){var W=((this.TXT.offsetWidth||200))-(_isIE()?0:2);this.lI.style.width=W+'px';if(this.lIBg)cDom.stlS(this.lIBg,{width:W+'px',left:this.lI.style.left});}
cCombo.prototype.lIReS=function(){var O=this._S;if(O.lIIsOpn()){O.lIPos();O.lIReW();O.lIReH();}}

cComboItem=function(){this.value=null;this.text='';this.selected=false;this.css='';}
cComboItem.prototype.select=function(){if(this.content){this.content.className='oComboItemSelected';}}
cComboItem.prototype.hide=function(m){this.item().style.display=m?'none':''}
cComboItem.prototype.isHidden=function(){return(this.item().style.display=='none')}
cComboItem.prototype.deselect=function(){if(this.content){this.item()};this.content.className='';}
cComboItem.prototype.setValue=function(attr){this.value=attr.value||'';this.text=attr.text||'';this.css=attr.css||'';this.content=null;}
cComboItem.prototype.item=function(){
	if(!this.content){
		this.content=cDom.add('div',{Class:'',style:'width:99.9%;overflow:hidden;'},this.text);
		this.content._S=this;
	};
	return this.content
}
cComboItem.prototype.data=function(){return [this.value,this.text]}
cComboItem.prototype.RdrwH=function(self){};


/*cGeoPnl*/
function cGeoPnl(elWrap,elPnl,elCountry,elRegion,elCity,elCountryVal,elRegionVal,elCityVal,elLat,elLon,elBtn,tMax,tMin){
	this.oCountry=gEl(elCountry);this.oRegion=gEl(elRegion);this.oCity=gEl(elCity);
	if(this.oCountry)this.oCountry._S=this;if(this.oRegion)this.oRegion._S=this;if(this.oCity)this.oCity._S=this;
	this.oCountryVal=gEl(elCountryVal);this.oRegionVal=gEl(elRegionVal);this.oCityVal=gEl(elCityVal);
	this.oLat=gEl(elLat);this.oLon=gEl(elLon);
	this.oBtn=gEl(elBtn);if(this.oBtn)this.oBtn._S=this;
	if(this.oCountry)cEvent.add(this.oCountry,'change',this.onCountry);
	if(this.oRegion)cEvent.add(this.oRegion,'change',this.onRegion);
	if(this.oCity)cEvent.add(this.oCity,'change',this.onCity);
	if(this.oBtn)cEvent.add(this.oBtn,'click',this.reloadGeo);
	var O=this;if(this.oCountry)window.setTimeout(function(){O.init()},1);
	this.startLat=this.lat=parseFloat(this.oLat&&this.oLat.value)?parseFloat(this.oLat.value):0;
	this.startLon=this.lon=parseFloat(this.oLon&&this.oLon.value)?parseFloat(this.oLon.value):0;
	if(this.lat==0||this.lon==0){
		this.latMax=50;this.latMin=-50;this.lonMax=100;this.lonMin=-100;this.coordT=0
	}else{
		this.latMax=this.lat+0.1;this.latMin=this.lat-0.1;this.lonMax=this.lon+0.1;this.lonMin=this.lon-0.1;this.coordT=1
	};
	if(!gEl(elPnl)||!gEl(elWrap)){if(this.oBtn){this.oBtn.style.display='none'};return};
	if(!GBrowserIsCompatible()&&gEl(elPnl)){gEl(elPnl).innerHTML="map error";if(this.oBtn){this.oBtn.style.display='none'};return};
	this.mc=new cMap({pnlwrap:elWrap,pnlmap:elPnl,cntlMap:{small:true},cntlType:true,cntlOverview:false,cntlMaxMin:{tMax:tMax,tMin:tMin},showHideMouseOver:true});
	this.map=this.mc.map;this.map.cPnl=gEl(elPnl);this.map._S=this;this.map.maxZoom=13;
	this.startZoom=this.map.getBoundsZoomLevel(new GLatLngBounds(new GLatLng(this.latMin,this.lonMin),new GLatLng(this.latMax,this.lonMax)));
	if(this.startZoom<=3){if(this.lat==0&&this.lon==0){this.startZoom=3}else{this.startZoom=10}};
	this.map.setCenter(new GLatLng(this.lat,this.lon),this.startZoom,G_NORMAL_MAP);
	this.map.enableScrollWheelZoom();
	this.Mrk=new GMarker(new GLatLng(this.lat,this.lon),{draggable:(this.oLat&&this.oLon)});
	this.Mrk._S=this;
	if(this.oLat&&this.oLon)GEvent.addListener(this.Mrk,'dragend',this.onPoint);
	GEvent.addListener(this.Mrk,'click',function(){var p=this.getPoint();this.openInfoWindowHtml('Coordinates: ' + Math.round(p.lat()*1000000)/1000000+'; '+Math.round(p.lng()*1000000)/1000000+'<br/>['+cCoord.DMS(p.lat(),'N','S')+' '+cCoord.DMS(p.lng(),'E','W')+']')});
	this.map.addOverlay(this.Mrk);
	this.map.CentralMarker=this.Mrk;
}
cGeoPnl.prototype.onPoint=function(lat,lon){var p=this.getPoint();var O=(this._S)?this._S:this;O.lat=p.lat();O.lon=p.lng();O.savePoint();}
cGeoPnl.prototype.savePoint=function(){if(this.map){this.oLat.value=this.lat;this.oLon.value=this.lon;}}
cGeoPnl.prototype.addMarker=function(title,lat,lon){this.Mrk=new GMarker(new GLatLng(lat,lon),{draggable:true,title:title});this.Mrk._S=this;this.map.addOverlay(this.Mrk);this.map.setCenter(new GLatLng(lat,lon),this.map.getBoundsZoomLevel(new GLatLngBounds(new GLatLng(lat-.1,lon-.1),new GLatLng(lat+.1,lon+.1))),G_NORMAL_MAP);}
cGeoPnl.prototype.setCompany=function(company){if(this.value)company=this.value;if(company=='00000000-0000-0000-0000-000000000000')return;var O=(this._S)?this._S:this;cAjax.get('/ajax/company/get/?company='+company,{f:O.fillCompany,o:O});}
cGeoPnl.prototype.fillCompany=function(F){var O=F.o;var o=eval("("+F.text+")");if(o.country)O.oCountryVal.value=o.country;if(o.region)O.oRegionVal.value=o.region;if(o.city)O.oCityVal.value=o.city;window.setTimeout(function(){O.init()},1);if(o.lat&&parseFloat(o.lat)!=NaN && o.lon&&parseFloat(o.lon)!=NaN){O.lat=parseFloat(o.lat);O.lon=parseFloat(o.lon);if(o.latMax&&parseFloat(o.latMax)!=NaN)O.latMax=parseFloat(o.latMax);if(o.latMin&&parseFloat(o.latMin)!=NaN)O.latMin=parseFloat(o.latMin);if(o.lonMax&&parseFloat(o.lonMax)!=NaN)O.lonMax=parseFloat(o.lonMax);if(o.lonMin&&parseFloat(o.lonMin)!=NaN)O.lonMin=parseFloat(o.lonMin);};if(O.map)O.map.setCenter(new GLatLng(O.lat,O.lon),O.map.getBoundsZoomLevel(new GLatLngBounds(new GLatLng(O.latMin,O.lonMin),new GLatLng(O.latMax,O.lonMax))),G_NORMAL_MAP);if(O.Mrk)O.Mrk.setPoint(new GLatLng(O.lat,O.lon));O.savePoint();}
cGeoPnl.prototype.reloadGeo=function(){var O=(this._S)?this._S:this;if(!O.oCountryVal){e=(window.event||e);O=((e.target)?e.target:e.srcElement)._S};cAjax.get('/ajax/georange/?country='+O.oCountry.value+'&region='+O.oRegion.value+'&city='+O.oCity.value,{f:O.fillGeo,o:O});}
cGeoPnl.prototype.fillGeo=function(F){var O=F.o;var o=eval("("+F.text+")");if(parseFloat(o.lat)!=NaN)O.lat=parseFloat(o.lat);if(parseFloat(o.lon)!=NaN)O.lon=parseFloat(o.lon);if(parseFloat(o.latMax)!=NaN&&parseFloat(o.latMin)!=NaN&&parseFloat(o.lonMax)!=NaN&&parseFloat(o.lonMin)!=NaN){O.latMax=parseFloat(o.latMax);O.latMin=parseFloat(o.latMin);O.lonMax=parseFloat(o.lonMax);O.lonMin=parseFloat(o.lonMin);}else{O.latMax=O.lat+0.1;O.latMin=O.lat-0.1;O.lonMax=O.lon+0.1;O.lonMin=O.lon-0.1};if(O.map){var _zoom=O.map.getBoundsZoomLevel(new GLatLngBounds(new GLatLng(O.latMin,O.lonMin),new GLatLng(O.latMax,O.lonMax)));if(_zoom>O.map.maxZoom)_zoom=O.map.maxZoom;O.map.setCenter(new GLatLng(O.lat,O.lon),_zoom)};if(O.Mrk){O.Mrk.setPoint(new GLatLng(O.lat+0.01*(0.5-Math.random()),O.lon+0.01*(0.5-Math.random())))};O.savePoint()}
cGeoPnl.prototype.reloadMap=function(){if(this.map)this.map.setCenter(new GLatLng(this.lat,this.lon),this.map.getBoundsZoomLevel(new GLatLngBounds(new GLatLng(this.latMin,this.lonMin),new GLatLng(this.latMax,this.lonMax))),G_NORMAL_MAP);if(this.Mrk)this.Mrk.setPoint(new GLatLng(this.lat,this.lon));}
cGeoPnl.prototype.init=function(){var O=(this._S)?this._S:this;O.initMe=true;try{if(window.cCntr){O.dropCountry();for(var i=0;i<cCntr.length;i++){var _a=cCntr[i];O.oCountry.options[O.oCountry.options.length]=new Option(_a.t,_a.v);if(O.oCountryVal.value==_a.v)O.oCountry.options[O.oCountry.options.length-1].selected=true}}else{O.oCountry.options.length=0;cAjax.get('/ajax/country/',{f:O.fillCountry,o:O});O.initMe=false;return};if(window.cRgn&&window.cRgn[O.oCountryVal.value]){O.dropRegion();for(var i=0;i<cRgn[O.oCountryVal.value].length;i++){var _a=cRgn[O.oCountryVal.value][i];O.oRegion.options[O.oRegion.options.length]=new Option(_a.t,_a.v);if(O.oRegionVal.value==_a.v)O.oRegion.options[O.oRegion.options.length-1].selected=true}}else{O.initMe=false;O.onCountry();return};if(window.cCt&&window.cCt[O.oRegionVal.value]){O.dropCity();for(var i=0;i<cCt[O.oRegionVal.value].length;i++){var _a=cCt[O.oRegionVal.value][i];O.oCity.options[O.oCity.options.length]=new Option(_a.t,_a.v);if(O.oCityVal.value==_a.v)O.oCity.options[O.oCity.options.length-1].selected=true}}else{O.initMe=false;O.onRegion();return}}catch(ex){};O.initMe=false;}
cGeoPnl.prototype.dropCountry=function(){this.oRegion.options.length=0;this.oRegion.options[this.oRegion.options.length]=new Option('','00000000-0000-0000-0000-000000000000');}
cGeoPnl.prototype.fillCountry=function(F){var O=F.o;O.dropCountry();var D=F.xml;var c=cDom.parse(D,'c');if(c.length==1){if(!window.cCntr)window.cCntr=[];var _a=cDom.parse(D,'o');for(var i=0;i<_a.length;i++){O.oCountry.options[O.oCountry.options.length]=new Option(_a[i].text,_a[i].value);window.cCntr.push({t:_a[i].text,v:_a[i].value});if(O.oCountryVal.value==_a[i].value)O.oCountry.options[O.oCountry.options.length-1].selected=true}};O.onRegion();}
cGeoPnl.prototype.onCountry=function(e){var O=(this._S)?this._S:this;if(!O.oCountryVal){e=(window.event||e);O=((e.target)?e.target:e.srcElement)._S};if(O.initMe)return;O.oCountryVal.value=O.oCountry.value;O.dropRegion();O.oRegion.disabled=true;O.dropCity();O.oCity.disabled=true;if(O.oCountry.value!='00000000-0000-0000-0000-000000000000'){if(window.cRgn&&window.cRgn[O.oCountry.value]){for(var i=0;i<cRgn[O.oCountry.value].length;i++){var _a=cRgn[O.oCountry.value][i];O.oRegion.options[O.oRegion.options.length]=new Option(_a.t,_a.v);if(O.oRegionVal.value==_a.v)O.oRegion.options[O.oRegion.options.length-1].selected=true;};O.oRegionVal.value=O.oRegion.value;O.oRegion.disabled=false;O.onRegion();}else{cAjax.get('/ajax/region/?country='+O.oCountry.value,{f:O.fillRegion,o:O,tV:O.oCountry.value})}}else{O.oRegionVal.value=O.oRegion.value;O.oRegion.disabled=false;}}
cGeoPnl.prototype.dropRegion=function(){this.oRegion.options.length=0;this.oRegion.options[this.oRegion.options.length]=new Option('','00000000-0000-0000-0000-000000000000');}
cGeoPnl.prototype.fillRegion=function(F){var O=F.o;O.dropRegion();O.dropCity();var D=F.xml;var c=cDom.parse(D,'c');if(c.length==1){if(!window.cRgn)window.cRgn=[];if(!window.cRgn[F.tV])window.cRgn[F.tV]=[];var _a=cDom.parse(D,'o');for(var i=0;i<_a.length;i++){O.oRegion.options[O.oRegion.options.length]=new Option(_a[i].text,_a[i].value);window.cRgn[F.tV].push({t:_a[i].text,v:_a[i].value});if(O.oRegionVal.value==_a[i].value)O.oRegion.options[O.oRegion.options.length-1].selected=true}};O.oRegionVal.value=O.oRegion.value;O.oRegion.disabled=false;O.onRegion();}
cGeoPnl.prototype.onRegion=function(){var O=(this._S)?this._S:this;if(!O.oCountryVal){e=(window.event||e);O=((e.target)?e.target:e.srcElement)._S};if(O.initMe)return;O.oRegionVal.value=O.oRegion.value;O.oCity.disabled=true;O.dropCity();O.oCity.disabled=true;if(O.oRegion.value!='00000000-0000-0000-0000-000000000000'){if(window.cCt&&window.cCt[O.oRegion.value]){for(var i=0;i<cCt[O.oRegion.value].length;i++){var _a=cCt[O.oRegion.value][i];O.oCity.options[O.oCity.options.length]=new Option(_a.t,_a.v);if(O.oCity.value==_a.v)O.oCity.options[O.oCity.options.length-1].selected=true;};O.oCityVal.value=O.oCity.value;O.oCity.disabled=false;O.onCity();}else{cAjax.get('/ajax/city/?country='+O.oCountry.value+'&region='+O.oRegion.value,{f:O.fillCity,o:O,tV:O.oRegion.value})}}else{O.oCityVal.value=O.oCity.value;O.oCity.disabled=false}}
cGeoPnl.prototype.dropCity=function(){this.oCity.options.length=0;this.oCity.options[this.oCity.options.length]=new Option('','00000000-0000-0000-0000-000000000000');}
cGeoPnl.prototype.fillCity=function(F){var O=F.o;O.dropCity();O.oCity.disabled=true;var D=F.xml;var c=cDom.parse(D,'c');if(c.length==1){var _a=cDom.parse(D,'o');if(!window.cCt)window.cCt=[];if(!window.cCt[F.tV])window.cCt[F.tV]=[];for(var i=0;i<_a.length;i++){O.oCity.options[O.oCity.options.length]=new Option(_a[i].text,_a[i].value);window.cCt[F.tV].push({t:_a[i].text,v:_a[i].value});if(O.oCityVal.value==_a[i].value)O.oCity.options[O.oCity.options.length-1].selected=true}};O.oCityVal.value=O.oCity.value;O.oCity.disabled=false;}
cGeoPnl.prototype.onCity=function(){var O=(this._S)?this._S:this;if(!O.oCountryVal){e=(window.event||e);O=((e.target)?e.target:e.srcElement)._S};if(O.initMe)return;O.oCityVal.value=O.oCity.value;}

/*cLang {txt,type,delay,shadow,xshadow,yshadow}*/
var c_dLangType=0;
function charCodeToLng(K){if((K>=65&&K<=90)||(K>=65&&K<=90)||(K>=97&&K<=122)){return 'en'}else if(K==1025||(K>=1040&&K<=1105)){return 'ru'}else{return ''}}
function cLang(o){try{TXT=this.TXT=gEl(o.txt);if(!TXT)return;TXT._S=this;this.type=(o.type!=null)?((o.type==1||o.type=='ico')?1:0):c_dLangType;this.delay=(o.delay&&!isNaN(o.delay))?o.delay*1000:2000;this.isSh=(o.shadow!=null)?o.shadow:true;this.xSh=o.xshadow?o.xshadow:2;this.ySh=o.yshadow?o.yshadow:2;if(this.type==1){cDom.insB(this.lng=cDom.add('span',{id:'lng',Class:'lng',style:'display:none;'},this.lngel=cDom.add('input',{type:'button'})))}else{cDom.insB(this.lng=cDom.add('span',{id:'lng',Class:'ttInfo',style:'display:none;'}))};if(this.isSh){cDom.insB(this.ttSh=cDom.add('div',{Class:'ttSh shadow',style:'display:none;'}))};cEvent.add(this.TXT,'keypress',this.onKey)}catch(e){};return this}
cLang.prototype.onKey=function(e){e=e||window.event;var O=this._S||(e&&e.srcElement&&e.srcElement._S);if(!O.TXT)return;	var K=e.charCode||e.keyCode||e.which||1;window.setTimeout(function(){O.onLng(K)},1)}
cLang.prototype.onLng=function(k){var gt=gTime();if(k==1){if(this.last&&((this.last||0)+this.delay<=gt))this.hide()}else{this.last=gt;var l=charCodeToLng(k);if(l==''){this.hide();return}else{this.show(l)};var O=this;window.setTimeout(function(){O.onLng(1)},this.delay+100)}}
cLang.prototype.show=function(l){try{if(this.type==1){this.lngel.className=l}else if(this.type==0){this.lng.innerHTML=l};if(this.lng.style.display!='block'){var P=cDom.pos(this.TXT);if(P){this.lng.style.display='block';var L=P.l-8+this.TXT.offsetWidth;var T=P.t+4-this.lng.offsetHeight;cDom.stlS(this.lng,{left:L+'px',top:T+'px'});if(this.ttSh)cDom.stlS(this.ttSh,{display:'block',left:L+this.xSh*2+'px',top:T+this.ySh*2+'px',width:this.lng.offsetWidth-this.xSh+'px',height:this.lng.offsetHeight-this.ySh+'px'})}}else if(this.ttSh){cDom.stlS(this.ttSh,{width:this.lng.offsetWidth-this.xSh+'px',height:this.lng.offsetHeight-this.ySh+'px'})}}catch(e){}}
cLang.prototype.hide=function(){this.lng.style.display='none';if(this.ttSh)this.ttSh.style.display='none'}


/*cText {txt,vld,fClr,mInfo,mOk,mErr,shadow,xshadow,yshadow,delay,rTimeout,url,rRslt}*/
c_aEmailRslt={rqst:{m:'экспресc проверка.'},free:{m:'OK'},lock:{m:'такая почта уже занята!',a:true},wait:{m:''},tout:{m:'экспресc проверка прервана.<br/>сервер не ответил.',a:true}};
c_aLoginRslt={rqst:{m:'экспресc проверка.'},False:{m:'OK'},True:{m:'такой логин уже занят!',a:true},wait:{m:''},tout:{m:'экспресc проверка прервана.<br/>сервер не ответил.',a:true}};
function cText(o){try{TXT=this.TXT=gEl(o.txt);this.TXT._S=this;this.fClr=(o.fClr)?o.fClr:false;this.text=null;this.mInfo=(o.mInfo)?o.mInfo:'';this.mOk=(o.mOk)?o.mOk:'';this.mErr=(o.mErr)?o.mErr:'';this.isSh=(o.shadow!=null)?o.shadow:true;this.xSh=o.xshadow?o.xshadow:2;this.ySh=o.yshadow?o.yshadow:2;this.url=o.url?o.url:'';this._R=o.rRslt?o.rRslt:{};this.delay=(o.delay&&!isNaN(o.delay))?o.delay*1000:0;this.rTimeout=(o.rTimeout&&!isNaN(o.rTimeout))?o.rTimeout*1000:10000;if(o.vld&&o.vld!=''){this.rgxp=new RegExp(o.vld);this.isVld=true;}else{this.isVld=false;};this.rgxp=(o.vld&&o.vld!='')?(new RegExp(o.vld)):(new RegExp(/(.)*/));cDom.insB(this.tt=cDom.add('span',{Class:'ttInfo',style:'display:none;'},this.lngel=cDom.add('input',{type:'button'})));if(this.isSh){cDom.insB(this.ttSh=cDom.add('div',{Class:'ttSh shadow',style:'display:none;'}));};this._L=false;this._LT='';this._LTD=gTime();this._C=[];cEvent.add(this.TXT,'keypress',this.onEvnt);cEvent.add(this.TXT,_isIE()?'paste':'input',this.onEvnt);cEvent.add(this.TXT,'focus',this.onEvnt);cEvent.add(this.TXT,'blur',this.onEvnt);}catch(e){};return this}
cText.prototype.onEvnt=function(e){e=e||window.event;var O=(this._S)||(event&&event.srcElement&&event.srcElement._S);if(!O.TXT)return;if(e.type=='blur'){window.setTimeout(function(){O.hide()},200);return};window.setTimeout(function(){O.draw()},1)}
cText.prototype.draw=function(){if(!this.TXT)return;var T=this.TXT.value;var gt=gTime();if(this._LT==T&&((this._LTD||1)+100>gt))return;this._LT=T;this._LTD=gt;if(this.text&&this.text==T&&this.tt.innerHTML!=''){this.text=T;this.show();this.autohide();return};if(!this.isVld&&this.mInfo!=''){this.render(this.mInfo)}else{if(this.rgxp.test(T)){if(this.fClr)this.TXT.className='';if(this.url&&this.url!=''&&T!=''){var M='';if(this._R['rqst']){M=this._R['rqst'].m;this.render(M)};if(this._C[T]){this._L=true;this.urlRslt({o:this,text:this._C[T]})}else{cAjax.get(this.url+((this.url.indexOf('?')!=-1)?'&':'?')+escape(T),{f:this.urlRslt,o:this});this._L=true;this._LR=gTime();var O=this;if(M!='')window.setTimeout(function(){O.loading(M)},1000)}}else{this.render(this.mOk)}}else{if(this.fClr)this.TXT.className='atn';this.render(this.mErr)}}}
cText.prototype.isValid=function(T){if(!this.isVld)return true;var T=T?T:this.TXT.value;return this.rgxp.test(T)}
cText.prototype.focus=function(){this.TXT.focus()}
cText.prototype.loading=function(M){if(!this._L)return;if((this._LR||1)+this.rTimeout<gTime()){this._L=false;if(this._R['tout']){this.tt.innerHTML=this._R['tout'].m;this.show()}else{this.hide()};return};M+='.';this.tt.innerHTML=M;this.show();var O=this;window.setTimeout(function(){O.loading(M)},1000)}
cText.prototype.urlRslt=function(o){if(!o||!o.text){if(o&&o.o){if(!o.o._L)return;o.o._L=false;if(o.o._R['error'])o.o.render(o.o._R['error'])}return}else{var O=o.o;var R=o.text;if(R.lastIndexOf(":")<0)return;var rs=R.substr(0,R.lastIndexOf(":"));if(O.TXT.value!=rs)return;O._C[rs]=R;if(!O._L)return;O._L=false;var rv=R.substr(Math.min(R.lastIndexOf(":")+1,R.length-1));if(O._R[rv]){if(O._R[rv].a)O.TXT.className='atn';O.render(O._R[rv].m)}}}
cText.prototype.render=function(M){var gt=gTime();if(M==null){if((this.last||1)+this.delay<=gt){this.hide()}}else if(M==''){this.hide()}else{this.last=gt;this.tt.innerHTML=M;this.show();this.autohide()}}
cText.prototype.show=function(){if(!this.TXT||!this.tt)return;var P=cDom.pos(this.TXT);if(!P)return;this.tt.style.display='block';var L=P.l-8+this.TXT.offsetWidth;var T=P.t+4-this.tt.offsetHeight;cDom.stlS(this.tt,{left:L+'px',top:T+'px'});if(this.ttSh)cDom.stlS(this.ttSh,{left:L+this.xSh*2+'px',top:T+this.ySh*2+'px',width:this.tt.offsetWidth-this.xSh+'px',height:this.tt.offsetHeight-this.ySh+'px',display:'block'})}
cText.prototype.hide=function(){var O=this._S?this._S:this;if(O.tt)O.tt.style.display='none';if(O.ttSh)O.ttSh.style.display='none'}
cText.prototype.autohide=function(){O=this;if(O.delay>0)window.setTimeout(function(){O.render()},O.delay+100)}

/*cCheck*/
function cCheck(o){try{btn=this.btn=gEl(o.btn);this.btn._S=this;this.vld=o.vld;this.url=o.ajax.url?o.ajax.url:'';this._R=o.ajax.response?o.ajax.response:{};this._L=false;this._LT='';this._LTD=gTime();this._C=[];this.delay=(o.delay&&!isNaN(o.delay))?o.delay*1000:0;this.rTimeout=(o.rTimeout&&!isNaN(o.rTimeout))?o.rTimeout*1000:10000;this.btn.onclick=this.onEvnt;this.btn.onkeypress=this.onKey;this._S=this;}catch(e){};return this}
cCheck.prototype.onInit=function(){if(gEl(this.vld)){this.vld=gEl(this.vld);this.rgxp=new RegExp(this.vld.validationexpression);this.txt=gEl(this.vld.controltovalidate);this.init=true;}}
cCheck.prototype.btnEnabled=function(b){this.btn.disabled=(b===false)?true:false;}
cCheck.prototype.onKey=function(e){if((e||event).keyCode&&(e||event).keyCode==13){return this._S.onEvent(e)}}
cCheck.prototype.onEvnt=function(e){e=e||window.event;cEvent.cancel(e);var O=(this._S)||(event&&event.srcElement&&event.srcElement._S);if(!O.init){O.onInit();if(!O.init)return;};window.setTimeout(function(){O.onCheck()},100);return false;}
cCheck.prototype.onCheck=function(){if(!this.txt||!this.btn)return;var T=this.txt.value;var gt=gTime();this._LT=T;this._LTD=gt;if(this.rgxp.test(T)){if(this.url&&this.url!=''&&T!=''){var M='';var C='';if(this._R['request']){M=this._R['request'].m;C=this._R['request'].c;this.render(M,C)};if(this._C[T]){this._L=true;this.urlRslt({o:this,text:this._C[T]})}else{cAjax.get(this.url+((this.url.indexOf('?')!=-1)?'&':'?')+escape(T),{f:this.urlRslt,o:this});this._L=true;this._LR=gTime();var O=this;if(M!='')window.setTimeout(function(){O.loading(M,C)},1000);this.btn.disabled=true;};}else{this.renderError();}}else{this.renderError();}}
cCheck.prototype.renderError=function(){this.render((this.vld.errormessage)?this.vld.errormessage:'');this.focus();}
cCheck.prototype.render=function(M,C){var gt=gTime();if(M&&M!=''){this.vld.innerHTML=M;this.vld.style.display='inline';this.vld.style.color=(C)?C:'Red';}else{this.vld.innerHTML=this.vld.errormessage;this.vld.style.display='none';this.vld.style.color=(C)?C:'Red';}}
cCheck.prototype.focus=function(){this.txt.focus()}
cCheck.prototype.loading=function(M,C){if(!this._L)return;if((this._LR||1)+this.rTimeout<gTime()){this._L=false;if(this._R['timeout']){this.render(this._R['timeout'].m,this._R['timeout'].c);}else{this.render();};this.btn.disabled=false;return;};M+='.';this.render(M,C);var O=this;window.setTimeout(function(){O.loading(M,C)},1000);}
cCheck.prototype.urlRslt=function(o){if(o&&o.o&&o.o.btnEnabled)o.o.btn.disabled=false;if(!o||!o.text){if(o&&o.o){if(!o.o._L)return;o.o._L=false;if(o.o._R['error']){o.o.render(o.o._R['error'].m,(o.o._R['error'].c)?o.o._R['error'].c:null);}else{o.o.renderError();}}return}else{var O=o.o;var R=o.text;if(R.lastIndexOf(":")<0)return;var rs=R.substr(0,R.lastIndexOf(":"));if(O.txt.value!=rs)return;O._C[rs]=R;if(!O._L)return;O._L=false;var rv=R.substr(Math.min(R.lastIndexOf(":")+1,R.length-1));if(O._R[rv]){if(O._R[rv].s)O._C[rs]=null;O.render(O._R[rv].m,(O._R[rv].c)?O._R[rv].c:null);}};}

/*cTextarea {txt,msg,max,lock,txtLeft}*/
function cTextarea(o){try{TXT=this.TXT=gEl(o.txt);if(!TXT)return;this.MSG=gEl(o.msg);TXT._S=this.MSG._S=this;this._M=(o.max>0?o.max:1);this._L=gBool(o.lock);this.txtLeft=(o.txtLeft)?o.txtLeft:'';this._MSG=this.MSG.innerHTML;this._LTD=gTime();cEvent.add(TXT,'keydown',this.onEvent);cEvent.add(TXT,_isIE()?'paste':'input',this.onEvent);cEvent.add(TXT,'change',this.onEvent);cEvent.add(TXT,'blur',this.onEvent);this.render()}catch(e){};return this}
cTextarea.prototype.pos=function(){var T=this.TXT;if(T){var V=T.value;var L=V.length;if(typeof(T.selectionStart)=='number'){return T.selectionEnd}else if(document.selection){var R=document.selection.createRange();if(R.parentElement()!=T)return L;var TR=document.body.createTextRange();TR.moveToElementText(T);var E=0;for(E=0;TR.compareEndPoints('StartToEnd',R)<0;E++){TR.moveStart('character',1)};for(var i=0;i<=E;i++){if(V.charAt(i)=='\n')E++;};return E}else{return L}};return 0}
cTextarea.prototype.onEvent=function(e){var O=this._S||(event&&event.srcElement&&event.srcElement._S);if(!O.TXT)return;window.setTimeout(function(){O.render()},1)}
cTextarea.prototype.render=function(){var O=this.TXT;var T=O.value;var gt=gTime();if(this._LT==T&&((this._LTD||1)+10>gt))return;this._LT=T;this._LTD=gt;var L=T.length;var M=this._M;var P=L/M*100;if(L==0){this.MSG.innerHTML=this._MSG}else if(this._L&&L>M){if(this.txtLeft!=''){this.MSG.innerHTML=this._MSG+' ['+this.txtLeft+': 0]';}else{this.MSG.innerHTML=this._MSG+' [0]';};var B=this.pos();if(O.setSelectionRange){if(B>L-M){O.value=T.substr(0,B-L+M)+T.substr(B,T.length);O.setSelectionRange(B-L+M,B-L+M);}else{O.value=T.substr(L-M,M);O.setSelectionRange(0,0)}}else if(O.createTextRange){if(B>L-M){O.value=T.substr(0,B-L+M)+T.substr(B,T.length);T=O.value;B=B-L+M;for(var i=0;i<T.length&&i<=B+1;i++){if(T.charAt(i)=='\n')B--;};var R=O.createTextRange();R.moveStart('character',B);R.collapse();R.select();}else{O.value=T.substr(L-M,M);var R=O.createTextRange();R.moveStart('character',0);R.collapse();R.select();}}else{O.value=T.substr(0,M)}}else{if(this.txtLeft!=''){this.MSG.innerHTML=this._MSG+' ['+this.txtLeft+': '+(M-L)+']';}else{this.MSG.innerHTML=this._MSG+' ['+(M-L)+']';}}}

/*cResizeArea {el}*/
function cResizeArea(o){try{
	EL=this.EL=gEl(o.el);if(!EL)return;EL._S=this;
	this.Rem=o.rem;
	if(EL){cDom.stlS(EL,'margin-bottom:0px;')}
	this.pnlResize=cDom.add('div',{Style:'width:0px;height:7px;cursor:s-resize;background:#f1f1f1 url(/image/resizev.gif) no-repeat center top;overflow:hidden;margin:0px;padding:0px;border:0px;'});
	this.pnlResize._S=this;
	var prntN=EL.parentNode;
	var nextN=null;
	var thisNext=false;
	for(var i=0;i<prntN.childNodes.length;i++){
		if(thisNext){
			nextN=prntN.childNodes[i];
			i=prntN.childNodes.length
		}else{
			if(prntN.childNodes[i]==EL)thisNext=true
		}
	};
	if(nextN!=null){
		cDom.insB(this.pnlResize,EL.parentNode,nextN)
	}else{
		cDom.app(this.pnlResize,EL.parentNode)
	};
	if(this.Rem){var h=cCookie.Get(this.EL.id);if(!isNaN(h)&&h>0&&h<2000)this.EL.style.height=h+'px'};cEvent.add(this.pnlResize,'mousedown',this.pnlResizeOn);var O=this;window.setTimeout(function(){O.ReWidth()},100)}catch(e){};return this}
cResizeArea.prototype.ReWidth=function(){if(this.EL.offsetWidth){this.pnlResize.style.width=parseInt(this.EL.offsetWidth)+'px';}else if(this.EL.style.width){this.pnlResize.style.width=this.EL.style.width;var O=this;window.setTimeout(function(){O.ReWidth()},1000);}else{var O=this;window.setTimeout(function(){O.ReWidth()},1000)}}
cResizeArea.prototype.pnlResizeOn=function(e){var T=this._S||(event&&event.srcElement&&event.srcElement._S);window.pnlRsz=T;cEvent.add(document.body,'mousemove',T.pnlResizeTo);cEvent.add(document.body,'mouseup',T.pnlResizeOff);document.body.style.cursor='s-resize';T.Sts={y:e.screenY,h:T.EL.offsetHeight,yd:null};cEvent.cancel((e||event));}
cResizeArea.prototype.pnlResizeTo=function(e){var T=window.pnlRsz;if(!T)return;T.Sts.yd=e.screenY-T.Sts.y;if(T.EL)T.EL.style.height=(T.Sts.h+T.Sts.yd)+'px';if(T.rng){try{T.rng.empty();}catch(ex){};}else{try{T.rng =document.selection;}catch(ex){}};cEvent.cancel((e||event));}
cResizeArea.prototype.pnlResizeOff=function(e){var T=window.pnlRsz;if(!T)return;cEvent.del(document.body,'mousemove',T.pnlResizeTo);cEvent.del(document.body,'mouseup',T.pnlResizeOff);document.body.style.cursor='default';window.pnlRsz=null;if(T.Sts.yd===null)return;var h=T.Sts.h+T.Sts.yd;if(T.Rem)cCookie.Set(T.EL.id,h);T.EL.style.height=h+'px';cEvent.cancel((e||event));}

/* Geo line selection */
cGeoLineSel=function(o){
	this.pnl=gEl(o.pnl);
	this.url=o.url;
	this.txtReload=o.txtReload;
	this.txtCountryAll=o.txtCountryAll;
	this.txtRegionAll=o.txtRegionAll;
	this.txtCityAll=o.txtCityAll;
	this.oCountry=gEl(o.valCountry);
	this.oRegion=gEl(o.valRegion);
	this.oCity=gEl(o.valCity);
	this.dCountry=o.defCountry?o.defCountry:nGUID;
	this.dRegion=o.defRegion?o.defRegion:nGUID;
	this.dCity=o.defCity?o.defCity:nGUID;
	this.urlContry=o.ajax.urlContry?o.ajax.urlContry:'';
	this.urlRegion=o.ajax.urlRegion?o.ajax.urlRegion:'';
	this.urlCity=o.ajax.urlCity?o.ajax.urlCity:'';
	this.rspns=o.ajax.response?o.ajax.response:{};
	this.rTimeout=(o.ajax.timeout&&!isNaN(o.ajax.timeout))?o.ajax.timeout*1000:10000;
	if(!window.geoCache)window.geoCache=[];
	this.pnl.innerHTML='';
	cDom.app(this.img=cDom.add('img',{src:'',Class:'flug16',style:'display:none;'}),this.pnl);
	cDom.app(this.spanCountry=cDom.add('span',{},
		this.aCountry=cDom.add('a',{Class:'lnkGeoDrop',Style:''},this.txtCountryAll)
	),this.pnl);
	cDom.app(this.c2r=cDom.add('span',{style:'display:none;padding:0px 6px 0px 6px;'},'&raquo;'),this.pnl);
	cDom.app(this.spanRegion=cDom.add('span',{},
		this.aRegion=cDom.add('a',{Class:'lnkGeoDrop',Style:'display:none;'},this.txtRegionAll)
	),this.pnl);
	cDom.app(this.r2c=cDom.add('span',{style:'display:none;padding:0px 6px 0px 6px;'},'&raquo;'),this.pnl);
	cDom.app(this.spanCity=cDom.add('span',{},
		this.aCity=cDom.add('a',{Class:'lnkGeoDrop',Style:'display:none;'},this.txtCityAll)
	),this.pnl);
	if(this.txtReload&&this.txtReload!=''&&this.url){
		cDom.app(this.aReload=cDom.add('a',{href:'#',Class:'inv',Style:'display:none;margin-left:10px;'},'['+this.txtReload+']'),this.pnl);
		this.aReload._S=this;this.aReload.onclick=this.go;
	};
	this.aCountry._S=this.aRegion._S=this.aCity._S=this;
	this.aCountry.onclick=this.tglCountry;
	this.aRegion.onclick=this.tglRegion;
	this.aCity.onclick=this.tglCity;
	this.pnlStyle='width:auto;display:block;clear:both;position:absolute;z-index:100;margin:2px 0px 0px -0px;border:1px solid #ccc;background-color:#fbfaf7;-moz-box-shadow: 3px 3px 2px #999;-webkit-box-shadow: 3px 3px 2px #999;box-shadow: 3px 3px 2px #999;filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=2,OffY=3,Color="#aaaaaa", Positive="true");';
	this.pnlInStyle='width:auto;clear:both;padding:0px;min-height:20px;max-height:385px;overflow:auto;overflow-x:hidden;overflow-y:scroll;background-color:#fdfcf9;';
	this.pnlInAllStyle='width:auto;clear:both;padding:0px 1px 0px 1px;border-bottom:2px solid #e2e1e0';
	this.pnlInItemStyle='width:auto;clear:both;padding:0px 1px 0px 1px;';
	if(_isIE()>0&&_isIE()<=6){
		this.pnlInStyle+='height:385px'
	}else{
		this.pnlInItemStyle+='white-space:nowrap;'
	};
	if(!window.cGeoLineSelAr){
		window.cGeoLineSelAr=[]
	};
	cGeoLineSelAr.push(this);
	cEvent.add(null,'click',this.closeAll);
	cEvent.add(this.pnl,'click',cEvent.stop);
	this.initCountry();
	this.initRegion();
	this.initCity();
	return this
}
cGeoLineSel.prototype.go=function(e){
	cEvent.cancel(e);var O=this._S||(e&&e.srcElement&&e.srcElement._S);
	var url=O.url;
	if(O.cityID()!=nGUID)url+=((url.indexOf('?')>0)?'&':'?')+'city='+O.cityID()
	else if(O.regionID()!=nGUID)url+=((url.indexOf('?')>0)?'&':'?')+'region='+O.regionID()
	else if(O.countryID()!=nGUID)url+=((url.indexOf('?')>0)?'&':'?')+'country='+O.countryID();
	location.href=url;
	return false
}
cGeoLineSel.prototype.govis=function(){if(this.aReload){this.aReload.style.display='inline';this.aReload.tick=1;var O=this;window.setTimeout(function(){O.gotic()},300)}}
cGeoLineSel.prototype.gotic=function(){var O=this;if(!O.aReload)return;if(Math.round(O.aReload.tick/2)==O.aReload.tick/2){O.aReload.className='inv';if(O.aReload.tick==6){O.aReload.tick=1;return}}else{O.aReload.className='empt'};O.aReload.tick++;window.setTimeout(function(){O.gotic()},300);}
cGeoLineSel.prototype.renderRqst=function(parent,o){if(o&&o.xml){var c=cDom.parse(o.xml,'c');if(c.length==1){var C=[];var A=cDom.parse(o.xml,'o');for(var i=0;i<A.length;i++){C.push({id:A[i]['value'],text:A[i]['text'],a2:A[i]['a2']})};geoCache[parent]=C}else{return}}}
cGeoLineSel.prototype.flag=function(a2){if(a2){this.img.src='/image/flag/16/'+a2+'.gif';this.img.style.display='inline'}else{this.img.style.display='none'}}
cGeoLineSel.prototype.countryID=function(){return this.oCountry.value};
cGeoLineSel.prototype.regionID=function(){return this.oRegion.value};
cGeoLineSel.prototype.cityID=function(){return this.oCity.value};
cGeoLineSel.prototype.initCountry=function(o){var O=(o&&o.o)?o.o:this;if(o&&o.xml){O.renderRqst(nGUID,o)};if(geoCache&&geoCache[nGUID]&&geoCache[nGUID].length){var A=geoCache[nGUID];;var idCountry=O.countryID();for(var i=0;i<A.length;i++){if(A[i].id==idCountry){O.aCountry.innerHTML=A[i].text;O.c2r.style.display=O.aRegion.style.display=O.spanRegion.style.display='inline';O.flag(A[i].a2);return}}}else if(!o){cAjax.get(O.urlContry,{f:O.initCountry,o:O})}}
cGeoLineSel.prototype.initRegion=function(o){var O=(o&&o.o)?o.o:this;if(o&&o.xml){O.renderRqst(O.countryID(),o)};if(O.countryID()==nGUID){return};if(geoCache&&geoCache[O.countryID()]&&geoCache[O.countryID()].length){var A=geoCache[O.countryID()];var idRegion=O.regionID();for(var i=0;i<A.length;i++){if(A[i].id==idRegion){O.aRegion.innerHTML=A[i].text;O.r2c.style.display=O.aCity.style.display=O.spanCity.style.display='inline';return}};}else if(!o){U=O.urlRegion+((O.urlRegion.indexOf('?')>0)?'&':'?')+'country='+O.countryID();cAjax.get(U,{f:O.initRegion,o:O})}}
cGeoLineSel.prototype.initCity=function(o){var O=(o&&o.o)?o.o:this;if(o&&o.xml){O.renderRqst(O.regionID(),o)};var idRegion=O.regionID();if(idRegion==nGUID){return};if(geoCache&&geoCache[idRegion]&&geoCache[idRegion].length){var A=geoCache[idRegion];var idCity=O.cityID();for(var i=0;i<A.length;i++){if(A[i].id==idCity){O.aCity.innerHTML=A[i].text;return}}}else if(!o){U=O.urlCity+((O.urlCity.indexOf('?')>0)?'&':'?')+'country='+O.countryID()+'&region='+idRegion;cAjax.get(U,{f:O.initCity,o:O})}}
cGeoLineSel.prototype.closeAll=function(){if(window.cGeoLineSelAr&&cGeoLineSelAr.length){for(var i=0;i<cGeoLineSelAr.length;i++){var O=cGeoLineSelAr[i];O.closeCountry();O.closeRegion();O.closeCity()}}};
cGeoLineSel.prototype.closeCountry=function(){
	if(this.pnlCountry){
		this.pnlCountry.style.display='none'
	};
	this.pnlCountry=null;
	if(this.pnlCountryBg){
		this.pnlCountryBg.style.display='none'
	};
	this.pnlCountryBg=null;
	this.aCountry.className='lnkGeoDrop';
}
cGeoLineSel.prototype.closeRegion=function(){if(this.pnlRegion){this.pnlRegion.style.display='none'};this.pnlRegion=null;if(this.pnlRegionBg){this.pnlRegionBg.style.display='none'};this.pnlRegionBg=null;this.aRegion.className='lnkGeoDrop';}
cGeoLineSel.prototype.closeCity=function(){if(this.pnlCity){this.pnlCity.style.display='none'};this.pnlCity=null;if(this.pnlCityBg){this.pnlCityBg.style.display='none'};this.pnlCityBg=null;this.aCity.className='lnkGeoDrop';}
cGeoLineSel.prototype.tglCountry=function(e){
	cEvent.cancel(e);
	var O=this._S||(e&&e.srcElement&&e.srcElement._S);
	if(O.pnlCountry){
		O.closeCountry();
		return
	}else{
		O.closeAll();
		O.aCountry.className='lnkGeoDropDown';
		O.pnlCountry=cDom.add('div',{style:O.pnlStyle});
		var iA=null;
		cDom.app(cDom.add('div',{style:O.pnlInAllStyle},
			iA=cDom.add('a',{href:'#',Class:(O.countryID()==nGUID?'pnlGeoCur':'pnlGeo')},O.txtCountryAll)
		),O.pnlCountry);
		cDom.app(O.pnlCountry.pnlItems=cDom.add('div',{style:O.pnlInStyle}),O.pnlCountry);
		cEvent.add(O.pnlCountry.pnlItems,'mousescroll',function(e){cEvent.stop(e)});
		var P=cDom.pos(O.spanCountry);
		var T=(P.t+O.spanCountry.offsetHeight-1);
		cDom.stlS(O.pnlCountry,{top:T+'px',left:P.l+'px'});
		cDom.app(O.pnlCountry,O.spanCountry);
		if(_isIE()){
			cDom.app(O.pnlCountryBg=cDom.add('iframe',{style:(O.pnlStyle+'border:0px;z-index:99;top:'+T+'px;left:'+P.l+'px;width:'+(O.pnlCountry.offsetWidth)+'px;height:'+(O.pnlCountry.offsetHeight)+'px')}),O.spanCountry)
		};
		iA._S=O;
		iA._O={id:nGUID,text:O.txtCountryAll};
		iA.onclick=O.clickCountry;
		O.rndrCountry()
	}
}
cGeoLineSel.prototype.rndrCountry=function(o){var O=(o&&o.o)?o.o:this;if(o&&o.xml){O.renderRqst(nGUID,o)};if(!O.pnlCountry||!O.pnlCountry.pnlItems)return;if(geoCache&&geoCache[nGUID]&&geoCache[nGUID].length){var A=geoCache[nGUID];var idCountry=O.countryID();var idFocus=(idCountry!=nGUID)?idCountry:O.dCountry;var elFocus=null;var elW=null;O.pnlCountry.aItems=[];for(var i=0;i<A.length;i++){var iA=null;cDom.app(elW=cDom.add('div',{style:O.pnlInItemStyle},iA=cDom.add('a',{href:'#',Class:(idCountry==A[i].id?'pnlGeoCur':'pnlGeo')},A[i].text)),O.pnlCountry.pnlItems);if(A[i].id==O.dCountry)iA.style.fontWeight='bold';if(A[i].id==idFocus)elFocus=elW;iA._S=O;iA._O=A[i];iA.onclick=O.clickCountry;};if(elFocus){try{elFocus.scrollIntoView(false);}catch(e){}};}else if(!o){cAjax.get(O.urlContry,{f:O.rndrCountry,o:O})}}
cGeoLineSel.prototype.clickCountry=function(e){cEvent.cancel(e);var A=(this._S)?(this):((e&&e.srcElement&&e.srcElement._S)?e.srcElement:null);var O=A._S;O.closeAll();O.selCountry(A._O);return false;}
cGeoLineSel.prototype.selCountry=function(I){var O=this;O.aCountry.innerHTML=I.text;O.oCountry.value=I.id;O.flag(I.a2);O.aCity.innerHTML=O.txtCityAll;O.spanCity.style.display='none';O.r2c.style.display='none';O.oCity.value=nGUID;O.aRegion.innerHTML=O.txtRegionAll;O.oRegion.value=nGUID;if(I.id==nGUID){O.spanRegion.style.display='none';O.c2r.style.display='none';}else{O.c2r.style.display='inline';O.spanRegion.style.display='inline';O.aRegion.style.display='inline';U=O.urlRegion+((O.urlRegion.indexOf('?')>0)?'&':'?')+'country='+O.countryID();cAjax.get(U,{f:function(o){var O=(o&&o.o)?o.o:this;if(o&&o.xml){O.renderRqst(O.countryID(),o)};},o:O})};O.govis()}
cGeoLineSel.prototype.tglRegion=function(e){cEvent.cancel(e);var O=this._S||(e&&e.srcElement&&e.srcElement._S);if(O.pnlRegion){O.closeRegion();return}else{O.closeAll();O.aRegion.className='lnkGeoDropDown';O.pnlRegion=cDom.add('div',{style:O.pnlStyle});var iA=null;cDom.app(elW=cDom.add('div',{style:O.pnlInAllStyle},iA=cDom.add('a',{href:'#',Class:(O.regionID()==nGUID?'pnlGeoCur':'pnlGeo')},O.txtRegionAll)),O.pnlRegion);cDom.app(O.pnlRegion.pnlItems=cDom.add('div',{style:O.pnlInStyle}),O.pnlRegion);cEvent.add(O.pnlRegion.pnlItems,'mousescroll',function(e){cEvent.stop(e)});var P=cDom.pos(O.spanRegion);var T=(P.t+O.spanRegion.offsetHeight-1);cDom.stlS(O.pnlRegion,{top:T+'px',left:P.l+'px'});cDom.app(O.pnlRegion,O.spanRegion);if(_isIE()){cDom.app(O.pnlRegionBg=cDom.add('iframe',{style:(O.pnlStyle+'border:0px;z-index:99;top:'+T+'px;left:'+P.l+'px;width:'+(O.pnlRegion.offsetWidth)+'px;height:'+(O.pnlRegion.offsetHeight)+'px')}),O.spanRegion);};iA._S=O;iA._O={id:nGUID,text:O.txtRegionAll};iA.onclick=O.clickRegion;O.rndrRegion();};}
cGeoLineSel.prototype.rndrRegion=function(o){var O=(o&&o.o)?o.o:this;var idCountry=O.countryID();if(o&&o.xml){O.renderRqst(idCountry,o)};if(!O.pnlRegion||!O.pnlRegion.pnlItems)return;if(geoCache&&geoCache[idCountry]&&geoCache[idCountry].length){var A=geoCache[idCountry];var idRegion=O.regionID();var idFocus=(idRegion!=nGUID)?idRegion:O.dRegion;var elFocus=null;var elW=null;O.pnlRegion.aItems=[];for(var i=0;i<A.length;i++){var iA=null;cDom.app(elW=cDom.add('div',{style:O.pnlInItemStyle},iA=cDom.add('a',{href:'#',Class:(idRegion==A[i].id?'pnlGeoCur':'pnlGeo')},A[i].text)),O.pnlRegion.pnlItems);if(A[i].id==O.dRegion)iA.style.fontWeight='bold';if(A[i].id==idFocus)elFocus=elW;iA._S=O;iA._O=A[i];iA.onclick=O.clickRegion;};if(elFocus){try{elFocus.scrollIntoView(false);}catch(e){}};}else if(!o){U=O.urlRegion+((O.urlRegion.indexOf('?')>0)?'&':'?')+'country='+O.countryID();cAjax.get(U,{f:O.rndrRegion,o:O})}}
cGeoLineSel.prototype.clickRegion=function(e){cEvent.cancel(e);var A=(this._S)?(this):((e&&e.srcElement&&e.srcElement._S)?e.srcElement:null);var O=A._S;O.closeAll();O.selRegion(A._O);return false;}
cGeoLineSel.prototype.selRegion=function(I){var O=this;O.aRegion.innerHTML=I.text;O.oRegion.value=I.id;O.aCity.innerHTML=O.txtCityAll;O.oCity.value=nGUID;if(I.id==nGUID){O.spanCity.style.display='none';O.r2c.style.display='none';}else{O.r2c.style.display='inline';O.spanCity.style.display='inline';O.aCity.style.display='inline';U=O.urlCity+((O.urlCity.indexOf('?')>0)?'&':'?')+'region='+O.regionID();cAjax.get(U,{f:function(o){var O=(o&&o.o)?o.o:this;if(o&&o.xml){O.renderRqst(O.regionID(),o)};},o:O})};O.govis()}
cGeoLineSel.prototype.tglCity=function(e){cEvent.cancel(e);var O=this._S||(e&&e.srcElement&&e.srcElement._S);if(O.pnlCity){O.closeCity();return}else{O.closeAll();O.aCity.className='lnkGeoDropDown';O.pnlCity=cDom.add('div',{style:O.pnlStyle});var iA=null;cDom.app(cDom.add('div',{style:O.pnlInAllStyle},iA=cDom.add('a',{href:'#',Class:(O.cityID()==nGUID?'pnlGeoCur':'pnlGeo')},O.txtCityAll)),O.pnlCity);cDom.app(O.pnlCity.pnlItems=cDom.add('div',{style:O.pnlInStyle}),O.pnlCity);cEvent.add(O.pnlCity.pnlItems,'mousescroll',function(e){cEvent.stop(e)});var P=cDom.pos(O.spanCity);var T=(P.t+O.spanCity.offsetHeight-1);cDom.stlS(O.pnlCity,{top:T+'px',left:P.l+'px'});cDom.app(O.pnlCity,O.spanCity);if(_isIE()){cDom.app(O.pnlCityBg=cDom.add('iframe',{style:(O.pnlStyle+'border:0px;z-index:99;top:'+T+'px;left:'+P.l+'px;width:'+(O.pnlCity.offsetWidth)+'px;height:'+(O.pnlCity.offsetHeight)+'px')}),O.spanCity)};iA._S=O;iA._O={id:nGUID,text:O.txtCityAll};iA.onclick=O.clickCity;O.rndrCity()}}
cGeoLineSel.prototype.rndrCity=function(o){var O=(o&&o.o)?o.o:this;var idRegion=O.regionID();if(o&&o.xml){O.renderRqst(idRegion,o)};if(!O.pnlCity||!O.pnlCity.pnlItems)return;if(geoCache&&geoCache[idRegion]&&geoCache[idRegion].length){var A=geoCache[idRegion];var idCity=O.cityID();var idFocus=(idCity!=nGUID)?idCity:O.dCity;var elFocus=null;var elW=null;O.pnlCity.aItems=[];for(var i=0;i<A.length;i++){var iA=null;cDom.app(elW=cDom.add('div',{style:O.pnlInItemStyle},iA=cDom.add('a',{href:'#',Class:(idCity==A[i].id?'pnlGeoCur':'pnlGeo')},A[i].text)),O.pnlCity.pnlItems);if(A[i].id==O.dCity)iA.style.fontWeight='bold';if(A[i].id==idFocus)elFocus=elW;iA._S=O;iA._O=A[i];iA.onclick=O.clickCity;};if(elFocus){try{elFocus.scrollIntoView(false);}catch(e){}};}else if(!o){U=O.urlCity+((O.urlCity.indexOf('?')>0)?'&':'?')+'country='+O.countryID()+'&region='+O.regionID();cAjax.get(U,{f:O.rndrCity,o:O})}}
cGeoLineSel.prototype.clickCity=function(e){cEvent.cancel(e);var A=(this._S)?(this):((e&&e.srcElement&&e.srcElement._S)?e.srcElement:null);var O=A._S;O.closeAll();O.selCity(A._O);return false}
cGeoLineSel.prototype.selCity=function(I){this.aCity.innerHTML=I.text;this.oCity.value=I.id;this.govis()}

/* wiki Albom */
var aWikiAlbomItem=[]
function wikiAlbomItemSelf(e){var O=(this._S)?this._S:this;if(!O._E&&this._S)O=this._S;if(!O._S){e=(window.event||e);O=((e.target)?e.target:e.srcElement)._S};return O;};
function wikiAlbomItemInit(){
	var A=cDom.gEBTN('A');
	for(i=0;i<A.length;i++){
		if(A[i].className=='wikiAlbomsImage'){
			new wikiAlbomItem(A[i],A[i].getAttribute('rate'))
		};
	};
};
function wikiAlbomItem(E,R){
	var startW=120,startH=90;
	E=gEl(E);this._E=E;this._R=R?R:1;
	this._href=E.getAttribute('href');
	for(var i=0;i<E.childNodes.length;i++){
		if(E.childNodes[i].tagName=='IMG')this._IMG=E.childNodes[i];
		if(E.childNodes[i].tagName=='DIV')this._DIV=E.childNodes[i]
	};
	if(this._IMG){
		this._title=this._IMG.getAttribute('ALT');
		this._src=this._IMG.getAttribute('SRC');
		this._titleShort=this._DIV?this._DIV.innerHTML:this._title;
		this._W=startW;
		this._H=parseInt(startW/this._R);
		if(startW/this._R>startH){
			this._W=parseInt(this._R*startH);
			this._H=startH
		};
		cDom.stlS(this._IMG,{width:this._W+'px',height:this._H+'px'});
		this._E._S=this._IMG._S=this._DIV._S=this;
		cEvent.add(this._E,'mousemove',this.Over)
	};
	return this
};
wikiAlbomItem.prototype.Over=function(e){
	O=wikiAlbomItemSelf(e);
	O.timeOver=new Date();
	
	var pos=cDom.pos(O._E);var t=pos.t-10;var l=pos.l-17;
	
	for(var i=0;i<aWikiAlbomItem.length;i++){
		if(aWikiAlbomItem[i].overImage)aWikiAlbomItem[i].overImage.style.display='none';
	};

	if(!O.overImage){
		cDom.app(O.overImage=cDom.add('A',{href:O._href,Style:'position:absolute;display:block;width:auto;height:auto;top:'+t+'px;left:'+l+'px;border:1px solid #f70;background-color:#fff;padding:4px;min-width:160px;min-height:140px;text-align:center;vertical-align:middle;text-decoration:none;-moz-box-shadow: 5px 5px 5px #999;-webkit-box-shadow: 5px 5px 5px #999;box-shadow: 5px 5px 5px #999;filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=4,OffY=4,Color="#aaaaaa", Positive="true");'},
			O.overImageI=cDom.add('IMG',{src:O._src,title:O._title,alt:O._title,Style:'width:'+parseInt(O._W*4/3)+'px;height:'+parseInt(O._H*4/3)+'px;cursor:pointer;'}),
			O.overImageD=cDom.add('DIV',{Style:'width:160px;white-space:nowrap;overflow:hidden;'},O._titleShort)
		));
		
		aWikiAlbomItem.push(O);
	}else{
		O.overImage.style.top=t+'px';
		O.overImage.style.left=l+'px';
		O.overImage.style.display='block';
	};
	
	O.overImage._S=O.overImageI._S=O.overImageD._S=O;
	
	cEvent.add(O.overImage,'mousemove',function(e){cEvent.stop(e);var O=wikiAlbomItemSelf(e);O.timeOver=new Date()});
	cEvent.add(O.overImageI,'mousemove',function(e){var O=wikiAlbomItemSelf(e);O.timeOver=new Date()});
	cEvent.add(O.overImageD,'mousemove',function(e){var O=wikiAlbomItemSelf(e);O.timeOver=new Date()});
	cEvent.add(O.overImage,'mouseout',O.Out);
};
wikiAlbomItem.prototype.Out=function(e){var O=wikiAlbomItemSelf(e);O.timeOut=new Date();window.setTimeout(function(){O.OutCheck()},300)};
wikiAlbomItem.prototype.OutCheck=function(e){var O=this;if(O.timeOver>O.timeOut||O.overImage.style.display=='none')return;O.overImage.style.display='none'}

/* wiki image preview */
var aWikiPrvItem=[]
function wPrvSlf(e){var O=(this._S)?this._S:this;if(!O._E&&this._S)O=this._S;if(!O._S){e=(window.event||e);O=((e.target)?e.target:e.srcElement)._S};return O;};
function wPreviwInit(clsName,overWidth,overHeight,textMust){
	if(!overWidth)overWidth=160;
	if(!overHeight)overHeight=160;
	if(textMust==null)textMust=true
	var A=cDom.gEBTN('A');
	for(i=0;i<A.length;i++){
		if(A[i].className==clsName){
			new wPrvItem(A[i],overWidth,overHeight,textMust)
		}
	}
};
function wPrvItem(E,W,H,Tm){
	E=gEl(E);this._E=E;this._href=E.getAttribute('href');this._target=E.getAttribute('TARGET');
	if(!E)return;
	E.oW=W;E.oH=H;E.Tm=Tm;
	for(var i=0;i<E.childNodes.length;i++){
		if(E.childNodes[i].tagName=='IMG'){
			this._IMG=E.childNodes[i];
		};
		if(E.childNodes[i].tagName=='DIV')this._DIV=E.childNodes[i]
	};
	if(this._IMG){
		this._title=this._IMG.getAttribute('ALT');
		this._src=this._IMG.getAttribute('SRC');
		this._titleShort=this._DIV?this._DIV.innerHTML:this._title;
		this._W=parseInt(this._IMG.style.width);
		this._H=parseInt(this._IMG.style.height);
		this._E._S=this._IMG._S=this;
		if(this._DIV)this._DIV._S=this;
		cEvent.add(this._E,'mousemove',this.Over)
	};
	return this
};
wPrvItem.prototype.Over=function(e){
	O=wPrvSlf(e);
	O.timeOver=new Date();
	var pos=cDom.pos(O._E);
	var t=pos.t-(O._E.oW-O._W)/2-2-5;
	var l=pos.l-(O._E.oH-O._H)/2-2;
	for(var i=0;i<aWikiPrvItem.length;i++){if(aWikiPrvItem[i].overImage)aWikiPrvItem[i].overImage.style.display='none'};
	if(!O.overImage){
		cDom.app(
			O.overImage=cDom.add('A',{href:O._href,Class:O._E.className,target:(O._target?O._target:''),title:O._title,Style:'position:absolute;display:block;width:auto;height:auto;top:'+t+'px;left:'+l+'px;border:1px solid #f70;background-color:#f4f4f4;padding:4px;min-width:'+O._E.oW+'px;min-height:'+O._E.oH+'px;text-align:center;vertical-align:middle;text-decoration:none;-moz-box-shadow: 4px 4px 3px #888;-webkit-box-shadow: 4px 4px 3px #888;box-shadow: 4px 4px 3px #888;filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=4,OffY=4,Color="#aaaaaa", Positive="true");'},
				O.overImageC=cDom.add('DIV',{Style:'width:auto;height:auto;display:block;'},
					O.overImageI=cDom.add('IMG',{src:O._src,title:O._title,alt:O._title,Style:'width:'+O._E.oW+'px;height:'+O._E.oH+'px;cursor:pointer;display:block;'})
				)
			)
		);
		if(O._titleShort!=''&&O._E.Tm){
			cDom.app(
				O.overImageD=cDom.add('DIV',{Style:'width:'+O._E.oW+'px;white-space:nowrap;overflow:hidden;'},O._titleShort)
			,O.overImage)
		};
		aWikiPrvItem.push(O);
	}else{O.overImage.style.top=t+'px';O.overImage.style.left=l+'px';O.overImage.style.display='block'};
	O.overImage._S=O.overImageI._S=O.overImageC._S=O;
	
	cEvent.add(O.overImage,'mousemove',function(e){cEvent.stop(e);var O=wPrvSlf(e);O.timeOver=new Date()});
	cEvent.add(O.overImageI,'mousemove',function(e){var O=wPrvSlf(e);O.timeOver=new Date()});
	cEvent.add(O.overImageC,'mousemove',function(e){var O=wPrvSlf(e);O.timeOver=new Date()});
	if(O.overImageD){
		O.overImageD._S=O;
		cEvent.add(O.overImageD,'mousemove',function(e){var O=wPrvSlf(e);O.timeOver=new Date()});
	};	
	if(O.overImage){try{var u=O._href;if(u.indexOf('/go/?http')==0){wOL(O.overImage,decodeURIComponent(u.replace(/^\/go\/\?/ig,'')))}else if(u.indexOf('/goto/?http')==0){wOL(O.overImage,decodeURIComponent(u.replace(/^\/GoTo\/\?/ig,'')))}else if(u.indexOf('/go/to/?http')==0){wOL(O.overImage,decodeURIComponent(u.replace(/^\/go\/to\/\?/ig,'')))}}catch(e){}};
	cEvent.add(O.overImage,'mouseout',O.Out)};
wPrvItem.prototype.Out=function(e){var O=wPrvSlf(e);O.timeOut=new Date();window.setTimeout(function(){O.OutCheck()},300)};
wPrvItem.prototype.OutCheck=function(e){var O=this;if(O.timeOver>O.timeOut||O.overImage.style.display=='none')return;O.overImage.style.display='none'}