
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 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) 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;
		}
	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+'/';
		}
	}




