function IsDate(n){var t,i;try{return(reqular=/^\d{4}\/(0[1-9]|1[0-2])\/(3[0-1]|[0-2][0-9])$/,!reqular.test(n))?!1:(t=n.split("/"),isNaN(t[0]))?!1:isNaN(t[1])?!1:isNaN(t[2])?!1:(yy=parseInt(t[0]),mm=parseInt(t[1]),dd=parseInt(t[2]),t[1]=="08"&&(mm=8),t[1]=="09"&&(mm=9),t[2]=="08"&&(dd=8),t[2]=="09"&&(dd=9),i=new Date,i.setFullYear(yy,mm-1,dd),i=="NaN")?!1:i.getFullYear()!=yy?!1:i.getMonth()+1!=mm?!1:i.getDate()!=dd?!1:!0}catch(r){return window.status="[error]: "+r,!1}}function IsEmail(n){return reqular=/[_a-zA-Z0-9-]+([.][_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+([.][a-zA-Z0-9-]+)*[.][a-zA-Z]{2,3}$/,reqular.test(n)}function IsNumeric(n){return!isNaN(parseFloat(n))&&isFinite(n)}function IsValidDay(n,t,i){var f=parseInt(t,10)-1,r=parseInt(i,10),u=[31,28,31,30,31,30,31,31,30,31,30,31];return(n%4==0&&n%100!=0||n%400==0)&&(u[1]=29),r>=1&&r<=u[f]}function MM_swapImgRestore(){for(var t,i=document.MM_sr,n=0;i&&n0&&parent.frames.length&&(t=parent.frames[n.substring(u+1)].document,n=n.substring(0,u)),(i=t[n])||!t.all||(i=t.all[n]),r=0;!i&&r
內容來源:"+document.title+"<\/a>
"+n+"<\/a>",t=document.createElement("div"),t.style.position="absolute",t.style.left="-99999px",f.appendChild(t),t.innerHTML=s,window.getSelection?i.selectAllChildren(t):(i.moveToElementText(t),i.select()),window.setTimeout(function(){f.removeChild(t)},0))}function randomNum(n,t){return Math.floor(Math.random()*(t-n+1)+n)}function formatNumber(n){return n<10?"0"+n:""+n}function CutStr(n,t){var i=0,u=0,r;for(str_cut=new String,u=n.length,r=0;r4&&i++,str_cut=str_cut.concat(a),i>=t)return str_cut=str_cut.concat("...");if(i0&&(CDNHost!=null&&CDNHost2!=null&&n.indexOf(CDNHost)==0?(n=n.replace(CDNHost,CDNHost2),$(this).unbind("error"),this.onerror=loadErrorImage2,$(this).attr("src",n)):$(this).attr("src",nopicture))})}function loadErrorImage2(){var n=$(this).attr("src");n=n.replace(CDNHost2,"/");$(this).unbind("error");this.onerror=ImageNotFound;$(this).attr("src",n)}function ImageNotFound(){$(this).unbind("error");$(this).attr("src",nopicture)}function WriteLog(n){$.ajax({type:"POST",url:"/service/tool/writelog.ashx",data:{p:n},dataType:"json",success:function(){},error:function(){}})}function SetSearchKeyword(n){$("#txtSearchKeyword").val(n)}function switchButtonStyle(n,t,i,r){var u=$(n).val();u!=null&&u!="0"&&u.length>0?$("."+t).addClass(i):r!="mutilSelect"&&$("."+t).removeClass(i)}function gotoTop(){$("html, body").stop().animate({scrollTop:0},900,"swing",function(){})}function gotoByClass(n){$("."+n).length>0&&$("html, body").stop().animate({scrollTop:$("."+n).offset().top-$(".web_header").height()-$(".menu_bar").height()-16},900,"swing",function(){})}function goto(n){$("html, body").stop().animate({scrollTop:$("#"+n).offset().top},900,"swing",function(){})}function getParameterByName(n,t){t||(t=window.location.href);n=n.replace(/[\[\]]/g,"\\$&");var r=new RegExp("[?&]"+n+"(=([^&#]*)|&|#|$)","i"),i=r.exec(t);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null}function GA_EventTracking(n,t,i){typeof dataLayer!="undefined"&&typeof dataLayer.push=="function"&&dataLayer.push({event:"EventTracking",eventCategory:n,eventAction:t,eventLabel:i,eventValue:undefined,eventNonInteraction:!0})}function QueryString(n){for(var i,u=window.location.search.substring(1),r=u.split("&"),t=0;t0)for(s=n.substring(1),f=s.split("&"),u=0;u0||!!navigator.userAgent.match(/Trident.*rv\:11\./)?parseInt(n.substring(t+5,n.indexOf(".",t))):0}function checkHover(){objGHomeMenu&&($(".products_sub").hide(),$("li.hoverdropGHome").removeClass("menu_bar_selected"),$("#body").hasClass("IsIndex")&&$(".menu_bar").addClass("menu_bar_nobgcolor"))}function ChangeGHomeSubMenu(n){$(".products_sub_menu").hide();n.length>0&&($(".products_sub_menu_"+n).show(),$(".products_catalog a").removeClass("products_catalog_selected"),$(".products_catalog_"+n).addClass("products_catalog_selected"))}function ChangeGHomeSubMenuRight(n){$.ajax({type:"POST",url:"/products/getlastproductsbyfirst4code",data:{aid_first4code:n},dataType:"json",success:function(n){var t=n,i=$(".products_sub_menu_right");i.empty();t.id1.length>0&&i.append('
<\/div>

'+t.brandname1+"<\/h3>

"+t.name1+"<\/p><\/a><\/div>")},error:function(){}})}function ChangeNewforcesSubMenu(n){$("#SubmenuNewforces .space_kind_nav ul li a").removeClass("selected");var t=$("#SubmenuNewforces .space_kind_nav ul li").eq(n);$("#"+t.attr("id")+" a").addClass("selected");$(".topic_designer img").prop("src",t.data("dsgimg"));$(".topic_designer a").prop("href","/designerintro.aspx?id="+t.data("dsgid"));$(".topic_designer a").text(t.data("dsgname"));$(".topic_project a").prop("href","/designercase.aspx?case="+t.data("docid"));$(".topic_project img").prop("src",t.data("docimg"));$(".topic_project p").text(t.data("docsummary"))}function goDesigners_Matching(){var n="/designerevent/index.aspx",u=$("#selArea option:selected").text(),t,i,r;u!=undefined&&u.length>0&&(n+=(n.indexOf("?")==-1?"?":"&")+"area="+u);t=$("#pingNumber").val();t!=undefined&&t.length>0&&(n+=(n.indexOf("?")==-1?"?":"&")+"pingnumber="+t);i=$("#selStyle option:selected").text();i!=undefined&&i.length>0&&(n+=(n.indexOf("?")==-1?"?":"&")+"style="+i);r=$("#selHouseStatus option:selected").text();r!=undefined&&r.length>0&&(n+=(n.indexOf("?")==-1?"?":"&")+"housestatus="+r);location.href=n}function IsWebview(){var n=navigator.userAgent,t="WebView)|((iPhone|iPod|iPad)(?!.*Safari/))|(Android.*(wv|.0.0.0)",i=new RegExp("("+t+")","ig");return Boolean(n.match(i))}function CollapseMainMenu(n,t){typeof PhotoAutoplaySetClose!="undefined"&&typeof PhotoAutoplaySetClose=="function"&&PhotoAutoplaySetClose();t!=null&&t!=undefined&&(t=="open"?$("body").removeClass(n):t=="close"&&$("body").addClass(n));$("body").hasClass(n)?$("body").removeClass(n):$("body").addClass(n)}function CollapseMainMenuMobile(n,t){$("body").hasClass("IsMobile")||$("body").hasClass("IsTablet")?$("body").hasClass(t)?$("body").removeClass(t):$("body").addClass(t):$("body").hasClass(n)?$("body").removeClass(n):$("body").addClass(n)}function SP_Keypress(n){if(n.keyCode==13)return n.preventDefault(),$(".SP_Button").click(),!1}function SP_btnSearch(){return SP_CheckKeyword()&&SP_GoSearch(),!1}function SP_GetSearchUrl(n){var u=1,i,t,r;if($(".SP_text").length>0)return i=encodeURIComponent($(".SP_text").val().trim()).replace(/\%20/g,"+"),n!=undefined&&n.length>0&&(i=encodeURIComponent(n).replace(/\%20/g,"+")),t=$(".divSearchType input[type=radio]:checked").val(),t!=null&&t!=undefined&&(u=parseInt(t)),r="whr="+i+"&idx="+u,"/search.aspx"+(r.length>0?"?":"")+r}function SP_GoSearch(){ShowMaskAndLoading();setTimeout(function(){location.href=SP_GetSearchUrl()},10)}function SP_CheckKeyword(){return $(".SP_text").val().trim()==""||$(".SP_text").val().trim()=="例如:客廳 古典風"||$(".SP_text").val().trim()=="例如:沙發 磁磚"?(alert("請輸入欲查詢的關鍵字"),!1):!0}function SP_changeSearchSelect(n){n=="6"?$(".SP_text").watermark("例如:沙發 磁磚"):$(".SP_text").watermark("例如:客廳 古典風");$.ajax({url:"/common/getsearchkeyword",data:{idx:n},type:"POST",contentType:"application/x-www-form-urlencoded",dataType:"json",success:function(n){var i,t;if(n.ResultCode=="1"){for($(".hot_keyword a").remove(),i="",t=0;t"+(n.Data[t].IsHotSearch?'<\/i>':"")+n.Data[t].Name+"<\/a>";$(".hot_keyword").append(i)}},complete:function(){}})}function InitSearchPanel(){var n=$(".divSearchType input[type=radio]:checked").val();n==null&&(n=0);SP_changeSearchSelect(n)}function NotLogin(){alert("請先登入系統");location.href=loginUrl}function DoAddCollect(n,t,i,r,u,f){MP_iframe_LightBox(null,"/member/member_collect_folderitem_action.aspx?addtype="+encodeURIComponent(t)+"&addcollectid="+encodeURIComponent(n)+"&addurl="+encodeURIComponent(i)+"&elementid="+encodeURIComponent(r)+"&itemIds="+encodeURIComponent(u)+"&followtype="+encodeURIComponent(f)+"&ajax",!0,!0,!1,null,"memberPopup","500px")}function RefreshCollectCnt(n,t,i,r){$.ajax({url:"/membercollect/refreshcollectcnt",type:"POST",data:{addcollectid:n,addtype:t,itemid:r},contentType:"application/x-www-form-urlencoded",dataType:"json",success:function(t){t.ResultCode=="1"&&$(".li_"+n+" .bookmark_number").html(t.Count)},error:function(){}})}function MP_ajax_LightBox(n,t,i,r,u,f,e){n==undefined||n==null?$.magnificPopup.open({type:"ajax",items:{src:t},fixedContentPos:!1,showCloseBtn:r,closeBtnInside:!0,closeOnContentClick:!1,modal:i,callbacks:{parseAjax:function(){$(".mfp-ajax-holder .mfp-content").addClass("white-popup");e!=null&&e!=undefined&&e.length>0&&$(".mfp-ajax-holder .mfp-content").addClass(e);r&&$(".mfp-ajax-holder .mfp-content").append('

<\/div>')},afterClose:function(){u&&window.parent.location.reload();f!=null&&f!=undefined&&typeof f=="function"&&f()}}}):$(n).magnificPopup({type:"ajax",ajax:{settings:{url:t,type:"get"}},fixedContentPos:!1,showCloseBtn:r,closeBtnInside:!0,closeOnContentClick:!1,modal:i,callbacks:{parseAjax:function(){$(".mfp-ajax-holder .mfp-content").addClass("white-popup");e!=null&&e!=undefined&&e.length>0&&$(".mfp-ajax-holder .mfp-content").addClass(e);r&&$(".mfp-ajax-holder .mfp-content").append('
<\/div>')},afterClose:function(){u&&window.parent.location.reload();f!=null&&f!=undefined&&typeof f=="function"&&f()}}})}function MP_iframe_LightBox(n,t,i,r,u,f,e,o){typeof PhotoAutoplaySetClose!="undefined"&&typeof PhotoAutoplaySetClose=="function"&&PhotoAutoplaySetClose();n==undefined||n==null?$.magnificPopup.open({type:"iframe",items:{src:t},iframe:{markup:'