function isIE() {
	return (navigator.appName.indexOf('Microsoft') != -1);
}

function Hodiny(s)
{
    var runTime = new Date();
    var hours = runTime.getHours();
    var minutes = runTime.getMinutes();
    var seconds = runTime.getSeconds();
    var mz = "";
    if (hours > 12) {
      mz = "";
    }
    if (hours == 0) {
      hours = 0;
    }
    if (hours <= 9) {
      hours = "0" + hours;
    }
    if (minutes <= 9) {
      minutes = "0" + minutes;
    }
    if (seconds <= 9) {
      seconds = "0" + seconds;
    }
    if (s) seconds = ":" + seconds;
    else seconds = " " + seconds;
    document.getElementById("hodiny").innerHTML = "<font class='cas'>" + hours + ":" + minutes + seconds + "</font>";
    if (s) window.setTimeout("Hodiny(1)", 1000);
    else window.setTimeout("Hodiny(0)", 1000);
}
function ladenie(text) {
	document.getElementById('ladenie').innerHTML = text;
	document.getElementById('ladenie').style.display = 'block';
}  
function verify()
{
	document.register.user1.value="";
	document.register.password1.value="";
	document.register.password_verify1.value="";
	document.register.profesia1.value="";
	document.register.tel1.value="";
	if (document.register.user_bp.value == "") 
	{document.register.user1.value="NEZADANÉ";
	document.register.user_bp.focus();
	return false;};
	if (document.register.password_bp.value == "")
	{document.register.password1.value="NEZADANÉ";
	document.register.password_bp.focus();
	return false;};
	if (document.register.password_verify_bp.value != document.register.password_bp.value)
	{document.register.password_verify1.value="NESPRÁVNE";
	document.register.password_verify_bp.focus();
	return false;};
	if (document.register.profesia.value == "")
	{document.register.profesia1.value="NEZADANÉ";
	document.register.profesia.focus();
	return false;};
	if (document.register.tel.value == "")
	{document.register.tel1.value="NEZADANÉ";
	document.register.tel.focus();
	return false;};
	return true;
}

function name_image(full_name)
{
	path_array = full_name.split("/");
	return path_array[path_array.length - 1];
}

function rozbal_menu()
{
	if (document.styleSheets[2].rules[0].style.display=="none")
	{document.styleSheets[2].rules[0].style.display="block";}
	else
	{document.styleSheets[2].rules[0].style.display="none";}
}

function rozbal_menu_historia()
{
	if (document.styleSheets[3].rules[0].style.display=="none")
	{document.styleSheets[3].rules[0].style.display="block";}
	else
	{document.styleSheets[3].rules[0].style.display="none";}
}

function rozbal_menu_kultura()
{
	if (document.styleSheets[4].rules[0].style.display=="none")
	{document.styleSheets[4].rules[0].style.display="block";}
	else
	{document.styleSheets[4].rules[0].style.display="none";}
}

function rozbal_menu_sport()
{
	if (document.styleSheets[5].rules[0].style.display=="none")
	{document.styleSheets[5].rules[0].style.display="block";}
	else
	{document.styleSheets[5].rules[0].style.display="none";}
}

function rozbal_menu_doprava()
{
	if (document.styleSheets[6].rules[0].style.display=="none")
	{document.styleSheets[6].rules[0].style.display="block";}
	else
	{document.styleSheets[6].rules[0].style.display="none";}
}

function verify_inz()
{
	if(document.register.text.value=="")
	{window.alert("Nezadali ste text inzerátu!");
	document.register.text.focus();
	return false;}
	if(document.register.kontakt.value=="")
	{window.alert("Nezadali ste kontakt!");
	document.register.kontakt.focus();
	return false;}
	sumar = "Zadali ste tieto údaje\n\n";
	sumar += "Kategória: " + kaa[document.register.kategoria_inz_for_add.value] + "\n\n";
	sumar += "Predaj: " + paa[document.register.predaj.value-1] + "\n\n";
	sumar += "Text: " + document.register.text.value + "\n\n";
	sumar += "Kontakt: " + document.register.kontakt.value + "\n\n";
	sumar += "Trvanie: " + document.register.do_x.value + " dní\n\n\n";
	sumar += "Sú údaje v poriadku? \n";
	if(window.confirm(sumar))
	{return true;}
	return false;
}

function verify_f()
{
	if(document.getElementById("reg_f").firma.value=="")
	{window.alert("Nezadali ste firmu");
	document.getElementById("reg_f").firma.focus();
	return false;}
	if (document.getElementById("reg_f").password_1.value.length < 4)
	{
		window.alert("Krátke heslo");
		document.getElementById("reg_f").password_1.focus();
		return false;
	}
	if (document.getElementById("reg_f").password_1.value=="")
	{
		window.alert("Nezadali ste heslo");
		document.getElementById("reg_f").password_1.focus();
		return false;
	}
	
	if (document.getElementById("reg_f").password_verify.value != document.getElementById("reg_f").password_1.value)
	{
		window.alert("Zlá verifikácia");
		document.getElementById("reg_f").password_verify.focus();
		return false;
	}
	
	if (document.getElementById("reg_f").adresa.value == "")
	{
		window.alert("Nezadali ste adresu");
		document.getElementById("reg_f").adresa.focus();
		return false;
	}
	
	if (document.getElementById("reg_f").ico.value == "")
	{
		window.alert("Nezadali ste IČO!");
		document.getElementById("reg_f").ico.focus();
		return false;
	}
	return true;
}

function verify_mail()
{
	if(linka.text.value=="")
	{
		window.alert("Nenapísali ste text správy");
		return false;
	}
	return true;
}

function openfoto(theURL,winName,features)
{ //v2.0
	window.open(theURL,winName,features);
}

function verify_reg()
{
	if((!document.getElementById("register").oznamy.checked)&&(!document.getElementById("register").majetok.checked)&&(!document.getElementById("register").noviny.checked)&&(!document.getElementById("register").invest.checked)&&(!document.getElementById("register").kultura.checked))
	{
		window.alert("Neoznačili ste žiadnu oblasť !");
		return false;
	}
	if(document.getElementById("register").adresa.value=="" || document.getElementById("register").adresa.value.indexOf("@")== -1 || document.getElementById("register").adresa.value.length < 7 || document.getElementById("register").adresa.value.indexOf(".")== -1)
	{
		window.alert("Nie je mailová adresa");
		return false;
	}
	return true;
}

function verify_del()
{
	if(document.register.adresa.value=="")
	{
		window.alert("Nezadali ste adresu !");
		return false;
	}
	return true;
}

function verify_find()
{
	if(document.uznes.uznesenie.value=="")
	{
		if(document.uznes.text.value=="")
		{
			window.alert("Nezadali ste text");
			return false;
		}
	}
	return true;
}

function finder_verify()
{
	if(document.sucher.text.value=="")
	{
		window.alert("Nezadali ste text!");
		document.sucher.text.focus();
		return false;
	}
	return true;
}

function verify_uprav_prace()
{
	document.register.profesia1.value="";
	document.register.tel1.value="";
	if (document.register.profesia.value == "")
	{document.register.profesia1.value="NEZADANÉ";
	document.register.profesia.focus();
	return false;};
	if (document.register.tel.value == "")
	{document.register.tel1.value="NEZADANÉ";
	document.register.tel.focus();
	return false;};
	return true;
}

function show_alert() {
	window.alert('Nepodarilo sa otvoriť nové okno. Akcia nemôže pokračovať.\nSkúste zmeniť nastavenie prehliadača.');
}

function noviny()
{
	var nove_okno;
	if (nove_okno = window.open('','NOVINY','scrollbars=no,resizable=no,toolbar=no,width=560,height=420')){
		nove_okno.document.write("<html>");
		nove_okno.document.write("<head>");
		nove_okno.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1250\">");
		nove_okno.document.write("<LINK rel=\"StyleSheet\" type=\"text/css\" href=\"_main.css\">");
		nove_okno.document.write("<title>Zvolenské noviny</title>");
		nove_okno.document.write("</head>");
		nove_okno.document.write("<body align=\"center\">");
		nove_okno.document.write("<table width=\"550\" cellspacing=\"0\" cellpadding=\"0\" height=\"380\">");
		nove_okno.document.write("<tr>");
		nove_okno.document.write("<td class=\"table_body\" style=\"border:0\" width=\"100%\">");
		nove_okno.document.write("<p align=\"center\"><img border=\"0\" src=\"images/noviny_big.gif\" width=\"550\" height=\"107\"><br>");
		nove_okno.document.write("<br><b>Týždenník mesta Zvolen</b><br><br>");
		nove_okno.document.write("• vychádza každý utorok v týždni • cena 8,50 Sk<br><br>");
		nove_okno.document.write("Adresa redakcie: Nám. slobody 22, 960 01 Zvolen (budova Mestského úradu, 3. poschodie)</p>");
		nove_okno.document.write("<p style=\"margin-left: 15; margin-right: 15\"><b>KONTAKTY:<br></b><br>");
		nove_okno.document.write("<b>");
		nove_okno.document.write("Andrea Bačová, šéfredaktorka,&nbsp;</b><br>");
		nove_okno.document.write("-	tel.: 045/5479 891, 5321 266, kl. 221, fax: 045/5479 891, 5335 992<br>");
		nove_okno.document.write("<b>Ľuba Mojžišová, zástupkyňa šéfredaktorky,&nbsp;</b><br>");
		nove_okno.document.write("-	tel.: 045/5479 891, 5321 266, kl. 285&nbsp;<br>");
		nove_okno.document.write("<b>Martin Mázor, redaktor</b><br>");
		nove_okno.document.write("-	tel.: 045/5479 891, 5321 266, kl. 285<br>");
		nove_okno.document.write("<b>Iveta Mituchovičová, inzercia, administratíva</b><br>");
		nove_okno.document.write("-	tel.: 045/5479 891, 5321 266, kl. 285, fax: 045/5479 891, 5335 992&nbsp;<br><br>");
		nove_okno.document.write("E-mail: <a href=\"mailto:spravca@zv.psg.sk\">spravca@zv.psg.sk<br></a>");
		nove_okno.document.write("");
		nove_okno.document.write("</td>");
		nove_okno.document.write("</tr>");
		nove_okno.document.write("</table>");
		nove_okno.document.write("</body>");
		nove_okno.document.write("</html>");
	}
	else show_alert();
}

download_flag = 0;

function collapse_menu(x,flag_obr) {
	var menu = document.getElementById("Out" + x + "d");
	if (menu.style.display == "block")
	menu.style.display = "none";
	else menu.style.display = "block";
	if (flag_obr) {
		var obr = document.getElementById("Out" + x);
		if (name_image(obr.src) == "grayplus.gif")
		obr.src = document.location.pathname.substr(0,document.location.pathname.indexOf('admin_new')) + "images/grayminus.gif";
		else obr.src = document.location.pathname.substr(0,document.location.pathname.indexOf('admin_new')) + "images/grayplus.gif";
	}
}
function collapse_menu_cond(x,$obr_flag,cond) {
	var menu = document.getElementById("Out" + x + "d");
	if ((menu.style.display == 'none' && window.confirm(cond)) || menu.style.display == 'block') collapse_menu(x,$obr_flag);
}
function collapse_kat(x,flag_obr) {
	var menu = document.getElementById("Kat_" + x + "d");
	if (menu.style.display == "none" || menu.style.display == "") {
		var all_kategories = document.getElementsByTagName("div");
		for (x=0;x<all_kategories.length;x++) {
			if (all_kategories[x].id.substr(0,4) == "Kat_") {
				all_kategories[x].style.display = "none";
			}
		}
		menu.style.display = "block";
	}
	else menu.style.display = "none";
	if (flag_obr) {
		var obr = document.getElementById("Kat_" + x);
		if (name_image(obr.src) == "grayplus.gif")
		obr.src = "images/grayminus.gif";
		else obr.src = "images/grayplus.gif";
	}
}

function is_regular_mail(mail_adresa) {
	if(mail_adresa=="" || mail_adresa.indexOf("@")== -1 || mail_adresa.length < 7 || mail_adresa.indexOf(".")== -1) {
		return false;
	}
	return true;
}

function resize_window(x,y) {
	if (x + 30 > screen.availWidth) x = screen.availWidth - 30;
	if (y + 70 > screen.availHeight) y = screen.availHeight - 70;
	window.resizeTo(x,y);
}

function update_bottom_special_position() {
	var bsp = document.getElementById('special_bottom');
	var top_position;
	if (_mozilla) {
		top_position = window_height() - bsp.offsetHeight + window.scrollY;
	}
	else {
		if (_ie6) {
			top_position = document.documentElement.clientHeight - bsp.offsetHeight + document.documentElement.scrollTop;
		}
		else if (_ie55 || _ie50) {
			top_position = document.body.clientHeight - bsp.offsetHeight + document.body.scrollTop;
		}
	}
	bsp.style.top = top_position + 'px';
}
var _password_verify_error;
var _login_verify_error;
permitted_chars = new Array("+","*","/",",",":",".","'",";","&","\"","\\"," ");
function in_array(string,array) {
	if (array.toString().indexOf(string) == -1) return false;
	else return true;
}
function has_permitted_chars(text) {
	var navrat = false;
	for (var x=0;x<text.length;x++) {
		if (in_array(text.substr(x,1),permitted_chars)) navrat = true;
	}
	return navrat;
}
function password_verify_insert(password,password_verify,min_length) {
	var navrat = false;
	if (!has_permitted_chars(password)) {
		if (password.length >= min_length) {
			if (password == password_verify) navrat = true; else _password_verify_error = 'Heslo a jeho potvrdenie sa nezhodujú';
		}
		else _password_verify_error = 'Heslo je kratšie ako minimálna povolená dĺžka';
	}
	else _password_verify_error = 'Heslo obsahuje zakázané znaky';
	return navrat;
}
function verify_login(login,min_length) {
	navrat = false;
	if (!has_permitted_chars(login)) {
		if (login.length >= min_length) navrat = true; else _login_verify_error = 'Meno je kratšie ako minimálna povolená dĺžka';
	}
	else _login_verify_error = 'Meno obsahuje nepovolené znaky';
	return navrat;
}
function nove_o_fotogaleria(x) {
	var sirka = 320
	var vyska = 240;
	var properties="width=" + sirka + ",height=" + vyska + ",scrollbars=yes,resizable=yes";
	var nove_okno;
	if (nove_okno = window.open('','okno' + x,properties)){
		nove_okno.window.location="show_foto.php?id=" + x;
	}
	else show_alert();
}
function osoba_podrobnosti(id_osoby,all_data) {
	var properties = 'width=400,height=400,scrollbars=yes,resizable=yes,left=' + (screen.availWidth-430) + ',top=15';
	var nove_okno = window.open('admin_new/modules/osoba_v_novom_okne.php?id_osoba=' + id_osoby + '&all_data=' + all_data,'osoba' + id_osoby,properties);
	if (nove_okno == null) show_alert();
}
function is_regular_mail(mail_adresa) {
	if(mail_adresa=="" || mail_adresa.indexOf("@")== -1 || mail_adresa.length < 7 || mail_adresa.indexOf(".")== -1) {
		return false;
	}
	return true;
}
function verify_rezervacia(obj) {
	if (obj.od.value == "") {
		window.alert("Nezadali ste dátum OD!");
		obj.od.focus();
		return false;
	}
	if (obj.pocet_noci.value == "" || isNaN(obj.pocet_noci.value)) {
		window.alert("Nezadali ste počet nocí!");
		obj.pocet_noci.focus();
		return false;
	}
	if (obj.pocet_dospelych.value == "" || isNaN(obj.pocet_dospelych.value)) {
		window.alert("Nezadali ste počet dospelých osôb!");
		obj.pocet_dospelych.focus();
		return false;
	}
	if (isNaN(obj.pocet_deti.value)) obj.pocet_deti.value = 0;
	if (obj.meno.value == "") {
		window.alert("Nezadali ste svoje meno!");
		obj.meno.focus();
		return false;
	}
	if (obj.adresa.value == "") {
		window.alert("Nezadali ste svoju adresu!");
		obj.adresa.focus();
		return false;
	}
	if (obj.telefon.value == "") {
		window.alert("Nezadali ste telefónne číslo!");
		obj.telefon.focus();
		return false;
	}
	if (!is_regular_mail(obj.email.value)) obj.email.value = "";
	return true;
}
var kill_iframe = 0;
function ClearIframe() {
	document.getElementById('special_print_id').removeChild(document.getElementById('special_print_id').firstChild);
}
function CreateIframe(_src) {
	nElement = document.createElement('iframe');
	var par = document.getElementById('special_print_id');
	par.appendChild(nElement);
	nElement.setAttribute('id','special_print_frame');
	nElement.setAttribute('src',_src);
	nElement.setAttribute('scrolling','no');
	nElement.setAttribute('frameborder','0');
}
function print_page(uri,mode) {
	if (_ie7 || mode) {
		if(uri.indexOf('?') != -1) _src = uri + '&print_demand=1'; else _src = uri + '?print_demand=1';
		//if (_ie7) {
			var properties = 'width=650,top=5,left=5,resizable=1,scrollbars=1';
			if (!window.open(_src,'_print_widow',properties)) show_alert();
		//}
		//else CreateIframe(_src);
	}
	else window.print();
}
function show_this(type,id_pp,id_kat) {
	var all_divs = document.getElementsByTagName('DIV');
	for (x=0;x<all_divs.length;x++) {
		if (all_divs[x].id.substr(0,10) == 'media_kat_') all_divs[x].className = 'media_kat';
		if (all_divs[x].id.substr(0,11) == 'media_item_') all_divs[x].style.display = 'none';
	}
	document.getElementById('media_kat_' + id_pp + '_' + id_kat).className = 'media_kat_active';
	document.getElementById('media_item_' + id_pp + '_' + id_kat).style.display = 'block';
}
function play_this(type,id_pp,id_item) {
	var path = '';
	if (type) path = 'admin_new/videoplayer/videoplayer.php'; else path = 'admin_new/soundplayer/soundplayer.php';
	document.getElementById('media_player_' + id_pp).src = path + '?id_pp=' + id_pp + '&id_item=' + id_item;
	window.scrollTo(0,document.getElementById('media_player_' + id_pp).offsetTop);
}
function get_ajax_data(id,separator,id_item,next,obr_flag) {
	if (separator == 'locality') {
		var sel = document.getElementById(id);
		for (x=sel.options.length-1;x>=0;x--) sel.removeChild(sel.options[x]);
		var newEl = document.createElement('OPTION');
		newEl.setAttribute('value',0);
		newEl.innerHTML = 'Načítavam údaje ... ';
		sel.appendChild(newEl);
	}
	if (obr_flag) document.getElementById(id).innerHTML = '<div style=\"text-align:center;\"><img src=\"images/uploading_temp.gif\" title=\"Nahrávam údaje\" alt=\"Nahrávam údaje\"></div>';
	var navrat = '';
	var url = 'ajax_data_sender.php?separator=' + separator + '&id_item=' + id_item;
	if (next != null) url += '&next=' + next;
/*	window.alert(url); */
	if (window.ActiveXObject) httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
	else httpRequest = new XMLHttpRequest();
	httpRequest.open("GET", url, true);
	httpRequest.onreadystatechange= function () {processRequest(id,separator); } ;
	httpRequest.send(null);
}
function processRequest(id,separator) {
	var data = '';
	if (httpRequest.readyState == 4) {
		if (httpRequest.status == 200) data = httpRequest.responseText;		
		if (separator == 'locality' || separator == 'nreality') set_select(id,data);
		else document.getElementById(id).innerHTML = data;
	}
}
function set_select(id,data) {
	var sel = document.getElementById(id);
	for (x=sel.options.length-1;x>=0;x--) sel.removeChild(sel.options[x]);
	var rows = data.split(';-;');
	for (i in rows) {
		var rd = rows[i].split(';');
		var newEl = document.createElement('OPTION');
		newEl.setAttribute('value',rd[0]);
		newEl.innerHTML = rd[1];
		sel.appendChild(newEl);
	}
}
function get_ajax_data_function(fname,id,separator,id_item,next,obr_flag) {
	if (obr_flag) document.getElementById(id).innerHTML = '<div style=\"text-align:center;\"><img src=\"images/uploading_temp.gif\" title=\"Nahrávam údaje\" alt=\"Nahrávam údaje\"></div>';
	var navrat = '';
	var url = 'ajax_data_sender.php?separator=' + separator + '&id_item=' + id_item;
	if (next != null) url += '&next=' + next;
/*	window.prompt('',url); */
	if (window.ActiveXObject) httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
	else httpRequest = new XMLHttpRequest();
	httpRequest.open("GET", url, true);
	httpRequest.onreadystatechange= function () {processRequest_function(fname,id); } ;
	httpRequest.send(null);
}
function processRequest_function(fname,id) {
	var data = '';
	if (httpRequest.readyState == 4) {
		if (httpRequest.status == 200) data = httpRequest.responseText;
		parseFirms(data,id);
		/*document.getElementById(id).innerHTML = data;*/
	}
}
function stop_ajax(id) {
	document.getElementById('aj_a_' + id).href = 'javascript:collapse_menu(' + id + ',0)';
}
var kurz = 30.126;
function count_eur(value) {
	var navrat = '';
	value = value.replace(/,/,'.');
	if (!isNaN(value))  navrat = (value/kurz).toFixed(2);
	document.getElementById('price_eur').value = navrat;
}
function count_sk(value) {
	var navrat = '';
	value = value.replace(/,/,'.');
	if (!isNaN(value))  navrat = (value*kurz).toFixed(2);
	document.getElementById('price_sk').value = navrat;
}
var google_flag = 0;
var actual_obj = new Object();
if (document.getElementById('g_st_sl_0') != null) actual_obj = document.getElementById('g_st_sl_0');
function updateFirms(parrent,page,link,unch,id_pp) {
	if (unch) document.getElementById('g_st_sl_0').checked = false;
	if (document.getElementById('collapse_map') != null && document.getElementById('collapse_map').style.display == 'none') {
		document.getElementById('collapse_map').style.display = 'block';
		connector.location.reload();
	}
	if (document.getElementById('sita_envelope') != null) document.getElementById('sita_envelope').style.display = 'none';
	var url_add = '';
	var add_loc = '';
	var add_loc_obj = document.getElementById('module_action__' + id_pp + '__id_loc');
	if (add_loc_obj != null) add_loc = ';-;' + add_loc_obj.value + ';-;' + id_pp;
	else add_loc = ';-;0;-;' + id_pp;
	var add_port_obj = document.getElementById('module_data__' + id_pp + '__id_port');
	if (add_port_obj != null) add_loc += ';-;' + add_port_obj.value;
	else add_loc += ';-;0';
	var all_check = document.getElementsByTagName('INPUT');
	for (var x=0;x<all_check.length;x++) {
		/*if (all_check[x].id.substr(0,8) == 'g_st_sl_' && all_check[x].checked && all_check[x].id != 'g_st_sl_0') url_add += all_check[x].value + ';;';*/
		if (all_check[x].id.substr(0,8) == 'g_st_sl_' && all_check[x].id != 'g_st_sl_0' && all_check[x] != actual_obj) all_check[x].checked = false;
		if (all_check[x].id.substr(0,8) == 'g_st_sl_' && all_check[x] == actual_obj && all_check[x].id != 'g_st_sl_0') url_add += all_check[x].value + ';;';
	}
	if (url_add != '') url_add = url_add.substr(0,url_add.length - 2);
	get_ajax_data_function('parseFirms','strom_sluzieb_firm_list','firms_array',parrent + ';-;' + page + ';-;' + link + add_loc,url_add,1);
}
function updateList(obj,parrent,page,link,id_pp) {
	if (google_flag) actualizePositions(obj);
	actual_obj = obj;
	updateFirms(parrent,page,link,1,id_pp);
}
function updateListAll(obj,parrent,page,link,id_pp) {
	if (obj.checked) {
		var all_check = document.getElementsByTagName('INPUT');
		for (var x=0;x<all_check.length;x++) {
			if (all_check[x].id != obj.id && all_check[x].id.substr(0,8) == 'g_st_sl_') {
				all_check[x].checked = false;
				/*if (google_flag) actualizePositions(all_check[x]);*/
				if (google_flag) connector.showMarkers(all_check[x].value);
			}
		}
		actual_obj = obj;
		updateFirms(parrent,page,link,0,id_pp);
	}
	else obj.checked = true;
}
function parseFirms(data,id) {
	if (data != "") {
		var arr = data.split(';my-special-separator;');
		document.getElementById(id).innerHTML = arr[0];
		if (document.getElementById('firm_obr_array') != null) document.getElementById('firm_obr_array').innerHTML = arr[1];
	}
}
function updateStreet(portal_id,id_pp,gm_sep) {
	var data = portal_id.split(';;');
	reloadMap(data[1],data[2],data[3],gm_sep);
	get_ajax_data('streets_of_portal_' + id_pp,'streets',data[0] + ';;' + gm_sep,id_pp,1);
}
function reloadMap(x_pos,y_pos,zoom,gm_sep) {connector.reloadMap(x_pos,y_pos,parseInt(zoom));}
function verify_update_position(obj,id_pp) {
	if (_ie7 || _ie6) conn = window.frames['google_map_frame'].document; else conn = document.getElementById('google_map_frame').contentDocument;
	document.getElementById('module_data__' + id_pp + '__map_lat').value = conn.getElementById('map_lat').value;
	document.getElementById('module_data__' + id_pp + '__map_lng').value = conn.getElementById('map_lng').value;
	document.getElementById('module_data__' + id_pp + '__m_fotogaleria').value = obj.m_fotogaleria.value;
	return true;
}
function verify_update_position_inz(obj,id_pp) {
	if (_ie7 || _ie6) conn = window.frames['google_map_frame'].document; else conn = document.getElementById('google_map_frame').contentDocument;
	document.getElementById('module_data__' + id_pp + '__map_lat').value = conn.getElementById('map_lat').value;
	document.getElementById('module_data__' + id_pp + '__map_lng').value = conn.getElementById('map_lng').value;
	return true;
}
function get_nearest_div_editor(obj) {
	while (obj.tagName != 'DIV' && obj.className != 'editor') {
		obj = obj.parentNode;
	}
	return obj;
}
function show_bubble(number,obj) {
	if (bubble = document.getElementById('bubble_' + number)) {
		bubble.style.display = 'block';
		bubble.style.width = '150px';
		bubble.style.left = obj.offsetLeft + 'px';
		var temp = obj.offsetTop + 20;
		if (_ie6 || _ie7) {
			var parent_editor = get_nearest_div_editor(obj);
			temp = temp - parent_editor.offsetTop;
		}
		bubble.style.top = temp + 'px';
		bubble.style.zIndex = 20000;
		obj.onmouseout = function() {bubble.style.display = 'none';}
	}
}
function my_add_listener(type,fn,flag) {
	if (!document.attachEvent) {
		window.addEventListener(type,fn,flag);
	}
	else {
		window.attachEvent('on' + type,fn,flag)
	}
}
function changeType(obj,id_item,next) {
	var all_a = document.getElementById('inner_table').getElementsByTagName('A');
	for (var x=0;x<all_a.length;x++) all_a[x].className = '';
	document.getElementById('hr_' + obj).className = 'active';
	get_ajax_data('types_inner','vozidla',id_item,0);
}
function change_blog_type(type) {
	var type_array = Array('new','readed','top');
	for (var x in type_array) {
		if (document.getElementById('bl_' + type_array[x]) != null) {
			document.getElementById('bl_' + type_array[x]).style.display = 'none';
			document.getElementById('bls_' + type_array[x]).className = 't_blogs';
		}
	}
	document.getElementById('bl_' + type).style.display = 'block';
	document.getElementById('bls_' + type).className = 't_blogs_active';
}
function verify_number(obj) {
	if (!parseFloat(obj.value)) {
		window.alert('Musí byť číslo!');
		obj.focus();
		return false;
	}
	else return true;
}
function showRDetail(sep,id_pp) {
	var all_divs = document.getElementsByTagName('DIV');
	for (x=0;x<all_divs.length;x++) if (all_divs[x].className == 'reality_other_tab') all_divs[x].style.display = 'none';
	document.getElementById(sep + '_' + id_pp).style.display = 'block';
}
function realitySend(name,surname,tel,mail) {
	if (name == '') {
		window.alert('Nezadané meno!');
		return false;
	}
	if (surname == '') {
		window.alert('Nezadané priezvisko!');
		return false;
	}
	if (tel == '' && !is_regular_mail(mail)) {
		window.alert('Nezadaný kontakt!');
		return false;
	}
	return true;
}
function show_kalendar_new(id) {
	var properties = 'height=180,width=196,left=' + (screen.availWidth - 220) + ',top=20';
	var nove_okno = window.open('kalendar.php?id=' + id,'kalendar',properties);
	if (nove_okno == null) show_alert();
}
var show_flag = new Array(0,0,0,0);
var start_menun = 0;
function show_menun(order) {
	if (start_menun) {
		show_flag[order] = 1;
		window.setTimeout('show_menu_maken(' + order + ')',20);
	}
}
function show_menu_maken(order) {
	if (show_flag[order]) {
		var _top = document.getElementById('top_menu_program').offsetTop + document.getElementById('sp_' + order).offsetTop + document.getElementById('sp_' + order).offsetHeight - 5;
		var _left = document.getElementById('top_menu_program').offsetLeft + document.getElementById('sp_' + order).offsetLeft + 5;
		document.getElementById('submenun_' + order).style.top = _top +  'px';
		document.getElementById('submenun_' + order).style.left = _left +  'px';
		document.getElementById('submenun_' + order).style.display = 'block';
	}
}
function hide_menun(order) {
	show_flag[order] = 0;
	window.setTimeout('hide_menu_maken(' + order + ')',20);
}
function hide_menu_maken(order) {
	if (!show_flag[order]) document.getElementById('submenun_' + order).style.display = 'none';
}
function printFirm(id_firm) {
	var properties = 'width=750,height=600,scrollbars=1,top=15,left=15';
	var nove_okno;
	if (nove_okno = window.open('' + id_firm + '&print_flag=1','okno',properties)) nove_okno.window.location = 'firma.php?id_firm=' + id_firm + '&print_flag=1';
	else show_alert();
}
function verify_insert_task(obj,id_pp) {
	var item = eval('obj.module_data__' + id_pp + '__namesur');
	if (item.value == '') {
		window.alert('Nezadali ste meno!');
		item.focus();
		return false;
	}
	item = eval('obj.module_data__' + id_pp + '__tel');
	if (item.value == '') {
		window.alert('Nezadali ste telefón!');
		item.focus();
		return false;
	}
	item = eval('obj.module_data__' + id_pp + '__mail');
	if (!is_regular_mail(item.value)) {
		window.alert('Nezadali ste korektný e-mail!');
		item.focus();
		return false;
	}
	return true;
}
function verify_csob(obj) {
	if (obj.nCastka.value == '') {
		window.alert('Nezadaná suma!');
		obj.nCastka.focus();
		return false;
	}
	if (obj.nKS.value == '') {
		window.alert('Nezadaný konštantný symbol!');
		obj.nKS.focus();
		return false;
	}
	if (obj.chVS.value == '') {
		window.alert('Nezadaný variabilný symbol!');
		obj.chVS.focus();
		return false;
	}
	return true;
}
function init_timer(minutes) {
	var date = new Date();
	end_time = date.getTime() + minutes*60000;
	decrese_time();
}
function decrese_time() {
	var timer = 0;
	var date = new Date();
	var actual_time = date.getTime();
	var minutes = Math.floor((end_time - actual_time)/60000);
	var seconds = Math.floor((end_time - actual_time - minutes*60000)/1000);
	if (minutes < 10) minutes = '0' + minutes;
	if (seconds < 10) seconds = '0' + seconds;
	if (minutes < 1) {
		if (minutes < '01' && seconds < '01') {
			document.getElementById('timer').innerHTML = 'Odhlásený';
		}
		else {
			document.getElementById('timer_').className = 'timer__last_minute';
			document.getElementById('timer').className = 'timer_last_minute';
			document.getElementById('timer').innerHTML = minutes + ':' + seconds;
			window.setTimeout('decrese_time()',1000);
		}
	}
	else {
		document.getElementById('timer').innerHTML = minutes + ':' + seconds;
		window.setTimeout('decrese_time()',1000);
	}
}
function processRequestR(id_item) {
	var data = '';
	if (httpRequest.readyState == 4) {
		if (httpRequest.status == 200) data = httpRequest.responseText;	
		document.getElementById(id_item).innerHTML = data;
	}
}