'});} else if (popnews == "yes"){$.colorbox({inline:true,href:'
'});}$(window).scroll(function(){var hauteur = $(window).scrollTop();if (parseInt(hauteur) > 70) {$("#panier").css("background-color","#6a1510");} else {$("#panier").css("background-color","");}});if ($("#pics_accueil").length){var mosaic = '';$("#pics_accueil_return a[href=art-tibetain-rub-fr-149]").parent().parent().before(mosaic);$("#pics_accueil_return a[href=art-tibetain-rub-fr-149]").parent().hide();}var url_detect = window.location.href;var url_check = url_detect.indexOf("#!#!");if (url_check>=0){var myRegEx=new RegExp("#!","gm");var url_redirect=url_detect.replace(myRegEx ,"");url_redirect=url_redirect.replace("index.php","");window.location.href=url_redirect;}$("#lang").hover(function () {$(".dropdown dd ul").show();}, function () {$(".dropdown dd ul").hide();});$.ajax({url:"includes/cart.php",type:"POST",data:"action=cart_display&lang=es",cache:false,success:function(data){data = data.split("[BRK]");$("#cart_number,#mobile_number").html(data[0]);if ($("#mobile_menu").is(":visible") && parseInt($("#mobile_number").html()) >= 1){$("#mobile_number").fadeIn(500); }$("#cart_price").html(data[1]);$("#customer_session").val(data[2]);$("#id_customer").val(data[3]);if(data[2] == "on"){$("#logout_link").attr("href","includes/logout.php?mail="+data[4]);$("#register_link").hide();if ($("#mobile_menu").is(":hidden")){ $("#logout_link").show(); }}setTimeout(function(){ cart_update("repeat"); },30000);}});if ($("#header_cs").is(":visible")){$(".menu_onglet").hover(function () {$(this).find("div").slideDown(300);}, function () {$(this).find("div").slideUp(300);});} else {$(".menu_onglet strong a").click(function(){$(".mega2").hide();if ($(this).parent().parent().find(".mega2").length && $(this).parent().parent().find(".mega2").is(":hidden")){$(this).parent().parent().find(".mega2").slideDown(300);} else if ($(this).parent().parent().find(".mega2").length && $(this).parent().parent().find(".mega2").is(":visible")){$(this).parent().parent().find(".mega2").slideUp(300);}});}$(".v_rubric").hover(function () {$(this).find("span").show();}, function () {var span_class = $(this).find("span").attr("class");if (span_class != "active") { $(this).find("span").hide(); }});$(".v_rubric").click(function(){$("#nav-left li span").removeClass("active").hide();$("span",this).addClass("active").show();$("#nav-left div").slideUp(500);$(this).next().slideDown(500);});$(".v_rubric a").click(function(){$("#nav-left li span").removeClass("active").hide();$(this).parent().find("span").addClass("active").show();$("#nav-left div").slideUp(500);$(this).parent().next().slideDown(500);});$(".bouton").hover(function(){$(this).css('cursor','pointer');var src1 = $(this).attr("src").match(/[^\.]+/) + "2.png";$(this).attr("src", src1);}, function() {$(this).css('cursor','auto');var src2 = $(this).attr("src").replace("2", "");$(this).attr("src", src2);});$("#menu .mega2 a").click(function(){ $(this).parent().hide(); });if ($("#foo1").length) {$.ajax({url:"includes/autosuggest.php",type:"GET",data:"action=autosuggest&type=left&lang=es",cache:false,success:function(data){$("#foo1").html(data);$("#foo1").carouFredSel({direction:"up",items:4,auto:{ pauseOnHover: true }, scroll:{ duration:1500}}).find(".slide").hover(function(){ $(this).find("div").slideDown(); },function(){ $(this).find("div").slideUp(); });}});}if ($("#foo3").length) {$("#foo3").carouFredSel({items:1,scroll : 1,auto : false,prev : {button: "#foo3_prev",key: "left"},next : { button: "#foo3_next",key: "right"},pagination: "#foo3_pag"});$(".slider").hover(function() { $(this).find("div").slideDown(); },function() { $(this).find("div").slideUp(); });}$('#contact11').click(function() {$('#contact1').animate({'right': '-=50px'}, 500);setTimeout('Go1()', 300);$(this).blur();return false;});$('#contact22').click(function() {$('#contact2').animate({'right': '-=200px'}, 1000);setTimeout('Go2()', 700);$(this).blur();return false;});$('#rappelgo').click(function() {$('#contact2').animate({'right': '-=200px'}, 1000);setTimeout('Go2()', 700);$(location).attr("href", "#!/kontakt-china-deko-de");setTimeout(function(){$("#objet_contact").val("Rappel");$("label[for=msgbis_contact]").html("Teléfono y horarios de llamada");}, 500);$(this).blur();return false;});$("#mobile_search").click(function(){var icon = $(this).find("img").attr("src");if (icon == "/template/webtao/images/icon_search_off.png"){$(this).css("background","#bb1420");$(this).find("img").attr("src","/template/webtao/images/icon_search_on.png");$("#searchbar").show();} else {close_mobile_search();}});$("#mobile_menu").click(function(){var icon = $(this).find("img").attr("src");if (icon == "/template/webtao/images/icon_menu_off.png"){$(this).css("background","#bb1420");$(this).find("img").attr("src","/template/webtao/images/icon_menu_on.png");$("#menu").show();} else {close_mobile_menu();}});var window_width = $(window).width();if (parseInt(window_width) <= 950){$("#badge").hover(function () {$(this).animate({left:"-2px"}, 500);$("#badge_ts2").hide();}, function () {$(this).animate({left:"-90px"}, 500);setTimeout(function(){$("#badge_ts2").show();}, 500);});}if (parseInt(window_width) >= 950){$("#badge").show();setTimeout(function(){$("#badge").animate({left:"0px"}, 500);$("#badge_ts2").hide();}, 2000);} else if (parseInt(window_width) <= 630){$("#badge").hide();}$.ajax({url:"includes/trustedshopsscript.php",type:"GET",data:"action=result",cache:false,success:function(data){data = data.split("[BRK]");if (parseInt(data[0]) > 0){$("#badge p").eq(1).find("span").html(data[0]);$("#badge p").eq(2).html(data[1]);$("#badge p").eq(3).html(data[2]);$("#badge p").eq(4).find("span").html(data[3]);} else {$("#badge").hide();}}});}); function minislider(){ $("#foo2").carouFredSel({items : 3,scroll : 3,auto : false,prev : {button: "#foo2_prev",key: "left"},next : { button: "#foo2_next",key: "right"},pagination: "#foo2_pag"});$(".slider").hover( function() { $(this).find("div").slideDown(); }, function() { $(this).find("div").slideUp(); } );}function menu_mosaic(linkto) {$(".v_rubric a.lien").each(function(){var lien = $(this).attr("href");if (linkto == lien) {if ($(this).parent().next().is(":hidden")) {$("#nav-left div").slideUp(500);$(this).parent().next().slideDown(500);}}});$("#nav-left div a.lien").each(function(){var lien = $(this).attr("href");if (linkto == lien) {if ($(this).parent().parent().parent().is(":hidden")) {$("#nav-left div").slideUp(500);$(this).parent().parent().parent().slideDown(500);}}});}function Go1() {$('#contact2').animate({'right': '+=200px'}, 1000);}function Go2() {$('#contact1').animate({'right': '+=50px'}, 500);}function rappel() {$('#objet_contact').change(function() {if ($(this).val() == "Rappel") {$("label[for=msgbis_contact]").html("Teléfono y horarios de llamada");} else {$("label[for=msgbis_contact]").html("Mensaje:");}});}function close_mobile_search(){$("#mobile_search").css("background","");$("#mobile_search").find("img").attr("src","/template/webtao/images/icon_search_off.png");$("#searchbar").hide();}function close_mobile_menu(){$("#mobile_menu").css("background","");$("#mobile_menu").find("img").attr("src","/template/webtao/images/icon_menu_off.png");$("#menu").hide();}function cart_update(type){$.ajax({url:"includes/cart.php",type:"POST",data:"action=cart_display&lang=es",cache:false,success:function(data){data = data.split("[BRK]");$("#cart_number,#mobile_number").html(data[0]);if ($("#mobile_menu").is(":visible") && parseInt($("#mobile_number").html()) >= 1){$("#mobile_number").fadeIn(500); }$("#cart_price").html(data[1]);if (type == "delete"){var cart_shipping = $("#cart_shipping").html().replace(" €");var order_total = parseFloat(data[1]) + parseFloat(cart_shipping);$("#cart_total span").html(order_total.toFixed(2) + " €");if (data[0] == 0) {$("#cart_show,#mobile_number").hide(); $("#cart_hide").fadeIn(500); }}if (type == "repeat"){ setTimeout(function(){ cart_update("repeat"); },30000); }}});}function trackingPopup(number){var iframeUrl = $("#tracking"+number).attr("href");$.colorbox({href:iframeUrl, innerWidth:800, innerHeight:500});return false;}window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s=d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set._.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute('charset','utf-8');$.src='//v2.zopim.com/?oB2L8m3bINqwBXK4aQSO5YuTaT2BoXVk';z.t=+new Date;$.type='text/javascript';e.parentNode.insertBefore($,e)})(document,'script');$(document).ready(function(){cookie();navigation();footer();blog();if (page_start == "/login.html" || page_start == "/customer.html" || page_start == "/customer2.html") { login(); }if (page_start == "/register.html" || page_start == "/register2.html" || page_start == "/customer.html" || page_start == "/customer2.html") { register(); }if (page_start == "/newsletter.html") { news(); }if (page_type == "prod") { prod(); }if (page_start == "/cart.html") { cart(); }if (page_start == "/info.html" || page_start == "/customer.html" || page_start == "/customer2.html") { address(); }if (page_start == "/customer.html") { customer(); }if (page_start == "/customer2.html") { customer2(); }if (page_start == "/account.html") { account(); }if (page_start == "/contact-boutique-objets-chinois-fr") { rappel(); }if (page_type == "scat" || page_start == "/search.html") { scat(); }if (page_start == "/reviews.html") { reviews(); }if (page_start == "/payment.html") { payment(); }if (page_start.indexOf("repayment.html") >= 0) { repayment(); }}); function cookie(){var consent = $("#consent_mem").val();if (consent == "unset"){if ((navigator.doNotTrack&&(navigator.doNotTrack=='yes'||navigator.doNotTrack=='1'))||(navigator.msDoNotTrack&&navigator.msDoNotTrack==1)||(window.DoNotTrack&&window.DoNotTrack==1)){$("#cookie_notify").slideDown(1000);$.get("/config/cookie.php",{action:"consent",consent:"no"});$("#consent_mem").val("no");$.get("/config/cookie.php",{action:"del_session"});} else {$("#cookie_rgpd").slideDown(1000);$.ajax({type:"GET",url:"/config/cookie.php",data:"action=consent&consent=yes",success:function(data){$("#consent_mem").val(data);if (analytics == "on"){}}});}} else if (consent != "no"){} else {$.get("/config/cookie.php",{action:"del_session"});}$("#cookie_notify_ok, #cookie_notify img").click(function(){$("#cookie_notify").slideUp(1000);});$("#cookie_rgpd span").click(function(){var id = $(this).attr("id");var consent = "yes";if (id == "cookie_rgpd_info"){consent = "no";$.get("/config/cookie.php",{action:"del_session"});}$("#cookie_rgpd").slideUp(1000);});}function navigation() {var linkto = "#!/" + $(location).attr("href").replace("https://www.objetoschinos.es/", "");menu_mosaic("#!/pequenos-pinceles-chinos-srub-es-137");$('a').click(function(){$(this).blur();});$("a.lien, area.lien, #ariane a.lien").each(function(){ var text = $(this).attr("href");if (text != "/") { text = text.replace("/objetoschinos.es", "").replace("/", ""); }text = "#!/" + text;text = text.replace("https://www.objetoschinos.es/", "");$(this).attr("href", text);});function nav() {$("#content_middle a.lien, #ariane a.lien").each(function(){ var text = $(this).attr("href");text = "#!/" + text;$(this).attr("href", text);});} var linkto = "#!/" + $(location).attr("href").replace("https://www.objetoschinos.es/", "");menu_mosaic("#!/pequenos-pinceles-chinos-srub-es-137");$('a').click(function(){$(this).blur();});function custom_check(){$.ajax({type: "GET",url: "includes/session.php",data: "action=check_session",cache: false,success: function(data){if (data != "" && $("#id_customer").val() != "" && data != $("#id_customer").val()) {var page_en_cours = window.location.hash.substring(3);if (page_en_cours == "") { page_en_cours = $(location).attr("href").replace("https://www.objetoschinos.es/", ""); }if (page_en_cours == "") { page_en_cours = "/"; }$(location).attr("href", page_en_cours);}}});}$("#searchbar input[type=text]").click(function(){var placeholder = $(this).attr("placeholder");var keyword = $(this).val();if (keyword == placeholder) { $(this).val(""); }});$("#searchbar input[type=text]").blur(function(){var placeholder = $(this).attr("placeholder");var keyword = $(this).val();if (keyword == "" || keyword == " ") { $(this).val(placeholder); }});$("#searchbar").submit(function(){var keyword = $("#searchbar input[type=text]").val();var placeholder = $("#searchbar input[type=text]").attr("placeholder");if (keyword != "" && keyword != placeholder && keyword != " ") {$.ajax({type: "GET",url: "includes/search.php",data: "search="+keyword+"&lang=es",cache: false,success: function(data){data = data.split('[BRK]');if (data[0] == "prod") {$(location).attr("href", data[1]);} else if (data[0] == "mosaic") {if (window.location.hash.substring(3) == "search.html") {$(window).trigger("hashchange");} else {$(location).attr("href", "#!/search.html");}} else {jAlert("No hay resultados para su búsqueda", "Confirmation");}}});}return false;}); $(window).hashchange(function(){var url = window.location.hash.substring(3).replace("https://www.objetoschinos.es/", "");if(url==""){url=$("#page_mem").val().substring(1);}if(url==""){url="/";}var dest = url.indexOf("-es");var dest2 = url.indexOf("blog");var dest2b = url.indexOf("-blog-");var dest3 = url.indexOf("_es.html");var dest4 = url.indexOf("_cates.html");var dest5 = url.indexOf("-rub-es");var dest6 = url.indexOf("-srub-es");var dest7 = url.indexOf("-prod-es");var dest8 = url.indexOf("es-cat-");var dest9 = url.indexOf("es-scat-");var dest10 = window.location.hash.indexOf("#rep");if (url == "/" || url == "es") { var type = "page"; url = "es"; }else if (dest2 >= 0 && dest2b < 0) { var type = "bcat"; url = "home"; }else if (dest3 >= 0) { var type = "blog"; }else if (dest4 >= 0) { var type = "bcat"; }else if (dest5 >= 0) { var type = "cat"; }else if (dest6 >= 0) { var type = "scat"; }else if (dest7 >= 0) { var type = "prod"; }else if (dest8 >= 0) { var type = "cat"; }else if (dest9 >= 0) { var type = "scat"; }else if (dest >= 0) { var type = "page"; }else if (dest10 >= 0) { var type = "faq"; }else { var type = "template"; }var clicpage = url;if (clicpage == "/") {var nextpage = clicpage;} else {var nextpage = "/" + clicpage;}var totalvars = "cookie=jl7n3to4adpiql4vjo8te50d7u&" + type + "=" + url + "&lang=es"; if (clicpage != "#" && type != "faq") {if (!($("#nav_loading").length) && type != "faq") {$("#content_middle").html('
cargar en curso...
');if ($("#menu").is(":visible") && $("#mobile_menu").is(":visible")){ close_mobile_menu(); }var page_top = $("#menu").offset().top;if ($("#mobile_menu").is(":visible")){ page_top = 0; }$("html,body").animate({scrollTop:page_top}, 1000);}$.ajax({type: "GET",url: "includes/content.php",data: totalvars,cache: false,success: function(data){data = data.split('[BRK]');$("#content_middle").hide();$("#content_middle").html(data[0]); $('title').text(data[1]); $(".jqbookmark").attr("title", data[1]); $(".jqbookmark").attr("href", data[2]); var ariane = data[3];if (data[3] == undefined || clicpage == "/") { ariane = ""; }$("#ariane").html(ariane).show(); nav(); menu_mosaic(window.location.hash); $("#content_middle").fadeIn(1000); if (clicpage == "newsletter.html") { news(); } if (clicpage == "login.html") { login(); $("#right").addClass("nopad loginbg"); } else { $("#right").removeClass("nopad loginbg"); } if (clicpage == "register.html") { register(); } if (clicpage == "register2.html") { register(); } if (clicpage == "account.html") { account(); } if (clicpage == "cart.html") { cart(); } if (clicpage == "/") { minislider(); } if (type == "prod") { prod(); } if (clicpage == "customer.html") { customer();if ($("#customer_session").val() == "off") {login();register();} else {address();}}if (clicpage == "customer2.html") { customer2(); } if (clicpage == "info.html") { address(); } if (clicpage == "reviews.html") { reviews(); } if (clicpage == "payment.html") { payment(); } if (clicpage == "repayment.html") { repayment(); } if (type == "scat" || clicpage == "search.html") { scat(); } if (type == "bcat" || type == "blog") { $("#content_middle").parent().addClass("blog_left");$("#content").removeClass().addClass("fond2");$(".blog_right").fadeIn(1000);blog();} else {$("#content_middle").parent().removeClass();$("#content").removeClass().addClass("fond1");$(".blog_right").fadeOut(1000);}_gaq.push(['_trackPageview', nextpage]); gtag('config','AW-1038219113',{'page_path':nextpage});custom_check(); }});}}); if(window.location.hash.substring(3)!= '' && window.location.hash.substring(3)!= '#') {$("#content_middle").html('
cargar en curso...
'); setTimeout('$(window).trigger("hashchange")', 1000); }$("a.lien").click(function () {var lastlink = window.location.hash;var nextlink = $(this).attr('href');if (lastlink == nextlink) {$(window).trigger("hashchange");}});}function blog(){if ($(".blog_texte").length && $("#mobile_menu").is(":visible")) {$(".blog_texte img").attr("style","");}$(".go2comment").click(function(){var slidepoint = parseInt($("#blog_post").offset().top) - 25;$("html,body").animate({scrollTop:slidepoint},500);});$("#blog_post .button button").click(function(){var slidepoint = parseInt($("#com_form").offset().top) - 25;$("html,body").animate({scrollTop:slidepoint},500);});$("#com_form").submit(function(){ if ($("#blog_wait").is(":hidden")) {var msg = "";if ($("#pseudo").val() == ""){msg += "- Insérez votre pseudo.\n";color($("#pseudo"));}if ($("#mail").val() == ""){msg += "- Gracias por apuntar su correo electrónico.\n";color($("#mail"));}if ($("#mail").val() != "") { indexAroba = $("#mail").val().indexOf('@');indexPoint = $("#mail").val().indexOf('.');if ((indexAroba < 0) || (indexPoint < 0)) {msg += "- Gracias por corregir su correo electrónico.\n";color($("#mail"));} }{ var invalidChars = " /:,;'éèàùï"; for (i=0; i -1) {msg += "- Gracias por corregir su correo electrónico.\n";color($("#mail"));} } }{ var atPos = $("#mail").val().indexOf("@",1);if ($("#mail").val().indexOf("@",atPos+1) != -1) { msg += "- Gracias por corregir su correo electrónico.\n";color($("#mail"));} }if ($("#comment").val() == ""){msg += "- Écrivez votre commentaire.\n";color($("#comment"));}if (msg != "") {jAlert("Datos inválidos, gracias por corregirles:\n" + msg, "Mensaje de error:");} else {$("#blog_wait").removeClass("hidden");var blogId = $("#blogId").val();var pseudo = $("#pseudo").val();var email = $("#mail").val().toLowerCase();var comment = $("#comment").val();var lang = $("#lang").val();$.ajax({type:"GET",url:"includes/blog.php",data:"action=submit&blog_id=" + blogId + "&blog_pseudo=" + encodeURIComponent(pseudo) + "&email=" + encodeURIComponent(email) + "&blog_comment=" + encodeURIComponent(comment) + "&lang=" + lang,cache:false,success:function(data){if (data == 1) {jAlert('Presque terminé !
Veuillez confirmer votre commentaire
depuis votre boîte e-mail. Merci.',"Confirmation");$("#pseudo,#mail,#comment").val("");} else {jAlert("Désolé, il semblerait qu'il ait une erreur de programmation.
Veuillez informer le webmaster du message suivant :\n" + data,"Message d'erreur");}$("#blog_wait").addClass("hidden");}});}}return false;});}function color(obj) { $(obj).css('border', "2px #cf8f29 solid"); }function decolor(obj) { $(obj).css('border', "1px transparent solid"); }function couleur(obj) { obj.style.backgroundColor = "#FFFFFF"; }function contact(){rappel();var msg = "";if (document.formulaire_contact.civilite_contact.value == ""){ msg += "Gracias por seleccionar su civilidad.\n";document.formulaire_contact.civilite_contact.style.backgroundColor = "#cf8f29";}if (document.formulaire_contact.nom_contact.value == ""){ msg += "Gracias por apuntar sus apellidos.\n";document.formulaire_contact.nom_contact.style.backgroundColor = "#cf8f29";}if (document.formulaire_contact.prenom_contact.value == ""){ msg += "Gracias por apuntar su nombre.\n";document.formulaire_contact.prenom_contact.style.backgroundColor = "#cf8f29";}if (document.formulaire_contact.mail_contact.value != ""){ indexAroba = document.formulaire_contact.mail_contact.value.indexOf('@');indexPoint = document.formulaire_contact.mail_contact.value.indexOf('.');if ((indexAroba < 0) || (indexPoint < 0)){document.formulaire_contact.mail_contact.style.backgroundColor = "#cf8f29";msg += "Gracias por corregir su correo electrónico.\n";}}else{document.formulaire_contact.mail_contact.style.backgroundColor = "#cf8f29";msg += "Gracias por apuntar su correo electrónico.\n";}{ var invalidChars = " /:,;'éèàùï"; for (i=0; i -1) {msg += "Gracias por corregir su correo electrónico.\n";document.formulaire_contact.mail_contact.style.backgroundColor = "#cf8f29";}}}{ var atPos = document.formulaire_contact.mail_contact.value.indexOf("@",1); if (document.formulaire_contact.mail_contact.value.indexOf("@",atPos+1) != -1) {msg += 'Gracias por corregir su correo electrónico.\n';document.formulaire_contact.mail_contact.style.backgroundColor = "#cf8f29";}}if (document.formulaire_contact.objet_contact.value == ""){ msg += "Por favor, seleccione el objeto de su solicitud.\n";document.formulaire_contact.objet_contact.style.backgroundColor = "#cf8f29";}if (document.formulaire_contact.msgbis_contact.value == ""){ msg += "Escriba su solicitud.\n";document.formulaire_contact.msgbis_contact.style.backgroundColor = "#cf8f29";}if (msg == "") { $("#send1_contact").hide();$("#send2_contact").show();var civilite = $("#civilite_contact").val();var nom = $("#nom_contact").val().toUpperCase();var prenom = $("#prenom_contact").val();var mail = $("#mail_contact").val();var objet = $("#objet_contact").val();var msgbis = $("#msgbis_contact").val();var lang = $("#lang_contact").val();var totalvars = "civilite=" + civilite + "&nom=" + nom + "&prenom=" + prenom + "&mail=" + mail + "&objet=" + objet + "&msgbis=" + msgbis + "&lang=es";$.ajax({type: "POST",url: "includes/contact.php",data: totalvars,cache: false,success: function(msg){ if (msg == 1) {$('#contactshow').hide();$('#ok_contact').fadeIn(500); }}});} else{alert("Datos inválidos, gracias por corregirles:\n"+msg);}return false;}function news() {$('#news_form').find('input').focus(function() { decolor(this); });$('#news_form').find('select').focus(function() { decolor(this); });$('#news_form').find('textarea').focus(function() { decolor(this); });$('#news_nom').focus(function() { if ($(this).val() == "APELLIDOS") { $(this).val(''); } });$('#news_nom').blur(function() { if ($(this).val() == "") { $(this).val("APELLIDOS"); } });$('#news_prenom').focus(function() { if ($(this).val() == "Nombre") { $(this).val(''); } });$('#news_prenom').blur(function() { if ($(this).val() == "") { $(this).val("Nombre"); } else { var part1 = $(this).val().substring(0, 1).toUpperCase(); var part2 = $(this).val().substring(1); $(this).val(part1+part2); } });$('#news_email').focus(function() { if ($(this).val() == "correo electrónico") { $(this).val('').focus(); } });$('#news_email').blur(function() { if ($(this).val() == "") { $(this).val("correo electrónico"); } });if ($('#mail_news').val() != "Mi correo electrónico") {var email = $("#mail_news").val();$('#news_email').val(email);$("#mail_news").val("Mi correo electrónico");}$("#news_submit").find("a").click(function(){$("#form_news").submit();return false;});$("#form_news").submit(function(){ var msg = ""; if ($("#news_civilite_bug").val() == "") { msg += "Gracias por seleccionar su civilidad.\n";color($("#news_civilite_bug"));}if ($("#news_nom").val() == "APELLIDOS") { msg += "Gracias por apuntar sus apellidos.\n";color($("#news_nom"));}if ($("#news_prenom").val() == "Nombre") { msg += "Gracias por apuntar su nombre.\n";color($("#news_prenom"));}if ($("#news_email").val() == "correo electrónico") { msg += "Gracias por apuntar su correo electrónico.\n";color($("#news_email"));}if ($("#news_email").val() != "correo electrónico") { indexAroba = $("#news_email").val().indexOf('@');indexPoint = $("#news_email").val().indexOf('.');if ((indexAroba < 0) || (indexPoint < 0)) {msg += "Gracias por corregir su correo electrónico.\n";color($("#news_email"));} }{ var invalidChars = " /:,;'éèàùï"; for (i=0; i -1) {msg += "Gracias por corregir su correo electrónico.\n";color($("#news_email"));} } }{ var atPos = $("#news_email").val().indexOf("@",1); if ($("#news_email").val().indexOf("@",atPos+1) != -1) { msg += "Gracias por corregir su correo electrónico.\n";color($("#news_email"));} }if ($("#news_spam").val() == "" || $("#news_spam").val() != "10") { msg += "Por favor complete el campo anti-spam.\n";color($("#news_spam"));}if (msg != "") { jAlert("Datos inválidos, gracias por corregirles:\n" + msg, "Mensaje de error:");} else {$('#news_submit').hide(); $('#news_wait').show();var civilite = $("#news_civilite_bug").val(); var nom = $("#news_nom").val().toUpperCase(); var prenom = $("#news_prenom").val(); var mail = $("#news_email").val(); var totalvars = "action=confirmation&civilite=" + civilite + "&nom=" + encodeURIComponent(nom) + "&prenom=" + encodeURIComponent(prenom) + "&mail=" + encodeURIComponent(mail) + "&lang=es";$.ajax({ type: "GET", url: "includes/newsletter.php", data: totalvars, cache: false, success: function(data){ alert(data);if(data==1) { jAlert("¡Ya subscribió!", "Mensaje de error:");} else if (data==0) { $("#news_spam").val(''); jAlert('¡Casi hecho!
Gracias por confirmar su subscripción
desde su buzón de correo.
', 'Confirmación:');} $('#news_submit').show(); $('#news_wait').hide(); }});}return false;});}function footer(){$("#signature").html('');if(window.opera) {if ($("a.jqbookmark").attr("rel") != ""){$("a.jqbookmark").attr("rel","sidebar");}}$("a.jqbookmark").click(function(event){event.preventDefault();var url = this.href;var title = this.title;if ($.browser.mozilla) {window.sidebar.addPanel(title, url,"");} else if($.browser.msie) {window.external.AddFavorite(url, title);} else {jAlert("Presione", "Aviso:");}return false;});$("#mail_news, #news_go").focus(function(){ if ($(this).val() == "Mi correo electrónico") {$(this).val('');}});$("#mail_news, #news_go").blur(function(){ if ($(this).val() == "") {$(this).val("Mi correo electrónico");}});$("#footer_news_form").submit(function(){ $(location).attr("href", "#!/newsletter.html");$("#mail_news").blur();return false;});$("#news_go2").click(function(){ if ($("#news_go").val() != "Mi correo electrónico") {email = $("#news_go").val();setTimeout(function(){$("#news_email").val(email);$("#news_go").val('');}, 1000);}});}function prod() {$('.cloud-zoom, .cloud-zoom-gallery').CloudZoom();var product_id = $("#id_product").val();var lang = "es";$.get("includes/autosuggest.php", { action:"add", product_id:product_id, lang:lang } );$("#add_to_cart").click(function(){var id_product = $("#id_product").val();var size = $("#size").val();var qte = $("#qte").val();var lang = "es";var add_check = $("#add_check").val();var cookie = "jl7n3to4adpiql4vjo8te50d7u";var customer = $("#customer_session").val();if (add_check == "on") { $("#add_check").val("off"); $.ajax({type: "POST",url: "includes/cart.php",data: "id_product=" + encodeURIComponent(id_product) + "&size=" + encodeURIComponent(size) + "&qte=" + encodeURIComponent(qte) + "&lang=" + encodeURIComponent(lang) + "&action=add_to_cart&cookie=" + encodeURIComponent(cookie),success: function(data){$('html, body').animate({scrollTop:0}, 500); var largeImg = $("#largeImg").attr("src"); $("#pix_flight").html('');setTimeout(function(){var left_width = $("#left").width();var right_width = $("#right").width();var window_width = $(window).width();var margin_width = parseInt(window_width - left_width - right_width - 60)/2;if (parseInt(margin_width) < 0) { margin_width = 0; }var left_poz = parseInt(right_width + margin_width) - 45;if ($("#photoV").length) {$("#pix_flight").css({"top":"58px", "left":"180px", "width":"320px", "height":"479px"}).show().animate({top:'-180px', left:left_poz+'px', width:'0px', height:'0px'},{duration:1500});} else {$("#pix_flight").css({"top":"58px", "left":"78px", "width":"500px", "height":"334px"}).show().animate({top:'-180px', left:left_poz+'px', width:'0px', height:'0px'},{duration:1500});}}, 500);setTimeout(function(){ $("#pix_flight").hide(); }, 2100); setTimeout(function(){ cart_update("change"); }, 2000);if (data == "stop") { $("#dbc").html('');$("#qte").attr("disabled", "disabled");$("#size").html('');$("#size").attr("disabled", "disabled");} else {setTimeout(function(){ update_size(); }, 2500);}setTimeout(function(){ $("#add_check").val("on"); }, 2500); }}); } }); $("#size").change(function(){update_qte();});function update_qte(){var id_product = $("#id_product").val();var size = $("#size").val();var qte = $("#qte").val();var lang = "es";var cookie = "jl7n3to4adpiql4vjo8te50d7u";if (size != "" && qte != 0) {$.ajax({type: "POST",url: "includes/cart.php",data: "id_product=" + encodeURIComponent(id_product) + "&size=" + encodeURIComponent(size) + "&lang=" + encodeURIComponent(lang) + "&action=update_qte&cookie=" + encodeURIComponent(cookie),success: function(data){$("#qte").html(data);}}); }} update_qte(); function update_size(){var id_product = $("#id_product").val();var lang = "es";var size = $("#size").val();var cookie = "jl7n3to4adpiql4vjo8te50d7u";$.ajax({type: "POST",url: "includes/cart.php",data: "id_product=" + encodeURIComponent(id_product) + "&lang=" + encodeURIComponent(lang) + "&action=update_size&cookie=" + encodeURIComponent(cookie),success: function(data){if (size != "onesize") { $("#size").html(data); }update_qte();}}); } } function login() {function logincheck(){$('#mail').click(function() { if ($(this).val() == 'correo electrónico') { $(this).val(''); }});$('#mdp_display').click(function() {$('#mdp').show().focus();$(this).hide();});$('#mail').blur(function() {$('#mdp').show().focus();$('#mdp_display').hide();if ($(this).val() != '') {var test = $("#mail").val();$.ajax({type: "POST",url: "includes/login.php",data: "mail=" + test + "&action=checkmail&lang=es",success: function(msg){if(msg==1) { $('#mail_ok').show(); $('#mail_error').hide(); } else { if (test != "") { $('#mail_error').show(); $('#mail_ok').hide(); } }}});}if ($(this).val() == '') { $(this).val('correo electrónico'); } });$('#mdp').blur(function() {if ($(this).val() != '') {var test1 = $("#mail").val();var test2 = $("#mdp").val();$.ajax({type: "POST",url: "includes/login.php",data: "mail=" + test1 + "&pass=" + test2 + "&action=checkpass&lang=es",success: function(msg){if(msg==1) { $('#mdp_ok').show(); $('#mdp_error').hide(); } else { if (test2 != "") { $('#mdp_error').show(); $('#mdp_ok').hide();}}}});}if ($(this).val() == '') { $('#mdp_display').show(); $(this).hide(); }});$('#login_auto').find('img').click(function(){if ($(this).attr('id') == 'login_box1') {$('#login_box1').hide();$('#login_box2').show();$('#autologin').val('yes');} else {$('#login_box1').show();$('#login_box2').hide();$('#autologin').val('no');}});$('#login').submit(function() {var test1 = $("#mail").val();var test2 = $("#mdp").val();var auto = $("#autologin").val();var totalvars = "mail=" + encodeURIComponent(test1) + "&pass=" + encodeURIComponent(test2) + "&autologin=" + auto + "&action=login&lang=es";if ($('#mail').val() != '' && $('#mdp').val() != '') {$.ajax({type: "POST",url: "includes/login.php",data: totalvars,success: function(data){ data = data.split("[BRK]"); if (data[0] == 1 && data[4] == "off"){ var page_en_cours = $(location).attr("href").replace("https://www.objetoschinos.es/", "").replace("#!/", ""); if (page_en_cours == "customer.html" || window.location.hash.substring(3) == "customer.html") { if (parseInt(data[1]) > 0) {$(location).attr("href", "#!/cart.html");jAlert("Por favor, verifique su cesta.
Se han añadido productos desde la última visita", "Información"); } else {$("#customer_disconnected").hide(); $("#customer_connected").fadeIn(1000); address_list("shipping"); address_list("billing"); address_recup("shipping", 0); address_recup("billing", 0); } } else { $(location).attr("href", "#!/account.html");} $("#cart_price").html(data[2]); $("#cart_number,#mobile_number").html(data[3]); if (parseInt(data[3]) > 1) { $("#cart_plurial").html("productos:"); } $("#logout_link").attr("href", "includes/logout.php?mail="+test1); if ($("#mobile_menu").is(":hidden")){ $("#logout_link").show(); } $("#register_link").hide(); $("#customer_session").val("on"); if (data[4] == "on") {} $("#id_customer").val(data[5]);} else if (data[0] == 1 && data[4] == "on"){jAlert("Usted será redirigido a la versión distribuidor del sitio web.","Información"); setTimeout(function(){ window.location.href = "https://www.asiadecoration.com/includes/login.php?action=loginpro&mail="+test1+"&pass="+test2+"&autologin="+auto; },5000);} }});}return false;});}logincheck(); $("#login_oubli").colorbox({inline:true, href:"#password"});$("#login_oubli").click(function() { $("#password_part1").show();$("#password_part2").hide();$("#password_mail").val('');$("#password_new").val('');$("#password_conf").val('');$("#password_send").show();$("#password_wait").hide();}); $("#password_form").find('input[type=text]').focus(function() {$(this).css("background-color", "#ffffff");});$("#password_form").find('input[type=password]').focus(function() {$(this).css("background-color", "#ffffff");});$("#password_send").click(function() { var msg = "";var mail = $("#password_mail").val();if ($("#password_mail").is(':visible')){ if ($("#password_mail").val() == ""){ msg += "Selecciona su correo electrónico.\n";$("#password_mail").css("background-color", "#cf8f29");}if ($("#password_mail").val() != ""){ indexAroba = $("#password_mail").val().indexOf('@');indexPoint = $("#password_mail").val().indexOf('.');if ((indexAroba < 0) || (indexPoint < 0)){msg += "Su correo electrónico no está valido.\n";$("#password_mail").css("background-color", "#cf8f29");} }{ var atPos = $("#password_mail").val().indexOf("@",1); if ($("#password_mail").val().indexOf("@",atPos+1) != -1) { msg += "Su correo electrónico no está valido.\n";$("#password_mail").css("background-color", "#cf8f29");} }}if ($("#password_new").val() == ""){msg += "Por favor, ingrese una nueva contraseña.\n";$("#password_new").css("background-color", "#cf8f29");}if ($("#password_conf").val() == "") { msg += "Por favor, confirme su nueva contraseña.\n";$("#password_conf").css("background-color", "#cf8f29");}if ($("#password_conf").val() != $("#password_new").val()){ msg += "Las contraseñas no coinciden.\n";$("#password_new").css("background-color", "#cf8f29");$("#password_conf").css("background-color", "#cf8f29");}var mail = $("#password_mail").val();var mdp = $("#password_new").val();if (msg == "") { $("#password_send").hide();$("#password_wait").show();totalvars = "mail=" + encodeURIComponent(mail) + "&password=" + encodeURIComponent(mdp) + "&lang=es";$.ajax({type: "POST",url: "includes/login.php",data: totalvars,cache: false,success: function(data){if (data == 1) { $.colorbox.close();jAlert("Usted no está registrado/a en nuestra base de datos.
Por favor, intente con otro correo electrónico
o contáctenos por correo electrónico.", "Aviso de noticia");$("#password_send").show();$("#password_wait").hide();} else if (data == 2) { $("#password_part1").hide();$("#password_part2").fadeIn(1000);setTimeout('$("#password_send").show()', 2000);setTimeout('$("#password_wait").hide()', 2000);}}});} else { jAlert("Por favor, corrija los datos inválidos.:\n"+msg, "Aviso de noticia");}return false;});}function decolor2(obj) { $(obj).css('border', "1px #cccccc solid"); }function register(){var page_en_cours = $(location).attr("href").replace("https://www.objetoschinos.es/", "").replace("http://localhost/objetoschinos.es/", "");if (page_en_cours == "register.html" || window.location.hash.substring(3) == "register.html" || page_en_cours == "register2.html" || window.location.hash.substring(3) == "register2.html") {$("#register_pro").show();$("#registerbox").css("min-height", "330px");}$('#registerbox').find('input[type=text]').focus(function() { decolor2(this); });$('#registerbox').find('select').focus(function() { decolor2(this); });$('#register_surname').focus(function() { if ($(this).val() == "APELLIDOS") { $(this).val(''); } });$('#register_surname').blur(function() { if ($(this).val() == "") { $(this).val("APELLIDOS"); } });$('#register_name').focus(function() { if ($(this).val() == "Nombre") { $(this).val(''); } });$('#register_name').blur(function() { if ($(this).val() == "") { $(this).val("Nombre"); } else { var part1 = $(this).val().substring(0, 1).toUpperCase(); var part2 = $(this).val().substring(1); $(this).val(part1+part2); } });$('#register_country').change(function() { if ($(this).val() != "FR") {$("#register_tel2, #register_zip2,#register_dob2").unmask();} else {$("#register_tel2").mask("99 99 99 99 99");$("#register_zip2").mask("99999");$("#register_dob2").mask("99/99/9999");}});$('#register_tel').focus(function() { $(this).hide(); $("#register_tel2").show().focus(); });$('#register_tel2').blur(function() { if ($(this).val() == "__ __ __ __ __" || $(this).val() == "") { $(this).hide(); $("#register_tel").show(); } });$('#register_dob').focus(function() { $(this).hide(); $("#register_dob2").show().focus(); });$('#register_dob2').blur(function() { if ($(this).val() == "__/__/____" || $(this).val() == "") { $(this).hide(); $("#register_dob").show(); } });$('#register_address').focus(function() { if ($(this).val() == "LINEA 1 DE DIRECCION") { $(this).val(''); } });$('#register_address').blur(function() { if ($(this).val() == "") { $(this).val("LINEA 1 DE DIRECCION"); } });$('#register_comp').focus(function() { if ($(this).val() == "LINEA 2 DE DIRECCION") { $(this).val(''); } });$('#register_comp').blur(function() { if ($(this).val() == "") { $(this).val("LINEA 2 DE DIRECCION"); } });$('#register_zip').focus(function() { $(this).hide(); $("#register_zip2").show().focus(); });$('#register_zip2').blur(function() { if ($(this).val() == "_____" || $(this).val() == "") { $(this).hide(); $("#register_zip").show(); } });$('#register_city').focus(function() { if ($(this).val() == "CIUDAD") { $(this).val(''); } });$('#register_city').blur(function() { if ($(this).val() == "") { $(this).val("CIUDAD"); } });$('#register_email').focus(function() { if ($(this).val() == "correo electrónico") { $(this).val(''); } });$('#register_email').blur(function() { if ($(this).val() == "") { $(this).val("correo electrónico"); } });$('#register_pass').focus(function() { $(this).hide(); $("#register_pass2").show().focus(); $("#pass_eye").show(); });$('#register_pass2').blur(function() { if ($(this).val() == "") { $(this).hide(); $("#register_pass").show(); } });$('#register_pass2').keyup(function() { var pass = $(this).val(); $("#register_pass_view").val(pass); });$("#pass_eye").hover(function () {if ($("#register_pass2").val() != "") { $("#register_pass2").hide(); $("#register_pass_view").show(); }}, function () {if ($("#register_pass2").val() != "") { $("#register_pass_view").hide(); $("#register_pass2").show(); }});$('#register_company').focus(function() { if ($(this).val() == "EMPRESA") { $(this).val(''); } });$('#register_company').blur(function() { if ($(this).val() == "") { $(this).val("EMPRESA"); } });$('#register_siret').focus(function() { if ($(this).val() == "CIF/NIF") { $(this).val(''); } });$('#register_siret').blur(function() { if ($(this).val() == "") { $(this).val("CIF/NIF"); } });$('#register_box1').click(function() { if ($(this).attr('src') == "template/webtao/images/login_box1.jpg") {$(this).attr('src', 'template/webtao/images/login_box2.jpg');$('#register_box2').attr('src', 'template/webtao/images/login_box1.jpg');$('#register_reseller').val('no');$('#register_validation').val('yes');$('#registerbox').css("height", "335px");$("#register_pro_input, #customer_welcome_pro").hide();decolor2($("#register_company"));decolor2($("#register_siret"));}});$('#register_box2').click(function() { if ($(this).attr('src') == "template/webtao/images/login_box1.jpg") {$(this).attr('src', 'template/webtao/images/login_box2.jpg');$('#register_box1').attr('src', 'template/webtao/images/login_box1.jpg');$('#register_reseller').val('yes');$('#register_validation').val('no');$('#registerbox').css("height", "365px");$("#register_pro_input, #customer_welcome_pro").show();}});$('#register_box3').click(function() { if ($(this).attr('src') == "template/webtao/images/login_box1.jpg") {$(this).attr('src', 'template/webtao/images/login_box2.jpg');$('#register_news').val('on');} else {$(this).attr('src', 'template/webtao/images/login_box1.jpg');$('#register_news').val('off');}});$("#register").submit(function(){ var msg = ""; if ($("#register_civility").val() == "") { msg += "Gracias por seleccionar su civilidad.\n";color($("#register_civility"));}if ($("#register_surname").val() == "APELLIDOS") { msg += "Gracias por apuntar sus apellidos.\n";color($("#register_surname"));}if ($("#register_name").val() == "Nombre") { msg += "Gracias por apuntar su nombre.\n";color($("#register_name"));}if ($("#register_tel2").val() == "" || $("#register_tel2").val() == "__ __ __ __ __") { msg += "Gracias por apuntar su número de teléfono.\n";color($("#register_tel"));}if ($("#register_dob2").val() == "" || $("#register_dob2").val() == "__/__/____") { msg += "Por favor, añada su fecha de nacimiento.\n";color($("#register_dob"));}if ($("#register_address").val() == "LINEA 1 DE DIRECCION") { msg += "Por favor, añada su dirección.\n";color($("#register_address"));}if ($("#register_zip2").val() == "") { msg += "Por favor, añada su código postal.\n";color($("#register_zip"));}if ($("#register_city").val() == "CIUDAD") { msg += "Por favor, añada su ciudad.\n";color($("#register_city"));}if ($("#register_email").val() == "e-mail") { msg += "Gracias por apuntar su correo electrónico.\n";color($("#register_email"));}if ($("#register_email").val() != "e-mail") { indexAroba = $("#register_email").val().indexOf('@');indexPoint = $("#register_email").val().indexOf('.');if ((indexAroba < 0) || (indexPoint < 0)) {msg += "Gracias por corregir su correo electrónico.\n";color($("#register_email"));} }{ var invalidChars = " /:,;'éèàùï"; for (i=0; i -1) {msg += "Gracias por corregir su correo electrónico.\n";color($("#register_email"));} } }{ var atPos = $("#register_email").val().indexOf("@",1); if ($("#register_email").val().indexOf("@",atPos+1) != -1) { msg += "Gracias por corregir su correo electrónico.\n";color($("#register_email"));} }if ($("#register_pass2").val() == "") { msg += "Por favor, añada su contraseña.\n";color($("#register_pass"));}if ($("#register_pro_input").is(":visible")) {if ($("#register_company").val() == "EMPRESA") { msg += "Por favor, añada el nombre de su empresa.\n";color($("#register_company"));}if ($("#register_siret").val() == "CIF/NIF") { msg += "Por favor, añada el CIF/NIF de su empresa.\n";color($("#register_siret"));}}if ($("#register_source").val() == "") { msg += "Por favor, indique cómo se enteró ObjetosChinos.es.\n";color($("#register_source"));}if (msg != "") { jAlert("Datos inválidos, gracias por corregirles:\n" + msg, "Mensaje de error:");} else {$('#register_submit').hide(); $('#register_wait').show();var civility = $("#register_civility").val(); var surname = $("#register_surname").val().toUpperCase(); var name = $("#register_name").val(); var country = $("#register_country").val(); var tel = $("#register_tel2").val(); var dob = $("#register_dob2").val(); var address = $("#register_address").val().toUpperCase(); var comp = $("#register_comp").val().toUpperCase(); if (comp == "LINEA 2 DE DIRECCION") { comp = ""; } var zip = $("#register_zip2").val().toUpperCase(); var city = $("#register_city").val().toUpperCase(); var email = $("#register_email").val().toLowerCase(); var pass = $("#register_pass2").val(); var company = $("#register_company").val().toUpperCase(); if (company == "EMPRESA") { company = ""; } var siret = $("#register_siret").val(); if (siret == "CIF/NIF") { siret = ""; } var source = $("#register_source").val(); var newsletter = $("#register_news").val(); var reseller = $("#register_reseller").val(); var validation = $("#register_validation").val(); var confirmation = "yes"; var page_en_cours = $(location).attr("href").replace("https://www.objetoschinos.es/", "").replace("http://localhost/objetoschinos.es/", ""); if (page_en_cours == "register2.html" || window.location.hash.substring(3) == "register2.html") { confirmation = "no"; }var totalvars = "civility=" + civility + "&surname=" + encodeURIComponent(surname) + "&name=" + encodeURIComponent(name) + "&country=" + encodeURIComponent(country) + "&tel=" + encodeURIComponent(tel) + "&dob=" + encodeURIComponent(dob) + "&address=" + encodeURIComponent(address) + "&comp=" + encodeURIComponent(comp) + "&zip=" + encodeURIComponent(zip) + "&city=" + encodeURIComponent(city) + "&email=" + encodeURIComponent(email) + "&pass=" + encodeURIComponent(pass) + "&company=" + encodeURIComponent(company) + "&siret=" + encodeURIComponent(siret) + "&source=" + encodeURIComponent(source) + "&newsletter=" + encodeURIComponent(newsletter) + "&reseller=" + encodeURIComponent(reseller) + "&validation=" + encodeURIComponent(validation) + "&confirmation=" + encodeURIComponent(confirmation) + "&action=new_customer&lang=es";$.ajax({ type: "POST", url: "includes/register.php", data: totalvars, cache: false, success: function(data){if (data == "stop") {jAlert("¿Ya usted tiene una cuenta?
Por favor, regístrese.", "Confirmación:");$('#register_submit').show();$('#register_wait').hide();} else if (data == 1) {if (page_en_cours == "customer.html" || window.location.hash.substring(3) == "customer.html") { $("#customer_disconnected").hide();$("#customer_connected").fadeIn(1000);$.ajax({ type: "GET", url: "includes/address_bug.php", data: totalvars, cache: false, success: function(data){ if (data == 1) { setTimeout('address()', 500); } } });} else {$("#customer_disconnected").hide();$("#customer_welcome").fadeIn(1000); } $("#customer_session").val("on"); $("#logout_link").attr("href", "includes/logout.php?mail="+email).show(); $("#register_link").hide(); } else {$('#register_submit').show();$('#register_wait').hide();} } });}return false;});}function cart() {var popcart = $("#popcart_mem").val();var popcartmob = $("#popcartmob_mem").val();if (popcartmob == "yes" && $("#mobile_menu").is(":visible")){$.colorbox({inline:true,href:''});} else if (popcart == "yes"){$.colorbox({inline:true,href:''});}check_lettremax();check_paquetprio();check_postexport();$(".cart_trash").click(function(){var line = $(this).attr("alt").replace("trash", "");var price_delete = $("#line_total"+line).html().replace(" €", "");var cart_qty = $("#cart_number").html();var qty_delete = $("#cart_qty"+line).html();var order_total = $("#cart_total span").html().replace(" €", "");var cart_total = $("#cart_price").html();var cart_shipping = $("#cart_shipping").html().replace(" €", "");var cart_discount = $("#cart_discount_result").html().replace(" €","");order_total = parseFloat(order_total) - parseFloat(price_delete);cart_total = parseFloat(cart_total) - parseFloat(price_delete);cart_qty = parseInt(cart_qty) - parseInt(qty_delete);if (cart_qty == 0) { cart_total = parseFloat(cart_total) - parseFloat(cart_discount); }jConfirm("¿Usted está seguro suprimir este producto de su cesta?", "Confirmación", function(answer){if(answer){$("#cart_tr"+line).fadeOut(1000); $("#cart_total span").html(order_total.toFixed(2) + " €"); $("#cart_number,#mobile_number").html(cart_qty); $("#cart_price").html(cart_total.toFixed(2)); if (cart_qty == 1 || cart_qty == 0) { $("#cart_plurial").html("producto:"); } if ($("#cart_price").html() == "-0.00") { $("#cart_price").html("0.00"); }if (cart_qty == 0) {$("#cart_show,#mobile_number").hide(); $("#cart_hide").fadeIn(500); }$.ajax({type: "POST",url: "includes/cart.php",data: "id_product=" + encodeURIComponent(line) + "&lang=es" + "&action=cart_delete",success: function(data){data = data.split("[BRK]");$("#check_lettremax").val(data[0]);check_lettremax();$("#check_postexport").val(data[1]);check_postexport();$("#check_paquetprio").val(data[2]);check_paquetprio();if ($("#cart_discount_line").is(":visible")) {var cart_discount = $("#cart_discount_result").html().replace(" €","");var cart_total = $("#cart_total span").html().replace(" €","");cart_total = parseFloat(cart_total) - parseFloat(cart_discount);$("#cart_total span").html(cart_total.toFixed(2)+" €");}$("#cart_discount_form").submit();}});}});});$(".cart_checkbox").click(function(){var status = $(this).attr("src");var transport = $(this).next().attr("alt");if (status == "template/webtao/images/box1.png") {$(".cart_checkbox").attr("src", status);$(this).attr("src", status.replace("box1", "box2"));shipping(transport);}});if ($("#cart_zone").val() == "EUR" && $("#cart_country select").val() != "FR") {$("#cart_transport_lettremax").hide();$("#cart_transport_chronopost").hide();if ($("#cart_session").val() == "off") { shipping("socolissimo"); }}if ($("#cart_zone").val() == "OM1") {$("#cart_transport_socolissimo").show();if ($("#cart_session").val() == "off") { shipping("socolissimo"); }}var counter = 0;var checkbox = "off";var first_transport = "";$(".cart_transport_wrap").each(function(){if ($(this).is(":visible")){var company = $(this).find(".cart_company").attr("alt");var status = $(this).find(".cart_checkbox").attr("src");counter = parseInt(counter) + 1;if (counter == 1) { first_transport = company; }if (checkbox == "off" && status == "template/webtao/images/box2.png") { checkbox = "on"; }}});if (checkbox == "off") { $("#cart_transport_"+first_transport).find(".cart_checkbox").click(); }$(".cart_company").click(function(){var status = $(this).prev().attr("src");var transport = $(this).attr("alt");if (status == "template/webtao/images/box1.png") {$(".cart_checkbox").attr("src", status);$(this).prev().attr("src", status.replace("box1", "box2"));shipping(transport);}});$("#cart_country select").change(function(){decolor2(this); var zone = $(this.options[this.selectedIndex]).parent().attr('label');zone = zone.replace(" --", "").replace("-- ", "");var country = $(this).val();$(".cart_transport_wrap").hide();$(".cart_checkbox").attr("src", "template/webtao/images/box1.png");$("#cart_zone").val(zone);if (zone == "EUROPA" && country == "FR") {$("#cart_transport_socolissimo, #cart_transport_chronopost").show();check_lettremax();} else if (zone == "EUROPA") {$("#cart_transport_socolissimo, #cart_transport_dhl, #cart_transport_fedex").show();check_postexport();} else if (zone == "ULTRAMAR 1" || zone == "ULTRAMAR 2") {$("#cart_transport_socolissimo").show();check_lettremax();} else if (zone == "RESTO DEL MUNDO") {$("#cart_transport_dhl, #cart_transport_fedex").show();check_postexport();check_paquetprio();}});$("#cart_discount_form").submit(function(){var code = $("#cart_discount_code").val().toUpperCase();var cart_total = $("#cart_total span").html().replace(" €","");var cart_discount = $("#cart_discount_result").html().replace(" €","");var cart_shipping = $("#cart_shipping").html().replace(" €","");var cart_price = parseFloat(cart_total) - parseFloat(cart_shipping);cart_price = cart_price.toFixed(2);var cart_content = "on"; if ($("#cart_show").is(":hidden")) { var cart_content = "off"; }if (code != "") {$.ajax({type:"GET",url:"includes/session.php",data:"code=" + encodeURIComponent(code) +"&cart_total=" + encodeURIComponent(cart_total) +"&cart_price=" + encodeURIComponent(cart_price) +"&cart_discount=" + encodeURIComponent(cart_discount) +"&cart_content=" + encodeURIComponent(cart_content) + "&action=discount",success:function(data){data = data.split("[BRK]");if (data[0] == "on") {var topcart = parseFloat(data[2]) - parseFloat(cart_shipping);$("#cart_price").html(topcart.toFixed(2));$("#cart_discount_result").html(data[1]+" €");$("#cart_total span").html(data[2]+" €");if ($("#cart_discount_line").is(":hidden")) {$("#cart_discount_line").show();$("#cart_discount_form").hide();jAlert("Código promocional aceptado", "Confirmación");}} else if (data[0] == "expired" || data[0] == "inactive"){if (data[0] == "expired") { jAlert("Código promocional caducado", "Mensaje de error"); } else { jAlert("Código promocional inactivo", "Mensaje de error"); }$("#cart_discount_code").val("");if ($("#cart_discount_line").is(":visible")) {$("#cart_price").html(cart_price);$("#cart_discount_result").html(data[1]+" €");$("#cart_total span").html(data[2]+" €");$("#cart_discount_line").hide();$("#cart_discount_form").show();}} else if (data[0] == "off"){if ($("#cart_show").is(":visible")) { jAlert("Código de promoción no válido", "Mensaje de error"); }$("#cart_discount_code").val("");if ($("#cart_discount_line").is(":visible")) {$("#cart_price").html(cart_price);$("#cart_discount_result").html(data[1]+" €");$("#cart_total span").html(data[2]+" €");$("#cart_discount_line").hide();$("#cart_discount_form").show();}}}});}return false;});if ($("#cart_discount_line").is(":visible")) {var cart_discount = $("#cart_discount_result").html().replace(" €","");var cart_total = $("#cart_total span").html().replace(" €","");cart_total = parseFloat(cart_total) - parseFloat(cart_discount);$("#cart_total span").html(cart_total.toFixed(2)+" €");$("#cart_discount_form").submit();}} function check_lettremax(){ var transport = $("#cart_transport").val();zone = $("#cart_zone").val();if (($("#cart_country select").val() == "FR" || zone == "ULTRAMAR 1" || zone == "OM1" || zone == "ULTRAMAR 2" || zone == "OM2") && $("#check_lettremax").val() == "on") {$("#cart_transport_lettremax").show();$(".cart_checkbox").attr("src", "template/webtao/images/box1.png");if (($("#cart_country select").val() == "FR" && $("#cart_session").val() == "off" && transport != "lettremax") || zone == "ULTRAMAR 1" || zone == "OM1") {$("#cart_transport_lettremax .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping("lettremax");} else {if (transport == "lettremax") {$("#cart_transport_lettremax .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping("lettremax");} else if (transport == "socolissimo") {$("#cart_transport_socolissimo .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping("socolissimo");} else {$("#cart_transport_lettremax .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping("lettremax");}}} else if (($("#cart_country select").val() == "FR" || zone == "ULTRAMAR 1") && $("#check_lettremax").val() == "off") {$(".cart_checkbox").attr("src", "template/webtao/images/box1.png");$("#cart_transport_"+transport+" .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping(transport);}} function check_postexport(){var transport = $("#cart_transport").val();zone = $("#cart_zone").val();if ($("#cart_country select").val() != "FR" && (zone == "EUROPA" || zone == "EUR" || zone == "RESTO DEL MUNDO" || zone == "WLD") && $("#check_postexport").val() == "on") {$("#cart_transport_postexport").show();$(".cart_checkbox").attr("src", "template/webtao/images/box1.png");if ($("#cart_session").val() == "off" && transport != "postexport") {if ($("#cart_country select").val() != "MC" && $("#cart_country select").val() != "AD") {$("#cart_transport_postexport .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping("postexport");} else {$("#cart_transport_dhl .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping("dhl");}} else {if ($("#cart_country select").val() != "MC" && $("#cart_country select").val() != "AD") { if (transport == "postexport") {$("#cart_transport_postexport .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping("postexport");} else if (transport == "socolissimo") {$("#cart_transport_socolissimo .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping("socolissimo");} else if (transport == "dhl") {$("#cart_transport_dhl .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping("dhl");} else if (transport == "fedex") {$("#cart_transport_fedex .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping("fedex");} else {$("#cart_transport_postexport .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping("postexport");}} else {$("#cart_transport_dhl .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping("dhl");$("#cart_transport_postexport").hide();}}} else if ($("#cart_country select").val() != "FR" && (zone == "EUROPA" || zone == "EUR") && $("#check_postexport").val() == "off") {$(".cart_checkbox").attr("src", "template/webtao/images/box1.png");if (transport == "postexport") {$("#cart_transport_postexport .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping("postexport");} else if (transport == "socolissimo") {$("#cart_transport_socolissimo .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping("socolissimo");} else if (transport == "dhl") {$("#cart_transport_dhl .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping("dhl");} else {$("#cart_transport_socolissimo .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping("socolissimo");}} else if ($("#cart_country select").val() != "MC" && $("#cart_country select").val() != "AD" && (zone == "RESTO DEL MUNDO" || zone == "WLD") && $("#check_postexport").val() == "off") {$(".cart_checkbox").attr("src", "template/webtao/images/box1.png");if (transport == "postexport") {$("#cart_transport_postexport .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping("postexport");} else if (transport == "dhl") {$("#cart_transport_dhl .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping("dhl");} else if (transport == "fedex") {$("#cart_transport_fedex .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping("fedex");} else {$("#cart_transport_dhl .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping("dhl");}} else if ($("#cart_country select").val() == "MC" || $("#cart_country select").val() == "AD") {$("#cart_transport_dhl .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping("dhl");}} function check_paquetprio(){ zone = $("#cart_zone").val();if ((zone == "RESTO DEL MUNDO" || zone == "WLD") && $("#check_paquetprio").val() == "on") {$("#cart_transport_paquetprio").show();if ($("#check_postexport").val() == "off") {$(".cart_checkbox").attr("src", "template/webtao/images/box1.png");$("#cart_transport_paquetprio .cart_checkbox").attr("src", "template/webtao/images/box2.png");shipping("paquetprio");}}setTimeout(function(){ $("#cart_session").val("on"); }, 1500);} function shipping(transport){$("#cart_transport").val(transport);var zone = $("#cart_zone").val();var country = $("#cart_country select").val();var lang = "es";var total_price = $("#cart_price").html(); $.ajax({type: "POST",url: "includes/cart.php",data: "transport=" + encodeURIComponent(transport) + "&country=" + encodeURIComponent(country) + "&total_price=" + encodeURIComponent(total_price) + "&zone=" + encodeURIComponent(zone) + "&lang=" + encodeURIComponent(lang) + "&action=update_shipping",success: function(data){data = data.split('[BRK]');var port = $("#cart_shipping").html().replace(" €", "");var total = $("#cart_total span").html().replace(" €", "");total = parseFloat(total) + parseFloat(data[0]) - parseFloat(port);$("#cart_shipping").html(data[0] +" €");$("#cart_total span").html(total.toFixed(2) +" €");$("#cart_total span").animate({backgroundColor:'#df1415'}, 250);setTimeout(function(){ $("#cart_total span").animate({backgroundColor:'#320001'}, 1500); }, 250);$("#shipping_time span").html(data[1]);$("#cart_transport_lettremax p").html(data[2] + " €");$("#cart_transport_colissimo p").html(data[3] + " €");$("#cart_transport_socolissimo p").html(data[4] + " €");$("#cart_transport_chronopost p").html(data[5] + " €");$("#cart_transport_dhl p").html(data[6] + " €");$("#cart_transport_fedex p").html(data[7] + " €");$("#cart_transport_gls p").html(data[8] + " €");$("#cart_transport_tnt p").html(data[9] + " €");$("#cart_transport_ups p").html(data[10] + " €");$("#cart_transport_postexport p").html(data[11] + " €");$("#cart_transport_paquetprio p").html(data[12] + " €");}});} function address() {if ($("#customer_session").val() == "on") {address_list("shipping");address_list("billing");var shipping_mem = $("#shipping_address_mem").val();address_recup("shipping", shipping_mem);var billing_mem = $("#billing_address_mem").val();address_recup("billing", billing_mem);}$("#shipping_modify, #billing_modify").click(function(){var type = $(this).attr("id").replace("_modify", "");$("#"+type+"_display, #"+type+"_change, #"+type+"_message").hide();$("#"+type+"_edit, #"+type+"_submit").fadeIn(500);});$(".address_add").click(function(){var type = $(this).attr("id").replace("_add", "");var country_mem = $("#country_mem").val();$("#"+type+"_display, #"+type+"_modify, #"+type+"_change, #"+type+"_message").hide();$("#"+type+"_edit, #"+type+"_submit, #"+type+"_add_name_wrap").fadeIn(500);$("#"+type+"box input").each(function(){var placeholder = $(this).attr("placeholder");if (placeholder != "" && placeholder != undefined) { $(this).val(placeholder); }});$("#" + type + "_zip").show();$("#" + type + "_zip2").hide();$("#"+type+"_civility").val("");$("#"+type+"_country").val(country_mem);});$("#shippingbox, #billingbox").find("input[type=text]").click(function(){var content = $(this).val();var placeholder = $(this).attr("placeholder");if (content == placeholder) { $(this).val(""); }});$("#shippingbox, #billingbox").find("input[type=text]").blur(function(){var content = $(this).val();var placeholder = $(this).attr("placeholder");if (content == "") { $(this).val(placeholder); }});$('#shippingbox, #billingbox').find("input[type=text], select").focus(function() { decolor2(this); });$("#shipping_country, #billing_country").change(function() {var type = $(this).attr("id").replace("_country", "");if ($(this).val() != "FR") {$("#"+type+"_zip2").unmask();} else {$("#"+type+"_zip2").mask("99999");}});if ($("#shipping_country").val() == "FR") { $("#shipping_zip2").mask("99999"); }if ($("#billing_country").val() == "FR") { $("#billing_zip2").mask("99999"); }$('#shipping_zip').focus(function() { $(this).hide(); $("#shipping_zip2").show().focus(); });$('#shipping_zip2').blur(function() { if ($(this).val() == "_____" || $(this).val() == "") { $(this).hide(); $("#shipping_zip").show(); } });$('#billing_zip').focus(function() { $(this).hide(); $("#billing_zip2").show().focus(); });$('#billing_zip2').blur(function() { if ($(this).val() == "_____" || $(this).val() == "") { $(this).hide(); $("#billing_zip").show(); } });$("#shipping_cancel, #billing_cancel").click(function(){var type = $(this).attr("id").replace("_cancel", "");$("#"+type+"_edit, #"+type+"_submit, #"+type+"_add_name_wrap").hide();$("#"+type+"_display, #"+type+"_modify, #"+type+"_change, #"+type+"_message").fadeIn(500);var current_address = $("#"+type+"_addresses").val();address_recup(type, current_address);$("#"+type+"box").find("input[type=text], select").each(function(){decolor2(this);});});$("#shipping_addresses, #billing_addresses").change(function() {var type = $(this).attr("id").replace("_addresses", "");var other_address = $(this).val();address_recup(type, other_address);});$('#shipping_name, #billing_name').blur(function() { if ($(this).val() == "") { $(this).val("Nombre"); } else { var part1 = $(this).val().substring(0, 1).toUpperCase(); var part2 = $(this).val().substring(1); $(this).val(part1+part2); } });$('#shipping_add_name, #billing_add_name').blur(function() { if ($(this).val() == "") { $(this).val("P.E. Trabajo"); } else { var part1 = $(this).val().substring(0, 1).toUpperCase(); var part2 = $(this).val().substring(1); $(this).val(part1+part2); } });$("#shipping_submit input, #billing_submit input").click(function(){var type = $(this).parent().attr("id").replace("_submit", "");var msg = ""; if ($("#"+type+"_civility").val() == "") { msg += "Gracias por seleccionar su civilidad.\n";color($("#"+type+"_civility"));}if ($("#"+type+"_surname").val() == "APELLIDOS") { msg += "Gracias por apuntar sus apellidos.\n";color($("#"+type+"_surname"));}if ($("#"+type+"_name").val() == "Nombre") { msg += "Gracias por apuntar su nombre.\n";color($("#"+type+"_name"));}if ($("#"+type+"_address").val() == "LINEA 1 DE DIRECCION") { msg += "Por favor, añada su dirección.\n";color($("#"+type+"_address"));}if ($("#"+type+"_zip").is(":visible")) { msg += "Por favor, añada su código postal.\n";color($("#"+type+"_zip"));}if ($("#"+type+"_city").val() == "CIUDAD") { msg += "Por favor, añada su ciudad.\n";color($("#"+type+"_city"));}if ($("#"+type+"_add_name").is(":visible") && $("#"+type+"_add_name").val() == "P.E. Trabajo") { msg += "Por favor, dé un nombre a esta nueva dirección.\n";color($("#"+type+"_add_name"));}if (msg != "") { jAlert("Datos inválidos, gracias por corregirles:\n" + msg, "Mensaje de error:");} else { $("#"+type+"_submit img").show();var civility = $("#"+type+"_civility").val();var surname = $("#"+type+"_surname").val().toUpperCase();var name = $("#"+type+"_name").val();var country = $("#"+type+"_country").val();var address = $("#"+type+"_address").val().toUpperCase();var comp = $("#"+type+"_comp").val().toUpperCase();if (comp == "LINEA 2 DE DIRECCION") { comp = ""; }var zip = $("#"+type+"_zip2").val().toUpperCase();var city = $("#"+type+"_city").val().toUpperCase();var company = $("#"+type+"_company").val().toUpperCase();if (company == "EMPRESA") { company = ""; }var add_name = $("#"+type+"_add_name").val();if (add_name == "P.E. Trabajo") { add_name = ""; }var current_address = $("#"+type+"_addresses").val();var totalvars = "action=save&type=" + type + "&civility=" + civility + "&surname=" + encodeURIComponent(surname) + "&name=" + encodeURIComponent(name) + "&country=" + encodeURIComponent(country) + "&address=" + encodeURIComponent(address) + "&comp=" + encodeURIComponent(comp) + "&zip=" + encodeURIComponent(zip) + "&city=" + encodeURIComponent(city) + "&company=" + encodeURIComponent(company) + "&add_name=" + encodeURIComponent(add_name) + "¤t_address=" + encodeURIComponent(current_address) + "&lang=es"; $.ajax({type: "POST",url: "includes/address.php",data: totalvars,success: function(data){data = data.split("[BRK]");if (data[0] == 1) {if (add_name != "") { address_list(type); setTimeout(function(){ $("#"+type+"_addresses").val(data[1]); }, 1000); }$("#"+type+"_edit, #"+type+"_submit, #"+type+"_add_name_wrap").hide();$("#"+type+"_display, #"+type+"_modify, #"+type+"_change, #"+type+"_message").fadeIn(500);address_recup(type, data[1]);$("#"+type+"_submit img").hide();}}});}});$("#shipping_suppr, #billing_suppr").click(function(){var type = $(this).attr("id").replace("_suppr", "");var id_address = $("#"+type+"_addresses").val();var nb_address = 0;$("#"+type+"_addresses option").each(function(){nb_address = parseInt(nb_address) + 1;});if (parseInt(nb_address) > 1) {jConfirm("Está seguro borrar esta dirección", "Confirmación:", function(answer){if(answer){$.ajax({type: "POST",url: "includes/address.php",data: "action=delete&id_address=" + id_address + "&lang=es",success: function(data){ if (data == 1) { address_list(type); address_recup(type, 0); }}});}});} else {jAlert("Acción imposible. Debe haber al menos una dirección.
Por favor, cree una nueva dirección o cambiar esta dirección.", "Mensaje de error");}});$("#cart_payment").click(function(){var shipping_note = $("#shipping_message textarea").val();var billing_note = $("#billing_message textarea").val();$.post("includes/address.php", { action:"save_note", shipping_note:shipping_note, billing_note:billing_note, lang:"es" });});} function address_list(type){$.ajax({type: "POST",url: "includes/address.php",data: "action=recup_select&type=" + type + "&lang=es",success: function(data){ data = data.split("[BRK]"); if (data[0] == 1) { $("#"+type+"_addresses").html(data[1]); }}});}function address_recup(type, id){$.ajax({type: "POST",url: "includes/address.php",data: "action=recup_address&type=" + type + "&id=" + id + "&lang=es",success: function(data){if (data != "") {data = data.split("[BRK]");if (data[0] != "") { $("#" + type + "_company").val(data[0]); }$("#" + type + "_civility").val(data[1]);$("#" + type + "_surname").val(data[2]);$("#" + type + "_name").val(data[3]);$("#" + type + "_address").val(data[4]);if (data[5] != "") { $("#" + type + "_comp").val(data[5]); }$("#" + type + "_zip2").val(data[6]);$("#" + type + "_city").val(data[7]);$("#" + type + "_country").val(data[8]);$("#" + type + "_zip").hide();$("#" + type + "_zip2").show();var address_to_display = '';if (data[0] != "") { address_to_display += data[0] + "
"; }if (data[1] == "Mme") { address_to_display += "Sra. "; }if (data[1] == "Mle") { address_to_display += "Srta. "; }if (data[1] == "Mr") { address_to_display += "Sr. "; }address_to_display += data[2] + " " + data[3] + "
";address_to_display += data[4] + "
";if (data[5] != "") { address_to_display += data[5] + "
"; }address_to_display += data[6] + " " + data[7] + " " + data[9].toUpperCase() + "
";$("#" + type + "_display p").html(address_to_display);$("#" + type + "_address_mem").val(data[10]);if ($("#relaisList").length){$("#relaisList .searchPoint").val(data[6]);boxtalList(data[6],data[7]);}setTimeout(function() {if ($("#" + type + "_addresses").val() != data[10]) { $("#" + type + "_addresses").val(data[10]); }}, 500);}if (data[1] != "") { if (type == "billing") { $("#billing_check").val("on"); }if (type == "shipping") { $("#shipping_check").val("on"); $("#country_check").val(data[8]); }}}});}function boxtalList(zipcode,city){$("#relaisList ul").html('Chargement en cours
').fadeIn(500);$.ajax({type:"GET",url:"includes/boxtal.php",data:"action=getTransport&zipcode=" + zipcode + "&city=" + encodeURIComponent(city),success:function(data){data = data.split("[BRK]");if (data[0] == 1) {$("#relaisList ul").html(data[1]).fadeIn(500);} else {$("#relaisList ul").html("Oups, il semblerait qu'il y ait une erreur...
").fadeIn(500);}}});}function saveRelay(pickupPoint,operator){var address = $("#"+pickupPoint).html();$("#relayAddress").html(address);$("#relaisList").hide();$("#relaisSelected").fadeIn(500);$.ajax({type:"GET",url:"includes/boxtal.php",data:"action=searchPickupPoint&pickupPoint=" + pickupPoint,success:function(data){ console.log(data);data = data.split("[BRK]");if (data[0] == 1) {$.get("includes/boxtal.php",{"action":"savePickupPoint","pickupPoint":pickupPoint,"relayOperator":operator,"relayAddress":address,"pickupPointName":data[1],"pickupPointAddress":data[2],"pickupPointZipcode":data[3],"pickupPointCity":data[4]});}}});}function newRelay(){$("#relaisSelected").hide();$("#relaisList").fadeIn(500);}function searchRelay(){var searchPoint = $(".searchPoint").val();if (searchPoint != ""){$.ajax({type:"GET",url:"includes/boxtal.php",data:"action=searchZipcode&searchPoint=" + searchPoint,success:function(data){data = data.split("[BRK]");if (data[0] == 1) {boxtalList(searchPoint,data[1]);}}});}}function customer(){$("#cart_payment").click(function(){var shipping_note = $("#shipping_message textarea").val();var billing_note = $("#billing_message textarea").val();var shipping_check = $("#shipping_check").val();var billing_check = $("#billing_check").val();var country_check = $("#country_check").val();var country_mem = $("#country_mem").val();if ($("#relaisList").is(":visible")){jAlert("Veuillez sélectionner un point relais.", "Message d'erreur");} else if (shipping_check == "on" && billing_check == "on" && country_check == country_mem) {$(location).attr("href", "#!/payment.html");} else {if (shipping_check == "off" && billing_check == "off") { jAlert("Por favor, añada su dirección de envío y su dirección de facturación.", "Mensaje de error"); }else if (shipping_check == "off") { jAlert("Por favor, añada su dirección de envío.", "Mensaje de error"); }else if (billing_check == "off") { jAlert("Por favor, añada su dirección de envío y su dirección de facturación.", "Por favor, añada su dirección de facturación"); }else if (country_check != country_mem) {$(location).attr("href", "#!/cart.html");setTimeout('color($("#cart_country select"))', 2000);jAlert("El país de entrega previamente definido no coincide con la dirección de entrega. Por favor, cambie el país de entrega.", "Mensaje de error");}}});}function account() {if ($("#customer_session").val() == 'off') {setTimeout('$(location).attr("href", "#!/login.html")', 1500);}$("#acount_return").click(function(){ setTimeout(function(){$("#objet_contact").val("Retour");}, 1000);});}function scat() { mosaic_sup();function mosaic_sup() {if ($("#mosaic_next").val() == "on") {$("#sup_wait").show();var sup_nav = $("#sup_nav").val();sup_nav = parseInt(sup_nav) + 1;var sup_scat = $("#sup_scat").val();$.ajax({type: "POST",url: "template/webtao/mosaic_prod.php",data: "sup_nav=" + sup_nav + "&sup_scat=" + sup_scat + "&lang=es",success: function(data){data = data.split('[BRK]');$("#mosaic_next_wrap").before(data[0]);$("#mosaic_next").val(data[1]);$("#sup_nav").val(sup_nav);mosaic_sup();}});} else { $("#sup_wait").hide(); }} } function mosaic_minus(prod_id){var qty = $("#mosaic_addtocart"+prod_id+" .qty").val();if (parseInt(qty) > 1) { $("#mosaic_addtocart"+prod_id+" .qty").val(parseInt(qty)-1); }}function mosaic_empty(prod_id){var qty = $("#mosaic_addtocart"+prod_id+" .qty").val();if (qty == "") { $("#mosaic_addtocart"+prod_id+" .qty").val(1); }}function mosaic_stock(prod_id,type){var qty = $("#mosaic_addtocart"+prod_id+" .qty").val();if (qty != ""){if (type == "plus"){ qty = parseInt(qty) + 1; }$("#mosaic_addtocart"+prod_id+" .ready").val("off");$.ajax({type: "POST",url: "includes/cart.php",data: "action=mosaic_stock&id_product="+prod_id+"&size=onesize&qty=" + qty + "&lang=es",success: function(data){data = data.split('[BRK]');if (data[0] == "ok"){if (type == "plus"){ $("#mosaic_addtocart"+prod_id+" .qty").val(qty); }if (type == "qty"){ $("#mosaic_addtocart"+prod_id+" .qty").blur(); }} else if (data[0] == "stop"){if (type == "qty"){ $("#mosaic_addtocart"+prod_id+" .qty").val(data[1]).blur(); }}$("#mosaic_addtocart"+prod_id+" .ready").val("on");}});}}function mosaic_add(prod_id){var qty = $("#mosaic_addtocart"+prod_id+" .qty").val();var ready = $("#mosaic_addtocart"+prod_id+" .ready").val();if (parseInt(qty) > 0 && ready == "on"){$("#mosaic_addtocart"+prod_id+" .wait").show();$.ajax({type: "POST",url: "includes/cart.php",data: "action=add_to_cart&id_product="+prod_id+"&size=onesize&qte=" + qty + "&lang=es",success: function(data){ console.log(data);data = data.split('[BRK]');if (data[0] == "stop"){ $("#mosaic_addtocart"+prod_id+" .qty").val(0); }if (data[0] == 1 || data[0] == "stop"){mosaic_addslide(prod_id);setTimeout(function(){ cart_update("change"); },1000);}setTimeout(function(){ $("#mosaic_addtocart"+prod_id+" .wait").hide();},1000);}});}}function mosaic_addslide(prod_id){var header_height = $("#header").height();var mosaic_vignette_position = $("#mosaic_vignette"+prod_id).offset();var mosaic_vignette_src = $("#mosaic_vignette"+prod_id).attr("src");var mosaic_vignette_width = $("#mosaic_vignette"+prod_id).width();var panier_position = $("#panier").offset();var panier_position_top = parseInt(panier_position.top) + 30;var panier_position_left = parseInt(panier_position.left) + 50;if ($("#mobile_menu").is(":visible")){panier_position = $("#mobile_cart").offset();panier_position_top = parseInt(panier_position.top) + 16;panier_position_left = parseInt(panier_position.left) + 16;}$("#mosaic_flight").html('').css({"top":mosaic_vignette_position.top+"px", "left":mosaic_vignette_position.left+"px", "width":mosaic_vignette_width+"px"}).show().animate({top:panier_position_top+'px',left:panier_position_left+'px',width:'0px'},{duration:1000});setTimeout(function(){ $("#mosaic_flight").hide();},1500);}function payment(){$(".payment_choice").click(function(){if ($("#order_wait").is(":hidden")) {var choice = $(this).attr("alt");$(".payment_choice").each(function(){var newsrc = $(this).attr("src").replace("_on", "_off");$(this).attr("src", newsrc);$(this).css("border", "2px solid #cccdc8");});var newsrc = $(this).attr("src").replace("_off", "_on");$(this).attr("src", newsrc);$(this).css("border", "2px solid #6a150e");$("#payment_choice").val(choice);if (choice == "cb") { $("#showbox_partner").attr("src", "template/webtao/images/es/sogenactif/sogenactif.png"); }if (choice == "paypal") { $("#showbox_partner").attr("src", "template/webtao/images/es/paypal/paypal.png"); }}});$(".payment_choice[alt=cb]").css("border", "2px solid #6a150e");$("#showbox_partner").attr("src", "template/webtao/images/es/sogenactif/sogenactif.png");$("#order_confirmation").click(function(){if ($("#order_wait").is(":hidden")) {$("#order_wait").show();_gaq.push(['_trackPageview', '/includes/tracking.php?step=order']); var payment = $("#payment_choice").val();var tpeTransaction = $("#vads_trans_id").val();$.ajax({type: "POST",url: "includes/order.php",data: "action=new_order&payment=" + payment + "&lang=es&tpeTransaction="+tpeTransaction,success: function(data){ data = data.split("[BRK]"); if (data[0] == 1) {$("body").append(''); if (payment == "chq") { $(location).attr("href", "#!/confirmation.html");_gaq.push(['_trackPageview', '/includes/tracking.php?step=chq']); }if (payment == "vir") { $(location).attr("href", "#!/confirmation.html");_gaq.push(['_trackPageview', '/includes/tracking.php?step=vir']); }if (payment == "cb"){ $("#atos_order_id").val(data[1]); tpeStart(); $("#showbox_paypal").hide();_gaq.push(['_trackPageview', '/includes/tracking.php?step=cb']); }if (payment == "paypal") { $.colorbox({ inline:true, href:"#showbox",onClosed:function(){window.location.href="#!/repayment.html";}}); $("#showbox_wait, #showbox_intro, #showbox_paypal").show(); $("#showbox_cb, #recup_atos, .atos").hide(); var url_return = $("#paypalRequest").find("input[name=return]").val().replace("#", data[1]); var url_cancel = $("#paypalRequest").find("input[name=cancel_return]").val().replace("#", data[1]); $("#paypalRequest").find("input[name=return]").val(url_return); $("#paypalRequest").find("input[name=cancel_return]").val(url_cancel); $("#paypalRequest").find("input[name=item_number]").val(data[2]); setTimeout('$("#paypalRequest").submit()', 5000);_gaq.push(['_trackPageview', '/includes/tracking.php?step=paypal']); }$("#cart_number,#mobile_number").html(0); $("#mobile_number").fadeOut(500); $("#cart_plurial").html("producto:"); $("#cart_price").html("0.00"); $.get("includes/notify.php", { action:"confirmation", order:data[1], skey:data[3], lang:"es" }); }}});}});}function tpeStart(){$("#showbox_intro,#showbox_wait").show();$("#showbox .atos").eq(2).show();$.colorbox({inline:true,href:"#showbox",escKey:false,overlayClose:false,closeButton:false});setTimeout(function(){$("#tpeRequest").submit()},5000);}function repayment() {$(".payment_choice").click(function(){if ($("#order_wait").is(":hidden")) {var choice = $(this).attr("alt");$(".payment_choice").each(function(){var newsrc = $(this).attr("src").replace("_on", "_off");$(this).attr("src", newsrc);$(this).css("border", "2px solid #cccdc8");});var newsrc = $(this).attr("src").replace("_off", "_on");$(this).attr("src", newsrc);$(this).css("border", "2px solid #6a150e");$("#payment_choice").val(choice);if (choice == "cb") { $("#showbox_partner").attr("src", "template/webtao/images/es/sogenactif/sogenactif.png"); }if (choice == "paypal") { $("#showbox_partner").attr("src", "template/webtao/images/es/paypal/paypal.png"); }}});$(".payment_choice[alt=cb]").css("border", "2px solid #6a150e");$("#showbox_partner").attr("src", "template/webtao/images/es/sogenactif/sogenactif.png");$("#order_confirmation").click(function(){if ($("#order_wait").is(":hidden")) {$("#order_wait").show();var payment = $("#payment_choice").val();var tpeTransaction = $("#vads_trans_id").val();$.ajax({type: "POST",url: "includes/order.php",data: "action=update_order&payment=" + payment + "&lang=es&order=" + $("#atos_order_id").val()+"&tpeTransaction="+tpeTransaction,success: function(data){ if (data == 1) { if (payment == "chq" || payment == "vir") { $(location).attr("href", "#!/confirmation.html"); } if (payment == "cb"){tpeStart();$("#showbox_paypal").hide(); } if (payment == "paypal") { $.colorbox({ inline:true, href:"#showbox",onClosed:function(){$("#order_wait").hide();}}); $("#showbox_wait, #showbox_intro, #showbox_paypal").show(); $("#showbox_cb, #recup_atos, .atos").hide(); setTimeout('$("#paypalRequest").submit()', 5000); } }}});}});function atos_recup(){$.ajax({type: "POST",url: "includes/payment.php",data: "action=atos&lang=es&order=" + $("#atos_order_id").val(),cache: false,success: function(data){$("#recup_atos").html(data);$("#recup_atos img").each(function(){ var newsrc = $(this).attr("src").replace("/includes", "includes");$(this).attr("src", newsrc);});$("#recup_atos input[type=image]").each(function(){ var newsrc = $(this).attr("src").replace("/includes", "includes");$(this).attr("src", newsrc);});$("#recup_atos br").remove();$("#recup_atos div").first().remove();$("#recup_atos, .atos").show();$.colorbox({ inline:true, href:"#showbox", onClosed:function(){ $("#order_wait").hide(); }});}});}}