

var htrequest;
var htrequest_typ='';
var htrequest_method='';
function load_htreq(url,targetfce) {

	if (window.XMLHttpRequest) {

		htrequest=new XMLHttpRequest();
		}
	else if (window.ActiveXObject) {
		try {
			htrequest=new ActiveXObject('Microsoft.XMLHTTP');
			}
		catch(e) {
			htrequest=new ActiveXObject('Msxml2.XMLHTTP');
			}
		}
	else {

		return false;
		}

	if (htrequest_method=='post')
		htrequest.open('POST',url,true);
	else
		htrequest.open('GET',url,true);

	try {
/*		htrequest.overrideMimeType("text/html; charset=windows-1250");*/
		}
	catch(e) {

		}

	htrequest.onreadystatechange=targetfce;

	if (htrequest_method=='post') {
		htrequest.setRequestHeader("Content-type","application/x-www-form-urlencoded");
		htrequest.send(htrequest_params);
		}
	else {
		htrequest.send(null);
		}

	htrequest_params='';

	return true;
	}


function htrequest_res() {

	if (htrequest.readyState==4 && htrequest.status==200) {

		htrequest_parse();
		}
	else if (htrequest.readyState==4 && htrequest.status!=200) {
  
		}
	}

function htrequest_parse() {

	if (htrequest.responseText.length>0) {

		if (htrequest_typ=='okresobec') {
	
			tmp=document.getElementById('idobec-blk');
			tmp.innerHTML=htrequest.responseText;
			}
		else if (htrequest_typ=='kdetozije') {
	
			tmp=document.getElementById('ikdetozije-hld');
			tmp.innerHTML=htrequest.responseText;

			mmn_kdetozije_anim_content=tmp.offsetHeight;
			}
		}
	}


function zfoto(foto,sirka,vyska) {

	try {

		window.open('/_data/clscripts/foto.php?f='+foto,'','scrollbars=yes,width='+(sirka+40)+',height='+(vyska+40));
		}
	catch (e) {

		}
	}

function load_script(url) {

	var head=document.getElementsByTagName('head').item(0);
	var old=document.getElementById('last_id');
	if (old)head.removeChild(old);
	script=document.createElement('script');
	script.src=url;
	script.type='text/javascript';
	script.defer=true;
	script.id='last_id';
	void(head.appendChild(script));
	}

function vlozjsemail(str) {

	str=str.replace(/\|/g,'.');
	str=str.replace(/\{/g,'c');
	str=str.replace(/;/g,'z');
	str=str.replace(/:/g,'a');
	str=str.replace(/>/g,'i');
	str=str.replace(/\}/g,'o');
	str=str.replace(/a1#a93z9/g,'@');

	document.write(str);
	}

var selid;

function tclearselect() {

	while (selid.options.length) selid.remove(0);
	}

function titemadd(id,nazev) {

	var it=document.createElement("OPTION");

	selid.options.add(it);
	it.value=id;
	it.innerHTML=nazev;
	}

function setoznac(idinzerat,iduser,mhash,mset) {

	load_script('/_data/clscripts/setoznac.php?id='+idinzerat+'&iduser='+iduser+'&h='+mhash+'&set='+((mset)?(1):(0)));
	}


function vlozjsemail(str) {

	str=str.replace(/\|/g,'.');
	str=str.replace(/\{/g,'c');
	str=str.replace(/;/g,'z');
	str=str.replace(/:/g,'a');
	str=str.replace(/>/g,'i');
	str=str.replace(/\}/g,'o');
	str=str.replace(/a1#a93z9/g,'@');

	document.write(str);
	}

function forum_hlasuj(idtema,idreakce,hlasu) {

	load_script('/_data/clscripts/forumhlasuj.php?s=hlasuj&idtema='+idtema+'&idreakce='+idreakce+'&hlasu='+hlasu);
	}


var stylzap=new Array();

function pgz_vlozitnakurzor(xid,hodnota) {

	try {

		tmpid=document.getElementById(xid);

		if (document.selection) {

			tmpid.focus();
			sel = document.selection.createRange();
			sel.text = hodnota;
			}
		else if (tmpid.selectionStart || tmpid.selectionStart == '0') {

			var startPos = tmpid.selectionStart;
			var endPos = tmpid.selectionEnd;

			tmpid.value = tmpid.value.substring(0, startPos) + hodnota + tmpid.value.substring(endPos,tmpid.value.length);
				}
		else {
			tmpid.value += hodnota;
			}
		}
	catch(e) {

		}
	}

function editsetstyle(styl) {
	
	var textp=document.getElementById('i-text');

	switch(styl) {
		case "tucne":

			if (stylzap[0]==1) stylzap[0]=0;
			else stylzap[0]=1;
/*
			if (stylzap[0]==1) pgz_vlozitnakurzor('i-text','[tucne]');
			else pgz_vlozitnakurzor('i-text','[/tucne]');
*/
			if (stylzap[0]==1) textp.value+='[tucne]';
			else textp.value+='[/tucne]';

		break;
		case "naklonene":

			if (stylzap[1]==1) stylzap[1]=0;
			else stylzap[1]=1;

			if (stylzap[1]==1) textp.value+='[naklonene]';
			else textp.value+='[/naklonene]';

		break;
		case "podtrzene":

			if (stylzap[2]==1) stylzap[2]=0;
			else stylzap[2]=1;

			if (stylzap[2]==1) textp.value+='[podtrzene]';
			else textp.value+='[/podtrzene]';

		break;
		case "kod":

			if (stylzap[3]==1) stylzap[3]=0;
			else stylzap[3]=1;

			if (stylzap[3]==1) textp.value+='[kod]';
			else textp.value+='[/kod]';

		break;
		case "podtrzene":

			if (stylzap[4]==1) stylzap[0]=0;
			else stylzap[4]=1;

			if (stylzap[4]==1) textp.value+='[podtrzene]';
			else textp.value+='[/podtrzene]';

		break;
		case "barva-red":

			if (stylzap[5]==1) stylzap[5]=0;
			else stylzap[5]=1;

			if (stylzap[5]==1) textp.value+='[barva=red]';
			else textp.value+='[/barva]';

		break;
		case "barva-green":

			if (stylzap[5]==1) stylzap[5]=0;
			else stylzap[5]=1;

			if (stylzap[5]==1) textp.value+='[barva=green]';
			else textp.value+='[/barva]';

		break;
		case "barva-blue":

			if (stylzap[5]==1) stylzap[5]=0;
			else stylzap[5]=1;

			if (stylzap[5]==1) textp.value+='[barva=blue]';
			else textp.value+='[/barva]';

		break;
		case "podnadpis":

			if (stylzap[6]==1) stylzap[6]=0;
			else stylzap[6]=1;

			if (stylzap[6]==1) textp.value+='[podnadpis]';
			else textp.value+='[/podnadpis]';

		break;
		case "podnadpis2":

			if (stylzap[7]==1) stylzap[7]=0;
			else stylzap[7]=1;

			if (stylzap[7]==1) textp.value+='[podnadpis2]';
			else textp.value+='[/podnadpis2]';

		break;
		}
	textp.focus();
	}


function regoverjs(i) {

	load_script('/_data/clscripts/overjs.php?i='+i);
	}


function zobrazfoto(idalbum,xfoto) {

	foto=document.getElementById('fdetail');

	foto.src='/_data/fotoalbum/'+idalbum+'/'+xfoto+'-1.jpg';
	foto.style.width='auto';
	foto.style.height='auto';

	return false;
	}

function vlozupozim() {

	document.write('<tr>');
	document.write('<td colspan="2" class="upozimp">(tento inzer�t byl jednor�zov� vlo�en z partnersk�ho serveru)</td>');
	document.write('</tr>');
	}

function jot(j) {

	window.open('http://'+j);
	}

function zkontroluj(iditem,upozorn) {

	try {

		if (document.getElementById(iditem).value!='') return true;
		}
	catch(e) {

		}

	if (upozorn!='') alert(upozorn);

	return false;
	}

var fxhodno=0;
function fhodno(znamka) {

	if (znamka==0) znamka=fxhodno;
	for (var i=1;i<=5;i++) { 

		if (i<=znamka)
			document.getElementById('xfhodn'+i).src='/_data/styles/img/hodn-star-on.png';
		else
			document.getElementById('xfhodn'+i).src='/_data/styles/img/hodn-star-off.png';
		}
	}

function fhodn(znamka,inzerat) {

	load_script('/_data/clscripts/sethodnocenifast.php?id='+inzerat+'&znamka='+znamka);
	}



function forumskoktema(idtema) {

	if (idtema>0) {

		location.href='/forum/tema/'+idtema+'/';
		}
	}

var sledujzmeny_kde='';
function mn_sledujzmeny_do() {

	load_script('/_data/clscripts/sledujzmeny.php?k='+sledujzmeny_kde);
	}

function mn_sledujzmeny() {

	window.setInterval('mn_sledujzmeny_do()',7000);
	}

function mn_udalostdel(id) {

	load_script('/_data/clscripts/udaldel.php?i='+id);
	}

//var sledujglobal_var=new Array();
function mn_sledujglobal_do() {

	load_script('/_data/clscripts/sledujglobal.php');
//	load_script('/_data/clscripts/sledujglobal.php?neprecteno='+sledujglobal_var['neprecteno']+'&nevzajemne='+sledujglobal_var['nevzajemne']);
	}

function mn_sledujglobal() {

	window.setInterval('mn_sledujglobal_do()',10000);
	}


var mn_sledujglobal_pole=new Array();
mn_sledujglobal_pole['vzkazy']=0;
mn_sledujglobal_pole['nevzajemne']=0;
mn_sledujglobal_pole['onpratele']=0;
mn_sledujglobal_pole['sledovano']=0;
mn_sledujglobal_pole['kosik']=0;

var mn_sledujglobal_cycle=new Array();
mn_sledujglobal_cycle['vzkazy']=0;
mn_sledujglobal_cycle['nevzajemne']=0;
mn_sledujglobal_cycle['onpratele']=0;
mn_sledujglobal_cycle['sledovano']=0;
mn_sledujglobal_cycle['kosik']=0;

function mn_sledujglobal_set(klic,hodnota) {

	tmp=document.getElementById('tw-item-'+klic);

	if (hodnota==-1) {

		tmp.style.display='block';
		tmp.innerHTML='POZOR - NEJSTE PŘIHLÁŠEN !!!';
		mn_meta_title_init();

		return true;
		}

	if (hodnota>0)
		tmp.style.display='block';
	else
		tmp.style.display='none';

	try {

		tmp.getElementsByTagName('span')[0].innerHTML=hodnota;
		}
	catch(e) {

		}

	if (klic=='nevzajemne' || klic=='vzkazy' || klic=='sledovano') {

		try {

			if (mn_sledujglobal_pole[klic]!=hodnota && hodnota>0) {

				if (mn_sledujglobal_cycle[klic]==0) {

					try {

						tmp=document.getElementById('tw-item-'+klic+'-a').innerHTML;

						document.getElementById('tw-item-'+klic+'-a').innerHTML=tmp+' +';
						}
					catch(e) {

						}

					mn_sledujglobal_cycle[klic]=1;
					}

				mn_meta_title_init();
				mn_sledujglobal_pole[klic]=hodnota;
				}

			}
		catch(e) {

			}
		}
	}

/* foto lightbox start */


var pgz_wwx=0;
var pgz_wwy=0;
var pgz_scrolly=0;


function pgz_window_onresize() {

	if (typeof(window.innerWidth)=='number') {
		pgz_wwx=window.innerWidth;
		pgz_wwy=window.innerHeight;
		}
	else if (document.documentElement && (document.documentElement.clientWidth ||
	document.documentElement.clientHeight)) {
		pgz_wwx=document.documentElement.clientWidth;
		pgz_wwy=document.documentElement.clientHeight;
		}
	else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
		pgz_wwx=document.body.clientWidth;
		pgz_wwy=document.body.clientHeight;
		}
/*
	if (pgz_lightbox_activated==1) {

		pgz_lightbox_refresh++;

		window.setTimeout('pgz_light_refresh('+pgz_lightbox_refresh+')',50);
		}
*/
/*
	if (pgz_lightbox_activated==1) {
		pgz_light_close();
		pgz_xdebug('1');	
		}
*/
	}


function pgz_window_onscroll() {

	try {
		
		if (document.body.scrollTop==0)
			pgz_scrolly=document.documentElement.scrollTop;
		else
			pgz_scrolly=document.body.scrollTop;
	
		}
	catch(e) {
	
		}

	if (pgz_lightbox_activated==1) {
		pgz_light_close();
//		pgz_xdebug('2');	
		}
	}


function pgz_light_refresh(kontrola) {

	if (pgz_lightbox_refresh==kontrola) {

		pgz_light_close();
//		pgz_xdebug('3');
		pgz_light_activate(null);

		pgz_lightbox_refresh=0;
		}
	}

pgz_window_onresize();
pgz_window_onscroll();

var pgz_lightbox_refresh=0;

var pgz_lightbox_activated=0;
var pgz_lightbox_fotky=new Array();
var pgz_lightbox_fotky_l=new Array();
var pgz_lightbox_fotky_x=new Array();
var pgz_lightbox_fotky_y=new Array();
var pgz_lightbox_fotky_ozn=new Array();
var pgz_lightbox_fotky_ano=new Array();
var pgz_lightbox_title='';
var pgz_lightbox_act=0;
var pgz_lightbox_count=0;
var pgz_lightbox_blockmove=0;
var pgz_lightbox_maxx=0;
var pgz_lightbox_maxy=0;

function pgz_keydown(e) {

	if (pgz_lightbox_activated==1) {

		if(!e) if (window.event) e=window.event;
	
		var key;
		if (typeof(e.which)=='number') key=e.which;
		else if (typeof(e.keyCode)=='number') key=e.keyCode;
		else if (typeof(e.charCode)=='number') key=e.charCode;
		else return;
	
		key=e.keyCode;
		
		if (key==37) {
	
			pgz_light_move(-1);
			}
		else if (key==39) {

			pgz_light_move(1);
			}
		}

	}

if (window.addEventListener) {

	window.addEventListener("keydown",pgz_keydown,false);
	}
else {

	document.onkeydown=pgz_keydown;
	}

function pgz_lightbox_init(titulek) {

	pgz_lightbox_title=titulek;
	window.onresize=pgz_window_onresize;
	window.onscroll=pgz_window_onscroll;

	try {

		tmp=window.location.hash;
		tmp2=tmp.split('-');
		if (tmp2[0]=='#foto') {
	
			tmp3=document.getElementById('lb-foto-'+tmp2[1]);
			pgz_light_activate(tmp3);
			}
		}
	catch(e) {

		}

	}

function pgz_light_activate(el) {

	pgz_lightbox_maxx=pgz_wwx-70;
	pgz_lightbox_maxy=pgz_wwy-150;

	if (el) {

		tmp3=el.src.replace(/\-0\./,'-2.');
		tmp3=tmp3.replace(/\-1\./,'-2.');
		tmp3=tmp3.replace(/\-3\./,'-2.');
		tmp3=tmp3.replace(/\-4\./,'-2.');
		}

	if (pgz_lightbox_activated==0 && pgz_lightbox_count==0)  {

		tmp1=document.getElementsByTagName('img');
		tmp2=tmp1.length;
		for (i=0;i<tmp2;i++) {

			tmps=tmp1[i].className;
			if (tmps.match('^pgz_fotky_')) {
				
				pgz_lightbox_fotky[pgz_lightbox_count]=tmp1[i].src.replace(/\-0\./,'-2.');
				pgz_lightbox_fotky[pgz_lightbox_count]=pgz_lightbox_fotky[pgz_lightbox_count].replace(/\-1\./,'-2.');
				pgz_lightbox_fotky[pgz_lightbox_count]=pgz_lightbox_fotky[pgz_lightbox_count].replace(/\-3\./,'-2.');
				pgz_lightbox_fotky[pgz_lightbox_count]=pgz_lightbox_fotky[pgz_lightbox_count].replace(/\-4\./,'-2.');

				tmpx=tmps.split('_');

				pgz_lightbox_fotky_x[pgz_lightbox_count]=tmpx[2];
				pgz_lightbox_fotky_y[pgz_lightbox_count]=tmpx[3];
//				pgz_lightbox_fotky_ozn[pgz_lightbox_count]=tmp1[i].getAttribute('alt');
				pgz_lightbox_fotky_ano[pgz_lightbox_count]=tmp1[i].getAttribute('title');

				pgz_lightbox_count++;
				}
			}
		}
	pgz_lightbox_activated=1;
/*
	try {

		document.getElementById('over-document').style.overflow='hidden';
		document.getElementById('over-document').style.width=(pgz_wwx-20)+'px';
		}
	catch(e) {

		}
*/
	if (pgz_lightbox_count==0)
		return false;

	for (i=0;i<pgz_lightbox_count;i++) {

		if (pgz_lightbox_fotky[i]==tmp3)
			pgz_lightbox_act=i;
		}

	pgz_lightbox_blockmove=0;

	var body=document.getElementsByTagName('body').item(0);

	var old=document.getElementById('pgz_light');
	if (old)body.removeChild(old);

	tmp4=document.createElement('div');
	tmp4.id='pgz_light';
	tmp4.style.top=pgz_scrolly+'px';

	if (document.body.clientHeight>pgz_wwy)
		tmp4.style.height=document.body.clientHeight+'px';
	else
		tmp4.style.height=pgz_wwy+'px';

	tmp4.onclick=pgz_light_close;
	body.appendChild(tmp4);

	tmp5=document.createElement('div');
	tmp5.id='pgz_light2';
	tmp5.style.width=(pgz_wwx-45)+'px';
	tmp5.style.top=pgz_scrolly+'px';

	tmp6=document.createElement('span');
	tmp6.className='pgz_light2_btn';
	tmp6.innerHTML='zavřít fotky';
	tmp6.onclick=new Function("pgz_light_close()");
	tmp5.appendChild(tmp6);

	if (pgz_lightbox_count>1) {
	
		tmp6=document.createElement('span');
		tmp6.className='pgz_light2_btn';
		tmp6.innerHTML='následující';
		tmp6.onclick=new Function("pgz_light_move(1)");
		tmp5.appendChild(tmp6);
	
		tmp6=document.createElement('span');
		tmp6.className='pgz_light2_btn';
		tmp6.innerHTML='předchozí';
		tmp6.onclick=new Function("pgz_light_move(-1)");
		tmp5.appendChild(tmp6);
		}

	tmp6=document.createElement('span');
	tmp6.id='pgz_light2_nadpis';
	tmp6.className='pgz_light2_span';
	tmp5.appendChild(tmp6);

	body.appendChild(tmp5);

	pgz_light_move(0);
	}

function pgz_light_clkfoto() {

	if ((pgz_lightbox_act+1)<pgz_lightbox_count) {
		pgz_light_move(1);
		}
	else {
		pgz_light_close();
//		pgz_xdebug('4');	
		}
	}

function pgz_light_cache_foto() {

	if ((pgz_lightbox_act+1)<pgz_lightbox_count) {

		var body=document.getElementsByTagName('body').item(0);

		body.appendChild(tmp6);

		tmp6=document.getElementById('pgz_light_img_cache');
		if (tmp6)body.removeChild(tmp6);

		tmp6=document.createElement('img');
		tmp6.id='pgz_light_img_cache';
		tmp6.style.visibility='hidden';
		tmp6.src=pgz_lightbox_fotky[pgz_lightbox_act+1];
		}
	}

function pgz_light_move(set) {

	if (pgz_lightbox_blockmove==1)
		return false;

	pgz_lightbox_blockmove=1;

	var body=document.getElementsByTagName('body').item(0);

	pgz_lightbox_act=pgz_lightbox_act+set;

	if (pgz_lightbox_act<0) {

//		pgz_lightbox_act=0;
		pgz_light_close();
		return false;
		}
	else if (pgz_lightbox_act>=pgz_lightbox_count) {

//		pgz_lightbox_act=pgz_lightbox_count-1;
		pgz_light_close();
		return false;
		}

	tmp6=document.getElementById('pgz_light2_nadpis');
	tmp6.innerHTML='Fotky: '+pgz_lightbox_title+' - fotka č.'+(pgz_lightbox_act+1)+' z '+pgz_lightbox_count;
//pgz_lightbox_fotky_ozn[pgz_lightbox_act]!='' || 
//		tmp6.innerHTML+='<p>'+pgz_lightbox_fotky_ozn[pgz_lightbox_act]+((pgz_lightbox_fotky_ano[pgz_lightbox_act]!='')?(' - '+pgz_lightbox_fotky_ano[pgz_lightbox_act]):(''))+'</p>';
	if (pgz_lightbox_fotky_ano[pgz_lightbox_act]!='')
		tmp6.innerHTML+='<p>'+pgz_lightbox_fotky_ano[pgz_lightbox_act]+'</p>';

	tmp6=document.getElementById('pgz_light_img');
	if (tmp6)body.removeChild(tmp6);

	tmp6=document.createElement('img');
	tmp6.id='pgz_light_img';
	tmp6.style.visibility='hidden';

/*
	if (pgz_lightbox_fotky_l[pgz_lightbox_act]!=1) {
		tmp6.onload=pgz_light_resize;
		tmp6.style.visibility='hidden';
		}
*/
//	tmp6.onclick=pgz_light_close;
	tmp6.onclick=new Function("pgz_light_clkfoto()");

	tmp6.src=pgz_lightbox_fotky[pgz_lightbox_act];
/* +'?r='+Math.round(Math.random()*100000); */
	body.appendChild(tmp6);
/*
	if (pgz_lightbox_fotky_l[pgz_lightbox_act]==1)
		pgz_light_resize()
*/

	pgz_light_resize();

	try {
/*
		window.location.hash='foto-'+pgz_lightbox_act;
*/
		}
	catch(e) {

		}

	if (set>=0)
		pgz_light_cache_foto();
	}

function pgz_light_resize() {

	tmpw=pgz_lightbox_fotky_x[pgz_lightbox_act];
	tmph=pgz_lightbox_fotky_y[pgz_lightbox_act];

	if (tmpw>pgz_lightbox_maxx || tmph>pgz_lightbox_maxy) {

		tmpp1=tmpw/pgz_lightbox_maxx;
		tmpp2=tmph/pgz_lightbox_maxy;

		if (tmpp1>tmpp2) 
			tmppo=tmpp1;
		else
			tmppo=tmpp2;

		tmpw=Math.floor(tmpw/tmppo);
		tmph=Math.floor(tmph/tmppo);
		}

	pgz_lightbox_fotky_l[pgz_lightbox_act]=1;
	tmp=document.getElementById('pgz_light_img');

	tmp.style.visibility='visible';

	tmpx=Math.round((pgz_wwx-tmpw)/2)-10;
	tmpy=Math.round((pgz_wwy-tmph)/2);
/*
	tmpx=Math.round((pgz_wwx-tmp.width)/2);
	tmpy=Math.round((pgz_wwy-tmp.height)/2);
*/
	if (tmpx<5) tmpx=5;
	if (tmpy<75) tmpy=75;

	tmp.style.left=tmpx+'px';
	tmp.style.top=(tmpy+pgz_scrolly)+'px';

	tmp.width=tmpw;
	tmp.height=tmph;
	tmp.style.width=tmpw+'px';
	tmp.style.height=tmph+'px';
	tmp.style.visibility='visible';

	pgz_lightbox_blockmove=0;
	}

function pgz_light_close() {

	pgz_lightbox_activated=0;
	var body=document.getElementsByTagName('body').item(0);

	tmp3=document.getElementById('pgz_light_img');
	tmp2=document.getElementById('pgz_light2');
	tmp1=document.getElementById('pgz_light');

	if (tmp3) body.removeChild(tmp3);
	if (tmp2) body.removeChild(tmp2);
	if (tmp1) body.removeChild(tmp1);

	try {
/*
		document.getElementById('over-document').style.width='auto';
		document.getElementById('over-document').style.overflow='auto';
*/
		}
	catch(e) {

		}
/*
	window.location.hash='zavreno';
*/
	}


/* foto lightbox end */

var mn_meta_title_enabled=0;
var mn_meta_title_act=0;
var mn_meta_title_len=3;
var mn_meta_title_str=':';
var mn_meta_title_title='';
/* ▁ ▃ ▄ ▅ ▆ ▇ █ ▇ ▆ ▅ ▄ ▃ */
function mn_meta_title_init() {

	if (mn_meta_title_enabled==0) {

		try {

			mn_meta_title_enabled=1;
			mn_meta_title_title=document.title;
		
			window.setInterval('mn_meta_title_cycle()',200);
			}
		catch(e) {
		
			}
		}
	}

function mn_meta_title_cycle() {

	try {
	
		mn_meta_title_act++;
		if (mn_meta_title_act>=(mn_meta_title_len*2))
			mn_meta_title_act=0;
	
		i=0;
		tmp='[';
		if (mn_meta_title_act<mn_meta_title_len)
			i=mn_meta_title_act;
		else
			i=(mn_meta_title_len*2)-mn_meta_title_act;
	
		if (i>0)
			tmp+=Array(i+1).join("-")
	
		tmp+=mn_meta_title_str;
	
		if (i<=mn_meta_title_len)
			tmp+=Array((mn_meta_title_len-i)+1).join("-")
	
		tmp+='] ';
	//	tmp+=i+' ';
	
		document.title=tmp+mn_meta_title_title;
		}
	catch(e) {

		}

//	document.title='['+mn_meta_title_str.substring(mn_meta_title_act,mn_meta_title_act+1)+'] '+mn_meta_title_title;
	}

function mn_forum_zavadne(iddotaz,idreakce,set) {

	load_script('/_data/clscripts/forumzavadne.php?iddotaz='+iddotaz+'&idreakce='+idreakce+'&set='+set);
	}

function mn_forum_nadpisedit(iddotaz,site) {

	location.href='/forum/upravit/?id='+iddotaz+'&s='+site;
	}

function mn_forum_textedit(iddotaz,idreakce) {

	location.href='/forum/upravit/?idreakce='+idreakce;
	}

/*
var mnfedit_text='';
var mnfedit_iddotaz=0;
var mnfedit_idreakce=0;

function mn_forum_textedit(iddotaz,idreakce) {

	mnfedit_text='';
	mnfedit_iddotaz=iddotaz;
	mnfedit_idreakce=idreakce;

	load_script('/_data/clscripts/forumtextedit.php?iddotaz='+iddotaz+'&idreakce='+idreakce);
	}

function mn_forum_textedit_getform(iddotaz,idreakce) {

	tmp='';

	tmp+='<form method="post" target="ihelper" action="/_data/clscripts/forumtexteditset.php">';
	tmp+='<div class="forum-inneredit">';
	tmp+='<textarea cols="20" rows="10">';

	tmp+=mnfedit_text;

	tmp+='<textarea>';
	tmp+='</div>';
	tmp+='</form>';

	document.getElementById('reakce-'+mnfedit_idreakce).innerHTML=tmp;
	}
*/

function mn_forum_delreak(id) {

	load_script('/_data/clscripts/mod_forum_delreak.php?id='+id);


	try {

		document.getElementById('reakce-'+id).style.display='none';
		}
	catch(e) {

		}
	}


function mn_gkomentar_zavadne(id,set) {

	load_script('/_data/clscripts/user_gkomentar_zavadne.php?id='+id+'&set='+set);
	}

function mn_gkomentar_textedit(id) {

	location.href='/sprava/gkomentar/upravit/?id='+id;
	}

function mn_gkomentar_delreak(id) {

	load_script('/_data/clscripts/mod_gkomentar_delreak.php?id='+id);


	try {

		document.getElementById('reakce-'+id).style.display='none';
		}
	catch(e) {

		}
	}



function mn_napoveda_close(typ) {

	load_script('/_data/clscripts/napovedaclose.php?typ='+typ);

	try {

		document.getElementById('dnapoveda').style.display='none';
		}
	catch(e) {

		}
	}

var maxy=0;

function zsh_katalog_check(pocsl) {

	if (pocsl<=1) return false;

	try {

		tmp=document.getElementsByTagName('div');

		maxy=0;
		for (var i=0;i<=(tmp.length-1);i++) {
	
			if (tmp[i].className=='blk-1') {
	
				if (tmp[i].offsetHeight>maxy)
					maxy=tmp[i].offsetHeight;
				}
			}

		if (maxy>0)
		for (var i=0;i<=(tmp.length-1);i++) {
	
			if (tmp[i].className=='blk-1') {
	
				tmp[i].style.height=maxy+'px';
				}
			}

		maxy=0;
		for (var i=0;i<=(tmp.length-1);i++) {
	
			if (tmp[i].className=='blk-2') {
	
				if (tmp[i].offsetHeight>maxy)
					maxy=tmp[i].offsetHeight;
				}
			}

		if (maxy>0)
		for (var i=0;i<=(tmp.length-1);i++) {
	
			if (tmp[i].className=='blk-2') {
	
				tmp1=(maxy-tmp[i].offsetHeight);
				tmp2=Math.floor(tmp1/2);
				tmp3=tmp1-tmp2;

				tmp[i].style.paddingTop=tmp2+'px';
				tmp[i].style.paddingBottom=tmp3+'px';
				}
			}


		maxy=0;
		for (var i=0;i<=(tmp.length-1);i++) {
	
			if (tmp[i].className=='blk-3') {
	
				if (tmp[i].offsetHeight>maxy)
					maxy=tmp[i].offsetHeight;
				}
			}

		if (maxy>0)
		for (var i=0;i<=(tmp.length-1);i++) {
	
			if (tmp[i].className=='blk-3') {
	
				tmp[i].style.height=maxy+'px';
				}
			}
		}
	catch(e) {

		}
	}

function xads_cj(typ) {

	if (typ=='dorm') {

		document.write('<a href="http://www.anrdoezrs.net/click-5525583-10956662" target="_top"><img src="http://www.lduhtrp.net/image-5525583-10956662" width="120" height="600" alt="" border="0"/></a>');
		}
	}




function zp_offtopx(obj) {

	var otop=0;
	if (obj.offsetParent) {
		
		otop=obj.offsetLeft;
		while (obj=obj.offsetParent)
			otop+=obj.offsetLeft;
		}
	return otop;
	}

function zp_offtopy(obj) {

	var otop=0;
	if (obj.offsetParent) {
		
		otop=obj.offsetTop;
		while (obj=obj.offsetParent)
			otop+=obj.offsetTop;
		}
	return otop;
	}

var wac_lblok_topy=-1;
/*
function pgz_window_onscroll() {

	try {
		
		if (document.body.scrollTop==0)
			pgz_scrolly=document.documentElement.scrollTop;
		else
			pgz_scrolly=document.body.scrollTop;
	
		}
	catch(e) {
	
		}

	try {

		tmp=document.getElementById('d-rside');

		if (wac_lblok_topy==-1)
			wac_lblok_topy=zp_offtopy(tmp);

		if (wac_lblok_topy>0) {

			if (wac_lblok_topy<(pgz_scrolly+5)) {

				tmp.style.top='0px';
				tmp.style.left='990px';
				tmp.style.position='fixed';
				}
			else {

				tmp.style.top='205px';
				tmp.style.left='990px';
				tmp.style.position='absolute';
				}
			}
		}
	catch(e) {

		}

	}
*/
/*
try {

	pgz_window_onscroll;
	}
catch(e) {

	}

try {

	window.onscroll=pgz_window_onscroll;
	}
catch(e) {

	}
*/

function mn_forum_palec(id,typ) {

	load_script('/_data/clscripts/user_forum_palec.php?id='+id+'&typ='+typ);

	try {

		document.getElementById('palec-'+id).style.display='none';
		}
	catch(e) {

		}
	}

function recept_setoznac(idrecept) {

	load_script('/_data/clscripts/user_recept_oznac.php?id='+idrecept);
	}

var mmn_animate_warn_alpha=0;
function mmn_animate_warn() {

	tmp=document.getElementById('tw-item-vzkazy');

	if (mn_sledujglobal_pole['vzkazy']>0) {

		mmn_animate_warn_alpha++;
		if (mmn_animate_warn_alpha>50)
			mmn_animate_warn_alpha=0;
	
		try {
	
			if (mmn_animate_warn_alpha>25)
				opac=50+((mmn_animate_warn_alpha-25)*2);
			else
				opac=100-(mmn_animate_warn_alpha*2);
	
			tmp.style.filter='alpha(opacity='+opac+')';
			tmp.style.opacity=opac/100;
			}
		catch(e) {
	
			}
		}
	}

function mmn_body_onload(user) {

	if (user==1) {

		window.setInterval('mmn_animate_warn()',30);
		}
	}

function pgz_dalsi_radek(varianta) {

	switch(varianta) {
	
		case "anketa":

			try {

				tmptb=document.getElementById('pgz_tbid');
				tmpbefore=document.getElementById('pgz_tbbefore');

				tmptr=document.createElement('tr');
	
				tmptd=document.createElement('td');
				tmptr.appendChild(tmptd);

				tmptd=document.createElement('td');

				tmpspan=document.createElement('span');
				tmpspan.className='pgz-innerpad';

				tmpinput=document.createElement('input');
				tmpinput.type='text';
				tmpinput.name='item[novaodpoved][]';
				tmpinput.className='input input2form';

				tmpspan.appendChild(tmpinput);
				tmptd.appendChild(tmpspan);
				tmptr.appendChild(tmptd);

				tmpbefore.parentNode.insertBefore(tmptr,tmpbefore);
				}
			catch(e) {
		
				}

		break;
		}

	}

function nb_anketa_hlas(id) {

	load_script('/_data/clscripts/user_anketa_hlas.php?id='+id);
	}

function mmn_user_okres_change(idokres) {

	try {
		htrequest.abort();
		}
	catch(e) {
		}

	url='/_data/clscripts/user_okres_change.php';
	url+='?idokres='+idokres;

	htrequest_method='get';
	htrequest_typ='okresobec';
	load_htreq(url,htrequest_res);
	}

var mmn_kdetozije_anim_value=0;
var mmn_kdetozije_anim_overflow=0;
var mmn_kdetozije_anim_content=0;

function mmn_kdetozije_init() {

	mmn_kdetozije_do();

	window.setInterval('mmn_kdetozije_do()',15100);

	mmn_kdetozije_anim_overflow=document.getElementById('topkdetozije-in').offsetHeight;

	window.setInterval('mmn_kdetozije_anim()',100);
	}

function mmn_kdetozije_do() {

	try {
		htrequest.abort();
		}
	catch(e) {
		}

	url='/_data/clscripts/global_kdetozije.php';

	htrequest_method='get';
	htrequest_typ='kdetozije';
	load_htreq(url,htrequest_res);
	}

function mmn_kdetozije_anim() {

	if (mmn_kdetozije_anim_content>0 && mmn_kdetozije_anim_overflow>0 && mmn_kdetozije_anim_overflow<mmn_kdetozije_anim_content) {

		tmp_maxposun=mmn_kdetozije_anim_content-mmn_kdetozije_anim_overflow;

		mmn_kdetozije_anim_value+=1;
		if (mmn_kdetozije_anim_value>(tmp_maxposun*2)) {

			mmn_kdetozije_anim_value=0;
			}

		tmp=document.getElementById('ikdetozije-hld');
		if (mmn_kdetozije_anim_value>tmp_maxposun) {

			tmpset='-'+((tmp_maxposun*2)-mmn_kdetozije_anim_value)+'px';
			}
		else {

			tmpset='-'+mmn_kdetozije_anim_value+'px';
			}

		tmp.style.marginTop=tmpset;
		}
	}



