common.js
114 KB
/*! dili 2016-01-06 */
function isIdCardNo(num){num=num.toUpperCase();var intCheckDigit,factorArr=new Array(7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2,1),parityBit=new Array("1","0","X","9","8","7","6","5","4","3","2"),varArray=new Array,lngProduct=0,intStrLen=num.length,idNumber=num;if(15!=intStrLen&&18!=intStrLen)return!1;for(i=0;i<intStrLen;i++){if(varArray[i]=idNumber.charAt(i),(varArray[i]<"0"||varArray[i]>"9")&&17!=i)return!1;i<17&&(varArray[i]=varArray[i]*factorArr[i])}if(18==intStrLen){var date8=idNumber.substring(6,14);if(0==isDate8(date8))return!1;for(i=0;i<17;i++)lngProduct+=varArray[i];if(intCheckDigit=parityBit[lngProduct%11],varArray[17]!=intCheckDigit)return!1}else{var date6=idNumber.substring(6,12);if(0==isDate6(date6))return!1}return!0}function isDate6(sDate){if(!/^[0-9]{6}$/.test(sDate))return!1;var year,month,myDate=new Date,nowyear=myDate.getFullYear();return year=sDate.substring(0,4),month=sDate.substring(4,6),year>nowyear?!1:1700>year||year>2500?!1:1>month||month>12?!1:!0}function isDate8(sDate){if(!/^[0-9]{8}$/.test(sDate))return!1;var year,month,day,myDate=new Date,nowyear=myDate.getFullYear();year=sDate.substring(0,4),month=sDate.substring(4,6),day=sDate.substring(6,8);var iaMonthDays=[31,28,31,30,31,30,31,31,30,31,30,31];return year>nowyear?!1:1700>year||year>2500?!1:((year%4==0&&year%100!=0||year%400==0)&&(iaMonthDays[1]=29),1>month||month>12?!1:1>day||day>iaMonthDays[month-1]?!1:!0)}function reg(value){var len=value.length;switch(len){case 13:return/[0-9a-zA-Z]{13}/.test(value);case 15:return/[0-9a-zA-Z]{15}/.test(value);case 18:return/[0-9a-zA-Z]{18}/.test(value);default:return!1}}define("base",function(require,exports){exports.now=function(){return(new Date).getTime()},exports.uid=function(start,len){for(var str="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"+(new Date).getTime(),len=len||12,temp=[],i=0;len>i;i++)temp.push(str.charAt(Math.floor(Math.random()*str.length)));return(void 0!==start?start+"-":"")+temp.join("")},exports.listen={_t:null,resize:function(callback){clearTimeout(this._t),this._t=setTimeout(function(){$(window).resize(function(){callback()})},79)}},exports.page={screen:{width:function(){return $(window).width()+$(window).scrollLeft()},height:function(){return $(window).height()+$(window).scrollTop()}}},exports.chars={toJson:function(str){str=str.replace(/^[\s\xA0{]+/,"").replace(/[\s\xA0}]+/,"");for(var json={},arr=str.split(/[,;]/),i=0;i<arr.length;i++){var item=arr[i].split(":");json[item[0]]=item[1].replace(/^[\s\xA0\'\"]+/,"").replace(/[\s\xA0\'\"}]+/,"")}return json},toStr:function(json,s1,s2){var arr=[];for(var key in json)arr.push(key+(s1||":")+json[key]);return arr.join(s2||";")},strcut:function(str,num,dir){if(str.length<=num)return[str];for(var temp=[],arr=[],index=0,i=0;i<str.length;i++)temp.push(str.charAt(i));-1===dir&&temp.reverse();for(var i=0;i<temp.length;i++){if(0!==i&&i%num==0&&(-1===dir&&arr[index].reverse(),arr[index]=arr[index].join(""),index++),arr[index]||(arr[index]=[]),i===temp.length-1){arr[index].push(temp[i]),-1===dir&&arr[index].reverse(),arr[index]=arr[index].join("");break}arr[index].push(temp[i])}return-1===dir?arr.reverse():arr}},exports.math={rand:function(end,start){var num=Math.floor(Math.random()*end);return(start||0)+num},"float":function(num,pos){var mynum="number"==typeof num?num:parseFloat(num),mypos=pos||2;return isNaN(mynum)?null:Math.round(mynum*Math.pow(10,mypos))/Math.pow(10,mypos)}},exports.browser={ishtml5:function(){return void 0!==typeof Worker?!0:!1}},exports.imgLoader=function(param,callback){var data={};$.isPlainObject(param)?data=param:$.isArray(param)||"object"===$.type(param)&&!$.isPlainObject(param)?$.each(param,function(){data[$(this).attr("src")]=this}):"string"==typeof param&&(data[param]=[]);for(var key in data){var url=key,img=new Image;if(img.src=url,img._callback=callback,img._orgi=data[key],img.complete)return void img._callback.call(img._orgi.length?img._orgi:img,!0);$(img).load(function(){this._callback.call(this._orgi.length?this._orgi:this,!1)})}},exports.handLazy=function(list){$(list).find("img").each(function(){var _image=$(this),o=_image.attr("src1")||_image.attr("original")||_image.attr("data-original"),s=_image.attr("src");o&&""!=o&&!_image.hasClass("load-img")&&(_image.attr("src",o).removeAttr("src1").removeAttr("original").removeAttr("data-original"),_image.bind("error",function(){$(this).attr("src",s).removeAttr("original").removeAttr("data-original").addClass("load-img")}))})},exports.lazyload=function(target,beginDis){function pageTop(){return(document.body.clientHeight<document.documentElement.clientHeight?document.body.clientHeight:document.documentElement.clientHeight)+Math.max(document.documentElement.scrollTop,document.body.scrollTop)}function imgLoad(){lazyArray.each(function(){var oft=$(this).offset();if(oft&&void 0!==this.nodeType&&oft.top<=pageTop()+(beginDis||0)){var original=$(this).attr("original")||$(this).attr("data-original"),_src=$(this).attr("src");original&&!$(this).hasClass("load-img")&&(murl=$(this).attr("src"),$(this).attr("src",original).removeAttr("original").removeAttr("data-original"),$(this).attr("isOriginal",!0),$(this).bind("error",function(){$(this).attr("src",_src).removeAttr("original").removeAttr("data-original").addClass("load-img")}))}})}var lazyArray=$(target),murl=null;imgLoad(),$(window).bind("scroll",function(){imgLoad()})},exports["goto"]=function(options){var timerId=null;clearTimeout(timerId);var opt={elem:null,duration:400,yOffset:0};$.extend(opt,options),opt.elem=$.isPlainObject(options)?$(opt.elem):$(options);var endpos=0,st=$(window).scrollTop(),start=(new Date).getTime(),toElem=null!==opt.elem&&opt.elem.length,easeout=function(x,t,b,c,d){return-c*t*t/(d*d)+2*c*t/d+b};return opt.elem&&opt.elem.length?(toElem&&(endpos=Math.round(opt.elem.offset().top)),endpos+opt.yOffset==st?!1:(endpos=Math.floor(endpos+opt.yOffset),void(timerId=setInterval(function(){var t=(new Date).getTime()-start,state=t/opt.duration,ratio=easeout(state,t,0,1,opt.duration);if((new Date).getTime()>start+opt.duration)clearInterval(timerId),timerId=null,$(window).scrollTop(endpos);else{var step=(toElem?ratio:1-ratio)*(endpos-st);$(window).scrollTop(st+step)}},17)))):!1}}),define("defval",function(require,exports){var defval=function(target,options){this.target=target,this.opt={fontColor:"#999"},$.extend(this.opt,options),this.init()};return defval.prototype={init:function(){if(""==$(this.target).val()){var id="s-defval-"+(new Date).getTime()*Math.floor(9999*Math.random()),t=$(this.target),v=$(this.target).attr("defval"),fixed_pos="none"!=t.css("float")?"":"position:relative";t.attr("defval",v).val(""),t.wrap('<span class="s-defval_wrap" style="'+fixed_pos+'"></span>'),t.after('<div id="'+id+'" class="s-defval" style="position:absolute;">'+v+"</div>"),this.target._dv=document.getElementById(id),this.set(),this.bind()}},set:function(){var type_arr={margin:[],padding:[]},num_arr={},pos_arr=["top","right","bottom","left"],t=$(this.target);t.parents(".s-defval_wrap");dv=$(this.target._dv),b_lr_rela=.5*this.getNum($(this.target).css("borderLeftWidth"),$(this.target).css("borderRightWidth"))+2,b_tb_rela=.5*this.getNum($(this.target).css("borderTopWidth"),$(this.target).css("borderBottomWidth"))+2,line_hei=t.outerHeight()-b_tb_rela-2,t.is("textarea")&&(line_hei="22"),isNaN(b_lr_rela)&&(b_lr_rela=2),isNaN(b_tb_rela)&&(b_tb_rela=2);for(var key in type_arr)$.each(pos_arr,function(i,item){var _att=key+"-"+item;type_arr[key].push(t.css(_att))}),num_arr[key]={},num_arr[key].tb=this.getNum(type_arr[key][0],type_arr[key][2]),num_arr[key].lr=this.getNum(type_arr[key][1],type_arr[key][3]),type_arr[key]=$.isArray(type_arr[key])?type_arr[key].join(" "):null;dv.css({left:t.position().left+b_lr_rela+"px",top:t.position().top+b_tb_rela+"px",width:t.outerWidth()-num_arr.padding.lr-b_lr_rela+"px",height:t.outerHeight()-num_arr.padding.tb-b_tb_rela+"px","line-height":line_hei-num_arr.padding.tb+"px",padding:type_arr.padding,margin:type_arr.margin,color:this.opt.fontColor,overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap",background:"none",cursor:"text"}),this.target._dv._t=t},getNum:function(num1,num2){var v=parseInt(num1.replace("px",""))+parseInt(num2.replace("px",""));return isNaN(v)?0:v},bind:function(){$(this.target._dv).click(function(){$(this).fadeTo(60,.4),$(this._t).focus()}),$(this.target).css("outline","none").blur(function(){var v=$.trim($(this).val());v.length||v==$(this._dv).text()||$(this._dv).show().fadeTo(60,1)}).keyup(function(){var v=$.trim($(this).val());v.length>0&&$(this._dv).hide()}).focus(function(){var v=$.trim($(this).val());v.length||v==$(this._dv).text()||$(this._dv).fadeTo(60,.4)})}},defval}),define("jselect",function(require){function jselectMain(target,_this,options){this.target=target,this._total_len=_this.length,this.opt={viewNum:8,disabledClass:"model_disabled",unClickClass:"disabled_click",selectedClass:this.name+"-selected",searchBar:!1,onSelect:function(){}},$.extend(this.opt,options),this.Init()}function domsearch(target,options){this.target=target,this.opt={dataItem:null,dataSource:null,autoQuick:!0},$.extend(this.opt,options),this.init()}var prevTarget=null,_list=[],jselect=function(elems,options){var _list=$(elems);_list.each(function(i){this._index=i,new jselectMain(this,_list,options)})};return jselectMain.prototype={name:"pack_jselect",Init:function(){this.GetModel(),$(this.target).is(":disabled"),this.Bind()},GetModel:function(){var _this=this,id=$(this.target).attr("id"),zi=parseInt(this._total_len)-parseInt(this.target._index);(void 0==id||""==id)&&(id=(new Date).getTime()*Math.round(999*Math.random())),id=id+"-"+this.name,(void 0==zi||isNaN(zi))&&(zi=0);var selectedOp=$(this.target).find("option:selected"),curClass=$(this.target).attr("class"),searchBarHtml=_this.opt.searchBar&&$(this.target).find("option").length>10?'<p class="s-select-bar"><input type="text"/></p>':"",htmlArr=[" <div style='z-index:"+zi+";' id='"+id+"' class='"+this.name+" "+curClass+"'> <div style=\"position:relative;z-index:1;overflow:hidden;\" class='"+(selectedOp.attr("class")||"")+"' value='"+selectedOp.val()+"'> <span>"+selectedOp.text()+"</span> <em class='"+this.name+"_arrow'><em></em></em> </div> <input style=\"position:absolute;z-index:-1;width:1px;height:1px;border:0;margin:0 0 0 -10000px;\" id='"+id+"-search' class='"+this.name+'-search\' type="text" value="" name='+id+'/> <ol class="s-pack_jselect-list" style=\'z-index:'+zi+";'>"+searchBarHtml+" <ul>"];$(this.target).find("option").each(function(i){var selectedClass=$(this).attr("class")?$(this).attr("class"):"",oClass=$(this).attr("class")?"oclass="+$(this).attr("class"):"";selectedOp.index()==i&&(selectedClass+=" "+_this.opt.selectedClass);var bgpart="",s_color=$(this).attr("s-color");if(s_color){var bg="";bg=/^#/.test(s_color)?"background-color: "+s_color:'background-image: url("'+s_color+'")',bgpart="<b class='s-color' style='"+bg+"'></b>"}var _disabledClass=$(this).is(":disabled")?_this.opt.unClickClass:"";htmlArr.push('<li class="'+_disabledClass+" "+selectedClass+'" '+oClass+' value="'+$(this).val()+'">'+bgpart+"<span>"+$(this).text()+"</span></li>")}),htmlArr.push("</ul></ol></div>"),$("#"+id).length&&$("#"+id).remove(),$(this.target).after(htmlArr.join("")),this.target._$smodel=$("#"+id),$(this.target).is(":disabled")&&this.target._$smodel.addClass(this.opt.disabledClass).attr("disabled","disabled"),_list.push(this.target._$smodel),this._$focus=this.target._$smodel.find("div"),this._$ul=this.target._$smodel.find(".s-pack_jselect-list"),this._$search=$("#"+id+"-search"),this.SetStyle()},SetStyle:function(){var real_w=this.target._$smodel.find("."+this.name+"_arrow").outerWidth(!0)+$(this.target).outerWidth(!0);this.target._$smodel.css("width",real_w);var toSet=$(this.target).attr("rel");if(toSet)for(var setArr=toSet.split(","),i=0;i<setArr.length;i++){var s=setArr[i],sArr=s.split(":"),pro=sArr[0],val=sArr[1];this.target._$smodel.css(pro,val)}this.SetModelListHeight(),$(this.target).hide(),this._$ul.hide()},SetModelListHeight:function(){var _this=this;if(this.opt.viewNum&&$(this.target).find("option").length>this.opt.viewNum){var hei=0;this._$ul.find("li").each(function(i){i<_this.opt.viewNum&&(hei+=$(this).outerHeight(!0))}),this._$ul.find("ul").css({height:hei,"overflow-y":"scroll"})}},GetMaxIndex:function(){var z=0,list=$(".pack_jselect"),len=list.length;return list.each(function(){var zi=parseInt($(this).css("z-index"));z=Math.max(z,zi?zi:len)}),z+1},Bind:function(fn){var _this=this;this._$focus.bind("click."+this.name,function(event){return clearTimeout(_this.timer),$(_this._$ul).css("z-index",_this.GetMaxIndex()),_this.target._$smodel&&_this.target._$smodel.hasClass(_this.opt.disabledClass)||void 0!==_this.target._$smodel.attr("disabled")?void 0:(_this.timer=setTimeout(function(){event.target!==prevTarget&&$.each(_list,function(i,item){item.find(".s-pack_jselect-list").hide(),item.css({"z-index":"1"})}),_this[_this._$ul.is(":hidden")?"Open":"Close"](),prevTarget=event.target},100),!1)}),$(this.target).bind("change."+this.name,function(){var selectedOption=$(this).find("option:selected"),selectedIndex=selectedOption.index();_this.UpdateModel(selectedIndex),""!=$(this).val()&&$(this).parent().find("label.error").length>0&&$(this).parent().find("label.error").remove()}),this._$ul.find("li").each(function(i){this._index=i}).bind("click."+this.name,function(){return $(this).hasClass(_this.opt.unClickClass)||$(this).hasClass("s-select-bar")?!1:void($(this).hasClass("pack_jselect-selected")?_this.Close():_this.Apply(this._index))}).bind("mouseover."+this.name,function(){var firstWord=$(this).text().charAt(0);_this._$search.val(firstWord)}),this._$ul.bind("mouseover."+this.name,function(){_this._in=!0}),this._$ul.bind("mouseout."+this.name,function(){_this._in=!1}),this._$search.bind("keyup."+this.name,function(event){var v=_this._$search.val(),lastWord=v.charAt(v.length-1),index=_this.matchIndex(lastWord);null!==index&&0!==index&&(_this.UpdateModel(index),_this.SetDropScrollTop(index)),13==event.keyCode&&(_this.Apply(index),_this._$search.val(""))}),this.opt.searchBar&&new domsearch(this._$ul.find(".s-select-bar input"),{dataItem:this._$ul.find("ul li"),dataSource:"span",autoQuick:!0}),$(document).bind("click."+this.name,function(){_this._in||_this.Close()}),this._$focus.bind("selectstart",function(){return!1}),this._$focus.bind("select",function(){document.selection.empty()})},Apply:function(index){var _this=this,elem=$(this.target).attr("sml:sametrigger")?$($(this.target).attr("sml:sametrigger")):$(this.target);elem.each(function(){var curOption=$(this).find("option").eq(index),curLi=_this._$ul.find("li").eq(index);curOption.attr("selected","selected"),$(this).triggerHandler("change"),_this.opt.onSelect.call(curOption,index,curLi)}),this.UpdateModel(index),this._$ul.fadeOut(100)},Open:function(){this._$ul.css({width:this._$focus.innerWidth()}),this._$search.focus(),this._$ul.fadeIn(100),this.target._$smodel.css({"z-index":"9999"}),this.opt.searchBar&&this._$ul.find(".s-select-bar input").focus()},Close:function(){$.each(_list,function(i,item){}),this._$ul.fadeOut(100),this.target._$smodel.css({"z-index":"1"}),this._in=!1},UpdateModel:function(index){var list=this._$ul.find("li"),c=void 0==list.eq(index).attr("oclass")?"":list.eq(index).attr("oclass");this._$focus.attr({value:list.eq(index).attr("val"),"class":c}),this._$focus.find("span").html(list.eq(index).text()),list.removeClass(this.opt.selectedClass),list.eq(index).addClass(this.opt.selectedClass)},SetDropScrollTop:function(index){var list=this._$ul.find("li"),cur=list.eq(index);this._$ul.scrollTop(cur.outerHeight(!0)*index)},matchIndex:function(str){for(var list=this._$ul.find("li"),i=0;i<list.length;i++){var item=list.eq(i),firstWord=item.text().charAt(0);if(firstWord.toLocaleUpperCase()===str.toLocaleUpperCase())return i}return null}},domsearch.prototype={init:function(){var _this=this;this.opt.autoQuick&&this.createQuick(),$(this.target).keyup(function(){var arr=_this.getMatch($.trim($(this).val()));_this.reload(arr)})},createQuick:function(){var _this=this;$(this.opt.dataItem).each(function(){var elem=_this.getDataFrom(this),text=_this.getText(elem);if(text.length&&"string"==typeof text){for(var qstr="",arr=text.split(""),i=0;i<arr.length;i++)qstr+=arr[i].charAt(0);elem.attr("dom-search-autoquick",qstr)}})},getMatch:function(val){var _this=this,match_arr=[],expr=new RegExp("^.*"+val,"i");return $(this.opt.dataItem).each(function(){var elem=_this.getDataFrom(this);(expr.test(_this.getText(elem))||expr.test(elem.attr("dom-search-autoquick")))&&match_arr.push(this)}),match_arr},getDataFrom:function(target){var ds=this.opt.dataSource;return ds?/^@/.test(ds)?$(target):$(target).find(ds):$(target)},getText:function(elem){var ds=this.opt.dataSource;return/^@/.test(ds)?elem.attr(ds.replace(/^@/,"")):elem.text()},reload:function(arr){$(this.opt.dataItem).not(arr).hide(),$(this.opt.dataItem).filter(arr).show()}},jselect}),define("qsearch",function(require,exports,module){function addHighLight(str,key){try{return str.replace(new RegExp(key,"i"),function(word){return"<b>"+word+"</b>"})}catch(ex){}}var ajaxTimer=null,hideTimer=null,showTimer=null,menuClass="ep_qsearch",qsearch=function(elem,option){this.elem=elem,this.dropmenu=null,this.curValue=null,this.keyOn=!1,this.onDrop=!1,this.keyIndex=-1,this.opt={ajaxUrl:null,params:null,form:null,submitLocked:!0,ajaxDelay:200,checkRepeat:!1,selected:"qsearch_selected",loading:'<i style="padding: 4px 10px;">Loading...</i>',error:'<i style="padding: 4px 10px;">Error.</i>',empty:'<i style="padding: 4px 10px;">Empty.</i>',searchBefore:function(){}},$.extend(this.opt,option),this.init()};return qsearch.prototype={init:function(){$(this.elem).attr("autocomplete","off"),$(this.elem).after(this.dropmenu=$('<div class="'+menuClass+'" style="display:none;"></div>')),this.bind(),this.dropmenu.ajaxStart(function(){}),this.dropmenu.ajaxError(function(){})},bind:function(){var _this=this;$(this.elem).bind({click:function(){_this.keyIndex=-1,_this.keyOn=!0,_this.getData($.trim($(this).val()),!0)},blur:function(){_this.keyOn=!1,_this.hide()},keydown:function(ev){return 13===ev.keyCode?(ev.preventDefault(),ev.stopPropagation(),!1):void 0},keyup:function(ev){clearTimeout(ajaxTimer);var isAjax=!0;return 13===ev.keyCode?(_this.toSelect(),!1):((38===ev.keyCode||40===ev.keyCode)&&(isAjax=!1),void _this.getData($.trim($(this).val()),isAjax))},mouseup:function(){return _this.keyOn=!0,_this.curValue==$(this).val()?!1:void 0}}),this.dropmenu.bind({mouseover:function(){_this.onDrop=!0},mouseout:function(){_this.onDrop=!1}}),$(document).keyup(function(ev){if(!_this.keyOn)return!1;switch(ev.keyCode){case 27:_this.hide();break;case 38:_this.toPrev();break;case 40:_this.toNext()}})},getData:function(value,isAjax){var _this=this;return value=$.trim(value),this.curValue!==value&&(this.keyIndex=-1),!isAjax||this.opt.checkRepeat&&this.curValue===value?!1:this.opt.ajaxDelay?void(ajaxTimer=setTimeout(function(){_this.send(value)},this.opt.ajaxDelay)):(this.send(value),!1)},send:function(value){var _this=this,url="",addParams="",params=this.opt.params;for(var key in params){var elem=params[key];elem.length&&(addParams+="&"+key+"="+$.trim(elem.val()))}addParams+="&keywords="+value,/\?/.test(this.opt.ajaxUrl)?url=this.opt.ajaxUrl:(url=this.opt.ajaxUrl+"?",addParams=addParams.replace(/^&/,"")),url+=addParams;var typekey=_this.opt.searchBefore();void 0!==typekey&&"string"==typeof typekey&&(url+=typekey),$.getJSON(url,function(json){_this.keyOn=!0,_this.getHtml(json)}),this.curValue=value},getHtml:function(json){if($.isEmptyObject(json))return this.dropmenu.hide(),!1;var h=["<ul>"];for(var key in json)$.isFunction(json[key])||void 0!==addHighLight(json[key],this.curValue)&&h.push('<li><a href="javascript:void(0);">'+addHighLight(json[key],this.curValue)+"</a></li>");h.push("</ul>"),this.dropmenu.html(h.join("")).show(),this.linksEvent()},linksEvent:function(){var _this=this,items=$("li",this.dropmenu);items.bind({click:function(){var h=$.trim($(this).text());$(_this.elem).val(h),_this.dropmenu.hide(),$(_this.opt.form).length&&$(_this.opt.form).submit()},mouseover:function(){items.removeClass(_this.opt.selected),$(this).addClass(_this.opt.selected);var cur=this;items.each(function(i){this===cur&&(_this.keyIndex=i)})}})},show:function(){clearTimeout(showTimer);var _this=this;showTimer=setTimeout(function(){_this.dropmenu.show()},200)},hide:function(){var _this=this;return this.onDrop?($(this.elem).focus(),!1):void(hideTimer=setTimeout(function(){_this.dropmenu.hide()},200))},selectItem:function(){var items=$("li",this.dropmenu),item=items.eq(this.keyIndex);return items.removeClass(this.opt.selected),item.addClass(this.opt.selected),this.dropScroll(),$("a",item).text()},dropScroll:function(){var elem=$("li",this.dropmenu).eq(this.keyIndex);if(!elem.length)return!1;var max=this.dropmenu.outerHeight(),th=elem.position().top+elem.outerHeight()+this.dropmenu.scrollTop(),st=0;th>max&&(st=th-max),this.dropmenu.scrollTop(st)},toSelect:function(){if(-1==this.keyIndex)return this.opt.submitLocked||""===$.trim($(this.elem).val())||$(this.opt.form).submit(),!1;var v=this.selectItem();return v&&""!==$.trim(v)?($(this.elem).val(v),this.dropmenu.hide(),this.opt.submitLocked?(this.keyIndex=-1,$(this.elem).blur(),!1):($(this.opt.form).submit(),!1)):!1},toPrev:function(){this.keyIndex>0&&($("li",this.dropmenu).removeClass(this.opt.selected),this.keyIndex--,this.selectItem())},toNext:function(){this.keyIndex<$("li",this.dropmenu).length-1&&($("li",this.dropmenu).removeClass(this.opt.selected),this.keyIndex++,this.selectItem())}},qsearch}),define("event",function(require,exports){function transit(target,options){this.target=target,this.opt={pauseGroup:null,onOver:function(){},onOut:function(){}},$.extend(this.opt,options),this.init()}var events={x:function(ev){return ev.pageX||ev.clientX+$(document).scrollLeft()},y:function(ev){return ev.pageY||ev.clientY+$(document).scrollTop()}};events.transit=function(target,options){$(target).each(function(){new transit(this,options)})};var transit_tick_timer=null,transit_timers=[];return transit.prototype={init:function(){var _this=this,target=this.target;target.onTrigger=function(){clearInterval(this.timer),clearTimeout(this.outTimer),this._triggered=!0,this._onOver.call(_this,this)},this.bind()},bind:function(){var _this=this;$(this.target).bind("mouseover.transit",function(event){_this.onStart(this,event)}),$(this.target).bind("mousemove.transit",function(event){_this.onProcess(event)}),$(this.target).bind("mouseout.transit",function(event){_this.onStop()})},bindGroup:function(target){var _this=this,group=this.opt.pauseGroup;group&&group.length&&(group.unbind("mouseover.transit").bind("mouseover.transit",function(event){clearTimeout(_this.current.outTimer)}),group.unbind("mouseout.transit").bind("mouseout.transit",function(event){_this.onStop()}))},onStart:function(target,event){var _this=this;target._onOver=this.opt.onOver,target._onOut=this.opt.onOut,this.current=target,this.coorArr=[.123456,.654321],this.clear(),this.tick(),clearTimeout(_this.current.outTimer),this.bindGroup(target),transit_timers.push(this.current),this.current.timer=setInterval(function(){_this.coorArr.push(_this.coor),_this.compareCoor()},23)},onProcess:function(event){this.coor=[event.pageX,event.pageY]},onStop:function(){var _this=this;return this.clear(),this.current&&$(this.current).length?(clearTimeout(this.current.outTimer),void(this.current.outTimer=setTimeout(function(){_this.current._triggered&&(_this.current._onOut.call(_this,_this.current),_this.current._triggered=!1)},24))):!1},compareCoor:function(){var arr=this.coorArr,len=arr.length,lastCoor=arr[len-1],prevCoor=arr[len-2];lastCoor[0]==prevCoor[0]&&lastCoor[1]==prevCoor[1]&&this.current.onTrigger()},clear:function(){for(var i=0;i<transit_timers.length;i++){var target=transit_timers[i];target===this.current&&(clearInterval(this.current.timer),transit_timers.splice(i,1))}},tick:function(){clearTimeout(transit_tick_timer),transit_tick_timer=setTimeout(function(){if(transit_timers.length)for(var i=0;i<transit_timers.length;i++){var target=transit_timers[i];clearInterval(target.timer),transit_timers.splice(i,1)}},3e3)}},events}),define("scrollfixed",function(require,exports){var scrollfixed=function(target,options){this.target=target,this.opt={startFixed:0,endFixed:null,baseClassName:"s-header-fixed",setWidth:!1,scrollCallback:function(){},endscrollCallback:function(){}},this.place=null,this.originalPosition=$(this.target).css("position"),$.extend(this.opt,options),this.init()};return scrollfixed.prototype={init:function(){var _this=($(this.target),this);$(window).on("scroll",function(){_this.getScroll()})},getProperties:function(){var t=$(this.target),properties={_height:t.outerHeight(),_width:t.outerWidth(),_top:t.offset().top};return properties},placeholder:function(){var t=$(this.target),_this=this,_p=this.getProperties();_this.place=$('<div style="height:'+_p._height+'px"></div>'),_this.place.insertBefore(t)},getScroll:function(){var t=$(this.target),_this=this,scrollTop=$(window).scrollTop(),_p=this.getProperties(),ie6=!-[1]&&!window.XMLHttpRequest,_position=ie6?"absolute":"fixed";if(scrollTop<=_this.opt.startFixed||scrollTop>_this.opt.startFixed&&null!=_this.opt.endFixed&&!isNaN(_this.opt.endFixed)&&scrollTop-_p._height>=_this.opt.endFixed)t.removeClass(_this.opt.baseClassName).css({position:_this.originalPosition}),null!=_this.place&&($(_this.place).remove(),_this.place=null),_this.opt.endscrollCallback();else{if(null==_this.place&&_this.placeholder(),t.css({position:_position}).addClass(_this.opt.baseClassName),_this.opt.setWidth){var _bl=isNaN(parseFloat(t.borderLeftWidth))?1:parseFloat(t.borderLeftWidth),_br=isNaN(parseFloat(t.borderRightWidth))?1:parseFloat(t.borderRightWidth);t.css({width:$(_this.place).width()-_bl-_br+"px"})}_this.opt.scrollCallback()}}},scrollfixed}),function($){$.extend($.fn,{validate:function(options){if(!this.length)return void(options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing"));var validator=$.data(this[0],"validator");return validator?validator:(this.attr("novalidate","novalidate"),validator=new $.validator(options,this[0]),$.data(this[0],"validator",validator),validator.settings.onsubmit&&(this.validateDelegate(":submit","click",function(ev){validator.settings.submitHandler&&(validator.submitButton=ev.target),$(ev.target).hasClass("cancel")&&(validator.cancelSubmit=!0)}),this.submit(function(event){function handle(){var hidden;return validator.settings.submitHandler?(validator.submitButton&&(hidden=$("<input type='hidden'/>").attr("name",validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm)),validator.settings.submitHandler.call(validator,validator.currentForm,event),validator.submitButton&&hidden.remove(),!1):!0}return validator.settings.debug&&event.preventDefault(),validator.cancelSubmit?(validator.cancelSubmit=!1,handle()):validator.form()?validator.pendingRequest?(validator.formSubmitted=!0,!1):handle():(validator.focusInvalid(),!1)})),validator)},valid:function(){if($(this[0]).is("form"))return this.validate().form();var valid=!0,validator=$(this[0].form).validate();return this.each(function(){valid&=validator.element(this)}),valid},removeAttrs:function(attributes){var result={},$element=this;return $.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value),$element.removeAttr(value)}),result},rules:function(command,argument){var element=this[0];if(command){var settings=$.data(element.form,"validator").settings,staticRules=settings.rules,existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument)),staticRules[element.name]=existingRules,argument.messages&&(settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages));break;case"remove":if(!argument)return delete staticRules[element.name],existingRules;var filtered={};return $.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method],delete existingRules[method]}),filtered}}var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required,data=$.extend({required:param},data)}return data}}),$.extend($.expr[":"],{blank:function(a){return!$.trim(""+a.value)},filled:function(a){return!!$.trim(""+a.value)},unchecked:function(a){return!a.checked}}),$.validator=function(options,form){this.settings=$.extend(!0,{},$.validator.defaults,options),this.currentForm=form,this.init()},$.validator.format=function(source,params){return 1===arguments.length?function(){var args=$.makeArray(arguments);return args.unshift(source),$.validator.format.apply(this,args)}:(arguments.length>2&¶ms.constructor!==Array&&(params=$.makeArray(arguments).slice(1)),params.constructor!==Array&&(params=[params]),$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n)}),source)},$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(element,event){this.lastActive=element,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(element)).hide())},onfocusout:function(element,event){this.checkable(element)||!(element.name in this.submitted)&&this.optional(element)||this.element(element)},onkeyup:function(element,event){(9!==event.which||""!==this.elementValue(element))&&(element.name in this.submitted||element===this.lastActive)&&this.element(element)},onclick:function(element,event){element.name in this.submitted?this.element(element):element.parentNode.name in this.submitted&&this.element(element.parentNode)},highlight:function(element,errorClass,validClass){"radio"===element.type?this.findByName(element.name).addClass(errorClass).removeClass(validClass):$(element).addClass(errorClass).removeClass(validClass)},unhighlight:function(element,errorClass,validClass){"radio"===element.type?this.findByName(element.name).removeClass(errorClass).addClass(validClass):$(element).removeClass(errorClass).addClass(validClass)}},setDefaults:function(settings){$.extend($.validator.defaults,settings)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function delegate(event){var validator=$.data(this[0].form,"validator"),eventType="on"+event.type.replace(/^validate/,"");validator&&validator.settings[eventType]&&validator.settings[eventType].call(validator,this[0],event)}this.labelContainer=$(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm),
this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var groups=this.groups={};$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key})});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value)}),$(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",delegate).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",delegate),this.settings.invalidHandler&&$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),$.extend(this.submitted,this.errorMap),this.invalid=$.extend({},this.errorMap),this.valid()||$(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var i=0,elements=this.currentElements=this.elements();elements[i];i++)this.check(elements[i]);return this.valid()},element:function(element){element=this.validationTargetFor(this.clean(element)),this.lastElement=element,this.prepareElement(element),this.currentElements=$(element);var result=this.check(element)!==!1;return result?delete this.invalid[element.name]:this.invalid[element.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),result},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors),this.errorList=[];for(var name in errors)this.errorList.push({message:errors[name],element:this.findByName(name)[0]});this.successList=$.grep(this.successList,function(element){return!(element.name in errors)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){$.fn.resetForm&&$(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(obj){var count=0;for(var i in obj)count++;return count},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(e){}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&1===$.grep(this.errorList,function(n){return n.element.name===lastActive.name}).length&&lastActive},elements:function(){var validator=this,rulesCache={};return $(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in rulesCache||!validator.objectLength($(this).rules())?!1:(rulesCache[this.name]=!0,!0)})},clean:function(selector){return $(selector)[0]},errors:function(){var errorClass=this.settings.errorClass.replace(" ",".");return $(this.settings.errorElement+"."+errorClass,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=$([]),this.toHide=$([]),this.currentElements=$([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(element){this.reset(),this.toHide=this.errorsFor(element)},elementValue:function(element){var type=$(element).attr("type"),val=$(element).val();return"radio"===type||"checkbox"===type?$('input[name="'+$(element).attr("name")+'"]:checked').val():"string"==typeof val?val.replace(/\r/g,""):val},check:function(element){element=this.validationTargetFor(this.clean(element));var result,rules=$(element).rules(),dependencyMismatch=!1,val=this.elementValue(element);for(var method in rules){var rule={method:method,parameters:rules[method]};try{if(result=$.validator.methods[method].call(this,val,element,rule.parameters),"dependency-mismatch"===result){dependencyMismatch=!0;continue}if(dependencyMismatch=!1,"pending"===result)return void(this.toHide=this.toHide.not(this.errorsFor(element)));if(!result)return this.formatAndAdd(element,rule),!1}catch(e){throw this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id+", check the '"+rule.method+"' method",e),e}}return dependencyMismatch?void 0:(this.objectLength(rules)&&this.successList.push(element),!0)},customMetaMessage:function(element,method){if($.metadata){var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method]}},customDataMessage:function(element,method){return $(element).data("msg-"+method.toLowerCase())||element.attributes&&$(element).attr("data-msg-"+method.toLowerCase())},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor===String?m:m[method])},findDefined:function(){for(var i=0;i<arguments.length;i++)if(void 0!==arguments[i])return arguments[i];return void 0},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),this.customDataMessage(element,method),this.customMetaMessage(element,method),!this.settings.ignoreTitle&&element.title||void 0,$.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>")},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method),theregex=/\$?\{(\d+)\}/g;"function"==typeof message?message=message.call(this,rule.parameters,element):theregex.test(message)&&(message=$.validator.format(message.replace(theregex,"{$1}"),rule.parameters)),this.errorList.push({message:message,element:element}),this.errorMap[element.name]=message,this.submitted[element.name]=message},addWrapper:function(toToggle){return this.settings.wrapper&&(toToggle=toToggle.add(toToggle.parent(this.settings.wrapper))),toToggle},defaultShowErrors:function(){var i,elements;for(i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass),this.showLabel(error.element,error.message)}if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(i=0;this.successList[i];i++)this.showLabel(this.successList[i]);if(this.settings.unhighlight)for(i=0,elements=this.validElements();elements[i];i++)this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return $(this.errorList).map(function(){return this.element})},showLabel:function(element,message){var label=this.errorsFor(element);label.length?(label.removeClass(this.settings.validClass).addClass(this.settings.errorClass),label.attr("generated")&&label.html(message)):(label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:!0}).addClass(this.settings.errorClass).html(message||""),this.settings.wrapper&&(label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(label).length||(this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element))),!message&&this.settings.success&&(label.text(""),"string"==typeof this.settings.success?label.addClass(this.settings.success):this.settings.success(label,element)),this.toShow=this.toShow.add(label)},errorsFor:function(element){var name=this.idOrName(element);return this.errors().filter(function(){return $(this).attr("for")===name})},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name)},validationTargetFor:function(element){return this.checkable(element)&&(element=this.findByName(element.name).not(this.settings.ignore)[0]),element},checkable:function(element){return/radio|checkbox/i.test(element.type)},findByName:function(name){return $(this.currentForm).find('[name="'+name+'"]')},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case"select":return $("option:selected",element).length;case"input":if(this.checkable(element))return this.findByName(element.name).filter(":checked").length}return value.length},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):!0},dependTypes:{"boolean":function(param,element){return param},string:function(param,element){return!!$(param,element.form).length},"function":function(param,element){return param(element)}},optional:function(element){var val=this.elementValue(element);return!$.validator.methods.required.call(this,val,element)&&"dependency-mismatch"},startRequest:function(element){this.pending[element.name]||(this.pendingRequest++,this.pending[element.name]=!0)},stopRequest:function(element,valid){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[element.name],valid&&0===this.pendingRequest&&this.formSubmitted&&this.form()?($(this.currentForm).submit(),this.formSubmitted=!1):!valid&&0===this.pendingRequest&&this.formSubmitted&&($(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",{old:null,valid:!0,message:this.defaultMessage(element,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(className,rules){className.constructor===String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className)},classRules:function(element){var rules={},classes=$(element).attr("class");return classes&&$.each(classes.split(" "),function(){this in $.validator.classRuleSettings&&$.extend(rules,$.validator.classRuleSettings[this])}),rules},attributeRules:function(element){var rules={},$element=$(element);for(var method in $.validator.methods){var value;"required"===method?(value=$element.get(0).getAttribute(method),""===value&&(value=!0),value=!!value):value=$element.attr(method),value?rules[method]=value:$element[0].getAttribute("type")===method&&(rules[method]=!0)}return rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)&&delete rules.maxlength,rules},metadataRules:function(element){if(!$.metadata)return{};var meta=$.data(element.form,"validator").settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata()},staticRules:function(element){var rules={},validator=$.data(element.form,"validator");return validator.settings.rules&&(rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{}),rules},normalizeRules:function(rules,element){return $.each(rules,function(prop,val){if(val===!1)return void delete rules[prop];if(val.param||val.depends){var keepRule=!0;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element)}keepRule?rules[prop]=void 0!==val.param?val.param:!0:delete rules[prop]}}),$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter}),$.each(["minlength","maxlength","min","max"],function(){rules[this]&&(rules[this]=Number(rules[this]))}),$.each(["rangelength","range"],function(){var parts;rules[this]&&($.isArray(rules[this])?rules[this]=[Number(rules[this][0]),Number(rules[this][1])]:"string"==typeof rules[this]&&(parts=rules[this].replace(/[\[\]]/g,"").split(/[\s,]+/),rules[this]=[Number(parts[0]),Number(parts[1])]))}),$.validator.autoCreateRanges&&(rules.min&&rules.max&&(rules.range=[rules.min,rules.max],delete rules.min,delete rules.max),rules.minlength&&rules.maxlength&&(rules.rangelength=[rules.minlength,rules.maxlength],delete rules.minlength,delete rules.maxlength)),rules.messages&&delete rules.messages,rules},normalizeRule:function(data){if("string"==typeof data){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=!0}),data=transformed}return data},addMethod:function(name,method,message){$.validator.methods[name]=method,$.validator.messages[name]=void 0!==message?message:$.validator.messages[name],method.length<3&&$.validator.addClassRules(name,$.validator.normalizeRule(name))},methods:{required:function(value,element,param){if(!this.depend(param,element))return"dependency-mismatch";if("select"===element.nodeName.toLowerCase()){var val=$(element).val();return val&&val.length>0}return this.checkable(element)?this.getLength(value,element)>0:$.trim(value).length>0},remote:function(value,element,param){if(this.optional(element))return"dependency-mismatch";var previous=this.previousValue(element);if(this.settings.messages[element.name]||(this.settings.messages[element.name]={}),previous.originalMessage=this.settings.messages[element.name].remote,this.settings.messages[element.name].remote=previous.message,param="string"==typeof param&&{url:param}||param,this.pending[element.name])return"pending";if(previous.old===value)return previous.valid;previous.old=value;var validator=this;this.startRequest(element);var data={};return data[element.name]=value,$.ajax($.extend(!0,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){validator.settings.messages[element.name].remote=previous.originalMessage;var valid=response===!0||"true"===response;if(valid){var submitted=validator.formSubmitted;validator.prepareElement(element),validator.formSubmitted=submitted,validator.successList.push(element),delete validator.invalid[element.name],validator.showErrors()}else{var errors={},message=response||validator.defaultMessage(element,"remote");errors[element.name]=previous.message=$.isFunction(message)?message(value):message,validator.invalid[element.name]=!0,validator.showErrors(errors)}previous.valid=valid,validator.stopRequest(element,valid)}},param)),"pending"},minlength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength($.trim(value),element);return this.optional(element)||length>=param},maxlength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength($.trim(value),element);return this.optional(element)||param>=length},rangelength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength($.trim(value),element);return this.optional(element)||length>=param[0]&&length<=param[1]},min:function(value,element,param){return this.optional(element)||value>=param},max:function(value,element,param){return this.optional(element)||param>=value},range:function(value,element,param){return this.optional(element)||value>=param[0]&&value<=param[1]},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(value)},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value)},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value))},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(value)},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value)},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value)},creditcard:function(value,element){if(this.optional(element))return"dependency-mismatch";if(/[^0-9 \-]+/.test(value))return!1;var nCheck=0,nDigit=0,bEven=!1;value=value.replace(/\D/g,"");for(var n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);nDigit=parseInt(cDigit,10),bEven&&(nDigit*=2)>9&&(nDigit-=9),nCheck+=nDigit,bEven=!bEven}return nCheck%10===0},equalTo:function(value,element,param){var target=$(param);return this.settings.onfocusout&&target.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){$(element).valid()}),value===target.val()}}}),$.format=$.validator.format}(jQuery),function($){var pendingRequests={};if($.ajaxPrefilter)$.ajaxPrefilter(function(settings,_,xhr){var port=settings.port;"abort"===settings.mode&&(pendingRequests[port]&&pendingRequests[port].abort(),pendingRequests[port]=xhr)});else{var ajax=$.ajax;$.ajax=function(settings){var mode=("mode"in settings?settings:$.ajaxSettings).mode,port=("port"in settings?settings:$.ajaxSettings).port;return"abort"===mode?(pendingRequests[port]&&pendingRequests[port].abort(),pendingRequests[port]=ajax.apply(this,arguments)):ajax.apply(this,arguments)}}}(jQuery),function($){jQuery.event.special.focusin||jQuery.event.special.focusout||!document.addEventListener||$.each({focus:"focusin",blur:"focusout"},function(original,fix){function handler(e){return e=$.event.fix(e),e.type=fix,$.event.handle.call(this,e)}$.event.special[fix]={setup:function(){this.addEventListener(original,handler,!0)},teardown:function(){this.removeEventListener(original,handler,!0)},handler:function(e){var args=arguments;return args[0]=$.event.fix(e),args[0].type=fix,$.event.handle.apply(this,args)}}}),$.extend($.fn,{validateDelegate:function(delegate,type,handler){return this.bind(type,function(event){var target=$(event.target);return target.is(delegate)?handler.apply(target,arguments):void 0})}})}(jQuery),function(e,t,n){"use strict";var i,r=t.event;r.special.smartresize={setup:function(){t(this).bind("resize",r.special.smartresize.handler)},teardown:function(){t(this).unbind("resize",r.special.smartresize.handler)},handler:function(e,t){var n=this,s=arguments;e.type="smartresize",i&&clearTimeout(i),i=setTimeout(function(){r.dispatch.apply(n,s)},"execAsap"===t?0:100)}},t.fn.smartresize=function(e){return e?this.bind("smartresize",e):this.trigger("smartresize",["execAsap"])},t.Mason=function(e,n){this.element=t(n),this._create(e),this._init()},t.Mason.settings={isResizable:!0,isAnimated:!1,animationOptions:{queue:!1,duration:500},gutterWidth:0,isRTL:!1,isFitWidth:!1,containerStyle:{position:"relative"}},t.Mason.prototype={_filterFindBricks:function(e){var t=this.options.itemSelector;return t?e.filter(t).add(e.find(t)):e},_getBricks:function(e){var t=this._filterFindBricks(e).css({position:"absolute"}).addClass("masonry-brick");return t},_create:function(n){this.options=t.extend(!0,{},t.Mason.settings,n),this.styleQueue=[];var r=this.element[0].style;this.originalStyle={height:r.height||""};var i=this.options.containerStyle;for(var s in i)this.originalStyle[s]=r[s]||"";this.element.css(i),this.horizontalDirection=this.options.isRTL?"right":"left";var o=this.element.css("padding-"+this.horizontalDirection),u=this.element.css("padding-top");this.offset={x:o?parseInt(o,10):0,y:u?parseInt(u,10):0},this.isFluid=this.options.columnWidth&&"function"==typeof this.options.columnWidth;var a=this;setTimeout(function(){a.element.addClass("masonry")},0),this.options.isResizable&&t(e).bind("smartresize.masonry",function(){a.resize()}),this.reloadItems()},_init:function(e){this._getColumns(),this._reLayout(e)},option:function(e,n){t.isPlainObject(e)&&(this.options=t.extend(!0,this.options,e))},layout:function(e,t){for(var n=0,r=e.length;r>n;n++)this._placeBrick(e[n]);var i={};if(i.height=Math.max.apply(Math,this.colYs),this.options.isFitWidth){var s=0;for(n=this.cols;--n&&0===this.colYs[n];)s++;i.width=(this.cols-s)*this.columnWidth-this.options.gutterWidth}this.styleQueue.push({$el:this.element,style:i});var a,o=this.isLaidOut&&this.options.isAnimated?"animate":"css",u=this.options.animationOptions;for(n=0,r=this.styleQueue.length;r>n;n++)a=this.styleQueue[n],a.$el[o](a.style,u);this.styleQueue=[],t&&t.call(e),this.isLaidOut=!0},_getColumns:function(){var e=this.options.isFitWidth?this.element.parent():this.element,t=e.width();this.columnWidth=this.isFluid?this.options.columnWidth(t):this.options.columnWidth||this.$bricks.outerWidth(!0)||t,this.columnWidth+=this.options.gutterWidth,this.cols=Math.floor((t+this.options.gutterWidth)/this.columnWidth),this.cols=Math.max(this.cols,1)},_placeBrick:function(e){var r,i,s,o,u,n=t(e);if(r=Math.ceil(n.outerWidth(!0)/this.columnWidth),r=Math.min(r,this.cols),1===r)s=this.colYs;else for(i=this.cols+1-r,s=[],u=0;i>u;u++)o=this.colYs.slice(u,u+r),s[u]=Math.max.apply(Math,o);for(var a=Math.min.apply(Math,s),f=0,l=0,c=s.length;c>l;l++)if(s[l]===a){f=l;break}var h={top:a+this.offset.y};h[this.horizontalDirection]=this.columnWidth*f+this.offset.x,this.styleQueue.push({$el:n,style:h});var p=a+n.outerHeight(!0),d=this.cols+1-c;for(l=0;d>l;l++)this.colYs[f+l]=p},resize:function(){var e=this.cols;this._getColumns(),(this.isFluid||this.cols!==e)&&this._reLayout()},_reLayout:function(e){var t=this.cols;for(this.colYs=[];t--;)this.colYs.push(0);this.layout(this.$bricks,e)},reloadItems:function(){this.$bricks=this._getBricks(this.element.children())},reload:function(e){this.reloadItems(),this._init(e)},appended:function(e,t,n){if(t){this._filterFindBricks(e).css({top:this.element.height()});var r=this;setTimeout(function(){r._appended(e,n)},1)}else this._appended(e,n)},_appended:function(e,t){var n=this._getBricks(e);this.$bricks=this.$bricks.add(n),this.layout(n,t)},remove:function(e){this.$bricks=this.$bricks.not(e),e.remove()},destroy:function(){this.$bricks.removeClass("masonry-brick").each(function(){this.style.position="",this.style.top="",this.style.left=""});var n=this.element[0].style;for(var r in this.originalStyle)n[r]=this.originalStyle[r];this.element.unbind(".masonry").removeClass("masonry").removeData("masonry"),t(e).unbind(".masonry")}},t.fn.imagesLoaded=function(e){function u(){e.call(n,r)}function a(e){var n=e.target;n.src!==s&&-1===t.inArray(n,o)&&(o.push(n),--i<=0&&(setTimeout(u),r.unbind(".imagesLoaded",a)))}var n=this,r=n.find("img").add(n.filter("img")),i=r.length,s="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",o=[];return i||u(),r.bind("load.imagesLoaded error.imagesLoaded",a).each(function(){var e=this.src;this.src=s,this.src=e}),n};var s=function(t){e.console&&e.console.error(t)};t.fn.masonry=function(e){if("string"==typeof e){var n=Array.prototype.slice.call(arguments,1);this.each(function(){var r=t.data(this,"masonry");return r?t.isFunction(r[e])&&"_"!==e.charAt(0)?void r[e].apply(r,n):void s("no such method '"+e+"' for masonry instance"):void s("cannot call methods on masonry prior to initialization; attempted to call method '"+e+"'")})}else this.each(function(){var n=t.data(this,"masonry");n?(n.option(e||{}),n._init()):t.data(this,"masonry",new t.Mason(e,this))});return this}}(window,jQuery),!function($){$.extend($.fn,{validate:function(options){if(!this.length)return void(options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing"));var validator=$.data(this[0],"validator");return validator?validator:(this.attr("novalidate","novalidate"),validator=new $.validator(options,this[0]),$.data(this[0],"validator",validator),validator.settings.onsubmit&&(this.validateDelegate(":submit","click",function(ev){validator.settings.submitHandler&&(validator.submitButton=ev.target),$(ev.target).hasClass("cancel")&&(validator.cancelSubmit=!0)}),this.submit(function(event){function handle(){var hidden;return validator.settings.submitHandler?(validator.submitButton&&(hidden=$("<input type='hidden'/>").attr("name",validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm)),validator.settings.submitHandler.call(validator,validator.currentForm,event),validator.submitButton&&hidden.remove(),!1):!0}return validator.settings.debug&&event.preventDefault(),validator.cancelSubmit?(validator.cancelSubmit=!1,handle()):validator.form()?validator.pendingRequest?(validator.formSubmitted=!0,!1):handle():(validator.focusInvalid(),!1)})),validator)},valid:function(){if($(this[0]).is("form"))return this.validate().form();var valid=!0,validator=$(this[0].form).validate();return this.each(function(){valid&=validator.element(this)}),valid},removeAttrs:function(attributes){var result={},$element=this;return $.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value),$element.removeAttr(value)}),result},rules:function(command,argument){var element=this[0];if(command){var settings=$.data(element.form,"validator").settings,staticRules=settings.rules,existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument)),staticRules[element.name]=existingRules,argument.messages&&(settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages));break;case"remove":if(!argument)return delete staticRules[element.name],existingRules;var filtered={};return $.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method],delete existingRules[method]}),filtered}}var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required,data=$.extend({required:param},data)}return data}}),$.extend($.expr[":"],{blank:function(a){return!$.trim(""+a.value)},filled:function(a){return!!$.trim(""+a.value)},unchecked:function(a){return!a.checked}}),$.validator=function(options,form){this.settings=$.extend(!0,{},$.validator.defaults,options),this.currentForm=form,this.init()},$.validator.format=function(source,params){return 1===arguments.length?function(){var args=$.makeArray(arguments);return args.unshift(source),$.validator.format.apply(this,args)}:(arguments.length>2&¶ms.constructor!==Array&&(params=$.makeArray(arguments).slice(1)),params.constructor!==Array&&(params=[params]),$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n)}),source)},$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(element,event){this.lastActive=element,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(element)).hide())},onfocusout:function(element,event){this.checkable(element)||!(element.name in this.submitted)&&this.optional(element)||this.element(element)},onkeyup:function(element,event){(9!==event.which||""!==this.elementValue(element))&&(element.name in this.submitted||element===this.lastActive)&&this.element(element)},onclick:function(element,event){element.name in this.submitted?this.element(element):element.parentNode.name in this.submitted&&this.element(element.parentNode)},highlight:function(element,errorClass,validClass){"radio"===element.type?this.findByName(element.name).addClass(errorClass).removeClass(validClass):$(element).addClass(errorClass).removeClass(validClass)},unhighlight:function(element,errorClass,validClass){"radio"===element.type?this.findByName(element.name).removeClass(errorClass).addClass(validClass):$(element).removeClass(errorClass).addClass(validClass)}},setDefaults:function(settings){$.extend($.validator.defaults,settings)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function delegate(event){var validator=$.data(this[0].form,"validator"),eventType="on"+event.type.replace(/^validate/,"");validator&&validator.settings[eventType]&&validator.settings[eventType].call(validator,this[0],event)}this.labelContainer=$(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm),this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var groups=this.groups={};$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key})});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value)}),$(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",delegate).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",delegate),
this.settings.invalidHandler&&$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),$.extend(this.submitted,this.errorMap),this.invalid=$.extend({},this.errorMap),this.valid()||$(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var i=0,elements=this.currentElements=this.elements();elements[i];i++)this.check(elements[i]);return this.valid()},element:function(element){element=this.validationTargetFor(this.clean(element)),this.lastElement=element,this.prepareElement(element),this.currentElements=$(element);var result=this.check(element)!==!1;return result?delete this.invalid[element.name]:this.invalid[element.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),result},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors),this.errorList=[];for(var name in errors)this.errorList.push({message:errors[name],element:this.findByName(name)[0]});this.successList=$.grep(this.successList,function(element){return!(element.name in errors)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){$.fn.resetForm&&$(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(obj){var count=0;for(var i in obj)count++;return count},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(e){}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&1===$.grep(this.errorList,function(n){return n.element.name===lastActive.name}).length&&lastActive},elements:function(){var validator=this,rulesCache={};return $(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in rulesCache||!validator.objectLength($(this).rules())?!1:(rulesCache[this.name]=!0,!0)})},clean:function(selector){return $(selector)[0]},errors:function(){var errorClass=this.settings.errorClass.replace(" ",".");return $(this.settings.errorElement+"."+errorClass,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=$([]),this.toHide=$([]),this.currentElements=$([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(element){this.reset(),this.toHide=this.errorsFor(element)},elementValue:function(element){var type=$(element).attr("type"),val=$(element).val();return"radio"===type||"checkbox"===type?$('input[name="'+$(element).attr("name")+'"]:checked').val():"string"==typeof val?val.replace(/\r/g,""):val},check:function(element){element=this.validationTargetFor(this.clean(element));var result,rules=$(element).rules(),dependencyMismatch=!1,val=this.elementValue(element);for(var method in rules){var rule={method:method,parameters:rules[method]};try{if(result=$.validator.methods[method].call(this,val,element,rule.parameters),"dependency-mismatch"===result){dependencyMismatch=!0;continue}if(dependencyMismatch=!1,"pending"===result)return void(this.toHide=this.toHide.not(this.errorsFor(element)));if(!result)return this.formatAndAdd(element,rule),!1}catch(e){throw this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id+", check the '"+rule.method+"' method",e),e}}return dependencyMismatch?void 0:(this.objectLength(rules)&&this.successList.push(element),!0)},customMetaMessage:function(element,method){if($.metadata){var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method]}},customDataMessage:function(element,method){return $(element).data("msg-"+method.toLowerCase())||element.attributes&&$(element).attr("data-msg-"+method.toLowerCase())},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor===String?m:m[method])},findDefined:function(){for(var i=0;i<arguments.length;i++)if(void 0!==arguments[i])return arguments[i];return void 0},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),this.customDataMessage(element,method),this.customMetaMessage(element,method),!this.settings.ignoreTitle&&element.title||void 0,$.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>")},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method),theregex=/\$?\{(\d+)\}/g;"function"==typeof message?message=message.call(this,rule.parameters,element):theregex.test(message)&&(message=$.validator.format(message.replace(theregex,"{$1}"),rule.parameters)),this.errorList.push({message:message,element:element}),this.errorMap[element.name]=message,this.submitted[element.name]=message},addWrapper:function(toToggle){return this.settings.wrapper&&(toToggle=toToggle.add(toToggle.parent(this.settings.wrapper))),toToggle},defaultShowErrors:function(){var i,elements;for(i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass),this.showLabel(error.element,error.message)}if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(i=0;this.successList[i];i++)this.showLabel(this.successList[i]);if(this.settings.unhighlight)for(i=0,elements=this.validElements();elements[i];i++)this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return $(this.errorList).map(function(){return this.element})},showLabel:function(element,message){var label=this.errorsFor(element);label.length?(label.removeClass(this.settings.validClass).addClass(this.settings.errorClass),label.attr("generated")&&label.html(message)):(label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:!0}).addClass(this.settings.errorClass).html(message||""),this.settings.wrapper&&(label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(label).length||(this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element))),!message&&this.settings.success&&(label.text(""),"string"==typeof this.settings.success?label.addClass(this.settings.success):this.settings.success(label,element)),this.toShow=this.toShow.add(label)},errorsFor:function(element){var name=this.idOrName(element);return this.errors().filter(function(){return $(this).attr("for")===name})},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name)},validationTargetFor:function(element){return this.checkable(element)&&(element=this.findByName(element.name).not(this.settings.ignore)[0]),element},checkable:function(element){return/radio|checkbox/i.test(element.type)},findByName:function(name){return $(this.currentForm).find('[name="'+name+'"]')},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case"select":return $("option:selected",element).length;case"input":if(this.checkable(element))return this.findByName(element.name).filter(":checked").length}return value.length},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):!0},dependTypes:{"boolean":function(param,element){return param},string:function(param,element){return!!$(param,element.form).length},"function":function(param,element){return param(element)}},optional:function(element){var val=this.elementValue(element);return!$.validator.methods.required.call(this,val,element)&&"dependency-mismatch"},startRequest:function(element){this.pending[element.name]||(this.pendingRequest++,this.pending[element.name]=!0)},stopRequest:function(element,valid){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[element.name],valid&&0===this.pendingRequest&&this.formSubmitted&&this.form()?($(this.currentForm).submit(),this.formSubmitted=!1):!valid&&0===this.pendingRequest&&this.formSubmitted&&($(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",{old:null,valid:!0,message:this.defaultMessage(element,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(className,rules){className.constructor===String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className)},classRules:function(element){var rules={},classes=$(element).attr("class");return classes&&$.each(classes.split(" "),function(){this in $.validator.classRuleSettings&&$.extend(rules,$.validator.classRuleSettings[this])}),rules},attributeRules:function(element){var rules={},$element=$(element);for(var method in $.validator.methods){var value;"required"===method?(value=$element.get(0).getAttribute(method),""===value&&(value=!0),value=!!value):value=$element.attr(method),value?rules[method]=value:$element[0].getAttribute("type")===method&&(rules[method]=!0)}return rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)&&delete rules.maxlength,rules},metadataRules:function(element){if(!$.metadata)return{};var meta=$.data(element.form,"validator").settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata()},staticRules:function(element){var rules={},validator=$.data(element.form,"validator");return validator.settings.rules&&(rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{}),rules},normalizeRules:function(rules,element){return $.each(rules,function(prop,val){if(val===!1)return void delete rules[prop];if(val.param||val.depends){var keepRule=!0;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element)}keepRule?rules[prop]=void 0!==val.param?val.param:!0:delete rules[prop]}}),$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter}),$.each(["minlength","maxlength","min","max"],function(){rules[this]&&(rules[this]=Number(rules[this]))}),$.each(["rangelength","range"],function(){var parts;rules[this]&&($.isArray(rules[this])?rules[this]=[Number(rules[this][0]),Number(rules[this][1])]:"string"==typeof rules[this]&&(parts=rules[this].replace(/[\[\]]/g,"").split(/[\s,]+/),rules[this]=[Number(parts[0]),Number(parts[1])]))}),$.validator.autoCreateRanges&&(rules.min&&rules.max&&(rules.range=[rules.min,rules.max],delete rules.min,delete rules.max),rules.minlength&&rules.maxlength&&(rules.rangelength=[rules.minlength,rules.maxlength],delete rules.minlength,delete rules.maxlength)),rules.messages&&delete rules.messages,rules},normalizeRule:function(data){if("string"==typeof data){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=!0}),data=transformed}return data},addMethod:function(name,method,message){$.validator.methods[name]=method,$.validator.messages[name]=void 0!==message?message:$.validator.messages[name],method.length<3&&$.validator.addClassRules(name,$.validator.normalizeRule(name))},methods:{required:function(value,element,param){if(!this.depend(param,element))return"dependency-mismatch";if("select"===element.nodeName.toLowerCase()){var val=$(element).val();return val&&val.length>0}return this.checkable(element)?this.getLength(value,element)>0:$.trim(value).length>0},remote:function(value,element,param){if(this.optional(element))return"dependency-mismatch";var previous=this.previousValue(element);if(this.settings.messages[element.name]||(this.settings.messages[element.name]={}),previous.originalMessage=this.settings.messages[element.name].remote,this.settings.messages[element.name].remote=previous.message,param="string"==typeof param&&{url:param}||param,this.pending[element.name])return"pending";if(previous.old===value)return previous.valid;previous.old=value;var validator=this;this.startRequest(element);var data={};return data[element.name]=value,$.ajax($.extend(!0,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){validator.settings.messages[element.name].remote=previous.originalMessage;var valid=response===!0||"true"===response;if(valid){var submitted=validator.formSubmitted;validator.prepareElement(element),validator.formSubmitted=submitted,validator.successList.push(element),delete validator.invalid[element.name],validator.showErrors()}else{var errors={},message=response||validator.defaultMessage(element,"remote");errors[element.name]=previous.message=$.isFunction(message)?message(value):message,validator.invalid[element.name]=!0,validator.showErrors(errors)}previous.valid=valid,validator.stopRequest(element,valid)}},param)),"pending"},minlength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength($.trim(value),element);return this.optional(element)||length>=param},maxlength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength($.trim(value),element);return this.optional(element)||param>=length},rangelength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength($.trim(value),element);return this.optional(element)||length>=param[0]&&length<=param[1]},min:function(value,element,param){return this.optional(element)||value>=param},max:function(value,element,param){return this.optional(element)||param>=value},range:function(value,element,param){return this.optional(element)||value>=param[0]&&value<=param[1]},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(value)},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value)},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value))},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(value)},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value)},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value)},creditcard:function(value,element){if(this.optional(element))return"dependency-mismatch";if(/[^0-9 \-]+/.test(value))return!1;var nCheck=0,nDigit=0,bEven=!1;value=value.replace(/\D/g,"");for(var n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);nDigit=parseInt(cDigit,10),bEven&&(nDigit*=2)>9&&(nDigit-=9),nCheck+=nDigit,bEven=!bEven}return nCheck%10===0},equalTo:function(value,element,param){var target=$(param);return this.settings.onfocusout&&target.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){$(element).valid()}),value===target.val()}}}),$.format=$.validator.format}(jQuery),function($){var pendingRequests={};if($.ajaxPrefilter)$.ajaxPrefilter(function(settings,_,xhr){var port=settings.port;"abort"===settings.mode&&(pendingRequests[port]&&pendingRequests[port].abort(),pendingRequests[port]=xhr)});else{var ajax=$.ajax;$.ajax=function(settings){var mode=("mode"in settings?settings:$.ajaxSettings).mode,port=("port"in settings?settings:$.ajaxSettings).port;return"abort"===mode?(pendingRequests[port]&&pendingRequests[port].abort(),pendingRequests[port]=ajax.apply(this,arguments)):ajax.apply(this,arguments)}}}(jQuery),function($){jQuery.event.special.focusin||jQuery.event.special.focusout||!document.addEventListener||$.each({focus:"focusin",blur:"focusout"},function(original,fix){function handler(e){return e=$.event.fix(e),e.type=fix,$.event.handle.call(this,e)}$.event.special[fix]={setup:function(){this.addEventListener(original,handler,!0)},teardown:function(){this.removeEventListener(original,handler,!0)},handler:function(e){var args=arguments;return args[0]=$.event.fix(e),args[0].type=fix,$.event.handle.apply(this,args)}}}),$.extend($.fn,{validateDelegate:function(delegate,type,handler){return this.bind(type,function(event){var target=$(event.target);return target.is(delegate)?handler.apply(target,arguments):void 0})}})}(jQuery),jQuery.extend(jQuery.validator.messages,{required:"必填内容",remote:"请勿输入非法字符与非法关键词",email:"请输入正确格式的电子邮件",url:"请输入合法的网址",date:"请输入合法的日期",dateISO:"请输入合法的日期 (ISO).",number:"请输入合法的数字",digits:"只能输入正整数",creditcard:"请输入合法的信用卡号",equalTo:"请再次输入相同的值",accept:"请输入拥有合法后缀名的字符串",money:"请输入正确的金额格式",maxlength:jQuery.validator.format("请输入一个长度最多是 {0} 的字符串"),minlength:jQuery.validator.format("请输入一个长度最少是 {0} 的字符串"),rangelength:jQuery.validator.format("请输入一个长度介于 {0} 和 {1} 之间的字符串"),range:jQuery.validator.format("请输入一个介于 {0} 和 {1} 之间的值"),max:jQuery.validator.format("请输入一个最大为 {0} 的值"),min:jQuery.validator.format("请输入一个最小为 {0} 的值"),notIllegalCharacter:"请输入正确的内容",isPhone:"请输入正确的电话号码",isMultiPhone:"请输入正确的电话号码",isChar:"请填写正确的中文, 字母或者数字"}),$.validator.setDefaults({focusInvalid:!0,focusCleanup:!1}),$.validator.setDefaults({errorPlacement:function(error,element){try{element.parent().is("span")?error.addClass("new-error-placement").appendTo(element.parent().parent()):error.addClass("new-error-placement").appendTo(element.parent("td"))}catch(e){$(element).focus()}}}),jQuery.validator.addMethod("isIdCardNo",function(value,element){return this.optional(element)||isIdCardNo(value)},"请正确输入您的身份证号码"),jQuery.validator.addMethod("isMobile",function(value,element){var length=value.length;return this.optional(element)||11==length&&/^1[3-8]\d{9}$/.test(value)},"请填写正确的手机号码"),jQuery.validator.addMethod("isVerifCode",function(value,element){var length=value.length;return this.optional(element)||6==length&&/^\d{6}$/.test(value)},"请填写正确的验证码"),jQuery.validator.addMethod("isCompany",function(value,element){return value.length,this.optional(element)||/^[\u4E00-\u9FA5]+$/.test(value)},"请填写正确的企业名称"),jQuery.validator.addMethod("isChar",function(value,element){return value.length,this.optional(element)||/^[\u4E00-\u9FA50-9a-zA-Z]+$/.test(value)},"请填写正确的中文, 字母或者数字!"),jQuery.validator.addMethod("isConcat",function(value,element){return value.length,this.optional(element)||/^[\u4E00-\u9FA50-9a-zA-Z\-]+$/.test(value)},"输入中含有非法字符!"),jQuery.validator.addMethod("isRealName",function(value,element){return this.optional(element)||/^[\u4E00-\u9FA5+·]{2,10}$/.test(value)&&!/^[\u4E00-\u9FA5+·]{2,10}[·]$/.test(value)&&!/^[·][\u4E00-\u9FA5+.]{2,10}$/.test(value)},"请填写正确的名字"),jQuery.validator.addMethod("money",function(value,element){var money=/^([1-9][0-9]+|[0-9])(\.\d{1,2})?$/;return this.optional(element)||money.test(value)},"请输入正确的金额"),jQuery.validator.addMethod("isPhone",function(value,element){var phone=/((^\d{11}$)|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/;return this.optional(element)||phone.test(value)},"请输入正确的电话号码"),jQuery.validator.addMethod("isMultiPhone",function(value,element){var phone=/^(((\d{11})|((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})))([;、;,、,]?))+$/;return this.optional(element)||phone.test(value)},"请输入正确的电话号码"),jQuery.validator.addMethod("isPlane",function(value,element){var tel=/^(\d{3,4}-)\d{7,9}$/g;return this.optional(element)||tel.test(value)},"请正确填写您的联系电话。"),jQuery.validator.addMethod("isTel",function(value,element){var length=value.length,mobile=/^1[3-8]\d{9}$/,tel=/^(\d{3,4}-)\d{7,9}$/g;return this.optional(element)||tel.test(value)||11==length&&mobile.test(value)},"请正确填写您的联系方式"),jQuery.validator.addMethod("notIllegalCharacter",function(value,element){var char=/^[^><\/\\;&]*$/;return this.optional(element)||char.test(value)},"请输入正确的内容"),jQuery.validator.addMethod("isBusinessReg",function(value,element){return this.optional(element)||reg(value)},"请填写正确的工商注册号码"),jQuery.validator.addMethod("diliMethod",function(value,element,param){var me=param,t=window[me].call(this,value,element);return 1!=t?($.validator.messages.diliMethod=t,!1):!0}),jQuery.validator.addMethod("diliPattern",function(value,element,param){var params=param.split("/,"),pa=eval(params[0]+"/"),msg=params[1],t=pa.test(value);return 0==t&&($.validator.messages.diliPattern=void 0!==msg?msg:$.validator.messages[msg]),t}),jQuery.validator.addMethod("isCarNo",function(value,element){var carNO=/^[\u4E00-\u9FA5]{1}[a-zA-Z]{1}[\da-zA-Z]{5}$/;return this.optional(element)||carNO.test(value)},"请输入正确的车牌号码!"),jQuery.validator.addMethod("isAddr",function(value,element){var reg=/[\#\<\>\=\'\"]+/g;return this.optional(element)||!reg.test(value)},"请输入正确的地址信息!"),jQuery.validator.addMethod("filterCharacter",function(value,element){var char=/^[0-9a-zA-Z\u4e00-\u9fa5\/()()&《》【】\+=\]\[]+$/g;return this.optional(element)||char.test(value)},"请输入正确的内容"),function(d){function e(a){var b=a||window.event,c=[].slice.call(arguments,1),f=0,e=0,g=0,a=d.event.fix(b);return a.type="mousewheel",b.wheelDelta&&(f=b.wheelDelta/120),b.detail&&(f=-b.detail/3),g=f,void 0!==b.axis&&b.axis===b.HORIZONTAL_AXIS&&(g=0,e=-1*f),void 0!==b.wheelDeltaY&&(g=b.wheelDeltaY/120),void 0!==b.wheelDeltaX&&(e=-1*b.wheelDeltaX/120),c.unshift(a,f,e,g),(d.event.dispatch||d.event.handle).apply(this,c)}var c=["DOMMouseScroll","mousewheel"];if(d.event.fixHooks)for(var h=c.length;h;)d.event.fixHooks[c[--h]]=d.event.mouseHooks;d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],e,!1);else this.onmousewheel=e},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],e,!1);else this.onmousewheel=null}},d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}(jQuery),function(r,G,f,v){var J=f("html"),n=f(r),p=f(G),b=f.fancybox=function(){b.open.apply(this,arguments)},I=navigator.userAgent.match(/msie/i),B=null,s=G.createTouch!==v,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},q=function(a){return a&&"string"===f.type(a)},E=function(a){return q(a)&&0<a.indexOf("%")},l=function(a,d){var e=parseInt(a,10)||0;return d&&E(a)&&(e*=b.getViewport()[d]/100),Math.ceil(e)},w=function(a,b){return l(a,b)+"px"};f.extend(b,{version:"2.1.5",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!s,fitToView:!0,aspectRatio:!1,topRatio:.5,leftRatio:.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3e3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+(I?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="关闭" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){return a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0))?(f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var g,h,j,m,l,k={};"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k,c.metadata())):k=c),g=d.href||k.href||(q(c)?c:null),h=d.title!==v?d.title:k.title||"",m=(j=d.content||k.content)?"html":d.type||k.type,!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null)),q(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":q(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift())),j||("inline"===m?g?j=f(q(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&!g&&k.isDom&&(m="inline",j=c)),f.extend(k,{href:g,type:m,content:j,title:h,selector:l}),a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==v&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)):void 0},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current||b._afterZoomOut(a))},close:function(a){b.cancel(),!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(b.isOpen&&!0!==a?(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]()):(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d(),b.current&&b.player.isActive&&(b.player.timer=setTimeout(b.next,b.current.playSpeed))},c=function(){d(),p.unbind(".player"),b.player.isActive=!1,b.trigger("onPlayEnd")};!0===a||!b.player.isActive&&!1!==a?b.current&&(b.current.loop||b.current.index<b.group.length-1)&&(b.player.isActive=!0,p.bind({"onCancel.player beforeClose.player":c,"onUpdate.player":e,"beforeLoad.player":d}),e(),b.trigger("onPlayStart")):c()},next:function(a){var d=b.current;d&&(q(a)||(a=d.direction.next),b.jumpto(d.index+1,a,"next"))},prev:function(a){var d=b.current;d&&(q(a)||(a=d.direction.prev),b.jumpto(d.index-1,a,"prev"))},jumpto:function(a,d,e){var c=b.current;c&&(a=l(a),b.direction=d||c.direction[a>=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==v&&(b.cancel(),b._start(a)))},reposition:function(a,d){var k,e=b.current,c=e?e.wrap:null;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},e.dim,k)))},update:function(a){var d=a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(B),B=null),b.isOpen&&!B&&(B=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),B=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate")),b.update())},hideLoading:function(){p.unbind(".loading"),f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading(),a=f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body"),p.bind("keydown.loading",function(a){27===(a.which||a.keyCode)&&(a.preventDefault(),b.cancel())}),b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:.5*d.h+d.y,left:.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||!1,d={x:n.scrollLeft(),y:n.scrollTop()};return a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&r.innerWidth?r.innerWidth:n.width(),d.h=s&&r.innerHeight?r.innerHeight:n.height()),d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb"),p.unbind(".fb"),n.unbind(".fb")},bindEvents:function(){var d,a=b.current;a&&(n.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=e.target||e.srcElement;return 27===c&&b.coming?!1:void(!e.ctrlKey&&!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]"))&&f.each(d,function(d,k){
return 1<a.group.length&&k[c]!==v?(b[d](k[c]),e.preventDefault(),!1):-1<f.inArray(c,k)?(b[d](),e.preventDefault(),!1):void 0}))}),f.fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(d,c,k,g){for(var h=f(d.target||null),j=!1;h.length&&!j&&!h.is(".fancybox-skin")&&!h.is(".fancybox-wrap");)j=h[0]&&!(h[0].style.overflow&&"hidden"===h[0].style.overflow)&&(h[0].clientWidth&&h[0].scrollWidth>h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();0!==c&&!j&&1<b.group.length&&!a.canShrink&&(g>0||k>0?b.prev(g>0?"down":"left"):(0>g||0>k)&&b.next(0>g?"up":"right"),d.preventDefault())}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){if(f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1))),!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){e&&b.helpers[d]&&f.isFunction(b.helpers[d][a])&&b.helpers[d][a](f.extend(!0,{},b.helpers[d].defaults,e),c)}),p.trigger(a)}},isImage:function(a){return q(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return q(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var e,c,d={};if(a=l(a),e=b.group[a]||null,!e)return!1;if(d=f.extend(!0,{},b.opts,e),e=d.margin,c=d.padding,"number"===f.type(e)&&(d.margin=[e,e,e,e]),"number"===f.type(c)&&(d.padding=[c,c,c,c]),d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}}),d.autoSize&&(d.autoWidth=d.autoHeight=!0),"auto"===d.width&&(d.autoWidth=!0),"auto"===d.height&&(d.autoHeight=!0),d.group=b.group,d.index=a,b.coming=d,!1===b.trigger("beforeLoad"))b.coming=null;else{if(c=d.type,e=d.href,!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;if(b.isActive=!0,("image"===c||"swf"===c)&&(d.autoHeight=d.autoWidth=!1,d.scrolling="visible"),"image"===c&&(d.aspectRatio=!0),"iframe"===c&&s&&(d.scrolling="scroll"),d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body"),f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)}),f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,w(d.padding[a]))}),b.trigger("onReady"),"inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error}),b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null,b.coming.width=this.width/b.opts.pixelRatio,b.coming.height=this.height/b.opts.pixelRatio,b._afterLoad()},a.onerror=function(){this.onload=this.onerror=null,b._error("image")},a.src=b.coming.href,!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading(),b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href);f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}}),a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1),s||f(this).bind("load.fb",b.update),f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show(),b._afterLoad()})),a.content=d.appendTo(a.inner),a.iframe.preload||b._afterLoad()},_preloadImages:function(){var f,g,a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,e-1):0;for(g=1;c>=g;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var e,c,k,g,h,a=b.coming,d=b.current;if(b.hideLoading(),a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{switch(d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()),b.unbindEvents(),e=a.content,c=a.type,k=a.scrolling,f.extend(b,{wrap:a.wrap,skin:a.skin,outer:a.outer,inner:a.inner,current:a,previous:d}),g=a.href,c){case"inline":case"ajax":case"html":a.selector?e=f("<div>").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case"image":e=a.tpl.image.replace("{href}",g);break;case"swf":e='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+g+'"></param>',h="",f.each(a.swf,function(a,b){e+='<param name="'+a+'" value="'+b+'"></param>',h+=" "+a+'="'+b+'"'}),e+='<embed src="'+g+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"></embed></object>"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e),b.trigger("beforeShow"),a.inner.css("overflow","yes"===k?"scroll":"no"===k?"hidden":k),b._setDimension(),b.reposition(),b.isOpen=!1,b.coming=null,b.bindEvents(),b.isOpened?d.prevMethod&&b.transitions[d.prevMethod]():f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove(),b.transitions[b.isOpened?a.nextMethod:a.openMethod](),b._preloadImages()}},_setDimension:function(){var v,z,t,C,A,F,B,D,H,a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,p=h.maxHeight,s=h.scrolling,q=h.scrollOutside?h.scrollbarWidth:0,x=h.margin,y=l(x[1]+x[3]),r=l(x[0]+x[2]);if(e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp"),x=l(k.outerWidth(!0)-k.width()),v=l(k.outerHeight(!0)-k.height()),z=y+x,t=r+v,C=E(c)?(a.w-z)*l(c)/100:c,A=E(j)?(a.h-t)*l(j)/100:j,"iframe"===h.type){if(H=h.content,h.autoHeight&&1===H.data("ready"))try{H[0].contentWindow.document.location&&(g.width(C).height(9999),F=H.contents().find("body"),q&&F.css("overflow-x","hidden"),A=F.outerHeight(!0))}catch(G){}}else(h.autoWidth||h.autoHeight)&&(g.addClass("fancybox-tmp"),h.autoWidth||g.width(C),h.autoHeight||g.height(A),h.autoWidth&&(C=g.width()),h.autoHeight&&(A=g.height()),g.removeClass("fancybox-tmp"));if(c=l(C),j=l(A),D=C/A,m=l(E(m)?l(m,"w")-z:m),n=l(E(n)?l(n,"w")-z:n),u=l(E(u)?l(u,"h")-t:u),p=l(E(p)?l(p,"h")-t:p),F=n,B=p,h.fitToView&&(n=Math.min(a.w-z,n),p=Math.min(a.h-t,p)),z=a.w-y,r=a.h-r,h.aspectRatio?(c>n&&(c=n,j=l(c/D)),j>p&&(j=p,c=l(j*D)),m>c&&(c=m,j=l(c/D)),u>j&&(j=u,c=l(j*D))):(c=Math.max(m,Math.min(c,n)),h.autoHeight&&"iframe"!==h.type&&(g.width(c),j=g.height()),j=Math.max(u,Math.min(j,p))),h.fitToView)if(g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height(),h.aspectRatio)for(;(a>z||y>r)&&c>m&&j>u&&!(19<d++);)j=Math.max(u,Math.min(p,j-10)),c=l(j*D),m>c&&(c=m,j=l(c/D)),c>n&&(c=n,j=l(c/D)),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height();else c=Math.max(m,Math.min(c,c-(a-z))),j=Math.max(u,Math.min(j,j-(y-r)));q&&"auto"===s&&A>j&&z>c+x+q&&(c+=q),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height(),e=(a>z||y>r)&&c>m&&j>u,c=h.aspectRatio?F>c&&B>j&&C>c&&A>j:(F>c||B>j)&&(C>c||A>j),f.extend(h,{dim:{width:w(a),height:w(y)},origWidth:C,origHeight:A,canShrink:e,canExpand:c,wPadding:x,hPadding:v,wrapSpace:y-k.outerHeight(!0),skinSpace:k.height()-j}),!H&&h.autoHeight&&j>u&&p>j&&!c&&g.height("auto")},_getPosition:function(a){var d=b.current,e=b.getViewport(),c=d.margin,f=b.wrap.width()+c[1]+c[3],g=b.wrap.height()+c[0]+c[2],c={position:"absolute",top:c[0],left:c[3]};return d.autoCenter&&d.fixed&&!a&&g<=e.h&&f<=e.w?c.position="fixed":d.locked||(c.top+=e.y,c.left+=e.x),c.top=w(Math.max(c.top,c.top+(e.h-g)*d.topRatio)),c.left=w(Math.max(c.left,c.left+(e.w-f)*d.leftRatio)),c},_afterZoomIn:function(){var a=b.current;a&&(b.isOpen=b.isOpened=!0,b.wrap.css("overflow","visible").addClass("fancybox-opened"),b.update(),(a.closeClick||a.nextClick&&1<b.group.length)&&b.inner.css("cursor","pointer").bind("click.fb",function(d){!f(d.target).is("a")&&!f(d.target).parent().is("a")&&(d.preventDefault(),b[a.closeClick?"close":"next"]())}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb",function(a){a.preventDefault(),b.close()}),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),a.loop||a.index!==a.group.length-1?b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay=!1,b.play()):b.play(!1))},_afterZoomOut:function(a){a=a||b.current,f(".fancybox-wrap").trigger("onReset").remove(),f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null}),b.trigger("afterClose",a)}}),b.transitions={getOrigPosition:function(){var a=b.current,d=a.element,e=a.orig,c={},f=50,g=50,h=a.hPadding,j=a.wPadding,m=b.getViewport();return!e&&a.isDom&&d.is(":visible")&&(e=d.find("img:first"),e.length||(e=d)),t(e)?(c=e.offset(),e.is("img")&&(f=e.outerWidth(),g=e.outerHeight())):(c.top=m.y+(m.h-g)*a.topRatio,c.left=m.x+(m.w-f)*a.leftRatio),("fixed"===b.wrap.css("position")||a.locked)&&(c.top-=m.y,c.left-=m.x),c={top:w(c.top-h*a.topRatio),left:w(c.left-j*a.leftRatio),width:w(f+j),height:w(g+h)}},step:function(a,d){var e,c,f=d.prop;c=b.current;var g=c.wrapSpace,h=c.skinSpace;("width"===f||"height"===f)&&(e=d.end===d.start?1:(a-d.start)/(d.end-d.start),b.isClosing&&(e=1-e),c="width"===f?c.wPadding:c.hPadding,c=a-c,b.skin[f](l("width"===f?c:c-g*e)),b.inner[f](l("width"===f?c:c-g*e-h*e)))},zoomIn:function(){var a=b.current,d=a.pos,e=a.openEffect,c="elastic"===e,k=f.extend({opacity:1},d);delete k.position,c?(d=this.getOrigPosition(),a.openOpacity&&(d.opacity=.1)):"fade"===e&&(d.opacity=.1),b.wrap.css(d).animate(k,{duration:"none"===e?0:a.openSpeed,easing:a.openEasing,step:c?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){var a=b.current,d=a.closeEffect,e="elastic"===d,c={opacity:.1};e&&(c=this.getOrigPosition(),a.closeOpacity&&(c.opacity=.1)),b.wrap.animate(c,{duration:"none"===d?0:a.closeSpeed,easing:a.closeEasing,step:e?this.step:null,complete:b._afterZoomOut})},changeIn:function(){var g,a=b.current,d=a.nextEffect,e=a.pos,c={opacity:1},f=b.direction;e.opacity=.1,"elastic"===d&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(e[g]=w(l(e[g])-200),c[g]="+=200px"):(e[g]=w(l(e[g])+200),c[g]="-=200px")),"none"===d?b._afterZoomIn():b.wrap.css(e).animate(c,{duration:a.nextSpeed,easing:a.nextEasing,complete:b._afterZoomIn})},changeOut:function(){var a=b.previous,d=a.prevEffect,e={opacity:.1},c=b.direction;"elastic"===d&&(e["down"===c||"up"===c?"top":"left"]=("up"===c||"left"===c?"-":"+")+"=200px"),a.wrap.animate(e,{duration:"none"===d?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset").remove()}})}},b.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!s,fixed:!0},overlay:null,fixed:!1,el:f("html"),create:function(a){a=f.extend({},this.defaults,a),this.overlay&&this.close(),this.overlay=f('<div class="fancybox-overlay"></div>').appendTo(b.coming?b.coming.parent:a.parent),this.fixed=!1,a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a),this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a),this.fixed||(n.bind("resize.overlay",f.proxy(this.update,this)),this.update()),a.closeClick&&this.overlay.bind("click.overlay",function(a){return f(a.target).hasClass("fancybox-overlay")?(b.isActive?b.close():d.close(),!1):void 0}),this.overlay.css(a.css).show()},close:function(){var a,b;n.unbind("resize.overlay"),this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),a=n.scrollTop(),b=n.scrollLeft(),this.el.removeClass("fancybox-lock"),n.scrollTop(a).scrollLeft(b)),f(".fancybox-overlay").remove().hide(),f.extend(this,{overlay:null,fixed:!1})},update:function(){var b,a="100%";this.overlay.width(a).height("100%"),I?(b=Math.max(G.documentElement.offsetWidth,G.body.offsetWidth),p.width()>b&&(a=p.width())):p.width()>n.width()&&(a=p.width()),this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0),e||this.create(a),a.locked&&this.fixed&&b.fixed&&(e||(this.margin=p.height()>n.height()?f("html").css("margin-right").replace("px",""):!1),b.locked=this.overlay.append(b.wrap),b.fixed=!1),!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){var e,c;b.locked&&(!1!==this.margin&&(f("*").filter(function(){return"fixed"===f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),e=n.scrollTop(),c=n.scrollLeft(),this.el.addClass("fancybox-lock"),n.scrollTop(e).scrollLeft(c)),this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}},b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d=b.current,e=d.title,c=a.type;if(f.isFunction(e)&&(e=e.call(d.element,d)),q(e)&&""!==f.trim(e)){switch(d=f('<div class="fancybox-title fancybox-title-'+c+'-wrap">'+e+"</div>"),c){case"inside":c=b.skin;break;case"outside":c=b.wrap;break;case"over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),I&&d.width(d.width()),d.wrapInner('<span class="child"></span>'),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}},f.fn.fancybox=function(a){var d,e=f(this),c=this.selector||"",k=function(g){var k,l,h=f(this).blur(),j=d;!g.ctrlKey&&!g.altKey&&!g.shiftKey&&!g.metaKey&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&""!==l&&"nofollow"!==l&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+'"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};return a=a||{},d=a.index||0,c&&!1!==a.live?p.undelegate(c,"click.fb-start").delegate(c+":not('.fancybox-item, .fancybox-nav')","click.fb-start",k):e.unbind("click.fb-start").bind("click.fb-start",k),this.filter("[data-fancybox-start=1]").trigger("click"),this},p.ready(function(){var a,d;if(f.scrollbarWidth===v&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();return a.remove(),b}),f.support.fixedPosition===v){a=f.support,d=f('<div style="position:fixed;top:20px;"></div>').appendTo("body");var e=20===d[0].offsetTop||15===d[0].offsetTop;d.remove(),a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")}),a=f(r).width(),J.addClass("fancybox-lock-test"),d=f(r).width(),J.removeClass("fancybox-lock-test"),f("<style type='text/css'>.fancybox-margin{margin-right:"+(d-a)+"px;}</style>").appendTo("head")})}(window,document,jQuery),define(function(require,exports,module){var _Base=require("base"),_Defval=require("defval"),_Jselect=require("jselect"),_Qsearch=(require("scrollfixed"),require("event"),require("qsearch")),_Simpletree=require("simpleTree");require("validate.extend"),require("mousewheel"),require("fancybox"),$(function(){_Base.lazyload($("img"),0),$("#s-page-loading").length>0&&$("#s-page-loading").remove(),$("input[defval], textarea[defval]").each(function(){new _Defval(this,{fontColor:"#ccc"})}),$(".search-bar input[type='text']").length>0&&$(".search-bar input[type='text']").each(function(){new _Qsearch(this,{form:$(this).parents(".search-bar").find("form"),submitLocked:!1,loading:"",ajaxUrl:"http://search.nong12.com/newTip.html?callFn=?",searchBefore:function(){var type=$(".goods").attr("name");return type="goods"==type?"STG":"STORE","&type="+type}})}),$(".s-select").length>0&&$(".s-select").each(function(){new _Jselect(this,{})}),$(".s-validate").length>0&&require.async(["validate.extend"],function(){$(".s-validate").each(function(){$(this).validate({ignore:".ignore"})})}),$(".search-bar").length>0&&($(".cat p").click(function(){$(".cat").hasClass("choose")?$(".cat").removeClass("choose"):$(".cat").addClass("choose")}),$(".cat li").live("click",function(){$(".cat").removeClass("choose");var text=$(this).find("span").html();$(".cat p").html($(this).find("span").html()+' <span class="icon-more"></span>'),$(".cat ul").html(""),"店铺"!=text?($(".searchForm").attr("action","http://search.nong12.com/goods.html"),$(".goods").attr("name","goods"),$(".cat ul").append('<li ><span>产品</span></li><li class="more"><span>店铺</span></li>')):($(".searchForm").attr("action","http://search.nong12.com/shop.html"),$(".goods").attr("name","store"),$(".cat ul").append('<li><span>店铺</span></li><li class="more"><span>产品</span></li>'))}),$(".search-bar input").focus(function(){$(this).parents().next().stop().slideDown(200)}),$(".search-list a").live("click",function(){return $(".search-list").stop().slideUp(200),$(".search-bar input").val($(this).html()),!1}),$(document).bind("click",function(e){var target=$(e.target);0==target.closest(".search-bar .cat").length&&$(".search-bar .cat").removeClass("choose")})),$(".menutree").length>0&&$(".menutree").each(function(){new _Simpletree(this,{handler:">div",toggleClass:"title-selected",showtarget:".show-menu",currentClass:".on"})}),$(".s-fancybox").fancybox({openEffect:"elastic",closeEffect:"elastic",scrolling:"visible"})}),$(".J-select-operation").length&&$(".J-select-operation").each(function(){var ul,_this=this,gather=$(this).find("option"),name={show:"J-select-show",color:"ora",link:"J-look",first:"J-first",url:"data-url",click:"data-onclick"};$('<div class="'+name.show+'"><ul></ul></div>').insertAfter($(this)),ul=$(this).next().find("ul");for(var i=0,l=gather.length;l>i;i++){var _clickEvent=gather.eq(i).attr(name.click),_href=gather.eq(i).attr(name.url);ul.append("<li><a "+(_href?'href="'+_href+'" ':"")+(_clickEvent?'onclick="'+_clickEvent+'" ':"")+'class="'+name.link+'">'+gather.eq(i).html()+"</a></li>")}ul.find("a").eq(0).attr("class",name.color).append('<i class="J-down"></i>'),ul.find("li").eq(0).addClass(name.first),$(this).next().append('<a class="'+name.color+'">'+gather.eq(0).html()+'<i class="J-down"></i></a>'),$(this).next().find(">a").on({mouseenter:function(){ul.css({width:parseInt($(this).width())+40}),ul.show()}}),ul.on({mouseleave:function(){$(this).hide()}}),ul.find("li").on({click:function(){$(_this).find("option").removeAttr("selected"),$(_this).find("option").eq($(this).index()).attr("selected","selected")}})})});