/*

po zmene proved minifikaci

*/

var IE = document.all?true:false;

   function msieversion()
   {

try {
      var ua = window.navigator.userAgent
      var msie = ua.indexOf ( "MSIE " )

      if ( msie > 0 )      // If Internet Explorer, return version number
         return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )))
      else                 // If another browser, return 0
         return 0
	}
catch(e) {

	}

   }

var ieversion=msieversion();

function loadscript(url) {

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


function setAttr(elem,klic,hodnota) {

	try {
	
		if (IE) {
	
			switch(klic) {
				case "class":elem.className=hodnota;break;
				case "id":elem.id=hodnota;break;
				case "title":elem.title=hodnota;break;
				case "href":elem.href=hodnota;break;
				case "nohref":elem.nohref=hodnota;break;
				case "target":elem.target=hodnota;break;
				case "onclick":elem.onclick=new Function(hodnota);break;
				case "onmousedown":elem.onmousedown=new Function(hodnota);break;
				case "onmouseover":elem.onmouseover=new Function(hodnota);break;
				case "onmouseout":elem.onmouseout=new Function(hodnota);break;
				case "onmousedown":elem.onmousedown=new Function(hodnota);break;
				case "onkeydown":elem.onkeydown=new Function(hodnota);break;
				case "onkeypress":elem.onkeypress=new Function(hodnota);break;
				case "onfocus":elem.onfocus=new Function(hodnota);break;
				case "onblur":elem.onblur=new Function(hodnota);break;
				}
			}
		else {
	
			if (klic=='class')
				elem.className=hodnota;
			else
				elem.setAttribute(klic,hodnota);
			}
		}
	catch(e) { }

	}


function setfoto(foto,fx,fy) {

	try {

		var fid=document.getElementById('nfoto');

		fid.width=fx;
		fid.height=fy;
		fid.src='/_data/foto/'+foto+'x1.jpg';
		}
	catch (e) {

		}
	}

function openfoto(foto) {

	try {

		window.open('/_data/clscripts/foto.php?foto='+escape(foto.replace(/x1/g,'x2')),'','scrollbars=yes,width=840,height=630');
		}
	catch (e) {

		}
	}


var lastparam=0;

function parametry_kat(idkat) {

	var head=document.getElementsByTagName('head').item(0);
	var old=document.getElementById('last_id');
	if (old)head.removeChild(old);
	script=document.createElement('script');
	script.src='/_clscripts/parametry.php?s=kat&idkat='+idkat;
	script.type='text/javascript';
	script.defer=true;
	script.id='last_id'
	void(head.appendChild(script));
	}

function parametry_predn_zobraz(id) {

	try {

		document.getElementById('predn_'+lastparam).style.visibility='hidden';
		}
	catch (e) {

		}

	if (lastparam==id) {

		lastparam=0;
		}
	else {
	
		document.getElementById('predn_'+id).style.visibility='visible';
		lastparam=id;
		}
	}

function parametry_anone_zobraz(id) {

	try {

		document.getElementById('anone_'+lastparam).style.visibility='hidden';
		}
	catch (e) {

		}

	if (lastparam==id) {

		lastparam=0;
		}
	else {
	
		document.getElementById('anone_'+id).style.visibility='visible';
		lastparam=id;
		}
	}

function parametry_predn_schovej(id) {

	try { 
		document.getElementById('predn_'+id).style.visibility='hidden';
		}
	catch (e) { }

	try {
		document.getElementById('predn_'+lastparam).style.visibility='hidden';
		}
	catch (e) {	}


	try {
		document.getElementById('anone_'+lastparam).style.visibility='hidden';
		}
	catch (e) {	}

	}

function parametry_predn_set(id,hodnota,ano) {

	try {
	
		if (ano==1) {

			document.getElementById('butanone_'+id).value='ANO';
			document.getElementById('param_ano_'+id).value=1;
			}
		else {

			document.getElementById('butanone_'+id).value='N/A';
			document.getElementById('param_ano_'+id).value=-1;
			}
		}
	catch(e) {

		}
	
	document.getElementById('p_'+id).value=hodnota;
	
	document.getElementById('predn_'+id).style.visibility='hidden';
	lastparam=0;
	}

function parametry_anone_set(id,hodnota) {

	switch(hodnota) {

	case "-1":

		document.getElementById('butanone_'+id).value='N/A';
		document.getElementById('param_ano_'+id).value=-1;

	break;
	case "0":

		document.getElementById('butanone_'+id).value='NE';
		document.getElementById('param_ano_'+id).value=0;

	break;
	case "1":

		document.getElementById('butanone_'+id).value='ANO';
		document.getElementById('param_ano_'+id).value=1;

	break;
		}

	document.getElementById('anone_'+id).style.visibility='hidden';
	lastparam=0;
	}

function parametry_hodnota_checkano(hodnota,id) {
/*	if (hodnota.length==0) {

		document.getElementById('butanone_'+id).value='N/A';
		document.getElementById('param_ano_'+id).value=-1;
		}
	else {

*/

	try {

		if (hodnota.length>0 && document.getElementById('param_ano_'+id).value==-1) {
			document.getElementById('butanone_'+id).value='ANO';
			document.getElementById('param_ano_'+id).value=1;
			}
		}
	catch(e) {

		}

	}

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 odkazopen(url) {

	try {

		window.open(url,'');
		}
	catch (e) {

		}
	}

function zmenokres(url) {

	var tar='';
	var xmore='';
	var okres='';

	try {

		okres=escape(document.getElementById('ofield').value);
		}
	catch(e) {

		}

	try {

		xmore=document.getElementById('qfield').value;
		if (xmore!='') xmore='?q='+xmore;
		}
	catch(e) {

		}

	if (okres!='') {

		tar=url+'-'+okres+'/'+xmore;
		}
	else {

		tar=url+xmore;
		}

	location.href=tar;
	return false;
	}

function parametry_setfocus(id) {

	try {

		document.getElementById('p_'+id).focus();
		}
	catch (e) {


		}
	}



function oznacit_inzerat(id,typ) {
	
	var hlaska='';

	var head=document.getElementsByTagName('head').item(0);
	var old=document.getElementById('last_id');
	if (old)head.removeChild(old);
	script=document.createElement('script');
	script.src='/_data/clscripts/oznacitinzerat.php?id='+id+'&typ='+typ;
	script.type='text/javascript';
	script.defer=true;
	script.id='last_id'
	void(head.appendChild(script));
	}




function vlozjbs(frz) {

	document.write('<iframe src="/_data/clscripts/jbs.php?q='+escape(frz)+'" scrolling="no" style="border:none;width:710px;height:100px;margin:0 0 10px 0;padding:0" frameborder="0"></iframe>');
	}


function checkregform() {

	if (!document.getElementById('souhlas').checked) {

		alert('K registraci je nutno potvrdit souhlas s podminkami.');
		return false;
		}

	if (document.getElementById('iemail').value.length==0) {

		alert('Vyplnte email.');
		return false;
		}

	return true;
	}



function openfotky(id) {

	try {

		window.open('/_data/clscripts/fotoall.php?id='+id,'','scrollbars=yes,width=840,height=630');
		}
	catch (e) {

		}
	}

function zavadnyobsah(id,questi) {

	if (confirm(questi))
		loadscript('/_data/clscripts/zavadnyobsah.php?id='+id);
	}

function zavadnyobsah_res(txt) {

	document.getElementById('ozninz').innerHTML=txt;
	}

function showhelp(typ) {

	}

function hidehelp(typ) {

	}

function focushelp(typ) {

	}

function blurhelp(typ) {

	}


var blokjslkat=0;

function inz_hn_mouse(el,typ) {



		if (el.parentNode.className!='selected') {

			if (typ==1)
				el.parentNode.className='s-hover';
			else
				el.parentNode.className='';
			}

	try {
		}
	catch(e) {

		}
	}

function inz_hn_click(id) {

	try {

		if (blokjslkat==0) {

			tmp=document.getElementById('lk-'+id);
			location.href=tmp.href;
			}
		}
	catch(e) {

		}
	}

function inz_pm_mouse(id,el,typ) {

	try {

		if (document.getElementById('kk-'+id).className=='hn-dc')
			tmp='plus';
		else
			tmp='minus';

		if (typ==1) {

			blokjslkat=1;
			el.src='/_data/styles/img/l-kat-'+tmp+'.png';
			}
		else {

			blokjslkat=0;
			el.src='/_data/styles/img/l-kat-'+tmp+'-l.png';
			}
		}
	catch(e) {

		}
	}

function inz_pm_open(id,el) {

	try {

		tmp=document.getElementById('kk-'+id);

		if (tmp.className!='hn-dc') {

			tmp.className='hn-dc';
			el.src='/_data/styles/img/l-kat-plus.png';
			}
		else {
			tmp.className='hn-do';
			el.src='/_data/styles/img/l-kat-minus.png';
			}

		}
	catch(e) {

		}
	}

var tbtnold='';
function tbtn_click(typ) {

	try {

		if (tbtnold!='') {

			tmp=document.getElementById('tbtn-'+tbtnold);
			tmp.style.display='none';
			}
		}
	catch(e) {

		}

	try {

		tmp=document.getElementById('tbtn-'+typ);

		if (tmp.style.display=='block' || tbtnold==typ) {

			tbtnold='';
			tmp.style.display='none';
			}
		else {

			tbtnold=typ;
			tmp.style.display='block';
			}
		}
	catch(e) {

		}
	}






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();
	}


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();

	if (zavad_active==1) {

		zavad_counter++;
 		window.setTimeout('onscroll_zavad('+zavad_counter+')',200);
		}

	}


function pgz_light_refresh(kontrola) {

	if (pgz_lightbox_refresh==kontrola) {

		pgz_light_close();
		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_lightbox_init(titulek) {

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

function pgz_light_activate(el) {

	pgz_lightbox_maxx=pgz_wwx-50;
	pgz_lightbox_maxy=pgz_wwy-100;

	if (el) {

		tmp3=el.src.replace(/x0/,'x2');
		tmp3=tmp3.replace(/x1/,'x2');
		}

	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_')) {
				
				tmpx=tmps.split('_');

				pgz_lightbox_fotky[pgz_lightbox_count]=tmp1[i].src.replace(/x0/,'x2');
				pgz_lightbox_fotky[pgz_lightbox_count]=pgz_lightbox_fotky[pgz_lightbox_count].replace(/x1/,'x2');

				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;
		}

	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='X';
	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='&gt;';
		tmp6.onclick=new Function("pgz_light_move(1)");
		tmp5.appendChild(tmp6);
	
		tmp6=document.createElement('span');
		tmp6.className='pgz_light2_btn';
		tmp6.innerHTML='&lt;';
		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();
	}

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;
	else if (pgz_lightbox_act>=pgz_lightbox_count) pgz_lightbox_act=pgz_lightbox_count-1;

	tmp6=document.getElementById('pgz_light2_nadpis');
	tmp6.innerHTML='';
//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>';

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

	tmp6=document.createElement('img');
	tmp6.id='pgz_light_img';
//	tmp6.title='Kliknutím na fotografii zobrazíte další (pokud není poslední). Kliknutím mimo fotografii zavřete prohlížení fotek.';
	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();

	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);
	}

var oldtkatset=3;
function tkatset(id) {

	if (oldtkatset>0) {

		try {

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

			}

		}

	oldtkatset=id;
	try {

		document.getElementById('tkat-'+oldtkatset).style.display='block';
		}
	catch(e) {

		}
	}

var vudivspechtml='';
function inz_change_typkat() {

	idkat=document.getElementById('i-idkat').value;

	typ=0;
	if (document.getElementById('i-typ-1').checked)
		typ='n';
	else if (document.getElementById('i-typ-2').checked)
		typ='p';

	loadscript('/_data/clscripts/vudivspec.php?idkat='+idkat+'&typ='+typ);
	}

function vudivspechtml_set(klice) {

	tmp=klice.split(',');
	tmpdata=new Array();
	
	for (i=0;i<tmp.length;i++) {

		try {
			tmpdata[tmp[i]]=document.getElementById('item-s-'+tmp[i]).value;
			}
		catch(e) {

			}
		}

	document.getElementById('vudivspec').innerHTML=vudivspechtml;

	for (i=0;i<tmp.length;i++) {

		try {

			if (tmpdata[tmp[i]])
				document.getElementById('item-s-'+tmp[i]).value=tmpdata[tmp[i]];
			}
		catch(e) {

			}
		}
	}

var zavad_active=0;
var zavad_counter=0;

function popdown_zavad() {

	zavad_active=0;
	holder=document.getElementById('holder-blk');

	holder.style.display='none';
	}

function onscroll_zavad(counter) {

	if (zavad_counter==counter) {

		tmp=document.getElementById('blk-fg');
	
		tmp.style.top=(pgz_scrolly+(pgz_wwy-430)/2)+'px';
		}
	}

function send_zavad() {

	tmp='?1=1';

	try {
		tmp='?id='+document.getElementById('zav_item_id').value;
		}
	catch(e) {
		}

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

		try {
			if (document.getElementById('zav_item_'+i).checked) tmp+='&zav[]='+i;
			}
		catch(e) {

			}
		}

	try {
		tmp+='&pozn='+encodeURIComponent(document.getElementById('zav_item_pozn').value);
		}
	catch(e) {
		}

	popdown_zavad();
	loadscript('/_data/clscripts/zavadpopup.php'+tmp);

	}

function popup_zavad(id) {

	pgz_window_onresize();
	pgz_window_onscroll();
	window.onscroll=pgz_window_onscroll;
	zavad_active=1;

	holder=document.getElementById('holder-blk');

	tmp=''
	tmp='<div id="blk-bg" class="blk-bg" onclick="popdown_zavad()" style="top:0px;left:0px;height:'+document.height+'px"></div>';


	tmp+='<div id="blk-fg" class="blk-fg" style="top:'+(pgz_scrolly+(pgz_wwy-430)/2)+'px;left:'+((pgz_wwx-450)/2)+'px;">';

	tmp+='<input type="button" value="X" class="btnclose" onclick="popdown_zavad()" />';

	tmp+='<h3>Nahlášení závadného inzerátu</h3>';
	tmp+='<p>Vyberte prosím minimálně jednu z možností.</p>';
	
	tmp+='<form>';
	tmp+='<ul>';
	tmp+='<li><input type="checkbox" name="item[0]" id="zav_item_0" value="1" /> <label for="zav_item_0">Nesprávná kategorie</label></li>';
	tmp+='<li><input type="checkbox" name="item[1]" id="zav_item_1" value="1" /> <label for="zav_item_1">Neaktuální inzerát</label></li>';

	tmp+='<li class="toppad"><input type="checkbox" name="item[2]" id="zav_item_2" value="1" /> <label for="zav_item_2">Spam - opakující se inzerát od jedné osoby</label></li>';
	tmp+='<li><input type="checkbox" name="item[3]" id="zav_item_3" value="1" /> <label for="zav_item_3">Inzerát bez dostatečného popisu (více informací v emailu např.)</label></li>';
	tmp+='<li><input type="checkbox" name="item[4]" id="zav_item_4" value="1" /> <label for="zav_item_4">Inzerce nekonkrétního zboží/služeb.</label></li>';

	tmp+='<li class="toppad"><input type="checkbox" name="item[5]" id="zav_item_5" value="1" /> <label for="zav_item_5">Nevhodný obsah inzerátu (léky, erotika, apod.)</label></li>';
	tmp+='<li><input type="checkbox" name="item[6]" id="zav_item_6" value="1" /> <label for="zav_item_6">Podvodný inzerát (upřesněte v poznámce)</label></li>';
	tmp+='<li><input type="checkbox" name="item[7]" id="zav_item_7" value="1" /> <label for="zav_item_7">Zcizené fotografie (upřesněte v poznámce)</label></li>';

	tmp+='<li class="toppad">Upřesňující informace (nepovinné):<br />';
	tmp+='<textarea id="zav_item_pozn" name="item[pozn]" cols="40" rows="3"></textarea></li>';
	tmp+='</ul>';

	tmp+='<div><input type="button" value="Odeslat hlášení" class="btn" onclick="send_zavad()" /></div>';
	tmp+='<input type="hidden" name="item[id]" id="zav_item_id" value="'+id+'" />';
	tmp+='</form>';

	tmp+='</div>';

	holder.innerHTML=tmp;
	holder.style.display='block';
	}

function vloz_zavad(id) {

	document.write('<span class="nahl-zavadny">');
//	document.write('<div class="nahl-zavadny">');
//	document.write('<div id="ozninz">');
	document.write('<span id="ozninz">');

//	document.write('<h2>Nahlásit závadný inzerát</h2>';
//	document.write('<form action="."><input type="button" value="Nahlásit závadný inzerát" onclick="popup_zavad('+id+')" /></form>');
	document.write(', <span onclick="popup_zavad('+id+')">nahlásit závadný inzerát</span>');

	document.write('</span>');
	document.write('</span>');
//	document.write('</div>');
//	document.write('</div>');
	}

function res_zavad(txt) {

	document.getElementById('ozninz').innerHTML=txt;
	}

function vloz_ares(ico) {

	document.write(' <span class="aresx"><a href="http://wwwinfo.mfcr.cz/cgi-bin/ares/ares_es.cgi?jazyk=cz&obch_jm=&cestina=cestina&obec=&k_fu=&maxpoc=200&ulice=&cis_or=&cis_po=&setrid=ZADNE&pr_for=&nace=&nace_h=&xml=1&filtr=0&ico='+ico+'" target="_blank">informace (nové okno)</a></span>');
	}



var gmap;
function g_map_init(gps1,gps2,xtext,xgetlocation) {

	var latlng = new google.maps.LatLng(gps1,gps2);
	
	var myOptions = {
		zoom: 13,
		center: latlng,
		mapTypeId: google.maps.MapTypeId.ROADMAP
		};

	gmap = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
	gmap.scrollwheel=true;
  }

function g_openmap(gps1,gps2,xtext,xgetlocation) {

	document.getElementById('map_canvas-over').style.display='block';

	g_map_init(gps1,gps2,xtext,xgetlocation);
	}

function vlozhodnoceni(params,inner,xbar) {

	if (xbar==1)
		document.write('<a href="/hodnoceni/?'+params+'" class="hodnlnk hodnlnkr">');
	else
		document.write('<a href="/hodnoceni/?'+params+'" class="hodnlnk">');
	document.write(inner);
	document.write('</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 htrequest;
var ajax_search_counter=0;
var ajax_search_timer;

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;
		}

	htrequest.open('GET',url,true);

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

		}

	htrequest.onreadystatechange=targetfce;
	htrequest.send(null);

	return true;
	}

function ajax_search() {

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

	tmp=document.getElementById('ajaxsearchblk');
	tmphelper=document.getElementById('ajaxsearchblk_helper');

	tmphelper.innerHTML='<span>ČEKEJTE PROSÍM</span><img src="/_data/img/wait.gif" width="132" height="132" alt="Prosím čekejte" />';
	
	tmphelper.style.width=tmp.offsetWidth+'px';
	tmphelper.style.height=tmp.offsetHeight+'px';

	tmphelper.style.display='block';
	
	url='/_data/clscripts/ajaxsearch.php';
	url+='?pkat='+document.getElementById('pkat').value;
	url+='&origqkat='+document.getElementById('origqkat').value;
	url+='&kfield='+document.getElementById('kfield').value;
	url+='&ofield='+document.getElementById('ofield').value;
	url+='&qcod='+document.getElementById('qcod').value;
	url+='&qcdo='+document.getElementById('qcdo').value;
	url+='&typc='+document.getElementById('typc').value;
	url+='&qfield='+encodeURI(document.getElementById('qfield').value);

	load_htreq(url,ajax_search_res);
	} 

function ajax_search_res() {

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

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


function ajax_search_write() {

	if (htrequest.responseText.length>0) {

		tmp=document.getElementById('ajaxsearchblk');
		tmphelper=document.getElementById('ajaxsearchblk_helper');

		tmp.innerHTML=htrequest.responseText;
		tmphelper.style.display='none';
		}
	}


function ajax_search_hard() {

	document.getElementById('search_form').submit();
	} 

function ajax_search_counter_do(counter) {

	if (ajax_search_counter==counter) {

		ajax_search();
		}
	} 

function ajax_search_delay() {

	try {
		window.clearTimeout(ajax_search_timer);
		}
	catch(e) {

		}

	ajax_search_counter++;
	ajax_search_timer=window.setTimeout('ajax_search_counter_do('+ajax_search_counter+')',200);
	} 

function adkatpos(el) {
/*
	if (ieversion>0 && ieversion<8) return false;
*/
	try {
		tmp1=document.getElementById('in-adkat'+el);
		tmp2=document.getElementById('adkat'+el);
		tmpminus=document.getElementById('d-main-main');

		tmpx=0;
		tmpy=zp_offtopy(tmp2)-zp_offtopy(tmpminus);

		tmp1.style.position='absolute';
		tmp1.style.top=tmpy+'px';
		tmp1.style.left=tmpx+'px';
		}
	catch(e) {

		}
	}



