var js_options = {"social_share":{"facebook_share_box":{"image":"\"\"","code":"'); this.load_box('#iframe_layer', 100, true); // BOF MOD by PT $('#menubox_gm_scroller').css({ display: 'none' }); if($(document).height() > $('#product_images_box').height()) { var pt_height = $(document).height(); } else { var pt_height = $('#product_images_box').height()+ 200; } $('#__dimScreen').css({height: pt_height + 'px'}); // EOF MOD by PT } this.load_box = function(box_id, fade_background_speed, fade_in, mb_height) { // scroll to top: scroll(0,0); if(fb)console.log('load_box: ' + box_id); if(typeof v == 'undefined') var fade_background_speed = 100; if(typeof fade_in == 'undefined') var fade_in = true; current_box_id = box_id; if(navigator.appVersion.match(/MSIE [0-6]\./)) { this.ie6_fix(true); } if(box_id == '#iframe_layer') { $(current_box_id).css( { zIndex: '1002', display: 'none' }); $.dimScreenIFrame(fade_background_speed, 0.7, function() { if(fb)console.log('dim done:' + current_box_id); if(fade_in) $(current_box_id).fadeIn(); else $(current_box_id).show(); }, mb_height); } else { $(current_box_id).css( { zIndex: '1000', display: 'none' }); $.dimScreen(fade_background_speed, 0.7, function() { if(fb)console.log('dim done:' + current_box_id); if(fade_in) $(current_box_id).fadeIn(); else $(current_box_id).show(); }, mb_height); } } this.close_iframe_box = function() { var t_close = true; if(typeof(gm_style_edit_mode_running) == 'boolean' && gm_style_edit_mode_running == true) { t_close = confirm('Klicken Sie auf Abbrechen, wenn Sie diesen Link nicht aufrufen, sondern bearbeiten möchten.'); } if(t_close) { if(typeof(gmLightBox) != 'undefined') { $('#iframe_box_bar').remove(); $('#iframe_box').remove(); this.close_box('#iframe_box'); } } return false; } this.close_box = function(p_box_id) { if(fb)console.log(current_box_id + ': close_box()'); // BOF MOD by PT $('#menubox_gm_scroller').css({ display: 'block' }); // EOF MOD by PT if(typeof(p_box_id) == 'undefined' || p_box_id != '#iframe_box') { $.dimScreenStop(); } else { $.dimScreenStopIFrame(); } $(current_box_id).fadeOut("normal", function(){ if(navigator.appVersion.match(/MSIE [0-6]\./)) { $('.lightbox_visibility_hidden').css( { visibility: 'visible' }); coo_this.ie6_fix(false); } }); current_box_id = ''; } this.centered_left = function(element_width) { var x = (screen.width / 2) - (element_width / 2); if(fb)console.log('centered width:' + x); return Math.round(x); } this.centered_top = function(element_height) { var y = (screen.height / 2) - (element_height / 2); if(fb)console.log('centered height:' + y); return Math.round(y); } this.ie6_fix = function(p_hide) { if(p_hide) { $('select').each(function() { if($(this).css('visibility') != 'hidden' && $(this).css('display') != 'none') { t_ie6_elements_array.push(this); $(this).css( { visibility: 'hidden' }); } }); } else { for(var i = 0; i < t_ie6_elements_array.length; i++) { $(t_ie6_elements_array[i]).css( { visibility: 'visible' }); } } } this.test = function() { $('.wrap_shop').append('
'); $('#test_box').css( { position: 'absolute', left: this.centered_left(500) + 'px', top: '150px', width: '500px', height: '0px', background: 'white' }); this.load_box('#test_box'); } } /**/ /* GMScroller.js.php */ /**/ function GMScroller(){ var x = null; var counter = 0; var scroller_stop = 0; var content_height = 0; this.scroll = function(){ if(content_height == 0){ document.getElementById('gm_scroller').style.display = "block"; document.getElementById('gm_scroller').style.padding = "170px 0px 170px 0px"; content_height = Number(document.getElementById("gm_scroller").offsetHeight); } clearTimeout(x); x = window.setTimeout("gmScroller.scroll()", Number("50")); if(scroller_stop == 1) return; document.getElementById('menubox_gm_scroller_body').scrollTop = counter; counter++; if(counter == content_height - Number("170")){ counter = 0; } } this.start = function() { x = window.setTimeout("gmScroller.scroll()", Number("50")); } this.set_stop = function(stop_val) { scroller_stop = stop_val; } } var gmScroller = new GMScroller(); $(document).ready(function() { if(fb)console.log("menubox_gm_scroller ready"); if($("#menubox_gm_scroller").attr('id') == 'menubox_gm_scroller'){ gmScroller.start(); } $('#menubox_gm_scroller_body').hover( function() { gmScroller.set_stop(1); }, function() { gmScroller.set_stop(0); } ); }); /**/ /* gm_shopping_cart.js */ /**/ var gm_qty_changed = false; function gm_qty_is_changed(old_qty, new_qty, gm_message) { if(new_qty != old_qty) { $("#gm_checkout").attr('href', "javascript:alert('" + gm_message + "')"); } return; } /**/ /* ActionSubmitHandler.js */ /**/ function ActionSubmitHandler() { if(fb)console.log('ActionSubmitHandler ready'); this.init_binds = function() { if(fb)console.log('ActionSubmitHandler init_binds'); $('.action_submit').die('click'); $('.action_submit').live('click', function() { if(fb)console.log('.action_submit click'); if($(this).closest('form').length > 0) { if($(this).hasClass('replace_form_action')) { if(fb)console.log('replace_form_action found!'); // submit button needs own action url var t_new_action_url = $(this).attr('href'); if($(this).closest('form').length > 0) { $(this).closest('form').attr('action', t_new_action_url); } } // TODO: better solution for executing onsubmit functions // and regarding return value -> stop submit in false-case if(typeof($(this).closest('form').attr('onsubmit')) == 'string') { if(fb)console.log('found onsubmit in form-tag!'); var t_onsubmit = $(this).closest('form').attr('onsubmit').replace('return ', ''); var t_onsubmit_return = eval(t_onsubmit); if(fb)console.log('onsubmit evaluated'); if(t_onsubmit_return == false) { if(fb)console.log('onsubmit returns: false'); return false; } else if(t_onsubmit_return == true) { if(fb)console.log('onsubmit returns: true'); } } // submit form $(this).closest('form').submit(); } else { if(fb)console.log('no form found!'); } return false; }); } this.init_binds(); } /**//* ButtonCurrencyChangeHandler.js */ /**/ function ButtonCurrencyChangeHandler() { if(fb)console.log('ButtonCurrencyChangeHandler ready'); this.init_binds = function() { if(fb)console.log('ButtonCurrencyChangeHandler init_binds'); $('.currencies_selection').die('change'); $('.currencies_selection').live('change', function() { if(fb)console.log('.currencies_selection change'); if($(this).closest('form').length > 0) { $(this).closest('form').submit(); } return false; }); } this.init_binds(); } /**/ /* ButtonOpenSearchHandler.js */ /**/ function ButtonOpenSearchHandler() { if(fb)console.log('ButtonOpenSearchHandler ready'); this.init_binds = function() { if(fb)console.log('ButtonOpenSearchHandler init_binds'); $('.button_opensearch').die('click'); $('.button_opensearch').live('click', function() { if(fb)console.log('.button_opensearch click'); /* add open search plugin */ add_opensearch_plugin(); return false; }); } function add_opensearch_plugin() { if(navigator.appVersion.match(/MSIE [7-8]\./) != null || navigator.userAgent.match(/Firefox/i) || navigator.userAgent.match(/Chrome/i)) { var t_opensearch_link = 'https://ctj24.de/export/opensearch_2.xml'; window.external.AddSearchProvider(t_opensearch_link); } else { alert('Die Schnell-Suche ist derzeit nur im Internet Explorer 7 und im Mozilla Firefox verfügbar.'); } } this.init_binds(); } /**/ /* CartControl.js */ /**/ function CartControl() { if(fb)console.log('CartControl ready'); this.submit_buy_now_form = function(p_form) { var coo_this = this; // handle for callback functions var t_form_data = $(p_form).serialize(); if(fb)console.log('t_form_data: '+ t_form_data); var t_url = 'request_port.php?module=buy_now&XTCsid=' + gm_session_id; $.ajax({ url: t_url, type: 'POST', dataType: 'json', data: t_form_data, success: function(p_result_json) { if(fb)console.log('show_details: ' + p_result_json.show_details); /* 0-0 dropdown 0-1 cart 1-0 details 1-1 details */ // dont redirect. use cart dropdown. if(p_result_json.show_details == false && p_result_json.show_cart == false) { // update cart dropdown coo_this.load_dropdown_content(); } // redirect to cart if(p_result_json.show_details == false && p_result_json.show_cart == true) { //TODO: add session-id document.location.href = 'https://ctj24.de/shopping_cart.php'; } // redirect to product details if(p_result_json.show_details == true) { document.location.href = p_result_json.products_details_url; } } }); } this.load_dropdown_content = function() { var coo_this = this; // handle for callback functions var t_url = ''; var t_close_timeout = false; $( document ).bind( "cart_shipping_costs_info_active", function() { if( t_close_timeout != false ) { clearTimeout( t_close_timeout ); t_close_timeout = false; } }); if(coo_this.need_fixed_cart() == true) { t_url = 'request_port.php?module=cart_dropdown&part=fixed&XTCsid=' + gm_session_id; $.ajax({ type: 'GET', url: t_url, success: function(p_result) { var t_dropdown_html = p_result; // remove old dropdown $('#fixed_dropdown_shopping_cart').remove(); // set loaded dropdown $('.wrap_shop').prepend(t_dropdown_html); // set position coo_this.position_fixed_dropdown(); // show dropdown coo_this.open_fixed_dropdown(); // start timeout for closing the dropdown setTimeout('coo_cart_control.close_fixed_dropdown()', 5000); } }); } // update dropdown content t_url = 'request_port.php?module=cart_dropdown&part=header&XTCsid=' + gm_session_id; $.ajax({ type: 'GET', url: t_url, success: function(p_result) { var t_header_html = p_result; $('#head_shopping_cart').remove(); $('#head_toolbox_inner').prepend(t_header_html); if(coo_this.need_fixed_cart() == false) { // fixed cart not needed, so need to activate dropdown $('#head_shopping_cart').addClass('active'); } } }); // update dropdown content t_url = 'request_port.php?module=cart_dropdown&part=dropdown&XTCsid=' + gm_session_id; $.ajax({ type: 'GET', url: t_url, success: function(p_result) { var t_dropdown_html = p_result; // remove old dropdown $('#dropdown_shopping_cart').remove(); // set loaded dropdown $('.wrap_shop').prepend(t_dropdown_html); // set position coo_this.position_dropdown(); if(coo_this.need_fixed_cart() == false) { // fixed cart not needed, so need to activate dropdown // show dropdown coo_this.open_dropdown(); // start timeout for closing the dropdown t_close_timeout = setTimeout('coo_cart_control.close_dropdown()', 5000); } } }); } this.need_fixed_cart = function() { var t_cart_header = $('#head_shopping_cart'); var t_dropdown_offset_top = $('#container').attr('offsetTop') + $(t_cart_header).attr('offsetTop') + $(t_cart_header).height(); var scrOfY = 0; if( typeof( window.pageYOffset ) == 'number' ) { //Netscape compliant scrOfY = window.pageYOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { //DOM compliant scrOfY = document.body.scrollTop; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { //IE6 standards compliant mode scrOfY = document.documentElement.scrollTop; } if(fb)console.log('offset ' + t_dropdown_offset_top); if(fb)console.log('scrollTop ' + scrOfY); // use fixed position, if dropdown not in viewport if(t_dropdown_offset_top < scrOfY) { if(fb)console.log('use fixed cart dropdown'); return true; } else { if(fb)console.log('use attached cart dropdown'); return false; } } this.open_fixed_dropdown = function() { if(fb)console.log('open_fixed_dropdown'); var t_cart_dropdown = $('#fixed_dropdown_shopping_cart'); $(t_cart_dropdown).slideDown('slow'); } // dont bind closing events, if styleedit is running if(typeof gm_style_edit_mode_running == 'undefined') { this.close_fixed_dropdown = function() { if(fb)console.log('close_fixed_dropdown'); var t_cart_dropdown = $('#fixed_dropdown_shopping_cart'); $(t_cart_dropdown).slideUp(); } } this.position_fixed_dropdown = function() { var t_cart_header = $('#head_shopping_cart'); var t_cart_dropdown = $('#fixed_dropdown_shopping_cart'); // set top relative to dropdown header $(t_cart_dropdown).css('left', $(t_cart_header).offset().left); if(typeof($('body').css('padding-top')) != 'undefined' && $('body').css('padding-top').search('px') != -1) { $(t_cart_dropdown).css('top', '-' + $('body').css('padding-top')); } } this.open_dropdown = function() { if(fb)console.log('open_dropdown'); var t_cart_header = $('#head_shopping_cart'); var t_cart_dropdown = $('#dropdown_shopping_cart'); $(t_cart_header).addClass('active'); $(t_cart_dropdown).slideDown('slow'); } // dont bind closing events, if styleedit is running if(typeof gm_style_edit_mode_running == 'undefined') { this.close_dropdown = function() { if(fb)console.log('close_dropdown'); var t_cart_header = $('#head_shopping_cart'); var t_cart_dropdown = $('#dropdown_shopping_cart'); $(t_cart_header).removeClass('active'); $(t_cart_dropdown).slideUp(); } } this.position_dropdown = function() { var t_cart_header = $('#head_shopping_cart'); var t_cart_dropdown = $('#dropdown_shopping_cart'); var t_top = Number($(t_cart_header).offset().top) + Number($(t_cart_header).height()) + Number($(t_cart_header).css('padding-top').replace('px', '')) + Number($(t_cart_header).css('padding-bottom').replace('px', '')); // set top relative to dropdown header $(t_cart_dropdown).css('left', $(t_cart_header).offset().left).css('top', t_top + 'px'); } } /**//* CartDropdownHandler.js */ /**/ function CartDropdownHandler() { if(fb)console.log('CartDropdownHandler ready'); this.init_binds = function() { if(fb)console.log('CartDropdownHandler init_binds'); //var coo_this = this; t_close_timeout = false; $('#head_shopping_cart').die('click'); $('#head_shopping_cart').live('click', function() { if(fb)console.log('#head_shopping_cart click'); if($(this).hasClass('active') == false) { coo_cart_control.position_dropdown(); coo_cart_control.open_dropdown(); t_close_timeout = setTimeout(coo_cart_control.close_dropdown, 10000); } else { coo_cart_control.close_dropdown() } return true; }); $( document ).bind( "cart_shipping_costs_info_active", function() { if( t_close_timeout != false ) { clearTimeout( t_close_timeout ); t_close_timeout = false; } }); } this.init_binds(); } /**/ /* InputEnterKeyHandler.js */ /**/ function InputEnterKeyHandler() { if(fb)console.log('InputEnterKeyHandler ready'); var v_last_key = 0; var v_last_key_down = 0; var v_ctrl_v = false; var v_last_char_count = 0; var v_arrow_key_pressed = false; var v_keydown = false; this.init_binds = function() { if(fb)console.log('InputEnterKeyHandler init_binds'); $('input').live('keyup', function(event) { var t_keycode = (event.keyCode ? event.keyCode : (event.which ? event.which : event.charCode)); if($(this).closest('form').find('.action_submit').length > 0) { // track enter key if(t_keycode == 13 && ((Math.abs($(this).val().length - v_last_char_count) <= 1 || v_ctrl_v == true) || v_last_key == 0)) // 13 keycode for enter key { // abort submit because input-field browser-suggestion was confirmed and no form submit was executed if(v_arrow_key_pressed || v_keydown == false) { return false; } if(typeof($(this).closest('form').attr('onsubmit')) == 'string') { if(fb)console.log('found onsubmit in form-tag!'); var t_onsubmit = $(this).closest('form').attr('onsubmit').replace('return ', ''); var t_onsubmit_return = eval(t_onsubmit); if(fb)console.log('onsubmit evaluated'); if(t_onsubmit_return == false) { if(fb)console.log('onsubmit returns: false'); return false; } else if(t_onsubmit_return == true) { if(fb)console.log('onsubmit returns: true'); } } $(this).closest('form').submit(); return false; } else if(t_keycode == 13) { v_keydown = false; v_arrow_key_pressed = false; } v_last_key = t_keycode; v_last_char_count = $(this).val().length; } else { if(fb)console.log('no ".action_submit" button found'); } return true; }); $('input').live('keydown', function(event) { var t_keycode = (event.keyCode ? event.keyCode : (event.which ? event.which : event.charCode)); if(t_keycode != 13) { v_ctrl_v = false; } if(v_last_key_down == 17) // key: CTRL { if(t_keycode == 86) // key: v { v_ctrl_v = true; } } if(v_last_key == 37 || v_last_key == 38 || v_last_key == 39 || v_last_key == 40) // 37-40 keycode for arrow-keys { v_arrow_key_pressed = true; } v_last_key_down = t_keycode; v_keydown = true; }); } this.init_binds(); } /**/ /* PullDownLinkHandler.js */ /**/ function PullDownLinkHandler() { if(fb)console.log('PullDownLinkHandler ready'); var coo_clicked_ids = Object(); var coo_clicked_elements = Object(); var coo_this = this; var t_allow_close_all = true; this.init_binds = function() { if(fb)console.log('PullDownLinkHandler init_binds'); $('.pulldown_link').die('click'); $('.pulldown_link').live('click', function() { if(fb)console.log('.pulldown_link click'); coo_this.start(this); return false; }); } this.start = function(p_element) { var t_container = $(p_element).attr('rel'); // open menu if($(t_container).css('display') == 'none'){ // hide opened dropdowns belonging to the div-container where the clicked link is placed in if($(p_element).closest('div[id]').attr('id').length > 0) { $('#' + $(p_element).closest('div[id]').attr('id') + ' a').each(function() { if($(this).attr('rel').length > 0) { if(typeof(coo_clicked_ids[$(this).attr('rel')]) == 'number') { clearTimeout(coo_clicked_ids[$(this).attr('rel')]); } $($(this).attr('rel')).slideUp(); } }); } var t_top = Number($(p_element).offset().top) + Number($(p_element).height()) + Number($(p_element).css('padding-top').replace('px', '')) + Number($(p_element).css('padding-bottom').replace('px', '')); $(t_container).css('left', $(p_element).offset().left).css('top', t_top + 'px').slideDown(); if($(p_element).hasClass('pulldown_link_no_auto_close') == false && typeof(gm_style_edit_mode_running) == 'undefined') { coo_clicked_ids[t_container] = setTimeout("$('" + t_container + "').slideUp()", 3000); } } // close menu else { if(typeof(coo_clicked_ids[t_container]) == 'number') { clearTimeout(coo_clicked_ids[t_container]); } $(t_container).slideUp(); } // stop menu sliding up by clicking into it $(t_container).die('click'); $(t_container).live('click', function() { t_allow_close_all = false; coo_clicked_elements[t_container] = true; if(typeof(coo_clicked_ids[t_container]) == 'number') { clearTimeout(coo_clicked_ids[t_container]); } }); // stop menu sliding up on mouseenter $(t_container).die('mouseenter'); $(t_container).live('mouseenter', function() { if(fb)console.log(t_container + ': mouseenter'); t_allow_close_all = false; if(typeof(coo_clicked_ids[t_container]) == 'number') { clearTimeout(coo_clicked_ids[t_container]); } }); // start timeout for sliding up menu $(t_container).die('mouseleave'); $(t_container).live('mouseleave', function() { if(fb)console.log(t_container + ': mouseleave'); t_allow_close_all = true; if(typeof(coo_clicked_ids[t_container]) == 'number' && typeof(coo_clicked_elements[t_container]) == 'undefined') { clearTimeout(coo_clicked_ids[t_container]); coo_clicked_ids[t_container] = setTimeout("$('" + t_container + "').slideUp()", 3000); } }); $('.wrap_shop').die('click', coo_this.close_all); $('.wrap_shop').live('click', coo_this.close_all); } this.close_all = function() { if(fb)console.log('PullDownLinkHandler close_all allowed: ' + t_allow_close_all); var t_element = ''; for(t_element in coo_clicked_ids) { clearTimeout(coo_clicked_ids[t_element]); if($(t_element).length > 0 && t_allow_close_all == true) { $(t_element).slideUp(); } } // reset if(t_allow_close_all == true) { coo_clicked_ids = Object(); coo_clicked_elements = Object(); $('.wrap_shop').die('click', this.close_all); } } this.init_binds(); } /**/ /* ResetFormHandler.js */ /**/ function ResetFormHandler() { if(fb)console.log('ResetFormHandler ready'); this.init_binds = function() { if(fb)console.log('ResetFormHandler init_binds'); $('.button_reset_form').die('click'); $('.button_reset_form').live('click', function() { if(fb)console.log('.button_reset_form click'); if($(this).closest('form').length > 0) { // reset form $(this).closest('form').find(':input').each(function() { switch(this.type) { case 'password': case 'select-multiple': case 'select-one': case 'text': case 'textarea': $(this).val(''); break; case 'checkbox': case 'radio': this.checked = false; } }); // TODO: better solution for executing onsubmit functions // and regarding return value -> stop submit in false-case if(typeof($(this).closest('form').attr('onsubmit')) == 'string') { if(fb)console.log('found onsubmit in form-tag!'); var t_onsubmit = $(this).closest('form').attr('onsubmit').replace('return ', ''); var t_onsubmit_return = eval(t_onsubmit); if(fb)console.log('onsubmit evaluated'); if(t_onsubmit_return == false) { if(fb)console.log('onsubmit returns: false'); return false; } else if(t_onsubmit_return == true) { if(fb)console.log('onsubmit returns: true'); } } // submit form $(this).closest('form').submit(); } else { if(fb)console.log('no form found!'); } return false; }); } this.init_binds(); } /**//* */ /**/ (function($){ $.fn.slider_plugin = function(){ var slider_id = $("#jcarousel_slider_id").val(); var li_width = parseInt(js_options.slider_plugin[slider_id].width); var ul_children_length = 0; var big_image_nr; var prev_image_nr; var count_steps; var active_animation = false; var timeout; ul_children_length = $("#jcarousel_image_box ul").children("li").length; $("#jcarousel_image_box ul").width((ul_children_length)*li_width); $("#jcarousel_image_box").scrollLeft((ul_children_length/2)*li_width); $("#slideImg_1").addClass("jcarousel_control_a_active"); if($(".jcarousel-control a").length > 1){ var control_pos = js_options.slider_plugin[slider_id].control_position.split("_"); switch(control_pos[0]){ case "top": $(".jcarousel-control").css("top", js_options.slider_plugin[slider_id].control_margin).css("bottom", ""); break; default: $(".jcarousel-control").css("top", "").css("bottom", js_options.slider_plugin[slider_id].control_margin); break; } switch(control_pos[1]){ case "left": $(".jcarousel-control").css("right", "").css("left", js_options.slider_plugin[slider_id].control_margin); break; case "center": $(".jcarousel-control").css("right", js_options.slider_plugin[slider_id].control_margin).css("left", js_options.slider_plugin[slider_id].control_margin); $(".jcarousel-control").css("text-align", "center"); break; default: $(".jcarousel-control").css("right", js_options.slider_plugin[slider_id].control_margin).css("left", ""); break; } $(".jcarousel-control a").css("visibility", "visible"); } if(ul_children_length > 2 && js_options.global.style_edit_mode != "edit"){ timeout = setTimeout(function(){ update_view(1); }, js_options.slider_plugin[slider_id].slider_speed); } if(js_options.global.style_edit_mode != "edit"){ $(this).bind("mouseover", function(){ if(js_options.slider_plugin[slider_id].stop_on_mouseover == true){ clearTimeout(timeout); } }); $(this).bind("mousemove", function(){ if(js_options.slider_plugin[slider_id].stop_on_mouseover == true){ clearTimeout(timeout); } }); $(this).bind("mouseleave", function(){ if(active_animation == false && js_options.slider_plugin[slider_id].stop_on_mouseover == true && ul_children_length > 2){ timeout = setTimeout( function(){ if($("#slider_flyover_container").length == 0){ update_view(1); } }, js_options.slider_plugin[slider_id].slider_speed); } }); $("#jcarousel_box .jcarousel-control a").click(function(){ var actual_children = $("#jcarousel_image_box ul").children("li"); var tmp_big_image_nr = $(actual_children[ul_children_length/2]).find("img").attr("id").split("_"); big_image_nr = parseInt(tmp_big_image_nr[1]); var tmp_prev_image_nr = $(this).attr("id").split('_'); prev_image_nr = parseInt(tmp_prev_image_nr[1]); if(active_animation == false && big_image_nr != prev_image_nr) { clearTimeout(timeout); if(prev_image_nr > big_image_nr){ count_steps = prev_image_nr - big_image_nr; }else{ count_steps = prev_image_nr - big_image_nr; } update_view(count_steps); } return false; }); } function update_view(steps){ active_animation = true; var tmp_steps = 0; if(steps > 0){ tmp_steps = steps; }else{ tmp_steps = steps*(-1); } $("#slider_flyover_container").hide(); $("#jcarousel_image_box").animate({ scrollLeft: li_width*(ul_children_length/2+steps) },{ duration: js_options.slider_plugin[slider_id].animation_speed/tmp_steps, easing: 'linear', complete: function(){ var actual_children = []; for(var i = 0; i < tmp_steps; i++){ if(steps > 0){ $("#jcarousel_image_box ul").append($("#jcarousel_image_box ul").find("li:first-child").detach()); $("#jcarousel_image_box").scrollLeft($("#jcarousel_image_box").scrollLeft()-li_width); }else{ $("#jcarousel_image_box ul").prepend($("#jcarousel_image_box ul").find("li:last-child").detach()); $("#jcarousel_image_box").scrollLeft($("#jcarousel_image_box").scrollLeft()+li_width); } } actual_children = $("#jcarousel_image_box ul").children("li"); $("#jcarousel_box .jcarousel-control a").removeClass("jcarousel_control_a_active"); var tmp_big_image_nr = $(actual_children[ul_children_length/2]).find("img").attr("id").split("_"); big_image_nr = parseInt(tmp_big_image_nr[1]); $("#slideImg_"+big_image_nr).addClass("jcarousel_control_a_active"); active_animation = false; timeout = setTimeout(function(){ update_view(1); }, js_options.slider_plugin[slider_id].slider_speed); } }); } }; })(jQuery); (function($){ $.fn.slider_flyover_content = function(){ var flyover_timeout; var mouse_pos_x; var mouse_pos_y; var actual_area_id; var request; $.each(this, function(){ var self = this; $(self).bind("mouseenter", function(){ clearTimeout(flyover_timeout); if($("#slider_flyover_container").length == 0){ var slider_flyover_container = $("
").attr("id", "slider_flyover_container"); $("body").append(slider_flyover_container); } $(self).unbind("mousemove"); $(self).bind("mousemove", function(e){ mouse_pos_x = e.pageX; mouse_pos_y = e.pageY; }); var id = $(self).attr("id").split("_"); actual_area_id = id[1]; if(actual_area_id != $("#slider_flyover_container").attr("class")){ if(request){ request.abort(); } request = $.ajax({ type: "POST", url: "request_port.php?module=Slider", async: true, data: {"action": "get_flyover_content", "slider_image_area_id": actual_area_id}, success: function(response){ var id = $(self).attr("id").split("_"); if(id[1] == actual_area_id && $.trim(response) != "" && $.trim(response.replace(/
/g, "")) != ""){ $("#slider_flyover_container").addClass(actual_area_id); $("#slider_flyover_container").html(response); $("#slider_flyover_container").css("left", mouse_pos_x); $("#slider_flyover_container").css("top", mouse_pos_y); if((mouse_pos_x-$(document).scrollLeft() + $("#slider_flyover_container").width()+30) >= $(window).width()){ $("#slider_flyover_container").css("left", mouse_pos_x-$("#slider_flyover_container").width()-20); } if((mouse_pos_y-$(document).scrollTop() + $("#slider_flyover_container").height()+30) >= $(window).height()){ $("#slider_flyover_container").css("top", mouse_pos_y-$("#slider_flyover_container").height()-20); } $("#slider_flyover_container").show(); } } }); } }); $(self).bind("mouseleave", function(){ actual_area_id = 0; flyover_timeout = setTimeout(remove_container, 50); }); $("#slider_flyover_container").live("mouseenter", function(){ var id = $(self).attr("id").split("_"); actual_area_id = id[1]; clearTimeout(flyover_timeout); }); $("#slider_flyover_container").live("mouseleave", function(){ actual_area_id = 0; flyover_timeout = setTimeout(remove_container, 50); }); function remove_container(){ if(actual_area_id == 0){ if(request){ request.abort(); } $("#slider_flyover_container").remove(); } } }); }; })(jQuery); $(document).ready(function() { if($("#jcarousel_box").length == 1){ $("#jcarousel_box").slider_plugin(); $("#jcarousel_box area").slider_flyover_content(); } }); /**/ /* TopNavigationHandler.js */ /**/ function TopNavigationHandler() { if(fb)console.log('TopNavigationHandler ready'); this.init_binds = function() { if(fb)console.log('TopNavigationHandler init_binds'); var t_background_color_hover = 'transparent'; $('#top_navi_inner ul li a').die('hover'); $('#top_navi_inner ul li a').live('hover', function() { if($(this).css('background-color') != 'transparent') { t_background_color_hover = $(this).css('background-color'); } }); $('#top_navi_inner ul li').die('mouseleave'); $('#top_navi_inner ul li').live('mouseleave', function() { $('#top_navi_inner ul li a').removeAttr('style'); }); $('#top_navi_inner ul li div').die('mouseenter'); $('#top_navi_inner ul li div').live('mouseenter', function() { if(t_background_color_hover != '') { $(this).next('a').css('background-color', t_background_color_hover); } }); $('#top_navi_inner ul li div').die('click'); $('#top_navi_inner ul li div').live('click', function() { if(typeof($(this).next('a').attr('rel')) == 'undefined' || $(this).next('a').attr('rel').length == 0) { document.location.href = $(this).next('a').attr('href'); return false; } else { // open pull down menu $(this).next('a').trigger('click'); } }); } this.init_binds(); } /**//* */ /**/ (function($){ $.fn.social_share_plugin = function(){ var self = $(this); var v_location = $(location).attr('href').replace(/[&]*XTCsid(=|\/)[a-zA-Z0-9,-]+/g, ''); v_location = v_location.replace(/\?&/g, '?'); v_location = v_location.replace(/\?$/g, ''); var v_location_encoded = encodeURIComponent(v_location); var v_product_image = encodeURIComponent(js_options.global.shop_root + $("#product_info .info_image_box img").attr('src')); var v_product_text = js_options.global.shop_name + ' - ' + $.trim($("#product_info .info h1").html() + ' '); $.each(self, function(){ $(this).bind("click", function(){ update_view(this); }); return this; }); function update_view(p_element){ var t_image = ""; var t_code = ""; if($(p_element).parent().hasClass("switch_on")){ $(p_element).parent().removeClass("switch_on"); t_image = 'js_options.social_share.'+$(p_element).parent().attr('id')+'.image'; $(p_element).parent().find(".social_share_content").html(eval(t_image)); }else{ $(p_element).parent().addClass("switch_on"); t_code = 'js_options.social_share.'+$(p_element).parent().attr('id')+'.code'; t_code = eval(t_code); t_code = t_code.replace('#text#', v_product_text); t_code = t_code.replace('#product_image#', v_product_image); t_code = t_code.replace('#location#', v_location); t_code = t_code.replace('#location_encoded#', v_location_encoded); $(p_element).parent().find(".social_share_content").html(t_code); } } }; })(jQuery); $(document).ready(function() { if($(".social_share_image").length > 0){ $(".social_share_image").social_share_plugin(); } }); /**//* InputDefaultValueHandler.js */ /**/ function InputDefaultValueHandler() { if(fb)console.log('InputDefaultValueHandler ready'); var t_input_array = new Array(); var coo_this = this; this.init_binds = function() { if(fb)console.log('InputDefaultValueHandler init_binds'); var t_search_field_value = ''; $('.default_value').die('click'); $('.default_value').live('click', function() { if(fb)console.log('.default_value click'); var t_check = coo_this.in_array(t_input_array, this); var t_key = t_check; if(typeof(t_check) == 'boolean' && t_check == false) { t_key = t_input_array.length; t_input_array[t_key] = new Object(); t_input_array[t_key]['ELEMENT'] = this; t_input_array[t_key]['VALUE'] = $(this).val(); } if($(this).val() != '') { t_search_field_value = $(this).val(); } if(t_search_field_value == t_input_array[t_key]['VALUE']) { $(this).val(''); } }); $('.default_value').die('blur'); $('.default_value').live('blur', function() { if(fb)console.log('.default_value blur'); if($(this).val().replace(/\s+/, '') == '') { var t_key = coo_this.in_array(t_input_array, this); $(this).val(t_input_array[t_key]['VALUE']); } }); } this.in_array = function(p_array, p_needle) { var t_found = false; if(typeof(p_array) == 'object') { for(var i = 0; i < p_array.length; i++) { if(p_array[i]['ELEMENT'] == p_needle) { t_found = i; } } } return t_found; } this.init_binds(); } /**/ /* LiveSearchHandler.js */ /**/ function LiveSearchHandler() { if(fb)console.log('LiveSearchHandler ready'); var coo_this = this; var t_ie6_elements_array = Array(); this.init_binds = function() { if(fb)console.log('LiveSearchHandler init_binds'); if($('#search_field').length > 0) { $('.wrap_shop').prepend(''); var t_offset_top = Number($('#search_field').offset().top); var t_height = 0; if(typeof($('#search_field').css('height')) != 'undefined') { t_height = Number($('#search_field').css('height').replace('px', '')); } var t_border_top_width = 0; if(typeof($('#search_field').css('border-top-width')) != 'undefined') { t_border_top_width = Number($('#search_field').css('border-top-width').replace('px', '')); } var t_padding_top = 0; if(typeof($('#search_field').css('padding-top')) != 'undefined') { t_padding_top = Number($('#search_field').css('padding-top').replace('px', '')); } var t_padding_bottom = 0; if(typeof($('#search_field').css('padding-bottom')) != 'undefined') { t_padding_bottom = Number($('#search_field').css('padding-bottom').replace('px', '')); } var t_top = t_offset_top + t_height + t_border_top_width + t_padding_top + t_padding_bottom; $('#live_search_container').css( { left: $('#search_field').offset().left, top: t_top + 'px' }); $('#live_search_container').css('border-color', $('#search_field').css('border-left-color')); $('#live_search_container').css('border-style', $('#search_field').css('border-left-style')); $('#live_search_container').css('border-width', $('#search_field').css('border-left-width')); $('#live_search_container').css('padding-left', $('#search_field').css('padding-left')); $('#live_search_container').css('padding-right', $('#search_field').css('padding-right')); // IE-Fix: $('#live_search_container ul li').live('click', function() { window.location.href = $(this).find('a').attr('href'); return false; }); $('#search_field').live('keyup', function(event) { if(fb)console.log('search_field keyup'); var t_needle = encodeURIComponent( $('#search_field').attr('value') ); if(t_needle.length > 2) { jQuery.ajax( { data: '', url: 'request_port.php?module=live_search&needle=' + t_needle + '&XTCsid=' + gm_session_id, type: "POST", async: true, success: function(t_search_result_html) { if(t_search_result_html != '') { coo_this.show_result(t_search_result_html); } else { coo_this.hide_result(); } } }).html; } else { coo_this.hide_result(); } }); $('.wrap_shop').die('click', coo_this.hide_result); $('.wrap_shop').live('click', coo_this.hide_result); } } this.hide_result = function() { $('#live_search_container').html(''); $('#live_search_container').hide(); if(navigator.appVersion.match(/MSIE [0-6]\./)) { coo_this.ie6_fix(false); } } this.show_result = function(p_html_content) { if(navigator.appVersion.match(/MSIE [0-6]\./)) { coo_this.ie6_fix(true); } $('#live_search_container').html(p_html_content); $('#live_search_container').show(); } this.ie6_fix = function(p_hide) { if(p_hide) { $('select').each(function() { if($(this).css('visibility') != 'hidden' && $(this).css('display') != 'none') { t_ie6_elements_array.push(this); $(this).css( { visibility: 'hidden' }); } }); } else { for(var i = 0; i < t_ie6_elements_array.length; i++) { $(t_ie6_elements_array[i]).css( { visibility: 'visible' }); } } } this.init_binds(); } /**/ /* SubmenuHandler.js */ /**/ function SubmenuHandler(p_delay_open, p_delay_close) { if(fb)console.log('SubmenuHandler ready'); this.v_delay_open = 250; // unit: ms if(typeof(p_delay_open) != 'undefined') { this.v_delay_open = this.clear_number(p_delay_open); } this.v_delay_close = 500; // unit: ms if(typeof(p_delay_close) != 'undefined') { this.v_delay_close = this.clear_number(p_delay_close); } this.v_parent_ids_array = Array(); this.v_z_index = 500; var coo_this = this; var v_visible_menu_ids_array = Array(); var v_timeout_open = 0; var v_timeout_close = 0; var v_active_element = ''; var v_inactive_submenus_shown = false; var v_allow_close_all = true; this.init_binds = function() { if(fb)console.log('SubmenuHandler init_binds'); this.ie6_fix(); this.v_parent_ids_array = this.push_id(0, this.v_parent_ids_array); this.find_loaded_submenus(); $('.wrap_shop').die('click', coo_this.close_all); $('.wrap_shop').live('click', function(){coo_this.close_all(true)}); $('.submenu li img').die('click', coo_this.open_link); $('.submenu li img').live('click', coo_this.open_link); $('.submenu li').die('mouseenter'); $('.submenu li').live('mouseenter', function() { if(fb)console.log('.submenu li mouseenter'); // clear title obscuring the menu $(this).find('a').attr('title', ''); v_allow_close_all = false; clearTimeout(v_timeout_close); v_active_element = $(this).attr('id'); var t_coo_this = this; if(v_inactive_submenus_shown == true) { v_timeout_open = setTimeout(function(){coo_this.open_menu(t_coo_this)}, coo_this.v_delay_open); } // ignore open_delay if there are no submenus that could be left accidentally else { if(fb)console.log('SubmenuHandler open_delay ignored') coo_this.open_menu(t_coo_this); } }); $('.submenu li').die('mouseleave'); $('.submenu li').live('mouseleave', function() { if(fb)console.log('.submenu li mouseleave'); clearTimeout(v_timeout_open); v_active_element = ''; }); $('.submenu').die('mouseleave'); $('.submenu').live('mouseleave', function() { if(fb)console.log('.submenu mouseleave'); v_allow_close_all = true; if(typeof(gm_style_edit_mode_running) == 'undefined') { v_timeout_close = setTimeout(coo_this.close_all, coo_this.v_delay_close); } }); } this.open_menu = function(p_coo_this) { if(typeof($(p_coo_this).closest('.submenu').attr('id')) != 'undefined') { var t_parents_id = 0; if($(p_coo_this).closest('.submenu').attr('id').search('submenu_box_id_') != -1) { t_parents_id = $(p_coo_this).closest('.submenu').attr('id').replace('submenu_box_id_', ''); } if(fb)console.log('.submenu li: parents_id ' + t_parents_id); if(t_parents_id == 0) { $('.content-box.categories.submenu ul li a.active').removeClass('active'); } else { $('#submenu_box_id_' + t_parents_id + ' ul li a.active').removeClass('active'); } $(p_coo_this).find('a').addClass('active'); var t_categories_id = 0; if($(p_coo_this).attr('id').search('menu_cat_id_') != -1) { t_categories_id = $(p_coo_this).attr('id').replace('menu_cat_id_', ''); } if(fb)console.log('.submenu li: categories_id ' + t_categories_id); coo_this.get_submenus_by_categories_id(t_parents_id, t_categories_id); } } this.get_submenus_by_categories_id = function(p_parents_id, p_categories_id) { c_parents_id = this.clear_number(p_parents_id); c_categories_id = this.clear_number(p_categories_id); var t_already_loaded = this.in_array(c_parents_id, this.v_parent_ids_array); if(t_already_loaded == false) { jQuery.ajax( { data: 'module=submenus&id=' + c_parents_id + '&XTCsid=' + gm_session_id, url: 'request_port.php', type: "GET", async: true, success: function(t_submenus_html) { t_already_loaded = coo_this.in_array(c_parents_id, coo_this.v_parent_ids_array); if(t_already_loaded == false) { $('.wrap_shop:first').prepend(t_submenus_html); coo_this.ie6_fix(); coo_this.v_parent_ids_array = coo_this.push_id(c_parents_id, coo_this.v_parent_ids_array); } coo_this.load_submenu(c_categories_id); } }).html; } else { coo_this.load_submenu(c_categories_id); } } this.load_submenu = function(p_categories_id) { if(typeof(p_categories_id) == 'undefined' || p_categories_id == 0 || isNaN(p_categories_id)) { return false; } this.v_z_index++; var t_top = $('#menu_cat_id_' + p_categories_id).offset().top; var t_left = $('#menu_cat_id_' + p_categories_id).offset().left + document.getElementById('menu_cat_id_' + p_categories_id).offsetWidth; var t_border_top_width = 0; if(typeof($('.submenu[id^="submenu_box_id_"]:first').find('div:first').css('border-top-width')) != 'undefined') { if(isNaN($('.submenu[id^="submenu_box_id_"]:first').find('div:first').css('border-top-width').replace('px', ''))) { t_border_top_width = 0; } else { t_border_top_width = Number($('.submenu[id^="submenu_box_id_"]:first').find('div:first').css('border-top-width').replace('px', '')); } } t_top -= t_border_top_width; var t_padding_top = 0; if(typeof($('.submenu[id^="submenu_box_id_"]:first').find('div:first').css('padding-top')) != 'undefined') { if(isNaN($('.submenu[id^="submenu_box_id_"]:first').find('div:first').css('padding-top').replace('px', ''))) { t_padding_top = 0; } else { t_padding_top = Number($('.submenu[id^="submenu_box_id_"]:first').find('div:first').css('padding-top').replace('px', '')); } } t_top -= t_padding_top; var t_padding_left = 0; if(typeof($('#menu_cat_id_' + p_categories_id).closest('div').css('padding-top')) != 'undefined') { t_padding_left = Number($('#menu_cat_id_' + p_categories_id).closest('div').css('padding-left').replace('px', '')); } var t_padding_right = 0; if(typeof($('#menu_cat_id_' + p_categories_id).closest('div').css('padding-bottom')) != 'undefined') { t_padding_right = Number($('#menu_cat_id_' + p_categories_id).closest('div').css('padding-right').replace('px', '')); } t_left += t_padding_left + t_padding_right - 2; if(this.is_submenu(p_categories_id) == false) { t_left += 7; } $('#submenu_box_id_' + p_categories_id).closest('.submenu_container').css( { 'z-index': this.v_z_index, top: t_top, left: t_left }); this.reset_visible_menu_ids(); this.set_visible_menu_ids(p_categories_id); for(var i = 0; i < v_visible_menu_ids_array.length; i++) { if(fb)console.log(v_visible_menu_ids_array[i]); } this.show_submenu(p_categories_id); } this.show_submenu = function(p_categories_id) { var c_categories_id = this.clear_number(p_categories_id); $('#submenu_box_id_' + c_categories_id).closest('.submenu_container').show(); v_visible_menu_ids_array = this.push_id('submenu_box_id_' + c_categories_id, v_visible_menu_ids_array); // hide menus not belonging to the last opened menu $('.submenu').each(function() { if($(this).attr('id') != '' && coo_this.in_array($(this).attr('id'), v_visible_menu_ids_array) == false) { $(this).closest('.submenu_container').hide(); // reset styles $(this).find('ul li a.active').removeClass('active'); } }); // remove highlight-class (active) from submenus of current hovered menu entry v_inactive_submenus_shown = false; var current_z_index = 0; if(typeof($('#menu_cat_id_' + c_categories_id).closest('.submenu_container').css('z-index')) != 'undefined' && $('#menu_cat_id_' + c_categories_id).closest('.submenu_container').css('z-index') != 'auto') { current_z_index = Number($('#menu_cat_id_' + c_categories_id).closest('.submenu_container').css('z-index')); } for(var i = 0; i < v_visible_menu_ids_array.length; i++) { if(current_z_index < ($('#' + v_visible_menu_ids_array[i]).closest('.submenu_container').css('z-index'))) { $('#' + v_visible_menu_ids_array[i] + ' ul li a.active').removeClass('active'); v_inactive_submenus_shown = true; } } } this.set_visible_menu_ids = function(p_categories_id) { var c_categories_id = this.clear_number(p_categories_id); if($('#menu_cat_id_' + c_categories_id).closest('.submenu').attr('id') != '') { var t_submenu_box_id = $('#menu_cat_id_' + c_categories_id).closest('.submenu').attr('id'); if(typeof(t_submenu_box_id) != 'undefined') { v_visible_menu_ids_array = this.push_id(t_submenu_box_id, v_visible_menu_ids_array); t_categories_id = t_submenu_box_id.replace('submenu_box_id_', ''); if(t_categories_id != '0') { this.set_visible_menu_ids(t_categories_id); } } } } this.reset_visible_menu_ids = function() { v_visible_menu_ids_array = Array(); } this.in_array = function(p_needle, p_haystack_array) { var t_found = false; for(var i = 0; i < p_haystack_array.length; i++) { if(p_haystack_array[i] == p_needle) { t_found = true; break; } } return t_found; } this.push_id = function(p_id, p_array) { if(this.in_array(p_id, p_array) == false) { p_array.push(p_id); } return p_array; } this.clear_number = function(p_number) { c_number = 0; if(typeof(p_number) != 'undefined' || isNaN(p_number) == false) { c_number = Number(p_number); } return c_number; } this.close_all = function(p_close_by_click) { if(fb)console.log('SubmenuHandler close_all'); if(typeof(p_close_by_click) == 'undefined') { p_close_by_click = false; } if(p_close_by_click == true) { if(v_allow_close_all == true) { clearTimeout(v_timeout_close); $('.submenu[id^="submenu_box_id_"]').closest('.submenu_container').hide(); $('.submenu ul li a.active').removeClass('active'); $('.wrap_shop').die('click', this); } } else { clearTimeout(v_timeout_close); $('.submenu[id^="submenu_box_id_"]').closest('.submenu_container').hide(); $('.submenu ul li a.active').removeClass('active'); } } this.is_submenu = function(p_parent_id) { var t_is_submenu = false; var c_parent_id = 0; if(isNaN(p_parent_id)) { c_parent_id = p_parent_id.replace(/[^\d]+/g, ''); if(isNaN(c_parent_id)) { if(fb)console.log('SubmenuHandler is_submenu(): wrong parameter "' + p_parent_id + '"'); return false; } } else { c_parent_id = p_parent_id; } // check if it is a submenu if(typeof($('#menu_cat_id_' + c_parent_id).closest('.submenu')) == 'object' && $('#menu_cat_id_' + c_parent_id).closest('.submenu').attr('id').search('submenu_box_id_') != -1) { t_is_submenu = true; } return t_is_submenu; } this.find_loaded_submenus = function() { var submenu_box_id = ''; var parent_id = ''; $('div[id^="submenu_box_id_"]').each(function() { submenu_box_id = $(this).attr('id').replace('submenu_box_id_', ''); if($('#menu_cat_id_' + submenu_box_id).length > 0) { parent_id = $('#menu_cat_id_' + submenu_box_id).closest('.submenu').attr('id').replace('submenu_box_id_', ''); coo_this.v_parent_ids_array = coo_this.push_id(parent_id, coo_this.v_parent_ids_array); } }); } this.open_link = function() { if(fb)console.log('.submenu li img click, open link: ' + $(this).closest('li').find('a:first').attr('href')); location.href = $(this).closest('li').find('a:first').attr('href'); return true; } // IE6 needs fixed width for outer div-block '.submenu_container' calculated by inner div-blocks paddings // ('.submenu', '.submenu div:first') and width of '.submenu ul li' (only set in IE6) this.ie6_fix = function() { if(navigator.appVersion.match(/MSIE [0-6]\./)) { var t_paddings = 0; if(typeof($('.submenu_container .submenu').css('padding-left')) != 'undefined' && $('.submenu_container .submenu').css('padding-left').search('px') != -1) { t_paddings += Number($('.submenu_container .submenu').css('padding-left').replace('px', '')); } if(typeof($('.submenu_container .submenu').css('padding-right')) != 'undefined' && $('.submenu_container .submenu').css('padding-right').search('px') != -1) { t_paddings += Number($('.submenu_container .submenu').css('padding-right').replace('px', '')); } if(typeof($('.submenu_container .submenu div:first').css('padding-left')) != 'undefined' && $('.submenu_container .submenu div:first').css('padding-left').search('px') != -1) { t_paddings += Number($('.submenu_container .submenu div:first').css('padding-left').replace('px', '')); } if(typeof($('.submenu_container .submenu div:first').css('padding-right')) != 'undefined' && $('.submenu_container .submenu div:first').css('padding-right').search('px') != -1) { t_paddings += Number($('.submenu_container .submenu div:first').css('padding-right').replace('px', '')); } if(typeof($('.submenu_container .submenu ul li').css('width')) != 'undefined' && $('.submenu_container .submenu ul li').css('width').search('px') != -1) { var t_width = Number($('.submenu_container .submenu ul li').css('width').replace('px', '')); t_width += t_paddings; $('.submenu_container').css('width', t_width + 'px'); } } } this.init_binds(); } /**/ /* GMAskOpensearch.js */ /**/ function GMAskOpensearch() { $(document).ready( function() { if(typeof gm_style_edit_mode_running == 'undefined') { gmOpenSearch.bind_flyover(); } } ); this.bind_flyover = function() { $('.gm_opensearch_info').mouseover(function(event) { if(fb)console.log('gm_opensearch_info mouseover'); $('#flyover_layer').remove(); $('.wrap_shop').append('
'); $('#flyover_layer').css({ zIndex: "100", position: "absolute", left: event.pageX + 5, top: event.pageY + 5 }); $('#flyover_layer').load('gm_opensearch.php'); }); $('.gm_opensearch_info').mouseout(function(event) { if(fb)console.log('gm_opensearch mouseout'); $('#flyover_layer').remove(); }); $('.gm_opensearch_info').mousemove(function(event) { $('#flyover_layer').css({ zIndex: "100", position: "absolute", left: event.pageX + 5, top: event.pageY + 5 }); }); } } /**/ /* GMMegaFlyOver.js */ /**/ function GMMegaFlyOver(p_slideshow) { var coo_this = this; var t_timeout = 0; var t_interval = 0; var t_slideshow = p_slideshow; var coo_event = new Object(); var t_mouse_over_element_id = ''; var t_request_timeout = 0; var t_max_image_check_loops = 100; var t_image_check_loops = 0; this.bind_styleedit_mode = function() { $('#flyover_layer').remove(); $('.wrap_shop').append('
'); $('#flyover_layer').css({ zIndex: "100", position: "absolute", display: "none" }); $('#flyover_layer').load('request_port.php?module=mega_flyover&mf_products_id=0&XTCsid='+gm_session_id); $('.flyover_item').mouseover(function(event) { if(fb)console.log('flyover_item mouseover (SE mode)'); $('#flyover_layer').css({ left: event.pageX + 5, top: event.pageY + 5, display: "block" }); }); $('.flyover_item').mousemove(function(event) { $('#flyover_layer').css({ left: event.pageX + 5, top: event.pageY + 5 }); }); } this.bind_flyover = function() { $('.flyover_item').die('mousemove'); $('.flyover_item').live('mousemove', function(event) { coo_event = event; coo_this.position_flyover(event); }); $('.flyover_item').die('mouseover'); $('.flyover_item').live('mouseover', function(event) { if(fb)console.log('flyover_item mouseover'); var t_this_element = this; if(typeof($(this).find('img').attr('alt')) != 'undefined') { $(this).find('img').attr('alt', ''); } if(typeof($(this).find('img').attr('title')) != 'undefined') { $(this).find('img').attr('title', ''); } $('#flyover_layer').remove(); $('.wrap_shop').append('
'); $('#flyover_layer').css({ zIndex: "100", position: "absolute", left: event.pageX + 5, top: event.pageY + 5 }); $('#flyover_layer').hide(); var products_id = $(this).attr('id'); products_id = products_id.split('_'); products_id = products_id.pop(); if(fb)console.log('products_id: ' + products_id); t_mouse_over_element_id = products_id; $(this).unbind('mouseout'); $(this).mouseout(function(event) { if(fb)console.log('flyover_item mouseout: ' + products_id); t_mouse_over_element_id = ''; clearTimeout(t_request_timeout); clearInterval(t_interval); }); clearTimeout(t_request_timeout); t_request_timeout = setTimeout(function(){coo_this.start_request(t_mouse_over_element_id);}, 100); }); } this.start_request = function(p_mouse_over_element_id) { if(p_mouse_over_element_id != '' && p_mouse_over_element_id == t_mouse_over_element_id) { jQuery.ajax({data: '', url: 'request_port.php?module=mega_flyover&mf_products_id=' + Number(p_mouse_over_element_id) + '&XTCsid=' + gm_session_id, type: "POST", async: true, success: function(t_flyover_html) { if(p_mouse_over_element_id == t_mouse_over_element_id) { $('#flyover_layer').html(t_flyover_html); if(t_slideshow == true) { clearInterval(t_interval); t_interval = setInterval(coo_this.image_check, 50); } else { $('#flyover .flyover_image').eq(0).show(); } $('#flyover_layer').show(); coo_this.position_flyover(coo_event); $('.flyover_item').unbind('mouseout'); $('.flyover_item').mouseout(function(event) { if(fb)console.log('flyover_item mouseout: ' + p_mouse_over_element_id); if(typeof gm_style_edit_mode_running == 'undefined') { clearTimeout(t_timeout); clearInterval(t_interval); // IE6-workaround: hide before removing to avoid shadow deposit on screen $('#flyover_layer').hide(); $('#flyover_layer').remove(); } }); } else { if(fb)console.log('mouseout before ajax-request success'); } } }).html; } } this.image_check = function() { var t_image_loaded = true; t_image_check_loops++; for(i = 0; i < document.images.length; ++i) { if(document.images[i].complete != true) { t_image_loaded = false; } } if(t_image_loaded || t_image_check_loops > t_max_image_check_loops || navigator.userAgent.search(/Opera/) != -1) // Opera has problems to check image complete status -> ignore check { clearInterval(t_interval); t_image_check_loops = 0; coo_this.start_slideshow(0); } else { if(fb)console.log('loading images... loop: ' + t_image_check_loops); } return t_image_loaded; } this.position_flyover = function(event) { if($('#flyover_layer').length > 0) { var t_page_x = event.pageX + 5; var t_page_y = event.pageY + 5; if($(document).width() < (event.pageX - $(document).scrollLeft() + Number($('#flyover_layer').css('width').replace('px', '')) + 20)) { t_page_x = (event.pageX - $(document).scrollLeft() - (Number($('#flyover_layer').css('width').replace('px', '')) + 20)); } if((Number($('#flyover_layer').css('height').replace('px', '')) + 20) + event.pageY > $(window).height() + $(document).scrollTop()) { t_page_y = event.pageY - (Number($('#flyover_layer').css('height').replace('px', '')) + 20); } $('#flyover_layer').css( { left: t_page_x, top: t_page_y }); } } this.start_slideshow = function(p_image_number) { if($('#flyover .flyover_image').length > 1) { var t_image_number = Number(p_image_number); if(t_image_number >= $('#flyover .flyover_image').length) { t_image_number = 0; } $('#flyover .flyover_image').hide(); if(fb)console.log('show flyover_image ' + t_image_number); $('#flyover .flyover_image').eq(t_image_number).show(); t_image_number++; clearTimeout(t_timeout); t_timeout = setTimeout(function(){coo_this.start_slideshow(t_image_number);}, 1000); } else { $('#flyover .flyover_image').eq(0).show(); } } if(typeof(gm_style_edit_mode_running) == 'undefined') { this.bind_flyover(); } else { this.bind_styleedit_mode(); } } /**/ /* gm_statusbar.js.php */ /**/ t_php_helper = ''; var gm_statusbar_text = "RAM-Mount Onlineschop von CTJ 24 e.K."; var gm_statusbar_speed = Number("120"); var gm_statusbar_width = Number("100"); var gm_statusbar_length = gm_statusbar_text.length; var gm_statusbar_position = 1 - gm_statusbar_width; function gm_statusbar() { gm_statusbar_position++; var gm_statusbar_text_state=""; if (gm_statusbar_position == gm_statusbar_length){ gm_statusbar_position = 1 - gm_statusbar_width; } if (gm_statusbar_position < 0){ for (var gm_statusbar_counter = 1; gm_statusbar_counter <= Math.abs(gm_statusbar_position); gm_statusbar_counter++){ gm_statusbar_text_state = gm_statusbar_text_state + " "; }; gm_statusbar_text_state = gm_statusbar_text_state + gm_statusbar_text.substring(0, gm_statusbar_width - gm_statusbar_counter + 1); } else{ gm_statusbar_text_state = gm_statusbar_text_state + gm_statusbar_text.substring(gm_statusbar_position, gm_statusbar_width + gm_statusbar_position); } window.status = gm_statusbar_text_state; setTimeout("gm_statusbar()", gm_statusbar_speed); } t_php_helper = ''; /**/ /* CartShippingCostsTooltip.js */ $(document).ready(function() { $(".cart_shipping_costs_info_icon").live( "click", function() { var t_info_text = $( ".cart_shipping_costs_info_text" ); if( $( t_info_text ).is( ":visible" ) ) { $( t_info_text ).css( "display", "none" ); } else { $( t_info_text ).css( "display", "block" ); $( document ).trigger( 'cart_shipping_costs_info_active' ); } }); }); /* GMOrderQuantityChecker.js */ /**/ function GMOrderQuantityChecker(){ this.check = function(){ var products_id = $('#gm_products_id').val(); var qty = $('#gm_attr_calc_qty').val(); var html = jQuery.ajax({ data: 'id=' + products_id + '&qty=' + qty, url: 'gm_ajax.php?module=order_quantity_checker', type: "GET", async: false}).responseText; html = html.replace(/^\s+|\s+$/g,""); $('#gm_checker_error_' + products_id).html('
' + html + '
'); if(html == '') { if(typeof(coo_combi_status_check) != 'undefined' && coo_combi_status_check.last_result_json != false) { if(coo_combi_status_check.last_result_json['STATUS_CODE'] < 1) { alert(coo_combi_status_check.last_result_json['STATUS_TEXT']); return false; } } return true; } else return false; } this.check_listing = function(products_id){ var qty = 1; if($('#gm_attr_calc_qty_' + products_id).length > 0) { qty = $('#gm_attr_calc_qty_' + products_id).val(); } else if($('#gm_add_to_cart_' + products_id + ' input[name="products_qty"]').length > 0) { qty = $('#gm_add_to_cart_' + products_id + ' input[name="products_qty"]').val(); } var html = jQuery.ajax({ data: 'id=' + products_id + '&qty=' + qty, url: 'gm_ajax.php?module=order_quantity_checker', type: "GET", async: false}).responseText; html = html.replace(/^\s+|\s+$/g,""); $('#gm_checker_error_' + products_id).html(html); if(html == '') return true; else return false; } this.check_cart = function(){ var products_id = ''; var qty = ''; var inputs = []; var html = ''; var j = 0; var t_success = true; $('.gm_cart_data').each(function(){ inputs.push(escape(this.value)); } ); for(i = 0; i < inputs.length; i = i+2){ qty = inputs[i]; products_id = inputs[i+1]; products_id_copy = products_id; products_id_copy = products_id_copy.replace(/{/g, "_"); products_id_copy = products_id_copy.replace(/}/g, "_"); products_id_copy = products_id_copy.replace(/{/g, "_"); products_id_copy = products_id_copy.replace(/}/g, "_"); if($('#gm_delete_product_' + products_id_copy).attr('checked') != true) { j = products_id.indexOf('{'); if(j == -1) j = products_id.indexOf('%'); if(j != -1) products_id = products_id.slice(0, j); html = jQuery.ajax({ data: 'id=' + products_id + '&qty=' + qty, url: 'gm_ajax.php?module=order_quantity_checker', type: "GET", async: false}).responseText; html = html.replace(/^\s+|\s+$/g,""); $('#gm_checker_error_' + products_id_copy).html(html); if(html == '') { var t_sep_found = products_id.search(/x/); if(typeof(coo_combi_status_check) != 'undefined' && t_sep_found != -1) { // extended pid found. check combis_id! coo_combi_status_check.get_combi_status_by_ext_products_id(products_id, qty); if(coo_combi_status_check.last_result_json != false) { if(coo_combi_status_check.last_result_json['STATUS_CODE'] < 1) { $('#gm_checker_error_' + products_id_copy).html(coo_combi_status_check.last_result_json['STATUS_TEXT']); t_success = false; } } } } else { t_success = false; } } } return t_success; } this.check_wishlist = function(){ var products_id = ''; var qty = ''; var inputs = []; var html = ''; var j = 0; var t_success = true; $('.gm_cart_data').each(function(){ inputs.push(escape(this.value)); } ); for(i = 0; i < inputs.length; i = i+2){ qty = inputs[i]; products_id = inputs[i+1]; products_id_copy = products_id; products_id_copy = products_id_copy.replace(/{/g, "_"); products_id_copy = products_id_copy.replace(/}/g, "_"); products_id_copy = products_id_copy.replace(/{/g, "_"); products_id_copy = products_id_copy.replace(/}/g, "_"); j = products_id.indexOf('{'); if(j == -1) j = products_id.indexOf('%'); if(j != -1) products_id = products_id.slice(0, j); html = jQuery.ajax({ data: 'id=' + products_id + '&qty=' + qty, url: 'gm_ajax.php?module=order_quantity_checker', type: "GET", async: false}).responseText; html = html.replace(/^\s+|\s+$/g,""); $('#gm_checker_error_' + products_id_copy).html(html); if(html != '') t_success = false; } return t_success; } } /**/ /* ActionAddToCartHandler.js */ /**/ function ActionAddToCartHandler() { if(fb)console.log('ActionAddToCartHandler ready'); this.init_binds = function() { if(fb)console.log('ActionAddToCartHandler init_binds'); $('.action_add_to_cart').die('click'); $('.action_add_to_cart').live('click', function() { if(fb)console.log('.action_add_to_cart click'); if($(this).closest('form').length > 0) { var t_quantity_success = true; if($(this).closest('form').find('.gm_products_id:first').length > 0) { var t_products_id = $(this).closest('form').find('.gm_products_id:first').val(); if(typeof(GMOrderQuantityChecker) == 'function') { var coo_quantity_checker = new GMOrderQuantityChecker(); t_quantity_success = coo_quantity_checker.check_listing(t_products_id); } } if(t_quantity_success) { var t_operation_form = $(this).closest('form'); coo_cart_control.submit_buy_now_form(t_operation_form); } } return false; }); $('.action_add_to_cart').closest('form').submit(function() { var t_quantity_success = true; if($(this).find('.gm_products_id:first').length > 0) { var t_products_id = $(this).find('.gm_products_id:first').val(); if(typeof(GMOrderQuantityChecker) == 'function') { var coo_quantity_checker = new GMOrderQuantityChecker(); t_quantity_success = coo_quantity_checker.check_listing(t_products_id); } } if(t_quantity_success) { coo_cart_control.submit_buy_now_form(this); } return false; }); } this.init_binds(); } /**//* ButtonManufacturerChangeHandler.js */ /**/ function ButtonManufacturerChangeHandler() { if(fb)console.log('ButtonManufacturerChangeHandler ready'); this.init_binds = function() { if(fb)console.log('ButtonManufacturerChangeHandler init_binds'); $('#product_listing .manufactuers_selection').die('change'); $('#product_listing .manufactuers_selection').live('change', function() { if(fb)console.log('#product_listing .manufactuers_selection change'); if($(this).closest('form').length > 0) { $(this).closest('form').submit(); } return false; }); } this.init_binds(); } /**/ /* ButtonSortingChangeHandler.js */ /**/ function ButtonSortingChangeHandler() { if(fb)console.log('ButtonSortingChangeHandler ready'); this.init_binds = function() { if(fb)console.log('ButtonSortingChangeHandler init_binds'); $('#product_listing .panel select').die('change'); $('#product_listing .panel select').live('change', function() { if(fb)console.log('#product_listing .panel select change'); if($(this).closest('form').length > 0) { $(this).closest('form').submit(); } return false; }); } this.init_binds(); } /**/ /* AttributesCalculatorHandler.js */ /**/ function AttributesCalculatorHandler() { if(fb)console.log('AttributesCalculatorHandler ready'); this.init_binds = function() { if(fb)console.log('AttributesCalculatorHandler init_binds'); $('#product_listing input[name="products_qty"]').die('keyup'); $('#product_listing input[name="products_qty"]').live('keyup', function() { if(fb)console.log('#product_listing input[name="products_qty"] keyup'); if($(this).closest('form').attr('id').search('gm_add_to_cart_') != -1) { var t_id = '0'; t_id =$(this).closest('form').attr('id').replace('gm_add_to_cart_', ''); gm_calc_prices_listing(t_id, true); } return false; }); $('#product_listing .gm_listing_form').die('click'); $('#product_listing .gm_listing_form').live('click', function() { if(fb)console.log('#product_listing .gm_listing_form click'); if($(this).closest('form').attr('id').search('gm_add_to_cart_') != -1) { var t_id = '0'; t_id =$(this).closest('form').attr('id').replace('gm_add_to_cart_', ''); gm_calc_prices_listing(t_id, true); } }); } this.init_binds(); } /**//* GMAttributesCalculator.js */ /**/ $(document).ready(function(){ $('.gm_products_id').each(function(){ var attr_calc = new GMAttributesCalculator(); attr_calc.calculate_listing($(this).attr('value')); }); if(typeof($(".gm_attr_calc_input").attr('class')) != 'undefined' || typeof($(".graduated_prices_detail_row").attr('class')) != 'undefined') { var attr_calc = new GMAttributesCalculator(); attr_calc.calculate(); var t_changed = false; if($(".gm_attr_calc_input").attr('type') == 'radio') { $(".gm_attr_calc_input").click(function() { if(t_changed == false) { var attr_calc = new GMAttributesCalculator(); attr_calc.calculate(); } }); } else { $(".gm_attr_calc_input").change(function() { // change-event is needed for Safari 4 var attr_calc = new GMAttributesCalculator(); attr_calc.calculate(); t_changed = true; }); } } // attributes price and graduated price $("#gm_attr_calc_qty").keyup(function(){ var attr_calc = new GMAttributesCalculator(); attr_calc.calculate(); coo_dropdowns_listener.check_combi_status(); }); } ); function GMAttributesCalculator(){ this.calculate = function(){ if($(".details_attributes_dropdown").length == 0){ jQuery.ajax({data: $("#cart_quantity").serialize(), url: 'gm_ajax.php?module=calculate_weight&XTCsid='+gm_session_id, type: "POST", async: true, success: function(t_updated_weight){ $("#gm_calc_weight").html(t_updated_weight); } }).html; } jQuery.ajax({data: $("#cart_quantity").serialize(), url: 'gm_ajax.php?module=calculate_price&XTCsid='+gm_session_id, type: "POST", async: true, success: function(t_updated_price){ $("#gm_attr_calc_price").html(t_updated_price); } }).html; } this.calculate_listing = function(gm_id, p_force_request){ var inputs = []; var t_has_price = false; $('#gm_add_to_cart_' + gm_id + ' .gm_listing_form').each(function() { if($(this).attr('type') == 'radio') { if($(this).attr('checked') == true){ inputs.push(this.name + '=' + escape(this.value)); if($(this).hasClass('has-price')) { t_has_price = true; } } } else { inputs.push(this.name + '=' + escape(this.value)); if(typeof($(this).find('option:selected')) != 'undefined' && $(this).find('option:selected').hasClass('has-price') == true) { t_has_price = true; } } } ); if((t_has_price == true || (typeof(p_force_request) != 'undefined' && p_force_request == true)) && (inputs.join('&').search(/id\[/) != -1 || typeof($('#gm_add_to_cart_' + gm_id + ' .gm_graduated_prices').attr('class')) != 'undefined')) { var updated_price = jQuery.ajax({data: inputs.join('&') + '&products_id=' + gm_id, url: 'gm_ajax.php?module=calculate_price&XTCsid='+gm_session_id, type: "POST", async: true, success: function(updated_price){ $('#gm_attr_calc_price_' + gm_id).html(updated_price); } }).html; if($('#gm_calc_weight_' + gm_id).length > 0) { jQuery.ajax({data: inputs.join('&') + '&products_id=' + gm_id, url: 'gm_ajax.php?module=calculate_weight&XTCsid='+gm_session_id, type: "POST", async: true, success: function(p_weight) { $('#gm_calc_weight_' + gm_id).html(p_weight); } }); } } } } /**/