var isIE	= (navigator.appName.indexOf('Internet Explorer') != -1);
var isOpera	= (navigator.userAgent.indexOf("Opera")>-1);
function addFavorite(a,b){if(window.external){if(window.external.addFavourite){window.external.addFavourite(a,b);return false}}alert("Your browser doesn't support this feature");return false}
/*@cc_on@if(@_win32&&@_jscript_version>4)var fixed_positions=new Array();var fixed_backgrounds=new Array();var fixed_viewport;function fixed_init(){fixed_viewport=(document.compatMode=='CSS1Compat')?document.documentElement:document.body;var el=document.createElement('div');el.setAttribute('id','fixed-measure');el.style.position='absolute';el.style.top='0';el.style.left='0';el.style.overflow='hidden';el.style.visibility='hidden';el.style.fontSize='xx-large';el.style.height='5em';el.style.setExpression('width','fixed_measureFont()');document.body.insertBefore(el,document.body.firstChild)}function fixed_bind(el){var needLayout=false;var tag=el.tagName.toLowerCase();var st=el.style;var cst=el.currentStyle;var anc;if(cst.position=='fixed'){needLayout=true;fixed_positions[fixed_positions.length]=el;st.position='absolute';st.fixedPLeft=cst.left;st.fixedPTop=cst.top;st.fixedPRight=cst.right;st.fixedPBottom=cst.bottom;st.fixedPWidth=fixed_parseLength(cst.width);st.fixedPHeight=fixed_parseLength(cst.height);st.fixedCB=null;for(anc=el;(anc=anc.parentElement).parentElement;){if(anc.currentStyle.position!='static'){st.fixedCB=anc;break}}st.fixedNest=false;for(anc=el;anc=anc.parentElement;){if(anc.style.fixedNest!=null)st.fixedNest=true;break}}if(cst.backgroundAttachment=='fixed'&&tag!='body'&&tag!='html'){needLayout=true;fixed_backgrounds[fixed_backgrounds.length]=el;st.fixedBLeft=fixed_parseLength(cst.backgroundPositionX);st.fixedBTop=fixed_parseLength(cst.backgroundPositionY);if(st.fixedBLeft[1]=='%'||st.fixedBTop[1]=='%'){st.fixedBWidth=0;st.fixedBHeight=0;fixed_measureBack(el)}}if(needLayout)fixed_layout()}var fixed_delaying=false;function fixed_delayout(){if(fixed_delaying)return;fixed_delaying=true;window.setTimeout(fixed_layout,0)}var fixed_ARBITRARY=200;function fixed_layout(){fixed_delaying=false;if(!fixed_viewport)return;var i,el,st,j,pr,tmp,A='auto';var cb,cbLeft,cbTop,cbRight,cbBottom,oLeft,oTop,oRight,oBottom;var vpWidth=fixed_viewport.clientWidth,vpHeight=fixed_viewport.clientHeight;for(i=fixed_positions.length;i-->0;){el=fixed_positions[i];st=el.style;cb=st.fixedCB;if(!cb)cb=fixed_viewport;cbLeft=fixed_pageLeft(cb);cbTop=fixed_pageTop(cb);if(cb!=fixed_viewport){cbLeft+=cb.clientLeft;cbTop+=cb.clientTop}cbRight=fixed_viewport.clientWidth-cbLeft-cb.clientWidth;cbBottom=fixed_viewport.clientHeight-cbTop-cb.clientHeight;if(st.fixedPWidth[1]=='%')st.width=Math.round(vpWidth*st.fixedPWidth[0]/100)+'px';if(st.fixedPHeight[1]=='%')st.height=Math.round(vpHeight*st.fixedPHeight[0]/100)+'px';st.left=A;st.right='0';st.top=A;st.bottom='0';oRight=el.offsetLeft+el.offsetWidth;oBottom=el.offsetTop+el.offsetHeight;st.left='0';st.right=A;st.top='0';st.bottom=A;oLeft=el.offsetLeft;oTop=el.offsetTop;st.left=A;st.right=st.fixedPRight;st.top=A;st.bottom=st.fixedPBottom;oRight-=el.offsetLeft+el.offsetWidth;oBottom-=el.offsetTop+el.offsetHeight;st.left=st.fixedPLeft;st.top=st.fixedPTop;oLeft=el.offsetLeft-oLeft;oTop=el.offsetTop-oTop;if(st.fixedPWidth[1]==A&&st.fixedPLeft!=A&&st.fixedPRight!=A){tmp=el.offsetLeft;st.left=A;st.width=fixed_ARBITRARY+'px';tmp=fixed_ARBITRARY+el.offsetLeft-tmp+cbLeft+cbRight;st.left=st.fixedPLeft;st.width=((tmp<1)?1:tmp)+'px'}if(st.fixedPHeight[1]==A&&st.fixedPTop!=A&&st.fixedPBottom!=A){tmp=el.offsetTop;st.top=A;st.height=fixed_ARBITRARY+'px';tmp=fixed_ARBITRARY+el.offsetTop-tmp+cbTop+cbBottom;st.top=st.fixedPTop;st.height=((tmp<1)?1:tmp)+'px'}st.fixedCLeft=(st.fixedPLeft=='auto')?oLeft:oLeft-cbLeft;st.fixedCTop=(st.fixedPTop=='auto')?oTop:oTop-cbTop;st.fixedCRight=(st.fixedPRight=='auto')?oRight:oRight-cbRight;st.fixedCBottom=(st.fixedPBottom=='auto')?oBottom:oBottom-cbBottom;if(st.fixedPLeft=='auto'&&st.fixedPRight!='auto')st.fixedCLeft='auto';if(st.fixedPTop=='auto'&&st.fixedPBottom!='auto')st.fixedCTop='auto'}for(i=fixed_backgrounds.length;i-->0;){el=fixed_backgrounds[i];st=el.style;tmp=st.fixedBImage;if(tmp){if(tmp.readyState!='uninitialized'){st.fixedBWidth=tmp.offsetWidth;st.fixedBHeight=tmp.offsetHeight;st.fixedBImage=window.undefined}}st.fixedBX=fixed_length(el,st.fixedBLeft,vpWidth-st.fixedBWidth);st.fixedBY=fixed_length(el,st.fixedBTop,vpHeight-st.fixedBHeight)}fixed_scroll()}var fixed_lastX,fixed_lastY;var fixed_PATCHDELAY=300;var fixed_patching=false;function fixed_patch(){fixed_patching=false;var scrollX=fixed_viewport.scrollLeft,scrollY=fixed_viewport.scrollTop;if(scrollX!=fixed_lastX&&scrollY!=fixed_lastY)fixed_scroll()}function fixed_scroll(){if(!fixed_viewport)return;var i,el,st,viewportX,viewportY;var scrollX=fixed_viewport.scrollLeft,scrollY=fixed_viewport.scrollTop;fixed_lastX=scrollX;fixed_lastY=scrollY;for(i=fixed_positions.length;i-->0;){st=fixed_positions[i].style;viewportX=(st.fixedNest)?0:scrollX;viewportY=(st.fixedNest)?0:scrollY;if(st.fixedCLeft!='auto')st.left=(st.fixedCLeft+viewportX)+'px';if(st.fixedCTop!='auto')st.top=(st.fixedCTop+viewportY)+'px';viewportX=(st.fixedCB==null||st.fixedCB==fixed_viewport)?0:viewportX;viewportY=(st.fixedCB==null||st.fixedCB==fixed_viewport)?0:viewportY;st.right=(st.fixedCRight-viewportX+1)+'px';st.right=(st.fixedCRight-viewportX)+'px';st.bottom=(st.fixedCBottom-viewportY+1)+'px';st.bottom=(st.fixedCBottom-viewportY)+'px'}for(i=fixed_backgrounds.length;i-->0;){el=fixed_backgrounds[i];st=el.style;viewportX=scrollX;viewportY=scrollY;while(el.offsetParent){viewportX-=el.offsetLeft+el.clientLeft;viewportY-=el.offsetTop+el.clientTop;el=el.offsetParent}st.backgroundPositionX=(st.fixedBX+viewportX)+'px';st.backgroundPositionY=(st.fixedBY+viewportY)+'px'}if(!fixed_patching){fixed_patching=true;window.setTimeout(fixed_patch,fixed_PATCHDELAY)}}function fixed_measureBack(el){var measure=document.getElementById('fixed-measure');var img=document.createElement('img');img.setAttribute('src',fixed_parseURL(el.currentStyle.backgroundImage));measure.appendChild(img);el.style.fixedBImage=img;if(img.readyState=='uninitialized')img.attachEvent('onreadystatechange',fixed_measureBackImage_ready)}function fixed_measureBackImage_ready(){var img=event.srcElement;if(img&&img.readyState!='uninitialized'){img.detachEvent('onreadystatechange',fixed_measureBackImage_ready);fixed_layout()}}var fixed_fontsize=0;function fixed_measureFont(){var fs=document.getElementById('fixed-measure').offsetHeight;if(fixed_fontsize!=fs&&fixed_fontsize!=0)fixed_delayout();fixed_fontsize=fs;return'5em'}function fixed_parseURL(v){v=v.substring(4,v.length-1);if(v.charAt(0)=='"'&&v.charAt(v.length-1)=='"'||v.charAt(0)=="'"&&v.charAt(v.length-1)=="'")return v.substring(1,v.length-1);else return v}var fixed_numberChars='+-0123456789.';var fixed_ZERO=new Array(0,'px');var fixed_50PC=new Array(50,'%');var fixed_100PC=new Array(100,'%');var fixed_AUTO=new Array(0,'auto');function fixed_parseLength(v){var num,i;if(v=='left'||v=='top')return fixed_ZERO;if(v=='right'||v=='bottom')return fixed_100PC;if(v=='center')return fixed_50PC;if(v=='auto')return fixed_AUTO;i=0;while(i<v.length&&fixed_numberChars.indexOf(v.charAt(i))!=-1)i++;num=parseFloat(v.substring(0,i));if(num==0)return fixed_ZERO;else return new Array(num,v.substring(i))}function fixed_length(el,l,full){var tmp,x;if(l[1]=='px')return l[0];if(l[1]=='%')return Math.round(full*l[0]/100);tmp=el.currentStyle.left;el.style.left='0';x=el.offsetLeft;el.style.left=l[0]+l[1];x=el.offsetLeft-x;el.style.left=tmp;return x}function fixed_pageLeft(el){var v=0;while(el.offsetParent){v+=el.offsetLeft;el=el.offsetParent}return v}function fixed_pageTop(el){var v=0;while(el.offsetParent){v+=el.offsetTop;el=el.offsetParent}return v}var fixed_SCANDELAY=500;function fixed_scan(){if(!document.body)return;if(!fixed_viewport)fixed_init();var el;for(var i=0;i<document.all.length;i++){el=document.all[i];if(!el.fixed_bound){el.fixed_bound=true;fixed_bind(el)}}}var fixed_scanner;function fixed_stop(){window.clearInterval(fixed_scanner);fixed_scan()}fixed_scan();fixed_scanner=window.setInterval(fixed_scan,fixed_SCANDELAY);window.attachEvent('onload',fixed_stop);window.attachEvent('onresize',fixed_delayout);window.attachEvent('onscroll',fixed_scroll);@end@*/
function getRadioValue(a){for(var i=0;i<a.length;i++)if(a[i].checked)return a[i].value;return null}function selectAll(a,b){var c=document.forms[a].elements;for(var i=0;i<c.length;i++)if(c[i].tagName=="INPUT"&&c[i].type=="checkbox")c[i].checked=b}function formToUrl(a){var b=a.elements;var c='';for(var i=0;i<b.length;i++){if(b[i]&&b[i].name&&b[i].name!='_dont_save_'){if(b[i].type=='radio'||b[i].type=='checkbox'){if(b[i].checked)c=c+b[i].name+'='+encodeURIComponent(b[i].value)+'&'}else c=c+b[i].name+'='+encodeURIComponent(b[i].value)+'&'}}return c}function formClear(a){var b=a.elements;for(var i=0;i<b.length;i++){if(b[i]&&b[i].name&&b[i].name!='SELECT'&&b[i].type!='button'&&b[i].type!='hidden'&&b[i].type!='select-one'&&b[i].type!='radio'){if(b[i].type=='checkbox')b[i].checked=false;else b[i].value=''}if(b[i].length)b[i].selectedIndex=0}}function callCalendar(a){var b=document.getElementById('callendar_container_'+a);b.className='wyswyg_show'}function closeCalendar(a){var b=document.getElementById('callendar_container_'+a);b.className='wyswyg_hidden'}function callEditor(a){block();wc=document.getElementById('wyswyg_container');wc.className='wyswyg_show';wc.style.top=document.body.scrollTop+100;var b=FCKeditorAPI.GetInstance('wyswyg_gate');b.SetHTML(a.innerHTML);curEditedElement=a.id.replace('div_','')}function saveEditorChanges(a){var b=top.FCKeditorAPI.GetInstance('wyswyg_gate');var c=document.getElementById('div_'+curEditedElement);var d=document.getElementById('hd_'+curEditedElement);if(a=='yes'){d.value=b.GetXHTML();c.innerHTML=d.value;b.SetHTML('')}else b.SetHTML('');curEditedElement=null;document.getElementById('wyswyg_container').className='wyswyg_hidden';unblock()}function selectCustomType(a,b){if(a.options[a.selectedIndex].value!=b)document.getElementById('cstm_inp_'+a.id).style.display='none';else document.getElementById('cstm_inp_'+a.id).style.display='block'}function insertInSelect(a,b,c){var d=document.createElement('option');d.appendChild(document.createTextNode(c));d.setAttribute('value',b);a.appendChild(d)}function addSelElToList(b){var c=document.getElementById('cntr_'+b);var d=c.options[c.selectedIndex];if(c.value!=0){var e=document.getElementById('div_cntr_'+b);var f=document.forms['form_edit_classifier'].elements['h_cntr_'+b];f.value=(f.value==''?d.value:f.value+','+d.value);count=(b=='from'?++countFrom:++countTo);var g=document.createElement('div');var h=document.createElement('span');g.setAttribute('id','div_'+b+'_'+count);h.setAttribute('id','sdiv_'+b+'_'+count);h.appendChild(document.createTextNode(d.text));var a=document.createElement('a');var i=document.createElement('img');i.setAttribute('src',delImg.src);i.setAttribute('style','border: 0px');a.setAttribute('href','javascript:void(0)');a.setAttribute('style','border: 0px;text-decoration: none;');a.setAttribute('onclick',"deleteCntr('"+b+"', '"+d.value+"', '"+count+"')");a.appendChild(i);g.appendChild(h);g.appendChild(a);c.remove(c.selectedIndex);e.appendChild(g)}}function deleteSelElFromList(a,b,c){var d=document.forms['form_edit_classifier'].elements['h_cntr_'+a];var e=d.value.toString();var f=e.split(",");var g=document.getElementById('div_cntr_'+a);var h=document.forms['form_edit_classifier'].elements['cntr_'+a];d.value='';for(var i=0;i<f.length;++i){if(f[i]!=b){d.value=(d.value==''?f[i]:d.value+','+f[i])}else{var j=document.getElementById('sdiv_'+a+'_'+c);insertInSelect(h,b,j.innerHTML)}}var k=document.getElementById('div_'+a+'_'+c);g.removeChild(k)}function hideElement(a,b,c){var d=document.getElementById(b);if(a.tagName=='INPUT'){if(a.type=='checkbox'){if(a.checked==true){d.style.display='block';return true}else{d.style.display='none';return false}}}else if(a.tagName=='SELECT'){if(a.options[a.selectedIndex].value==c){d.style.display='block';return true}else{d.style.display='none';return false}}}function setDo(a,b){var c=document.getElementById(a);c.value+=b}
var jsFormCallendar = {
	day: 		new Array(),
	month: 		new Array(),
	year: 		new Array(),
	weekFormat: null,
	monthNames:	new Array(),
	monthNamesI:	new Array(),
	weekDays:	new Array(),
	links:		new Array(),
	onclicks:	new Array(),
	forArchive:	null,
	dateDump:	new Array(),
	currDate:	new Array(),

	isLeapYear: function (year)
	{
		if (year % 4 == 0)
		{
			return true;
		}
		else
		{
			return false;
		}
	},

	getDays: function (month, year)
	{
		 var ar = new Array(13);
		 ar[0] = 31 ;
		 ar[1] = (this.isLeapYear(year)) ? 29 : 28;
		 ar[2] = 31 ;
		 ar[3] = 30 ;
		 ar[4] = 31 ;
		 ar[5] = 30 ;
		 ar[6] = 31;
		 ar[7] = 31 ;
		 ar[8] = 30 ;
		 ar[9] = 31 ;
		 ar[10] = 30 ;
		 ar[11] = 31 ;

		 return ar[month];
	},

	Print: function(callId)
	{

		var container = document.getElementById('callendar_container_'+callId);
		container.innerHTML = '';
		var displDate = new Date();

		if(this.year[callId])
		{
			displDate.setFullYear(this.year[callId]);
		}
		else
		{
			if (isIE) this.year[callId] = displDate.getYear();
				else this.year[callId] = 1900 + displDate.getYear();
		}

		if(this.month[callId]) displDate.setMonth(this.month[callId]);
			else this.month[callId] = displDate.getMonth();

		displDate.setDate(1);
		this.setCurDate(callId);
		var dayInWeek = displDate.getDay();

		if(this.weekFormat == 'ru') var dayOffset = dayInWeek == 0 ? 6 : dayInWeek - 1;
			else var dayOffset = dayInWeek;

		var dayInMonth = this.getDays(this.month[callId], this.year[callId]);

		var monYear = document.createElement('div');
		var table = document.createElement('table');
		var body = document.createElement('tbody');
		var icont =  document.createElement('div');

		icont.id = 'callendar_container';

		this.generateHead(monYear, body, callId);
		this.generateBody(body, dayInMonth, dayOffset, callId);

		icont.appendChild(monYear);
		table.appendChild(body);
		icont.appendChild(table);

		var closeButtonContainer = document.createElement('div');
		closeButtonContainer.innerHTML = "Закрыть";
		closeButtonContainer.className = "pointer";
		closeButtonContainer.onclick = function(){closeCalendar(callId)};

		icont.appendChild(closeButtonContainer);
		container.appendChild(icont);
	},

	setCurDate: function(callId)
	{
		if(typeof(this.dateDump[callId]) == 'undefined')
		{
			this.dateDump[callId] = new Array();

			this.dateDump[callId]['day'] = this.day[callId];
			this.dateDump[callId]['month'] = this.month[callId];
			this.dateDump[callId]['year'] = this.year[callId];
		}

		if(typeof(this.currDate[callId]) == 'undefined')
		{
			this.currDate[callId] = new Array();
			var dt = new Date();

			this.currDate[callId]['day'] = dt.getDate();
			this.currDate[callId]['month'] = dt.getMonth();
			this.currDate[callId]['year'] = isIE ? parseInt(dt.getYear()) : 1900 + parseInt(dt.getYear());
		}
	},

	generateBody: function(body, dayInMonth, dayOffset, callId)
	{
		var link = this.links[callId];
		var onclick = this.onclicks[callId];

		var dayCounter = 1;
		var tr = document.createElement('tr');
		tr.className = 'row';

		for(var i = -dayOffset; i < dayInMonth + 7; i++)
		{
			if(dayCounter % 8 == 0) body.appendChild(tr);

			if(dayCounter % 8 == 0)
			{
				var tr = document.createElement('tr');
				tr.className = 'row';
				dayCounter = 1;
			}

			var td = document.createElement('td');

			if(i >= 0 && i < dayInMonth)
			{
				var d = i + 1;
				var m = this.month[callId];
				var y = this.year[callId];

				if(d == this.dateDump[callId]['day'] && m == this.dateDump[callId]['month'] && y == this.dateDump[callId]['year'])
				{
					td.className = "selected";
				}

				if(d == this.currDate[callId]['day'] && m == this.currDate[callId]['month'] && y == this.currDate[callId]['year'])
				{
					td.className = td.className == '' ? "current" : td.className+" current";
				}

				var subTd = document.createElement('a');
				this.setDayClass(subTd, dayCounter, 'we_day_p', 'smpl_day_p');

				subTd.setAttribute("href", "javascript:jsFormCallendar.Set('"+callId+"', "+d+", "+m+", "+y+")");
				subTd.appendChild(document.createTextNode(d));
			}
			else var subTd = document.createTextNode('');

			td.appendChild(subTd);
			tr.appendChild(td);
			dayCounter++;
		}
	},

	setDayClass: function(element, dnum, wks, sds)
	{
		if(this.weekFormat == 'ru')
		{
			if(dnum % 7 == 0 || (dnum + 1) % 7 == 0) element.className = wks;
				else element.className = sds;
		}
		else
		{
			if(dnum == 1 || dnum == 7 ) element.className = wks;
				else element.className = sds;
		}
	},

	generateHead: function(monYear, body, callId)
	{
		monYear.className = 'top-cal';
		var aPrev = document.createElement('a');
		aPrev.className = 'arch_prev_mon';

		if(isIE)	aPrev.onclick = function(){jsFormCallendar.Prev(callId)};
			else aPrev.setAttribute('onclick', 'jsFormCallendar.Prev(\''+callId+'\'); return false;');

		aPrev.appendChild(document.createTextNode('«'));
		var aNext = document.createElement('a');
		aNext.className = 'arch_next_mon';

		if(isIE) aNext.onclick = function(){jsFormCallendar.Next(callId)};
			else aNext.setAttribute('onclick', 'jsFormCallendar.Next(\''+callId+'\'); return false;');

		aNext.appendChild(document.createTextNode('»'));

		monYear.appendChild(aPrev);
		monYear.appendChild(document.createTextNode(' ' + this.monthNames[this.month[callId]] + ' ' + this.year[callId] + ' '));
		monYear.appendChild(aNext);

		var row = document.createElement('tr');
		row.className = 'arch_head';

		for(var i = 0; i < this.weekDays.length; i++)
		{
			var th = document.createElement('th');
			this.setDayClass(th, i + 1, 'h_we_day', 'h_smpl_day');
			th.appendChild(document.createTextNode(this.weekDays[i]));
			row.appendChild(th);
		}

		body.appendChild(row);
	},

	Prev: function(callId)
	{

		if (this.month[callId] == 0)
		{
			this.month[callId] = 11
			this.year[callId]--;
		}
		else this.month[callId]--;

		this.Print(callId);
	},

	Next: function(callId)
	{
		if (this.month[callId] == 11)
		{
			this.month[callId] = 0;
			this.year[callId]++;
		}
		else this.month[callId]++;

		this.Print(callId);
	},

	Reset: function(callId)
	{
		this.day[callId]		= document.getElementById('callendar_c_day_'+callId).value;
		this.month[callId]		= document.getElementById('callendar_c_month_'+callId).value;
		this.year[callId]		= document.getElementById('callendar_c_year_'+callId).value;
		this.month_name[callId] 	= this._month[this.month[callId]];

		this.Print(callId);
	},

	Set: function(callId, day, month, year)
	{
		document.getElementById('callendar_day_'+callId).value = day;
		document.getElementById('callendar_month_'+callId).value = month;
		document.getElementById('callendar_year_'+callId).value = year;

		var el = document.getElementById('callendar_date_div_'+callId);

		var divs = el.getElementsByTagName('div');
		if (divs.length > 0) el.removeChild(divs[0]);

		newdiv = document.createElement('div');
		newdiv.innerHTML = day + " " + this.monthNamesI[month] + " " + year;
		el.appendChild(newdiv);

		closeCalendar(callId);
	}
}
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('H.2Q={3I:7(){5(3.z()==j){6}5(F.1f("17")==j){3.V=j;3.N=h;F.1m("17",h)}q{3.V=h;3.N=j}},3l:7(a){3.1y=a;5(3.V==h){3.1d(3.Q);3.V=j}},2P:7(c,d){8 e=3;8 f=7(){5(e.K>0)e.K=e.K-e.1n;c=e.1M(c);8 a=y.11(c);5(a!=P||a!=w){8 b="3f: 3e 3d 27 1x 32 "+"1u 2V 1b 2O 2N L\'s "+"1X 2B 1V 1l 1u y, "+"2x 1T a 2t 1l 2q "+"2o; 2m 2l 1u "+"2k 1T 3H a 3G "+"U 1X 3B 1x 3y "+"3v 3u L\'s 1l 3 "+"y. 3t 3s 3r "+"3o 3n 3k 3h 27 1x "+"1V a U: "+c;1o b;}F.1m(c,d);e.A=h;3.S=h;e.Q=c;H.U.1B=c;5(e.z())e.R.1A="/1z.1e?"+c;3.S=j};H.36(f,3.K);3.K=3.K+3.1n},35:7(){5(3.N==h){6 h}q{6 j}},31:7(){6 j},30:7(){6"0.2Z"},1t:7(){8 a=3.1M(H.U.1B);6 a},Q:w,1y:w,R:w,A:w,1n:2U,K:0,V:w,N:w,S:w,2S:7(){8 a=3.1t();3.Q=a;5(3.z()){8 b="<R Y=\'2R: 1s; 21: 20; "+"1Z: 20; 1Y: 29; 2I: 1s; "+"2G: 1s; 1D: 2D;\' "+"1a=\'1j\' L=\'1j\' "+"1A=\'/1z.1e?"+a+"\'>"+"</R>";8 c=y.1I;8 e=y.1G(\'1q\');e.1K=b;c.1p(e);3.1n=2v}8 d=3;H.2u=7(){d.N=w};5(3.z()==j){5(F.1f("17")==j){3.A=h;3.N=h;F.1m("17",h)}q{3.A=j;3.V=h}}q{3.A=h}5(3.z()){3.R=y.11("1j")}8 d=3;8 f=7(){d.2j()};2s(f,2r)},1d:7(a){8 b=F.1Q(a);3.1y.2p(w,a,b)},2j:7(){5(3.z()==j&&3.A==h){3.A=j;6}5(3.z()==j&&3.S==h){6}8 a=3.1t();5(a==3.Q)6;3.S=h;5(3.z()&&3.1P()!=a){3.R.1A="/1z.1e?"+a}q 5(3.z()){6}3.Q=a;3.S=j;3.1d(a)},1P:7(){8 a=y.11("1j");8 b=a.2n.y;8 c=15 W(b.U.1O);5(c.C==1&&c.D(0)=="?")c="";q 5(c.C>=2&&c.D(0)=="?")c=c.1N(1);6 c},1M:7(a){5(a==w||a==P)6 w;q 5(a=="")6"";q 5(a.C==1&&a.D(0)=="#")6"";q 5(a.C>1&&a.D(0)=="#")6 a.1N(1);q 6 a},3F:7(a){5(3.A==h){3.A=j;6}8 b=15 W(a.1O);5(b.C==1&&b.D(0)=="?")b="";q 5(b.C>=2&&b.D(0)=="?")b=b.1N(1);5(3.3E!=h){H.U.1B=b}3.1d(b)},z:7(){8 a=3D.3C.3A();5(y.3z&&a.3x(\'3w\')!=-1){6 h}q{6 j}}};H.F={2i:j,G:15 2h(),1J:j,1m:7(a,b){3.14(a);5(3.1f(a)){3.2f(a)}3.G[a]=b;3.1H()},1Q:7(a){3.14(a);3.13();8 b=3.G[a];5(b==P)6 w;q 6 b},2f:7(a){3.14(a);3.13();3q 3.G[a];3.1H()},3p:7(){3.T.1b="";3.G=15 2h()},1f:7(a){3.14(a);3.13();5(M 3.G[a]=="P")6 j;q 6 h},2e:7(a){6(M a=="1F")},T:w,3j:7(){8 a="1Y: 29; 3i: -1i; 1E: -1i;";5(3.2i==h){a="21: 2d; 1Z: 2d;"}8 b="<18 L=\'2c\' "+"1S=\'2b\' "+"Y=\'1D: 2a; "+a+"\'>"+"<19 L=\'O\' "+"Y=\'"+a+"\'"+"1E: -1i;\' "+"1a=\'O\'>{}</19>"+"</18>";8 c=y.1I;8 e=y.1G(\'1q\');e.1K=b;c.1p(e);3.T=y.11("O")},14:7(a){5(3.2e(a)==j){1o"3c 3b a 3a 28 10 "+"H.F, 28= "+a;}},13:7(){39{5(3.1J==j){8 a=3.T.1b;5(a!=""&&a!=w){3.G=38(\'(\'+a+\')\')}3.1J=h}}37(e){8 b="<18 L=\'2c\' "+"1S=\'2b\' "+"Y=\'1D: 2a;\'>"+"<19 L=\'O\' "+"Y=\'\'"+"1E: -1i;\' "+"1a=\'O\'>{}</19>"+"</18>";8 c=y.1I;8 e=y.1G(\'1q\');e.1K=b;c.1p(e);3.T=y.11("O")}},1H:7(){3.13();8 a=Z.12(3.G);3.T.1b=a}};34.33.1c=\'1c\';8 Z={1v:\'26://25.Z.1v\',2Y:\'(c)2X Z.1v\',24:\'26://25.2W.2T/Z/24.1e\',12:7(a){8 c,i,l,s=\'\',v;X(M a){p\'23\':5(a){5(a.1c==\'1c\'){10(i=0;i<a.C;++i){v=3.12(a[i]);5(s){s+=\',\'}s+=v}6\'[\'+s+\']\'}q 5(M a.1w!=\'P\'){10(i 1l a){v=a[i];5(M v!=\'P\'&&M v!=\'7\'){v=3.12(v);5(s){s+=\',\'}s+=3.12(i)+\':\'+v}}6\'{\'+s+\'}\'}}6\'w\';p\'22\':6 1C(a)?W(a):\'w\';p\'1F\':l=a.C;s=\'"\';10(i=0;i<l;i+=1){c=a.D(i);5(c>=\' \'){5(c==\'\\\\\'||c==\'"\'){s+=\'\\\\\'}s+=c}q{X(c){p\'\\b\':s+=\'\\\\b\';x;p\'\\f\':s+=\'\\\\f\';x;p\'\\n\':s+=\'\\\\n\';x;p\'\\r\':s+=\'\\\\r\';x;p\'\\t\':s+=\'\\\\t\';x;1g:c=c.2M();s+=\'\\\\2L\'+2K.2J(c/16).1w(16)+(c%16).1w(16)}}}6 s+\'"\';p\'2H\':6 W(a);1g:6\'w\'}},3g:7(b){8 c=0;8 d=\' \';7 J(m){1o{1a:\'2F\',2E:m,2C:c-1,3m:b}}7 g(){d=b.D(c);c+=1;6 d}7 B(){I(d!=\'\'&&d<=\' \'){g()}}7 1r(){8 i,s=\'\',t,u;5(d==\'"\'){1W:I(g()){5(d==\'"\'){g();6 s}q 5(d==\'\\\\\'){X(g()){p\'b\':s+=\'\\b\';x;p\'f\':s+=\'\\f\';x;p\'n\':s+=\'\\n\';x;p\'r\':s+=\'\\r\';x;p\'t\':s+=\'\\t\';x;p\'u\':u=0;10(i=0;i<4;i+=1){t=2A(g(),16);5(!1C(t)){x 1W}u=u*16+t}s+=W.2z(u);x;1g:s+=d}}q{s+=d}}}J("1k 1F")}7 2g(){8 a=[];5(d==\'[\'){g();B();5(d==\']\'){g();6 a}I(d){a.2y(1h());B();5(d==\']\'){g();6 a}q 5(d!=\',\'){x}g();B()}}J("1k 2w")}7 1U(){8 k,o={};5(d==\'{\'){g();B();5(d==\'}\'){g();6 o}I(d){k=1r();B();5(d!=\':\'){x}g();o[k]=1h();B();5(d==\'}\'){g();6 o}q 5(d!=\',\'){x}g();B()}}J("1k 23")}7 1L(){8 n=\'\',v;5(d==\'-\'){n=\'-\';g()}I(d>=\'0\'&&d<=\'9\'){n+=d;g()}5(d==\'.\'){n+=\'.\';I(g()&&d>=\'0\'&&d<=\'9\'){n+=d}}5(d==\'e\'||d==\'E\'){n+=\'e\';g();5(d==\'-\'||d==\'+\'){n+=d;g()}I(d>=\'0\'&&d<=\'9\'){n+=d;g()}}v=+n;5(!1C(v)){J("1k 22")}q{6 v}}7 1R(){X(d){p\'t\':5(g()==\'r\'&&g()==\'u\'&&g()==\'e\'){g();6 h}x;p\'f\':5(g()==\'a\'&&g()==\'l\'&&g()==\'s\'&&g()==\'e\'){g();6 j}x;p\'n\':5(g()==\'u\'&&g()==\'l\'&&g()==\'l\'){g();6 w}x}J("3J J")}7 1h(){B();X(d){p\'{\':6 1U();p\'[\':6 2g();p\'"\':6 1r();p\'-\':6 1L();1g:6 d>=\'0\'&&d<=\'9\'?1L():1R()}}6 1h()}};',62,232,'|||this||if|return|function|var||||||||next|true||false||||||case|else||||||null|break|document|isInternetExplorer|ignoreLocationChange|white|length|charAt||historyStorage|storageHash|window|while|error|currentWaitTime|id|typeof|firstLoad|historyStorageField|undefined|currentLocation|iframe|ieAtomicLocationChange|storageField|location|fireOnNewListener|String|switch|style|JSON|for|getElementById|stringify|loadHashTable|assertValidKey|new||DhtmlHistory_pageLoaded|form|textarea|name|value|______array|fireHistoryEvent|html|hasKey|default|val|1000px|DhtmlHistoryFrame|Bad|in|put|WAIT_TIME|throw|appendChild|DIV|str|0px|getCurrentLocation|the|org|toString|not|listener|blank|src|hash|isFinite|visibility|left|string|createElement|saveHashTable|body|hashLoaded|innerHTML|num|removeHash|substring|search|getIFrameHash|get|word|method|to|obj|be|outer|that|position|height|1px|width|number|object|license|www|http|can|key|absolute|hidden|GET|historyStorageForm|30em|isValidKey|remove|arr|Object|debugging|checkLocation|developer|ask|please|contentWindow|Explorer|call|Internet|100|setInterval|bug|onunload|400|array|due|push|fromCharCode|parseInt|might|at|visible|message|JSONError|right|boolean|bottom|floor|Math|u00|charCodeAt|_any_|as|add|dhtmlHistory|border|create|com|200|same|crockford|2005|copyright|05|getVersion|isInternational|have|prototype|Array|isFirstLoad|setTimeout|catch|eval|try|valid|provide|Please|locations|History|Exception|parse|and|top|init|taken|addListener|text|already|is|reset|delete|ID|following|The|HTML|any|msie|indexOf|match|all|toLowerCase|does|userAgent|navigator|pageLoadEvent|iframeLoaded|history|choose|initialize|Syntax'.split('|'),0,{}));
var cache		= new Array();
var isBlocked 	= false;
var JsRequest = {
	req:new Array(),
	rid:new Array(),
	url:new Array(),
	history:new Array(),
	xmlUrl:new Array(),
	reqXSL:new Array(),
	onLoad:null,
	onError:null,
	onProcess:null,
	responseObject:null,
	xml:new Array(),
	timerErrorXSL:new Array(),
	timerErrorXML:new Array(),

	initRequestXSL:function (id)
	{
		if (window.XMLHttpRequest) this.reqXSL[id] = new XMLHttpRequest ();
			else if (window.ActiveXObject) this.reqXSL[id] = new ActiveXObject ("Microsoft.XMLHTTP");

		if (this.reqXSL[id] == null) return false;
		var obj = this;

		this.reqXSL[id].onreadystatechange = function ()
		{
			if (obj.reqXSL[id].readyState == 4)
			{
				clearTimeout(obj.timerErrorXSL[id]);
				if (obj.reqXSL[id].status == 200)
				{
					if (obj.reqXSL[id].onLoad) obj.reqXSL[id].onLoad ();
				}
				else if (obj.reqXSL[id].onError) obj.reqXSL[id].onError ();
			}
		}

		return true;
	},

	openXSL:function (url)
	{
		var id = Math.random();

		if (!this.initRequestXSL (id)) return;
		if (this.onProcess) this.onProcess ();

		this.reqXSL[id].open ("GET", url, false);
		this.reqXSL[id].send (null);
		this.timerErrorXSL[id] = setTimeout("JsRequest.etimeout("+id+");", 40000);

		return id;
	},

	initRequest:function (id)
	{
		if (window.XMLHttpRequest)
		{
			try {
				this.req[id] = new XMLHttpRequest();
			} catch (e){}
		}
		else if (window.ActiveXObject)
		{
			try {
				this.req[id] = new ActiveXObject('Msxml2.XMLHTTP');
			}
			catch (e)
			{
				try {
					this.req[id] = new ActiveXObject('Microsoft.XMLHTTP');
				} catch (e){}
			}
		}

		if (this.req[id] == null) return false;
		var obj = this;

		this.req[id].onreadystatechange = function ()
		{
			if (obj.req[id].readyState == 4)
			{
				clearTimeout(obj.timerErrorXML[id]);
				if (obj.req[id].status == 200)
				{
					if (obj.req[id].onLoad) obj.req[id].onLoad ();
					obj.handleResponse(id);
				}
				else if (obj.req[id].onError) obj.req[id].onError ();
			}
		}

		return true;
	},

	etimeout:function (id)
	{
		try
		{
			this.req[id].abort();
			unblock();
			alert("Время ожидания ответа сервера истекло.");
		} catch (e) {}
	},

	openPOST:function (url, postData)
	{
		var id = Math.random ();

		if (!this.initRequest (id)) return;
		if (this.onProcess) this.onProcess ();

		this.req[id].open ("POST", url, true);
		this.req[id].setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		this.req[id].send (postData);
		this.timerErrorXML[id] = setTimeout("JsRequest.etimeout("+id+");", 40000);
	},

	openGET:function (url, rid, history)
	{
		var id = Math.random ();

		if (!this.initRequest (id)) return;
		if (this.onProcess) this.onProcess ();

		this.req[id].open ("GET", url, true);
		this.req[id].send (null);
		this.timerErrorXML[id] = setTimeout("JsRequest.etimeout("+id+");", 40000);
		this.rid[id] = rid;
		this.url[id] = url;
		this.history[id] = history;
		this.xmlUrl[id] = url;
	},

	handleResponse:function (id)
	{
		var xmlDoc = Sarissa.getDomDocument();
		try
		{
			var xmlDoc = this.req[id].responseXML;
			var replaceId = this.rid[id];
			if(!xmlDoc) throw("Bad XML was responsed!");
			if(xmlDoc.selectSingleNode('/index/errors') || xmlDoc.selectSingleNode('/index/chselect') || xmlDoc.selectSingleNode('/index/function'))
			{
				if (xmlDoc.selectSingleNode('/index/errors')) this.setFormErrors(xmlDoc);
				if (xmlDoc.selectSingleNode('/index/chselect'))
				{
					this.chSelect(xmlDoc);
					unblock(scrollUp, true);
					return true;
				}
				if(xmlDoc.selectSingleNode('/index/function')) this.callBackHandler(xmlDoc);

				if (!xmlDoc.selectSingleNode('/index/function/block')) unblock(scrollUp);
				return true;
			}
			if (xmlDoc.selectSingleNode('/index/redirect'))
			{
				location.href = Sarissa.getText(xmlDoc.selectSingleNode('/index/redirect'));
				return false;
			}
			if (mtitle = xmlDoc.selectSingleNode('/index/data/meta-title')) document.title = Sarissa.getText(mtitle);
			if (!replaceId) replaceId = Sarissa.getText(xmlDoc.selectSingleNode('/index/data/id'));
			navId = Sarissa.getText(xmlDoc.selectSingleNode('/index/data/nav-id'));
			var oldId = '';
			try {
				if (!(replaceId && document.getElementById(replaceId)))
				{
					replaceSiblingId = xmlDoc.selectNodes('/index/data/siblilng-id');
					for (var i=0; replaceSiblingId.length; i++)
					{
						if (document.getElementById(Sarissa.getText(replaceSiblingId[i])))
						{
							oldId = Sarissa.getText(replaceSiblingId[i]);
						}
					}
				}
				else oldId = replaceId;
			} catch(e) {};
			try {BaseXml = Sarissa.getText(xmlDoc.selectSingleNode('/index/data/base-xml'))} catch(e) {};
			if (replaceId == "_") window.location = Sarissa.getText(xmlDoc.selectSingleNode('/index/data/base-html'));
			var xslSrc = Sarissa.getText(xmlDoc.selectSingleNode('/index/data/xsl'));
			var xslId = Sarissa.getText(xmlDoc.selectSingleNode('/index/data/xsl-cache-id'));
			var scrollUp = Sarissa.getText(xmlDoc.selectSingleNode('/index/data/scroll-up'));
		}
		catch (e)
		{
			alert(e);
			document.write(this.req[id].responseText);
			document.close();
			alert(this.req[id].responseText)
			return false;
		}

		if (!cache[xslId])
		{
			idXSL = this.openXSL(xslSrc);
			var xslDoc = Sarissa.getDomDocument();
			var xslDoc = this.reqXSL[idXSL].responseXML;
		}
		else xslDoc = cache[xslId];

		if (document.getElementById(oldId))
		{
			try {
				if (!this.history[id]) dhtmlHistory.add(navId, this.url[id]);
			} catch(e){}
			var processor = new XSLTProcessor();
			processor.importStylesheet(xslDoc);
			var newDocument = processor.transformToDocument(xmlDoc);
			newText = new XMLSerializer().serializeToString(newDocument.selectSingleNode('/index/body'));
			var repl = document.getElementById(oldId);
			repl.style.display = 'none';
			repl.innerHTML = newText;
			repl.id = replaceId;
			go_decoding();
			textareaPrepare();
			try {
				if (jQuery) $('#'+replaceId).fadeIn('slow', function() {unblock(scrollUp);});
			} catch (e) {
				repl.style.display = 'block';
				unblock(scrollUp);
			}
		}
		else get(BaseXml);
		delete this.req[id];
		delete this.reqXSL[idXSL];
		delete this.rid[id];
	},

	callBackHandler:function (obj)
	{
	    	var items = obj.selectNodes('/index/function');

	    	for(var i = 0; i < items.length; i++)
	    	{
	    		var functionName = items[i].getAttribute('name');

	    		var xmlCBDocument = Sarissa.getDomDocument();
	    		var index = xmlCBDocument.createElement('index');
	    		xmlCBDocument.appendChild(index);
	    		var nodes = obj.selectNodes('/index/function/*');

	    		for(var o = 0; o < nodes.length; o++)
	    		{
	    			var tmpNode = nodes[o].cloneNode(true);
	    			index.appendChild(tmpNode);
	    		}

	    		eval(functionName+'(xmlCBDocument)');
	    	}
	},

	setFormErrors:function (obj)
	{
		var formName = obj.selectSingleNode('/index').getAttribute('name');
		var item = obj.selectNodes('/index/errors/error');

		for(var i=0; i<item.length; i++)
		{
			var name	= item[i].getAttribute('name');
			var pclass	= item[i].getAttribute('class');
			var text	= Sarissa.getText(item[i]);
			var id		= formName + '_' + name + '_error';

			var elem	= document.getElementById(id)
			elem.innerHTML = text;

			if (pclass) elem.className = elem.className + ' ' + pclass;
				else elem.className = 'error';

			elem.style.display = 'block';
		}

		try {killMessage()} catch (e) {}
	},

	chSelect:function (obj)
	{
		var name = obj.selectSingleNode('/index/chselect').getAttribute('name');
		var item = obj.selectNodes('/index/chselect/o');
		var item1 = obj.selectNodes('/index/chselect/o1');
		var title = obj.selectNodes('/index/chselect/first');
		var clear = obj.selectNodes('/index/clear');
		var elem = document.getElementsByName(name);
		elem = elem[0];
		if (clear)
		{
			for(var i=0; i<clear.length; i++)
			{
				var celem = document.getElementsByName(Sarissa.getText(clear[i]));

				celem = celem[0];

				celem.options.length = 0;
				var opt = document.createElement("option")
				celem.options.add(opt);
				opt.text	= '-- выберите значение --';
				opt.value	= '';
			}
			try
			{
				if (Sarissa.getText(clear[0]) == 'series')
				{
					var series = obj.selectNodes('/index/series1');
					var el1 = document.getElementById('series1');
					if (Sarissa.getText(series[0]) == '0') el1.className = 'hideel';
					if (Sarissa.getText(series[0]) == '1')
					{
						var el2 = document.getElementById('series');
						el2.className = 'showel';

						el2.options.length = 0
						var opt = document.createElement("option")
						el2.options.add(opt);
						opt.text	= '-- выберите значение --';
						opt.value	= '';

						for(var i=0; i<item1.length; i++)
						{
							var value	= item1[i].getAttribute('v');
							var text	= Sarissa.getText(item1[i]);

							var opt 	= document.createElement("option");
							opt.text	= text;
							opt.value	= value;

							el2.options.add(opt);
						}
					}
				}
			} catch(e){}
		}

		elem.options.length = 0
		var opt = document.createElement("option")
		elem.options.add(opt);
		try
		{
			if (title[0].getAttribute('first') != '') opt.text = title[0].getAttribute('v')
				else opt.text = '-- выберите значение --';
		} catch (e) {opt.text = '-- выберите значение --';}
		opt.value	= '';

		for(var i=0; i<item.length; i++)
		{
			var value	= item[i].getAttribute('v');
			var text	= Sarissa.getText(item[i]);
			var opt 	= document.createElement("option");
			opt.text	= text;
			opt.value	= value;

			elem.options.add(opt);
		}
		if (elem.options.length < 2) elem.disabled = true;
			else elem.disabled = false;
	}
}
function loadFromCache(a){var b=cache[a];replaceId=Sarissa.getText(b.selectSingleNode('/index/data/id'));var c=Sarissa.getText(b.selectSingleNode('/index/data/xsl'));var d=Sarissa.getText(b.selectSingleNode('/index/data/xsl-cache-id'));if(!cache[d]){idXSL=this.openXSL(c);var e=Sarissa.getDomDocument();var e=this.reqXSL[idXSL].responseXML;cache[d]=e}else e=cache[d];var f=new XSLTProcessor();f.importStylesheet(e);var g=f.transformToDocument(b);newText=new XMLSerializer().serializeToString(g.selectSingleNode('/index/body'));document.getElementById(replaceId).style.display='none';document.getElementById(replaceId).innerHTML=newText;document.getElementById(replaceId).style.display='block';unblock();go_decoding()}function get(a,b){a=a.replace('.html','.xml');if(a){block();hintHide();if(!cache[a]){loading();JsRequest.openGET(a,false,b)}else loadFromCache(a);return false}else{return true}}function nhget(a){get(a,true)}function rget(a,b){JsRequest.openGET(a,b)}function post(a,b){a=a.replace('.html','.xml');if(a){block();loading();JsRequest.openPOST(a,b);return false}else{return true}}function block(){try{var a=document.getElementById('blocking');if(isIE)a.style.filter="progid:DXImageTransform.Microsoft.BasicImage(opacity=0.2)";else a.style.opacity=0.2;a.style.width=getDocumentWidth()+'px';a.style.height=document.getElementById('allPage').offsetHeight}catch(e){}try{var a=document.getElementById('loading');if(isIE)a.style.filter="progid:DXImageTransform.Microsoft.BasicImage(opacity=0.7)";else a.style.opacity=0.7}catch(e){}try{document.getElementById('blocking').style.display='block';isBlocked=true}catch(e){}}function blockById(a){try{document.getElementById(a).style.display='block';isBlocked=true}catch(e){}}function loading(){try{document.getElementById('loading').style.display='block'}catch(e){}}function unblock(a,b){if(!b)onLoad(true);try{document.getElementById('blocking').style.display='none';document.getElementById('loading').style.display='none';isBlocked=false;if(a=='yes')document.body.scrollTop=0}catch(e){}}function unblockById(a,b){try{document.getElementById('loading').style.display='none';document.getElementById(a).style.display='none';isBlocked=false;if(b=='yes')document.body.scrollTop=0}catch(e){}onLoad(true)}function bodySize(){}function init(){if(isIE)bodySize()}onload=init;if(isIE)onresize=bodySize;
var bannersInPlaces=new Array();var bannersPlacesList=new Array();var currentBanner=new Array();var isFirst=1;var bannersPlacesShow=new Array();function startRotation(){if(bannersPlacesList.length>0){for(var a=0;a<bannersPlacesList.length;a++){var b=bannersPlacesList[a];if(bannersPlacesShow[b]==1){showNextBanner(b);if(bannersInPlaces[b+'_re']=='true'){window.setInterval('showNextBanner(\''+b+'\')',bannersInPlaces[b+'_rt'])}}}isFirst=0}}function showNextBanner(a){var b=bannersInPlaces[a].length;if(isFirst==0){var c=getNextBanner(a,b);var d=currentBanner[a];var e=bannersInPlaces[a][d-1];var f=document.getElementById('b_'+a+'_'+e);if(f){f.style.display='none'}}else{var c=b>0?1:null}if(c!=null){currentBanner[a]=c;var g=bannersInPlaces[a][c-1];var h=document.getElementById('b_'+a+'_'+g);if(h){h.style.display='block'}}else{return}}function getNextBanner(a,b){var c=currentBanner[a];if((c+1)<=b){return(c+1)}else{return 1}}
var user_agent=null;var oX=10;var oY=15;var img_height=null;var curEditedElement=null;switch(true){case navigator.userAgent.indexOf("Opera")>-1:user_agent="Opera";window.captureEvents(Event.MOUSEMOVE);window.onmousemove=function(e){mouseX=e.pageX;mouseY=e.pageY};break;case navigator.userAgent.indexOf("MSIE")>-1:user_agent="IE";break;case navigator.userAgent.indexOf("Gecko")>-1:user_agent="Gecko";window.captureEvents(Event.MOUSEMOVE);window.onmousemove=function(e){mouseX=e.pageX;mouseY=e.pageY};break}var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function encode64(input){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;do{chr1=input.charCodeAt(i++);chr2=input.charCodeAt(i++);chr3=input.charCodeAt(i++);enc1=chr1>>2;enc2=((chr1&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64}else if(isNaN(chr3)){enc4=64}output=output+keyStr.charAt(enc1)+keyStr.charAt(enc2)+keyStr.charAt(enc3)+keyStr.charAt(enc4)}while(i<input.length);return output}
function decode64(input) {
	var output = "";
	var chr1, chr2, chr3;
	var enc1, enc2, enc3, enc4;
	var i = 0;
	input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
	do {
		enc1 = keyStr.indexOf(input.charAt(i++));
		enc2 = keyStr.indexOf(input.charAt(i++));
		enc3 = keyStr.indexOf(input.charAt(i++));
		enc4 = keyStr.indexOf(input.charAt(i++));
		chr1 = (enc1 << 2) | (enc2 >> 4);
		chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
		chr3 = ((enc3 & 3) << 6) | enc4;
		output = output + String.fromCharCode(chr1);
		if (enc3 != 64) output = output + String.fromCharCode(chr2);
		if (enc4 != 64) output = output + String.fromCharCode(chr3);
	} while (i < input.length);
	return output;
}
function uriHashRewrite()
{
	var query	= location.href;
	var hash	= location.hash;
	if (!hash) return false;

	query 		= query.replace(hash, '');
	hash 		= hash.replace('#', '')
	if (query.split('?').length > 1) query += '&__hash=' + hash;
		else query += '?__hash=' + hash;
	return query;
}
function uriHashRm()
{
	var query	= location.href;
	var hash	= location.hash;
	if (!hash) return false;
	query = query.replace(hash, '');
	return query;
}
function getCookie(c_name)
{
	if (document.cookie.length>0)
	{
		c_start=document.cookie.indexOf(c_name + "=")
		if (c_start!=-1)
		{
			c_start=c_start + c_name.length+1
			c_end=document.cookie.indexOf(";",c_start)
			if (c_end==-1) c_end=document.cookie.length
				return unescape(document.cookie.substring(c_start,c_end))
		}
	}
	return ""
}

function uriHashToCookie()
{
	var hash = location.hash;
	if (hash) return true;
	return false;
}


function historyChange(newLocation, historyData)
{
	if (historyData) get(historyData, true);
}

function otherShow()
{
	document.getElementById('_bullets').style.display = 'none';
	document.getElementById('_other').style.display = 'block';
}
function otherHide()
{
	document.getElementById('_bullets').style.display = 'block';
	document.getElementById('_other').style.display = 'none';
	document.getElementById('r6').value = '';
	document.getElementById('r7').value = '';
}
var sd = Array();
function showDown(id, url_)
{
	if (!sd[url_])
	{
		rget(url_, id);
		sd[url_] = true;
	}
	document.getElementById(id).style.visibility = 'visible';
}
function hideDown(id)
{
	document.getElementById(id).style.visibility = 'hidden';
}
function hintLoad(id, x, y, img_id)
{
	var hint = document.getElementById('drop_down');
	var source = document.getElementById(id);
	if (x) {oX = x} else {oX = 10}
	if (y) {oY = y} else {oY = 15}
	hint.innerHTML = source.innerHTML;
}
function hintShow()
{
	if (!isBlocked)
	{
		var hint = document.getElementById('drop_down');
		var hintHeight = hint.clientHeight;
		if (isIE) {mouseX = window.event.x}
		if (isIE) {mouseY = window.event.y + (document.documentElement?document.documentElement.scrollTop:document.body.scrollTop);}
		var limit = document.body.clientHeight + window.pageYOffset;
		var bottom = hintHeight + mouseY + oY;
		var hint = document.getElementById('drop_down');
		hint.style.left = (oX + mouseX) + 'px';
		if ((bottom)<limit) hint.style.top = (oY + mouseY) + 'px';
			else hint.style.top = limit - hintHeight + 'px';
	}
}
function hintHide()
{
	try
	{
		var hint = document.getElementById('drop_down');
		hint.style.left = '-10000px';
		hint.style.top = '-10000px';
	} catch (e) {}
}
function clearElem(id)
{
	try
	{
		document.getElementById(id).innerHTML = '';
		document.getElementById(id).style.display = 'none';
	}
	catch (e)
	{
		// debug here
	}
}
function setElem(id, text)
{
	document.getElementById(id).innerHTML = text;
	document.getElementById(id).style.display = 'block';
}

function textareaPrepare()
{
	var textA = document.body.getElementsByTagName("TEXTAREA");
	for (var i=0; i<textA.length; i++)
		if (textA.item(i).value == '--!--' || textA.item(i).value == '<!---->') textA.item(i).value = '';
}

function onLoad(noHistory)
{
	if (!noHistory)
	{
		window.historyStorage.init();
		window.dhtmlHistory.create();

		try{
			dhtmlHistory.initialize();
			dhtmlHistory.addListener(historyChange);

			if (dhtmlHistory.isFirstLoad()){}
		} catch (e) {}

	}

	var jsSrc = '';
	try
	{
		var clear = document.getElementsByName('button_clear');
		clear[0].style.display = 'inline';
	} catch (e) {}
	if (document.body.getElementsByTagName('FORM'))
	{
		var error = document.body.getElementsByTagName('DIV');
		for (var i=0; i<error.length; i++)
		{
			if (error.item(i).getAttribute('name') == 'file_ajax') error.item(i).style.display = 'inline';
			if (error.item(i).getAttribute('name') == 'file_red')
			{
				error.item(i).style.display = 'none';
				error.item(i).innerHTML = '';
			}
			if(error.item(i).getAttribute('name') == 'embeded_script') jsSrc += error.item(i).innerHTML;
		}
	}
	textareaPrepare();
	try
	{
		if (isIE)
		{
			var elements = document.forms['login'].elements;
			elements['login'].value = getCookie('login');
			elements['psw'].value = decode64(getCookie('password'));
		}
	}
	catch (e) {}
	try {eval(jsSrc)} catch (e) {alert("Error in embeded script:" + e + '  (' + e.description + ')')};
	try {
		var divforieinfooter = document.createElement('div');
		divforieinfooter.innerHTML = '<!--x-->';
		document.getElementById('footer').appendChild(divforieinfooter);
	}catch (e) { }
	document.close();
}

function getDocumentHeight()
{
	return (document.body.scrollHeight > document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight;
}

function getDocumentWidth()
{
	return (document.body.scrollWidth > document.body.offsetWidth)?document.body.scrollWidth:document.body.offsetWidth;
}
function killMessage()
{
	if (document.body.getElementsByTagName('FORM'))
	{
		var error = document.body.getElementsByTagName('DIV');
		for (var i=0; i<error.length; i++)
		{
			if (error.item(i).className == 'message')
			{
				error.item(i).style.display = 'none';
				style.display = 'inline';
			}
		}
	}
}
function fileUpload(id)
{
	var src = document.getElementById('copy');
	var dest = document.getElementById('dest');
	dest.innerHTML = src.innerHTML;
}
function onIframeLoading(id, loadingShow)
{
	if (loadingShow)
	{
		var loading = document.getElementById(id + '_loading');
		loading.style.display = 'block';
		var done = document.getElementById(id + '_done');
		done.style.display = 'none';
	}
	if (isIE)
	{
		try
		{
			var iframe =  document.frames[id+'_frame'].document.getElementById('good');
			var result = iframe.getAttribute('name');
			var loading = document.getElementById(id + '_loading');
			loading.style.display = 'none';
			var done = document.getElementById(id + '_done');
			done.style.display = 'block';
			var tmp = document.getElementById(id + '_tmp');
			tmp.value = result;
			var name = iframe.innerHTML;
			var show = document.getElementById(id + '_show');
			show.innerHTML = name;
			iframe.id = '0o0o0o';
		} catch (e)
		{
			window.setTimeout('onIframeLoading("'+id+'")', 200);
		}
	}
	else
	{
		try
		{
			var iframe = top.document.getElementById(id+'_frame').contentDocument.getElementById('good');
			var result = iframe.getAttribute('name');
			var loading = document.getElementById(id + '_loading');
			loading.style.display = 'none';
			var done = document.getElementById(id + '_done');
			done.style.display = 'block';
			var tmp = document.getElementById(id + '_tmp');
			tmp.value = result;
			var name = iframe.innerHTML;
			var show = document.getElementById(id + '_show');
			show.innerHTML = name;
			iframe.id = '0o0o0o';
		} catch (e)
		{
			window.setTimeout('onIframeLoading("'+id+'")', 200);
		}
	}
}
function activeStyle(obj)
{
	var item = document.body.getElementsByTagName('DIV');
	var currStyle	= obj.className;
	for (var i=0; i<item.length; i++)
		if (item[i].getAttribute('name') == 'menu') item[i].className = currStyle;
	obj.className	= currStyle + ' active';
}
function show(id)
{
	if (id.constructor == Array)
	{
		for (var i=0; i<id.length; i++) try {document.getElementById(id[i]).style.display = 'block';} catch (e) {};
	}
	else
	{
		try {document.getElementById(id).style.display = 'block';} catch (e) {};
	}
}
function hide(id)
{
	if (id.constructor == Array)
	{
		for (var i=0; i<id.length; i++) try {document.getElementById(id[i]).style.display = 'none';} catch (e) {};
	}
	else
	{
		try {document.getElementById(id).style.display = 'none';} catch (e) {};
	}
}
function style(obj, stl)
{
	obj.className = stl;
}

function setCookie(name, value, expires, path, domain, secure) {
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

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