function customize_item(itemURL,itemName,itemMobileURL) { $("#hiddenCurrentCustomizeImageURL").val(itemURL); $("#hiddenCurrentCustomizeImageURLMobile").val(itemMobileURL); $(".PreviewImageName").html(itemName); $(".PreviewImgSteps").attr("src",itemMobileURL); PreviewLoad(); // jQuery(".kjhyug").hide(); //jQuery("#CurrentCustomizeImage_1").show(); $('#modal_customize_item').modal('toggle'); return false; } function fRedirect(str) { var Curl = window.location.href; Curl = Curl.replace("#", ""); if(str=="back") { Curl = Curl.replace("&cart=1", ""); Curl = Curl.replace("&payment=1", ""); Curl = Curl.replace("&checkout=1", ""); } else if(str=="payment") { Curl = Curl.replace("&cart=1", ""); Curl = Curl.replace("&payment=1", ""); Curl = Curl.replace("&checkout=1", ""); Curl = Curl+"&payment=1"; } else if(str=="checkout") { Curl = Curl.replace("&cart=1", ""); Curl = Curl.replace("&payment=1", ""); Curl = Curl.replace("&checkout=1", ""); Curl = Curl+"&checkout=1"; } else { var substring = "&cart=1"; if(Curl.indexOf(substring) !== -1) {} else { Curl = Curl+"&cart=1"; } } window.location=Curl; return false; } function PreviewLoad() { jQuery('.PreviewImgSteps').load(function() { }); } function checkoutTabOpen(open) { var current = 1; if((jQuery(".fb-checkout-step-1")).hasClass('chk-step-enable')) current = 1; else if((jQuery(".fb-checkout-step-2")).hasClass('chk-step-enable')) current = 2; else if((jQuery(".fb-checkout-step-3")).hasClass('chk-step-enable')) current = 3; jQuery(".fb-checkout-step-"+current).removeClass('chk-step-enable'); jQuery(".fb-checkout-step-"+current).addClass('chk-step-p-enable'); if((jQuery(".fb-checkout-step-"+open)).hasClass('chk-step-p-enable')) { jQuery(".fb-checkout-step-"+open).removeClass('chk-step-p-enable'); jQuery(".fb-checkout-step-"+open).addClass('chk-step-enable'); } } jQuery(document).ready(function() { jQuery('.btnCompleteOrder125').click(function(event) { jQuery(".section-btn-complete-order").hide(); jQuery(".orderCompletedMSG").show(); jQuery("#hiddenCheckoutStep").val(0); }); jQuery('.chk-step-p-enable .fb-checkout-heading').live('click', function(event) { var open = jQuery(this).attr("data-open"); checkoutTabOpen(open); }); jQuery('.row-chk-body .btnSaveCartInfo').click(function(event) { var current = jQuery(this).attr("data-current"); var next = jQuery(this).attr("data-next"); var x=1,y=2,z=3; if(next==1) { x=0,y=1,z=2; } if(next==2) { x=1,y=2,z=3; } if(next==3) { x=2,y=3,z=4; } //if(!(jQuery(this)).hasClass('chk-step-p-enable')) jQuery(".fb-checkout-step-"+x).removeClass("chk-step-enable"); jQuery(".fb-checkout-step-"+x).removeClass("chk-step-default"); jQuery(".fb-checkout-step-"+x).removeClass("chk-step-disable"); jQuery(".fb-checkout-step-"+x).addClass("chk-step-p-enable"); //deal with next. jQuery(".fb-checkout-step-"+y).removeClass("chk-step-enable"); jQuery(".fb-checkout-step-"+y).removeClass("chk-step-default"); jQuery(".fb-checkout-step-"+y).removeClass("chk-step-disable"); jQuery(".fb-checkout-step-"+y).removeClass("chk-step-p-enable"); jQuery(".fb-checkout-step-"+y).addClass("chk-step-enable"); //deal with 2nd next. jQuery(".fb-checkout-step-"+z).removeClass("chk-step-enable"); jQuery(".fb-checkout-step-"+z).removeClass("chk-step-default"); jQuery(".fb-checkout-step-"+z).removeClass("chk-step-disable"); if(!(jQuery(".fb-checkout-step-"+z)).hasClass('chk-step-p-enable')) jQuery(".fb-checkout-step-"+z).addClass("chk-step-default"); }); jQuery('ul.items-shopping-cart').click(function(event) { event.stopPropagation(); jQuery('#dropdown_ddCart').addClass("open"); }); jQuery('#count_notification_cart').click(function(event) { if (jQuery('#dropdown_ddCart').hasClass("open")) {} else { window.setTimeout(function(){ jQuery('#dropdown_ddCart').addClass("open"); }, 100); } }); jQuery('.cart-item .remove-item img').click(function(event) { jQuery(this).closest('.list-cart-item').remove(); }); jQuery(".catItem").click(function() { jQuery(".catItem").removeClass("selected"); jQuery(this).addClass("selected"); }); jQuery(".prodItem").click(function() { jQuery(".prodItem").removeClass("selected"); jQuery(this).addClass("selected"); jQuery(".selectedProductInfo").html((jQuery(this).find(".prodName").html())); //selectedProductInfo }); jQuery(".tab-switch").live('click', function() { var target = jQuery(this).attr("data-traget"); var common = jQuery(this).attr("data-common"); jQuery("."+common).hide(); jQuery("#"+target).show(); return false; }); /****scroll shopping cart table ****/ /* var $table = $('table.cart-table-scroll12'), $bodyCells = $table.find('tbody tr:first').children(), colWidth; $(window).resize(function() { colWidth = $bodyCells.map(function() { return $(this).width(); }).get(); $table.find('thead tr').children().each(function(i, v) { $(v).width(colWidth[i]); }); }).resize(); */ /*****focus control*****/ $('.fb-checkout-body-inn .form-control').focus( function() { $("."+$(this).attr("data-rel")).addClass('active'); }); $('.fb-checkout-body-inn .form-control').blur( function() { $("."+$(this).attr("data-rel")).removeClass('active'); }); /*****END - focus control*****/ });