jQuery(document).ready(function($){ var error=true; function addLoading(e){ } function removeLoading(e){ } function addError(name, e, effect){ error=true; $(e).removeClass('icon success'); $(e).addClass('icon error'); $('.contact-form .contact-form-error-messages .contact-form-error-' + name).css('display','block'); if(effect!==undefined&&effect==true){ $(e).css({position:'relative'}).animate({left:-10}, 100).animate({left:10}, 100).animate({left:-5}, 100).animate({left:5}, 100).animate({left:0}, 100); }} function addSuccess(e){ $(e).addClass('icon success'); } function removeError(name, e){ error=false; $('.contact-form .contact-form-error-messages .contact-form-error-' + name).css('display','none'); $(e).removeClass('icon error'); $(e).removeClass('formRed') addSuccess(e); } $('.contact-form .required').blur(function(){ var name=$(this).attr('name').match(/(.*)\[(.*)\]/); if($(this).val()=='') addError(name[2], this); else removeError(name[2], this); }); $('.contact-form .email-validate').blur(function(){ var expr=/^[_a-z0-9+-]+(\.[_a-z0-9+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/; var name=$(this).attr('name').match(/(.*)\[(.*)\]/); if(( $(this).val()!=''&&!expr.test($(this).val()))||($(this).is('.required')&&$(this).val()=='')) addError(name[2], this); else removeError(name[2], this); }); $('.contact-form').submit(function(){ addLoading('.contact-form input:submit'); }); if($.fn.placeholder){ $('input[placeholder], textarea[placeholder]').placeholder(); } function orderFields(){ $('#content-page .contact-form').each(function(){ var contactForm=$('ul', $(this)); var submit=contactForm.find('.submit-button'); var textarea=contactForm.find('li').filter('.textarea-field.span9'); if($('body').outerWidth() <=767){ textarea.appendTo(contactForm); submit.appendTo(contactForm); }}); } $(window).resize(function(){ orderFields(); }); orderFields(); }); (function ($){ const creditCardFormType=$('#woocommerce_omise_secure_form_enabled'); const cardFormTheme=$('#woocommerce_omise_card_form_theme'); const cardFormThemeParent=cardFormTheme.closest("tr[valign='top']"); Boolean(parseInt(creditCardFormType.val())) ? cardFormThemeParent.show() : cardFormThemeParent.hide(); creditCardFormType.on('change', function(e){ Boolean(parseInt($(this).val())) ? cardFormThemeParent.show() : cardFormThemeParent.hide(); }); })(jQuery); if(typeof tb_pathToImage!='string'){ var tb_pathToImage=thickboxL10n.loadingAnimation; } jQuery(document).ready(function(){ tb_init('a.thickbox, area.thickbox, input.thickbox'); imgLoader=new Image(); imgLoader.src=tb_pathToImage; }); function tb_init(domChunk){ jQuery('body') .on('click', domChunk, tb_click) .on('thickbox:iframe:loaded', function(){ jQuery('#TB_window').removeClass('thickbox-loading'); }); } function tb_click(){ var t=this.title||this.name||null; var a=this.href||this.alt; var g=this.rel||false; tb_show(t,a,g); this.blur(); return false; } function tb_show(caption, url, imageGroup){ var $closeBtn; try { if(typeof document.body.style.maxHeight==="undefined"){ jQuery("body","html").css({height: "100%", width: "100%"}); jQuery("html").css("overflow","hidden"); if(document.getElementById("TB_HideSelect")===null){ jQuery("body").append("
"); jQuery("#TB_overlay").click(tb_remove); }}else{ if(document.getElementById("TB_overlay")===null){ jQuery("body").append(""); jQuery("#TB_overlay").click(tb_remove); jQuery('body').addClass('modal-open'); }} if(tb_detectMacXFF()){ jQuery("#TB_overlay").addClass("TB_overlayMacFFBGHack"); }else{ jQuery("#TB_overlay").addClass("TB_overlayBG"); } if(caption===null){caption="";} jQuery("body").append(""); jQuery('#TB_load').show(); var baseURL; if(url.indexOf("?")!==-1){ baseURL=url.substr(0, url.indexOf("?")); }else{ baseURL=url; } var urlString=/\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/; var urlType=baseURL.toLowerCase().match(urlString); if(urlType=='.jpg'||urlType=='.jpeg'||urlType=='.png'||urlType=='.gif'||urlType=='.bmp'){ TB_PrevCaption=""; TB_PrevURL=""; TB_PrevHTML=""; TB_NextCaption=""; TB_NextURL=""; TB_NextHTML=""; TB_imageCount=""; TB_FoundURL=false; if(imageGroup){ TB_TempArray=jQuery("a[rel="+imageGroup+"]").get(); for (TB_Counter=0; ((TB_Counter < TB_TempArray.length)&&(TB_NextHTML==="")); TB_Counter++){ var urlTypeTemp=TB_TempArray[TB_Counter].href.toLowerCase().match(urlString); if(!(TB_TempArray[TB_Counter].href==url)){ if(TB_FoundURL){ TB_NextCaption=TB_TempArray[TB_Counter].title; TB_NextURL=TB_TempArray[TB_Counter].href; TB_NextHTML=" "+thickboxL10n.next+""; }else{ TB_PrevCaption=TB_TempArray[TB_Counter].title; TB_PrevURL=TB_TempArray[TB_Counter].href; TB_PrevHTML=" "+thickboxL10n.prev+""; }}else{ TB_FoundURL=true; TB_imageCount=thickboxL10n.image + ' ' + (TB_Counter + 1) + ' ' + thickboxL10n.of + ' ' + (TB_TempArray.length); }} } imgPreloader=new Image(); imgPreloader.onload=function(){ imgPreloader.onload=null; var pagesize=tb_getPageSize(); var x=pagesize[0] - 150; var y=pagesize[1] - 150; var imageWidth=imgPreloader.width; var imageHeight=imgPreloader.height; if(imageWidth > x){ imageHeight=imageHeight * (x / imageWidth); imageWidth=x; if(imageHeight > y){ imageWidth=imageWidth * (y / imageHeight); imageHeight=y; }}else if(imageHeight > y){ imageWidth=imageWidth * (y / imageHeight); imageHeight=y; if(imageWidth > x){ imageHeight=imageHeight * (x / imageWidth); imageWidth=x; }} TB_WIDTH=imageWidth + 30; TB_HEIGHT=imageHeight + 60; jQuery("#TB_window").append(""+thickboxL10n.close+"" + " "); jQuery("#TB_closeWindowButton").click(tb_remove); if(!(TB_PrevHTML==="")){ function goPrev(){ if(jQuery(document).unbind("click",goPrev)){jQuery(document).unbind("click",goPrev);} jQuery("#TB_window").remove(); jQuery("body").append(""); tb_show(TB_PrevCaption, TB_PrevURL, imageGroup); return false; } jQuery("#TB_prev").click(goPrev); } if(!(TB_NextHTML==="")){ function goNext(){ jQuery("#TB_window").remove(); jQuery("body").append(""); tb_show(TB_NextCaption, TB_NextURL, imageGroup); return false; } jQuery("#TB_next").click(goNext); } jQuery(document).bind('keydown.thickbox', function(e){ if(e.which==27){ tb_remove(); }else if(e.which==190){ if(!(TB_NextHTML=="")){ jQuery(document).unbind('thickbox'); goNext(); }}else if(e.which==188){ if(!(TB_PrevHTML=="")){ jQuery(document).unbind('thickbox'); goPrev(); }} return false; }); tb_position(); jQuery("#TB_load").remove(); jQuery("#TB_ImageOff").click(tb_remove); jQuery("#TB_window").css({'visibility':'visible'}); }; imgPreloader.src=url; }else{ var queryString=url.replace(/^[^\?]+\??/,''); var params=tb_parseQuery(queryString); TB_WIDTH=(params['width']*1) + 30||630; TB_HEIGHT=(params['height']*1) + 40||440; ajaxContentW=TB_WIDTH - 30; ajaxContentH=TB_HEIGHT - 45; if(url.indexOf('TB_iframe')!=-1){ urlNoQuery=url.split('TB_'); jQuery("#TB_iframeContent").remove(); if(params['modal']!="true"){ jQuery("#TB_window").append("