var pathForImages = '/portals_pictures/'
var povod = ' ';
function w_in() {
povod = window.status;
window.status = ' ';
return true;
}
function w_out() {
window.status = povod;
return true;
}
function show_new_window(id,what)
{
var sirka_ = 400;
var vyska_ = 400;
if (what == "tasr")
{
sirka_ = 500;
vyska_ = 500;
}
if (what == "vzn")
{
sirka_ = 750;
vyska_ = 500;
}
if (what == "jedalny_listok")
{
sirka_ = 500;
vyska_ = 500;
}
if (what == 'mapa_data') {
sirka_ = 350;
vyska_ = 150;
}
if (what.substr(0,7) == 'recept_') {
sirka_ = 750;
vyska_ = 700;
}
var properties = "top=15,left=15,width=" + sirka_ + ",height=" + vyska_ + ",scrollbars=yes,resizable=yes";
var nove_okno;
if (nove_okno = window.open('','okno' + id,properties)){
nove_okno.window.location = homePage + '/new_window.php?id=' + id + '&what=' + what;
}
else show_alert();
}
if (navigator.appName.indexOf("Netscape") != -1) var _mozilla = 1; else var _mozilla = 0;
if (navigator.appName.indexOf("Opera") != -1) var _opera = 1; else var _opera = 0;
if (navigator.appName.indexOf("Microsoft") != -1) {
if (navigator.appVersion.indexOf("MSIE 7.0") != -1) var _ie7 = 1; else var _ie7 = 0;
if (navigator.appVersion.indexOf("MSIE 6.0") != -1) var _ie6 = 1; else var _ie6 = 0;
if (navigator.appVersion.indexOf("MSIE 5.5") != -1) var _ie55 = 1; else var _ie55 = 0;
if (navigator.appVersion.indexOf("MSIE 5.0") != -1) var _ie50 = 1; else var _ie50 = 0;
}
else {
var _ie7 = 0;
var _ie6 = 0;
var _ie55 = 0;
var _ie50 = 0;
}
function is_navigator_type(type) {
if (type == 'ie' && (_ie7 || _ie6 || _ie55 || _ie50)) return true;
if (type == 'firefox' && _mozilla) return true;
if (type == '_opera' && _opera) return true;
return false;
}
var buble_start = 0;
function window_width()
{
if (_mozilla) return self.innerWidth;
else return document.body.offsetWidth;
}
function window_height()
{
if (_mozilla) return self.innerHeight;
else return document.body.offsetHeight;
}
function get_scroll(os) {
var navrat = '';
if (os == 'x') {
if (_mozilla) {
navrat = window.scrollX;
}
else {
if (_ie6) navrat = document.documentElement.scrollLeft;
if (_ie50 || _ie55) navrat = document.body.scrollLeft;
}
}
else {
if (_mozilla) {
navrat = window.scrollY;
}
else {
if (_ie6) navrat = document.documentElement.scrollTop;
if (_ie50 || _ie55) navrat = document.body.scrollTop;
}
}
return navrat;
}
function show_bubble(cislo,_left,_top) {
if (buble_start) {
_scrollLeft = get_scroll('x');
_scrollTop = get_scroll('y');
var _x_p = document.getElementById("_xp" + cislo);
if (_x_p.style.display == "none")
{
if ((_left + _scrollLeft + 250 > window_width()) && (_left + _scrollLeft > 250)) _left = _left - 250;
var all_xps = document.getElementsByTagName("div");
for (x=0;x<all_xps.length;x++)
{
if (all_xps[x].id.substr(0,3) == "_xp") all_xps[x].style.display = "none";
}
_left += _scrollLeft;
_top += _scrollTop;
_x_p.style.left = _left + 'px';
_x_p.style.top = _top + 'px';
_x_p.style.display = "block";
}
}
}
obr=new Array();
obr[0]="images/plus.gif";
obr[1]="images/minus.gif";
Menu=new Array();
menu_flag=new Array();
i=0;
function st_r(x)
{window.status=x;
return true;}
function nove_o_menu(x)
{
var sirka = 320;
var vyska = 240;
var properties="width=" + sirka + ",height=" + vyska + ",scrollbars=yes,resizable=yes,top=15,left=15";
var nove_okno;
if (nove_okno = window.open('','okno',properties)){
nove_okno.window.location = homePage + '/big_foto_menu.php?id=' + x;
}
else show_alert();
}
function firma_n(id_firm,ubytovanie_flag)
{
var properties="width=567,height="+(screen.availHeight - 100)+",scrollbars=yes,resizable=yes,top=15,left=15,status=yes";
var nove_okno;
if (nove_okno = window.open('','okno',properties)){
var new_location = homePage + '/firma_detail.php?firma='+id_firm;
if (ubytovanie_flag != '') new_location += "#" + ubytovanie_flag;
nove_okno.window.location = new_location;
}
else show_alert();
}
function firma_a(id_firm,ubytovanie_flag)
{
var properties="width=567,height="+(screen.availHeight - 100)+",scrollbars=yes,resizable=yes,top=15,left=15,status=yes";
var nove_okno;
if (nove_okno = window.open('','okno',properties)){
var new_location = homePage + '/firma_detail.php?firma='+id_firm+'&id_jazyk=3';
if (ubytovanie_flag != '') new_location += "#" + ubytovanie_flag;
nove_okno.window.location = new_location;
}
else show_alert();
}
function firma_de(id_firm,ubytovanie_flag)
{
var properties="width=567,height="+(screen.availHeight - 100)+",scrollbars=yes,resizable=yes,top=15,left=15,status=yes";
var nove_okno;
if (nove_okno = window.open('','okno',properties)){
var new_location = homePage + '/firma_detail.php?firma='+id_firm+'&id_jazyk=2';
if (ubytovanie_flag != '') new_location += "#" + ubytovanie_flag;
nove_okno.window.location = new_location;
}
else show_alert();
}
function nove_o_all(x)
{
var sirka = 320;
var vyska = 240;
var properties='width=' + sirka + ',height=' + vyska + ',scrollbars=yes,resizable=yes,top=15,left=15';
var nove_okno;
if (nove_okno = window.open(homePage + '/big_foto_all.php?id=' + x,'okno',properties)){
}
else show_alert();
}
function nove_o_other(x,sep) {
	var sirka = 600;
	var vyska = 240;
	var properties='width=' + sirka + ',height=' + vyska + ',scrollbars=yes,resizable=yes,top=15,left=15';
var nove_okno;
if (nove_okno = window.open(homePage + '/big_foto_other.php?id=' + x + '&separator=' + sep,'okno',properties)){
}
else show_alert();
}
var old_class_name = '';
function change_parent_style(obj,what,class_name) {
while (obj.parentNode.tagName != what) {
obj = obj.parentNode;
}
old_class_name = obj.parentNode.className;
obj.parentNode.className = class_name;
}
function get_date(obj,zrus) {
var properties = 'width=200,height=170,resizable=0,scrollbars=0,status=0';
var nove_okno;
if (nove_okno = window.open('','date',properties)) {
nove_okno.window.location = homePage + '/admin_new/get_date.php?obj=' + obj.id + '&zrus=' + zrus;
}
else show_alert();
}
function get_time(obj,zrus) {
var properties = 'width=';
if (zrus) properties += '280'; else properties += '250';
properties += ',height=100,resizable=0,scrollbars=0';
var nove_okno;
if (nove_okno = window.open('','date',properties)) {
var next = '';
if (obj.value != '') next = '&hour_actual=' + obj.value.substr(0,2) + '&minute_actual=' + obj.value.substr(3,2);
nove_okno.window.location = homePage + '/admin_new/get_time.php?obj=' + obj.id + next + '&zrus=' + zrus;
}
else show_alert();
}
function print_select(how,sort) {
var properties = 'width=550,height=250,top=5,left=5,scrollbars=0,resizable=0';
var nove_okno;
if (nove_okno = window.open('','print',properties)) {
nove_okno.window.location = homePage + '/new_window.php?id=0pbsdnm65m0fncu8pjf8tuaqf0&what=print&how=' + how + '&sort=' + sort;
}
else show_alert();
}
function set_other(id) {
document.getElementById(id).checked = 1;
}
function open_div(obj) {
while (obj.parentNode.tagName != 'DIV' || obj.parentNode.className == 'intermezzo') obj = obj.parentNode;
if (obj.parentNode.id != 'stop_div') {
obj.parentNode.style.display = 'block';
document.getElementById(obj.parentNode.id.substr(0,obj.parentNode.id.length - 1)).src = 'images/grayminus.gif';
open_div(obj.parentNode);
}
}
var _password_verify_error;
var _login_verify_error;
var permitted_chars = new Array('+','*','/',',',':','.','\'',';','&','"',' ',String.fromCharCode(34),String.fromCharCode(92));
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;
}
var show_flag = new Array();
function init_menu_virtualne() {
var _left;
var _top;
var active_menu;
var obj;
for (number=0;number<show_flag.length;number++) {
active_menu = document.getElementById('d_menu_' + number);
obj = document.getElementById('submenu' + number);
_top = obj.offsetTop + document.getElementById('search_row').offsetHeight - 5;
if (is_navigator_type('ie')) _top += document.getElementById('v_header').offsetHeight;
_left = obj.offsetLeft;
if (is_navigator_type('ie')) _left += document.getElementById('for_v_menu').offsetLeft;
active_menu.style.left = _left + 'px';
active_menu.style.top = _top + 'px';
}
}
function activate_submenu(number) {
var active_menu = document.getElementById('d_menu_' + number);
show_flag[number] = 1;
window.setTimeout('activate_submenu1('+number+')',300);
}
function activate_submenu1(number) {
if (show_flag[number]) {
var active_menu = document.getElementById('d_menu_' + number);
if (show_flag[number]) active_menu.style.display = 'block';
}
}
function deactivate_submenu(number) {
var active_menu = document.getElementById('d_menu_' + number);
show_flag[number] = 0;
window.setTimeout('deactivate_submenu1(' + number + ')',300);
}
function deactivate_submenu1(number) {
var active_menu = document.getElementById('d_menu_' + number);
if (!show_flag[number]) active_menu.style.display = 'none';
}
function verify_rec(x) {
if (document.getElementById('module_data__' + x + '__nazov').value == '') {
window.alert('Nezadali ste názov!');
document.getElementById('module_data__' + x + '__nazov').focus();
return false;
}
if (document.getElementById('module_data__' + x + '__suroviny').value == '') {
window.alert('Nezadali ste suroviny!');
document.getElementById('module_data__' + x + '__suroviny').focus();
return false;
}
if (document.getElementById('module_data__' + x + '__postup').value == '') {
window.alert('Nezadali ste postup!');
document.getElementById('module_data__' + x + '__postup').focus();
return false;
}
return window.confirm("Skutočne chcete odoslať recept?\nSkontrolujte prosím pre odoslaním jeho správnosť");
}
function change_recept(id,what) {
if (document.getElementById(what + '_recept_' + id).style.display == 'block') document.getElementById(what + '_recept_' + id).style.display = 'none';
else {
document.getElementById('add_recept_' + id).style.display = 'none';
document.getElementById('send_recept_' + id).style.display = 'none';
document.getElementById(what + '_recept_' + id).style.display = 'block';
}
}
function change_tip(id,what) {
if (document.getElementById(what + '_tip_' + id).style.display == 'block') document.getElementById(what + '_tip_' + id).style.display = 'none';
else {
document.getElementById('add_tip_' + id).style.display = 'none';
document.getElementById('send_tip_' + id).style.display = 'none';
document.getElementById(what + '_tip_' + id).style.display = 'block';
}
}
function temp_upload(position) {
var posun = 0;
if (_mozilla) posun = window.scrollY;
else {
if (_ie6) posun = document.documentElement.scrollTop;
else if (_ie50 || _ie55) posun = document.body.scrollTop;
}
var obj = document.getElementById('uploading_data');
if (obj != null) {
if (posun) obj.style.top = position + posun + 'px';
obj.style.display = 'block';
}
}
function init_menu(id_menu) {
var menu = document.getElementById('menu_id_' + id_menu);
if (menu != null) {
document.getElementById('a_m_' + id_menu).className += '_active';
menu = menu.parentNode;
while (menu.className != 'main_menu') {
menu.style.display = 'block';
menu = menu.parentNode;
}
}
}
function firma_nn(id_firm) {
var properties="width=590,height=100,scrollbars=yes,resizable=yes,top=15,left=15";
var nove_okno;
if (nove_okno = window.open('','okno',properties)){
nove_okno.window.location = homePage + '/firma_detail_n.php?ico=' + id_firm;
}
else show_alert();
}
function get_ring(id_ring) {
var properties="width=200,height=50,scrollbars=no,resizable=no,top=15,left=15";
if (!window.open(homePage + '/admin_new/playamo/player.php?productId=' + id_ring,'ring',properties)) show_alert();
}
function getAjaxData(id,id_banner) {
	var navrat = '';
	var url = 'http://reklama.slovenska.sk/get_banner_script.php?id=' + id_banner;
	if (window.ActiveXObject) httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
	else httpRequest = new XMLHttpRequest();
	httpRequest.open('GET', url, true);
	httpRequest.onreadystatechange= function () {processRequestR(id); } ;
	httpRequest.send(null);
}

