function GetFileNameByPath(n){return n.indexOf("\\")>-1?n.match(/\\([^\\^.]+)\.[^\\]*$/)[1]:n}function GetSmallImg(n,t){var i="";return n&&n.length>0&&(i=n.indexOf("-small")>-1?n.substring(0,n.length-11)+"-small"+t+".jpg":n.substring(0,n.length-4)+"-small"+t+".jpg"),i}function GetIndexImgUrl(n,t){if(n!=""&&n!=null){var i=get_type_of_url(n),r=n.indexOf(".");if(r>-1)if(n.substring(0,r)=="http://filecloud"){if(i="."+i,t==1)return n.replace(i,"_72x72"+i);if(t==2)return n.replace(i,"_400x400"+i);if(t==3)return n.replace(i,"_800x800"+i);if(t==4)return n.replace(i,"_218x218"+i);if(t==5)return n.replace(i,"_100x100"+i);if(t==6)return n.replace(i,"_240x240"+i);if(t==7)return n.replace(i,"_80x80"+i);if(t==8)return n.replace(i,"_200x200"+i)}else return n.replace("."+i,"-small"+t+"."+i)}return""}function isint(n){return/^[1-9]\d*$/.test($(n).val())}function StringBuilder(){this.arrStr=[]}function getFileExt(n){var t=/\.[^\.]+$/.exec(n);return t.toString().toLowerCase()}function GetFileExtVal(n){if(n!="")return"."+n.replace(/.+\./,"")}function HtmlEncode(n){return n.replace(/&/g,"&").replace(/\"/g,""").replace(//g,">")}function HtmlDecode(n){return n.replace(/&/g,"&").replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/\n/g,"
").replace(/\t/g,"
").replace(/\r/g,"")}function GetJsPram(n,t){var u=document.getElementById(n).src,i=u+"&",r=new RegExp("(\\?|\\&)"+t+"=([^\\&\\?]*)\\&","gi"),f;return r.test(i)?(f=r.exec(i),RegExp.$2):""}function GetUrlParams(n){var u={},f=document.location.search.substr(1).split("&"),t,r;for(i=0;i255?2:1,u>=t)break;return i=n.substr(0,r),i.lengtht){var i=parseInt(t/2),r=n.substr(0,i),u=n.substr(n.length-i);n="";n=r+" ... "+u}return n}function get_type_of_url(n){var t="",i;return(n!=""&&(i=n.lastIndexOf(".")+1,t=n.substring(i,n.length)),t.length>5)?"":t}function CopyObText(n){var t=document.body.createTextRange();t.moveToElementText(n);t.scrollIntoView();t.select();clipboardData.setData("text",n.innerText);alert("复制成功!!")}function JsonToObj(sJson){return eval("({"+sJson+"})")}function isurl(n){var i=new RegExp("^((https|http|ftp|rtsp|mms)?://)?(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?(([0-9]{1,3}.){3}[0-9]{1,3}|([0-9a-z_!~*'()-]+.)*([0-9a-z][0-9a-z-]{0,61})?[0-9a-z].[a-z]{2,6})(:[0-9]{1,4})?((/?)|(/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+/?)$"),t=i.test(n);return t||(n.lastIndexOf(".htm")>0||n.lastIndexOf(".html")>0||n.lastIndexOf(".aspx")>0||n.lastIndexOf(".ashx")||n.lastIndexOf(".php")||n.lastIndexOf(".asp"))&&(t=!0),t}function onAjaxBeforeSend(){}function run_ajax_async(n,t,i){$.ajax({type:"get",url:n,data:t,beforeSend:onAjaxBeforeSend,dataType:"html",success:function(n){i!=null&&i(n)},async:!0})}function run_ajax_async_type(n,t,i,r){$.ajax({type:r,url:n,data:t,beforeSend:onAjaxBeforeSend,dataType:"html",success:function(n){i!=null&&i(n)},async:!0})}function run_ajax_async_json(n,t,i){var r=t;(t==null||t=="")&&(r={});$.ajax({url:n,data:JSON.stringify(r),type:"POST",contentType:"application/json; charset=utf-8",beforeSend:onAjaxBeforeSend,success:function(n){i!=null&&i(n)},error:function(){}})}function run_ajax_unasync_json(n,t){var i,r=t;return(t==null||t=="")&&(r={}),$.ajax({url:n,async:!1,data:JSON.stringify(r),type:"POST",contentType:"application/json; charset=utf-8",dataType:"json",beforeSend:onAjaxBeforeSend,success:function(n){i=n},error:function(){}}),i}function run_ajax_unasync(n){return $.ajax({url:n,beforeSend:onAjaxBeforeSend,async:!1}).responseText}function run_ajax_async_js(n,t,i){$.ajax({type:"get",url:n,data:t,dataType:"script",beforeSend:onAjaxBeforeSend,success:function(n){i!=null&&i(n)},async:!0})}function run_ajax_xml(n,t,i){$.ajax({type:"POST",url:n,data:t,beforeSend:onAjaxBeforeSend,dataType:"xml",success:function(n){i!=null&&i(n)},async:!0})}function get_json(n,t){$.getJSON(n,t)}function JsonToObj(sJson){return eval("({"+sJson+"})")}function GetCheckValues(n){var t=[],i=$("#"+n);return i.find("input[type=checkbox]").each(function(){this.checked&&t.push($(this).val())}),t.join(",")}function on_checkall(n){$(n).find("input[type=checkbox]").each(function(){this.checked=!0})}function on_checkback(n){var t=$(n);t.find("input[type=checkbox]").each(function(){this.checked=this.checked?!1:!0})}function on_check(n){var t=$(n).parent().parent().parent();$(t).find("input[type=checkbox]").each(function(){this.checked=n.checked})}function get_checkedradio_value(n){for(var t=0;t<=n.length;t++)if(n[t].checked)return n[t].value;return null}function set_radio_checked(n,t){for(var r=$(n),i=0;i'+u+"<\/option>")}function delete_selecte_option(n,t){$("#"+n).find("option").each(function(n){n!=t&&$(this).remove()})}function delete_sel_item(n){$("#"+n).find("option:selected").remove()}function ColseGreyBox(){parent.ColseWinbox!=undefined?parent.ColseWinbox():window.close()}function Refesh(){var n=location.href;n.lastIndexOf("#")>0&&(n=n.substring(0,n.length-1));document.location.href=n}function runajax(n,t,i){var r="/ajax/"+n;if(arguments.length==2)return run_ajax_unasync_json(r,t);arguments.length==3&&run_ajax_async_json(r,t,i)}function initsearch(){$("#txtkeyword").parent().click(function(){$("#div_wxpj").hide();getMyCarModel();carModel.yearId==""&&(localStorage.getItem("m.beimai.com.IsKnow")==null||localStorage.getItem("m.beimai.com.IsKnow")!="1")&&$("#addCarModelTip").attr("style","display:block");autoComplate()});$(".return").click(function(){$(".header-search").css({left:"110px"});$("#AutoComplateBox").hide();$("header div").hide();$(".logo").show();$("section").last().show();$("#stPartsOil").hide();$("#stReturn").show();$("#btnMainReturn").hide()});oldkeyword=""}function diu_Randomize(n,t){return!n&&n!=0||!t?"?":Math.floor(Math.random()*t+n)}function getCartCount(n,t,i){var r=0,u=new Date,f=u.setTime(u.getTime()+18e5);n==undefined&&t==undefined&&i==undefined?r=$.cookie("CartCount")!=undefined&&$.cookie("CartCount")!=null?$.cookie("CartCount"):runajax("GetCartCount",{}):n==!1&&t==!0&&i!=undefined?$.cookie("CartCount")!=undefined&&$.cookie("CartCount")!=null?(r=$.cookie("CartCount"),r=parseInt(r)+parseInt(i),$.cookie("CartCount",r,{expires:f,path:"/",domain:".beimai.com"})):(r=runajax("GetCartCount",{}),$.cookie("",r,{expires:f,path:"/",domain:".beimai.com"})):r=runajax("GetCartCount",{});$("header").find("span.num-s").text(r);$("footer").find("span.num-s").text(r)}function gotoCarModel(){localStorage.setItem("m.beimai.com.IsKnow","1");window.location.href="/carmodel/index/6"}function CloseCarModelTip(){localStorage.setItem("m.beimai.com.IsKnow","1");$("#addCarModelTip").attr("style","display:none")}function getMyCarModel(){var carInfo=localStorage.getItem("m.beimai.com.carmodel"),obj;carInfo!=null&&carInfo!=""&&(obj=eval("("+carInfo+")"),obj.b_brandimg!=null&&obj.b_brandimg!=""&&$("#myCarImg").attr("src",obj.b_brandimg),carModel={factoryId:obj.b_factoryid,carModelId:obj.b_carmodelid,yearId:obj.b_caryearid,brandId:obj.b_brandid},$("#myCar").html(obj.b_factoryname+" "+obj.b_carmodelname+" "+obj.b_caryearname))}function autoComplate(){var n=$.trim($("#txtkeyword").val());$("#searchData").html("");n!=null&&n!=""?(oldkeyword=n,runajax("AutoComplate",{fId:carModel.factoryId,cmId:carModel.carModelId,yId:carModel.yearId,key:n,iCount:10},function(n){var f='您要找的是不是<\/span>',r,t,i,u;if(n!=undefined&&n!=null&&n!=""){for(r=0;r\""+i+'"<\/span> 相关品牌配件<\/em><\/a>':""+i+"<\/a>";$("#serchHistory").addClass("none");$("#AutoComplateBox").css({display:"block",top:"38px",background:" #fff"});$("#AutoComplateBox_1").css({display:"block",top:"38px",background:" #fff"});$("#searchData").html(f)}else $("#serchHistory").removeClass("none"),$("#AutoComplateBox").css({display:"none"}),$("#AutoComplateBox_1").css({display:"none"})})):($("#serchHistory").removeClass("none"),$("#AutoComplateBox").css({display:"none"}),$("#AutoComplateBox_1").css({display:"none"}))}var oldkeyword,isKnow,carModel;!function(n,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=n.document?t(n,!0):function(n){if(!n.document)throw new Error("jQuery requires a window with a document");return t(n)}:t(n)}("undefined"!=typeof window?window:this,function(n,t){function ri(n){var t=n.length,r=i.type(n);return"function"===r||i.isWindow(n)?!1:1===n.nodeType&&t?!0:"array"===r||0===t||"number"==typeof t&&t>0&&t-1 in n}function ui(n,t,r){if(i.isFunction(t))return i.grep(n,function(n,i){return!!t.call(n,i,n)!==r});if(t.nodeType)return i.grep(n,function(n){return n===t!==r});if("string"==typeof t){if(ef.test(t))return i.filter(t,n,r);t=i.filter(t,n)}return i.grep(n,function(n){return ft.call(t,n)>=0!==r})}function ur(n,t){while((n=n[t])&&1!==n.nodeType);return n}function of(n){var t=fi[n]={};return i.each(n.match(c)||[],function(n,i){t[i]=!0}),t}function ht(){u.removeEventListener("DOMContentLoaded",ht,!1);n.removeEventListener("load",ht,!1);i.ready()}function v(){Object.defineProperty(this.cache={},0,{get:function(){return{}}});this.expando=i.expando+v.uid++}function fr(n,t,r){var u;if(void 0===r&&1===n.nodeType)if(u="data-"+t.replace(hf,"-$1").toLowerCase(),r=n.getAttribute(u),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:sf.test(r)?i.parseJSON(r):r}catch(f){}e.set(n,t,r)}else r=void 0;return r}function lt(){return!0}function k(){return!1}function hr(){try{return u.activeElement}catch(n){}}function vr(n,t){return i.nodeName(n,"table")&&i.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?n.getElementsByTagName("tbody")[0]||n.appendChild(n.ownerDocument.createElement("tbody")):n}function bf(n){return n.type=(null!==n.getAttribute("type"))+"/"+n.type,n}function kf(n){var t=pf.exec(n.type);return t?n.type=t[1]:n.removeAttribute("type"),n}function ei(n,t){for(var i=0,u=n.length;u>i;i++)r.set(n[i],"globalEval",!t||r.get(t[i],"globalEval"))}function yr(n,t){var u,c,f,s,h,l,a,o;if(1===t.nodeType){if(r.hasData(n)&&(s=r.access(n),h=r.set(t,s),o=s.events)){delete h.handle;h.events={};for(f in o)for(u=0,c=o[f].length;c>u;u++)i.event.add(t,f,o[f][u])}e.hasData(n)&&(l=e.access(n),a=i.extend({},l),e.set(t,a))}}function o(n,t){var r=n.getElementsByTagName?n.getElementsByTagName(t||"*"):n.querySelectorAll?n.querySelectorAll(t||"*"):[];return void 0===t||t&&i.nodeName(n,t)?i.merge([n],r):r}function df(n,t){var i=t.nodeName.toLowerCase();"input"===i&&er.test(n.type)?t.checked=n.checked:("input"===i||"textarea"===i)&&(t.defaultValue=n.defaultValue)}function pr(t,r){var f,u=i(r.createElement(t)).appendTo(r.body),e=n.getDefaultComputedStyle&&(f=n.getDefaultComputedStyle(u[0]))?f.display:i.css(u[0],"display");return u.detach(),e}function si(n){var r=u,t=oi[n];return t||(t=pr(n,r),"none"!==t&&t||(at=(at||i("