var wpshop=jQuery.noConflict();jQuery.fn.center=function(){this.css("top",(jQuery(window).height()- this.height())/2+"px");this.css("left",(jQuery(window).width()- this.width())/2+"px");return this;};wpshop(document).ready(function(){jQuery.address.init(function(event){}).bind('change',function(event){jQuery('.page-numbers').address(function(){return jQuery(this).attr('href').replace(location.pathname,'');});var id=jQuery.address.queryString();if(id!=null){var page_number=id.replace('page_product=','');if(page_number!=''){wpshop_get_product_by_criteria_on_load(parseInt(page_number));}}});function back2Element(element){var offset=element.offset();jQuery('html, body').animate({scrollTop:offset.top},800);} var options_login={dataType:'json',beforeSubmit:validate_login,success:showResponse};if(wpshop("#login_form").length>0){wpshop('#login_form').ajaxForm(options_login);} if(jQuery("#new_entity_quick_form").length>0){jQuery('#new_entity_quick_form').ajaxForm({dataType:'json',beforeSubmit:function(a,f,o){animate_container('#new_entity_quick_form',jQuery("#new_entity_quick_form_container"));},success:function(response){desanimate_container(jQuery("#new_entity_quick_form_container"));if(response[0]){jQuery('#wpshop_quick_add_entity_result').addClass("success");jQuery('#new_entity_quick_form')[0].reset();} else{jQuery('#wpshop_quick_add_entity_result').addClass("error");} jQuery('#wpshop_quick_add_entity_result').html(response[1]);jQuery('#wpshop_quick_add_entity_result').show();setTimeout(function(){jQuery('#wpshop_quick_add_entity_result').html("");jQuery('#wpshop_quick_add_entity_result').slideUp();jQuery('#wpshop_quick_add_entity_result').removeClass("success");jQuery('#wpshop_quick_add_entity_result').removeClass("error");},3500);},});} var options_register={dataType:'json',success:showResponse};if(wpshop("#register_form").length>0){wpshop('#register_form').ajaxForm(options_register);} function validate_login(formData,jqForm,options){for(var i=0;iPlease enter a value for both Username/Email and Password').fadeIn(500);return false;}} return true;} function validate_register(formData,jqForm,options){var required_fields=['account_first_name','account_last_name','account_email','account_password_1','account_password_2','billing_address','billing_city','billing_postcode','billing_country'];var required_fields_shipping=['shipping_first_name','shipping_last_name','shipping_address','shipping_city','shipping_postcode','shipping_country'];for(var i=0;i'+WPSHOP_REQUIRED_FIELD_ERROR_MESSAGE+'').fadeIn(500);back2Element(jQuery('#reponseBox'));return false;}} if(jQuery('input[name=shiptobilling]',jqForm).prop('checked')==false){for(var i=0;i'+WPSHOP_REQUIRED_FIELD_ERROR_MESSAGE+'').fadeIn(500);back2Element(jQuery('#reponseBox'));return false;}}} if(!is_email(jQuery('input[name=account_email]',jqForm).val())){jQuery('#reponseBox').hide().html('
'+WPSHOP_INVALID_EMAIL_ERROR_MESSAGE+'
').fadeIn(500);back2Element(jQuery('#reponseBox'));return false;} if(jQuery('input[name=account_password_1]',jqForm).val()!=jQuery('input[name=account_password_2]',jqForm).val()){jQuery('#reponseBox').hide().html('
'+WPSHOP_UNMATCHABLE_PASSWORD_ERROR_MESSAGE+'
').fadeIn(500);back2Element(jQuery('#reponseBox'));return false;} return true;} function showResponse(responseText,statusText,xhr,$form){if(responseText['status']){jQuery('#reponseBox').fadeOut('slow');if(responseText['url']!=''){window.top.location.href=responseText['url'];} else{window.top.location.href=CURRENT_PAGE_URL;}} else{jQuery('#reponseBox').hide().html(responseText['reponse']).fadeIn('slow');back2Element(jQuery('#reponseBox'));}} function is_email(email){var reg=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;if(reg.test(email)==false){return false;}else return true;} if(jQuery("#wpshop_product_feature").length>0){wpshop("#wpshop_product_feature").tabs();} wpshop(".wpshop_open_category").click(function(){widget_menu_animation(wpshop(this));});wpshop("a[rel=appendix]").fancybox({'transitionIn':'none','transitionOut':'none'});wpshop("a#product_thumbnail").fancybox({'titleShow':false});if(jQuery("#wpshop_add_to_cart_form").length>0){var form_options_add_to_cart={dataType:'json',beforeSubmit:function_before_add_to_cart_form_submit,success:function_after_form_success,};jQuery('#wpshop_add_to_cart_form').ajaxForm(form_options_add_to_cart);jQuery('.wpshop_add_to_cart_button').live("click",function(){var element=jQuery(this).parent();jQuery('.wpshop_cart_loading_picture',element).removeClass('success error');jQuery('.wpshop_cart_loading_picture',element).css('display','inline');jQuery('#wpshop_add_to_cart_form').submit();});jQuery('.wpshop_ask_a_quotation_button').live("click",function(){var element=jQuery(this).parent();jQuery('.wpshop_cart_loading_picture',element).removeClass('success error');jQuery('.wpshop_cart_loading_picture',element).css('display','inline');jQuery('#wpshop_add_to_cart_form input[name=wpshop_cart_type]').val('quotation');jQuery('#wpshop_add_to_cart_form').submit();});} else{jQuery('.wpshop_add_to_cart_button').live("click",function(){wpshop_product_add_to_cart('cart',jQuery(this));});jQuery('.wpshop_ask_a_quotation_button').live("click",function(){wpshop_product_add_to_cart('quotation',jQuery(this));});} jQuery("input[name=takeOrder], button[name=takeOrder]").click(function(){if(jQuery("#terms_of_sale").size()>0){if(!jQuery("#terms_of_sale").is(':checked')){alert(WPSHOP_ACCEPT_TERMS_OF_SALE);return false;}}});var wpshop_display_info_about_value_ajax_request=null;jQuery(".wpshop_display_information_about_value").live('change',function(){var attribute_for_detail=[];jQuery(".wpshop_display_information_about_value").each(function(){if((jQuery(this).attr("type")=="checkbox")||(jQuery(this).attr("type")=="radio")){if(jQuery(this).is(":checked")){attribute_for_detail.push(jQuery(this).attr("name").replace("wps_pdt_variations[","").replace("]","")+"-_variation_val_-"+ jQuery(this).val());}} else{attribute_for_detail.push(jQuery(this).attr("name").replace("wps_pdt_variations[","").replace("]","")+"-_variation_val_-"+ jQuery(this).val());}});var data={action:"wpshop_ajax_variation_selection_show_detail_for_value",attribute_for_detail:attribute_for_detail,};if(wpshop_display_info_about_value_ajax_request!=null){wpshop_display_info_about_value_ajax_request.abort();} wpshop_display_info_about_value_ajax_request=jQuery.post(ajaxurl,data,function(response){jQuery(".wpshop_product_variation_value_detail_main_container").html(response);});});jQuery(".wpshop_variation_selector_input, .wpshop_currency_field").live('change',function(){load_variation_summary();});jQuery(".wpshop_variation_selector_input, .wpshop_currency_field").live('keyup',function(){load_variation_summary();});jQuery(".wpshop_variation_selector_input, .wpshop_currency_field").live('blur',function(){load_variation_summary();});load_variation_summary();jQuery('.emptyCart').live('click',function(){jQuery('#cartContent .remove').each(function(){jQuery(this).click();});return false;});jQuery('.submit_coupon').live('click',function(){var coupon_code=jQuery('input[name=coupon_code]').val();if(coupon_code=='') return false;jQuery.getJSON(WPSHOP_AJAX_URL,{post:"true",elementCode:"ajax_cartAction",action:"applyCoupon",coupon_code:coupon_code},function(data){if(data[0]){reload_cart();} else{alert(data[1]);}});return false;});jQuery('select[name=sorting_criteria]').live('change',function(){_this=jQuery(this);if(jQuery('option:selected',this).val()!='') wpshop_get_product_by_criteria(1,_this);return false;});jQuery('.reverse_sorting').live('click',function(){_this=jQuery(this);var wpshop_sorting_bloc=_this.closest('.wpshop_products_block').children('.sorting_bloc');var order=jQuery('input[name=order]',wpshop_sorting_bloc).val()=='ASC'?'DESC':'ASC';jQuery('input[name=order]',wpshop_sorting_bloc).val(order);jQuery('.reverse_sorting',wpshop_sorting_bloc).toggleClass('product_asc_listing');wpshop_get_product_by_criteria(1,_this);return false;});jQuery('ul.pagination li a').live("click",function(){_this=jQuery(this);var page_number=jQuery(this).html();jQuery('input[name=page_number]').val(page_number);wpshop_get_product_by_criteria(page_number,_this);return false;});jQuery('.change_display_mode').live('click',function(){_this=jQuery(this);var wpshop_sorting_bloc=_this.closest('.wpshop_products_block').children('.sorting_bloc');if(jQuery(this).hasClass('list_display'))var display_type='list';else var display_type='grid';if(jQuery('input[name=display_type]',wpshop_sorting_bloc).val()!=display_type){jQuery('input[name=display_type]',wpshop_sorting_bloc).val(display_type);jQuery('.list_display',wpshop_sorting_bloc).toggleClass('active');jQuery('.grid_display',wpshop_sorting_bloc).toggleClass('active');var page_number=jQuery('input[name=page_number]',wpshop_sorting_bloc).val();wpshop_get_product_by_criteria(page_number,_this);} return false;});jQuery(document).on('keyup','.wpshop_product_qty_input',function(){jQuery('#wpshop_pdt_qty').val(jQuery(this).val());});function animate_container(container,sub_container){jQuery(sub_container,container).animate({opacity:0.3},500);jQuery('#wpshop_loading').fadeIn('slow');var offset=jQuery(container).offset();var bottom_visible_block=offset.top+ jQuery(container).height();if(offset.top>jQuery(window).scrollTop()) var top=(jQuery(window).scrollTop()+jQuery(window).height()-offset.top)/2-16;else var top=jQuery(window).scrollTop()- offset.top+(bottom_visible_block-jQuery(window).scrollTop())/2- 16;jQuery('#wpshop_loading').css({left:(jQuery(container).width()/2-16)+'px',top:top+'px'}).animate({'top':top});} function desanimate_container(container){jQuery('#wpshop_loading').fadeOut('slow');jQuery(container).animate({opacity:1},500);} xhr=null;function wpshop_get_product_by_criteria(page_number,eventElement){var wpshop_product_container=eventElement.closest('.wpshop_products_block').children('.wpshop_product_container');var wpshop_sorting_bloc=eventElement.closest('.wpshop_products_block').children('.sorting_bloc');if(typeof(page_number)=='undefined'){var page_number=1;jQuery('input[name=page_number]').val(page_number);} jQuery('ul.pagination li').removeClass('active');jQuery('ul.pagination li:nth-child('+page_number+')').addClass('active');animate_container(wpshop_product_container,'.products_listing');var criteria=jQuery('.hidden_sorting_criteria_field option:selected',wpshop_sorting_bloc).val();var ajax_url=WPSHOP_AJAX_URL+'?post=true&elementCode=products_by_criteria&page_number='+page_number+'&criteria='+criteria;jQuery('.hidden_sorting_fields',wpshop_sorting_bloc).each(function(){ajax_url+='&'+jQuery(this).attr('name')+'='+jQuery(this).val();});if(xhr!=null)xhr.abort();xhr=jQuery.getJSON(ajax_url,{},function(data){if(data[0]){jQuery(wpshop_product_container).html(data[1]);desanimate_container(wpshop_product_container);var offset=wpshop_sorting_bloc.offset();jQuery('html, body').stop(true).animate({scrollTop:offset.top},800);}});} function wpshop_get_product_by_criteria_on_load(page_number){jQuery('.wpshop_product_container').html(WPSHOP_LOADER_ICON_JQUERY_ADDRESS);var offset=jQuery('.sorting_bloc').offset();jQuery('html, body').stop(true).animate({scrollTop:offset.top},800);var criteria='';var ajax_url=WPSHOP_AJAX_URL+'?post=true&elementCode=products_by_criteria&page_number='+page_number+'&criteria='+criteria;jQuery('.hidden_sorting_fields').each(function(){ajax_url+='&'+jQuery(this).attr('name')+'='+jQuery(this).val();});if(xhr!=null)xhr.abort();xhr=jQuery.getJSON(ajax_url,{},function(data){if(data[0]){jQuery('.wpshop_product_container').html(data[1]);desanimate_container(jQuery('.wpshop_product_container'));var offset=jQuery('.sorting_bloc').offset();jQuery('html, body').stop(true).animate({scrollTop:offset.top},800);}});} jQuery(".closeAlert").live('click',function(){jQuery('.wpshop_superBackground').fadeOut('slow',function(){jQuery(this).remove();});jQuery('.wpshop_popupAlert').fadeOut('slow',function(){jQuery(this).remove();});});jQuery(document).on('click','.wpshop_superBackground',function(){jQuery('.wpshop_superBackground').fadeOut('slow',function(){jQuery(this).remove();});jQuery('.wpshop_popupAlert').fadeOut('slow',function(){jQuery(this).remove();});});jQuery('a.recalculate-cart-button').live('click',function(){reload_cart();return false;});jQuery('a.remove').live('click',function(){jQuery(this).addClass('loading');var element=jQuery(this).parent().parent();var pid=element.attr('id').substr(8);updateQty(element,pid,0);return false;});jQuery('input[name=productQty]').live('change',function(){var input=jQuery(this);var element=input.parent().parent();var pid=element.attr('id').substr(8);var qty=input.val();updateQty(element,pid,qty);return false;});jQuery('a.productQtyChange').live('click',function(){var a=jQuery(this);var element=a.parent().parent();var input=jQuery('input[name=productQty]',element);var pid=element.attr('id').substr(8);if(a.hasClass('wpshop_more_product_qty_in_cart')) var qty=parseInt(input.val())+1;else var qty=parseInt(input.val())-1;updateQty(element,pid,qty);return false;});jQuery('a.checkoutForm_login').click(function(){var elementToShow='';var elementToHide='';var infosToShow='';var infosToHide='';if(jQuery('#register').css('display')=='block'){elementToShow='#login';elementToHide='#register';infosToShow='#infos_login';infosToHide='#infos_register';} else{elementToShow='#register';elementToHide='#login';infosToShow='#infos_register';infosToHide='#infos_login';} jQuery(infosToShow).show();jQuery(infosToHide).hide();jQuery(elementToHide).fadeOut(250,function(){jQuery(elementToShow).fadeIn(250);});return false;});jQuery('input[type=checkbox][name=shiptobilling]').click(function(){if(jQuery(this).attr('checked')=='checked'){jQuery('#shipping_infos_bloc').fadeOut(250);} else jQuery('#shipping_infos_bloc').fadeIn(250);});jQuery('table.blockPayment').click(function(){jQuery('table.blockPayment').removeClass('active');jQuery('table.blockPayment input[type=radio]').attr('checked',false);jQuery(this).addClass('active');jQuery('input[type=radio]',this).attr('checked',true);});jQuery(".address_choice_select").live('change',function(){var id=jQuery(this).attr('id');var address_id=jQuery(this).val();jQuery("#choosen_address_"+id).html();jQuery("loader_"+id).show();var data={action:"change_address","address_type":jQuery(this).attr('id'),"address_id":jQuery(this).val()};jQuery.post(ajaxurl,data,function(response){if(response[0]){reload_shipping_mode();jQuery("#choosen_address_"+id).html(response[1]);jQuery("#edit_link_"+id).html(response[2]);jQuery("#hidden_input_"+id).val(address_id);if(id=='shipping_address'){reload_cart();reload_cart();} if(response[3]!=null){jQuery('input[name=takeOrder]').hide();jQuery('#wpshop_checkout_payment_buttons').html(response[4]);} else{jQuery('input[name=takeOrder]').show();}} else{jQuery("loader_"+id).hide();jQuery("#choosen_address_"+id).html();}},"json");});jQuery('#restart_order_loader').hide();jQuery(document).on('click','#restart_order',function(){jQuery('#restart_order_loader').fadeIn();var data={action:"restart_the_order",order_id:jQuery('#wps_order_id').val()};jQuery.post(ajaxurl,data,function(response){if(response['status']){jQuery('#restart_order').hide();if(response['add_to_cart_checking']){alert(response['add_to_cart_checking_message']);} else{window.location.replace(response['response']);} reload_cart();} else{alert(response['response']);} jQuery('#restart_order_loader').fadeOut();},'json');});jQuery(document).on('click','.make_order_again',function(){var id=jQuery(this).attr('id');jQuery('#make_order_again_loader_'+ id).removeClass('wpshopHide');var data={action:"restart_the_order",order_id:id,make_order_again:'1'};jQuery.post(ajaxurl,data,function(response){if(response['status']){jQuery('#make_order_again_loader_'+ id).addClass('wpshopHide');if(response['add_to_cart_checking']){alert(response['add_to_cart_checking_message']);} else{window.location.replace(response['response']);} reload_cart();} else{alert(response['response']);jQuery('#make_order_again_loader_'+ id).addClass('wpshopHide');} jQuery('#restart_order_loader').fadeOut();},'json');});if(jQuery('.error_bloc').length>0){jQuery('#wpshop_checkout_payment_buttons').hide();}});var wpshop_load_variation_summary=null;function load_variation_summary(){var frontend_attribute_variation_selection=[];var frontend_attribute_free_variation_selection=[];var frontend_currency=null;if(jQuery(".wpshop_currency_field").length>0){frontend_currency=jQuery(".wpshop_currency_field").val();} var has_variation_displayed=false;jQuery(".wpshop_variation_selector_input").each(function(){if((jQuery(this).attr("type")=="checkbox")||(jQuery(this).attr("type")=="radio")){if(jQuery(this).is(":checked")){frontend_attribute_variation_selection.push(jQuery(this).attr("name").replace("wps_pdt_variations[","").replace("]","")+"-_variation_val_-"+ jQuery(this).val());has_variation_displayed=true;}} else if(jQuery(this).attr("id").slice(0,10)=="attribute_"){frontend_attribute_free_variation_selection.push(jQuery(this).attr("name").replace("wps_pdt_variations[free][","").replace("]","")+"-_variation_val_-"+ jQuery(this).val());has_variation_displayed=true;} else{frontend_attribute_variation_selection.push(jQuery(this).attr("id").replace("wpshop_variation_attr_","")+"-_variation_val_-"+ jQuery(this).val());has_variation_displayed=true;}});if(has_variation_displayed){jQuery(".wpshop_product_price").addClass("wpshop_product_price_loading");jQuery(".wpshop_product_price").removeClass("wpshop_product_price_is_loaded");jQuery(".wpshop_save_money_message").html('');var data={action:"wpshop_variation_selection",wpshop_pdt:jQuery("#wpshop_pdt").val(),wpshop_variation:frontend_attribute_variation_selection,wpshop_free_variation:frontend_attribute_free_variation_selection,wpshop_current_for_display:frontend_currency,};if(wpshop_load_variation_summary!=null){wpshop_load_variation_summary.abort();} wpshop_load_variation_summary=jQuery.post(ajaxurl,data,function(response){if(response[0]){jQuery(".wpshop_product_price.wpshop_product_price_loading").after(response[1]['product_price_output']);jQuery(".wpshop_product_price.wpshop_product_price_loading").remove();jQuery("#wpshop_product_variation_summary_container").html(response[1]['product_output']);if(response[2]){jQuery('.wpshop_add_to_cart_button').hide();jQuery('.wpshop_ask_a_quotation_button').hide();} else{jQuery('.wpshop_add_to_cart_button').show();jQuery('.wpshop_ask_a_quotation_button').show();}} jQuery(".wpshop_product_price").removeClass("wpshop_product_price_loading");jQuery(".wpshop_product_price").addClass("wpshop_product_price_is_loaded");setTimeout(function(){jQuery(".wpshop_product_price").removeClass("wpshop_product_price_is_loaded");},'1500');},'json');}};function widget_menu_animation(current_element){current_category=current_element.attr("id").replace("wpshop_open_category_","");if(current_element.hasClass("wpshop_category_closed")){current_element.removeClass("wpshop_category_closed");current_element.addClass("wpshop_category_opened");wpshop(".wpshop_category_sub_content_"+ current_category).slideDown();} else{current_element.removeClass("wpshop_category_opened");current_element.addClass("wpshop_category_closed");wpshop(".wpshop_category_sub_content_"+ current_category).slideUp();}} function updateQty(element,pid,qty){qty=qty<0?0:qty;jQuery('input[name=productQty]',element).val(qty);jQuery('a.remove',element).addClass('loading');var data={action:"wpshop_set_qtyfor_product_into_cart",product_id:pid,product_qty:qty,};jQuery.post(ajaxurl,data,function(response){if(response[0]){if(qty<=0){element.fadeOut(250,function(){element.remove();});} else{jQuery('a.remove',element).removeClass('loading');} reload_cart();var chosen_method=jQuery('input[name=wps_shipping_method_choice]:checked').attr('id');recalculate_shipping_cost(chosen_method);} else{jQuery('a.remove',element).removeClass('loading');jQuery('input[name=productQty]',element).val(jQuery('input[name=currentProductQty]',element).val());alert(response[1]);}},'json');} function wpshop_product_add_to_cart(cart_type,current_element){var ajax_action="add_product_to_cart";var replacement="wpshop_add_to_cart_";if(cart_type=='quotation'){var replacement="wpshop_ask_a_quotation_";var ajax_action="add_product_to_quotation";} var element=current_element.parent();jQuery('.wpshop_cart_loading_picture',element).removeClass('success error');jQuery('.wpshop_cart_loading_picture',element).css('display','inline');var pid=current_element.attr("id").replace(replacement,"");var variations=new Array;jQuery(".wpshop_variation_selector_input").each(function(){var attr_val=jQuery('option:selected',this).val();variations.push(attr_val);});var data={action:"wpshop_add_product_to_cart",wpshop_pdt:pid,wpshop_pdt_qty:jQuery('.wpshop_product_qty_input').val(),wpshop_cart_type:cart_type,wpshop_pdt_variation:variations};jQuery.post(ajaxurl,data,function(response){if(response[0]){jQuery('.wpshop_cart_loading_picture',element).addClass('success');setTimeout(function(){jQuery('.wpshop_cart_loading_picture',element).fadeOut('slow');},1500);if(cart_type=='quotation'){jQuery(".wpshop_add_to_cart_button").remove();} if(cart_type=='cart'){jQuery(".wpshop_ask_a_quotation_button").remove();} if(response[2]){document.location=response[3];return false;} else{add_to_cart_animation(response);} if(jQuery('.wpshop_cart_summary').attr("class")!=undefined){var data={action:"wpshop_reload_mini_cart"};jQuery('.wpshop_cart_summary').load(ajaxurl,data,function(response){});} jQuery(".wpshop_variation_selector_input").each(function(){jQuery('option:selected',this).val("");});} else{jQuery('.wpshop_cart_loading_picture',element).addClass('error');alert(response[1]);}},'json');return false;} function add_to_cart_animation(response){if(response[5][0]=='animation'&&jQuery('.wpshop_cart_summary').length){jQuery('body').append('
');if(jQuery("#product_thumbnail").length){pos=jQuery('#product_thumbnail').offset();img_produit=jQuery('#product_thumbnail').html();} else{pos=jQuery('.product_thumbnail_'+ response[4]).offset();img_produit=jQuery('.product_thumbnail_'+ response[4]).html();} jQuery('.add_to_cart_product_animation_container').css({'opacity':0,'left':pos.left,'top':(pos.top- 200)});var pos_cart=jQuery('.wpshop_cart_summary').offset();jQuery('.add_to_cart_product_animation_container').html(img_produit);jQuery('.add_to_cart_product_animation_container').animate({opacity:0.8,left:pos_cart.left,top:pos_cart.top},1100,function(){jQuery('.add_to_cart_product_animation_container').fadeOut('slow');jQuery('.wpshop_cart_alert').html(response[5][1]);jQuery('.wpshop_cart_alert').fadeIn('slow');setTimeout(function(){jQuery('.wpshop_cart_alert').fadeOut('slow');},2000);});} else{jQuery('body').append(response[1]);if(response[6][0]!=null){jQuery('#product_img_dialog_box').html(response[6][0]);} if(response[6][1]!=null){jQuery('.product_title_dialog_box').html(response[6][1]);} if(response[6][2]!=null){jQuery('#wpshop_add_to_cart_box_related_products').html(response[6][2]);} if(response[6][3]!=null){jQuery('.product_price_dialog_box').html(response[6][3]);} jQuery('.wpshop_superBackground').fadeIn();jQuery('.wpshop_popupAlert').fadeIn();jQuery('.wpshop_popupAlert').css("top",(jQuery(window).height()-jQuery('.wpshop_popupAlert').height())/2+"px");jQuery('.wpshop_popupAlert').css("left",(jQuery(window).width()-jQuery('.wpshop_popupAlert').width())/2+"px");}} function function_before_add_to_cart_form_submit(formData,jqForm,options){jQuery('.wpshop_cart_loading_picture').removeClass('error success loading');jQuery('#wpshop_product_add_to_cart_form_result').remove();var form_is_complete=true;for(var i=0;i