var sajax_debug_mode = false;var sajax_request_type = "GET";var sajax_target_id = "";var sajax_failure_redirect = "";function sajax_debug(text) {if (sajax_debug_mode)alert(text);}function sajax_init_object() {sajax_debug("sajax_init_object() called..");var A;var msxmlhttp = new Array('Msxml2.XMLHTTP.5.0','Msxml2.XMLHTTP.4.0','Msxml2.XMLHTTP.3.0','Msxml2.XMLHTTP','Microsoft.XMLHTTP');for (var i = 0; i < msxmlhttp.length; i++) {try {A = new ActiveXObject(msxmlhttp[i]);} catch (e) {A = null;}}if(!A && typeof XMLHttpRequest != "undefined")A = new XMLHttpRequest();if (!A)sajax_debug("Could not create connection object.");return A;}var sajax_requests = new Array();function sajax_cancel() {for (var i = 0; i < sajax_requests.length; i++)sajax_requests[i].abort();}function sajax_do_call(func_name, args) {var i, x, n;var uri;var post_data;var target_id;sajax_debug("in sajax_do_call().." + sajax_request_type + "/" + sajax_target_id);target_id = sajax_target_id;if (typeof(sajax_request_type) == "undefined" || sajax_request_type == "")sajax_request_type = "GET";uri = "/";if (sajax_request_type == "GET") {if (uri.indexOf("?") == -1)uri += "?rs=" + escape(func_name);else{uri += "&rs=" + escape(func_name);}uri += "&rst=" + escape(sajax_target_id);uri += "&rsrnd=" + new Date().getTime();for (i = 0; i < args.length-1; i++)uri += "&rsargs[]=" + escape(args[i]);post_data = null;}else if (sajax_request_type == "POST") {post_data = "rs=" + escape(func_name);post_data += "&rst=" + escape(sajax_target_id);post_data += "&rsrnd=" + new Date().getTime();for (i = 0; i < args.length-1; i++)post_data = post_data + "&rsargs[]=" + escape(args[i]);}else {alert("Illegal request type: " + sajax_request_type);}x = sajax_init_object();if (x == null) {if (sajax_failure_redirect != "") {location.href = sajax_failure_redirect;return false;} else {sajax_debug("NULL sajax object for user agent:\n" + navigator.userAgent);return false;}} else {x.open(sajax_request_type, uri, true);sajax_requests[sajax_requests.length] = x;if (sajax_request_type == "POST") {x.setRequestHeader("Method", "POST " + uri + " HTTP/1.1");x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");}x.onreadystatechange = function() {if (x.readyState != 4)return;sajax_debug("received " + x.responseText);var status;var data;var txt = x.responseText.replace(/^\s*|\s*$/g,"");status = txt.charAt(0);data = txt.substring(2);if (status == "") {} else if (status == "-")alert("Error: " + data);else {if (target_id != "")document.getElementById(target_id).innerHTML = eval(data);else {try {var callback;var extra_data = false;if (typeof args[args.length-1] == "object") {callback = args[args.length-1].callback;extra_data = args[args.length-1].extra_data;} else {callback = args[args.length-1];}callback(eval(data), extra_data);} catch (e) {sajax_debug("Caught error " + e + ": Could not eval " + data );}}}}}sajax_debug(func_name + " uri = " + uri + "/post = " + post_data);x.send(post_data);sajax_debug(func_name + " waiting..");delete x;return true;}function x_store_menu_state_to_session() {sajax_do_call("store_menu_state_to_session",x_store_menu_state_to_session.arguments);}function x_e8() {sajax_do_call("e8",x_e8.arguments);}function x_gm() {sajax_do_call("gm",x_gm.arguments);}function x_login() {sajax_do_call("login",x_login.arguments);}function x_logout() {sajax_do_call("logout",x_logout.arguments);}function x_show_help() {sajax_do_call("show_help",x_show_help.arguments);}function x_account_activation() {sajax_do_call("account_activation",x_account_activation.arguments);}function x_f1() {sajax_do_call("f1",x_f1.arguments);}function x_f0() {sajax_do_call("f0",x_f0.arguments);}function x_d9() {sajax_do_call("d9",x_d9.arguments);}function x_bl() {sajax_do_call("bl",x_bl.arguments);}function x_gg() {sajax_do_call("gg",x_gg.arguments);}function x_eb() {sajax_do_call("eb",x_eb.arguments);}function x_kr() {sajax_do_call("kr",x_kr.arguments);}function x_gc() {sajax_do_call("gc",x_gc.arguments);}function x_au() {sajax_do_call("au",x_au.arguments);}function x_p() {sajax_do_call("p",x_p.arguments);}function x_r() {sajax_do_call("r",x_r.arguments);}function x_bi() {sajax_do_call("bi",x_bi.arguments);}function x_f() {sajax_do_call("f",x_f.arguments);}function x_iw() {sajax_do_call("iw",x_iw.arguments);}function x_is() {sajax_do_call("is",x_is.arguments);}function x_rating_add() {sajax_do_call("rating_add",x_rating_add.arguments);}function x_gl() {sajax_do_call("gl",x_gl.arguments);}function x_z() {sajax_do_call("z",x_z.arguments);}function x_f5() {sajax_do_call("f5",x_f5.arguments);}function x_bj() {sajax_do_call("bj",x_bj.arguments);}function x_add_to_catalog_or_remove() {sajax_do_call("add_to_catalog_or_remove",x_add_to_catalog_or_remove.arguments);}function x_k3() {sajax_do_call("k3",x_k3.arguments);}function x_fc() {sajax_do_call("fc",x_fc.arguments);}function x_jt() {sajax_do_call("jt",x_jt.arguments);}function x_i4() {sajax_do_call("i4",x_i4.arguments);}function x_g2() {sajax_do_call("g2",x_g2.arguments);}function x_gz() {sajax_do_call("gz",x_gz.arguments);}function x_bh() {sajax_do_call("bh",x_bh.arguments);}function x_jc() {sajax_do_call("jc",x_jc.arguments);}function x_kq() {sajax_do_call("kq",x_kq.arguments);}function x_eo() {sajax_do_call("eo",x_eo.arguments);}function x_j6() {sajax_do_call("j6",x_j6.arguments);}function x_gr() {sajax_do_call("gr",x_gr.arguments);}function x_h() {sajax_do_call("h",x_h.arguments);}function x_ih() {sajax_do_call("ih",x_ih.arguments);}function x_save_pictures_order() {sajax_do_call("save_pictures_order",x_save_pictures_order.arguments);}function x_v() {sajax_do_call("v",x_v.arguments);}function x_ix() {sajax_do_call("ix",x_ix.arguments);}function x_store_newsletter_email() {sajax_do_call("store_newsletter_email",x_store_newsletter_email.arguments);}function x_g() {sajax_do_call("g",x_g.arguments);}function js_debug(){var jsd = 'js debug: ';jsd += '<br>current_pic='+current_pic;jsd += '<br>available_pics='+available_pics;document.getElementById('js_debug_div').innerHTML = jsd;}function store_menu_state_to_session(){var menu_state = get_menu_status();x_store_menu_state_to_session(menu_state, submenu_stati.toString(), store_menu_state_to_session_cb);}function encode_utf8(text){return unescape(encodeURIComponent(text));}function decode_utf8(text){return decodeURIComponent(escape(text));}function debug_init(){window.setInterval('x_gm(standard_innerhtml_cb);',1000);}function login(){document.getElementById("login_logout_loader").style.display='block';document.getElementById("login_submit").blur();var log = document.getElementById("login_user").value;var pwd = document.getElementById("login_pass").value;x_login(log,pwd,login_cb);}function logout(){stop_polling_cycle();document.getElementById("login_logout_loader").style.display='block';document.getElementById("logout_submit").blur();x_logout(logout_cb);}var last_modal_dialog_cleanup = '';function show_help(section){x_show_help(section, 0, show_modal_dialog);}var dialog_top;var focus_to_element_after_modal_dialog_hide = false;function show_modal_dialog(data){dialog_top = parseInt(getYScrollAmount()) + data[0];document.getElementById("dialog_frame").style.top = dialog_top + 'px';last_modal_dialog_cleanup = '';if(document.getElementById("reg_state")){document.getElementById("reg_state").style.visibility='hidden';last_modal_dialog_cleanup += 'document.getElementById("reg_state").style.visibility=\'visible\';';}if(document.getElementById("spec_category")){document.getElementById("spec_category").style.visibility='hidden';last_modal_dialog_cleanup += 'document.getElementById("spec_category").style.visibility=\'visible\';';}if(data[1]<400){animate_resizing_dialog_frame(data[1]-20,data[2]-20,data[1],data[2],data[3]);}else{animate_resizing_dialog_frame(data[1],data[2],data[1],data[2],data[3]);}document.getElementById("modality_mask").style.display='block';}var animate_resizing_dialog_frame_content_tmp;var animate_resizing_dialog_frame_counter = 0;function animate_resizing_dialog_frame(w1,h1,w2,h2,content){if(animate_resizing_dialog_frame_counter == 0){animate_resizing_dialog_frame_content_tmp = content;document.getElementById("dialog_frame").style.display='block';document.getElementById("dialog_frame_shadow").style.display='block';}else{if(w1==w2 && h1==h2){animate_resizing_dialog_frame_counter = 9999;document.getElementById("dialog_frame_target").innerHTML = animate_resizing_dialog_frame_content_tmp;document.getElementById("dialog_frame_target").style.height=h2-23+'px';document.getElementById("dialog_frame_target").style.width=w2-3+'px';document.getElementById("dialog_frame_target").style.top='20px';document.getElementById("dialog_frame_target").style.left='0px';document.getElementById("dialog_frame_target").style.display='block';}else{w1 += 4;h1 += 4;if(w1>w2){w1=w2;}if(h1>h2){h1=h2;}}}animate_resizing_dialog_frame_counter++;document.getElementById("dialog_frame").style.width = w1+'px';document.getElementById("dialog_frame").style.height = h1+'px';document.getElementById("dialog_frame_shadow").style.width = w1+3+'px';document.getElementById("dialog_frame_shadow").style.height = h1-14+'px';document.getElementById("dialog_frame_shadow").style.top = -h1+dialog_top+18+'px';document.getElementById("dialog_content").style.width = w1-2+'px';document.getElementById("dialog_content").style.height = h1-20+'px';document.getElementById("dialog_content").style.top = 18+'px';if(animate_resizing_dialog_frame_counter < 9999){window.setTimeout('animate_resizing_dialog_frame('+w1+','+h1+','+w2+','+h2+',\'\');',30);}}function hide_modal_dialog(){eval(last_modal_dialog_cleanup);document.getElementById("dialog_frame").style.display='none';document.getElementById("modality_mask").style.display='none';animate_resizing_dialog_frame_counter = 0;document.getElementById("dialog_frame_shadow").style.display='none';document.getElementById("dialog_frame_target").style.display='none';document.getElementById("dialog_frame_target").innerHTML = '';if(focus_to_element_after_modal_dialog_hide){if(document.getElementById(focus_to_element_after_modal_dialog_hide)){document.getElementById(focus_to_element_after_modal_dialog_hide).focus();}focus_to_element_after_modal_dialog_hide = false;}}function account_activation(code){if(code.length!=8){alert('Chyba: aktivačný kód musí mať presne 8 znakov!');}else{x_account_activation(code,standard_innerhtml_cb);}}function pwd_reset(code){if(code.length!=12){alert('Chyba: bezpečnostný kód musí mať presne 12 znakov!');}else{x_f1(code,0,standard_innerhtml_cb);}}function show_processing_bar(state){if(state==1){var bar_top = parseInt(getYScrollAmount()) + 300;document.getElementById("processing_mask").style.top = bar_top + 'px';document.getElementById("processing_mask").style.display='block';}else{document.getElementById("processing_mask").style.display='none';}}function getStyle(oElm, strCssRule){var strValue = "";if(document.defaultView && document.defaultView.getComputedStyle){strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule);}else if(oElm.currentStyle){strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){return p1.toUpperCase();});strValue = oElm.currentStyle[strCssRule];}return strValue;}function getYScrollAmount(){if(typeof window.pageYOffset != "undefined"){var scroll = window.pageYOffset;}else if(typeof document.documentElement.scrollTop != "undefined"){var scroll = document.documentElement.scrollTop;}else{var scroll = document.body.scrollTop;}return parseInt(scroll);};function getXScrollAmount(){if(typeof window.pageXOffset != "undefined"){var scroll = window.pageXOffset;}else if(typeof document.documentElement.scrollLeft != "undefined"){var scroll = document.documentElement.scrollLeft;}else{var scroll = document.body.scrollLeft;}return parseInt(scroll);};var user_list_hover_last_timeout=false;var user_list_hover_blocked=0;function user_list_hover(state,id){if(user_list_hover_blocked){return 1;}if(state!=3){document.getElementById("tooltip_div").style.display='none';if(user_list_hover_last_timeout){window.clearTimeout(user_list_hover_last_timeout);}if(state==1){user_list_hover_last_timeout = window.setTimeout('user_list_hover(3,'+id+');',1000);}}else{if(tempX+300+15+30 > document.getElementById("layer1").offsetWidth){document.getElementById("tooltip_div").style.left = tempX-35-300+'px';}else{document.getElementById("tooltip_div").style.left = tempX+15+'px';}if(tempY+200+15+30 > document.getElementById("layer1").offsetHeight){document.getElementById("tooltip_div").style.top = tempY-45-200+'px';}else{document.getElementById("tooltip_div").style.top = tempY+15+'px';}document.getElementById("tooltip_div").innerHTML='<center><br><b>LOADING</b><div class="loading_bar">&nbsp;</div></center>';document.getElementById("tooltip_div").style.display='block';x_gc(id,standard_innerhtml_cb)}}function getMouseXY(e){if(e){tempX = e.pageX;tempY = e.pageY;}else{tempX = event.clientX + getXScrollAmount();tempY = event.clientY + getYScrollAmount();}}function get_viewport_wh(){var viewportwidth;var viewportheight;if (typeof window.innerWidth != 'undefined'){viewportwidth = window.innerWidth,viewportheight = window.innerHeight}else if (typeof document.documentElement != 'undefined'&& typeof document.documentElement.clientWidth !='undefined' && document.documentElement.clientWidth != 0){viewportwidth = document.documentElement.clientWidth,viewportheight = document.documentElement.clientHeight}else{viewportwidth = document.getElementsByTagName('body')[0].clientWidth,viewportheight = document.getElementsByTagName('body')[0].clientHeight}alert('Your viewport width is '+viewportwidth+'x'+viewportheight);}function getPos(inputElement) {var coords =  new Object();coords.x = 0;coords.y = 0;try {targetElement = inputElement;if(targetElement.x && targetElement.y) {coords.x = targetElement.x;coords.y = targetElement.y;} else {if(targetElement.offsetParent) {coords.x += targetElement.offsetLeft;coords.y += targetElement.offsetTop;while(targetElement = targetElement.offsetParent) {coords.x += targetElement.offsetLeft;coords.y += targetElement.offsetTop;}} else {}}return coords;} catch(error) {return coords;}}var basketPanel_dragged = 0;var basketPanel_dragged_prev = 0;function show_basket_panel(reset_position){if(YAHOO.gastroshop.basketPanel.cfg.getProperty('visible')){if(reset_position==1){YAHOO.gastroshop.basketPanel.moveTo(50,50);}basketPanel_savepos_forced();}YAHOO.gastroshop.basketPanel.show();}function basketPanel_savepos(){if(basketPanel_dragged_prev==1 && basketPanel_dragged==0){x_store_menu_state_to_session( getPos(document.getElementById('basketPanel')).x+','+getPos(document.getElementById('basketPanel')).y,'basketPanel', store_menu_state_to_session_cb);}basketPanel_dragged_prev = basketPanel_dragged;basketPanel_dragged=0;}function basketPanel_savepos_forced(){x_store_menu_state_to_session( getPos(document.getElementById('basketPanel')).x+','+getPos(document.getElementById('basketPanel')).y,'basketPanel', store_menu_state_to_session_cb);}function basket_cmd(item_id,command){x_p(item_id,command,0,standard_innerhtml_cb);if(document.getElementById("basket_checkout")){x_v('refresh',0,0,v_cb);}}function show_hide_side_tab(id,action){if(action){document.getElementById("side_tab_"+id+"_open").style.display='none';side_tab_anim(id,action,190);x_store_menu_state_to_session(id+',show', 'sideTabs', store_menu_state_to_session_cb);}else{side_tab_anim(id,action,0);x_store_menu_state_to_session(id+',hide', 'sideTabs', store_menu_state_to_session_cb);if(id==2){side_tab_compare_rolled = 0;}}if(id==2 || id==3){side_tab_chat_rolled = action;}}function side_tab_anim(id,direction,position){if(direction){position -= (position/10)+3;if(position>10){window.setTimeout("side_tab_anim("+id+","+direction+","+position+");",20);}else{position = 0;}document.getElementById("side_tab_"+id).style.left=-(position)+'px';}else{position += position/10+3;if(position<=190){window.setTimeout("side_tab_anim("+id+","+direction+","+position+");",20);}else{position = 190;document.getElementById("side_tab_"+id+"_open").style.display='block';}document.getElementById("side_tab_"+id).style.left=-(position)+'px';}}function capture_compare_checkboxes(){var i;var states = '';var cbs = document.getElementsByName("cb_compare[]");for(i=0;i<cbs.length;i++){states += cbs[i].value + ',' + document.getElementById("cb_compare_"+cbs[i].value).checked + ',';}return states;}var rating_anim_out;function rating_animate(seg,state,opacity){if(state==1){if(rating_anim_out){clearTimeout(rating_anim_out);rating_anim_out = false;}document.getElementById("rating_score").style.display='none';var pos = seg * 30;document.getElementById("rating_fork").style.backgroundPosition='0px -'+pos+'px';document.getElementById("rating_fork").setAttribute("class", "rating_fork");document.getElementById("rating_fork").setAttribute("className", "rating_fork");}else{if(opacity){rating_anim_out = window.setTimeout("document.getElementById('rating_score').style.display='block';document.getElementById('rating_fork').style.backgroundPosition='0px 0px';document.getElementById('rating_fork').setAttribute('class','rating_fork0');document.getElementById('rating_fork').setAttribute('className','rating_fork0');",10);}else{rating_anim_out = window.setTimeout("document.getElementById('rating_score').style.display='block';document.getElementById('rating_fork').style.backgroundPosition='0px 0px';",10);}}}function rating_animate2(seg,state,opacity){if(state==1){if(rating_anim_out){clearTimeout(rating_anim_out);rating_anim_out = false;}document.getElementById("rating_score").style.display='none';document.getElementById("rating_bar").style.display='block';document.getElementById("rating_bar").style.width=(7 + seg * 22 + seg / 3)+'px';document.getElementById("rating_merch").setAttribute("class", "rating_merch");document.getElementById("rating_merch").setAttribute("className", "rating_merch");}else{document.getElementById("rating_bar").style.display='none';document.getElementById("rating_bar").style.width='0 px';if(opacity){rating_anim_out = window.setTimeout("document.getElementById('rating_score').style.display='block';document.getElementById('rating_merch').style.backgroundPosition='0px 0px';document.getElementById('rating_merch').setAttribute('class','rating_merch0');document.getElementById('rating_merch').setAttribute('className','rating_merch0');",10);}else{rating_anim_out = window.setTimeout("document.getElementById('rating_score').style.display='block';document.getElementById('rating_merch').style.backgroundPosition='0px 0px';",10);}}}function rating_animate2m(seg,state,opacity,order){if(state==1){if(rating_anim_out){clearTimeout(rating_anim_out);rating_anim_out = false;}document.getElementById("rating_score"+order).style.display='none';document.getElementById("rating_bar"+order).style.display='block';var w,l,b;if(seg==1){w = 140;l = 0;b = 0;}else if(seg < 7){w = (13 + 7 + (Math.abs(6-seg) * 22) + seg / 3);l = 140 - w;b = 140 - w;}else if(seg == 11){l = 119;b = 119;w = 141;}else{l = 119;b = 119;w = (7 + seg * 22 + seg / 3) - l;}document.getElementById("rating_bar"+order).style.width=w+'px';document.getElementById("rating_bar"+order).style.left=l+'px';document.getElementById("rating_bar"+order).style.backgroundPosition=-b+'px -30px';document.getElementById("rating_merch"+order).setAttribute("class", "rating_merch");document.getElementById("rating_merch"+order).setAttribute("className", "rating_merch");}else{document.getElementById("rating_bar"+order).style.display='none';document.getElementById("rating_bar"+order).style.width='0 px';if(opacity){rating_anim_out = window.setTimeout("document.getElementById('rating_score'+order).style.display='block';document.getElementById('rating_merch'+order).style.backgroundPosition='0px 0px';document.getElementById('rating_merch'+order).setAttribute('class','rating_merch0');document.getElementById('rating_merch'+order).setAttribute('className','rating_merch0');",10);}else{rating_anim_out = window.setTimeout("document.getElementById('rating_score'+order).style.display='block';document.getElementById('rating_merch'+order).style.backgroundPosition='0px 0px';",10);}}}function get_basket_items_amout(){return document.getElementById("basket_items").value;}function get_basket_items_var(){if(document.getElementById("var_sizes")){return document.getElementById("var_sizes").value;}else{return 0;}}function add_comment_link(which){if(which==1){document.getElementById('add_comment_form_1').style.display='block';if(document.getElementById('no_comments_yet')){document.getElementById('no_comments_yet').style.display='none';}}else if(which==2){document.getElementById('add_comment_form_2').style.display='block';}if(document.getElementById('add_comment_link_1')){document.getElementById('add_comment_link_1').style.visibility='hidden';}if(document.getElementById('add_comment_link_2')){document.getElementById('add_comment_link_2').style.visibility='hidden';}}function chat_send(){if(document.getElementById("sending_bar").style.display!='block'){document.getElementById("sending_bar").style.display='block';x_z('send',document.getElementById("chat_msg").value,chat_action_and_rollout_cb);}}var polling_cycle_timeout = false;var polling_cycle_shutdown = false;function start_polling_cycle(){return false;polling_cycle_shutdown = false;polling_cycle_timeout = window.setTimeout('x_f5(f5_cb);',polling_cycle_interval);}function stop_polling_cycle(){return false;polling_cycle_shutdown = true;window.clearTimeout(polling_cycle_timeout);}function browse_goods_pictures(id,kind,dir){if(dir==1){if(current_pic<available_pics){current_pic++;}}if(dir==-1){if(current_pic>1){current_pic--;}}if(dir==9){current_pic=available_pics;}if(dir==0){current_pic=1;}document.getElementById('goods_picture').src='./picture.php?id='+id+'&kind='+kind+'&n='+current_pic+'&skin=naviservice&res=1&refresh='+Math.floor(100000*Math.random());if(current_pic==1){document.getElementById('icon_arrow_left').setAttribute("class", "icon_arrow_left0");document.getElementById('icon_arrow_left').setAttribute("className", "icon_arrow_left0");}else{document.getElementById('icon_arrow_left').setAttribute("class", "icon_arrow_left");document.getElementById('icon_arrow_left').setAttribute("className", "icon_arrow_left");}if(current_pic==available_pics){document.getElementById('icon_arrow_right').setAttribute("class", "icon_arrow_right0");document.getElementById('icon_arrow_right').setAttribute("className", "icon_arrow_right0");}else{document.getElementById('icon_arrow_right').setAttribute("class", "icon_arrow_right");document.getElementById('icon_arrow_right').setAttribute("className", "icon_arrow_right");}if(available_pics>1){document.getElementById('pic_counter').innerHTML = 'Obrázok '+current_pic+'/'+available_pics;}else{document.getElementById('pic_counter').innerHTML = '';}}function change_sort_mode(mode){var loc = "" + window.location;var sort_pos = loc.indexOf("sort=");if(sort_pos > 0){loc = loc.replace(loc.substring(sort_pos,sort_pos+7),"sort="+mode);}else{loc += '&sort='+mode;}window.location=loc;}function change_paging_size(mode){if(mode==''){return;}var loc = "" + window.location;var sort_pos = loc.indexOf("page=");var c;var e=false;if(mode==0){mode = 'all';}if(sort_pos > 0){var end_pos = sort_pos+5;do{c = loc.substring(end_pos,end_pos+1);if(c!='&' && end_pos < loc.length){end_pos++;}else{e = true;}}while(e==false);loc = loc.replace(loc.substring(sort_pos,end_pos),"page=0,"+mode);}else{loc += '&page=0,'+mode;}window.location=loc;}var dropdown_menu_body_swap=0;function show_dropdown_menu(id,action){if(action==1){if(dropdown_menu_body_swap){document.getElementById('dropdown_menu_body').innerHTML = dropdown_menu_body_swap;}if(document.getElementById('super_container')){tempX -= document.getElementById('super_container').offsetLeft;}var tempYmask = tempY - 100;if(tempYmask<0){tempYmask = 0;}document.getElementById('dropdown_menu_title').innerHTML='#'+id;document.getElementById('dropdown_menu').style.left= tempX-15+'px';document.getElementById('dropdown_menu').style.top = tempY-15+'px';document.getElementById('dropdown_menu_outer_mask').style.top=tempYmask+'px';document.getElementById('dropdown_menu').style.display='block';document.getElementById('dropdown_menu_outer_mask').style.display='block';document.getElementById('dropdown_menu_item0').href='?menu=cpl&id=goods&item='+id;document.getElementById('dropdown_menu_item1').href='?menu=cpl&id=stock&item='+id;document.getElementById('dropdown_menu_item2').href='?menu=cpl&id=stock&item='+id;if(document.getElementById('dropdown_menu_item3')){document.getElementById('dropdown_menu_item3').href='';document.getElementById('dropdown_menu_item3').onclick = function(){document.getElementById('dropdown_menu_outer_mask').style.display='none';dropdown_menu_body_swap = document.getElementById('dropdown_menu_body').innerHTML;document.getElementById('dropdown_menu_body').innerHTML = "<div class=\"dropdown_catg_move\">Wybierz kategorie do ktrej przesuniesz produkt:<form action=\"\" method=\"GET\"><input type=\"hidden\" id=\"catg_move_current_catg\" name=\"id\" value=\"0\"><input type=\"hidden\" id=\"catg_move_src\" name=\"src_id\" value=\"00\"><select class=\"dest_catg\" name=\"dest_catg\" id=\"dest_catg\" onChange=\"/*alert(\'dropdown1 changed\');*/return false;\"><option value=\"0\">-- wybierz --</select><div style=\"height:20px;\"><input type=\"submit\" name=\"move\" value=\"OK\" class=\"button2\" style=\"position:relative;top:1px;display:block;margin-left:10px;text-decoration:none;-moz-outline-style:none;text-align:center;cursor:pointer;cursor:hand;\"><input type=\"submit\" onclick=\"show_dropdown_menu(0,0);return false;\" name=\"cancel\" value=\"Anuluj\" class=\"button2\" style=\"position:relative;top:1px;display:block;margin-left:10px;text-decoration:none;-moz-outline-style:none;text-align:center;cursor:pointer;cursor:hand;\"></div></form></div>";document.getElementById('catg_move_src').value = id;var loc = "" + window.location;var id_pos = loc.indexOf("id=");var id_x = 0;if(id_pos > 0){id_x = parseInt(loc.substring(id_pos+3),10);}document.getElementById('catg_move_current_catg').value = id_x;return false;}}if(document.getElementById('dropdown_menu_item4')){document.getElementById('dropdown_menu_item4').href='';document.getElementById('dropdown_menu_item4').onclick = function(){x_add_to_catalog_or_remove(id,1,add_to_catalog_or_remove_cb);return false;}}if(document.getElementById('dropdown_menu_item5')){document.getElementById('dropdown_menu_item5').href='';document.getElementById('dropdown_menu_item5').onclick = function(){x_kq(id,kq_cb);return false;}}}else if(action==0){document.getElementById('dropdown_menu').style.display='none';document.getElementById('dropdown_menu_outer_mask').style.display='none';}}function save_restore_user_auction(action){var result = '';var value;var error = 0;if(action==1){for(x1=1;x1<=4;x1++){for(x2=1;x2<=4;x2++){for(x3=1;x3<=4;x3++){if(document.getElementById("catalog_x"+x1+''+x2+''+x3)){value = document.getElementById("catalog_x"+x1+x2+x3).value;value = strtr(value,',','.');if(value == '' || !isNaN(value)){result += x1+'-'+x2+'-'+x3+':'+value+';';document.getElementById("catalog_x"+x1+x2+x3).setAttribute("class", "auction_input0");document.getElementById("catalog_x"+x1+x2+x3).setAttribute("className", "auction_input0");}else{alert('Pozor, zadali ste nespravnu hodnotu: '+value+'. Pouzite len cisla pripadne desatinne ciarky');document.getElementById("catalog_x"+x1+x2+x3).setAttribute("class", "auction_input1");document.getElementById("catalog_x"+x1+x2+x3).setAttribute("className", "auction_input1");x1=999;x2=999;x3=999;error = 1;}}}}}if(error){}else{document.getElementById('save_auction_avg_bar').style.display='block';x_k3(result,k3_cb);}}else if(action == 0){x_fc(0,1,fc_cb);}}function clear_user_auction_inputs(){for(x1=1;x1<=4;x1++){for(x2=1;x2<=4;x2++){for(x3=1;x3<=4;x3++){if(document.getElementById("catalog_x"+x1+''+x2+''+x3)){document.getElementById("catalog_x"+x1+x2+x3).value = '';document.getElementById("catalog_x"+x1+x2+x3).setAttribute("class", "auction_input0");document.getElementById("catalog_x"+x1+x2+x3).setAttribute("className", "auction_input0");}}}}}function strtr (str, from, to) {var fr = '', i = 0, lgth = 0;if (typeof from === 'object') {for (fr in from) {str = str.replace(fr, from[fr]);}return str;}lgth = to.length;if (from.length < to.length) {lgth = from.length;}for (i = 0; i < lgth; i++) {str = str.replace(from[i], to[i], 'g');}return str;}function explode( delimiter, string, limit ) {var emptyArray = { 0: '' };if ( arguments.length < 2|| typeof arguments[0] == 'undefined'|| typeof arguments[1] == 'undefined' ){return null;}if ( delimiter === ''|| delimiter === false|| delimiter === null ){return false;}if ( typeof delimiter == 'function'|| typeof delimiter == 'object'|| typeof string == 'function'|| typeof string == 'object' ){return emptyArray;}if ( delimiter === true ) {delimiter = '1';}if (!limit) {return string.toString().split(delimiter.toString());} else {var splitted = string.toString().split(delimiter.toString());var partA = splitted.splice(0, limit - 1);var partB = splitted.join(delimiter.toString());partA.push(partB);return partA;}}function settings_changed(catalog,other){if(catalog){document.getElementById('button_save_settings').style.display='block';document.getElementById('save_settings_bar').style.display='none';if(catalog==1){document.getElementById('catalog_controls_seller_only').style.display='block';}else{document.getElementById('catalog_controls_seller_only').style.display='none';}}if(other){document.getElementById('button_save_settings').style.display='block';document.getElementById('save_settings_bar').style.display='none';}if(other=='saved'){if(document.getElementById('radio_cat_publ1')){var settings = document.getElementById('radio_cat_recv1').checked+'-'+document.getElementById('radio_cat_publ1').checked+'-'+document.getElementById('radio_news1').checked;}else{var settings = document.getElementById('radio_cat_recv1').checked+'-false-'+document.getElementById('radio_news1').checked;}x_jt(settings,jt_cb);document.getElementById('button_save_settings').style.display='none';document.getElementById('save_settings_bar').style.display='block';}}function init_sortables_catalog_picks(){if(document.getElementById("catalog_picks_sort_list")){new Sortables(document.getElementById("catalog_picks_sort_list"),{onComplete:sortables_order_changed});}else{}}function sortables_order_changed(){document.getElementById('save_auction_picks_controls').style.display='block';}function save_auction_picks_order(){var children = document.getElementById('catalog_picks_sort_list').childNodes;var order = '';var special = '';for(var i = 0; i < children.length; i++){order += children.item(i).value+',';special += document.getElementById('catalog_picks_special_option_'+i).value+',';}document.getElementById('save_auction_picks_controls').innerHTML = '<div class="saving_picks_bar" style="float:right;margin-top:5px;"><!-- --></div>';x_g2(order,special,g2_cb);}function remove_auction_pick(id){document.getElementById('save_auction_picks_controls').innerHTML = '<div class="saving_picks_bar" style="float:right;margin-top:5px;"><!-- --></div>';x_add_to_catalog_or_remove(id,2,add_to_catalog_or_remove_cb);}var initial_time;var countdown_interval = false;function init_auction_countdown(){if(countdown_interval){window.clearInterval('countdown_interval');}if(document.getElementById("auction_countdown")){if(document.getElementById("auction_countdown_init")){initial_time = document.getElementById("auction_countdown_init").innerHTML;countdown();countdown_interval = window.setInterval("countdown()",1000);}}}function countdown(){if(!document.getElementById("auction_countdown")){return false;}initial_time --;var day = Math.floor(initial_time / (60 * 60 * 24));var hrs = Math.floor(initial_time / (60 * 60) % 24);var min = Math.floor((initial_time / 60) % 60);var sec = initial_time % 60;var result='';if(sec<10){sec = "0"+sec;}if(min<10){min = "0"+min;}if(day>0){result += '<strong>'+day+'</strong>d, ';}if(hrs>0){result += '<strong>'+hrs+'</strong>h, ';}if(min>0){result += '<strong>'+min+'</strong>m, ';}result += '<strong>'+sec+'</strong>s';document.getElementById("auction_countdown").innerHTML = result;if(initial_time == 0){window.clearInterval(countdown_interval);window.setTimeout('x_gz(standard_innerhtml_cb);',1000);window.setTimeout('x_gz(standard_innerhtml_cb);',2000);}}function quick_order_person_select(type){if(type==1){document.getElementById('ico_dic').style.display='none';}else if(type==2){document.getElementById('ico_dic').style.display='block';}}var auto_value_select_dest = false;var auto_value_select_a = false;function auto_value(type,dest,span_id,a_id){document.getElementById(a_id).style.display='none';document.getElementById(span_id).innerHTML = '<select class=\"brand_select\" name=\"brand_select\" id=\"brand_select\" onChange=\"auto_value_selected(this.value);\"><option value=\"0\">-- wybierz --</select>';auto_value_select_dest = dest;auto_value_select_a = a_id;}function auto_value_selected(value){document.getElementById(auto_value_select_dest).value = value;document.getElementById('auto_value_brand').innerHTML = '';document.getElementById(auto_value_select_a).style.display='inline';}function toggle_order_details(id){if(document.getElementById('ord_a_'+id).innerHTML=='+'){document.getElementById('ord_'+id).style.display='block';document.getElementById('ord_a_'+id).innerHTML='-';}else{document.getElementById('ord_'+id).style.display='none';document.getElementById('ord_a_'+id).innerHTML='+';}}function cpl_profile_publish_defaults(){var i,fields = new Array('name','surname','email','tel1','tel2','fax','company_name','street','town','zip','country'),fields2 = new Array('ico','ico_dph','dic','bank_account');for(i=0;i<fields.length;i++){document.getElementById('cb_publish_'+fields[i]).checked=true;}for(i=0;i<fields2.length;i++){document.getElementById('cb_publish_'+fields2[i]).checked=false;}}function comments_warning(state){if(state){document.getElementById("comments_warning_icon").setAttribute("class", "icon_warning icon_warning_h");document.getElementById("comments_warning_icon").setAttribute("className", "icon_warning icon_warning_h");document.getElementById("comments_warning_text").setAttribute("class", "comments_warning comments_warning_h");document.getElementById("comments_warning_text").setAttribute("className", "comments_warning comments_warning_h");}else{document.getElementById("comments_warning_icon").setAttribute("class", "icon_warning");document.getElementById("comments_warning_icon").setAttribute("className", "icon_warning");document.getElementById("comments_warning_text").setAttribute("class", "comments_warning");document.getElementById("comments_warning_text").setAttribute("className", "comments_warning");}}function define_intervals(container){var dialog_width = 480;$('#dialog_frame').css('top',200);$('#dialog_frame').css('width',dialog_width);$('#modality_mask').fadeIn('normal',function(){ $('#dialog_frame').fadeIn(); });$('#dialog_content').css('top',18);$('#dialog_content').css('width',dialog_width-4);$('#dialog_content').html('<div id="'+container+'"><div></div></div>');$('#dialog_header td:eq(1)').attr('onclick',false);$('#dialog_header td:eq(1)').click(function(){$('#dialog_frame').fadeOut();$('#modality_mask').fadeOut();x_h('interval',h_cb);});x_eo(container,edit_intervals);}var next_int_id;var container;function edit_intervals(data){container = data[0];var ints_c = data[1];var ints = data[2];var rows;next_int_id = 1;$('#'+container+' div:first').empty();$('#'+container+' div:first').append('<div style="height:30px;"><a class="button4" style="padding:0px;padding-left:17px;float:left;clear:both;margin:5px;margin-left:160px;color:#550000;width:130px;line-height:18px;" onclick="add_new_interval_def();return false;">Pridať novú definíciu<span class="button4r" style="height:20px;float:right;margin-right:-3px;"></span></a></div>');var c=0;for(var b=0;c<ints_c && b<100;b++){if(ints[b+1] == undefined){}else{c++;rows = ints[b+1][0]-1;create_new_interval_def(b,0);$('#interval'+b+' .int_name').attr('value',ints[b+1][rows+1][5]);for(var i=1; i<=rows; i++){add_row(b);for(var j=0; j<4; j++){$('#tab'+b+' tr:eq('+(i)+') input:eq('+(j)+')').attr('value',ints[b+1][i][j+1]);}}if(rows==0){add_row();}}}next_int_id = b;$('#'+container).fadeIn();}function add_new_interval_def(){next_int_id++;var b = next_int_id;create_new_interval_def(b,1);}function create_new_interval_def(b,fade){$('#'+container+' div:first').append('<div class="interval" id="interval'+b+'"></div>');if(fade){$('#interval'+b).css('display','none');}$('#interval'+b).append('<p><strong>názov</strong></p><p><input type="text" class="int_name" onkeyup="interval_field_modified(this);"></p>');$('#interval'+b).append('<table id="tab'+b+'"><thead></thead><tbody></tbody></table>');$('#tab'+b+' thead').append('<tr><th>od</th><th>do</th><th>body</th><th>zľava</th><th></th>');$('#tab'+b).append('<tr><td colspan="5"></td></tr>');$('#tab'+b+' tr:last td').append('<a href="" class="row_add" onclick="add_row('+b+');return false;"></a>').append('&nbsp;').append('<button class="button2" style="padding:0px;margin-left:5px;color:#550000;float:right;margin-right:40px;display:none;" onclick="read_data('+b+');return false;">Uložiť</button>').append('<a class="button4" style="padding:0px;padding-left:17px;margin-left:5px;color:#550000;float:right;width:120px;line-height:18px;" onclick="x_gr('+b+',gr_cb);return false;">Odstrániť definíciu<span class="button4r" style="height:20px;float:right;margin-right:-3px;"></span></a>');if(fade){$('#interval'+b).fadeIn();}}function add_row(tab){var row = $('<tr><td></td><td></td><td></td><td></td><td></td></tr>');row.find('td:not(:last)').append('<input type="text" value="" onkeyup="interval_field_modified(this);">');row.find('td:last').append('<a href="" class="row_del" onclick="$(this).parents(\'#tab'+tab+' tr\').fadeOut();row_deleted('+tab+');return false;"></a>');row.hide();row.insertBefore('#tab'+tab+' tr:last').fadeIn();$('#tab'+tab+' .button2').css('display','');$('#tab'+tab+' .button4').css('display','none');}function row_deleted(tab){var remaining_rows = $('#tab'+tab+' tr:visible').length - 3;if(remaining_rows==0){$('#tab'+tab+' .button2').css('display','none');$('#tab'+tab+' .button4').css('display','');}}function read_data(tab){var fields = Array();fields[0] = ''+tab;$('#tab'+tab+' tr:visible input').each(function(i){fields[i+1] = $(this).val();});fields[fields.length] = $('#interval'+tab+' input:first').attr('value');x_j6(serializeJsToPhp(fields),j6_cb);$('#interval'+tab+' .button2').css('display','none');$('#interval'+tab+' tr:last td').append('<div class="saving_intervals_bar" style="float:right;margin-right:40px;margin-top:7px;margin-bottom:4px;"><!-- --></div>');}function interval_field_modified(which){var tbody = $(which).parent().parent().parent();var inp = tbody.find('input').index(which);var tot = tbody.find('input').length;if(inp % 4 == 1 && inp < tot - 4){tbody.find('input:eq('+(3+inp)+')').attr('value',1+parseInt((tbody.find('input:eq('+inp+')').attr('value'))));}if(inp % 4 == 0 && inp >= 4){tbody.find('input:eq('+(-3+inp)+')').attr('value',-1+parseInt((tbody.find('input:eq('+inp+')').attr('value'))));}}function isArray(obj) {if (obj.constructor.toString().indexOf("Array") == -1){return false;}else{return true;}}function serializeJsToPhp(jsArray){var arrayLength = jsArray.length;var phpString = "a:"+arrayLength+":{";for(var i=0; i<arrayLength; i++){phpString += "i:"+i;if(!isArray(jsArray[i])){phpString += ";s:"+jsArray[i].length+":\""+jsArray[i]+"\";";}else{phpString += ";"+serializeJsToPhp(jsArray[i]);}}phpString += "}";return phpString;}function LTrim( value ){var re = /\s*((\S+\s*)*)/;return value.replace(re, "$1");}function RTrim( value ){var re = /((\s*\S+)*)\s*/;return value.replace(re, "$1");}function trim( value ){return LTrim(RTrim(value));}function reg_show_password(status){if(status){document.getElementById('reg_pwd').type='text';document.getElementById('reg_pwd2').type='text';}else{document.getElementById('reg_pwd').type='password';document.getElementById('reg_pwd2').type='password';}}function disable_amt_dlvr(val){if(val>1){document.getElementById("amount").setAttribute("class", "goods_amount goods_input_disabled");document.getElementById("amount").setAttribute("className", "goods_amount goods_input_disabled");document.getElementById("delivery").setAttribute("class", "goods_delivery goods_input_disabled");document.getElementById("delivery").setAttribute("className", "goods_delivery goods_input_disabled");}else{document.getElementById("amount").setAttribute("class", "goods_amount");document.getElementById("amount").setAttribute("className", "goods_amount");document.getElementById("delivery").setAttribute("class", "goods_delivery");document.getElementById("delivery").setAttribute("className", "goods_delivery");}}function disable_points_price(val){if(!val){document.getElementById("points_price").setAttribute("class", "goods_points_price goods_input_disabled");document.getElementById("points_price").setAttribute("className", "goods_points_price goods_input_disabled");document.getElementById("price").setAttribute("class", "goods_price");document.getElementById("price").setAttribute("className", "goods_price");document.getElementById("vat").setAttribute("class", "goods_vat");document.getElementById("vat").setAttribute("className", "goods_vat");}else{document.getElementById("points_price").setAttribute("class", "goods_points_price");document.getElementById("points_price").setAttribute("className", "goods_points_price");document.getElementById("price").setAttribute("class", "goods_price goods_input_disabled");document.getElementById("price").setAttribute("className", "goods_price goods_input_disabled");document.getElementById("vat").setAttribute("class", "goods_vat goods_input_disabled");document.getElementById("vat").setAttribute("className", "goods_vat goods_input_disabled");}}function reorder_pictures(item){var container = 'pictures_ordering';var dialog_width = 480;$('#dialog_frame').css('top',200);$('#dialog_frame').css('width',dialog_width);$('#modality_mask').fadeIn('normal',function(){ $('#dialog_frame').fadeIn(); });$('#dialog_content').css('top',18);$('#dialog_content').css('width',dialog_width-4);$('#dialog_content').html('<div id="'+container+'"><div></div></div>');$('#dialog_header td:eq(1)').attr('onclick',false);$('#dialog_header td:eq(1)').unbind('click');$('#dialog_header td:eq(1)').click(function(){$('#dialog_header td:eq(1)').unbind('click');$('#dialog_header td:eq(1)').click(function(){hide_modal_dialog();} );$('#dialog_frame').fadeOut();$('#modality_mask').fadeOut();window.setTimeout("$('#dialog_content').html('');",1000);});x_ih(item,container,order_pictures);}function order_pictures(data){container = data[0];$('#'+container).html(data[1]);$("#sortable_pictures_order").sortable();$("#sortable_pictures_order").disableSelection();}function save_pictures_order(pic_id,list_id,current_pic){var final_order = '';$('#'+list_id+' li').each(function(i){ final_order += this.id;final_order +=','});x_save_pictures_order(pic_id,final_order,current_pic,save_pictures_order_cb);}function var_rb_change(type, id){$('#'+type+'_p_all p input').attr('checked',false);$('#'+type+'_p_all p').hide();$('#'+type+'_p_'+id).show();}function reg_person_type_changed(value){if(value==1){document.getElementById("reg_buy_sell2").setAttribute("disabled", true);var sel2 = document.getElementById("reg_buy_sell2").checked;if(sel2){document.getElementById("reg_buy_sell1").checked = true;}document.getElementById("reg_buy_sell2_label").setAttribute("class", "reg_radio reg_radio_disabled");document.getElementById("reg_buy_sell2_label").setAttribute("className", "reg_radio reg_radio_disabled");document.getElementById("reg_buy_disabled_hint").style.visibility="visible";}else if(value==2){document.getElementById("reg_buy_sell2").removeAttribute("disabled");document.getElementById("reg_buy_sell2_label").setAttribute("class", "reg_radio");document.getElementById("reg_buy_sell2_label").setAttribute("className", "reg_radio");document.getElementById("reg_buy_disabled_hint").style.visibility="hidden";}}function store_newsletter_email(){document.getElementById('newsletter_email_err').innerHTML = '<!-- -->';document.getElementById('newsletter_send_loader').style.display='block';x_store_newsletter_email(document.getElementById('newsletter_email').value,store_newsletter_email_cb);}function show_direct_acc_info(currency){var all_curr = Array();all_curr[0] = 'pln';all_curr[1] = 'usd';all_curr[2] = 'eur';for(var i=0; i<3; i++){document.getElementById('direct_pay_acc_info_'+all_curr[i]).style.display='none';}document.getElementById('direct_pay_acc_info_'+currency).style.display='block';}function show_countries_dropdown(type){if(type=='letter'){document.getElementById('countries_parcel').style.display='none';document.getElementById('countries_letter').style.display='block';}else if(type=='parcel'){document.getElementById('countries_parcel').style.display='block';document.getElementById('countries_letter').style.display='none';}else{document.getElementById('countries_parcel').style.display='none';document.getElementById('countries_letter').style.display='none';}}function e8_cb(data){document.getElementById(data[0]+"_content").innerHTML = data[2];init_sortables_catalog_picks();init_auction_countdown();}function standard_innerhtml_cb(data){document.getElementById(data[0]).innerHTML = data[1];if(data[2]){document.getElementById(data[2]).innerHTML = data[3];}if(data[4]){document.getElementById(data[4]).innerHTML = data[5];}}function logout_cb(data){document.getElementById(data[0]).innerHTML = data[1];if(!document.getElementById(data[2])){document.getElementById('content').innerHTML = '<br>'+data[3];window.location='?action=logout';}else{document.getElementById(data[2]).innerHTML = data[3];document.getElementById(data[2]).style.display='block';}if(data[4] && document.getElementById(data[4])){document.getElementById(data[4]).innerHTML = data[5];document.getElementById(data[4]).style.display='block';}x_is(standard_innerhtml_cb);}function login_cb(data){document.getElementById("login_logout_loader").style.display='none';if(data[0]==1){document.getElementById(data[1]).innerHTML = data[2];document.getElementById(data[3]).innerHTML = data[4];document.getElementById(data[3]).style.display='block';if(data[5]){if(document.getElementById("message_block"+data[5])){document.getElementById("message_block"+data[5]).innerHTML = '';}}start_polling_cycle();}else if(data[0]==2){window.location = window.location;}else{if(data[1]==1){show_help('account_unverified');}else{focus_to_element_after_modal_dialog_hide = 'login_pass';show_help('login_failed');document.getElementById("login_pass").value='';document.getElementById("login_pass").focus();}}}function delete_user_all_cb(data){if(data[0]){show_processing_bar(0);alert(data[1]);}else{x_d9(d9_cb);}}function delete_user_reg_cb(data){if(data[0]){show_processing_bar(0);alert(data[1]);}else{x_eb(eb_cb);}}function d9_cb(html){document.getElementById("admin_content_div").innerHTML = html;show_processing_bar(0);}function gg_cb(data){if(data[0]){show_processing_bar(0);alert(data[1]);}else{x_d9(d9_cb);}}function kr_cb(data){if(data[0]){show_processing_bar(0);alert(data[1]);}else{x_eb(eb_cb);}}function eb_cb(html){document.getElementById("admin_content_div").innerHTML = html;show_processing_bar(0);}function bi_cb(data){if(data[0]){show_processing_bar(0);alert(data[1]);}else{show_processing_bar(0);window.location = window.location;}}function f_cb(data){if(data[0]){show_processing_bar(0);alert(data[1]);}else{x_iw(1,iw_cb)}}function iw_cb(html){document.getElementById("goods_status_preview").innerHTML = html;show_processing_bar(0);}function render_compare_and_rollout_cb(data){document.getElementById(data[0]).innerHTML = data[1];if(!side_tab_compare_rolled){side_tab_compare_rolled = 1;show_hide_side_tab(2,1);}}function chat_action_and_rollout_cb(data){document.getElementById(data[0]).innerHTML = data[1];if(!side_tab_chat_rolled){side_tab_chat_rolled = 1;show_hide_side_tab(3,1);}window.setTimeout("document.getElementById('chat_msg').focus();",10);window.setTimeout("document.getElementById('chat_msg').focus();",100);}function f5_cb(data){if(polling_cycle_shutdown){return;}if(data[0]){x_z('reload',data[0],chat_action_and_rollout_cb);}if(data[1]){x_z('reload',data[1],chat_action_and_rollout_cb);}js_debug();polling_cycle_timeout = window.setTimeout('x_f5(f5_cb);',polling_cycle_interval);}function chat_end_cb(data){side_tab_chat_rolled = 0;x_is(standard_innerhtml_cb);}function p_cb(data){standard_innerhtml_cb(data);if(data[6]){show_basket_panel();window.setTimeout('animate_basket_button(4);',500);}}function animate_basket_button(step){if(step > 0){if(step % 2 == 1){document.getElementById('basket_open_button').setAttribute("class", "basket_button");document.getElementById('basket_open_button').setAttribute("className", "basket_button");}else{document.getElementById('basket_open_button').setAttribute("class", "basket_button_hover");document.getElementById('basket_open_button').setAttribute("className", "basket_button_hover");}window.setTimeout('animate_basket_button('+(step-1)+');',500);}}function bj_cb(data){var id = data[0];var kind = data[1];if(!available_pics){return false;}available_pics--;if(current_pic > available_pics){current_pic = available_pics;}if(available_pics==0){if(kind==0){document.getElementById('file_upload_form2').style.display='none';}picture_upload_hint = 0;}if(available_pics==1){document.getElementById('pic_arrows').style.display='none';document.getElementById('pic_counter').innerHTML = '';}if(available_pics>0){browse_goods_pictures(id,kind,0);}else{document.getElementById('goods_picture').src='./picture.php?id='+id+'&kind='+kind+'&mode=add&res=1&skin=naviservice&refresh='+Math.floor(100000*Math.random());}}function kq_cb(result){show_dropdown_menu(0,0);}function add_to_catalog_or_remove_cb(result){if(result==1){}else if(result==2){x_g2(0,0,g2_cb);}else if(result==0){alert('Error while adding or removing item to/from catalog');}}function k3_cb(result){if(result=='updated_OK'){document.getElementById('save_auction_avg_bar').style.display='none';alert('auction updated, need to reload averages info');}else{alert(result);}}function fc_cb(data){var d = explode(';',data);var v;clear_user_auction_inputs();for(var i=0;i<d.length;i++){if(d[i]!=''){v = explode(':',d[i]);if(document.getElementById("catalog_x"+v[0])){document.getElementById("catalog_x"+v[0]).value=v[1];}}}}function i4_cb(html){document.getElementById('user_auction_avg_table').innerHTML = html;document.getElementById('refresh_auction_avg_bar').style.display='none';}function jt_cb(data){if(data=='saved_ok'){document.getElementById('save_settings_bar').style.display='none';}else{if(data==undefined){document.getElementById('button_save_container').innerHTML = '<span class="general_errors">Error while saving settings.</span>';}else{document.getElementById('button_save_container').innerHTML = '<span class="general_errors">'+data+'</span>';}}}function g2_cb(data){document.getElementById(data[0]).innerHTML = data[1];new Sortables(document.getElementById("catalog_picks_sort_list"),{onComplete:sortables_order_changed});}function store_special_request_cb(data){alert(data[0]);alert(data[1]);}function bh_cb(result){if(result==0){}else{document.getElementById('comment_id'+result).style.display='none';}}function jc_cb(result){if(result==0){}else{document.getElementById('comment_id'+result+'_report').setAttribute("class", "icon_reported_big");document.getElementById('comment_id'+result+'_report').setAttribute("className", "icon_reported_big");document.getElementById('comment_id'+result+'_report').onclick = false;document.getElementById('comment_id'+result+'_report').title = 'ten komentarz został raportowany do moderatora';}}function j6_cb(result){if(result[0]==0){$('#interval'+result[1]+' .saving_intervals_bar').replaceWith('');$('#interval'+result[1]+' .button2').css('display','block');}}function gr_cb(data){var result = data[0];var int_id = data[1];if(result==0){$('#interval'+int_id).fadeOut();}else{alert('Nie je možné odstrániť túto definíciu pretože niektoré položky ju používajú');}}function h_cb(data){$('#interval').replaceWith(data);}function save_pictures_order_cb(result){if(result[0]==1){$('#dialog_frame').fadeOut();$('#modality_mask').fadeOut();$('#goods_picture').attr('src',result[1]);}else{alert('error while setting the new order');}}function store_menu_state_to_session_cb(return_string){}function v_cb(html){document.getElementById("basket_checkout").innerHTML = html;}function store_newsletter_email_cb(data){document.getElementById('newsletter_send_loader').style.display='none';if(data[0]){document.getElementById('newsletter_email_err').innerHTML = data[1];}else{document.getElementById('newsletter_email_ok').innerHTML = data[1];}}function karta(il){this.ilosc = il;this.rozwinieta = true;}function display(id, wartosc){if(!document.getElementById(id)){if(wartosc){return false;}else{return '';}}if(wartosc){if(document.getElementById){document.getElementById(id).style.display = wartosc;}else if(document.all){document.all[id].style.display = wartosc;}}else{var wart;if(document.getElementById){wart = document.getElementById(id).style.display;}else if(document.all){wart = document.all[id].style.display;}return wart;}}var id_rozwin_zwin = 0;function rozwin_zwin(id, nr){if(!nr){var nr = 0;/* $ parameter = 'SMART_HIDING';if($ GLOBALS['menu_options'][$ parameter])echo "if(!karty[id].rozwinieta){var i;for(i=".$ GLOBALS['menu_options'][$ parameter]."; i<karty.length; i++){if(i!=id){ukryj(i);}}}";*/}if(nr<karty[id].ilosc){if(karty[id].rozwinieta){if(nr<karty[id].ilosc){display("nr" + id + "_" + nr, "none");}}else{if(nr<karty[id].ilosc){display("nr" + id + "_" + nr, "block");}}}nr++;clearTimeout(id_rozwin_zwin);if(nr<karty[id].ilosc-1){id_rozwin_zwin = setTimeout('rozwin_zwin(' + id + ',' + nr + ')', 10);}else{karty[id].rozwinieta = (karty[id].rozwinieta ? false : true);}}function submenu_show_hide(divname,divnum){if(submenu_stati[divnum]){document.getElementById(divname).style.display='none';submenu_stati[divnum] = 0;}else{document.getElementById(divname).style.display='block';submenu_stati[divnum] = 1;}alert('warning: submenu undefined but fires an event');store_menu_state_to_session();}function menu_show_hide(id){if(karty_state[id]==1){karty_state[id]=0;}else{karty_state[id]=1;}store_menu_state_to_session();if(karty[id].rozwinieta){document.getElementById('menu_arrow'+id).setAttribute("class", "menu_arrow0");document.getElementById('menu_arrow'+id).setAttribute("className", "menu_arrow0");}else{document.getElementById('menu_arrow'+id).setAttribute("class", "menu_arrow1");document.getElementById('menu_arrow'+id).setAttribute("className", "menu_arrow1");}rozwin_zwin(id);}function get_menu_status(){var output = '';for(i=0; i<karty_state.length; i++){if(i>0){output += ',';}if(karty_state[i]){output += '1';}else{output += '0';}}return output;}function select_tab(i,first,last,middle){if(active_tab==i){return;}var active_tab_1 = active_tab + 1;document.getElementById("tab"+active_tab+"m").setAttribute("class", "am");document.getElementById("tab"+active_tab+"m").setAttribute("className", "am");if(active_tab==0){document.getElementById("tab"+active_tab+"l").setAttribute("class", "al");document.getElementById("tab"+active_tab+"l").setAttribute("className", "al");}else{document.getElementById("tab"+active_tab+"lr").setAttribute("class", "aa");document.getElementById("tab"+active_tab+"lr").setAttribute("className", "aa");}if(active_tab==tabs_count-1){document.getElementById("tab"+active_tab+"r").setAttribute("class", "ar");document.getElementById("tab"+active_tab+"r").setAttribute("className", "ar");}else{document.getElementById("tab"+active_tab_1+"lr").setAttribute("class", "aa");document.getElementById("tab"+active_tab_1+"lr").setAttribute("className", "aa");}actives[active_tab]=0;active_tab = i;actives[active_tab]=1;document.getElementById("tab"+active_tab+"m").setAttribute("class", "cm");document.getElementById("tab"+active_tab+"m").setAttribute("className", "cm");active_tab_1 = active_tab + 1;if(active_tab==0){document.getElementById("tab"+active_tab+"l").setAttribute("class", "cl");document.getElementById("tab"+active_tab+"l").setAttribute("className", "cl");}else{document.getElementById("tab"+active_tab+"lr").setAttribute("class", "ac");document.getElementById("tab"+active_tab+"lr").setAttribute("className", "ac");}if(active_tab==tabs_count-1){document.getElementById("tab"+active_tab+"r").setAttribute("class", "cr");document.getElementById("tab"+active_tab+"r").setAttribute("className", "cr");}else{document.getElementById("tab"+active_tab_1+"lr").setAttribute("class", "ca");document.getElementById("tab"+active_tab_1+"lr").setAttribute("className", "ca");}x_e8(tabview_name,i,e8_cb);}function activate_tab(i,first,last,middle){var i_1 = i + 1;if(actives[i]==1){}else{document.getElementById("tab"+i+"m").setAttribute("class", "bm");document.getElementById("tab"+i+"m").setAttribute("className", "bm");if(first){document.getElementById("tab"+i+"l").setAttribute("class", "bl");document.getElementById("tab"+i+"l").setAttribute("className", "bl");}if(last){document.getElementById("tab"+i+"r").setAttribute("class", "br");document.getElementById("tab"+i+"r").setAttribute("className", "br");if(actives[i-1]==1){document.getElementById("tab"+i+"lr").setAttribute("class", "cb");document.getElementById("tab"+i+"lr").setAttribute("className", "cb");}else{document.getElementById("tab"+i+"lr").setAttribute("class", "ab");document.getElementById("tab"+i+"lr").setAttribute("className", "ab");}}else{if(actives[i+1]==1){document.getElementById("tab"+i_1+"lr").setAttribute("class", "bc");document.getElementById("tab"+i_1+"lr").setAttribute("className", "bc");}else{document.getElementById("tab"+i_1+"lr").setAttribute("class", "ba");document.getElementById("tab"+i_1+"lr").setAttribute("className", "ba");}}if(middle){if(actives[i-1]==1){document.getElementById("tab"+i+"lr").setAttribute("class", "cb");document.getElementById("tab"+i+"lr").setAttribute("className", "cb");}else{document.getElementById("tab"+i+"lr").setAttribute("class", "ab");document.getElementById("tab"+i+"lr").setAttribute("className", "ab");}}}}function deactivate_tab(i,first,last,middle){if(active_tab==i){return;}var i_1 = i + 1;document.getElementById("tab"+i+"m").setAttribute("class", "am");document.getElementById("tab"+i+"m").setAttribute("className", "am");if(first){document.getElementById("tab"+i+"l").setAttribute("class", "al");document.getElementById("tab"+i+"l").setAttribute("className", "al");}if(last){document.getElementById("tab"+i+"r").setAttribute("class", "ar");document.getElementById("tab"+i+"r").setAttribute("className", "ar");if(actives[i-1]==1){document.getElementById("tab"+i+"lr").setAttribute("class", "ca");document.getElementById("tab"+i+"lr").setAttribute("className", "ca");}else{document.getElementById("tab"+i+"lr").setAttribute("class", "aa");document.getElementById("tab"+i+"lr").setAttribute("className", "aa");}}else{if(actives[i+1]==1){document.getElementById("tab"+i_1+"lr").setAttribute("class", "ac");document.getElementById("tab"+i_1+"lr").setAttribute("className", "ac");}else{document.getElementById("tab"+i_1+"lr").setAttribute("class", "aa");document.getElementById("tab"+i_1+"lr").setAttribute("className", "aa");}}if(middle){if(actives[i-1]==1){document.getElementById("tab"+i+"lr").setAttribute("class", "ca");document.getElementById("tab"+i+"lr").setAttribute("className", "ca");}else{document.getElementById("tab"+i+"lr").setAttribute("class", "aa");document.getElementById("tab"+i+"lr").setAttribute("className", "aa");}}}
