PageSourceSearch

http://jiaxiong.cc/js/a.js

js jiaxiong.cc collected 2026-10-07 10:45:39 UTC 472,748 bytes, 7,968 lines download raw bytes

vendor: 94,840 bytes, lines 1-4
1/*! jQuery v1.7.2 jquery.com | jquery.org/license */
2(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return l}function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return d;d=parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return d+"px"}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h,i){var j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in d)e.access(a,c,l,d[l],1,h,f);g=1}else if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m,n=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return this},fire:function(){p.fireWith(this,arguments);return this},fired:function(){return!!i}};return p};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="<div "+n+"display:block;'><div style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h,i,j=this[0],k=0,m=null;if(a===b){if(this.length){m=f.data(j);if(j.nodeType===1&&!f._data(j,"parsedAttrs")){g=j.attributes;for(i=g.length;k<i;k++)h=g[k].name,h.indexOf("data-")===0&&(h=f.camelCase(h.substring(5)),l(j,h,m[h]));f._data(j,"parsedAttrs",!0)}}return m}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!";return f.access(this,function(c){if(c===b){m=this.triggerHandler("getData"+e,[d[0]]),m===b&&j&&(m=f.data(j,a),m=l(j,a,m));return m===b&&d[1]?this.data(d[0]):m}d[1]=c,this.each(function(){var b=f(this);b.triggerHandler("setData"+e,d),f.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length<d)return f.queue(this[0],a);return c===b?this:this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise(c)}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,f.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i<g;i++)e=d[i],e&&(c=f.propFix[e]||e,h=u.test(e),h||f.attr(a,e,""),a.removeAttribute(v?e:c),h&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0,coords:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(
3a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:g&&G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=f.event.special[c.type]||{},j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(!i.preDispatch||i.preDispatch.call(this,c)!==!1){if(e&&(!c.button||c.type!=="click")){n=f(this),n.context=this.ownerDocument||this;for(m=c.target;m!=this;m=m.parentNode||this)if(m.disabled!==!0){p={},r=[],n[0]=m;for(k=0;k<e;k++)s=d[k],t=s.selector,p[t]===b&&(p[t]=s.quick?H(m,s.quick):n.is(t)),p[t]&&r.push(s);r.length&&j.push({elem:m,matches:r})}}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){q=j[k],c.currentTarget=q.elem;for(l=0;l<q.matches.length&&!c.isImmediatePropagationStopped();l++){s=q.matches[l];if(h||!c.namespace&&!s.namespace||c.namespace_re&&c.namespace_re.test(s.namespace))c.data=s.data,c.handleObj=s,o=((f.event.special[s.origType]||{}).handle||s.handler).apply(q.elem,g),o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()))}}i.postDispatch&&i.postDispatch.call(this,c);return c.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),d._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9||d===11){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.globalPOS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")[\\s/>]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f
4.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(f.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,function(a,b){b.src?f.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1></$2>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]==="<table>"&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i<u;i++)bn(l[i]);else bn(l);l.nodeType?j.push(l):j=f.merge(j,l)}if(d){g=function(a){return!a.type||be.test(a.type)};for(k=0;j[k];k++){h=j[k];if(e&&f.nodeName(h,"script")&&(!h.type||be.test(h.type)))e.push(h.parentNode?h.parentNode.removeChild(h):h);else{if(h.nodeType===1){var v=f.grep(h.getElementsByTagName("script"),g);j.splice.apply(j,[k+1,0].concat(v))}d.appendChild(h)}}}return j},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/([A-Z]|^ms)/g,bs=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,bu=/^([\-+])=([\-+.\de]+)/,bv=/^margin/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Top","Right","Bottom","Left"],by,bz,bA;f.fn.css=function(a,c){return f.access(this,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)},a,c,arguments.length>1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),(e===""&&f.css(d,"display")==="none"||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",cu(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ct("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(ct("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o,p,q;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]);if((k=f.cssHooks[g])&&"expand"in k){l=k.expand(a[g]),delete a[g];for(i in l)i in a||(a[i]=l[i])}}for(g in a){h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cu(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cm.test(h)?(q=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),q?(f._data(this,"toggle"+i,q==="show"?"hide":"show"),j[q]()):j[h]()):(m=cn.exec(h),n=j.cur(),m?(o=parseFloat(m[2]),p=m[3]||(f.cssNumber[i]?"":"px"),p!=="px"&&(f.style(this,i,(o||1)+p),n=(o||1)/j.cur()*n,f.style(this,i,n+p)),m[1]&&(o=(m[1]==="-="?-1:1)*o+n),j.custom(n,o,p)):j.custom(n,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:ct("show",1),slideUp:ct("hide",1),slideToggle:ct("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cq||cr(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){f._data(e.elem,"fxshow"+e.prop)===b&&(e.options.hide?f._data(e.elem,"fxshow"+e.prop,e.start):e.options.show&&f._data(e.elem,"fxshow"+e.prop,e.end))},h()&&f.timers.push(h)&&!co&&(co=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cq||cr(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(cp.concat.apply([],cp),function(a,b){b.indexOf("margin")&&(f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)})}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cv,cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?cv=function(a,b,c,d){try{d=a.getBoundingClientRect()}catch(e){}if(!d||!f.contains(c,a))return d?{top:d.top,left:d.left}:{top:0,left:0};var g=b.body,h=cy(b),i=c.clientTop||g.clientTop||0,j=c.clientLeft||g.clientLeft||0,k=h.pageYOffset||f.support.boxModel&&c.scrollTop||g.scrollTop,l=h.pageXOffset||f.support.boxModel&&c.scrollLeft||g.scrollLeft,m=d.top+k-i,n=d.left+l-j;return{top:m,left:n}}:cv=function(a,b,c){var d,e=a.offsetParent,g=a,h=b.body,i=b.defaultView,j=i?i.getComputedStyle(a,null):a.currentStyle,k=a.offsetTop,l=a.offsetLeft;while((a=a.parentNode)&&a!==h&&a!==c){if(f.support.fixedPosition&&j.position==="fixed")break;d=i?i.getComputedStyle(a,null):a.currentStyle,k-=a.scrollTop,l-=a.scrollLeft,a===e&&(k+=a.offsetTop,l+=a.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(a.nodeName))&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),g=e,e=a.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),j=d}if(j.position==="relative"||j.position==="static")k+=h.offsetTop,l+=h.offsetLeft;f.support.fixedPosition&&j.position==="fixed"&&(k+=Math.max(c.scrollTop,h.scrollTop),l+=Math.max(c.scrollLeft,h.scrollLeft));return{top:k,left:l}},f.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){f.offset.setOffset(this,a,b)});var c=this[0],d=c&&c.ownerDocument;if(!d)return null;if(c===d.body)return f.offset.bodyOffset(c);return cv(c,d,d.documentElement)},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
4;
5/*!
6 * jQuery UI 1.8.17
7 *
8 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
9 * Dual licensed under the MIT or GPL Version 2 licenses.
10 * http://jquery.org/license
11 *
12 * http://docs.jquery.com/UI
13 */(function(a,b){function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;if(!b.href||!g||f.nodeName.toLowerCase()!=="map")return!1;h=a("img[usemap=#"+g+"]")[0];return!!h&&d(h)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}a.ui=a.ui||{};a.ui.version||(a.extend(a.ui,{version:"1.8.17",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){if(c===b)return g["inner"+d].call(this);return this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){if(typeof b!="number")return g["outer"+d].call(this,b);return this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!!d&&!!a.element[0].parentNode)for(var e=0;e<d.length;e++)a.options[d[e][0]]&&d[e][1].apply(a.element,c)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if(a(b).css("overflow")==="hidden")return!1;var d=c&&c==="left"?"scrollLeft":"scrollTop",e=!1;if(b[d]>0)return!0;
13b[d]=1,e=b[d]>0,b[d]=0;return e},isOverAxis:function(a,b,c){return a>b&&a<b+c},isOver:function(b,c,d,e,f,g){return a.ui.isOverAxis(b,d,f)&&a.ui.isOverAxis(c,e,g)}}))})(jQuery);/*!
14 * jQuery UI Widget 1.8.17
15 *
16 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
17 * Dual licensed under the MIT or GPL Version 2 licenses.
18 * http://jquery.org/license
19 *
20 * http://docs.jquery.com/UI/Widget
21 */(function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++)try{a(e).triggerHandler("remove")}catch(f){}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}});return d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)};var g=new c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e=="string",g=Array.prototype.slice.call(arguments,1),h=this;e=!f&&g.length?a.extend.apply(null,[!0,e].concat(g)):e;if(f&&e.charAt(0)==="_")return h;f?this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b){h=f;return!1}}):this.each(function(){var b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new d(e,this))});return h}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0)return a.extend({},this.options);if(typeof c=="string"){if(d===b)return this.options[c];e={},e[c]=d}this._setOptions(e);return this},_setOptions:function(b){var c=this;a.each(b,function(a,b){c._setOption(a,b)});return this},_setOption:function(a,b){this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b);return this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var e,f,g=this.options[b];d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent;if(f)for(e in f)e in c||(c[e]=f[e]);this.element.trigger(c,d);return!(a.isFunction(g)&&g.call(this.element[0],c,d)===!1||c.isDefaultPrevented())}}})(jQuery);/*!
22 * jQuery UI Mouse 1.8.17
23 *
24 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
25 * Dual licensed under the MIT or GPL Version 2 licenses.
26 * http://jquery.org/license
27 *
28 * http://docs.jquery.com/UI/Mouse
29 *
30 * Depends:
31 *	jquery.ui.widget.js
32 */(function(a,b){var c=!1;a(document).mouseup(function(a){c=!1}),a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(!0===a.data(c.target,b.widgetName+".preventClickEvent")){a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation();return!1}}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(b){if(!c){this._mouseStarted&&this._mouseUp(b),this._mouseDownEvent=b;var d=this,e=b.which==1,f=typeof this.options.cancel=="string"&&b.target.nodeName?a(b.target).closest(this.options.cancel).length:!1;if(!e||f||!this._mouseCapture(b))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(b)!==!1;if(!this._mouseStarted){b.preventDefault();return!0}}!0===a.data(b.target,this.widgetName+".preventClickEvent")&&a.removeData(b.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return d._mouseMove(a)},this._mouseUpDelegate=function(a){return d._mouseUp(a)},a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),b.preventDefault(),c=!0;return!0}},_mouseMove:function(b){if(a.browser.msie&&!(document.documentMode>=9)&&!b.button)return this._mouseUp(b);if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b));return!this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b));return!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);/*
33 * jQuery UI Draggable 1.8.17
34 *
35 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
36 * Dual licensed under the MIT or GPL Version 2 licenses.
37 * http://jquery.org/license
38 *
39 * http://docs.jquery.com/UI/Draggables
40 *
41 * Depends:
42 *	jquery.ui.core.js
43 *	jquery.ui.mouse.js
44 *	jquery.ui.widget.js
45 */
46(function( $, undefined ) {
47
48$.widget("ui.draggable", $.ui.mouse, {
49	widgetEventPrefix: "drag",
50	options: {
51		addClasses: true,
52		appendTo: "parent",
53		axis: false,
54		connectToSortable: false,
55		containment: false,
56		cursor: "auto",
57		cursorAt: false,
58		grid: false,
59		handle: false,
60		helper: "original",
61		iframeFix: false,
62		opacity: false,
63		refreshPositions: false,
64		revert: false,
65		revertDuration: 500,
66		scope: "default",
67		scroll: true,
68		scrollSensitivity: 20,
69		scrollSpeed: 20,
70		snap: false,
71		snapMode: "both",
72		snapTolerance: 20,
73		stack: false,
74		zIndex: false,
75		concernAngle: false
76	},
77	_create: function() {
78
79		if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position")))
80			this.element[0].style.position = 'relative';
81
82		(this.options.addClasses && this.element.addClass("ui-draggable"));
83		(this.options.disabled && this.element.addClass("ui-draggable-disabled"));
84
85		this._mouseInit();
86
87	},
88
89	destroy: function() {
90		if(!this.element.data('draggable')) return;
91		this.element
92			.removeData("draggable")
93			.unbind(".draggable")
94			.removeClass("ui-draggable"
95				+ " ui-draggable-dragging"
96				+ " ui-draggable-disabled");
97		this._mouseDestroy();
98
99		return this;
100	},
101
102	_mouseCapture: function(event) {
103
104		var o = this.options;
105
106		// among others, prevent a drag on a resizable-handle
107		if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle,.ui-resizable-handle>.knob'))
108			return false;
109
110		//Quit if we're not on a valid handle
111		this.handle = this._getHandle(event);
112		if (!this.handle)
113			return false;
114		
115		if ( o.iframeFix ) {
116			$(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
117				$('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
118				.css({
119					width: this.offsetWidth+"px", height: this.offsetHeight+"px",
120					position: "absolute", opacity: "0.001", zIndex: 1000
121				})
122				.css($(this).offset())
123				.appendTo("body");
124			});
125		}
126
127		return true;
128
129	},
130
131	_mouseStart: function(event) {
132
133		var o = this.options;
134
135		//Create and append the visible helper
136		this.helper = this._createHelper(event);
137
138		//Cache the helper size
139		this._cacheHelperProportions();
140
141		//If ddmanager is used for droppables, set the global draggable
142		if($.ui.ddmanager)
143			$.ui.ddmanager.current = this;
144
145		/*
146		 * - Position generation -
147		 * This block generates everything position related - it's the core of draggables.
148		 */
149
150		//Cache the margins of the original element
151		this._cacheMargins();
152
153		//Store the helper's css position
154		this.cssPosition = this.helper.css("position");
155		this.scrollParent = this.helper.scrollParent();
156
157		//The element's absolute position on the page minus margins
158		this.offset = this.positionAbs = this.element.offset();
159		if(o.concernAngle){
160			var parentoffset=this.element.parent().offset();
161			this.offset = this.positionAbs = {
162				left:parentoffset.left+$.parseInteger(this.element.css('left')),
163				top:parentoffset.top+$.parseInteger(this.element.css('top'))
164			}
165		} 
166		this.offset = {
167			top: this.offset.top - this.margins.top,
168			left: this.offset.left - this.margins.left
169		};
170
171		$.extend(this.offset, {
172			click: { //Where the click happened, relative to the element
173				left: event.pageX - this.offset.left,
174				top: event.pageY - this.offset.top
175			},
176			parent: this._getParentOffset(),
177			relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
178		});
179
180		//Generate the original position
181		this.originalPosition = this.position = this._generatePosition(event);
182		this.originalPageX = event.pageX;
183		this.originalPageY = event.pageY;
184
185		//Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
186		(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
187
188		//Set a containment if given in the options
189		if(o.containment)
190			this._setContainment();
191
192		//Trigger event + callbacks
193		if(this._trigger("start", event) === false) {
194			this._clear();
195			return false;
196		}
197
198		//Recache the helper size
199		this._cacheHelperProportions();
200
201		//Prepare the droppable offsets
202		if ($.ui.ddmanager && !o.dropBehaviour)
203			$.ui.ddmanager.prepareOffsets(this, event);
204
205		this.helper.addClass("ui-draggable-dragging");
206		this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
207		
208		//If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
209		if ( $.ui.ddmanager ) $.ui.ddmanager.dragStart(this, event);
210		
211		return true;
212	},
213
214	_mouseDrag: function(event, noPropagation) {
215
216		//Compute the helpers position
217		this.position = this._generatePosition(event);
218		this.positionAbs = this._convertPositionTo("absolute");
219
220		//Call plugins and callbacks and use the resulting position if something is returned
221		if (!noPropagation) {
222			var ui = this._uiHash();
223			if(this._trigger('drag', event, ui) === false) {
224				this._mouseUp({});
225				return false;
226			}
227			this.position = ui.position;
228		}
229
230		if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
231		if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
232		if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
233
234		return false;
235	},
236
237	_mouseStop: function(event) {
238
239		//If we are using droppables, inform the manager about the drop
240		var dropped = false;
241		if ($.ui.ddmanager && !this.options.dropBehaviour)
242			dropped = $.ui.ddmanager.drop(this, event);
243
244		//if a drop comes from outside (a sortable)
245		if(this.dropped) {
246			dropped = this.dropped;
247			this.dropped = false;
248		}
249		
250		//if the original element is removed, don't bother to continue if helper is set to "original"
251		if((!this.element[0] || !this.element[0].parentNode) && this.options.helper == "original")
252			return false;
253
254		if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
255			var self = this;
256			$(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
257				if(self._trigger("stop", event) !== false) {
258					self._clear();
259				}
260			});
261		} else {
262			if(this._trigger("stop", event) !== false) {
263				this._clear();
264			}
265		}
266
267		return false;
268	},
269	
270	_mouseUp: function(event) {
271		if (this.options.iframeFix === true) {
272			$("div.ui-draggable-iframeFix").each(function() { 
273				this.parentNode.removeChild(this); 
274			}); //Remove frame helpers
275		}
276		
277		//If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)
278		if( $.ui.ddmanager ) $.ui.ddmanager.dragStop(this, event);
279		
280		return $.ui.mouse.prototype._mouseUp.call(this, event);
281	},
282	
283	cancel: function() {
284		
285		if(this.helper.is(".ui-draggable-dragging")) {
286			this._mouseUp({});
287		} else {
288			this._clear();
289		}
290		
291		return this;
292		
293	},
294
295	_getHandle: function(event) {
296
297		var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
298		$(this.options.handle, this.element)
299			.find("*")
300			.andSelf()
301			.each(function() {
302				if(this == event.target) handle = true;
303			});
304
305		return handle;
306
307	},
308
309	_createHelper: function(event) {
310
311		var o = this.options;
312		var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone().removeAttr('id') : this.element);
313
314		if(!helper.parents('body').length)
315			helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
316
317		if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position")))
318			helper.css("position", "absolute");
319
320		return helper;
321
322	},
323
324	_adjustOffsetFromHelper: function(obj) {
325		if (typeof obj == 'string') {
326			obj = obj.split(' ');
327		}
328		if ($.isArray(obj)) {
329			obj = {left: +obj[0], top: +obj[1] || 0};
330		}
331		if ('left' in obj) {
332			this.offset.click.left = obj.left + this.margins.left;
333		}
334		if ('right' in obj) {
335			this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
336		}
337		if ('top' in obj) {
338			this.offset.click.top = obj.top + this.margins.top;
339		}
340		if ('bottom' in obj) {
341			this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
342		}
343	},
344
345	_getParentOffset: function() {
346
347		//Get the offsetParent and cache its position
348		this.offsetParent = this.helper.offsetParent();
349		var po = this.offsetParent.offset();
350
351		// This is a special case where we need to modify a offset calculated on start, since the following happened:
352		// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
353		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
354		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
355		if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
356			po.left += this.scrollParent.scrollLeft();
357			po.top += this.scrollParent.scrollTop();
358		}
359
360		if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
361		|| (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
362			po = { top: 0, left: 0 };
363
364		return {
365			top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),
36510) || 0),
366			left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
367		};
368
369	},
370
371	_getRelativeOffset: function() {
372
373		if(this.cssPosition == "relative") {
374			var p = this.element.position();
375			return {
376				top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
377				left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
378			};
379		} else {
380			return { top: 0, left: 0 };
381		}
382
383	},
384
385	_cacheMargins: function() {
386		this.margins = {
387			left: (parseInt(this.element.css("marginLeft"),10) || 0),
388			top: (parseInt(this.element.css("marginTop"),10) || 0),
389			right: (parseInt(this.element.css("marginRight"),10) || 0),
390			bottom: (parseInt(this.element.css("marginBottom"),10) || 0)
391		};
392	},
393
394	_cacheHelperProportions: function() {
395		this.helperProportions = {
396			width: this.helper.outerWidth(),
397			height: this.helper.outerHeight()
398		};
399	},
400
401	_setContainment: function() {
402
403		var o = this.options;
404		if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
405		if(o.containment == 'document' || o.containment == 'window') this.containment = [
406			o.containment == 'document' ? 0 : $(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
407			o.containment == 'document' ? 0 : $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top,
408			(o.containment == 'document' ? 0 : $(window).scrollLeft()) + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
409			(o.containment == 'document' ? 0 : $(window).scrollTop()) + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
410		];
411
412		if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {
413		        var c = $(o.containment);
414			var ce = c[0]; if(!ce) return;
415			var co = c.offset();
416			var over = ($(ce).css("overflow") != 'hidden');
417
418			this.containment = [
419				(parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0),
420				(parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0),
421				(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right,
422				(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top  - this.margins.bottom
423			];
424			this.relative_container = c;
425
426		} else if(o.containment.constructor == Array) {
427			this.containment = o.containment;
428		}
429
430	},
431
432	_convertPositionTo: function(d, pos) {
433
434		if(!pos) pos = this.position;
435		var mod = d == "absolute" ? 1 : -1;
436		var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
437
438		return {
439			top: (
440				pos.top																	// The absolute mouse position
441				+ this.offset.relative.top * mod										// Only for relative positioned nodes: Relative offset from element to offset parent
442				+ this.offset.parent.top * mod											// The offsetParent's offset without borders (offset + border)
443				- ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
444			),
445			left: (
446				pos.left																// The absolute mouse position
447				+ this.offset.relative.left * mod										// Only for relative positioned nodes: Relative offset from element to offset parent
448				+ this.offset.parent.left * mod											// The offsetParent's offset without borders (offset + border)
449				- ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
450			)
451		};
452
453	},
454
455	_generatePosition: function(event) {
456
457		var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
458		var pageX = event.pageX;
459		var pageY = event.pageY;
460
461		/*
462		 * - Position constraining -
463		 * Constrain the position to a mix of grid, containment.
464		 */
465
466		if(this.originalPosition) { //If we are not dragging yet, we won't check for options
467		         var containment;
468		         if(this.containment) {
469				 if (this.relative_container){
470				     var co = this.relative_container.offset();
471				     containment = [ this.containment[0] + co.left,
472						     this.containment[1] + co.top,
473						     this.containment[2] + co.left,
474						     this.containment[3] + co.top ];
475				 }
476				 else {
477				     containment = this.containment;
478				 }
479
480				if(event.pageX - this.offset.click.left < containment[0]) pageX = containment[0] + this.offset.click.left;
481				if(event.pageY - this.offset.click.top < containment[1]) pageY = containment[1] + this.offset.click.top;
482				if(event.pageX - this.offset.click.left > containment[2]) pageX = containment[2] + this.offset.click.left;
483				if(event.pageY - this.offset.click.top > containment[3]) pageY = containment[3] + this.offset.click.top;
484			}
485
486			if(o.grid) {
487				//Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)
488				var top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
489				pageY = containment ? (!(top - this.offset.click.top < containment[1] || top - this.offset.click.top > containment[3]) ? top : (!(top - this.offset.click.top < containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
490
491				var left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
492				pageX = containment ? (!(left - this.offset.click.left < containment[0] || left - this.offset.click.left > containment[2]) ? left : (!(left - this.offset.click.left < containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
493			}
494
495		}
496
497		return {
498			top: (
499				pageY																// The absolute mouse position
500				- this.offset.click.top													// Click offset (relative to the element)
501				- this.offset.relative.top												// Only for relative positioned nodes: Relative offset from element to offset parent
502				- this.offset.parent.top												// The offsetParent's offset without borders (offset + border)
503				+ ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
504			),
505			left: (
506				pageX																// The absolute mouse position
507				- this.offset.click.left												// Click offset (relative to the element)
508				- this.offset.relative.left												// Only for relative positioned nodes: Relative offset from element to offset parent
509				- this.offset.parent.left												// The offsetParent's offset without borders (offset + border)
510				+ ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
511			)
512		};
513
514	},
515
516	_clear: function() {
517		this.helper.removeClass("ui-draggable-dragging");
518		if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();
519		//if($.ui.ddmanager) $.ui.ddmanager.current = null;
520		this.helper = null;
521		this.cancelHelperRemoval = false;
522	},
523
524	// From now on bulk stuff - mainly helpers
525
526	_trigger: function(type, event, ui) {
527		ui = ui || this._uiHash();
528		$.ui.plugin.call(this, type, [event, ui]);
529		if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins
530		return $.Widget.prototype._trigger.call(this, type, event, ui);
531	},
532
533	plugins: {},
534
535	_uiHash: function(event) {
536		return {
537			helper: this.helper,
538			position: this.position,
539			originalPosition: this.originalPosition,
540			offset: this.positionAbs
541		};
542	}
543
544});
545
546$.extend($.ui.draggable, {
547	version: "1.8.17"
548});
549
550$.ui.plugin.add("draggable", "connectToSortable", {
551	start: function(event, ui) {
552
553		var inst = $(this).data("draggable"), o = inst.options,
554			uiSortable = $.extend({}, ui, { item: inst.element });
555		inst.sortables = [];
556		$(o.connectToSortable).each(function() {
557			var sortable = $.data(this, 'sortable');
558			if (sortable && !sortable.options.disabled) {
559				inst.sortables.push({
560					instance: sortable,
561					shouldRevert: sortable.options.revert
562				});
563				sortable.refreshPositions();	// Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page).
564				sortable._trigger("activate", event, uiSortable);
565			}
566		});
567
568	},
569	stop: function(event, ui) {
570
571		//If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
572		var inst = $(this).data("draggable"),
573			uiSortable = $.extend({}, ui, { item: inst.element });
574
575		$.each(inst.sortables, function() {
576			if(this.instance.isOver) {
577
578				this.instance.isOver = 0;
579
580				inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
581				this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
582
583				//The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'
584				if(this.shouldRevert) this.instance.options.revert = true;
585
586				//Trigger the stop of the sortable
587				this.instance._mouseStop(event);
588
589				this.instance.options.helper = this.instance.options._helper;
590
591				//If the helper has been the original item, restore properties in the sortable
592				if(inst.options.helper == 'original')
593					this.instance.currentItem.css({ top: 'auto', left: 'auto' });
594
595			} else {
596				this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
597				this.instance._trigger("deactivate", event, uiSortable);
598			}
599
600		});
601
602	},
603	drag: function(event, ui) {
604
605		var inst = $(this).data("draggable"), self = this;
606
607		var checkPos = function(o) {
608			var dyClick = this.offset.click.top, dxClick = this.offset.click.left;
609			var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;
610			var itemHeight = o.height, itemWidth = o.width;
611			var itemTop = o.top, itemLeft = o.left;
612
613			return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);
614		};
615
616		$.each(inst.sortables, function(i) {
617			
618			//Copy over some variables to allow calling the sortable's native _intersectsWith
619			this.instance.positionAbs = inst.positionAbs;
620			this.instance.helperProportions = inst.helperProportions;
621			this.instance.offset.click = inst.offset.click;
622			
623			if(this.instance._intersectsWith(this.instance.containerCache)) {
624
625				//If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
626				if(!this.instance.isOver) {
627
628					this.instance.isOver = 1;
629					//Now we fake the start of dragging for the sortable instance,
630					//by cloning the list group item, appending it to the sortable and using it as inst.currentItem
631					//We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
632					this.instance.currentItem = $(self).clone().removeAttr('id').appendTo(this.instance.element).data("sortable-item", true);
633					this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
634					this.instance.options.helper = function() { return ui.helper[0]; };
635
636					event.target = this.instance.currentItem[0];
637					this.instance._mouseCapture(event, true);
638					this.instance._mouseStart(event, true, true);
639
640					//Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
641					this.instance.offset.click.top = inst.offset.click.top;
642					this.instance.offset.click.left = inst.offset.click.left;
643					this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
644					this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
645
646					inst._trigger("toSortable", event);
647					inst.dropped = this.instance.element; //draggable revert needs that
648					//hack so receive/update callbacks work (mostly)
649					inst.currentItem = inst.element;
650					this.instance.fromOutside = inst;
651
652				}
653
654				//Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
655				if(this.instance.currentItem) this.instance._mouseDrag(event);
656
657			} else {
658
659				//If it doesn't intersect with the sortable, and it intersected before,
660				//we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
661				if(this.instance.isOver) {
662
663					this.instance.isOver = 0;
664					this.instance.cancelHelperRemoval = true;
665					
666					//Prevent reverting on this forced stop
667					this.instance.options.revert = false;
668					
669					// The out event needs to be triggered independently
670					this.instance._trigger('out', event, this.instance._uiHash(this.instance));
671					
672					this.instance._mouseStop(event, true);
673					this.instance.options.helper = this.instance.options._helper;
674
675					//Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
676					this.instance.currentItem.remove();
677					if(this.instance.placeholder) this.instance.placeholder.remove();
678
679					inst._trigger("fromSortable", event);
680					inst.dropped = false; //draggable revert needs that
681				}
682
683			};
684
685		});
686
687	}
688});
689
690$.ui.plugin.add("draggable", "cursor", {
691	start: function(event, ui) {
692		var t = $('body'), o = $(this).data('draggable').options;
693		if (t.css("cursor")) o._cursor = t.css("cursor");
694		t.css("cursor", o.cursor);
695	},
696	stop: function(event, ui) {
697		var o = $(this).data('draggable').options;
698		if (o._cursor) $('body').css("cursor", o._cursor);
699	}
700});
701
702$.ui.plugin.add("draggable", "opacity", {
703	start: function(event, ui) {
704		var t = $(ui.helper), o = $(this).data('draggable').options;
705		if(t.css("opacity")) o._opacity = t.css("opacity");
706		t.css('opacity', o.opacity);
707	},
708	stop: function(event, ui) {
709		var o = $(this).data('draggable').options;
710		if(o._opacity) $(ui.helper).css('opacity', o._opacity);
711	}
712});
713
714$.ui.plugin.add("draggable", "scroll", {
715	start: function(event, ui) {
716		var i = $(this).data("draggable");
717		if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();
718	},
719	drag: function(event, ui) {
720
721		var i = $(this).data("draggable"), o = i.options, scrolled = false;
722
723		if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {
724
725			if(!o.axis || o.axis != 'x') {
726				if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
727					i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
728				else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity)
729					i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
730			}
731
732			if(!o.axis || o.axis != 'y') {
733				if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
734					i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
735				else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity)
736					i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
737			}
738
739		} else {
740
741			if(!o.axis || o.axis != 'x') {
742				if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
743					scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
744				else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
745					scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
746			}
747
748			if(!o.axis || o.axis != 'y') {
749				if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
750					scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
751				else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
752					scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
753			}
754
755		}
756
757		if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
758			$.ui.ddmanager.prepareOffsets(i, event);
759
760	}
761});
762
763$.ui.plugin.add("draggable", "snap", {
764	start: function(event, ui) {
765
766		var i = $(this).data("draggable"), o = i.options;
767		i.snapElements = [];
768
769		$(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() {
770			var $t = $(this); var $o = $t.offset();
771			if(this != i.element[0]) i.snapElements.push({
772				item: this,
773				width: $t.outerWidth(), height: $t.outerHeight(),
774				top: $o.top, left: $o.left
775			});
776		});
777
778	},
779	drag: function(event, ui) {
780
781		var inst = $(this).data("draggable"), o = inst.options;
782		var d = o.snapTolerance;
783
784		var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
785			y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
786
787		for (var i = inst.snapElements.length - 1; i >= 0; i--){
788
789			var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
790				t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
791
792			//Yes, I know, this is insane ;)
793			if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
794				if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
795				inst.snapElements[i].snapping = false;
796				continue;
797			}
798
799			if(o.snapMode != 'inner') {
800				var ts = Math.abs(t - y2) <= d;
801				var bs = Math.abs(b - y1) <= d;
802				var ls = Math.abs(l - x2) <= d;
803				var rs = Math.abs(r - x1) <= d;
804				if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
805				if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
806				if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
807				if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
808			}
809
810			var first = (ts || bs || ls || rs);
811
812			if(o.snapMode != 'outer') {
813				var ts = Math.abs(t - y1) <= d;
814				var bs = Math.abs(b - y2) <= d;
815				var ls = Math.abs(l - x1) <= d;
816				var rs = Math.abs(r - x2) <= d;
817				if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
818				if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
819				if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
820				if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
821			}
822
823			if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))
824				(inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
825			inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
826
827		};
828
829	}
830});
831
832//wopop cstlyer 
833$.ui.plugin.add("draggable", "wopop_snap", {
834	start: function(event, ui) {
835		return;
836		var i = $(this).data("draggable"), o = i.options;
837		var wopop_snap=o.wopop_snap;
838		if(!wopop_snap) return;
839		if($(this).data('deg')) return;
840		if(!$(this).is('.cstlayer')) return; 
841		//判断是否包含锁定元素
842		var has_layer_lock=false;
843		$('.ui-modselected').each(function(){
844			$(this).data('left',$(this).css('left'));
845			$(this).data('top',$(this).css('top'));
846			$(this).data('width',$(this).css('width'));
847			$(this).data('height',$(this).css('height'));
848
849				if($(this).data('cstlayerstatus') == 'unlock' ){
850					has_layer_lock=true;
851				}
852		});
853		if(has_layer_lock) return;
854		if($(this).closest('.fullpagesection').length) return;
855		
856		i.snapElements = [];
857		var abs_top=$(this).ab_pos_cnter('top')-i.originalPosition.top;
858		i.wopop_ab_top=abs_top;
859		
860		var vsnap=[];
861	     var hsnap=[];
862		function in_array(num,snaparr){
863			for(var i=0;i<snaparr.length;i++){
864				var snapnum=snaparr[i];
865				if(Math.abs(snapnum-num)<2) return 1;
866			}
867			return -1;
868		}
869		
870		function clear_snap(){
871			vsnap=[];
872			hsnap=[];
873			$('.wopop_snap').remove();
874			i.snapElements=[];
875		}
876		
877		 function getLayerSnap(layer){
878				 var t=parseInt(layer.ab_pos_cnter('top'))||0;
879				 var b=t+parseInt(layer.css('height'))||0;
880				 var l=parseInt(layer.css('left'))||0;
881				 var r=l+parseInt(layer.css('width'))||0;
882				 var offsetl=$('#canvas').offset().left-$('#scroll_container').offset().left;
883				 var totalh=$('#scroll_container_bg').height();
884				 var scct=$('#scroll_container').scrollTop();
885				 i.ori_scct=scct;
886//				 if(!((t>scct&&t<scct+$(window).height())||(b>scct&&b<scct+$(window).height()))){
887//					 return;
888//				 }
889				 if(in_array(t, hsnap)==-1){
890						 hsnap.push(t);
891						 var snapstr="<div class='wopop_snap_horizon wopop_snap' style='top:"+t+"px;'></div>";
892						 $('#scroll_container').append(snapstr);
893				 }
894				 if(in_array(b, hsnap)==-1){
895						 hsnap.push(b);
896						 var snapstr="<div class='wopop_snap_horizon wopop_snap' style='top:"+b+"px;'></div>";
897						 $('#scroll_container').append(snapstr);
898				 }
899				 if(in_array(l, vsnap)==-1){
900						 vsnap.push(l);
901						 var snapstr="<div class='wopop_snap_vertical wopop_snap' style='left:"+(offsetl+l)+"px;height:"+totalh+"px;'></div>";
902						 $('#scroll_container').append(snapstr);
903				 }
904				 if(in_array(r, vsnap)==-1){
905						 vsnap.push(r);
906						 var snapstr="<div class='wopop_snap_vertical wopop_snap' style='left:"+(offsetl+r)+"px;height:"+totalh+"px;'></div>";
907						 $('#scroll_container').append(snapstr);
908				 }
909		 }
910
911		$(this).unbind('layersnapstart').bind('layersnapstart',function(){
912			clear_snap();
913			if($.getElementAreaInf($(this))=='canvas'){
914				$('#canvas .cstlayer:not(.ui-modselected)').each(function(){
915					getLayerSnap($(this));
916				})
917			}else{
918				$('#scroll_container .cstlayer:not(.ui-modselected)').each(function(){
919					getLayerSnap($(this));
920				})
921			}
922
923			i.snapElements=[];
924			var scct=$('#scroll_container').scrollTop();
925			var offsetl=$('#canvas').offset().left;
926			$('.wopop_snap').each(function(){
927				var $t = $(this); var $o = $t.offset();
928				if($t.is('.wopop_snap_vertical')){
929					var obj={
930						item: this,
931						width: 0, height: $t.outerHeight(),
932						top: 0, left: $o.left-offsetl
933					};
934					i.snapElements.push(obj);
935					$(this).data('snapel',obj);
936				}else{
937					var obj={
938						item: this,
939						width: $t.outerWidth(), height: 0,
940						top: parseInt($t.css('top'))||0, left: 0
941					}
942					i.snapElements.push(obj);
943					$(this).data('snapel',obj);
944				}
945
946			})
947		})
948		$(this).trigger('layersnapstart');
949
950
951	},
952	drag: function(event, ui) {
953		return;
954		var inst = $(this).data("draggable"), o = inst.options;
955		var wopop_snap=o.wopop_snap;
956		if(!wopop_snap) return;
957		if($(this).data('deg')) return;
958		if(!$(this).is('.cstlayer')) return; 
959		var snapMode='outer';
960		var d = 3; //snapTolerance :5,
961		var scct=$('#scroll_container').scrollTop();
962		var ori_scct=inst.ori_scct;
963		if(scct !=ori_scct ){
964			$(this).trigger('layersnapstart');
965		}
966		var ab_top=inst.wopop_ab_top;
967
968		for (var i = inst.snapElements.length - 1; i >= 0; i--){
969			var x1 = ui.position.left, x2 = x1 + inst.helperProportions.width,
970			y1 =  ui.position.top+ab_top, y2 = y1 + inst.helperProportions.height;
971
972			var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
973				t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
974
975			var ls=Math.abs(l-x1)<=d;
976			var rs=Math.abs(l-x2)<=d;
977			var ts=Math.abs(t-y1)<=d;
978			var bs=Math.abs(t-y2)<=d;
979			if(ls) ui.position.left =ui.position.left+l-x1;
980			if(rs) ui.position.left =ui.position.left+(l-x2);
981			if(ts) ui.position.top =ui.position.top+t-y1;
982			if(bs) ui.position.top =ui.position.top+t-y2;
983
984			var first = (ts || bs || ls || rs);
985
986			if( (ts || bs || ls || rs || first)){
987				if($(inst.snapElements[i].item).is('.wopop_snap_vertical')){
988					$('.wopop_snap_vertical.showline').each(function(){
989						var snapinfo=$(this).data('snapel');
990						var l=snapinfo.left;
991						var x1 = ui.position.left, x2 = x1 + inst.helperProportions.width;
992						if(!(Math.abs(l-x1)<0.5 || Math.abs(l-x2)<0.5)) $(this).removeClass('showline');
993					})
994				}else{
995					$('.wopop_snap_horizon.showline').each(function(){
996						var snapinfo=$(this).data('snapel');
997						var t=snapinfo.top;
998						var y1 =  ui.position.top+ab_top, y2 = y1 + inst.helperProportions.height;
999						if(!(Math.abs(t-y1)<0.5 || Math.abs(t-y2)<0.5)) $(this).removeClass('showline');
1000					})
1001				}
1002				$(inst.snapElements[i].item).addClass('showline');
1003			}else{
1004				inst.snapElements[i].snapping = false;
1005				$(inst.snapElements[i].item).removeClass('showline');
1006				continue;
1007			}
1008			inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
1009
1010		};
1011
1012	},
1013	stop: function(event, ui) {
1014		return;
1015		$('.wopop_snap').remove();
1016		$(this).unbind('layersnapstart');
1017	}
1018});
1019
1020$.ui.plugin.add("draggable", "stack", {
1021	start: function(event, ui) {
1022
1023		var o = $(this).data("draggable").options;
1024
1025		var group = $.makeArray($(o.stack)).sort(function(a,b) {
1026			return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0);
1027		});
1028		if (!group.length) { return; }
1029		
1030		var min = parseInt(group[0].style.zIndex) || 0;
1031		$(group).each(function(i) {
1032			this.style.zIndex = min + i;
1033		});
1034
1035		this[0].style.zIndex = min + group.length;
1036
1037	}
1038});
1039
1040$.ui.plugin.add("draggable", "zIndex", {
1041	start: function(event, ui) {
1042		var t = $(ui.helper), o = $(this).data("draggable").options;
1043		if(t.css("zIndex")) o._zIndex = t.css("zIndex");
1044		t.css('zIndex', o.zIndex);
1045	},
1046	stop: function(event, ui) {
1047		var o = $(this).data("draggable").options;
1048		if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex);
1049	}
1050});
1051
1052})(jQuery);
1053/* jQuery UI Droppable 1.8.17
1054 *
1055 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
1056 * Dual licensed under the MIT or GPL Version 2 licenses.
1057 * http://jquery.org/license
1058 *
1059 * http://docs.jquery.com/UI/Droppables
1060 *
1061 * Depends:
1062 *	jquery.ui.core.js
1063 *	jquery.ui.widget.js
1064 *	jquery.ui.mouse.js
1065 *	jquery.ui.draggable.js
1066 */(function(a,b){a.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var b=this.options,c=b.accept;this.isover=0,this.isout=1,this.accept=a.isFunction(c)?c:function(a){return a.is(c)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},a.ui.ddmanager.droppables[b.scope]=a.ui.ddmanager.droppables[b.scope]||[],a.ui.ddmanager.droppables[b.scope].push(this),b.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];for(var c=0;c<b.length;c++)b[c]==this&&b.splice(c,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(b,c){b=="accept"&&(this.accept=a.isFunction(c)?c:function(a){return a.is(c)}),a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),c&&this._trigger("activate",b,this.ui(c))},_deactivate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),c&&this._trigger("deactivate",b,this.ui(c))},_over:function(b){var c=a.ui.ddmanager.current;!!c&&(c.currentItem||c.element)[0]!=this.element[0]&&this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",b,this.ui(c)))},_out:function(b){var c=a.ui.ddmanager.current;!!c&&(c.currentItem||c.element)[0]!=this.element[0]&&this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",b,this.ui(c)))},_drop:function(b,c){var d=c||a.ui.ddmanager.current;if(!d||(d.currentItem||d.element)[0]==this.element[0])return!1;var e=!1;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var b=a.data(this,"droppable");if(b.options.greedy&&!b.options.disabled&&b.options.scope==d.options.scope&&b.accept.call(b.element[0],d.currentItem||d.element)&&a.ui.intersect(d,a.extend(b,{offset:b.element.offset()}),b.options.tolerance)){e=!0;return!1}});if(e)return!1;if(this.accept.call(this.element[0],d.currentItem||d.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",b,this.ui(d));return this.element}return!1},ui:function(a){return{draggable:a.currentItem||a.element,helper:
1066a.helper,position:a.position,offset:a.positionAbs}}}),a.extend(a.ui.droppable,{version:"1.8.17"}),a.ui.intersect=function(b,c,d){if(!c.offset)return!1;var e=(b.positionAbs||b.position.absolute).left,f=e+b.helperProportions.width,g=(b.positionAbs||b.position.absolute).top,h=g+b.helperProportions.height,i=c.offset.left,j=i+c.proportions.width,k=c.offset.top,l=k+c.proportions.height;switch(d){case"fit":return i<=e&&f<=j&&k<=g&&h<=l;case"intersect":return i<e+b.helperProportions.width/2&&f-b.helperProportions.width/2<j&&k<g+b.helperProportions.height/2&&h-b.helperProportions.height/2<l;case"pointer":var m=(b.positionAbs||b.position.absolute).left+(b.clickOffset||b.offset.click).left,n=(b.positionAbs||b.position.absolute).top+(b.clickOffset||b.offset.click).top,o=a.ui.isOver(n,m,k,i,c.proportions.height,c.proportions.width);return o;case"touch":return(g>=k&&g<=l||h>=k&&h<=l||g<k&&h>l)&&(e>=i&&e<=j||f>=i&&f<=j||e<i&&f>j);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();droppablesLoop:for(var g=0;g<d.length;g++){if(d[g].options.disabled||b&&!d[g].accept.call(d[g].element[0],b.currentItem||b.element))continue;for(var h=0;h<f.length;h++)if(f[h]==d[g].element[0]){d[g].proportions.height=0;continue droppablesLoop}d[g].visible=d[g].element.css("display")!="none";if(!d[g].visible)continue;e=="mousedown"&&d[g]._activate.call(d[g],c),d[g].offset=d[g].element.offset(),d[g].proportions={width:d[g].element[0].offsetWidth,height:d[g].element[0].offsetHeight}}},drop:function(b,c){var d=!1;a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){!this.options||(!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)&&(d=this._drop.call(this,c)||d),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],b.currentItem||b.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,c)))});return d},dragStart:function(b,c){b.element.parents(":not(body,html)").bind("scroll.droppable",function(){b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)})},drag:function(b,c){b.options.refreshPositions&&a.ui.ddmanager.prepareOffsets(b,c),a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var d=a.ui.intersect(b,this,this.options.tolerance),e=!d&&this.isover==1?"isout":d&&this.isover==0?"isover":null;if(!e)return;var f;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");g.length&&(f=a.data(g[0],"droppable"),f.greedyChild=e=="isover"?1:0)}f&&e=="isover"&&(f.isover=0,f.isout=1,f._out.call(f,c)),this[e]=1,this[e=="isout"?"isover":"isout"]=0,this[e=="isover"?"_over":"_out"].call(this,c),f&&e=="isout"&&(f.isout=0,f.isover=1,f._over.call(f,c))}})},dragStop:function(b,c){b.element.parents(":not(body,html)").unbind("scroll.droppable"),b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)}}})(jQuery);/*
1067 * jQuery UI Resizable 1.8.17
1068 *
1069 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
1070 * Dual licensed under the MIT or GPL Version 2 licenses.
1071 * http://jquery.org/license
1072 *
1073 * http://docs.jquery.com/UI/Resizables
1074 *
1075 * Depends:
1076 *	jquery.ui.core.js
1077 *	jquery.ui.mouse.js
1078 *	jquery.ui.widget.js
1079 */
1080(function( $, undefined ) {
1081
1082$.widget("ui.resizable", $.ui.mouse, {
1083	widgetEventPrefix: "resize",
1084	options: {
1085		alsoResize: false,
1086		animate: false,
1087		animateDuration: "slow",
1088		animateEasing: "swing",
1089		aspectRatio: false,
1090		aspectFunc:false,
1091		autoHide: false,
1092		containment: false,
1093		ghost: false,
1094		grid: false,
1095		handles: "e,s,se",
1096		helper: false,
1097		scroll: false,
1098		scrollSensitivity:20,
1099		scrollSpeed: 20,
1100		maxHeight: null,
1101		maxWidth: null,
1102		minHeight: 10,
1103		minWidth: 10,
1104		zIndex: 1000,
1105		concernAngle: false,
1106		concernLock:false
1107	},
1108	_create: function() {
1109
1110		var self = this, o = this.options;
1111		this.element.addClass("ui-resizable");
1112
1113		$.extend(this, {
1114			_aspectRatio: !!(o.aspectRatio),
1115			aspectRatio: o.aspectRatio,
1116			originalElement: this.element,
1117			_proportionallyResizeElements: [],
1118			_helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null
1119		});
1120
1121		//Wrap the element if it cannot hold child nodes
1122		if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {
1123
1124			//Opera fix for relative positioning
1125			if (/relative/.test(this.element.css('position')) && $.browser.opera)
1126				this.element.css({ position: 'relative', top: 'auto', left: 'auto' });
1127
1128			//Create a wrapper element and set the wrapper to the new current internal element
1129			this.element.wrap(
1130				$('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({
1131					position: this.element.css('position'),
1132					width: this.element.outerWidth(),
1133					height: this.element.outerHeight(),
1134					top: this.element.css('top'),
1135					left: this.element.css('left')
1136				})
1137			);
1138
1139			//Overwrite the original this.element
1140			this.element = this.element.parent().data(
1141				"resizable", this.element.data('resizable')
1142			);
1143
1144			this.elementIsWrapper = true;
1145
1146			//Move margins to the wrapper
1147			this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") });
1148			this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});
1149
1150			//Prevent Safari textarea resize
1151			this.originalResizeStyle = this.originalElement.css('resize');
1152			this.originalElement.css('resize', 'none');
1153
1154			//Push the actual element to our proportionallyResize internal array
1155			this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' }));
1156
1157			// avoid IE jump (hard set the margin)
1158			this.originalElement.css({ margin: this.originalElement.css('margin') });
1159
1160			// fix handlers offset
1161			this._proportionallyResize();
1162
1163		}
1164
1165		this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' });
1166		if(this.handles.constructor == String) {
1167
1168			if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw';
1169			var n = this.handles.split(","); this.handles = {};
1170
1171			for(var i = 0; i < n.length; i++) {
1172
1173				var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle;
1174				var axis = $('<div class="ui-resizable-handle ' + hname + '"></div>');
1175
1176				// increase zIndex of sw, se, ne, nw axis
1177				//TODO : this modifies original option
1178				if(/sw|se|ne|nw/.test(handle)) axis.css({ zIndex: ++o.zIndex });
1179
1180				//TODO : What's going on here?
1181				if ('se' == handle) {
1182					axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se');
1183				};
1184
1185				//Insert into internal handles object and append to element
1186				this.handles[handle] = '.ui-resizable-'+handle;
1187				this.element.append(axis);
1188			}
1189
1190		}
1191
1192		this._renderAxis = function(target) {
1193
1194			target = target || this.element;
1195
1196			for(var i in this.handles) {
1197
1198				if(this.handles[i].constructor == String)
1199					this.handles[i] = $(this.handles[i], this.element).show();
1200
1201				//Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
1202				if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {
1203
1204					var axis = $(this.handles[i], this.element), padWrapper = 0;
1205
1206					//Checking the correct pad and border
1207					padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
1208
1209					//The padding type i have to apply...
1210					var padPos = [ 'padding',
1211						/ne|nw|n/.test(i) ? 'Top' :
1212						/se|sw|s/.test(i) ? 'Bottom' :
1213						/^e$/.test(i) ? 'Right' : 'Left' ].join("");
1214
1215					target.css(padPos, padWrapper);
1216
1217					this._proportionallyResize();
1218
1219				}
1220
1221				//TODO: What's that good for? There's not anything to be executed left
1222				if(!$(this.handles[i]).length)
1223					continue;
1224
1225			}
1226		};
1227
1228		//TODO: make renderAxis a prototype function
1229		this._renderAxis(this.element);
1230
1231		this._handles = $('.ui-resizable-handle', this.element)
1232			.disableSelection();
1233
1234		//Matching axis name
1235		this._handles.mouseover(function() {
1236			if (!self.resizing) {
1237				if (this.className)
1238					var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
1239				//Axis, default = se
1240				self.axis = axis && axis[1] ? axis[1] : 'se';
1241			}
1242		});
1243
1244		//If we want to auto hide the elements
1245		if (o.autoHide) {
1246			this._handles.hide();
1247			$(this.element)
1248				.addClass("ui-resizable-autohide")
1249				.hover(function() {
1250					if (o.disabled) return;
1251					$(this).removeClass("ui-resizable-autohide");
1252					self._handles.show();
1253				},
1254				function(){
1255					if (o.disabled) return;
1256					if (!self.resizing) {
1257						$(this).addClass("ui-resizable-autohide");
1258						self._handles.hide();
1259					}
1260				});
1261		}
1262
1263		//Initialize the mouse interaction
1264		this._mouseInit();
1265
1266	},
1267
1268	destroy: function() {
1269
1270		this._mouseDestroy();
1271
1272		var _destroy = function(exp) {
1273			$(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
1274				.removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();
1275		};
1276
1277		//TODO: Unwrap at same DOM position
1278		if (this.elementIsWrapper) {
1279			_destroy(this.element);
1280			var wrapper = this.element;
1281			wrapper.after(
1282				this.originalElement.css({
1283					position: wrapper.css('position'),
1284					width: wrapper.outerWidth(),
1285					height: wrapper.outerHeight(),
1286					top: wrapper.css('top'),
1287					left: wrapper.css('left')
1288				})
1289			).remove();
1290		}
1291
1292		this.originalElement.css('resize', this.originalResizeStyle);
1293		_destroy(this.originalElement);
1294
1295		return this;
1296	},
1297
1298	_mouseCapture: function(event) {
1299		var handle = false;
1300		for (var i in this.handles) {
1301			if ($(this.handles[i])[0] == event.target || $(this.handles[i])[0] == event.target.parentNode) {
1302				handle = true;
1303			}
1304		}
1305
1306		var lockcondition=true;
1307		if(this.options.concernLock && this.element.data('cstlayerstatus') == 'unlock'){
1308			lockcondition=false;
1309		}
1310		return !this.options.disabled && handle && lockcondition;
1311	},
1312
1313	_mouseStart: function(event) {
1314
1315		var o = this.options, iniPos = this.element.position(), el = this.element;
1316
1317		this.resizing = true;
1318		this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() };
1319		
1320		// bugfix for http://dev.jquery.com/ticket/1749
1321		if(!o.concernAngle&&!o.noinit){
1322			if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) {
1323				el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left });
1324			}
1325		}
1326		
1327		//Opera fixing relative position
1328		if ($.browser.opera && (/relative/).test(el.css('position')))
1329			el.css({ position: 'relative', top: 'auto', left: 'auto' });
1330		
1331		this._renderProxy();
1332		
1333		var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top'));
1334		
1335		if (o.containment) {
1336			curleft += $(o.containment).scrollLeft() || 0;
1337			curtop += $(o.containment).scrollTop() || 0;
1338		}
1339
1340		//Store needed variables
1341		this.offset = this.helper.offset();
1342		this.position = { left: curleft, top: curtop };
1343		if($.browser.msie && $.browser.version < 9 && el.data('deg') % 360 != 0)
1344			this.size = {width:el.data('IEWidth'),height:el.data('IEHeight')};
1345		else
1346			this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
1347		this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
1348		this.originalPosition = { left: curleft, top: curtop };
1349		this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };
1350		this.originalMousePosition = { left: event.pageX, top: event.pageY };
1351
1352		if(o.scroll &&(!o.concernAngle||o.concernAngle&&!this.element.data('deg'))){
1353			this.scrollParent =this.element.scrollParent();
1354			this.originalMousePosition.top+=this.scrollParent.scrollTop();
1355		}
1356		//Aspect Ratio
1357		this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1);
1358
1359		if(o.concernAngle){
1360			//处理旋转模块Resize鼠标cursor样式
1361			$.divrotate.getDegreeResizeCursor(this.element);
1362		}
1363	    var cursor = this.element.find('.ui-resizable-' + this.axis).css('cursor');
1364	    $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor);
1365	    
1366		el.addClass("ui-resizable-resizing");
1367		this._propagate("start", event);
1368		return true;
1369	},
1370
1371	_mouseDrag: function(event) {
1372
1373		//Increase performance, avoid regex
1374		var el = this.helper, o = this.options, props = {},
1375			self = this, smp = this.originalMousePosition, a = this.axis;
1376		var ypos=event.pageY;
1377		if(o.scroll &&(!o.concernAngle||o.concernAngle&&!this.element.data('deg'))){
1378			ypos+=this.scrollParent.scrollTop();
1379		}
1380		var dx = (event.pageX-smp.left)||0, dy = (ypos-smp.top)||0;
1381		var trigger = this._change[a];
1382		if (!trigger) return false;
1383
1384		// Calculate the attrs that will be change
1385		var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff;
1386
1387		// Put this in the mouseDrag handler since the user can start pressing shift while resizing
1388		this._updateVirtualBoundaries(event.shiftKey);
1389		if (!$.isFunction(o.aspectFunc)&&(this._aspectRatio || event.shiftKey)){
1390			data = this._updateRatio(data, event);
1391		}else if($.isFunction(o.aspectFunc)){
1392			data = this._updateAFunc(data, event);
1393		}
1394
1395		data = this._respectSize(data, event);
1396
1397		// plugins callbacks need to be called first
1398		this._propagate("resize", event);
1399
1400		el.css({
1401			top: this.position.top + "px", left: this.position.left + "px",
1402			width: this.size.width + "px", height: this.size.height + "px"
1403		});
1404
1405		if (!this._helper && this._proportionallyResizeElements.length)
1406			this._proportionallyResize();
1407
1408		this._updateCache(data);
1409
1410		// calling the user callback at the end
1411		this._trigger('resize', event, this.ui());
1412	
1413		return false;
1414	},
1415
1416	_mouseStop: function(event) {
1417
1418		this.resizing = false;
1419		var o = this.options, self = this;
1420
1421		if(this._helper) {
1422			var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
1423				soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
1424				soffsetw = ista ? 0 : self.sizeDiff.width;
1425
1426			var s = { width: (self.helper.width()  - soffsetw), height: (self.helper.height() - soffseth) },
1427				left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
1428				top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
1429
1430			if (!o.animate)
1431				this.element.css($.extend(s, { top: top, left: left }));
1432
1433			self.helper.height(self.size.height);
1434			self.helper.width(self.size.width);
1435
1436			if (this._helper && !o.animate) this._proportionallyResize();
1437		}
1438
1439		$('body').css('cursor', 'auto');
1440
1441		this.element.removeClass("ui-resizable-resizing");
1442
1443		this._propagate("stop", event);
1444
1445		if (this._helper) this.helper.remove();
1446		return false;
1447
1448	},
1449
1450    _updateVirtualBoundaries: function(forceAspectRatio) {
1451        var o = this.options, pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b;
1452
1453        b = {
1454            minWidth: isNumber(o.minWidth) ? o.minWidth : 0,
1455            maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity,
1456            minHeight: isNumber(o.minHeight) ? o.minHeight : 0,
1457            maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity
1458        };
1459
1460        if(this._aspectRatio || forceAspectRatio) {
1461            // We want to create an enclosing box whose aspect ration is the requested one
1462            // First, compute the "projected" size for each dimension based on the aspect ratio and other dimension
1463            pMinWidth = b.minHeight * this.aspectRatio;
1464            pMinHeight = b.minWidth / this.aspectRatio;
1465            pMaxWidth = b.maxHeight * this.aspectRatio;
1466            pMaxHeight = b.maxWidth / this.aspectRatio;
1467
1468            if(pMinWidth > b.minWidth) b.minWidth = pMinWidth;
1469            if(pMinHeight > b.minHeight) b.minHeight = pMinHeight;
1470            if(pMaxWidth < b.maxWidth) b.maxWidth = pMaxWidth;
1471            if(pMaxHeight < b.maxHeight) b.maxHeight = pMaxHeight;
1472        }
1473        this._vBoundaries = b;
1474    },
1475
1476	_updateCache: function(data) {
1477		var o = this.options;
1478		this.offset = this.helper.offset();
1479		if (isNumber(data.left)) this.position.left = data.left;
1480		if (isNumber(data.top)) this.position.top = data.top;
1481		if (isNumber(data.height)) this.size.height = data.height;
1482		if (isNumber(data.width)) this.size.width = data.width;
1483	},
1484
1485	_updateRatio: function(data, event) {
1486
1487		var o = this.options, cpos = this.position, csize = this.size, a = this.axis;
1488
1489		if (isNumber(data.height)) data.width = (data.height * this.aspectRatio);
1490		else if (isNumber(data.width)) data.height = (data.width / this.aspectRatio);
1491
1492		if (a == 'sw') {
1493			data.left = cpos.left + (csize.width - data.width);
1494			data.top = null;
1495		}
1496		if (a == 'nw') {
1497			data.top = cpos.top + (csize.height - data.height);
1498			data.left = cpos.left + (csize.width - data.width);
1499		}
1500
1501		return data;
1502	},				
1503	_updateAFunc: function(data, event) {
1504
1505		var o = this.options, cpos = this.position, csize = this.size, a = this.axis;
1506		var el=this.element;var aspectFunc=o.aspectFunc;
1507         
1508		if (isNumber(data.height)) data.width = aspectFunc(el,data.height,'height');
1509		else if (isNumber(data.width)) data.height = aspectFunc(el,data.width,'width');
1510
1511		if (a == 'sw') {
1512			data.left = cpos.left + (csize.width - data.width);
1513			data.top = null;
1514		}
1515		if (a == 'nw') {
1516			data.top = cpos.top + (csize.height - data.height);
1517			data.left = cpos.left + (csize.width - data.width);
1518		}
1519
1520		return data;
1521	},
1522
1523	_respectSize: function(data, event) {
1524
1525		var el = this.helper, o = this._vBoundaries, pRatio = this._aspectRatio || event.shiftKey, a = this.axis,
1526				ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
1527					isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height);
1528
1529		if (isminw) data.width = o.minWidth;
1530		if (isminh) data.height = o.minHeight;
1531		if (ismaxw) data.width = o.maxWidth;
1532		if (ismaxh) data.height = o.maxHeight;
1533
1534		var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height;
1535		var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
1536
1537		if (isminw && cw) data.left = dw - o.minWidth;
1538		if (ismaxw && cw) data.left = dw - o.maxWidth;
1539		if (isminh && ch)	data.top = dh - o.minHeight;
1540		if (ismaxh && ch)	data.top = dh - o.maxHeight;
1541
1542		// fixing jump error on top/left - bug #2330
1543		var isNotwh = !data.width && !data.height;
1544		if (isNotwh && !data.left && data.top) data.top = null;
1545		else if (isNotwh && !data.top && data.left) data.left = null;
1546
1547		return data;
1548	},
1549
1550	_proportionallyResize: function() {
1551
1552		var o = this.options;
1553		if (!this._proportionallyResizeElements.length) return;
1554		var element = this.helper || this.element;
1555
1556		for (var i=0; i < this._proportionallyResizeElements.length; i++) {
1557
1558			var prel = this._proportionallyResizeElements[i];
1559
1560			if (!this.borderDif) {
1561				var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')],
1562					p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')];
1563
1564				this.borderDif = $.map(b, function(v, i) {
1565					var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0;
1566					return border + padding;
1567				});
1568			}
1569
1570			if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length)))
1571				continue;
1572
1573			prel.css({
1574				height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,
1575				width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0
1576			});
1577
1578		};
1579
1580	},
1581
1582	_renderProxy: function() {
1583
1584		var el = this.element, o = this.options;
1585		this.elementOffset = el.offset();
1586
1587		if(this._helper) {
1588
1589			this.helper = this.helper || $('<div style="overflow:hidden;"></div>');
1590
1591			// fix ie6 offset TODO: This seems broken
1592			var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0),
1593			pxyoffset = ( ie6 ? 2 : -1 );
1594
1595			this.helper.addClass(this._helper).css({
1596				width: this.element.outerWidth() + pxyoffset,
1597				height: this.element.outerHeight() + pxyoffset,
1598				position: 'absolute',
1599				left: this.elementOffset.left - ie6offset +'px',
1600				top: this.elementOffset.top - ie6offset +'px',
1601				zIndex: ++o.zIndex //TODO: Don't modify option
1602			});
1603
1604			this.helper
1605				.appendTo("body")
1606				.disableSelection();
1607
1608		} else {
1609			this.helper = this.element;
1610		}
1611
1612	},
1613	
1614	_change: {
1615		e: function(event, dx, dy) {
1616			var o = this.options, cs = this.originalSize, sp = this.originalPosition;
1617			if(o.concernAngle&&this.element.data('deg')){
1618				return $.divrotate.getDegreeResizeChange(this.element,[dx,dy],sp,cs,'e');
1619			}
1620			return { width: this.originalSize.width + dx };
1621		},
1622		w: function(event, dx, dy) {
1623			var o = this.options, cs = this.originalSize, sp = this.originalPosition;
1624			if(o.concernAngle&&this.element.data('deg')){
1625				return $.divrotate.getDegreeResizeChange(this.element,[dx,dy],sp,cs,'w');
1626			}
1627			return { left: sp.left + dx, width: cs.width - dx };
1628		},
1629		n: function(event, dx, dy) {
1630			var o = this.options, cs = this.originalSize, sp = this.originalPosition;
1631			if(o.concernAngle&&this.element.data('deg')){
1632				return $.divrotate.getDegreeResizeChange(this.element,[dx,dy],sp,cs,'n');
1633			}
1634			else return { top: sp.top + dy, height: cs.height - dy };
1635		},
1636		s: function(event, dx, dy) {
1637			var o = this.options, cs = this.originalSize, sp = this.originalPosition;
1638			if(o.concernAngle&&this.element.data('deg')){
1639				return $.divrotate.getDegreeResizeChange(this.element,[dx,dy],sp,cs,'s');
1640			}
1641			return { height: this.originalSize.height + dy };
1642		},
1643		se: function(event, dx, dy) {
1644			return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
1645		},
1646		sw: function(event, dx, dy) {
1647			return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
1648		},
1649		ne: function(event, dx, dy) {
1650			return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
1651		},
1652		nw: function(event, dx, dy) {
1653			var o = this.options, cs = this.originalSize, sp = this.originalPosition;
1654			if(o.concernAngle&&this.element.data('deg')){
1655				var l=sp.left,t=sp.top;
1656				var nchange=this._change.n.apply(this, arguments);
1657				var wchange=this._change.w.apply(this, arguments);
1658				var nwchange=$.extend({},nchange,wchange);
1659				nwchange.left=nchange.left+wchange.left-l;
1660				nwchange.top=nchange.top+wchange.top-t;
1661				return nwchange;
1662			}
1663			return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
1664		}
1665	},
1666
1667	_propagate: function(n, event) {
1668		$.ui.plugin.call(this, n, [event, this.ui()]);
1669		(n != "resize" && this._trigger(n, event, this.ui()));
1670	},
1671
1672	plugins: {},
1673
1674	ui: function() {
1675		return {
1676			originalElement: this.originalElement,
1677			element: this.element,
1678			helper: this.helper,
1679			position: this.position,
1680			size: this.size,
1681			originalSize: this.originalSize,
1682			originalPosition: this.originalPosition
1683		};
1684	}
1685
1686});
1687
1688$.extend($.ui.resizable, {
1689	version: "1.8.17"
1690});
1691
1692/*
1693 * Resizable Extensions
1694 */
1695
1696$.ui.plugin.add("resizable", "alsoResize", {
1697
1698	start: function (event, ui) {
1699		var self = $(this).data("resizable"), o = self.options;
1700
1701		var _store = function (exp) {
1702			$(exp).each(function() {
1703				var el = $(this);
1704				el.data("resizable-alsoresize", {
1705					width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
1706					left: parseInt(el.css('left'), 10), top: parseInt(el.css('top'), 10),
1707					position: el.css('position') // to reset Opera on stop()
1708				});
1709			});
1710		};
1711
1712		if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) {
1713			if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); }
1714			else { $.each(o.alsoResize, function (exp) { _store(exp); }); }
1715		}else{
1716			_store(o.alsoResize);
1717		}
1718	},
1719
1720	resize: function (event, ui) {
1721		var self = $(this).data("resizable"), o = self.options, os = self.originalSize, op = self.originalPosition;
1722
1723		var delta = {
1724			height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0,
1725			top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0
1726		},
1727
1728		_alsoResize = function (exp, c) {
1729			$(exp).each(function() {
1730				var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, 
1731					css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left'];
1732
1733				$.each(css, function (i, prop) {
1734					var sum = (start[prop]||0) + (delta[prop]||0);
1735					if (sum && sum >= 0)
1736						style[prop] = sum || null;
1737				});
1738
1739				// Opera fixing relative position
1740				if ($.browser.opera && /relative/.test(el.css('position'))) {
1741					self._revertToRelativePosition = true;
1742					el.css({ position: 'absolute', top: 'auto', left: 'auto' });
1743				}
1744
1745				el.css(style);
1746			});
1747		};
1748
1749		if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) {
1750			$.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); });
1751		}else{
1752			_alsoResize(o.alsoResize);
1753		}
1754	},
1755
1756	stop: function (event, ui) {
1757		var self = $(this).data("resizable"), o = self.options;
1758
1759		var _reset = function (exp) {
1760			$(exp).each(function() {
1761				var el = $(this);
1762				// reset position for Opera - no need to verify it was changed
1763				el.css({ position: el.data("resizable-alsoresize").position });
1764			});
1765		};
1766
1767		if (self._revertToRelativePosition) {
1768			self._revertToRelativePosition = false;
1769			if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) {
1770				$.each(o.alsoResize, function (exp) { _reset(exp); });
1771			}else{
1772				_reset(o.alsoResize);
1773			}
1774		}
1775
1776		$(this).removeData("resizable-alsoresize");
1777	}
1778});
1779
1780$.ui.plugin.add("resizable", "animate", {
1781
1782	stop: function(event, ui) {
1783		var self = $(this).data("resizable"), o = self.options;
1784
1785		var pr = self._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
1786					soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
1787						soffsetw = ista ? 0 : self.sizeDiff.width;
1788
1789		var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
1790					left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
1791						top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
1792
1793		self.element.animate(
1794			$.extend(style, top && left ? { top: top, left: left } : {}), {
1795				duration: o.animateDuration,
1796				easing: o.animateEasing,
1797				step: function() {
1798
1799					var data = {
1800						width: parseInt(self.element.css('width'), 10),
1801						height: parseInt(self.element.css('height'), 10),
1802						top: parseInt(self.element.css('top'), 10),
1803						left: parseInt(self.element.css('left'), 10)
1804					};
1805
1806					if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height });
1807
1808					// propagating resize, and updating values for each animation step
1809					self._updateCache(data);
1810					self._propagate("resize", event);
1811
1812				}
1813			}
1814		);
1815	}
1816
1817});
1818
1819$.ui.plugin.add("resizable", "containment", {
1820
1821	start: function(event, ui) {
1822		var self = $(this).data("resizable"), o = self.options, el = self.element;
1823		var oc = o.containment,	ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;
1824		if (!ce) return;
1825
1826		self.containerElement = $(ce);
1827
1828		if (/document/.test(oc) || oc == document) {
1829			self.containerOffset = { left: 0, top: 0 };
1830			self.containerPosition = { left: 0, top: 0 };
1831
1832			self.parentData = {
1833				element: $(document), left: 0, top: 0,
1834				width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight
1835			};
1836		}
1837
1838		// i'm a node, so compute top, left, right, bottom
1839		else {
1840			var element = $(ce), p = [];
1841			$([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); });
1842
1843			self.containerOffset = element.offset();
1844			self.containerPosition = element.position();
1845			self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) };
1846
1847			var co = self.containerOffset, ch = self.containerSize.height,	cw = self.containerSize.width,
1848						width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);
1849
1850			self.parentData = {
1851				element: ce, left: co.left, top: co.top, width: width, height: height
1852			};
1853		}
1854	},
1855
1856	resize: function(event, ui) {
1857		var self = $(this).data("resizable"), o = self.options,
1858				ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position,
1859				pRatio = self._aspectRatio || event.shiftKey, cop = { top:0, left
1859:0 }, ce = self.containerElement;
1860
1861		if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co;
1862
1863		if (cp.left < (self._helper ? co.left : 0)) {
1864			self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left));
1865			if (pRatio) self.size.height = self.size.width / o.aspectRatio;
1866			self.position.left = o.helper ? co.left : 0;
1867		}
1868
1869		if (cp.top < (self._helper ? co.top : 0)) {
1870			self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top);
1871			if (pRatio) self.size.width = self.size.height * o.aspectRatio;
1872			self.position.top = self._helper ? co.top : 0;
1873		}
1874
1875		self.offset.left = self.parentData.left+self.position.left;
1876		self.offset.top = self.parentData.top+self.position.top;
1877
1878		var woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ),
1879					hoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height );
1880
1881		var isParent = self.containerElement.get(0) == self.element.parent().get(0),
1882		    isOffsetRelative = /relative|absolute/.test(self.containerElement.css('position'));
1883
1884		if(isParent && isOffsetRelative) woset -= self.parentData.left;
1885
1886		if (woset + self.size.width >= self.parentData.width) {
1887			self.size.width = self.parentData.width - woset;
1888			if (pRatio) self.size.height = self.size.width / self.aspectRatio;
1889		}
1890
1891		if (hoset + self.size.height >= self.parentData.height) {
1892			self.size.height = self.parentData.height - hoset;
1893			if (pRatio) self.size.width = self.size.height * self.aspectRatio;
1894		}
1895	},
1896
1897	stop: function(event, ui){
1898		var self = $(this).data("resizable"), o = self.options, cp = self.position,
1899				co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement;
1900
1901		var helper = $(self.helper), ho = helper.offset(), w = helper.outerWidth() - self.sizeDiff.width, h = helper.outerHeight() - self.sizeDiff.height;
1902
1903		if (self._helper && !o.animate && (/relative/).test(ce.css('position')))
1904			$(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
1905
1906		if (self._helper && !o.animate && (/static/).test(ce.css('position')))
1907			$(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
1908
1909	}
1910});
1911
1912$.ui.plugin.add("resizable", "scroll", {
1913	start: function(event, ui) {
1914		var i = $(this).data("resizable");o=i.options;
1915		if(o.scroll &&(!o.concernAngle||o.concernAngle&&!i.element.data('deg'))){
1916			i.scrollout=1;
1917			if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();
1918		}
1919	},
1920	resize: function(event, ui) {
1921
1922		var i = $(this).data("resizable"), o = i.options, scrolled = false;
1923		if(o.scroll &&(!o.concernAngle||o.concernAngle&&!i.element.data('deg'))){
1924			if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {
1925					var oriscrolltop= i.scrollParent[0].scrollTop;
1926					i.element.data('resize_oriscrolltop',oriscrolltop);
1927					var lastheightval=i.lastheightval||0;
1928					if((i.axis=='s' || i.axis=='n')&&lastheightval-i.size.height !=0){
1929						i.lastheightval=i.size.height;
1930						var delta=0;
1931						var func=function(type){
1932							delta=i.scrollParent[0].scrollTop-oriscrolltop;
1933							if(i.axis=='s'){
1934								if(i.scrollout==1){
1935									i.size.height +=delta;
1936									i.scrollout=type;
1937								}else{
1938									i.size.height +=delta*2;
1939								}
1940							}else{
1941								if(i.scrollout==1){
1942									i.size.height -=delta;
1943									i.position.top+=delta;
1944									i.scrollout=type;
1945								}else{
1946									i.size.height -=delta*2;
1947									i.position.top+=delta*2;
1948								}
1949							}
1950						}
1951						if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity){
1952							i.scrollParent[0].scrollTop = scrolled =oriscrolltop + o.scrollSpeed;
1953							func(2);
1954						}else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity){
1955							i.scrollParent[0].scrollTop = scrolled = oriscrolltop - o.scrollSpeed;
1956							func(3);
1957						}else{
1958							i.scrollout=1;
1959						}
1960					}
1961			} 
1962		}
1963
1964
1965	}
1966});
1967
1968$.ui.plugin.add("resizable", "ghost", {
1969
1970	start: function(event, ui) {
1971
1972		var self = $(this).data("resizable"), o = self.options, cs = self.size;
1973
1974		self.ghost = self.originalElement.clone();
1975		self.ghost
1976			.css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 })
1977			.addClass('ui-resizable-ghost')
1978			.addClass(typeof o.ghost == 'string' ? o.ghost : '');
1979
1980		self.ghost.appendTo(self.helper);
1981
1982	},
1983
1984	resize: function(event, ui){
1985		var self = $(this).data("resizable"), o = self.options;
1986		if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width });
1987	},
1988
1989	stop: function(event, ui){
1990		var self = $(this).data("resizable"), o = self.options;
1991		if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0));
1992	}
1993
1994});
1995
1996$.ui.plugin.add("resizable", "grid", {
1997
1998	resize: function(event, ui) {
1999		var self = $(this).data("resizable"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey;
2000		o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid;
2001		var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1);
2002
2003		if (/^(se|s|e)$/.test(a)) {
2004			self.size.width = os.width + ox;
2005			self.size.height = os.height + oy;
2006		}
2007		else if (/^(ne)$/.test(a)) {
2008			self.size.width = os.width + ox;
2009			self.size.height = os.height + oy;
2010			self.position.top = op.top - oy;
2011		}
2012		else if (/^(sw)$/.test(a)) {
2013			self.size.width = os.width + ox;
2014			self.size.height = os.height + oy;
2015			self.position.left = op.left - ox;
2016		}
2017		else {
2018			self.size.width = os.width + ox;
2019			self.size.height = os.height + oy;
2020			self.position.top = op.top - oy;
2021			self.position.left = op.left - ox;
2022		}
2023	}
2024
2025});
2026
2027//wopop cstlyer 
2028$.ui.plugin.add("resizable", "wopop_snap", {
2029	start: function(event, ui) {
2030		return;
2031		var i = $(this).data("resizable"), o = i.options;
2032		var wopop_snap=o.wopop_snap;
2033		if(!wopop_snap) return;
2034		if($(this).data('deg')) return;
2035		if(!$(this).is('.cstlayer')) return; 
2036		if($(this).closest('.fullpagesection').length) return;
2037		
2038		i.snapElements = [];
2039		var abs_top=$(this).ab_pos_cnter('top')-i.originalPosition.top;
2040		i.wopop_ab_top=abs_top;
2041		
2042		var vsnap=[];
2043	     var hsnap=[];
2044		function in_array(num,snaparr){
2045			for(var i=0;i<snaparr.length;i++){
2046				var snapnum=snaparr[i];
2047				if(Math.abs(snapnum-num)<2) return 1;
2048			}
2049			return -1;
2050		}
2051		
2052		function clear_snap(){
2053			vsnap=[];
2054			hsnap=[];
2055			$('.wopop_snap').remove();
2056			i.snapElements=[];
2057		}
2058		
2059		 function getLayerSnap(layer){
2060				 var t=parseInt(layer.ab_pos_cnter('top'))||0;
2061				 var b=t+parseInt(layer.css('height'))||0;
2062				 var l=parseInt(layer.css('left'))||0;
2063				 var r=l+parseInt(layer.css('width'))||0;
2064				 var offsetl=$('#canvas').offset().left-$('#scroll_container').offset().left;
2065				 var totalh=$('#scroll_container_bg').height();
2066				 var scct=$('#scroll_container').scrollTop();
2067				 i.ori_scct=scct;
2068//				 if(!((t>scct&&t<scct+$(window).height())||(b>scct&&b<scct+$(window).height()))){
2069//					 return;
2070//				 }
2071				 if(in_array(t, hsnap)==-1){
2072						 hsnap.push(t);
2073						 var snapstr="<div class='wopop_snap_horizon wopop_snap' style='top:"+t+"px;'></div>";
2074						 $('#scroll_container').append(snapstr);
2075				 }
2076				 if(in_array(b, hsnap)==-1){
2077						 hsnap.push(b);
2078						 var snapstr="<div class='wopop_snap_horizon wopop_snap' style='top:"+b+"px;'></div>";
2079						 $('#scroll_container').append(snapstr);
2080				 }
2081				 if(in_array(l, vsnap)==-1){
2082						 vsnap.push(l);
2083						 var snapstr="<div class='wopop_snap_vertical wopop_snap' style='left:"+(offsetl+l)+"px;height:"+totalh+"px;'></div>";
2084						 $('#scroll_container').append(snapstr);
2085				 }
2086				 if(in_array(r, vsnap)==-1){
2087						 vsnap.push(r);
2088						 var snapstr="<div class='wopop_snap_vertical wopop_snap' style='left:"+(offsetl+r)+"px;height:"+totalh+"px;'></div>";
2089						 $('#scroll_container').append(snapstr);
2090				 }
2091		 }
2092
2093		$(this).unbind('layersnapstart').bind('layersnapstart',function(){
2094			clear_snap();
2095			if($.getElementAreaInf($(this))=='canvas'){
2096				$('#canvas .cstlayer:not(.ui-modselected)').each(function(){
2097					getLayerSnap($(this));
2098				})
2099			}else{
2100				$('#scroll_container .cstlayer:not(.ui-modselected)').each(function(){
2101					getLayerSnap($(this));
2102				})
2103			}
2104			
2105
2106			i.snapElements=[];
2107			var scct=$('#scroll_container').scrollTop();
2108			var offsetl=$('#canvas').offset().left;
2109			$('.wopop_snap').each(function(){
2110				var $t = $(this); var $o = $t.offset();
2111				if($t.is('.wopop_snap_vertical')){
2112					i.snapElements.push({
2113						item: this,
2114						width: 0, height: $t.outerHeight(),
2115						top: 0, left: $o.left-offsetl
2116					});
2117				}else{
2118					i.snapElements.push({
2119						item: this,
2120						width: $t.outerWidth(), height: 0,
2121						top: parseInt($t.css('top'))||0, left: 0
2122					});
2123				}
2124
2125			})
2126		})
2127		$(this).trigger('layersnapstart');
2128		
2129
2130	},
2131	resize: function(event, ui) {
2132		return;
2133		var inst = $(this).data("resizable"), o = inst.options;
2134		var wopop_snap=o.wopop_snap;
2135		if(!wopop_snap) return;
2136		if($(this).data('deg')) return;
2137		if(!$(this).is('.cstlayer')) return; 
2138		var snapMode='outer';
2139		var d = 3; //snapTolerance :5,
2140		var scct=$('#scroll_container').scrollTop();
2141		var ori_scct=inst.ori_scct;
2142		if(scct !=ori_scct ){
2143			$(this).trigger('layersnapstart');
2144		}
2145		var self = inst;var offsetminus=0;//canvas 值存在小数导致模块left对齐有偏差
2146		var cs = self.size, os = self.originalSize, op = self.originalPosition,a = self.axis;
2147		var ab_top=inst.wopop_ab_top;
2148
2149		
2150		for (var i = inst.snapElements.length - 1; i >= 0; i--){
2151
2152			var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
2153				t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
2154			var snapel=$(inst.snapElements[i].item);
2155			var is_snap=false;
2156
2157			if(a=='e' || a=='w'){
2158				if(!snapel.is('.wopop_snap_vertical')){
2159					inst.snapElements[i].snapping = false;
2160					snapel.removeClass('showline');
2161					continue;
2162				}
2163				if(a=='e'){
2164					var y2=op.left+self.size.width;
2165					var rs = Math.abs(l -y2) <= d;
2166					if(rs){
2167						self.size.width = self.size.width + (l -y2)-offsetminus;
2168						is_snap=true;
2169					}
2170				}else{
2171					var y=self.position.left;
2172					var ls = Math.abs(l -y) <= d;
2173					if(ls){
2174						self.size.width = self.size.width - (l -y)+offsetminus;
2175						self.position.left=self.position.left+(l -y)-offsetminus;
2176						is_snap=true;
2177					}
2178				}
2179			}else if(a=='n' || a=='s'){
2180				if(!snapel.is('.wopop_snap_horizon')){
2181					inst.snapElements[i].snapping = false;
2182					snapel.removeClass('showline');
2183					continue;
2184				}
2185				if(a=='n'){
2186					var y2=self.position.top+ab_top;
2187					var ts = Math.abs(t -y2) <= d;
2188					if(ts){
2189						self.size.height = self.size.height - (t -y2);
2190						self.position.top=self.position.top+ (t -y2);
2191						is_snap=true;
2192					}
2193				}else{
2194					var y2=self.position.top+ab_top+self.size.height;
2195					var bs = Math.abs(b -y2) <= d;
2196					if(bs){
2197						self.size.height = self.size.height +(b -y2);
2198						is_snap=true;
2199					}
2200				}
2201			}else{
2202				var axisarr=a.match(/./g);
2203				for(var ii=0;ii<axisarr.length;ii++){
2204					var axis2=axisarr[ii];
2205					if(axis2=='e'){
2206						var y2=op.left+self.size.width;
2207						var rs = Math.abs(r -y2) <= d;
2208						if(rs){
2209							self.size.width = self.size.width + (r -y2)-offsetminus;
2210							is_snap=true;
2211						}
2212					}else if(axis2=='w'){
2213						var y=self.position.left;
2214						var ls = Math.abs(l -y) <= d;
2215						if(ls){
2216							self.size.width = self.size.width - (l -y)+offsetminus;
2217							self.position.left=self.position.left+(l -y)-offsetminus;
2218							is_snap=true;
2219						}
2220					}else if(axis2=='n'){
2221						var y2=self.position.top+ab_top;
2222						var ts = Math.abs(t -y2) <= d;
2223						if(ts){
2224							self.size.height = self.size.height - (t -y2);
2225							self.position.top=self.position.top+ (t -y2);
2226							is_snap=true;
2227						}
2228					}else if(axis2=='s'){
2229						var y2=self.position.top+self.size.height+ab_top;
2230						var bs = Math.abs(b -y2) <= d;
2231						if(bs){
2232							self.size.height = self.size.height +(b -y2);
2233							is_snap=true;
2234						}
2235					}
2236				}
2237			}
2238			if(is_snap){
2239				inst.snapElements[i].snapping = true;
2240				if($(inst.snapElements[i].item).is('.wopop_snap_vertical')){
2241					$('.wopop_snap_vertical').removeClass('showline');
2242				}else{
2243					$('.wopop_snap_horizon').removeClass('showline');
2244				}
2245				$(inst.snapElements[i].item).addClass('showline');
2246			}else{
2247				inst.snapElements[i].snapping = false;
2248				snapel.removeClass('showline');
2249				continue;
2250			}
2251               continue;
2252
2253		};
2254
2255	},
2256	stop: function(event, ui) {
2257		return;
2258		$('.wopop_snap').remove();
2259	}
2260});
2261
2262var num = function(v) {
2263	return parseInt(v, 10) || 0;
2264};
2265
2266var isNumber = function(value) {
2267	return !isNaN(parseInt(value, 10));
2268};
2269
2270})(jQuery);
2271 /*
2272 * jQuery UI Slider 1.8.17
2273 *
2274 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
2275 * Dual licensed under the MIT or GPL Version 2 licenses.
2276 * http://jquery.org/license
2277 *
2278 * http://docs.jquery.com/UI/Slider
2279 *
2280 * Depends:
2281 *	jquery.ui.core.js
2282 *	jquery.ui.mouse.js
2283 *	jquery.ui.widget.js
2284 */(function(a,b){var c=5;a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var b=this,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",g=d.values&&d.values.length||1,h=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(d.disabled?" ui-slider-disabled ui-disabled":"")),this.range=a([]),d.range&&(d.range===!0&&(d.values||(d.values=[this._valueMin(),this._valueMin()]),d.values.length&&d.values.length!==2&&(d.values=[d.values[0],d.values[0]])),this.range=a("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;i<g;i+=1)h.push(f);this.handles=e.add(a(h.join("")).appendTo(b.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).hover(function(){d.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){d.disabled?a(this).blur():(a(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),a(this).addClass("ui-state-focus"))}).blur(function(){a(this).removeClass("ui-state-focus")}),this.handles.each(function(b){a(this).data("index.ui-slider-handle",b)}),this.handles.keydown(function(d){var e=!0,f=a(this).data("index.ui-slider-handle"),g,h,i,j;if(!b.options.disabled){switch(d.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:e=!1;if(!b._keySliding){b._keySliding=!0,a(this).addClass("ui-state-active"),g=b._start(d,f);if(g===!1)return}}j=b.options.step,b.options.values&&b.options.values.length?h=i=b.values(f):h=i=b.value();switch(d.keyCode){case a.ui.keyCode.HOME:i=b._valueMin();break;case a.ui.keyCode.END:i=b._valueMax();break;case a.ui.keyCode.PAGE_UP:i=b._trimAlignValue(h+(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.PAGE_DOWN:i=b._trimAlignValue(h-(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(h===b._valueMax())return;i=b._trimAlignValue(h+j);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(h===b._valueMin())return;i=b._trimAlignValue(h-j)}b._slide(d,f,i);return e}}).keyup(function(c){var d=a(this).data("index.ui-slider-handle");b._keySliding&&(b._keySliding=!1,b._stop(c,d),b._change(c,d),a(this).removeClass("ui-state-active"))}),this._refreshValue(),this._animateOff=!1},destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"),this._mouseDestroy();return this},_mouseCapture:function(b){var c=this.options,d,e,f,g,h,i,j,k,l;if(c.disabled)return!1;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),d={x:b.pageX,y:b.pageY},e=this._normValueFromMouse(d),f=this._valueMax()-this._valueMin()+1,h=this,this.handles.each(function(b){var c=Math.abs(e-h.values(b));f>c&&(f=c,g=a(this),i=b)}
vendor: 4,301 bytes, line 2284
2284),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i);if(j===!1)return!1;this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0;return!0},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);this._slide(a,this._handleIndex,c);return!1},_mouseStop:function(a){this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1;return!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e;return this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values());return this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c<d)&&(c=d),c!==this.values(b)&&(e=this.values(),e[b]=c,f=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e}),d=this.values(b?0:1),f!==!1&&this.values(b,c,!0))):c!==this.value()&&(f=this._trigger("slide",a,{handle:this.handles[b],value:c}),f!==!1&&this.value(c))},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("change",a,c)}},value:function(a){if(arguments.length)this.options.value=this._trimAlignValue(a),this._refreshValue(),this._change(null,0);else return this._value()},values:function(b,c){var d,e,f;if(arguments.length>1)this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);else{if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f<d.length;f+=1)d[f]=this._trimAlignValue(e[f]),this._change(null,f);this._refreshValue()}},_setOption:function(b,c){var d,e=0;a.isArray(this.options.values)&&(e=this.options.values.length),a.Widget.prototype._setOption.apply(this,arguments);switch(b){case"disabled":c?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.propAttr("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(d=0;d<e;d+=1)this._change(null,d);this._animateOff=!1}},_value:function(){var a=this.options.value;a=this._trimAlignValue(a);return a},_values:function(a){var b,c,d;if(arguments.length){b=this.options.values[a],b=this._trimAlignValue(b);return b}c=this.options.values.slice();for(d=0;d<c.length;d+=1)c[d]=this._trimAlignValue(c[d]);return c}
2284,_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;Math.abs(c)*2>=b&&(d+=c>0?b:-b);return parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.17"})})(jQuery);
2285
2286 /*
2287 * jQuery UI Position 1.8.17
2288 *
2289 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
2290 * Dual licensed under the MIT or GPL Version 2 licenses.
2291 * http://jquery.org/license
2292 *
2293 * http://docs.jquery.com/UI/Position
2294 */(function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1];return this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]!==e){var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0}},top:function(b,c){if(c.at[1]!==e){var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];if(!c||!c.ownerDocument)return null;if(b)return this.each(function(){a.offset.setOffset(this,b)});return h.call(this)}),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",
2294width:0,height:0,border:0,margin:0,background:"none"},b&&jQuery.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);
2295
2296/********************************************
2297 * 
2298 */
2299 /*
2300 * jQuery UI Autocomplete 1.8.17
2301 *
2302 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
2303 * Dual licensed under the MIT or GPL Version 2 licenses.
2304 * http://jquery.org/license
2305 *
2306 * http://docs.jquery.com/UI/Autocomplete
2307 *
2308 * Depends:
2309 *	jquery.ui.core.js
2310 *	jquery.ui.widget.js
2311 *	jquery.ui.position.js
2312 */
2313 (function(B,C){var A=0;B.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,width:"auto",position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var F=this,D=this.element[0].ownerDocument,E;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(H){if(F.options.disabled||F.element.propAttr("readOnly")){return}E=false;var G=B.ui.keyCode;switch(H.keyCode){case G.PAGE_UP:F._move("previousPage",H);break;case G.PAGE_DOWN:F._move("nextPage",H);break;case G.UP:F._move("previous",H);H.preventDefault();break;case G.DOWN:F._move("next",H);H.preventDefault();break;case G.ENTER:case G.NUMPAD_ENTER:if(F.menu.active){E=true;H.preventDefault()}case G.TAB:if(!F.menu.active){return}F.menu.select(H);break;case G.ESCAPE:F.element.val(F.term);F.close(H);break;default:clearTimeout(F.searching);F.searching=setTimeout(function(){if(F.term!=F.element.val()){F.selectedItem=null;F.search(null,H)}},F.options.delay);break}}).bind("keypress.autocomplete",function(G){if(E){E=false;G.preventDefault()}}).bind("focus.autocomplete",function(){if(F.options.disabled){return}F.selectedItem=null;F.previous=F.element.val()}).bind("blur.autocomplete",function(G){if(F.options.disabled){return}clearTimeout(F.searching);F.closing=setTimeout(function(){F.close(G);F._change(G)},150)});this._initSource();this.response=function(){return F._response.apply(F,arguments)};this.menu=B("<ul></ul>").addClass("ui-autocomplete").appendTo(B(this.options.appendTo||"body",D)[0]).mousedown(function(G){var H=F.menu.element[0];if(!B(G.target).closest(".ui-menu-item").length){setTimeout(function(){B(document).one("mousedown",function(I){if(I.target!==F.element[0]&&I.target!==H&&!B.ui.contains(H,I.target)){F.close()}})},1)}setTimeout(function(){clearTimeout(F.closing)},13)}).menu({focus:function(H,G){var I=G.item.data("item.autocomplete");if(false!==F._trigger("focus",H,{item:I})){if(/^key/.test(H.originalEvent.type)){F.element.val(I.value)}}},selected:function(H,G){var J=G.item.data("item.autocomplete"),I=F.previous;if(F.element[0]!==D.activeElement){F.element.focus();F.previous=I;setTimeout(function(){F.previous=I;F.selectedItem=J},1)}if(false!==F._trigger("select",H,{item:J})){F.element.val(J.value)}F.term=F.element.val();F.close(H);F.selectedItem=J},blur:function(H,G){if(F.menu.element.is(":visible")&&(F.element.val()!==F.term)){F.element.val(F.term)}}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");if(B.fn.bgiframe){this.menu.element.bgiframe()}F.beforeunloadHandler=function(){F.element.removeAttr("autocomplete")};B(window).bind("beforeunload",F.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();B(window).unbind("beforeunload",this.beforeunloadHandler);B.Widget.prototype.destroy.call(this)},_setOption:function(E,D){B.Widget.prototype._setOption.apply(this,arguments);if(E==="source"){this._initSource()}if(E==="appendTo"){this.menu.element.appendTo(B(D||"body",this.element[0].ownerDocument)[0])}if(E==="disabled"&&D&&this.xhr){this.xhr.abort()}},_initSource:function(){var E=this,F,D;if(B.isArray(this.options.source)){F=this.options.source;this.source=function(H,G){G(B.ui.autocomplete.filter(F,H.term))}}else{if(typeof this.options.source==="string"){D=this.options.source;this.source=function(H,G){if(E.xhr){E.xhr.abort()}E.xhr=B.ajax({url:D,data:H,dataType:"json",autocompleteRequest:++A,success:function(J,I){if(this.autocompleteRequest===A){G(J)}},error:function(){if(this.autocompleteRequest===A){G([])}}})}}else{this.source=this.options.source}}},search:function(D,E){D=D!=null?D:this.element.val();this.term=this.element.val();if(D.length<this.options.minLength){return this.close(E)}clearTimeout(this.closing);
2313if(this._trigger("search",E)===false){return}return this._search(D)},_search:function(D){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:D},this.response)},_response:function(D){if(!this.options.disabled&&D&&D.length){D=this._normalize(D);this._suggest(D);this._trigger("open")}else{this.close()}this.pending--;if(!this.pending){this.element.removeClass("ui-autocomplete-loading")}},close:function(D){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.deactivate();this._trigger("close",D)}},_change:function(D){if(this.previous!==this.element.val()){this._trigger("change",D,{item:this.selectedItem})}},_normalize:function(D){if(D.length&&D[0].label&&D[0].value){return D}return B.map(D,function(E){if(typeof E==="string"){return{label:E,value:E}}return B.extend({label:E.label||E.value,value:E.value||E.label},E)})},_suggest:function(D){var E=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(E,D);this.menu.deactivate();this.menu.refresh();E.show();this._resizeMenu();E.position(B.extend({of:this.element},this.options.position));if(this.options.autoFocus){this.menu.next(new B.Event("mouseover"))}},_resizeMenu:function(){var D=this.menu.element;if(this.options.width=="auto"){D.outerWidth(Math.max(D.width("").outerWidth()+1,this.element.outerWidth()))}else{D.outerWidth(this.options.width).css({"overflow-x":"hidden"})}},_renderMenu:function(F,D){var E=this;B.each(D,function(H,G){E._renderItem(F,G)})},_renderItem:function(E,D){return B("<li></li>").data("item.autocomplete",D).append(B("<a></a>").text(D.label)).appendTo(E)},_move:function(D,E){if(!this.menu.element.is(":visible")){this.search(null,E);return}if(this.menu.first()&&/^previous/.test(D)||this.menu.last()&&/^next/.test(D)){this.element.val(this.term);this.menu.deactivate();return}this.menu[D](E)},widget:function(){return this.menu.element}});B.extend(B.ui.autocomplete,{escapeRegex:function(D){return D.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(F,E){var D=new RegExp(B.ui.autocomplete.escapeRegex(E),"i");return B.grep(F,function(G){return D.test(G.label||G.value||G)})}})}(jQuery));
2314
2315/*
2316 * jQuery UI Menu (not officially released)
2317 * 
2318 * This widget isn't yet finished and the API is subject to change. We plan to finish
2319 * it for the next release. You're welcome to give it a try anyway and give us feedback,
2320 * as long as you're okay with migrating your code later on. We can help with that, too.
2321 *
2322 * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
2323 * Dual licensed under the MIT or GPL Version 2 licenses.
2324 * http://jquery.org/license
2325 *
2326 * http://docs.jquery.com/UI/Menu
2327 *
2328 * Depends:
2329 *	jquery.ui.core.js
2330 *  jquery.ui.widget.js
2331 */
2332(function(A){A.widget("ui.menu",{_create:function(){var B=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(C){if(!A(C.target).closest(".ui-menu-item a").length){return}C.preventDefault();B.select(C)});this.refresh()},refresh:function(){var C=this;var B=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");B.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(D){C.activate(D,A(this).parent())}).mouseleave(function(){C.deactivate()})},activate:function(C,F){this.deactivate();if(this.hasScroll()){var D=F.offset().top-this.element.offset().top,E=this.element.scrollTop(),B=this.element.height();if(D<0){this.element.scrollTop(E+D)}else{if(D>=B){this.element.scrollTop(E+D-B+F.height())}}}this.active=F.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",C,{item:F})},deactivate:function(){if(!this.active){return}this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null},next:function(B){this.move("next",".ui-menu-item:first",B)},previous:function(B){this.move("prev",".ui-menu-item:last",B)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(C,B,D){if(!this.active){this.activate(D,this.element.children(B));return}var E=this.active[C+"All"](".ui-menu-item").eq(0);if(E.length){this.activate(D,E)}else{this.activate(D,this.element.children(B))}},nextPage:function(E){if(this.hasScroll()){if(!this.active||this.last()){this.activate(E,this.element.children(".ui-menu-item:first"));return}var B=this.active.offset().top,D=this.element.height(),C=this.element.children(".ui-menu-item").filter(function(){var F=A(this).offset().top-B-D+A(this).height();return F<10&&F>-10});if(!C.length){C=this.element.children(".ui-menu-item:last")}this.activate(E,C)}else{this.activate(E,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))}},previousPage:function(D){if(this.hasScroll()){if(!this.active||this.first()){this.activate(D,this.element.children(".ui-menu-item:last"));return}var B=this.active.offset().top,C=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var E=A(this).offset().top-B+C-A(this).height();return E<10&&E>-10});if(!result.length){result=this.element.children(".ui-menu-item:first")}this.activate(D,result)}else{this.activate(D,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))}},hasScroll:function(){return this.element.height()<this.element[A.fn.prop?"prop":"attr"]("scrollHeight")},select:function(B){this._trigger("selected",B,{item:this.active})}})}(jQuery));
2333
2334/*
2335 * jQuery UI Selectable 1.8.17
2336 *
2337 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
2338 * Dual licensed under the MIT or GPL Version 2 licenses.
2339 * http://jquery.org/license
2340 *
2341 * http://docs.jquery.com/UI/Selectables
2342 *
2343 * Depends:
2344 *	jquery.ui.core.js
2345 *	jquery.ui.mouse.js
2346 *	jquery.ui.widget.js
2347 */
2348(function( $, undefined ) {
2349
2350$.widget("ui.selectable", $.ui.mouse, {
2351	options: {
2352		appendTo: 'body',
2353		autoRefresh: true,
2354		distance: 0,
2355		filter: '*',
2356		tolerance: 'touch'
2357	},
2358	_create: function() {
2359		var self = this;
2360
2361		this.element.addClass("ui-selectable");
2362
2363		this.dragged = false;
2364
2365		// cache selectee children based on filter
2366		var selectees;
2367		this.refresh = function() {
2368			selectees = $(self.options.filter, self.element[0]);
2369			selectees.addClass("ui-selectee");
2370			selectees.each(function() {
2371				var $this = $(this);
2372				var pos = $this.offset();
2373				$.data(this, "selectable-item", {
2374					element: this,
2375					$element: $this,
2376					left: pos.left,
2377					top: pos.top,
2378					right: pos.left + $this.outerWidth(),
2379					bottom: pos.top + $this.outerHeight(),
2380					startselected: false,
2381					selected: $this.hasClass('ui-selected'),
2382					selecting: $this.hasClass('ui-selecting'),
2383					unselecting: $this.hasClass('ui-unselecting')
2384				});
2385			});
2386		};
2387		this.refresh();
2388
2389		this.selectees = selectees.addClass("ui-selectee");
2390
2391		this._mouseInit();
2392
2393		this.helper = $("<div class='ui-selectable-helper'></div>");
2394	},
2395
2396	destroy: function() {
2397		this.selectees
2398			.removeClass("ui-selectee")
2399			.removeData("selectable-item");
2400		this.element
2401			.removeClass("ui-selectable ui-selectable-disabled")
2402			.removeData("selectable")
2403			.unbind(".selectable");
2404		this._mouseDestroy();
2405
2406		return this;
2407	},
2408
2409	_mouseStart: function(event) {
2410		var self = this;
2411
2412		this.opos = [event.pageX, event.pageY];
2413
2414		if (this.options.disabled)
2415			return;
2416
2417		var options = this.options;
2418
2419		this.selectees = $(options.filter, this.element[0]);
2420
2421		this._trigger("start", event);
2422
2423		$(options.appendTo).append(this.helper);
2424		// position helper (lasso)
2425		this.helper.css({
2426			"left": event.clientX,
2427			"top": event.clientY,
2428			"width": 0,
2429			"height": 0
2430		});
2431
2432		if (options.autoRefresh) {
2433			this.refresh();
2434		}
2435
2436		this.selectees.filter('.ui-selected').each(function() {
2437			var selectee = $.data(this, "selectable-item");
2438			selectee.startselected = true;
2439			if (!event.metaKey && !event.ctrlKey) {
2440				selectee.$element.removeClass('ui-selected');
2441				selectee.selected = false;
2442				selectee.$element.addClass('ui-unselecting');
2443				selectee.unselecting = true;
2444				// selectable UNSELECTING callback
2445				self._trigger("unselecting", event, {
2446					unselecting: selectee.element
2447				});
2448			}
2449		});
2450
2451		$(event.target).parents().andSelf().each(function() {
2452			var selectee = $.data(this, "selectable-item");
2453			if (selectee) {
2454				var doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass('ui-selected');
2455				selectee.$element
2456					.removeClass(doSelect ? "ui-unselecting" : "ui-selected")
2457					.addClass(doSelect ? "ui-selecting" : "ui-unselecting");
2458				selectee.unselecting = !doSelect;
2459				selectee.selecting = doSelect;
2460				selectee.selected = doSelect;
2461				// selectable (UN)SELECTING callback
2462				if (doSelect) {
2463					self._trigger("selecting", event, {
2464						selecting: selectee.element
2465					});
2466				} else {
2467					self._trigger("unselecting", event, {
2468						unselecting: selectee.element
2469					});
2470				}
2471				return false;
2472			}
2473		});
2474
2475	},
2476
2477	_mouseDrag: function(event) {
2478		var self = this;
2479		this.dragged = true;
2480
2481		if (this.options.disabled)
2482			return;
2483
2484		var options = this.options;
2485
2486		var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY;
2487		if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; }
2488		if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; }
2489		this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1});
2490
2491		this.selectees.each(function() {
2492			var selectee = $.data(this, "selectable-item");
2493			//prevent helper from being selected if appendTo: selectable
2494			if (!selectee || selectee.element == self.element[0])
2495				return;
2496			var hit = false;
2497			if (options.tolerance == 'touch') {
2498				hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
2499			} else if (options.tolerance == 'fit') {
2500				hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
2501			}
2502
2503			if (hit) {
2504				// SELECT
2505				if (selectee.selected) {
2506					selectee.$element.removeClass('ui-selected');
2507					selectee.selected = false;
2508				}
2509				if (selectee.unselecting) {
2510					selectee.$element.removeClass('ui-unselecting');
2511					selectee.unselecting = false;
2512				}
2513				if (!selectee.selecting) {
2514					selectee.$element.addClass('ui-selecting');
2515					selectee.selecting = true;
2516					// selectable SELECTING callback
2517					self._trigger("selecting", event, {
2518						selecting: selectee.element
2519					});
2520				}
2521			} else {
2522				// UNSELECT
2523				if (selectee.selecting) {
2524					if ((event.metaKey || event.ctrlKey) && selectee.startselected) {
2525						selectee.$element.removeClass('ui-selecting');
2526						selectee.selecting = false;
2527						selectee.$element.addClass('ui-selected');
2528						selectee.selected = true;
2529					} else {
2530						selectee.$element.removeClass('ui-selecting');
2531						selectee.selecting = false;
2532						if (selectee.startselected) {
2533							selectee.$element.addClass('ui-unselecting');
2534							selectee.unselecting = true;
2535						}
2536						// selectable UNSELECTING callback
2537						self._trigger("unselecting", event, {
2538							unselecting: selectee.element
2539						});
2540					}
2541				}
2542				if (selectee.selected) {
2543					if (!event.metaKey && !event.ctrlKey && !selectee.startselected) {
2544						selectee.$element.removeClass('ui-selected');
2545						selectee.selected = false;
2546
2547						selectee.$element.addClass('ui-unselecting');
2548						selectee.unselecting = true;
2549						// selectable UNSELECTING callback
2550						self._trigger("unselecting", event, {
2551							unselecting: selectee.element
2552						});
2553					}
2554				}
2555			}
2556		});
2557
2558		return false;
2559	},
2560
2561	_mouseStop: function(event) {
2562		var self = this;
2563
2564		this.dragged = false;
2565
2566		var options = this.options;
2567
2568		$('.ui-unselecting', this.element[0]).each(function() {
2569			var selectee = $.data(this, "selectable-item");
2570			selectee.$element.removeClass('ui-unselecting');
2571			selectee.unselecting = false;
2572			selectee.startselected = false;
2573			self._trigger("unselected", event, {
2574				unselected: selectee.element
2575			});
2576		});
2577		$('.ui-selecting', this.element[0]).each(function() {
2578			var selectee = $.data(this, "selectable-item");
2579			selectee.$element.removeClass('ui-selecting').addClass('ui-selected');
2580			selectee.selecting = false;
2581			selectee.selected = true;
2582			selectee.startselected = true;
2583			self._trigger("selected", event, {
2584				selected: selectee.element
2585			});
2586		});
2587		this._trigger("stop", event);
2588
2589		this.helper.remove();
2590
2591		return false;
2592	}
2593
2594});
2595
2596$.extend($.ui.selectable, {
2597	version: "1.8.17"
2598});
2599
2600})(jQuery);;
2601/*
2602 * Lazy Load - jQuery plugin for lazy loading images
2603 *
2604 * Copyright (c) 2007-2013 Mika Tuupola
2605 *
2606 * Licensed under the MIT license:
2607 *   http://www.opensource.org/licenses/mit-license.php
2608 *
2609 * Project home:
2610 *   http://www.appelsiini.net/projects/lazyload
2611 *
2612 * Version:  1.9.3
2613 *
2614 */
2615
2616(function($, window, document, undefined) {
2617    var $window = $(window);
2618
2619    $.fn.lazyload = function(options) {
2620        var elements = this;
2621        var $container;
2622        var settings = {
2623            threshold       : 0,
2624            failure_limit   : 0,
2625            event           : "scroll",
2626            effect          : "show",
2627            container       : window,
2628            data_attribute  : "original",
2629            skip_invisible  : true,
2630            appear          : null,
2631            load            : null,
2632            placeholder     : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"
2633        };
2634
2635        function update() {
2636            var counter = 0;
2637
2638            elements.each(function() {
2639                var $this = $(this);
2640                if (settings.skip_invisible && !$this.is(":visible")) {
2641                    return;
2642                }
2643			if($('.fullpage_alllist').length){
2644				$this.trigger("appear");
2645				counter = 0;
2646			}else{
2647				if (settings.container === undefined || settings.container === window) {
2648						var fold = $window.scrollTop();
2649				} else {
2650						var fold = $(settings.container).offset().top;
2651				}
2652				if($this.offset().top-fold<0){
2653					$this.trigger("appear");
2654					/* if we found an image we'll load, reset the counter */
2655					counter = 0;
2656				}else if ($.abovethetop(this, settings) ||
2657						$.leftofbegin(this, settings)) {
2658								/* Nothing. */
2659				} else if (!$.belowthefold(this, settings) &&
2660						!$.rightoffold(this, settings)) {
2661								$this.trigger("appear");
2662								/* if we found an image we'll load, reset the counter */
2663								counter = 0;
2664				} else {
2665						if (++counter > settings.failure_limit) {
2666								return false;
2667						}
2668				}
2669			}
2670            });
2671
2672        }
2673
2674        if(options) {
2675            /* Maintain BC for a couple of versions. */
2676            if (undefined !== options.failurelimit) {
2677                options.failure_limit = options.failurelimit;
2678                delete options.failurelimit;
2679            }
2680            if (undefined !== options.effectspeed) {
2681                options.effect_speed = options.effectspeed;
2682                delete options.effectspeed;
2683            }
2684
2685            $.extend(settings, options);
2686        }
2687
2688        /* Cache container as jQuery as object. */
2689        $container = (settings.container === undefined ||
2690                      settings.container === window) ? $window : $(settings.container);
2691
2692        /* Fire one scroll event per scroll. Not one scroll event per image. */
2693        if (0 === settings.event.indexOf("scroll")) {
2694		  var ret=true;
2695		  var timer;
2696            $container.bind(settings.event, function() {
2697			if(timer) clearTimeout(timer);				
2698			 timer=setTimeout(function(){
2699				 ret= update();
2700			 },200)
2701			 return ret;
2702                
2703            });
2704        }
2705
2706        this.each(function() {
2707            var self = this;
2708            var $self = $(self);
2709
2710            self.loaded = false;
2711
2712            /* If no src attribute given use data:uri. */
2713            if ($self.attr("src") === undefined || $self.attr("src") === false) {
2714                if ($self.is("img")) {
2715                    $self.attr("src", settings.placeholder);
2716                }
2717            }
2718            /* fixed bug#1630 */
2719            //if(parseInt($self.css("top"))<-100) $self.css("top","");
2720            /* When appear is triggered load original image. */
2721            $self.one("appear", function() {
2722                if (!this.loaded) {
2723                    if (settings.appear) {
2724                        var elements_left = elements.length;
2725                        settings.appear.call(self, elements_left, settings);
2726                    }
2727                    $("<img />")
2728                        .bind("load", function() {
2729
2730                            var original = $self.attr("data-" + settings.data_attribute);
2731                            $self.hide();
2732                            if ($self.is("img")) {
2733                                $self.attr("src", original);
2734                            } else {
2735                                $self.css("background-image", "url('" + original + "')");
2736                            }
2737                            $self[settings.effect](settings.effect_speed);
2738
2739                            self.loaded = true;
2740
2741                            /* Remove image from array so it is not looped next time. */
2742                            var temp = $.grep(elements, function(element) {
2743                                return !element.loaded;
2744                            });
2745                            elements = $(temp);
2746
2747                            if (settings.load) {
2748                                var elements_left = elements.length;
2749                                settings.load.call(self, elements_left, settings);
2750                            }
2751                        })
2752                        .attr("src", $self.attr("data-" + settings.data_attribute));
2753                }
2754            });
2755
2756            /* When wanted event is triggered load original image */
2757            /* by triggering appear.                              */
2758            if (0 !== settings.event.indexOf("scroll")) {
2759                $self.bind(settings.event, function() {
2760                    if (!self.loaded) {
2761                        $self.trigger("appear");
2762                    }
2763				});
2764			}
2765        });
2766
2767        /* Check if something appears when window is resized. */
2768        $window.bind("resize", function() {
2769            update();
2770        });
2771
2772        /* With IOS5 force loading images when navigating with back button. */
2773        /* Non optimal workaround. */
2774        if ((/(?:iphone|ipod|ipad).*os 5/gi).test(navigator.appVersion)) {
2775            $window.bind("pageshow", function(event) {
2776                if (event.originalEvent && event.originalEvent.persisted) {
2777                    elements.each(function() {
2778                        $(this).trigger("appear");
2779                    });
2780                }
2781            });
2782        }
2783	  update();
2784        /* Force initial check if images should appear. */
2785        $(document).ready(function() {
2786            update();
2787        });
2788
2789        return this;
2790    };
2791
2792    /* Convenience methods in jQuery namespace.           */
2793    /* Use as  $.belowthefold(element, {threshold : 100, container : window}) */
2794
2795    $.belowthefold = function(element, settings) {
2796        var fold;
2797
2798        if (settings.container === undefined || settings.container === window) {
2799            fold = (window.innerHeight ? window.innerHeight : $window.height()) + $window.scrollTop();
2800        } else {
2801            fold = $(settings.container).offset().top + $(settings.container).height();
2802        }
2803        return fold <= $(element).offset().top - settings.threshold;
2804    };
2805
2806    $.rightoffold = function(element, settings) {
2807        var fold;
2808
2809        if (settings.container === undefined || settings.container === window) {
2810            fold = $window.width() + $window.scrollLeft();
2811        } else {
2812            fold = $(settings.container).offset().left + $(settings.container).width();
2813        }
2814
2815        return fold <= $(element).offset().left - settings.threshold;
2816    };
2817
2818    $.abovethetop = function(element, settings) {
2819        var fold;
2820
2821        if (settings.container === undefined || settings.container === window) {
2822            fold = $window.scrollTop();
2823        } else {
2824            fold = $(settings.container).offset().top;
2825        }
2826        //bug#2660
2827        var eleparwid = $(element).height();
2828        if(eleparwid==0&&$(element).parents().parents().attr('class')=='img_over'){
2829        	var eleparwid = $(element).parents().parents().height();
2830        }
2831        return fold >= $(element).offset().top + settings.threshold  + eleparwid;
2832    };
2833
2834    $.leftofbegin = function(element, settings) {
2835        var fold;
2836
2837        if (settings.container === undefined || settings.container === window) {
2838            fold = $window.scrollLeft();
2839        } else {
2840            fold = $(settings.container).offset().left;
2841        }
2842
2843        return fold >= Math.max($(element).offset().left + $(element).width(),2)+ settings.threshold ;
2844    };
2845
2846    $.inviewport = function(element, settings) {
2847         return !$.rightoffold(element, settings) && !$.leftofbegin(element, settings) &&
2848                !$.belowthefold(element, settings) && !$.abovethetop(element, settings);
2849     };
2850
2851    /* Custom selectors for your convenience.   */
2852    /* Use as $("img:below-the-fold").something() or */
2853    /* $("img").filter(":below-the-fold").something() which is faster */
2854
2855    $.extend($.expr[":"], {
2856        "below-the-fold" : function(a) { return $.belowthefold(a, {threshold : 0}); },
2857        "above-the-top"  : function(a) { return !$.belowthefold(a, {threshold : 0}); },
2858        "right-of-screen": function(a) { return $.rightoffold(a, {threshold : 0}); },
2859        "left-of-screen" : function(a) { return !$.rightoffold(a, {threshold : 0}); },
2860        "in-viewport"    : function(a) { return $.inviewport(a, {threshold : 0}); },
2861        /* Maintain BC for couple of versions. */
2862        "above-the-fold" : function(a) { return !$.belowthefold(a, {threshold : 0}); },
2863        "right-of-fold"  : function(a) { return $.rightoffold(a, {threshold : 0}); },
2864        "left-of-fold"   : function(a) { return !$.rightoffold(a, {threshold : 0}); }
2865    });
2866
2867})(jQuery, window, document);;
2868(function( $, undefined ) {
2869	var sin_cache={0:0};
2870	var cos_cache={0:1};
2871	var tan_cache={0:0};
2872	
2873	$.math={};
2874	$.math.sin=function(degree){
2875		if(degree<0) degree=degree+360;
2876		if(degree>=360) degree=degree%360;
2877		if(sin_cache[degree]==undefined){
2878			var value=Math.sin(degree*Math.PI/180);
2879			sin_cache[degree]=value;
2880		}
2881		return sin_cache[degree];
2882	}
2883	
2884	$.math.cos=function(degree){
2885		if(degree<0) degree=degree+360;
2886		if(degree>=360) degree=degree%360;
2887		if(cos_cache[degree]==undefined){
2888			var value=Math.cos(degree*Math.PI/180);
2889			cos_cache[degree]=value;
2890		}
2891		return cos_cache[degree];
2892	}
2893	
2894	$.math.tan=function(degree){
2895		if(degree<0) degree=degree+360;
2896		if(degree>=360) degree=degree%360;
2897		if(tan_cache[degree]==undefined){
2898			var value=Math.tan(degree*Math.PI/180);
2899			tan_cache[degree]=value;
2900		}
2901		return tan_cache[degree];
2902	}
2903	
2904	$.math.acos=function(cosdegree){
2905		var deg=Math.acos(cosdegree);
2906		return Math.round(deg*180/Math.PI);
2907	}
2908	
2909	$.parseInteger = function(str){
2910		var i = parseInt(str);
2911		if(isNaN(i)) return 0;
2912		return i;
2913	}
2914	
2915	//跨浏览器旋转css设置	
2916	$.divrotate=function(dom,degree,initpos,sizearr){
2917		dom=$(dom);
2918		var w=dom.width();
2919		var h=dom.height();
2920		if(sizearr){
2921			w=sizearr[0];
2922			h=sizearr[1];
2923		}
2924		
2925		if(initpos){
2926			var left=initpos[0];
2927			var top=initpos[1];
2928			
2929			if($.browser.msie && $.browser.version < 9){
2930				w = parseInt(dom.data('IEWidth'));
2931				h = parseInt(dom.data('IEHeight'));
2932				
2933				left = dom.data('IELeft');
2934				if(left == undefined)
2935				{
2936					left = initpos[0];
2937					dom.data('IELeft',left);
2938				}
2939				
2940				top = dom.data('IETop');
2941				if(top == undefined)
2942				{
2943					top = initpos[1];
2944					dom.data('IETop',top);
2945				}
2946				
2947				ieRotate({
2948					degree:degree,
2949					left:left,
2950					top:top,
2951					width:w,
2952					height:h,
2953					dom:dom
2954				});
2955			}else{
2956				dom[0].style.left=Math.round(left)+'px';
2957				dom[0].style.top=Math.round(top)+'px';
2958			}
2959		}
2960		
2961		if($.browser.safari || $.browser.mozilla || $.browser.opera || ($.browser.msie && $.browser.version == '9.0')){
2962			ieRotate({
2963				degree:degree,
2964				dom:dom
2965			});
2966		}
2967	}
2968	
2969	$.fn.modattr=function(keyname,value){
2970		if(keyname=='leftpos'){
2971			var oldpos=this.data('prop_leftpos');
2972			if(!oldpos){
2973				oldpos=[parseInt(this.css('left')),parseInt(this.css('top'))];
2974			}
2975			if(value!=undefined) this.data('prop_leftpos',value);
2976			return oldpos;
2977		}
2978		if(keyname=='degree'){
2979			var oldpos=this.data('deg');
2980			if(!oldpos){
2981				oldpos=0;
2982			}
2983			if(value!=undefined) this.data('deg',value);
2984			return oldpos;
2985		}
2986		
2987		if(keyname=='size'){
2988			var oldpos=this.data('prop_size');
2989			if(!oldpos){
2990				oldpos=[this.width(),this.height()];
2991			}
2992			if(value!=undefined) this.data('prop_size',value);
2993			return oldpos;
2994		}
2995	}
2996	
2997	//IE实际左点和定位的左点转换函数
2998	$.divrotate.reversePos=function(pos,degree,w,h){
2999				var left=pos[0];
3000				var top=pos[1];
3001				var costheta = $.math.cos(degree);
3002				var sintheta = $.math.sin(degree);
3003				if($.browser.msie && $.browser.version < 9){
3004					var newl=left;
3005					if(degree<90) newl=left+h*sintheta;
3006					else if(degree<180) newl=left+h*sintheta-w*costheta;
3007					else if(degree<270) newl=left-w*costheta;
3008					else newl=left;
3009
3010					var newt=top;
3011					if(degree<90) newt=top;
3012					else if(degree<180) newt=top-h*costheta;
3013					else if(degree<270) newt=top-h*costheta-w*sintheta;
3014					else newt=top-w*sintheta;
3015					return [newl,newt];
3016				}else{
3017					return pos;
3018				}
3019		}
3020		
3021		//计算旋转模块离各个边界的距离
3022		$.divrotate.getMaxDistance=function(dom){
3023			var degree=dom.data('deg');
3024			var left=parseInt(dom.css('left'));
3025			var top=parseInt(dom.css('top'));
3026			
3027			var w=dom.width();
3028			var h=dom.height();
3029			var canvaswidth = canv.width();
3030			var maxleft,maxright,maxtop;
3031			
3032			//没有旋转
3033			if(!degree){
3034				maxleft=left;
3035				maxright=canvaswidth-w-left;
3036				maxtop=top;
3037			}else{
3038				if(degree>360) degree=degree%360;
3039				var cosa=$.math.cos(degree);
3040				var sina=$.math.sin(degree);
3041				if(degree<=90){
3042					maxleft=left-h*sina;
3043					maxright=canvaswidth-left-w*cosa;
3044					maxtop=top;
3045				}else if(degree>90 && degree<=180){
3046					maxleft=left-h*sina+w*cosa;
3047					maxright=canvaswidth-left;
3048					maxtop=top+h*cosa;
3049				}else if(degree>180 && degree<=270){
3050					maxleft=left+w*cosa;
3051					maxright=canvaswidth-left+h*sina;
3052					maxtop=top+h*cosa+w*sina;
3053				}else if(degree>270 && degree<=360){
3054					maxleft=left;
3055					maxright=canvaswidth-left+h*sina-w*cosa;
3056					maxtop=top+w*sina;
3057				}
3058			}
3059			return {left:maxleft,right:maxright,top:maxtop};
3060			
3061		}
3062		
3063		//计算旋转模块
3064		//postype: left right,top, buttom
3065		$.divrotate.getDegreeModMaxPointOrigin=function(dom,degree,pos,sizearr,postype){
3066			var fatherid=$.getElementFatherid(dom);
3067			var fathertoppos=$('#'+fatherid).ab_pos_cnter('top');
3068			var fatherleftpos=$('#'+fatherid).ab_pos_cnter('left') || 0;
3069			var degree=degree;
3070			//没有旋转
3071			if(!degree){
3072				var maxval=0;
3073				var w=sizearr[0];
3074				var h=sizearr[1];
3075				switch (postype) {
3076					case 'left':
3077						maxval=pos[0]+fatherleftpos;
3078						break;
3079					case 'right':
3080						maxval=pos[0]+w+fatherleftpos;
3081						break;
3082					case 'top':
3083						maxval=pos[1]+fathertoppos;
3084						break;
3085					case 'buttom':
3086						maxval=pos[1]+h+fathertoppos;
3087						break;
3088				}
3089				return maxval;
3090
3091			}else{
3092				if($.browser.msie && $.browser.version < 9){
3093					var maxval=0;
3094					switch (postype) {
3095						case 'left':
3096							maxval = dom.position().left;
3097							break;
3098						case 'right':
3099							maxval = dom.position().left+dom.width();
3100							break;
3101						case 'top':
3102							maxval = dom.position().top;
3103							break;
3104						case 'buttom':
3105							maxval = dom.position().top+dom.height();
3106							break;
3107					}
3108					return maxval;
3109				}
3110				var maxval=0;
3111				var w=sizearr[0];
3112				var h=sizearr[1];
3113				var l=pos[0];
3114				var t=pos[1];
3115				if(degree>360) degree=degree%360;
3116				var cosa=$.math.cos(degree);
3117				var sina=$.math.sin(degree);
3118				switch (postype) {
3119					case 'left':
3120						if(degree<=90){
3121							maxval=l-h*sina;
3122						}else if(degree>90 && degree<=180){
3123							maxval=l-h*sina+w*cosa;
3124						}else if(degree>180 && degree<=270){
3125							maxval=l+w*cosa;
3126						}else if(degree>270 && degree<=360){
3127							maxval=l;
3128						}
3129						maxval+=fatherleftpos;
3130						break;
3131					case 'right':
3132						if(degree<=90){
3133							maxval=l+w*cosa;
3134						}else if(degree>90 && degree<=180){
3135							maxval=l;
3136						}else if(degree>180 && degree<=270){
3137							maxval=l-h*sina;
3138						}else if(degree>270 && degree<=360){
3139							maxval=l-h*sina+w*cosa;
3140						}
3141						maxval+=fatherleftpos;
3142						break;
3143					case 'top':
3144						if(degree<=90){
3145							maxval=t;
3146						}else if(degree>90 && degree<=180){
3147							maxval=t+h*cosa;
3148						}else if(degree>180 && degree<=270){
3149							maxval=t+h*cosa+w*sina;
3150						}else if(degree>270 && degree<=360){
3151							maxval=t+w*sina;
3152						}
3153						maxval=maxval+fathertoppos;
3154						break;
3155					case 'buttom':
3156						if(degree<=90){
3157							maxval=t+h*cosa+w*sina;
3158						}else if(degree>90 && degree<=180){
3159							maxval=t+w*sina;
3160						}else if(degree>180 && degree<=270){
3161							maxval=t;
3162						}else if(degree>270 && degree<=360){
3163							maxval=t+h*cosa;
3164						}
3165						maxval=maxval+fathertoppos;
3166						break;
3167				}
3168				return maxval;
3169			}
3170		}
3171		
3172		//计算旋转模块
3173		//postype: left right,top, buttom
3174		$.divrotate.getDegreeModMaxPoint=function(dom,pos,postype){
3175			var degree=dom.data('deg');
3176			if(pos==null) pos=[$.parseInteger(dom.css('left')),$.parseInteger(dom.css('top'))]
3177			var w=dom.width();
3178			var h=dom.height();
3179			return $.divrotate.getDegreeModMaxPointOrigin(dom,degree,pos,[w,h],postype);
3180
3181		}
3182		
3183		//计算旋转模块
3184		//postype: left right,top, buttom
3185		$.divrotate.getDegreeModMaxPointForRotate=function(dom,degree,pos,postype){
3186			var w=dom.width();
3187			var h=dom.height();
3188			return $.divrotate.getDegreeModMaxPointOrigin(dom,degree,pos,[w,h],postype);
3189
3190		}
3191		
3192		// Get Resize Mouse Cursor
3193		$.divrotate.getDegreeResizeCursor=function(dom){
3194			var degree=dom.data('deg');
3195			if(degree==null) degree=0;
3196			if(degree>360) degree=degree%360;
3197			
3198			if(degree<=22||degree>=338){
3199				dom.find('.ui-resizable-n').css('cursor','n-resize');
3200				dom.find('.ui-resizable-e').css('cursor','e-resize');
3201				dom.find('.ui-resizable-w').css('cursor','w-resize');
3202				dom.find('.ui-resizable-s').css('cursor','s-resize');
3203				dom.find('.ui-resizable-ne').css('cursor','ne-resize');
3204				dom.find('.ui-resizable-se').css('cursor','se-resize');
3205				dom.find('.ui-resizable-nw').css('cursor','nw-resize');
3206				dom.find('.ui-resizable-sw').css('cursor','sw-resize');
3207			}else if(degree>22&&degree<=67){
3208				dom.find('.ui-resizable-n').css('cursor','ne-resize');
3209				dom.find('.ui-resizable-e').css('cursor','se-resize');
3210				dom.find('.ui-resizable-w').css('cursor','nw-resize');
3211				dom.find('.ui-resizable-s').css('cursor','sw-resize');
3212				dom.find('.ui-resizable-ne').css('cursor','e-resize');
3213				dom.find('.ui-resizable-se').css('cursor','s-resize');
3214				dom.find('.ui-resizable-nw').css('cursor','n-resize');
3215				dom.find('.ui-resizable-sw').css('cursor','w-resize');
3216			}else if(degree>67&&degree<=112){
3217				dom.find('.ui-resizable-n').css('cursor','e-resize');
3218				dom.find('.ui-resizable-e').css('cursor','s-resize');
3219				dom.find('.ui-resizable-w').css('cursor','n-resize');
3220				dom.find('.ui-resizable-s').css('cursor','w-resize');
3221				dom.find('.ui-resizable-ne').css('cursor','se-resize');
3222				dom.find('.ui-resizable-se').css('cursor','sw-resize');
3223				dom.find('.ui-resizable-nw').css('cursor','ne-resize');
3224				dom.find('.ui-resizable-sw').css('cursor','nw-resize');
3225			}else if(degree>112&&degree<=157){
3226				dom.find('.ui-resizable-n').css('cursor','se-resize');
3227				dom.find('.ui-resizable-e').css('cursor','sw-resize');
3228				dom.find('.ui-resizable-w').css('cursor','ne-resize');
3229				dom.find('.ui-resizable-s').css('cursor','nw-resize');
3230				dom.find('.ui-resizable-ne').css('cursor','s-resize');
3231				dom.find('.ui-resizable-se').css('cursor','w-resize');
3232				dom.find('.ui-resizable-nw').css('cursor','e-resize');
3233				dom.find('.ui-resizable-sw').css('cursor','n-resize');
3234			}else if(degree>157&&degree<=202){
3235				dom.find('.ui-resizable-n').css('cursor','s-resize');
3236				dom.find('.ui-resizable-e').css('cursor','w-resize');
3237				dom.find('.ui-resizable-w').css('cursor','e-resize');
3238				dom.find('.ui-resizable-s').css('cursor','n-resize');
3239				dom.find('.ui-resizable-ne').css('cursor','sw-resize');
3240				dom.find('.ui-resizable-se').css('cursor','nw-resize');
3241				dom.find('.ui-resizable-nw').css('cursor','se-resize');
3242				dom.find('.ui-resizable-sw').css('cursor','ne-resize');
3243			}else if(degree>202&&degree<=247){
3244				dom.find('.ui-resizable-n').css('cursor','sw-resize');
3245				dom.find('.ui-resizable-e').css('cursor','nw-resize');
3246				dom.find('.ui-resizable-w').css('cursor','se-resize');
3247				dom.find('.ui-resizable-s').css('cursor','ne-resize');
3248				dom.find('.ui-resizable-ne').css('cursor','w-resize');
3249				dom.find('.ui-resizable-se').css('cursor','n-resize');
3250				dom.find('.ui-resizable-nw').css('cursor','s-resize');
3251				dom.find('.ui-resizable-sw').css('cursor','e-resize');
3252			}else if(degree>247&&degree<=292){
3253				dom.find('.ui-resizable-n').css('cursor','w-resize');
3254				dom.find('.ui-resizable-e').css('cursor','n-resize');
3255				dom.find('.ui-resizable-w').css('cursor','s-resize');
3256				dom.find('.ui-resizable-s').css('cursor','e-resize');
3257				dom.find('.ui-resizable-ne').css('cursor','nw-resize');
3258				dom.find('.ui-resizable-se').css('cursor','ne-resize');
3259				dom.find('.ui-resizable-nw').css('cursor','sw-resize');
3260				dom.find('.ui-resizable-sw').css('cursor','se-resize');
3261			}else if(degree>292&&degree<=337){
3262				dom.find('.ui-resizable-n').css('cursor','nw-resize');
3263				dom.find('.ui-resizable-e').css('cursor','ne-resize');
3264				dom.find('.ui-resizable-w').css('cursor','sw-resize');
3265				dom.find('.ui-resizable-s').css('cursor','se-resize');
3266				dom.find('.ui-resizable-ne').css('cursor','n-resize');
3267				dom.find('.ui-resizable-se').css('cursor','e-resize');
3268				dom.find('.ui-resizable-nw').css('cursor','w-resize');
3269				dom.find('.ui-resizable-sw').css('cursor','s-resize');
3270			}
3271		}
3272		
3273		// Get Resize Change Property
3274		$.divrotate.getDegreeResizeChange=function(dom,pos,oriPos,oriSize,postype){
3275			//pos[dx,dy]鼠标移动时与刚开始拉伸鼠标相对偏移量,oriPos[l,t]鼠标拖动前模块坐标,oriSize[w,h]鼠标拖动前模块宽高
3276			var degree=dom.data('deg');
3277			if(degree>360) degree=degree%360;
3278			
3279			var sinx = Math.sin(degree*Math.PI/180);
3280			var cosx = Math.cos(degree*Math.PI/180);
3281			if($.browser.msie && $.browser.version < 9)
3282			{
3283				//模块宽高
3284				var w = dom.data('IEWidth');
3285				var h = dom.data('IEHeight');
3286				//左上顶点坐标
3287				if(degree >= 0 && degree < 90)
3288					var l = oriPos.left + h*sinx,t = oriPos.top;
3289				else if(degree >= 90 && degree < 180)
3290					var l = h*sinx - w*cosx + oriPos.left,t = oriPos.top - h*cosx;
3291				else if(degree > 180 && degree <= 270)
3292					var l = oriPos.left - w*cosx,t = oriPos.top - w*sinx - h*cosx;
3293				else if(degree > 270 && degree < 360)
3294					var l = oriPos.left,t = w*cosx + oriPos.top;
3295			}
3296			else
3297			{
3298				var w=oriSize.width;
3299				var h=oriSize.height;
3300				var l=oriPos.left,t=oriPos.top;
3301			}
3302			
3303			//鼠标滑行偏移量
3304			var dx=pos[0];
3305			var dy=pos[1];
3306			
3307			var tana=$.math.tan(degree);
3308			var bgree,height,rotateOrigin;
3309			
3310			var heplerfunc=function(ypos){
3311				bgree=$.math.acos((dx+ypos*dy)/(Math.sqrt(dx*dx+dy*dy)*Math.sqrt(1+ypos*ypos)));
3312				height=Math.sqrt(dx*dx+dy*dy)*$.math.sin(bgree);
3313				rotateOrigin=dx*ypos-dy;
3314			}
3315			
3316			var heplerfunc2=function(ypos){
3317				bgree=$.math.acos((dx-ypos*dy)/(Math.sqrt(dx*dx+dy*dy)*Math.sqrt(1+ypos*ypos)));
3318				height=Math.sqrt(dx*dx+dy*dy)*$.math.sin(bgree);
3319				rotateOrigin=0-(dx*ypos+dy);
3320			}
3321			
3322			if($.browser.msie && $.browser.version < 9)
3323			{
3324				var return_str = null;
3325				switch (postype) {
3326					case 'n':
3327						heplerfunc(tana);
3328						if(rotateOrigin==0) return {};
3329						if(degree <= 90)
3330						{
3331							if(rotateOrigin>0){
3332								return_str = {height:Math.round(h+height),left:Math.round(l+height*$.math.sin(degree)-(h+height)*$.math.sin(degree)),top:Math.round(t-height*$.math.cos(degree))}
3333							}else if(rotateOrigin<0){
3334								return_str = {height:Math.round(h-height),left:Math.round(l-height*$.math.sin(degree)-(h-height)*$.math.sin(degree)),top:Math.round(t+height*$.math.cos(degree))}
3335							}
3336						}
3337						else if(degree>270 && degree<360)
3338						{
3339							if(rotateOrigin>0){
3340								return_str = {height:Math.round(h+height),left:Math.round(l+height*$.math.sin(degree)),top:Math.round(t-height*$.math.cos(degree)-w*$.math.cos(degree))}
3341							}else if(rotateOrigin<0){
3342								return_str = {height:Math.round(h-height),left:Math.round(l-height*$.math.sin(degree)),top:Math.round(t+height*$.math.cos(degree)-w*$.math.cos(degree))}
3343							}
3344						}
3345						else if(degree > 90 && degree <= 180)
3346						{
3347							if(rotateOrigin>0){
3348								return_str = {height:Math.round(h-height),left:Math.round(l-height*$.math.sin(degree)-(h-height)*$.math.sin(degree)+w*$.math.cos(degree)),top:Math.round(t+height*$.math.cos(degree)+(h-height)*$.math.cos(degree))}
3349							}else if(rotateOrigin<0){
3350								return_str = {height:Math.round(h+height),left:Math.round(l+height*$.math.sin(degree)-(h+height)*$.math.sin(degree)+w*$.math.cos(degree)),top:Math.round(t-height*$.math.cos(degree)+(h+height)*$.math.cos(degree))}
3351							}
3352						}
3353						else if(degree > 180 && degree <= 270)
3354						{
3355							if(rotateOrigin>0){
3356								return_str = {height:Math.round(h-height),left:Math.round(l-height*$.math.sin(degree)+w*$.math.cos(degree)),top:Math.round(t+height*$.math.cos(degree)+(h-height)*$.math.cos(degree)+w*$.math.sin(degree))}
3357							}else if(rotateOrigin<0){
3358								return_str = {height:Math.round(h+height),left:Math.round(l+height*$.math.sin(degree)+w*$.math.cos(degree)),top:Math.round(t-height*$.math.cos(degree)+(h+height)*$.math.cos(degree)+w*$.math.sin(degree))}
3359							}
3360						}
3361						break;
3362					case 's':
3363						heplerfunc(tana);
3364						if(rotateOrigin==0) return {};
3365						if(degree <= 90)
3366						{
3367							if(rotateOrigin>0){
3368								return_str = {width:w,height:Math.round(h-height),left:Math.round(l-(h-height)*$.math.sin(degree)),top:t}
3369							}else if(rotateOrigin<0){
3370								return_str = {width:w,height:Math.round(h+height),left:Math.round(l-(h+height)*$.math.sin(degree)),top:t}
3371							}
3372						}
3373						else if(degree > 90 && degree <= 180)
3374						{
3375							if(rotateOrigin>0){
3376								return_str = {width:w,height:Math.round(h+height),left:Math.round(l-(h+height)*$.math.sin(degree)+w*$.math.cos(degree)),top:Math.round(t+(h+height)*$.math.cos(degree))}
3377							}else if(rotateOrigin<0){
3378								return_str = {width:w,height:Math.round(h-height),left:Math.round(l-(h-height)*$.math.sin(degree)+w*$.math.cos(degree)),top:Math.round(t+(h-height)*$.math.cos(degree))}
3379							}
3380						}
3381						else if(degree > 180 && degree <= 270)
3382						{
3383							if(rotateOrigin>0){
3384								return_str = {width:w,height:Math.round(h+height),left:Math.round(l+w*$.math.cos(degree)),top:Math.round(t+(h+height)*$.math.cos(degree)+w*$.math.sin(degree))}
3385							}else if(rotateOrigin<0){
3386								return_str = {width:w,height:Math.round(h-height),left:Math.round(l+w*$.math.cos(degree)),top:Math.round(t+(h-height)*$.math.cos(degree)+w*$.math.sin(degree))}
3387							}
3388						}
3389						else if(degree>270 && degree<360)
3390						{
3391							if(rotateOrigin>0){
3392								return_str = {width:w,height:Math.round(h-height),left:l,top:Math.round(t-w*$.math.cos(degree))}
3393							}else if(rotateOrigin<0){
3394								return_str = {width:w,height:Math.round(h+height),left:l,top:Math.round(t-w*$.math.cos(degree))}
3395							}
3396						}
3397						break;
3398					case 'w':
3399						heplerfunc2(1/tana);
3400						if(rotateOrigin==0) return {};
3401						if(degree <= 90)
3402						{
3403							if(rotateOrigin>0){
3404								return_str = {width:Math.round(w+height),height:h,left:Math.round(l-height*$.math.cos(degree)-h*$.math.sin(degree)),top:Math.round(t-height*$.math.sin(degree))}
3405							}else if(rotateOrigin<0){
3406								return_str = {width:Math.round(w-height),height:h,left:Math.round(l+height*$.math.cos(degree)-h*$.math.sin(degree)),top:Math.round(t+height*$.math.sin(degree))}
3407							}
3408						}
3409						else if(degree > 90 && degree <= 180)
3410						{
3411							if(rotateOrigin>0){
3412								return_str = {width:Math.round(w+height),height:h,left:Math.round(l-height*$.math.cos(degree)-h*$.math.sin(degree)+(w+height)*$.math.cos(degree)),top:Math.round(t-height*$.math.sin(degree)+h*$.math.cos(degree))}
3413							}else if(rotateOrigin<0){
3414								return_str = {width:Math.round(w-height),height:h,left:Math.round(l+height*$.math.cos(degree)-h*$.math.sin(degree)+(w-height)*$.math.cos(degree)),top:Math.round(t+height*$.math.sin(degree)+h*$.math.cos(degree))}
3415							}
3416						}
3417						else if(degree > 180 && degree <= 270)
3418						{
3419							if(rotateOrigin>0){
3420								return_str = {width:Math.round(w-height),height:h,left:Math.round(l+height*$.math.cos(degree)+(w-height)*$.math.cos(degree)),top:Math.round(t+height*$.math.sin(degree)+(w-height)*$.math.sin(degree)+h*$.math.cos(degree))}
3421							}else if(rotateOrigin<0){
3422								return_str = {width:Math.round(w+height),height:h,left:Math.round(l-height*$.math.cos(degree)+(w+height)*$.math.cos(degree)),top:Math.round(t-height*$.math.sin(degree)+(w+height)*$.math.sin(degree)+h*$.math.cos(degree))}
3423							}
3424						}
3425						else if(degree > 270 && degree < 360)
3426						{
3427							if(rotateOrigin>0){
3428								return_str = {width:Math.round(w-height),height:h,left:Math.round(l+height*$.math.cos(degree)),top:Math.round(t+height*$.math.sin(degree)-(w-height)*$.math.cos(degree))}
3429							}else if(rotateOrigin<0){
3430								return_str = {width:Math.round(w+height),height:h,left:Math.round(l-height*$.math.cos(degree)),top:Math.round(t-height*$.math.sin(degree)-(w+height)*$.math.cos(degree))}
3431							}
3432						}
3433						break;
3434					case 'e':
3435						heplerfunc2(1/tana);
3436						if(rotateOrigin==0) return {};
3437						if(degree <= 90)
3438						{
3439							if(rotateOrigin>0){
3440								return_str = {width:Math.round(w-height),height:h,left:l-h*$.math.sin(degree),top:t}
3441							}else if(rotateOrigin<0){
3442								return_str = {width:Math.round(w+height),height:h,left:l-h*$.math.sin(degree),top:t}
3443							}
3444						}
3445						else if(degree > 90 && degree <= 180)
3446						{
3447							if(rotateOrigin>0){
3448								return_str = {width:Math.round(w-height),height:h,left:l-h*$.math.sin(degree)+(w-height)*$.math.cos(degree),top:t+h*$.math.cos(degree)}
3449							}else if(rotateOrigin<0){
3450								return_str = {width:Math.round(w+height),height:h,left:l-h*$.math.sin(degree)+(w+height)*$.math.cos(degree),top:t+h*$.math.cos(degree)}
3451							}
3452						}
3453						else if(degree > 180 && degree <= 270)
3454						{
3455							if(rotateOrigin>0){
3456								return_str = {width:Math.round(w+height),height:h,left:l+(w+height)*$.math.cos(degree),top:t+(w+height)*$.math.sin(degree)+h*$.math.cos(degree)}
3457							}else if(rotateOrigin<0){
3458								return_str = {width:Math.round(w-height),height:h,left:l+(w-height)*$.math.cos(degree),top:t+(w-height)*$.math.sin(degree)+h*$.math.cos(degree)}
3459							}
3460						}
3461						else if(degree > 270 && degree < 360)
3462						{
3463							if(rotateOrigin>0){
3464								return_str = {width:Math.round(w+height),height:h,left:l,top:t-(w+height)*$.math.cos(degree)}
3465							}else if(rotateOrigin<0){
3466								return_str = {width:Math.round(w-height),height:h,left:l,top:t-(w-height)*$.math.cos(degree)}
3467							}
3468						}
3469						break;
3470				}
3471				dom.data('IEWidth_tmp',return_str.width||w).data('IEHeight_tmp',return_str.height||h);
3472				$('.propblk,.posblk').remove();
3473				return return_str;
3474			}
3475			else
3476			{
3477				switch (postype) {
3478					case 'n':
3479						heplerfunc(tana);
3480						if(rotateOrigin==0) return {};
3481						if(degree<=90||(degree>270 && degree<=360)){
3482							if(rotateOrigin>0){
3483								return {height:Math.round(h+height),left:Math.round(l+height*$.math.sin(degree)),top:Math.round(t-height*$.math.cos(degree))}
3484							}else if(rotateOrigin<0){
3485								return {height:Math.round(h-height),left:Math.round(l-height*$.math.sin(degree)),top:Math.round(t+height*$.math.cos(degree))}
3486							}
3487						}else if(degree>90 && degree<=270){
3488							if(rotateOrigin>0){
3489								return {height:Math.round(h-height),left:Math.round(l-height*$.math.sin(degree)),top:Math.round(t+height*$.math.cos(degree))}
3490							}else if(rotateOrigin<0){
3491								return {height:Math.round(h+height),left:Math.round(l+height*$.math.sin(degree)),top:Math.round(t-height*$.math.cos(degree))}
3492							}
3493						}
3494						break;
3495					case 's':
3496						heplerfunc(tana);
3497						if(rotateOrigin==0) return {};
3498						if(degree<=90||(degree>270 && degree<=360)){
3499							if(rotateOrigin>0){
3500								return {height:Math.round(h-height)}
3501							}else if(rotateOrigin<0){
3502								return {height:Math.round(h+height)}
3503							}
3504						}else if(degree>90 && degree<=270){
3505							if(rotateOrigin>0){
3506								return {height:Math.round(h+height)}
3507							}else if(rotateOrigin<0){
3508								return {height:Math.round(h-height)}
3509							}
3510						}
3511						break;
3512					case 'w':
3513						heplerfunc2(1/tana);
3514						if(rotateOrigin==0) return {};
3515						if(degree<=180){
3516							if(rotateOrigin>0){
3517								return {width:Math.round(w+height),left:Math.round(l-height*$.math.cos(degree)),top:Math.round(t-height*$.math.sin(degree))}
3518							}else if(rotateOrigin<0){
3519								return {width:Math.round(w-height),left:Math.round(l+height*$.math.cos(degree)),top:Math.round(t+height*$.math.sin(degree))}
3520							}
3521						}else if(degree>180 && degree<=360){
3522							if(rotateOrigin>0){
3523								return {width:Math.round(w-height),left:Math.round(l+height*$.math.cos(degree)),top:Math.round(t+height*$.math.sin(degree))}
3524							}else if(rotateOrigin<0){
3525								return {width:Math.round(w+height),left:Math.round(l-height*$.math.cos(degree)),top:Math.round(t-height*$.math.sin(degree))}
3526							}
3527						}
3528						break;
3529					case 'e':
3530						heplerfunc2(1/tana);
3531						if(rotateOrigin==0) return {};
3532						if(degree<=180){
3533							if(rotateOrigin>0){
3534								return {width:Math.round(w-height)}
3535							}else if(rotateOrigin<0){
3536								return {width:Math.round(w+height)}
3537							}
3538						}else if(degree>180 && degree<=360){
3539							if(rotateOrigin>0){
3540								return {width:Math.round(w+height)}
3541							}else if(rotateOrigin<0){
3542								return {width:Math.round(w-height)}
3543							}
3544						}
3545						break;
3546				}
3547			}
3548		}
3549		
3550	
3551})(jQuery);
3552function rotateWithCenter(dom,degree){
3553	dom=$(dom);
3554	var oldpos=dom.modattr('leftpos');
3555		var oldleft=oldpos[0];
3556		var oldtop=oldpos[1];
3557
3558	
3559	var olddegree=dom.modattr('degree');
3560	
3561	var w=dom.width();
3562	var h=dom.height();
3563	
3564	var sinolddegree=$.math.sin(olddegree);
3565	var cosolddegree=$.math.cos(olddegree);
3566	var centerPoint=[oldleft+w/2*cosolddegree-h/2*sinolddegree,oldtop+h/2*cosolddegree+w/2*sinolddegree];
3567	
3568	var sinnewdegree=$.math.sin(degree);
3569	var cosnewdegree=$.math.cos(degree);
3570	var newleft=centerPoint[0]+h/2*sinnewdegree-w/2*cosnewdegree;
3571	var newtop=centerPoint[1]-w/2*sinnewdegree-h/2*cosnewdegree;
3572
3573	//dom.modattr('leftpos',[newleft,newtop]);
3574	//dom.modattr('size',[w,h]);
3575	$.divrotate(dom,degree,[newleft,newtop]);
3576	
3577	toolbarRotate(dom,degree,{w:w,h:h});
3578	
3579}
3580
3581function toolbarRotate(dom,degree,domSize,actualel){
3582	if(!actualel) actualel=$(".propblk");
3583	if(actualel.length==0) return;
3584	dom=$(dom);
3585	if(actualel.is('.propblk')) var sizearr=dom.data('toolbarsize');
3586	else{
3587		sizearr=dom.data('posizeblksize');
3588		if(degree) actualel.data('rotatedegree',degree);
3589	}
3590	if(!sizearr){
3591		sizearr=[actualel.width(),actualel.height()];
3592		dom.data('toolbarsize',sizearr);
3593	}
3594	
3595	if($.browser.msie && $.browser.version < 9)
3596	{
3597		var pw = sizearr[0];
3598		var ph = sizearr[1];
3599		var w = $("#"+dom.attr('id')).width();
3600		var h = $("#"+dom.attr('id')).height();
3601		var left = $.resetModToolbarLeft($("#"+dom.attr('id')).position().left);
3602		var top = $("#"+dom.attr('id')).position().top;
3603		var angle = degree % 360;
3604		var oldModW = dom.data('IEWidth');
3605		var oldModH = dom.data('IEHeight'); 
3606		
3607		if(dom.data('sinx') == undefined)
3608		{
3609			var rotation = Math.PI * angle / 180;
3610			var cosx = Math.cos(rotation);
3611			var sinx = Math.sin(rotation);
3612			dom.data('sinx',sinx);
3613			dom.data('cosx',cosx);
3614		}
3615		else//获取模块三角函数值,不需要在属性栏旋转重新计算
3616		{
3617			var cosx = dom.data('cosx');
3618			var sinx = dom.data('sinx');
3619		}
3620		
3621		if(angle > 0 && angle <= 90)
3622		{
3623			var propLeftNew = (w+left)-ph*sinx;
3624			var propTopNew = top+(h-oldModH*cosx);
3625		}
3626		else if(angle > 90 && angle <= 180)
3627		{
3628			var propLeftNew = w + left - (ph*sinx-pw*cosx) - (-1*cosx*oldModW);
3629			var propTopNew =h + top + ph*cosx;
3630		}
3631		else if(angle > 180 && angle <= 270)
3632		{
3633			var propLeftNew = left+pw*cosx;
3634			var propTopNew = top-oldModH*cosx+ph*cosx+pw*sinx;
3635		}
3636		else if(angle > 270 && angle < 360)
3637		{
3638			var propLeftNew = left+oldModW*cosx;
3639			var propTopNew = top+pw*sinx;
3640		}
3641		actualel.css({filter : "progid:DXImageTransform.Microsoft.Matrix(M11="+cosx+",M12="+(-sinx)+",M21="+sinx+",M22="+cosx+",SizingMethod='auto expand')",'left':propLeftNew+'px','top':propTopNew+'px'});
3642	}
3643	else
3644	{
3645		var oldsize=dom.data('prop_size');
3646		var w=0;
3647		if(oldsize){
3648			w=oldsize[0];
3649		}else{
3650			w=dom.width();
3651		}
3652		
3653		if(!degree) degree=0;
3654		var oldpos=dom.data('prop_leftpos');
3655		var oldleft=parseInt(dom.css('left'));
3656		var oldleft2=$.resetModToolbarLeft(parseInt(oldleft));
3657		if(dom.attr('fatherid')&&dom.attr('fatherid')!=''&&$('#'+dom.attr('fatherid')).is('.cstlayer')){
3658			oldleft2=oldleft;
3659		}
3660		var oldtop=parseInt(dom.css('top'));
3661		if(oldpos){
3662			oldleft=oldpos[0];
3663			oldtop=oldpos[1];
3664		}
3665
3666		var h=35;
3667		var left1 = $.math.sin(degree)*h +oldleft2 +canv.offset().left-(window.MobileOffsetLeft||0)+$('#'+$.getElementFatherid(dom)).ab_pos_cnter('left');
3668		var top1 =  parseInt(oldtop)-$.math.cos(degree)*h+$('#'+$.getElementFatherid(dom)).ab_pos_cnter('top');
3669		$.divrotate(actualel,degree,[left1,top1],sizearr);
3670	}
3671}
3672
3673function modPosRotate(dom,degree,domSize){
3674	if($(".posblk").length==0) return;
3675	dom=$(dom);
3676	var sizearr=dom.data('modpossize');
3677	if(!sizearr){
3678		sizearr=[$(".posblk").width(),$(".posblk").height()];
3679		dom.data('modpossize',sizearr);
3680	}
3681	
3682	if(!degree) degree=0;
3683	var oldpos=dom.data('prop_leftpos');
3684	var oldleft=parseInt(dom.css('left'));
3685	var oldtop=parseInt(dom.css('top'));
3686	if(oldpos){
3687		oldleft=oldpos[0];
3688		oldtop=oldpos[1];
3689	}
3690	
3691	dom.data('deg',degree);
3692	$(".posblk").find('.posblk-position').html(Math.round(oldleft)+","+Math.round(oldtop)).andSelf().find('.posblk-deg').html(dom.data('deg')%360);
3693	
3694	
3695	if($.browser.msie && $.browser.version < 9)
3696	{
3697		var pow = sizearr[0];
3698		var poh = sizearr[1];
3699		var w = $("#"+dom.attr('id')).width();
3700		var h = $("#"+dom.attr('id')).height();
3701		var left = $("#"+dom.attr('id')).position().left;
3702		var top = $("#"+dom.attr('id')).position().top;
3703		var angle = degree % 360;
3704		var oldModW = dom.data('IEWidth');
3705		var oldModH = dom.data('IEHeight');
3706		if(dom.data('sinx') == undefined)
3707		{
3708			var rotation = Math.PI * angle / 180;
3709			var cosx = Math.cos(rotation);
3710			var sinx = Math.sin(rotation);
3711			dom.data('sinx',sinx);
3712			dom.data('cosx',cosx);
3713		}
3714		else//获取模块三角函数值,不需要在属性栏旋转重新计算
3715		{
3716			var cosx = dom.data('cosx');
3717			var sinx = dom.data('sinx');
3718		}
3719		
3720		if(angle >= 0 && angle <= 90)
3721		{
3722			var posLeftNew = left + oldModH*sinx;
3723			var posTopNew = top - poh*cosx;
3724		}
3725		else if(angle > 90 && angle <= 180)
3726		{
3727			var posLeftNew = left + w + pow*cosx;
3728			var posTopNew = top - oldModH*cosx;
3729		}
3730		else if(angle > 180 && angle <= 270)
3731		{
3732			var posLeftNew = left - oldModW*cosx + pow*cosx + poh*sinx;
3733			var posTopNew = top + h + pow*sinx;
3734		}
3735		else if(angle > 270 && angle < 360)
3736		{
3737			var posLeftNew = left + poh*sinx;
3738			var posTopNew = top - oldModW*sinx-poh*cosx+pow*sinx;
3739		}
3740		$(".posblk").css({filter : "progid:DXImageTransform.Microsoft.Matrix(M11="+cosx+",M12="+(-sinx)+",M21="+sinx+",M22="+cosx+",SizingMethod='auto expand')",'left':posLeftNew+'px','top':posTopNew+'px'});
3741	}
3742	else
3743	{
3744//		var h=$(".posblk").height()+2;
3745//		var left1 = $.math.sin(degree)*h + parseInt(oldleft)+canv.offset().left;
3746//		var top1 =  parseInt(oldtop)-$.math.cos(degree)*h+$('#'+$.getElementFatherid(dom)).ab_pos_cnter('top');
3747//		$.divrotate($(".posblk"),degree,[left1,top1],sizearr);
3748		var oldsize=dom.data('prop_size');
3749		var w=0;
3750		if(oldsize){
3751			w=oldsize[0] + 10;
3752		}else{
3753			w=dom.width() + 10;
3754		}
3755		var left1 = $.math.cos(degree)*w + parseInt(oldleft)+canv.offset().left-(window.MobileOffsetLeft||0)+$('#'+$.getElementFatherid(dom)).ab_pos_cnter('left');
3756		var top1 =  $.math.sin(degree)*w + parseInt(oldtop)+$('#'+$.getElementFatherid(dom)).ab_pos_cnter('top');
3757	
3758		$.divrotate($(".posblk"),degree,[left1,top1],sizearr);
3759	}
3760}
3761
3762//ie下根据模块实际宽高获取模块在0度时的左上顶点
3763function getOldProxyFromSize(dom,degree,w,h)
3764{
3765	var angle = degree % 360;
3766	var oldX = $("#"+dom.attr('id')).position().left;
3767	var oldY = $("#"+dom.attr('id')).position().top;
3768	var newDom = $("#"+dom.attr('id'));
3769	if(dom.data('sinx') == undefined)
3770	{
3771		var rotation = Math.PI * angle / 180;
3772		var cosx = Math.cos(rotation);
3773		var sinx = Math.sin(rotation);
3774		dom.data('sinx',sinx);
3775		dom.data('cosx',cosx);
3776	}
3777	else
3778	{
3779		var sinx = dom.data('sinx');
3780		var cosx = dom.data('cosx');
3781	}
3782	
3783	if(angle == 0)
3784	{
3785		var x = oldX;
3786		var y = oldY;
3787	}
3788	else if(angle >= 0 && angle <= 90)
3789	{
3790		var x = (h*sinx+w*cosx-w)/2+oldX;
3791		var y = (w*sinx+h*cosx-h)/2+oldY;
3792	}
3793	else if(angle > 90 && angle <= 180)
3794	{
3795		var x = (h*sinx-w*cosx-w)/2+oldX;
3796		var y = (w*sinx-h*cosx-h)/2+oldY;
3797	}
3798	else if(angle > 180 && angle <= 270)
3799	{
3800		var x = (-1*h*sinx-w*cosx-w)/2+oldX;
3801		var y = (-1*w*sinx-h*cosx-h)/2+oldY;
3802	}
3803	else if(angle > 270 && angle < 360)
3804	{
3805		var x = (-1*h*sinx+w*cosx-w)/2+oldX;
3806		var y = (-1*w*sinx+h*cosx-h)/2+oldY;
3807	}
3808	
3809	return [x,y];
3810}
3811
3812//ie下获取左上顶点与标准浏览器兼容
3813function getLeftPointProxy(dom,degree)
3814{
3815	var angle = degree % 360;
3816	var x0 = dom.position().left,y0 = dom.position().top;//[x0,y0]ie下面的左上顶点需要转换成标准浏览器顶点
3817	var reg = Math.PI * angle / 180;
3818	var sinx = Math.sin(reg),cosx = Math.cos(reg);
3819	var w = dom.data('IEWidth'),h = dom.data('IEHeight');
3820	if(angle >= 0 && angle < 90)
3821		return [Math.round(x0+h*sinx),Math.round(y0)];
3822	else if(angle >= 90 && angle < 180)
3823		return [Math.round(x0+h*sinx-w*cosx),Math.round(y0-h*cosx)];
3824	else if(angle >= 180 && angle < 270)
3825		return [Math.round(x0-w*cosx),Math.round(y0-h*cosx-w*sinx)];
3826	else if(angle >= 270 && angle < 360)
3827		return [Math.round(x0),Math.round(y0-w*sinx)];
3828};
3829/*! LAB.js (LABjs :: Loading And Blocking JavaScript)
3830    v2.0.3 (c) Kyle Simpson
3831    MIT License
3832*/
3833(function(o){var K=o.$LAB,y="UseLocalXHR",z="AlwaysPreserveOrder",u="AllowDuplicates",A="CacheBust",B="BasePath",C=/^[^?#]*\//.exec(location.href)[0],D=/^\w+\:\/\/\/?[^\/]+/.exec(C)[0],i=document.head||document.getElementsByTagName("head"),L=(o.opera&&Object.prototype.toString.call(o.opera)=="[object Opera]")||("MozAppearance"in document.documentElement.style),q=document.createElement("script"),E=typeof q.preload=="boolean",r=E||(q.readyState&&q.readyState=="uninitialized"),F=!r&&q.async===true,M=!r&&!F&&!L;function G(a){return Object.prototype.toString.call(a)=="[object Function]"}function H(a){return Object.prototype.toString.call(a)=="[object Array]"}function N(a,c){var b=/^\w+\:\/\//;if(/^\/\/\/?/.test(a)){a=location.protocol+a}else if(!b.test(a)&&a.charAt(0)!="/"){a=(c||"")+a}return b.test(a)?a:((a.charAt(0)=="/"?D:C)+a)}function s(a,c){for(var b in a){if(a.hasOwnProperty(b)){c[b]=a[b]}}return c}function O(a){var c=false;for(var b=0;b<a.scripts.length;b++){if(a.scripts[b].ready&&a.scripts[b].exec_trigger){c=true;a.scripts[b].exec_trigger();a.scripts[b].exec_trigger=null}}return c}function t(a,c,b,d){a.onload=a.onreadystatechange=function(){if((a.readyState&&a.readyState!="complete"&&a.readyState!="loaded")||c[b])return;a.onload=a.onreadystatechange=null;d()}}function I(a){a.ready=a.finished=true;for(var c=0;c<a.finished_listeners.length;c++){a.finished_listeners[c]()}a.ready_listeners=[];a.finished_listeners=[]}function P(d,f,e,g,h){setTimeout(function(){var a,c=f.real_src,b;if("item"in i){if(!i[0]){setTimeout(arguments.callee,25);return}i=i[0]}a=document.createElement("script");
3833if(f.type)a.type=f.type;if(f.charset)a.charset=f.charset;if(h){if(r){e.elem=a;if(E){a.preload=true;a.onpreload=g}else{a.onreadystatechange=function(){if(a.readyState=="loaded")g()}}a.src=c}else if(h&&c.indexOf(D)==0&&d[y]){b=new XMLHttpRequest();b.onreadystatechange=function(){if(b.readyState==4){b.onreadystatechange=function(){};e.text=b.responseText+"\n//@ sourceURL="+c;g()}};b.open("GET",c);b.send()}else{a.type="text/cache-script";t(a,e,"ready",function(){i.removeChild(a);g()});a.src=c;i.insertBefore(a,i.firstChild)}}else if(F){a.async=false;t(a,e,"finished",g);a.src=c;i.insertBefore(a,i.firstChild)}else{t(a,e,"finished",g);a.src=c;i.insertBefore(a,i.firstChild)}},0)}function J(){var l={},Q=r||M,n=[],p={},m;l[y]=true;l[z]=false;l[u]=false;l[A]=false;l[B]="";function R(a,c,b){var d;function f(){if(d!=null){d=null;I(b)}}if(p[c.src].finished)return;if(!a[u])p[c.src].finished=true;d=b.elem||document.createElement("script");if(c.type)d.type=c.type;if(c.charset)d.charset=c.charset;t(d,b,"finished",f);if(b.elem){b.elem=null}else if(b.text){d.onload=d.onreadystatechange=null;d.text=b.text}else{d.src=c.real_src}i.insertBefore(d,i.firstChild);if(b.text){f()}}function S(c,b,d,f){var e,g,h=function(){b.ready_cb(b,function(){R(c,b,e)})},j=function(){b.finished_cb(b,d)};b.src=N(b.src,c[B]);b.real_src=b.src+(c[A]?((/\?.*$/.test(b.src)?"&_":"?_")+~~(Math.random()*1E9)+"="):"");if(!p[b.src])p[b.src]={items:[],finished:false};g=p[b.src].items;if(c[u]||g.length==0){e=g[g.length]={ready:false,finished:false,ready_listeners:[h],finished_listeners:[j]};P(c,b,e,((f)?function(){e.ready=true;for(var a=0;a<e.ready_listeners.length;a++){e.ready_listeners[a]()}e.ready_listeners=[]}:function(){I(e)}),f)}else{e=g[0];if(e.finished){j()}else{e.finished_listeners.push(j)}}}function v(){var e,g=s(l,{}),h=[],j=0,w=false,k;function T(a,c){a.ready=true;a.exec_trigger=c;x()}function U(a,c){a.ready=a.finished=true;a.exec_trigger=null;for(var b=0;b<c.scripts.length;b++){if(!c.scripts[b].finished)return}c.finished=true;x()}function x(){while(j<h.length){if(G(h[j])){try{h[j++]()}catch(err){}continue}else if(!h[j].finished){if(O(h[j]))continue;break}j++}if(j==h.length){w=false;k=false}}function V(){if(!k||!k.scripts){h.push(k={scripts:[],finished:true})}}e={script:function(){for(var f=0;f<arguments.length;f++){(function(a,c){var b;if(!H(a)){c=[a]}for(var d=0;d<c.length;d++){V();a=c[d];if(G(a))a=a();if(!a)continue;if(H(a)){b=[].slice.call(a);b.unshift(d,1);[].splice.apply(c,b);d--;continue}if(typeof a=="string")a={src:a};a=s(a,{ready:false,ready_cb:T,finished:false,finished_cb:U});k.finished=false;k.scripts.push(a);S(g,a,k,(Q&&w));w=true;if(g[z])e.wait()}})(arguments[f],arguments[f])}return e},wait:function(){if(arguments.length>0){for(var a=0;a<arguments.length;a++){h.push(arguments[a])}k=h[h.length-1]}else k=false;x();return e}};return{script:e.script,wait:e.wait,setOptions:function(a){s(a,g);return e}}}m={setGlobalDefaults:function(a){s(a,l);return m},setOptions:function(){return v().setOptions.apply(null,arguments)},script:function(){return v().script.apply(null,arguments)},wait:function(){return v().wait.apply(null,arguments)},queueScript:function(){n[n.length]={type:"script",args:[].slice.call(arguments)};return m},queueWait:function(){n[n.length]={type:"wait",args:[].slice.call(arguments)};return m},runQueue:function(){var a=m,c=n.length,b=c,d;for(;--b>=0;){d=n.shift();a=a[d.type].apply(null,d.args)}return a},noConflict:function(){o.$LAB=K;return m},sandbox:function(){return J()}};return m}o.$LAB=J();(function(a,c,b){if(document.readyState==null&&document[a]){document.readyState="loading";document[a](c,b=function(){document.removeEventListener(c,b,false);document.readyState="complete"},false)}})("addEventListener","DOMContentLoaded")})(this);;
3834var mclick = 'click',mtouchstart = 'mousedown',mtouchend = 'mouseup',mtouchmove = 'mousemove';
3835if (window.ontouchstart !== undefined) {
3836	mclick = 'click';mtouchstart = 'touchstart';mtouchend = 'touchend';mtouchmove = 'touchmove';
3837}
3838/**Global Function**/
3839function getSessionExpiredUrl()
3840{
3841	$(window).unbind('beforeunload');
3842	alert(translate('page.sessionTimeout')); 
3843	window.close();
3844	return null;
3845}
3846
3847function wp_heightAdapt(dom,oldHeight){}
3848
3849function is_website_mobile(){
3850	var type=getWebSiteType();
3851	return type=='mobile';
3852}
3853
3854function layer_img_lzld(layerid){
3855	var imgcontainer=$('#scroll_container');
3856	var ismobile=is_website_mobile();
3857	if(!ismobile){
3858		var chromebug=$('#scroll_container').data('chrome_bug');
3859		if(chromebug){
3860			imgcontainer=window;
3861		}
3862	}else imgcontainer=window;
3863	$('#'+layerid+'  img.img_lazy_load').lazyload({
3864		     threshold  : 0,
3865			failure_limit : $('#'+layerid+'  img.img_lazy_load').length,
3866			container : imgcontainer,	
3867			placeholder:relativeToAbsoluteURL('template/default/images/blank.gif'),
3868			load:function(){
3869			 var self=$(this);
3870			 var id=self.closest('.cstlayer').prop('id');
3871			if(window['set_thumb_'+id]) window['set_thumb_'+id](this);
3872		 }
3873	});
3874}
3875
3876function initScrollcontainerHeight(){
3877	var container=$('#scroll_container');
3878	var cvhgt = window.innerHeight || window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
3879	container.height(cvhgt);
3880	$('#scroll_container_bg').css('height',cvhgt);
3881}
3882
3883function noRightClick(){
3884	//禁用鼠标右键  CTRL+C 复制   CTRL+V  粘贴   CTRL+S 保存
3885	$(function(){
3886		document.body.oncontextmenu=function(){return false;}
3887		$(document).keydown(function(event) {
3888					if ((event.ctrlKey&&event.which==67) || (event.ctrlKey&&event.which==86)) {
3889							return false;
3890					}        
3891			})
3892			$(document).keydown(function(event) {
3893					if ((event.ctrlKey&&event.which==67) || (event.ctrlKey&&event.which==86) || (event.ctrlKey&&event.which==83)) {
3894							return false;
3895					}        
3896			})
3897	})
3898}
3899
3900function doc_end_exec(){
3901	$(function(){
3902		$(document).triggerHandler('lastexec');
3903	})
3904	$('#scroll_container').css("visibility", 'visible');
3905	$('.mloading-mask').remove();
3906	$(window).load(function(){ 
3907		var heightadaptel=$("#canvas").find(".cstlayer[type='article_detail'],.cstlayer[type='product_detail'],.cstlayer[type='wzl'],.cstlayer[type='fxdp'],.cstlayer[type='tb_product_detail'],.cstlayer[type='tb_product_list'],.cstlayer[type='product_list'],.cstlayer[type='wkj'],.cstlayer[type='crowdfunding'],.cstlayer[type='btag'],.cstlayer[type='greetingcard'],.cstlayer[type='weiredpack'],.cstlayer[type='mseckill_detail'],.cstlayer[type='mgroupon_detail'],.cstlayer[type='mgroupons_detail'],.cstlayer[type='groupon_detail']");
3908		if(heightadaptel.length){
3909			heightadaptel.each(function(){
3910				if($(this).data('not_need_heightadapt')) return;
3911				wp_heightAdapt($(this));
3912			}) 		
3913			window.scroll_container_adjust();
3914		}
3915	});
3916	
3917	var imgcontainer=$('#scroll_container');
3918	var ismobile=is_website_mobile();
3919	if(!ismobile){
3920		var chromebug=$('#scroll_container').data('chrome_bug');
3921		if(chromebug){
3922			imgcontainer=window;
3923		}
3924	}else imgcontainer=window;
3925	$('img.img_lazy_load').lazyload({
3926		     threshold  : 0,
3927			failure_limit : $('img.img_lazy_load').length,
3928			container : imgcontainer,	
3929			placeholder:relativeToAbsoluteURL('template/default/images/blank.gif'),
3930			load:function(){
3931			 var self=$(this);
3932			 var id=self.closest('.cstlayer').prop('id');
3933			if(window['set_thumb_'+id]) window['set_thumb_'+id](this);
3934		 }
3935	});
3936	
3937	$(window).load(function(){
3938		$('.cstlayer').showEffects();
3939	})
3940}
3941
3942function wpfullcolumn_float(){
3943    var wp_ibody = $('#scroll_container'),wp_icontent = $('#canvas'),wp_icontent_foot = $('#site_footer #footer_content');
3944    $('.full_column,.cstlayer').filter('[infixed=1]').each(function(){
3945        var fc_lid = '#'+$(this).attr('id');
3946        var $fc_lid = $(this);
3947        var wp_layer_abs = $('#canvas '+fc_lid),wp_layer_abs_footer = $('#site_footer #footer_content '+fc_lid),wp_layer_fix= $('#scroll_container '+fc_lid);
3948        var currpoor = ($('.full_width').width() - $('.full_content').width())/2;
3949        var isinfixed = $fc_lid.attr('infixed');
3950        if(isinfixed==1) {
3951            var nPos = $('#scroll_container').scrollTop() ;
3952            //oPos get第一次正确的值,以后不再获得
3953            var oPos_tmp = $(document).data("fixed_"+$(this).attr('id')+"_oPos");
3954		  var inbuttom=$(document).data("fixed_"+$(this).attr('id')+"_inbuttom");
3955            if(!oPos_tmp){
3956                oPos_tmp =  $fc_lid.ab_pos_cnter('top');
3957                $(document).data("fixed_"+$(this).attr('id')+"_oPos",oPos_tmp);
3958            }
3959		if(inbuttom==null){
3960                inbuttom =  $fc_lid.attr('inbuttom');
3961                $(document).data("fixed_"+$(this).attr('id')+"_inbuttom",inbuttom);
3962            }
3963            var oPos = $(document).data("fixed_"+$(this).attr('id')+"_oPos");
3964            if(oPos==0 && $fc_lid.parent().is('#canvas')) return;
3965            if(oPos==0){
3966				var oldsty = $fc_lid.attr('oldstyle')||'';
3967				if(oldsty.match(/top:\d+px/)){
3968					var oldtop = oldsty.match(/top:\d+px/);
3969					oldtop = oldtop[0].match(/\d+/);
3970					oPos = oldtop[0];
3971				}
3972            }
3973            if(inbuttom>0){
3974                //存在页脚中
3975                if(nPos > oPos){
3976                    var newleft = $('.full_column').ab_pos('left') + currpoor ;
3977				if(wp_layer_abs_footer.is('.cstlayer')){
3978					newleft =wp_layer_abs_footer.offset().left+$('#scroll_container').scrollLeft();
3979				}
3980                    if(wp_layer_abs_footer.length>0){
3981                        var oldstyle = wp_layer_abs_footer.attr('style');
3982                        wp_layer_fix = wp_layer_abs_footer.clone(true).appendTo('#scroll_container')
3983                        .attr('oldstyle',oldstyle).attr('inbuttom','1')
3984                        .addClass('full_column-fixed');
3985				if(wp_layer_abs_footer.attr('fatherid')) wp_layer_fix.attr('fatherid',wp_layer_abs.attr('fatherid'));
3986                    wp_layer_fix.show();wp_layer_fix.css({'position':'fixed','top':'','left':newleft,'z-index':'999'});
3987                    wp_layer_abs_footer.remove();
3988                    }
3989                }else{
3990                    oldstyle = wp_layer_fix.attr('oldstyle');
3991                    if(wp_layer_abs_footer.length==0){
3992					wp_icontent_foot=$('#site_footer #footer_content');
3993					if(wp_layer_fix.attr('fatherid')){
3994						wp_icontent_foot=$('#'+wp_layer_fix.attr('fatherid'));
3995					}
3996                        wp_layer_abs_footer = wp_layer_fix.clone(true).appendTo(wp_icontent_foot)
3997                        .attr('style',oldstyle).attr('inbuttom','1').removeClass('full_column-fixed');
3998					if(wp_layer_fix.attr('fatherid')){
3999						wp_layer_abs_footer.attr('fatherid',wp_layer_fix.attr('fatherid'));
4000					}
4001                        wp_layer_abs_footer.show();wp_layer_fix.remove();
4002                    }
4003                }
4004            }else{
4005                var infixed_html = $('#canvas').data('infixed_content');
4006                if(!infixed_html){
4007                    infixed_html =wp_layer_abs.html(); $('#canvas').data('infixed_content',infixed_html);
4008                }
4009                if(nPos > oPos){
4010                    var newleft = Math.abs(parseFloat($('.full_column').find('.full_width').css('left')));
4011				if(wp_layer_abs.is('.cstlayer')){
4012					newleft =wp_layer_abs.offset().left+$('#scroll_container').scrollLeft();
4013				}
4014				var fatherid=$.getElementFatherid(wp_layer_abs);
4015				$(document).data("fixed_"+wp_layer_abs.attr('id')+"_father",$('#'+fatherid));
4016                    //clone(true) has true 可以存储data
4017                    if(wp_layer_abs.length>0){
4018                        //////////////////////
4019                        var oldstyle = wp_layer_abs.attr('style');
4020                        var func=function(){ //未加载完拖拽滚动条为空异常处理
4021                            var success=true;
4022                            var newleft = Math.abs(parseFloat($(fc_lid).find('.full_width').css('left')));
4023                            if(!(newleft)){success=false;}
4024                            if(success){
4025                                $(fc_lid).css('left',newleft);
4026                            }else {
4027                                setTimeout(func,100);
4028                            }
4029                         }
4030                         func();
4031                        var layerdiv=$("<div/>").attr({
4032                                'id':wp_layer_abs.attr('id'),'class':wp_layer_abs.attr('class'),'infixed':1,'style':wp_layer_abs.attr('style')});
4033				    if(wp_layer_abs.attr('fatherid')) layerdiv.attr('fatherid',wp_layer_abs.attr('fatherid'));
4034                        $('#scroll_container').append(layerdiv);
4035                        wp_layer_abs.remove();
4036                        var wp_layer_fix =$(fc_lid).html(infixed_html)
4037                        .attr('oldstyle',oldstyle)
4038                        .addClass('full_column-fixed');
4039                        wp_layer_fix.show();wp_layer_fix.css({'position':'fixed','top':'','left':newleft,'z-index':'999'});
4040                        ////fix时 full_width宽为空异常处理
4041                        var funco=function(){
4042                            var full_width_val = Math.abs(parseFloat($(fc_lid).find('.full_width').css('left')));
4043                            if(!full_width_val){
4044                                $(fc_lid).children('.full_width').css({left:0-$('#canvas').offset().left-$.parseInteger($('#canvas').css("borderLeftWidth")),width:$('#scroll_container_bg').width()});
4045                                if(!(Math.abs(parseFloat($(fc_lid).find('.full_width').css('left'))))){
4046                                    setTimeout(funco,100);
4047                                }
4048                            }
4049                        }
4050                        funco();
4051                        //////////
4052					var imgcontainer=$('#scroll_container');
4053					var ismobile=is_website_mobile();
4054					if(!ismobile){
4055						var chromebug=$('#scroll_container').data('chrome_bug');
4056						if(chromebug){
4057							imgcontainer=window;
4058						}
4059					}else imgcontainer=window;
4060                        $('.full_content img.img_lazy_load').lazyload({
4061                           threshold  : 0,
4062                        	  failure_limit : $('img.img_lazy_load').length,
4063                        	  container : imgcontainer,	
4064                        	  placeholder:relativeToAbsoluteURL('template/default/images/blank.gif'),
4065                        	  load:function(){
4066                        		 var self=$(this);
4067                        		 var id=self.closest('.cstlayer').prop('id');
4068                        		if(window['set_thumb_'+id]) window['set_thumb_'+id](this);
4069                        	 }
4070                        });	
4071                    }
4072                }else{
4073                    if( wp_layer_fix.data('always_fix')) return;
4074                    oldstyle = wp_layer_fix.attr('oldstyle');
4075                    if(!wp_layer_abs.length>0){
4076                        //////////////////////////////
4077                        var layerdiv=$("<div/>").attr({
4078                                'id':wp_layer_fix.attr('id'),'class':wp_layer_fix.attr('class'),'infixed':1,'style':wp_layer_fix.attr('oldstyle')});
4079				    if(wp_layer_fix.attr('fatherid')) layerdiv.attr('fatherid',wp_layer_fix.attr('fatherid'));
4080				    wp_icontent = $(document).data("fixed_"+wp_layer_fix.attr('id')+"_father");
4081				    if(!wp_icontent.length) wp_icontent=$('#canvas');
4082                        wp_icontent.append(layerdiv);
4083                        wp_layer_fix.remove();
4084                        wp_layer_abs =$(fc_lid).html(infixed_html)
4085                        .attr('oldstyle',oldstyle)
4086                        .removeClass('full_column-fixed');
4087                        wp_layer_abs.show();
4088                        //为空异常处理
4089                        var funco=function(){
4090                            var full_width_val = Math.abs(parseFloat($(fc_lid).find('.full_width').css('left')));
4091                            if(!(full_width_val)){
4092                                $(fc_lid).children('.full_width').css({left:0-$('#canvas').offset().left-$.parseInteger($('#canvas').css("borderLeftWidth")),width:$('#scroll_container_bg').width()});
4093                                if(!(Math.abs(parseFloat($(fc_lid).find('.full_width').css('left'))))){
4094                                    setTimeout(funco,100);
4095                                }
4096                            }
4097                        }
4098                        funco();
4099                        //////////////////////////////
4100				    var imgcontainer=$('#scroll_container');
4101					var ismobile=is_website_mobile();
4102					if(!ismobile){
4103						var chromebug=$('#scroll_container').data('chrome_bug');
4104						if(chromebug){
4105							imgcontainer=window;
4106						}
4107					}else imgcontainer=window;
4108                        $('.full_content img.img_lazy_load').lazyload({
4109                           threshold  : 0,
4110                        	  failure_limit : $('img.img_lazy_load').length,
4111                        	  container : imgcontainer,	
4112                        	  placeholder:relativeToAbsoluteURL('template/default/images/blank.gif'),
4113                        	  load:function(){
4114                        		 var self=$(this);
4115                        		 var id=self.closest('.cstlayer').prop('id');
4116                        		if(window['set_thumb_'+id]) window['set_thumb_'+id](this);
4117                        	 }
4118                        });	
4119                    }
4120                }
4121            }
4122        }
4123    });
4124}
4125
4126function getTop(){//for ie6 css hack
4127  return document.documentElement.scrollTop;
4128}
4129
4130function init_fullcolumn_fixed_code(){
4131	$(function(){
4132			setTimeout(function(){
4133					$('.full_column,.cstlayer').filter('[infixed=1]').each(function(){
4134					var self=$(this);
4135					if(self.parent().is('#canvas')&&parseInt(self.css('top'))==0){
4136					var currpoor = ($('.full_width').width() - $('.full_content').width())/2;
4137					var newleft = self.ab_pos('left') + currpoor ;
4138					if(self.is('.cstlayer')){
4139						newleft =self.offset().left+$('#scroll_container').scrollLeft();
4140					}
4141					var wp_layer_abs=self;
4142					var layerid=wp_layer_abs.attr('id');
4143					 var oldstyle = wp_layer_abs.attr('style');
4144					var layerhtml=wp_layer_abs.html();
4145					var layerdiv=$("<div/>").attr({
4146						id:wp_layer_abs.attr('id'),
4147						'class':wp_layer_abs.attr('class'),
4148						infixed:1,
4149						style:wp_layer_abs.attr('style'),
4150					});
4151					wp_layer_abs.remove();
4152					$('#scroll_container').append(layerdiv);
4153					var wp_layer_fix =$('#'+layerid).html(layerhtml)
4154					.attr('oldstyle',oldstyle)
4155					.addClass('full_column-fixed');
4156					wp_layer_fix.data('always_fix',true);
4157					wp_layer_fix.show();wp_layer_fix.css({'position':'fixed','top':'','left':newleft,'z-index':'999'})
4158					if($.browser.msie && ($.browser.version < 9)){
4159						wp_layer_fix.css({'top':'0px'});
4160						wp_layer_fix.find('.full_width').css({'top':'0px'});
4161					}
4162					var ismobile=is_website_mobile();
4163					var imgcontainer=window;
4164					if(!ismobile) imgcontainer=$('#scroll_container').add(window);
4165					wp_layer_fix.find('img.img_lazy_load').lazyload({
4166							threshold  : 0,
4167							failure_limit : wp_layer_fix.find('img.img_lazy_load').length,
4168							container : imgcontainer,
4169							placeholder:relativeToAbsoluteURL('template/default/images/blank.gif'),
4170							load:function(){
4171								 var self=$(this);
4172								 var id=self.closest('.cstlayer').prop('id');
4173								if(window['set_thumb_'+id]) window['set_thumb_'+id](this);
4174							 }
4175					});	
4176					// 固定通栏里显示动画
4177					wp_layer_fix.find('.cstlayer:not(.now_effecting)').showEffects();
4178									//explain:修复bug(2282多语言模块放置固定的通栏后异常),author:fpf,date:2015/03/30,action:add;
4179									var $multilingual = $(document).find('.wp-multilingual_content');
4180									if($multilingual.get(0) != 'undefined'){
4181											var $multilingual_content = $multilingual.find('.wp-content > .overz');
4182											if(parseInt($multilingual_content.length) > 1){
4183													$multilingual.find('.wp-content > .overz:last').remove();
4184											}
4185									}
4186							}
4187					});
4188		// 修复“通栏设置‘固定显示’后导致‘鼠标滚轮’事件异常(bug#4230)”
4189		$(document).bind("mousewheel DomMouseScroll MozMousePixelScroll", function(e){
4190			e = e || window.event;			
4191			var $target = $(e.target).closest('.full_column[infixed="1"],.cstlayer[infixed="1"]');
4192			if ($target.length > 0) {
4193				var wheeldelta=e.wheelDelta;
4194				var detail=e.detail||e.originalEvent.detail;
4195				if(e.type=='mousewheel'){
4196					var wheeldelta=e.deltaY || e.originalEvent.deltaY;
4197					wheeldelta=(wheeldelta>0)?1:-1;
4198				}else{
4199					var wheeldelta=e.wheelDelta || e.originalEvent.wheelDelta;
4200					if(!wheeldelta) wheeldelta=detail;
4201				}
4202				var $win = $(window),$stainer = $('#scroll_container'),
4203				$scroll = $stainer.height() <= $win.height() ? $stainer : $win,
4204				movey = wheeldelta * -(Math.abs(detail) > 3 ? 1 : 40);
4205				$scroll.scrollTop($scroll.scrollTop() - movey);
4206				$win = $stainer = $scroll = movey = null;
4207			}
4208			$target = null;
4209		});
4210					//explain:修复flash模块在360安全浏览器极速模式下鼠标:hover后无法触发滚动效果,该事件在采用Webkit内核的浏览器下都会触发,author:fpf,date:2015-01-15,action:add;
4211					$('div.wp-flash_content').each(function(){
4212							$(this).unbind('mousewheel').bind('mousewheel',function(event){
4213									var scrolltop=$('#scroll_container').scrollTop();
4214									if(event.wheelDelta>0){
4215											$('#scroll_container').scrollTop(scrolltop-50);
4216									} else{
4217											$('#scroll_container').scrollTop(scrolltop+50);
4218									}
4219							});
4220					});
4221
4222			},300);
4223	})
4224
4225	$('#scroll_container').scroll(function(){
4226		wpfullcolumn_float();
4227	});
4228}
4229
4230function initCanvasHeight(){
4231	var maxheight=0;
4232	var helperfunc=function(dom){
4233		var degree=dom.data('deg')||dom.attr('deg');
4234		var pos=[parseInt(dom.css('left')),parseInt(dom.css('top'))]
4235		var w=dom.width();
4236		var h=dom.height();
4237		if(dom.hasClass('cstlayer')){
4238			var buttompos=$.divrotate.getDegreeModMaxPointOrigin(dom,degree,pos,[w,h],'buttom');
4239		}else{
4240			var buttompos=dom.ab_pos_cnter('top')+parseInt(dom.css('height'));
4241		}
4242		return buttompos;
4243	}
4244	var filterfunc=function(){
4245		return $(this).is(":not(div[deleted='deleted'])") && $(this).attr('childdel') != 'del';
4246	}
4247	$('#canvas  .cstlayer,#canvas  .full_column').filter(filterfunc).each(function(){
4248		var canvheight=helperfunc($(this));
4249		if(canvheight>maxheight) maxheight=canvheight;
4250	})
4251	$("#canvas").data('layermaxheight',maxheight);
4252	//#5460
4253	setTimeout(function(){
4254		$('#site_footer').find('.cstlayer').each(function(){
4255			var sitetop = parseInt($('#site_footer').css('top'));
4256			var thistop = parseInt($(this).css('top'))
4257			if(thistop<0&&sitetop<-thistop) {$(this).css('top',-sitetop);}
4258		})
4259	},100)
4260}
4261
4262$.fn.layer_ready=function(func){
4263	var is_exec=false;
4264	var execfunc=function(){
4265		if(is_exec) return;
4266		func();
4267		is_exec=true;
4268	}
4269	$(this).bind('layer_ready',function(){
4270		execfunc();
4271	})
4272	
4273	$(function(){
4274		execfunc();
4275	})
4276}
4277
4278/**document ready js**/
4279$(document).bind('lastexec',function(){
4280
4281	// Mobile device 2014/01/06
4282	if (window.MobileModel) {
4283		var $scontainer = $('#scroll_container'),canvaswidth = $('#canvas').width();
4284		$scontainer.unbind(".mbprevredhat.tmpredhat");
4285		if ($('#wp-mobile-device-header').length > 0) {
4286			// 手机模型定位
4287			var screenWidth = window.innerWidth||self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,
4288			deviceOtherHeight = $('#wp-mobile-device-header').closest('.wp-new-manage-toolbar-position').height() + $('#wp-mobile-device-footer').height();
4289			var onlyOnce_resize_width = false;
4290			$(window).bind("resize.mbeditor", function(e, status){
4291				var screenHeight = window.innerHeight||self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;
4292				$('#wp-mobile-device-sides').height(screenHeight - deviceOtherHeight).children('.mwrapper').height(screenHeight - deviceOtherHeight - 2);
4293				// 自定义滚动条样式
4294				var sidewidth = 14;/* 手机模型边缘宽度 */
4295				var mbtimer = setTimeout(function(){
4296					var newleft = ($._parseFloat($('#wp-mobile-device-header').css("left"))||0) + sidewidth;
4297					$scontainer.css({"left": (newleft - 10)+'px',"width": function(){/*-10是为了修复"缩放句柄被遮"问题*/
4298						if( onlyOnce_resize_width == false ){
4299							onlyOnce_resize_width = true;
4300							return ($(this).width() + (status?(sidewidth + 15 + 10):0))+'px';
4301						}else{
4302							return ;
4303						}
4304					},"margin": '0',"padding-left": '11px',"top": '-6px',"overflow-y": 'scroll'});
4305					$('#site_footer').css("left", '11px');/*11px是为了修复"缩放句柄被遮"问题*/
4306					if (status == undefined) $scontainer.mscroll("destroy");
4307					$scontainer.mscroll({difleft: 10,maskbg: '#ccc'});clearTimeout(mbtimer);
4308				}, 100);
4309			}).triggerHandler("resize.mbeditor", ['init']);
4310			$('#wp-mobile-device-header,#wp-mobile-device-sides,#wp-mobile-device-footer').css({"left": function(){
4311				return ((screenWidth - $(this).width()) / 2)+'px';
4312			}, "visibility": 'visible'});
4313			// 保存布局
4314			$('#wp-mobile-device-footer > span').click(function(){
4315				wp_floatpanel(parseToURL('wp_widgets','save_page'),{
4316					title: translate('page.saveLayout'),width: 418,overlay: true,isCenter: true,
4317					contentClass: 'wp-site-set_panel_c',id: 'wp-page_save',zIndex: 9999
4318				});
4319			});
4320		} else {/* 预览模式 */
4321			$scontainer.css("visibility", 'visible');
4322			$(window).load(function(){
4323				var $win = $(this),frmwidth = $win.width(),frmheight = window.getdeviceheight||565;
4324				$scontainer.height(frmheight);
4325				var mprevtimer = setTimeout(function(){
4326					$scontainer.mscroll({"maskcname": 'wp-mobile-device-premask',"difleft": -6,
4327					"height": frmheight,"barcname": 'wp-mobile-prescrollbar',"maskleft": frmwidth,"barleft": frmwidth});
4328					$win.triggerHandler("pageloaded");clearTimeout(mprevtimer);
4329					// 模拟“触屏”模式
4330					var maxtop = frmheight - $('.wp-mobile-prescrollbar > span.pane').height();
4331					$scontainer.bind("mousedown.mbprevredhat", function(e){
4332						e.preventDefault();
4333						var $prebar = $('.wp-mobile-prescrollbar'),pagey = e.pageY;
4334						$scontainer.bind("mousemove.tmpredhat", function(e){
4335							e.preventDefault();
4336							var scrltop = $scontainer.scrollTop(),movey = e.pageY - pagey;
4337							if (scrltop < 0) scrltop = 0;
4338							$scontainer.scrollTop(scrltop - movey);
4339						}).bind("mouseup.tmpredhat", function(e){
4340							e.preventDefault();$scontainer.unbind(".tmpredhat");
4341							$(parent.document).unbind(".rmredhat");
4342						});
4343						$(parent.document).bind("mouseup.rmredhat",function(){$scontainer.unbind(".tmpredhat")});
4344					});
4345				}, 150);
4346			});
4347		}
4348		$('#site_footer,#footer_content').width(canvaswidth);
4349	}
4350	
4351	function resizeCanvasHeight(){
4352		window.canv = $("#canvas");
4353		var container=$('#scroll_container');
4354		// 画布高度
4355		var cvhgt = window.getdeviceheight || window.innerHeight || self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;//$(window).height();
4356		var ua = /micromessenger/i.test(navigator.userAgent.toLowerCase());
4357		if (window.isHandheld&&!ua) cvhgt = Math.min(cvhgt, MobileUtils.getScreenHeight());
4358		cvhgt -= container.offset().top,mfooterheight = $('#wp-mobile-device-footer').height()||0;
4359		container.height(cvhgt - mfooterheight);
4360		if($('#site_footer').length>0){
4361			var canvheight=Math.max($("#canvas").data('layermaxheight'),cvhgt-$('#site_footer').height()-mfooterheight);
4362			if($('#site_footer:not(.only_copyright)').length>0){
4363				canvheight=Math.max(canvheight,$("#canvas").height());
4364			}
4365		}else{
4366			var canvheight=Math.max($("#canvas").data('layermaxheight'),cvhgt);
4367			canvheight=Math.max($("#canvas").data('layermaxheight'),cvhgt-mfooterheight);//没有页脚时去设备底部高度,防没有任何模块时有滚动条bug/4574
4368		}
4369		// 重置bSlider模块高度 2013/03/25
4370		$('.cstlayer[type="bslider"]:not(.isplate)').each(function(i, dom){
4371			$(dom).triggerHandler('resetbsliderheight', [canvheight]);
4372		});
4373		if(!canv) var canv = $("#canvas");
4374		canv.css('height',canvheight+'px');
4375		$('#scroll_container_bg').css('height',(canvheight+$('#site_footer').height())+'px');
4376		if($(window).width()-canv.width()<0) $('#scroll_container_bg').width(canv.width());
4377		else  $('#scroll_container_bg').css('width','100%');
4378		// 更新标尺位置Start 2012/3/2
4379		var canvleft = canv.offset().left;
4380		if (typeof $.fn.ruler_locate != 'undefined') {
4381			$.fn.ruler_locate({
4382				x : {left:canvleft+'px'},
4383				y : {height:canvheight+'px', left:(canvleft>17?canvleft-17:0)+'px'}
4384			});
4385			$('.line_y').height(canvheight);// 辅助线高度
4386		}
4387		// 在手机设备上访问 2014/02/08
4388		if (window.isHandheld) {
4389			var $container = $('#scroll_container'),$footer = $('#site_footer'),
4390			maxheight = $('#scroll_container_bg').height() + $('>.mblank_placeholder',$container).height();
4391			$container.css({"height": maxheight+'px',"overflow-x": 'hidden',"overflow-y": 'hidden'});
4392			if($footer.length) {
4393				if (/micromessenger/i.test(navigator.userAgent.toLowerCase())) {
4394					$footer.css({'position':'absolute','top':$('#canvas').height()});
4395				}
4396				$footer.find('#footer_content').andSelf().width($('#canvas').width());
4397			}
4398			/*adpHandheld();*/$('.mloading-mask').remove();
4399			$container.css("visibility", 'visible');$(window).triggerHandler("pageloaded");
4400			// 修复ipad中iframe touchmove冲突问题(bug#97) 2014/09/16
4401			if (/ipad/.test(navigator.userAgent.toLowerCase())) {
4402				$(document.body).parent().andSelf().css({"overflow-x": 'hidden',"overflow-y": 'auto'});
4403				container.css({"height": 'auto',"overflow-y": 'auto'});
4404			}
4405		}
4406	}
4407	
4408	function correctFooterPos(){
4409		var canv = $("#canvas");
4410		var canvheight=canv.height();
4411		var canvwidth=canv.width();
4412		var containerOffsetLeft = $('#scroll_container').offset().left;
4413		$('#site_footer').css({left:canv.offset().left-containerOffsetLeft+$('#scroll_container').scrollLeft()+$.parseInteger($('#canvas').css("borderLeftWidth")),top:canvheight});
4414		$('#site_footer >.full_width').css({left:0-canv.offset().left+containerOffsetLeft-$('#scroll_container').scrollLeft()-$.parseInteger($('#canvas').css("borderLeftWidth")),width:$(window.MobileModel?'#canvas':'#scroll_container_bg').width()});
4415		if($('#wp-mobile-device-header').length) $('#site_footer >.full_width').css("left", '0px');
4416	}
4417	window.correctFooterPos=correctFooterPos;
4418	
4419	window.scroll_container_adjust=function(){
4420		initCanvasHeight();
4421		//resizeCanvasHeight();
4422        //微信下初始化加载cvans高度过大出现滚动条。bug/4574
4423        if (/micromessenger/i.test(navigator.userAgent.toLowerCase())) {
4424            setTimeout(function(){
4425            // fixed bug#1107
4426            var fxdpstr = $(window).data("fxdp_scrollpage")||'',_scrtop = $(window).scrollTop();
4427            resizeCanvasHeight();
4428            if(fxdpstr == 'fxdp') $(window).scrollTop(_scrtop);
4429            correctFooterPos();
4430            // 修复"微信浏览器中锚点异常(bug#1059)"问题
4431            var hstr = location.hash||'';
4432            if(hstr.length > 0){location.href = location.href;location.hash = hstr.substr(1)}
4433            },600)
4434        }else {
4435            resizeCanvasHeight();
4436            correctFooterPos();
4437        }
4438		
4439	}
4440	window.scroll_container_adjust();
4441	if(!canv) var canv = $("#canvas");
4442	$('.full_column>.full_width').css({left:0-canv.offset().left+$('#scroll_container').offset().left-$('#scroll_container').scrollLeft()-$.parseInteger($('#canvas').css("borderLeftWidth")),width:$('#scroll_container_bg').width()});
4443	//浏览器缩放是自动调整高度
4444	var me = "orientation" in window && "onorientationchange" in window ? "orientationchange" : "resize"
4445	$(window).bind(me, function(e){
4446		if(e.target==window||e.target==document){
4447			resizeCanvasHeight();
4448			correctFooterPos();
4449			$('.full_column>.full_width').css({left:0-canv.offset().left+$('#scroll_container').offset().left-$('#scroll_container').scrollLeft()-$.parseInteger($('#canvas').css("borderLeftWidth")),width:$('#scroll_container_bg').width()});
4450			if($('.full_column-fixed').length){
4451				var full_column_left = 0-$('.full_column-fixed>.full_width').position().left;
4452				$('.full_column-fixed').css("left",full_column_left+"px");
4453			}
4454		}
4455	})
4456	
4457	if (!window.isHandheld) rotateDom($('.cstlayer'));
4458	//Preview need resize window
4459	if(window.opener){
4460		var winH = screen.availHeight || 768,winW = screen.availWidth || 1024;
4461		window.resizeTo(winW, winH);
4462	}
4463	// 新窗口打开超链接
4464	$.extend({
4465		openNewWin: function(URI){
4466			var win = window.open(URI,'_blank');
4467			win.focus;
4468		}
4469	});
4470});
4471/*!
4472 * jQuery Cookie Plugin v1.4.1
4473 * https://github.com/carhartl/jquery-cookie
4474 *
4475 * Copyright 2013 Klaus Hartl
4476 * Released under the MIT license
4477 */
4478(function (factory) {
4479	if (typeof define === 'function' && define.amd) {
4480		// AMD
4481		define(['jquery'], factory);
4482	} else if (typeof exports === 'object') {
4483		// CommonJS
4484		factory(require('jquery'));
4485	} else {
4486		// Browser globals
4487		factory(jQuery);
4488	}
4489}(function ($) {
4490
4491	var pluses = /\+/g;
4492
4493	function encode(s) {
4494		return config.raw ? s : encodeURIComponent(s);
4495	}
4496
4497	function decode(s) {
4498		return config.raw ? s : decodeURIComponent(s);
4499	}
4500
4501	function stringifyCookieValue(value) {
4502		return encode(config.json ? JSON.stringify(value) : String(value));
4503	}
4504
4505	function parseCookieValue(s) {
4506		if (s.indexOf('"') === 0) {
4507			// This is a quoted cookie as according to RFC2068, unescape...
4508			s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
4509		}
4510
4511		try {
4512			// Replace server-side written pluses with spaces.
4513			// If we can't decode the cookie, ignore it, it's unusable.
4514			// If we can't parse the cookie, ignore it, it's unusable.
4515			s = decodeURIComponent(s.replace(pluses, ' '));
4516			return config.json ? JSON.parse(s) : s;
4517		} catch(e) {}
4518	}
4519
4520	function read(s, converter) {
4521		var value = config.raw ? s : parseCookieValue(s);
4522		return $.isFunction(converter) ? converter(value) : value;
4523	}
4524
4525	var config = $.cookie = function (key, value, options) {
4526
4527		// Write
4528
4529		if (value !== undefined && !$.isFunction(value)) {
4530			options = $.extend({}, config.defaults, options);
4531
4532			if (typeof options.expires === 'number') {
4533				var days = options.expires, t = options.expires = new Date();
4534				t.setTime(+t + days * 864e+5);
4535			}
4536
4537			return (document.cookie = [
4538				encode(key), '=', stringifyCookieValue(value),
4539				options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
4540				options.path    ? '; path=' + options.path : '',
4541				options.domain  ? '; domain=' + options.domain : '',
4542				options.secure  ? '; secure' : ''
4543			].join(''));
4544		}
4545
4546		// Read
4547
4548		var result = key ? undefined : {};
4549
4550		// To prevent the for loop in the first place assign an empty array
4551		// in case there are no cookies at all. Also prevents odd result when
4552		// calling $.cookie().
4553		var cookies = document.cookie ? document.cookie.split('; ') : [];
4554
4555		for (var i = 0, l = cookies.length; i < l; i++) {
4556			var parts = cookies[i].split('=');
4557			var name = decode(parts.shift());
4558			var cookie = parts.join('=');
4559
4560			if (key && key === name) {
4561				// If second argument (value) is a function it's a converter...
4562				result = read(cookie, value);
4563				break;
4564			}
4565
4566			// Prevent storing a cookie that we couldn't decode.
4567			if (!key && (cookie = read(cookie)) !== undefined) {
4568				result[name] = cookie;
4569			}
4570		}
4571
4572		return result;
4573	};
4574
4575	config.defaults = {};
4576
4577	$.removeCookie = function (key, options) {
4578		if ($.cookie(key) === undefined) {
4579			return false;
4580		}
4581
4582		// Must not alter options, thus extending a fresh object...
4583		$.cookie(key, '', $.extend({}, options, { expires: -1 }));
4584		return !$.cookie(key);
4585	};
4586
4587}));
4588;
4589/*
4590 * SimpleModal 1.4.3 - jQuery Plugin
4591 * http://simplemodal.com/
4592 * Copyright (c) 2012 Eric Martin
4593 * Licensed under MIT and GPL
4594 * Date: Sat, Sep 8 2012 07:52:31 -0700
4595 */
4596(function(b){"function"===typeof define&&define.amd?define(["jquery"],b):b(jQuery)})(function(b){var j=[],l=b(document),m=b.browser.msie&&6===parseInt(b.browser.version)&&"object"!==typeof window.XMLHttpRequest,o=b.browser.msie&&7===parseInt(b.browser.version),n=null,k=b(window),h=[];b.modal=function(a,d){return b.modal.impl.init(a,d)};b.modal.close=function(){b.modal.impl.close()};b.modal.focus=function(a){b.modal.impl.focus(a)};b.modal.setContainerDimensions=function(){b.modal.impl.setContainerDimensions()};
4597b.modal.setPosition=function(){b.modal.impl.setPosition()};b.modal.update=function(a,d){b.modal.impl.update(a,d)};b.fn.modal=function(a){return b.modal.impl.init(this,a)};b.modal.defaults={appendTo:"body",focus:!0,opacity:50,overlayId:"simplemodal-overlay",overlayCss:{},containerId:"simplemodal-container",containerCss:{},dataId:"simplemodal-data",dataCss:{},minHeight:null,minWidth:null,maxHeight:null,maxWidth:null,autoResize:!1,autoPosition:!0,zIndex:1E3,close:!0,closeHTML:'<a class="modalCloseImg" title="Close"></a>',
4598closeClass:"simplemodal-close",escClose:!0,overlayClose:!1,fixed:!0,position:null,persist:!1,modal:!0,onOpen:null,onShow:null,onClose:null};b.modal.impl={d:{},init:function(a,d){if(this.d.data)return!1;n=b.browser.msie&&!b.support.boxModel;this.o=b.extend({},b.modal.defaults,d);this.zIndex=this.o.zIndex;this.occb=!1;if("object"===typeof a){if(a=a instanceof b?a:b(a),this.d.placeholder=!1,0<a.parent().parent().size()&&(a.before(b("<span></span>").attr("id","simplemodal-placeholder").css({display:"none"})),
4599this.d.placeholder=!0,this.display=a.css("display"),!this.o.persist))this.d.orig=a.clone(!0)}else if("string"===typeof a||"number"===typeof a)a=b("<div></div>").html(a);else return alert("SimpleModal Error: Unsupported data type: "+typeof a),this;this.create(a);this.open();b.isFunction(this.o.onShow)&&this.o.onShow.apply(this,[this.d]);return this},create:function(a){this.getDimensions();if(this.o.modal&&m)this.d.iframe=b('<iframe src="javascript:false;"></iframe>').css(b.extend(this.o.iframeCss,
4600{display:"none",opacity:0,position:"fixed",height:h[0],width:h[1],zIndex:this.o.zIndex,top:0,left:0})).appendTo(this.o.appendTo);this.d.overlay=b("<div></div>").attr("id",this.o.overlayId).addClass("simplemodal-overlay").css(b.extend(this.o.overlayCss,{display:"none",opacity:this.o.opacity/100,height:this.o.modal?j[0]:0,width:this.o.modal?j[1]:0,position:"fixed",left:0,top:0,zIndex:this.o.zIndex+1})).appendTo(this.o.appendTo);this.d.container=b("<div></div>").attr("id",this.o.containerId).addClass("simplemodal-container").css(b.extend({position:this.o.fixed?
4601"fixed":"absolute"},this.o.containerCss,{display:"none",zIndex:this.o.zIndex+2})).append(this.o.close&&this.o.closeHTML?b(this.o.closeHTML).addClass(this.o.closeClass):"").appendTo(this.o.appendTo);this.d.wrap=b("<div></div>").attr("tabIndex",-1).addClass("simplemodal-wrap").css({height:"100%",outline:0,width:"100%"}).appendTo(this.d.container);this.d.data=a.attr("id",a.attr("id")||this.o.dataId).addClass("simplemodal-data").css(b.extend(this.o.dataCss,{display:"none"})).appendTo("body");this.setContainerDimensions();
4602this.d.data.appendTo(this.d.wrap);(m||n)&&this.fixIE()},bindEvents:function(){var a=this;b("."+a.o.closeClass).bind("click.simplemodal",function(b){b.preventDefault();a.close()});a.o.modal&&a.o.close&&a.o.overlayClose&&a.d.overlay.bind("click.simplemodal",function(b){b.preventDefault();a.close()});l.bind("keydown.simplemodal",function(b){a.o.modal&&9===b.keyCode?a.watchTab(b):a.o.close&&a.o.escClose&&27===b.keyCode&&(b.preventDefault(),a.close())});k.bind("resize.simplemodal orientationchange.simplemodal",
4603function(){a.getDimensions();a.o.autoResize?a.setContainerDimensions():a.o.autoPosition&&a.setPosition();m||n?a.fixIE():a.o.modal&&(a.d.iframe&&a.d.iframe.css({height:h[0],width:h[1]}),a.d.overlay.css({height:j[0],width:j[1]}))})},unbindEvents:function(){b("."+this.o.closeClass).unbind("click.simplemodal");
4603l.unbind("keydown.simplemodal");k.unbind(".simplemodal");this.d.overlay.unbind("click.simplemodal")},fixIE:function(){var a=this.o.position;b.each([this.d.iframe||null,!this.o.modal?null:this.d.overlay,
4604"fixed"===this.d.container.css("position")?this.d.container:null],function(b,f){if(f){var g=f[0].style;g.position="absolute";if(2>b)g.removeExpression("height"),g.removeExpression("width"),g.setExpression("height",'document.body.scrollHeight > document.body.clientHeight ? document.body.scrollHeight : document.body.clientHeight + "px"'),g.setExpression("width",'document.body.scrollWidth > document.body.clientWidth ? document.body.scrollWidth : document.body.clientWidth + "px"');else{var c,e;a&&a.constructor===
4605Array?(c=a[0]?"number"===typeof a[0]?a[0].toString():a[0].replace(/px/,""):f.css("top").replace(/px/,""),c=-1===c.indexOf("%")?c+' + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"':parseInt(c.replace(/%/,""))+' * ((document.documentElement.clientHeight || document.body.clientHeight) / 100) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"',a[1]&&(e="number"===typeof a[1]?
4606a[1].toString():a[1].replace(/px/,""),e=-1===e.indexOf("%")?e+' + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"':parseInt(e.replace(/%/,""))+' * ((document.documentElement.clientWidth || document.body.clientWidth) / 100) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"')):(c='(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"',
4607e='(document.documentElement.clientWidth || document.body.clientWidth) / 2 - (this.offsetWidth / 2) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"');g.removeExpression("top");g.removeExpression("left");g.setExpression("top",c);g.setExpression("left",e)}}})},focus:function(a){var d=this,a=a&&-1!==b.inArray(a,["first","last"])?a:"first",f=b(":input:enabled:visible:"+a,d.d.wrap);setTimeout(function(){0<f.length?f.focus():d.d.wrap.focus()},
460810)},getDimensions:function(){var a="undefined"===typeof window.innerHeight?k.height():window.innerHeight;j=[l.height(),l.width()];h=[a,k.width()]},getVal:function(a,b){return a?"number"===typeof a?a:"auto"===a?0:0<a.indexOf("%")?parseInt(a.replace(/%/,""))/100*("h"===b?h[0]:h[1]):parseInt(a.replace(/px/,"")):null},update:function(a,b){if(!this.d.data)return!1;this.d.origHeight=this.getVal(a,"h");this.d.origWidth=this.getVal(b,"w");this.d.data.hide();a&&this.d.container.css("height",a);b&&this.d.container.css("width",
4609b);this.setContainerDimensions();this.d.data.show();this.o.focus&&this.focus();this.unbindEvents();this.bindEvents()},setContainerDimensions:function(){var a=m||o,d=this.d.origHeight?this.d.origHeight:b.browser.opera?this.d.container.height():this.getVal(a?this.d.container[0].currentStyle.height:this.d.container.css("height"),"h"),a=this.d.origWidth?this.d.origWidth:b.browser.opera?this.d.container.width():this.getVal(a?this.d.container[0].currentStyle.width:this.d.container.css("width"),"w"),f=this.d.data.outerHeight(!0),
4610g=this.d.data.outerWidth(!0);this.d.origHeight=this.d.origHeight||d;this.d.origWidth=this.d.origWidth||a;var c=this.o.maxHeight?this.getVal(this.o.maxHeight,"h"):null,e=this.o.maxWidth?this.getVal(this.o.maxWidth,"w"):null,c=c&&c<h[0]?c:h[0],e=e&&e<h[1]?e:h[1],i=this.o.minHeight?this.getVal(this.o.minHeight,"h"):"auto",d=d?this.o.autoResize&&d>c?c:d<i?i:d:f?f>c?c:this.o.minHeight&&"auto"!==i&&f<i?i:f:i,c=this.o.minWidth?this.getVal(this.o.minWidth,"w"):"auto",a=a?this.o.autoResize&&a>e?e:a<c?c:a:
4611g?g>e?e:this.o.minWidth&&"auto"!==c&&g<c?c:g:c;this.d.container.css({height:d,width:a});this.d.wrap.css({overflow:f>d||g>a?"auto":"visible"});this.o.autoPosition&&this.setPosition()},setPosition:function(){var a,b;a=h[0]/2-this.d.container.outerHeight(!0)/2;b=h[1]/2-this.d.container.outerWidth(!0)/2;var f="fixed"!==this.d.container.css("position")?k.scrollTop():0;this.o.position&&"[object Array]"===Object.prototype.toString.call(this.o.position)?(a=f+(this.o.position[0]||a),b=this.o.position[1]||
4612b):a=f+a;this.d.container.css({left:b,top:a})}
4612,watchTab:function(a){if(0<b(a.target).parents(".simplemodal-container").length){if(this.inputs=b(":input:enabled:visible:first, :input:enabled:visible:last",this.d.data[0]),!a.shiftKey&&a.target===this.inputs[this.inputs.length-1]||a.shiftKey&&a.target===this.inputs[0]||0===this.inputs.length)a.preventDefault(),this.focus(a.shiftKey?"last":"first")}else a.preventDefault(),this.focus()},open:function(){this.d.iframe&&this.d.iframe.show();b.isFunction(this.o.onOpen)?
4613this.o.onOpen.apply(this,[this.d]):(this.d.overlay.show(),this.d.container.show(),this.d.data.show());this.o.focus&&this.focus();this.bindEvents()},close:function(){if(!this.d.data)return!1;this.unbindEvents();if(b.isFunction(this.o.onClose)&&!this.occb)this.occb=!0,this.o.onClose.apply(this,[this.d]);else{if(this.d.placeholder){var a=b("#simplemodal-placeholder");this.o.persist?a.replaceWith(this.d.data.removeClass("simplemodal-data").css("display",this.display)):(this.d.data.hide().remove(),a.replaceWith(this.d.orig))}else this.d.data.hide().remove();
4614this.d.container.hide().remove();this.d.overlay.hide();this.d.iframe&&this.d.iframe.hide().remove();this.d.overlay.remove();this.d={}}}}});
4615
4616/**
4617 * Confirm对话框
4618 * (String)message - 欲显示的内容
4619 * (Function)callback - 回调函数
4620 */
4621function wp_confirm(message, callback, cancelBack){
4622	if ($('#wp-confirmpnl_overlay,#wp-confirm_panel').size()) return;
4623	var width = 286,pnl = '',ol = '<div id="wp-confirmpnl_overlay"></div>';
4624	pnl = '<div id="wp-confirm_panel" class="overz wp-manage_panel wp-alert-panel" style="position:absolute;width:'+width+'px;z-index:10001;">'
4625	+'<div class="wp-panel_outpadding overz"><div class="wp-manage_panel_block_one wp-manage-link overz"><h2 class="overz">'+message+'</h2></div>'
4626	+'<div class="wp-alert_button overz"><a href="javascript:;" class="wp-alert-sure">'+translate('Sure')+'</a><a href="javascript:;" class="wp-alert-cancel">'+translate('Cancel')+'</a></div></div></div>';
4627	$(ol+pnl).appendTo('body');
4628	var $cpnl = $('#wp-confirm_panel');
4629	$cpnl.bind('rename',function(e,name){
4630		if (name.length) {var self = this;
4631			$('a.wp-alert-sure',self).html(name);
4632			var timerid = setTimeout(function(){
4633				var newidth = $('a.wp-alert-sure',self).outerWidth(true) + $('a.wp-alert-cancel',self).outerWidth(true);
4634				$('.wp-alert_button',self).width(newidth);newidth = null;clearTimeout(timerid);
4635			}, 50);
4636		}
4637	});
4638	// 动态设置wp-alert_button宽度
4639	var resetWtimer = setTimeout(function(){
4640		var $altbtn = $cpnl.find('.wp-alert_button');
4641		$altbtn.width($altbtn.outerWidth());
4642//		var maxw = 0,$altbtn = $cpnl.find('.wp-alert_button');
4643//		$altbtn.children('a').each(function(i,a){
4644//			maxw += $(this).outerWidth(true);
4645//		});
4646//		if(maxw) $altbtn.width(maxw);
4647	},30);
4648	// 定位Dialog
4649	panel_position($cpnl,width,'auto',true,'wp-confirmpnl_overlay');
4650	// Bind window resize
4651	$(window).resize(function(){
4652		panel_position($cpnl,width,'auto',true,'wp-confirmpnl_overlay');
4653	});
4654	// 绑定"OK|Cancel"按钮
4655	$cpnl.find('a.wp-alert-sure').click(function(e){
4656		if(callback && $.isFunction(callback)) callback();
4657		$cpnl.add('#wp-confirmpnl_overlay').remove();
4658		if(resetWtimer) clearTimeout(resetWtimer);
4659		e.preventDefault();
4660	}).end().find('a.wp-alert-cancel').click(function(e){
4661		if(cancelBack && $.isFunction(cancelBack)) cancelBack();
4662		$cpnl.add('#wp-confirmpnl_overlay').remove();
4663		if(resetWtimer) clearTimeout(resetWtimer);
4664		e.preventDefault();
4665	});
4666	// 绑定Enter事件
4667	$(document).keydown(function(e){
4668		if(e.keyCode == 13) $cpnl.find('a.wp-alert-sure').trigger('click');
4669	});
4670	return false;
4671}
4672
4673function wp_editPicOnline(param)
4674{
4675	var imgtype=parseInt(getImageProcessType())||0; //图片处理  0 使用aviary处理  1 使用美图秀秀处理
4676	var imgprocess=['feather','xiuxiu'];
4677	if(imgtype >= imgprocess.length) imgtype=0;
4678	var imgtypestr=imgprocess[imgtype];
4679	
4680	$LAB.script(relativeToAbsoluteURL('script/wopop2_'+imgtypestr+'.js'))
4681	.wait(function(){
4682		wp_editPicOnlineActual(param);
4683	})
4684}
4685
4686/**
4687 * Alert对话框
4688 * (String)message - 欲显示的内容
4689 */
4690function wp_alert(message,callback){
4691	if ($('#wp-alertpnl_overlay,#wp-alert_panel').size()) return;
4692	var width = 286,pnl = '',ol = '<div id="wp-alertpnl_overlay"></div>';	
4693	pnl = '<div id="wp-alert_panel" class="overz wp-manage_panel wp-alert-panel" style="position:absolute;width:'+width+'px;z-index:10001;">'
4694	+'<div class="wp-panel_outpadding overz"><div class="wp-manage_panel_block_one wp-manage-link overz"><h2 class="overz">'+message+'</h2></div>'
4695	+'<div class="wp-alert_button overz" style="width:55px;"><a href="javascript:;" class="wp-alert-sure">'+translate('Sure')+'</a></div></div></div>';
4696	$(ol+pnl).appendTo('body');
4697	var $apnl = $('#wp-alert_panel');
4698	// 定位Dialog
4699	panel_position($apnl,width,'auto',true,'wp-alertpnl_overlay');
4700	// Bind window resize
4701	$(window).resize(function(){
4702		panel_position($apnl,width,'auto',true,'wp-alertpnl_overlay');
4703	});
4704	// 绑定"OK"按钮
4705	$apnl.find('a.wp-alert-sure').click(function(e){
4706		$apnl.add('#wp-alertpnl_overlay').remove();
4707		if($.isFunction(callback)) callback();
4708		e.preventDefault();
4709	});
4710	// 绑定Enter事件
4711	$(document).keydown(function(e){
4712		if(e.keyCode == 13) $apnl.find('a.wp-alert-sure').trigger('click');
4713	});
4714
4715	return false;
4716}
4717
4718/**
4719 * --------------------------------------------------------
4720 * Popup对话框(临时函数)
4721 * --------------------------------------------------------
4722 */
4723function show_dialog(load_url, title, width, height, callback, opentype){
4724	var fn = $.extend({}, {
4725		open: function(d){},
4726		close: function(d){}
4727	}, callback || {});
4728	$('#osx-modal-content').modal({
4729		overlayId: 'osx-overlay',
4730		containerId: 'osx-container',
4731		closeHTML: null,
4732		zIndex: 1000,
4733		opacity: 25,
4734		onOpen: function(d){
4735			fn.open(d);
4736			var self = this, $container = d.container, container = $container[0];
4737			var $data = $('#osx-modal-data', container);
4738			if (opentype == 'iframe') {								
4739				$data.html('<iframe src="'+load_url+'" frameborder="0" width="'+width+'" onload="this.height=this.contentWindow.document.documentElement.scrollHeight" scrolling="no"></iframe>');
4740				d.overlay.show();
4741				$data.show();
4742				$('#osx-modal-content,div.close', container).show();
4743				$('#osx-modal-title', container).html(title).show();
4744				$container.fadeTo('fast',1).draggable({handle: '#osx-modal-title',cursor: 'move'});
4745			} else {
4746				var $ajaxload = $('#wp-ajaxsend_loading2'),$win = $(window);
4747				if($ajaxload.size()==0)  $('<div id="wp-ajaxsend_loading2" style="width:'+$win.width()+'px;height:'+$win.height()+'px;z-index:9999;"><img src="'+relativeToAbsoluteURL('template/default/images/loading.gif')+'" width="16" height="16" /></div>').appendTo('body');
4748				$.get(load_url, function(data){
4749					$data.html(data);
4750					d.overlay.show();
4751					$data.show();
4752					$('#osx-modal-content,div.close', container).show();
4753					$('#osx-modal-title', container).html(title).show();
4754					$container.fadeTo('fast',1).draggable({handle: '#osx-modal-title',cursor: 'move'});
4755					self.setPosition();
4756					$('#wp-ajaxsend_loading2').remove();
4757				}).error(function(){
4758					$('#wp-ajaxsend_loading2').remove();
4759					alert(translate('Request failed!')); 
4760					self.close();return;
4761				});
4762			}
4763			if(width > 0) $container.css('width', width);
4764			$container.css('height', height || '');
4765			$('#osx-modal-content').bind('add_loading',function(){
4766				var loading=$data.children('.loading');
4767				if(loading.size()) loading.remove();
4768				$('<div class="loading" style="width:'+$data.width()+'px;height:'+$data.outerHeight()+'px;z-index:9999;"><img src="'+relativeToAbsoluteURL('template/default/images/loading.gif')+'" width="16" height="16" /></div>').appendTo($data);
4769			})
4770
4771//			d.overlay.fadeIn('slow', function(){
4772//				$data.show();
4773//				$('#osx-modal-content,div.close', container).show();
4774//				$('#osx-modal-title', container).html(title).show();
4775//
4776//				$container.fadeTo('fast',1).draggable({handle: '#osx-modal-title',cursor: 'move'});
4777//			});
4778		},
4779		onClose: function(d){
4780			fn.close(d);
4781			var self = this;
4782			d.container.hide();
4783			d.overlay.hide();
4784			$("#osx-modal-content").triggerHandler('dialogclose', d);
4785			$("#osx-modal-content").unbind('dialogclose');
4786			$('#osx-modal-content').unbind('add_loading');
4787			setTimeout(function(){
4788				self.close();
4789			},500)
4790			
4791//			d.container.fadeOut('slow', function(){
4792//				d.overlay.fadeOut('slow', function(){
4793//					$("#osx-modal-content").triggerHandler('dialogclose', d);
4794//					$("#osx-modal-content").unbind('dialogclose');
4795//					self.close();
4796//				});
4797//			});
4798		}
4799	});
4800}
4801
4802/*获取样式*/
4803function get_plugin_css(tagid,css){
4804	var editmode=false;
4805	if($.saveLayout) editmode=true;
4806	var setcss=$("#page_set_css").html();
4807	setcss=setcss.replace(/<style>/ig,'').replace(/<\/style>/ig,'').replace(/[\r]/g, " ").replace(/[\n]/g, " ").replace(/[\r\n]/g, " ").replace(/\s+/g, " "); 
4808	var reg = eval("/\\/\\*"+tagid+"\\*\\/(.*)\\/\\*"+tagid+"\\*\\//ig");
4809	setcss=setcss.replace(reg,'');	
4810	if(setcss&&$.trim(setcss) != '') css=css.replace(/@charset [^;]+;/i,'');
4811	var tempcss=setcss + ' /*'+ tagid +'*/ '+css+' /*'+ tagid +'*/ ';
4812	tempcss=tempcss.replace(/&gt;/ig,'>');
4813	if(editmode) $("#page_set_css").html('<style> '+tempcss + '</style>');
4814	else{
4815		$("#page_set_css").after($("#page_set_css").clone().attr('id','page_set_css2').html('<style> '+tempcss + '</style>'));
4816		$("#page_set_css").remove();
4817		$("#page_set_css2").attr('id','page_set_css');
4818	}
4819}
4820
4821(function( $, undefined ) {
4822	var callbackhash={};
4823	var mod_property={};
4824	
4825	$.modplugin={
4826		addCallBack:function(type,funcname,func){
4827			if($.isFunction(func)){
4828				if(!callbackhash[type]) callbackhash[type]={};
4829				callbackhash[type][funcname]=func;
4830			}
4831		},
4832		fireCallBack:function(type,funcname,dom,data){
4833			var func=callbackhash[type];
4834			if(!func) return false;
4835			func=func[funcname];
4836			if($.isFunction(func)){
4837				return func(dom,data);
4838			}else{
4839				return false;
4840			}
4841		}
4842	}
4843	
4844	$.fn.execPluginCallBack=function(funcname,data){
4845			return $.modplugin.fireCallBack(this.attr('type'),funcname,this,data);
4846	}
4847	
4848	$.fn.mod_property=function(key,val){
4849		     if($.isPlainObject(key)){
4850					for(var inkey in key){
4851						this.mod_property(inkey,key[inkey]);
4852					}
4853					return ;
4854			 }
4855			var id=this.prop('id');
4856			if(!id) return null;
4857			var propertydata=mod_property[id];
4858			if(!propertydata){
4859				mod_property[id]=propertydata={};
4860			}
4861			if(val !== undefined){
4862				propertydata[key]=val;
4863				return val;
4864			}else{
4865				return propertydata[key];
4866			}
4867	}
4868	
4869	
4870	var PropertyCommand=null;
4871	function initPropCommand(){
4872		if(PropertyCommand) return;
4873		PropertyCommand=Undo.Command.createModuleCommand(function(blockid,val){
4874			var blockel=$('#'+blockid);
4875			if(val.propval!=undefined) blockel.mod_property(val.propkey,val.propval);
4876			else blockel.del_mod_property(val.propkey);
4877			blockel.execPluginCallBack('property_undo',val); 
4878		},null,{returntype:'class'});
4879	}
4880	
4881	$.fn.autoundo_mod_property=function(key,val){
4882		if(val === undefined) return this.mod_property(key);
4883		initPropCommand();
4884		var oldval=this.mod_property(key);
4885		this.mod_property(key,val);
4886		var oldvalue={propkey:key,propval:oldval,act:'set',cmdtype:'undo'}
4887		var newvalue={propkey:key,propval:val,act:'set',cmdtype:'redo'}
4888		if(!Undo.Command.DefaultEqAct(oldval,val)) new PropertyCommand(this.attr('id')).insertWithVals(oldvalue, newvalue);
4889	}
4890	
4891	$.fn.autoundo_del_mod_property=function(key){
4892		initPropCommand();
4893		var oldval=this.mod_property(key);
4894		this.del_mod_property(key);
4895		var oldvalue={propkey:key,propval:oldval,act:'del',cmdtype:'undo'}
4896		var newvalue={propkey:key,act:'del',cmdtype:'redo'}
4897		if(oldval != undefined)  new PropertyCommand(this.attr('id')).insertWithVals(oldvalue, newvalue);
4898	}
4899	
4900	$.fn.del_mod_property=function(key){
4901		var id=this.prop('id');
4902		if(!id) return null;
4903		var propertydata=mod_property[id];
4904		if($.isPlainObject(propertydata)){
4905			var oldval=propertydata[key];
4906			delete propertydata[key];
4907			return oldval;
4908		}
4909	}
4910	
4911	$.fn.get_mod_property=function(){
4912		var id=this.prop('id');
4913		if(!id) return null;
4914		var propertydata=mod_property[id];
4915		return propertydata||{};
4916	}
4917	
4918})(jQuery);;
4919function footerinit(){
4920	footerdrag();
4921	footerresize();
4922	
4923	$.showSiteFooterTips();
4924	$('.full_column').each(function(){
4925		fullcolumninit($(this));
4926	})
4927}
4928
4929function fullcolumninit(dom){
4930	dom.children('.full_width').css({left:0-canv.offset().left-$.parseInteger($('#canvas').css("borderLeftWidth")),width:$('#scroll_container_bg').width()});
4931	dom.wp_rightkey(); 
4932	if(dom.is(':not(.isplate)')){
4933		dom.wp_layerhover();
4934		fullcolumndrag(dom);
4935		fullcolumnresize(dom);
4936		fullcolumndrop(dom);
4937	}
4938	
4939}
4940
4941function footerdrag(){
4942	var maxminusheight=0;
4943	var curcanvheight=canv.height();
4944	var Command=Undo.Command.createModuleCommand(function(blockid,val){
4945			var blockel=$('#'+blockid);
4946			blockel.css('top',val.top);
4947			canv.height(val.canvheight);
4948			$('#scroll_container_bg').css('height',(val.canvheight+blockel.height())+'px');
4949			$.updateselectbgopt();
4950			$.updatepospropblk();
4951			$.canvasHeightChange();
4952	 },null,{returntype:'class'});
4953	 
4954	 var undoobj=null;
4955	$('#site_footer').draggable({
4956			cursor: 'move',
4957			axis: "y",
4958			start: function(event, ui){
4959				$(this).find('.ui-resizable-handle > .knob').hide();
4960				$(this).find('.ui-resizable-n').css('border-top-color', '#83c521');
4961				$(this).find('.ui-resizable-s').css('border-bottom-color', '#83c521');
4962				$(this).find('.ui-resizable-e').css('border-right-color', '#83c521');
4963				$(this).find('.ui-resizable-w').css('border-left-color', '#83c521');
4964				
4965				initCanvasHeight();
4966				var canvasminheight=canv.data('layermaxheight')||0;
4967				curcanvheight=canv.height();
4968				maxminusheight=curcanvheight-canvasminheight;
4969				undoobj=new Command('site_footer');
4970				undoobj.setOldVal({top:$.parseInteger($(this).css('top')),canvheight:curcanvheight});
4971			},
4972			drag: function(event, ui){
4973
4974				var topmovepx = ui.position.top - ui.originalPosition.top;
4975				if(topmovepx<0){
4976					var delta=0-topmovepx;
4977					if(delta>maxminusheight){
4978						var canvasminheight=canv.data('layermaxheight')||0;
4979						ui.position.top=ui.originalPosition.top-maxminusheight;
4980						canv.height(canvasminheight);
4981						$('#scroll_container_bg').css('height',(canvasminheight+$(this).height()+100)+'px');
4982						$.showselectbgopt($(this));
4983						$('.bgblk').hide();
4984						$('.posizeblk').html("x:"+(parseFloat($(this).css('left'))||0)+", y:"+ui.position.top).show();
4985						$(this).triggerHandler('drag_progress',[{left:0,top:ui.position.top}]);
4986						return;
4987					} 
4988				}
4989				$(this).triggerHandler('drag_progress',[{left:0,top:ui.position.top}]);
4990				canv.height(curcanvheight+topmovepx);
4991				$.showselectbgopt($(this));
4992				$('.bgblk').hide();
4993				$('.posizeblk').html("x:"+(parseFloat($(this).css('left'))||0)+", y:"+ui.position.top).show();
4994				$('#scroll_container_bg').css('height',(curcanvheight+topmovepx+$(this).height()+100)+'px');
4995			},
4996			stop:function(event, ui){
4997				$(this).find('.ui-resizable-handle > .knob').show();
4998				$(this).find('.ui-resizable-n').css('border-top-color', '#ff872e');
4999				$(this).find('.ui-resizable-s').css('border-bottom-color', '#ff872e');
5000				$(this).find('.ui-resizable-e').css('border-right-color', '#ff872e');
5001				$(this).find('.ui-resizable-w').css('border-left-color', '#ff872e');
5002				
5003				var topmovepx = ui.position.top - ui.originalPosition.top;
5004				canv.height(curcanvheight+topmovepx);
5005				$('#scroll_container_bg').css('height',(curcanvheight+topmovepx+$(this).height()+100)+'px');
5006				$.canvasHeightChange();
5007				correctFooterPos();
5008				undoobj.insertWithNewVal({top:$.parseInteger($(this).css('top')),canvheight:curcanvheight+topmovepx});		
5009				undoobj=null;
5010				$('.bgblk').show();
5011				$('.posizeblk').hide();
5012				$(this).trigger('drag_stop',[{left:parseInt($(this).css('left')),top:parseInt($(this).css('top'))}]);
5013			}
5014			
5015	});
5016}
5017
5018function fullcolumndrag(dom){
5019	dom.wp_drag();
5020}
5021
5022function fullcolumnresize(dom){
5023	var createhandlefunc=function(handle){
5024		     dom.each(function(){
5025					 var hname = 'ui-resizable-'+handle;
5026					var axis = $('<div class="ui-resizable-handle ' + hname + '"><p class="knob "></p></div>');
5027					
5028					axis.css({zIndex: 1000});
5029					$(this).children('.full_width').append(axis);
5030			 })
5031				
5032	}
5033	var createplaceholderfunc=function(handle){
5034			  dom.each(function(){
5035					var hname = 'placeholder-'+handle;
5036					var axis = $('<div class="li-placeholder  ' + hname + '"></div>');
5037					axis.css({zIndex: 1000}).hide();
5038					$(this).children('.full_width').append(axis);
5039			  })
5040	}
5041	createhandlefunc('n');
5042	createhandlefunc('s');
5043	createplaceholderfunc('w');
5044	createplaceholderfunc('e');
5045	
5046	var fullcolumnbuttompos;
5047	dom.resizable({
5048			handles: {n: '>.full_width .ui-resizable-n',s: '>.full_width .ui-resizable-s'},
5049			noinit:true,
5050			canvascontain: '#canvas',
5051			distance: 0,
5052		     concernLock:true,
5053			scroll: true,
5054			create:function(){
5055				$(this).children('.full_width').find('.ui-resizable-handle').hide();
5056			},
5057			start: function(event, ui){
5058				fullcolumnbuttompos=$.getFullColChildMaxButtom(dom);
5059				var self=$(this);
5060				var resizeundo=new ResizeCommand(self.attr('id'));
5061				var oldcssarr=['top','height'];
5062				var oldval={};
5063				for(var i=0;i<oldcssarr.length;i++){
5064					oldval[oldcssarr[i]]=self.css(oldcssarr[i]);
5065				}
5066				resizeundo.setOldVal(oldval);
5067				$(document).data('resizeundo',resizeundo);
5068			},
5069			resize: function(event, ui){
5070				
5071				var curtop=dom.ab_pos_cnter('top');
5072				var curheight=$.parseInteger(dom.css('height'));
5073				if($.getElementAreaInf($(this))=='canvas'){
5074					var maxbuttom=Math.max(curtop+fullcolumnbuttompos,curtop+curheight);
5075					$.canvasheightresizeOrigin(maxbuttom);
5076				}
5077				
5078				$(this).children('.full_content,.full_width').height($(this).height());
5079				$(this).triggerHandler('resize_progress',[{ui:ui}]);
5080				$.showselectbgopt($(this));
5081				$('.bgblk').hide();
5082				$('.posizeblk').html("W:"+$(this).width()+", H:"+$(this).height()).show();
5083			},
5084			stop:function(event, ui){
5085				$(this).children('.full_content,.full_width').height($(this).height());
5086				$.showselectbgopt($(this));
5087				var resizeundo=$(document).data('resizeundo');
5088				$(document).removeData('resizeundo');
5089				var self=$(this);
5090				var oldcssarr=['top','height'];
5091				var newval={};
5092				for(var i=0;i<oldcssarr.length;i++){
5093					newval[oldcssarr[i]]=self.css(oldcssarr[i]);
5094				}
5095				$(this).triggerHandler('resize_stop',[{ui:ui}]);
5096				resizeundo.insertWithNewVal(newval);	
5097				$('.bgblk').show();
5098				$('.posizeblk').hide();
5099			}
5100			
5101	});
5102}
5103
5104function footerresize(){
5105	var createhandlefunc=function(handle){
5106				var hname = 'ui-resizable-'+handle;
5107				var axis = $('<div class="ui-resizable-handle ' + hname + '"><p class="knob "></p></div>');
5108				axis.css({zIndex: 1000});
5109				$('#site_footer >.full_width').append(axis);
5110	}
5111	var createplaceholderfunc=function(handle){
5112				var hname = 'placeholder-'+handle;
5113				var axis = $('<div class="li-placeholder  ' + hname + '"></div>');
5114				axis.css({zIndex: 1000});
5115				$('#site_footer> .full_width').append(axis);
5116	}
5117	createhandlefunc('n');
5118	createhandlefunc('s');
5119	createplaceholderfunc('w');
5120	createplaceholderfunc('e');
5121	
5122	
5123	var maxminusheight=0;
5124	var curcanvheight=canv.height();
5125	var canvasminheight=0;
5126	
5127	var Command=Undo.Command.createModuleCommand(function(blockid,val){
5128			var blockel=$('#'+blockid);
5129			blockel.css('top',val.top);
5130			blockel.css('height',val.height);
5131			canv.height(val.canvheight);
5132			blockel.children('.full_content,.full_width').height(val.height);
5133			$('#scroll_container_bg').css('height',(val.canvheight+blockel.height())+'px');
5134			$.updateselectbgopt();
5135			$.updatepospropblk();
5136			$.canvasHeightChange();
5137	 },null,{returntype:'class'});
5138	 
5139	 var undoobj=null;
5140	 var resizertimer=null;
5141	$('#site_footer').resizable({
5142			handles: {n: '>.full_width .ui-resizable-n',s: '>.full_width .ui-resizable-s'},
5143			noinit:true,
5144			distance: 0,
5145			scroll: true,
5146			create:function(){
5147				$(this).children('.full_width').find('.ui-resizable-handle').hide();
5148			},
5149			start: function(event, ui){
5150				initCanvasHeight();
5151				if(resizertimer){
5152					clearTimeout(resizertimer);
5153					resizertimer=null;
5154				}
5155				canvasminheight=canv.data('layermaxheight')||0;
5156				curcanvheight=canv.height();
5157				maxminusheight=curcanvheight-canvasminheight;
5158				
5159				undoobj=new Command('site_footer');
5160				undoobj.setOldVal({top:$.parseInteger($(this).css('top')),canvheight:curcanvheight,height:$(this).height()});
5161				$(this).triggerHandler('resize_progress',[{ui:ui}]);
5162			},
5163			resize: function(event, ui){
5164				var resizeobj=$(this).data('resizable');
5165				var theaxis=resizeobj.axis;
5166				if(theaxis=='n'){
5167					var changey= $(this).height()-ui.originalSize.height;
5168					if(changey>maxminusheight){
5169						var mintop=canvasminheight;
5170						$(this).css({top:mintop,height:ui.originalSize.height+maxminusheight});
5171						var oriscrolltop=$(this).data('resize_oriscrolltop');
5172						$(this).scrollParent().scrollTop(oriscrolltop);
5173						$(this).children('.full_content,.full_width').height($(this).height());
5174						canv.height(canvasminheight);
5175						$('#scroll_container_bg').css('height',(canvasminheight+$(this).height()+100)+'px');
5176						$.showselectbgopt($(this));
5177						$('.bgblk').hide();
5178						$('.posizeblk').html("W:"+$(this).width()+", H:"+$(this).height()).show();
5179						return;
5180					}
5181					canv.height(curcanvheight-changey);
5182					$(this).children('.full_content,.full_width').height($(this).height());
5183					$('#scroll_container_bg').css('height',(canv.height()+$(this).height()+100)+'px');
5184				}else{
5185					$(this).children('.full_content,.full_width').height($(this).height());
5186					$('#scroll_container_bg').css('height',(canv.height()+$(this).height()+100)+'px');
5187				}
5188				$.showselectbgopt($(this));
5189				$('.bgblk').hide();
5190				$('.posizeblk').html("W:"+$(this).width()+", H:"+$(this).height()).show();
5191				$(this).triggerHandler('resize_stop',[{ui:ui}]);
5192			},
5193			stop:function(event, ui){
5194				var self=$(this);
5195				undoobj.insertWithNewVal({top:$.parseInteger(self.css('top')),canvheight:canv.height(),height:self.height()});		
5196				undoobj=null;
5197				$('.bgblk').show();
5198				$('.posizeblk').hide();
5199				$.canvasHeightChange();
5200			}
5201			
5202	});
5203}
5204
5205function fullcolumndrop(dom){
5206	var createplaceholderfunc=function(handle){
5207			  dom.each(function(){
5208					var hname = 'placeholder-'+handle;
5209					var axis = $('<div class="li-placeholder  ' + hname + '"></div>');
5210					axis.css({zIndex: 1000});
5211					$(this).children('.full_content').append(axis);
5212			  })
5213	}
5214	createplaceholderfunc('n');
5215	createplaceholderfunc('s');
5216	createplaceholderfunc('w');
5217	createplaceholderfunc('e');
5218	
5219	var contentblock=dom.children('.full_content');
5220	contentblock.children('.li-placeholder').hide();
5221	contentblock.children('.placeholder-n').css({'border-top':'#FF9900 dashed 4px'});
5222	contentblock.children('.placeholder-s').css({'border-bottom':'#FF9900 dashed 4px'});
5223	contentblock.children('.placeholder-e').css({'border-right':'#FF9900 dashed 4px'});
5224	contentblock.children('.placeholder-w').css({'border-left':'#FF9900 dashed 4px'});
5225	
5226	contentblock.droppable({
5227			tolerance: 'pointer',
5228			accept:'.full_column,.cstlayer',
5229			drop: function( event, ui ) {
5230				var draggable = $.ui.ddmanager.current;
5231				if($.getElementAreaInf($(draggable.element))==$.getElementAreaInf(dom)){
5232					if(!dom.hasClass('ui-modselected')){
5233						$(this).children('.li-placeholder').hide();
5234						var existcolumn=$(document).data('layer_final_drop_id');
5235						var biggercolumn=$.chooseBiggerColumn(existcolumn,dom.attr('id'));
5236						
5237						$(document).data('layer_final_drop_id',biggercolumn);
5238					}
5239				}
5240			},
5241			over: function(event, ui){
5242				//判断是否包含锁定元素
5243				var has_layer_lock=false;
5244				$('.ui-modselected').each(function(){
5245						if($(this).data('cstlayerstatus') == 'unlock' ){
5246							has_layer_lock=true;
5247						}
5248				});
5249				if(has_layer_lock) return;
5250				var draggable = $.ui.ddmanager.current;
5251				if($.getElementAreaInf($(draggable.element))==$.getElementAreaInf(dom)){
5252					if(!dom.hasClass('ui-modselected')){
5253						var thisid=dom.attr('id');
5254						var existid=$(document).data('layer_drop_over_id');
5255						if(thisid != existid){
5256							var biggerid=$.chooseBiggerColumn(existid,thisid);
5257							if(biggerid == thisid){
5258								var $this=$(this);
5259								$(this).children('.li-placeholder').show();
5260								if(existid){
5261									var existcolumnel = $('#'+existid);
5262									if(!existcolumnel.is('.wp_droppable')){
5263										var dropobj=existcolumnel.children('.full_content').data('droppable');
5264									}else{
5265										var dropobj=existcolumnel.children('.drop_box').data('droppable');
5266									}
5267									dropobj['isover'] = 0;
5268									dropobj['isout'] = 1;
5269									dropobj._out.call(dropobj, event);
5270								}
5271								$(document).data('layer_drop_over_id', thisid);
5272							}else{
5273								var dropobj1=$(this).data('droppable');
5274								dropobj1['isover'] = 0;
5275								dropobj1['isout'] = 1;
5276							}
5277						}
5278
5279					}
5280				}
5281			},
5282			out: function(event, ui){
5283				//判断是否包含锁定元素
5284				var has_layer_lock=false;
5285				$('.ui-modselected').each(function(){
5286						if($(this).data('cstlayerstatus') == 'unlock' ){
5287							has_layer_lock=true;
5288						}
5289				});
5290				if(has_layer_lock) return;
5291				var draggable = $.ui.ddmanager.current;
5292				if($.getElementAreaInf($(draggable.element))==$.getElementAreaInf(dom)){
5293					if(!dom.hasClass('ui-modselected') ){
5294						$(this).children('.li-placeholder').hide();
5295						var curoverid=$(document).data('layer_drop_over_id');
5296						if(curoverid == dom.attr('id')) $(document).removeData('layer_drop_over_id');
5297					} 
5298				}
5299				
5300			}
5301	});
5302
5303}
5304
5305function fullcolumn_propblk_init(){
5306	var lvtimer;
5307	for(var key in $.backgroundPropDefaults){
5308		(function(){	
5309			var curkey=key;
5310			var otherfunc=null;
5311			if($.inArray(curkey,['bg_moveto_prevop','bg_moveto_nextop']) != -1){
5312				var innertxt ='', lvtype = '';
5313				switch(curkey){
5314					case 'bg_moveto_prevop':
5315						lvtype = 'top';
5316						innertxt = '<div class="wp-moveto_fstlevel"><a class="property-bar-top" href="###" title="'+translate('Move to top')+'"><span>&nbsp;</span></a></div>';
5317						break;
5318					case 'bg_moveto_nextop':
5319						lvtype = 'bottom';
5320						innertxt = '<div class="wp-moveto_lstlevel"><a class="property-bar-bottom" href="###" title="'+translate('Move to bottom')+'"><span>&nbsp;</span></a></div>';
5321						break;
5322				}
5323				otherfunc={
5324					mousedown:function(){
5325						var $target = $(this)
5326						var apos =$target.offset();
5327						var scrollctner=$('#scroll_container');
5328						var scrolltop=scrollctner.scrollTop();
5329
5330						$(innertxt).appendTo(scrollctner).css({
5331							top: function(){
5332								return (apos.top+scrolltop - 25-39)+'px'
5333							},left: apos.left+'px'
5334						}).click(function(e){
5335							$('#'+$.bgselectedid).wp_setorder(lvtype,$.bgselectedid);
5336							$(this).remove();
5337							$target.removeClass('local');
5338							e.preventDefault();
5339						});
5340
5341					},
5342					mouseup:function(){
5343
5344					}
5345				}
5346			}
5347			$('#'+curkey).mousedown(function(e){
5348					var $target = $(this);	
5349					$target.addClass('local');
5350					if($('.wp-moveto_fstlevel,.wp-moveto_lstlevel').size()) $('.wp-moveto_fstlevel,.wp-moveto_lstlevel').remove();
5351					if(otherfunc != null){
5352						otherfunc.mousedown.apply(this);
5353					}
5354					e.preventDefault();
5355			}).mouseup(function(e){
5356					var self = this,$target = $(self);
5357					$target.removeClass('local');
5358					$.backgroundPropDefaults[curkey].apply(this);
5359					if(otherfunc != null){
5360						otherfunc.mouseup.apply(this);
5361					}
5362					e.preventDefault();
5363			})
5364		})();
5365	}
5366}
5367
5368(function($){
5369function getAllParents(el){
5370	var parents={};
5371	parents[el.prop('id')]='null';
5372	var curel=el;
5373	while(true){
5374		var parentid=$.getElementFatherid(curel);
5375		if(parentid =='none') break;
5376		parents[parentid]=curel.prop('id');
5377		curel=$('#'+parentid);
5378	}
5379	return parents;
5380}
5381
5382$.chooseBiggerColumn=function(existcolumnid,newcolumnid){
5383	var biggercolumnid=newcolumnid;
5384	if(existcolumnid==newcolumnid) return biggercolumnid;
5385	if(existcolumnid){
5386		var existcolumnel=$('#'+existcolumnid);
5387		var newcolumnel=$('#'+newcolumnid);
5388		
5389		var existcolumnfathers=getAllParents(existcolumnel);
5390		var newcolumnfathers=getAllParents(newcolumnel);
5391		var rootid='canvas';
5392		if(!existcolumnfathers[rootid])  rootid='site_footer';
5393		var existdifffather=rootid;
5394		var newdifffather=rootid;
5395		while(existdifffather == newdifffather){
5396			existdifffather =existcolumnfathers[existdifffather];
5397			newdifffather =newcolumnfathers[newdifffather];
5398			if(existdifffather=='null' || newdifffather=='null') break;
5399		}
5400		if(existdifffather=='null') biggercolumnid=newcolumnid;
5401		else if(newdifffather=='null') biggercolumnid=existcolumnid;
5402		else{
5403			var existfatherzindex=$.parseInteger($('#'+existdifffather).css('z-index'));
5404			var newfatherzindex=$.parseInteger($('#'+newdifffather).css('z-index'));
5405			if(existfatherzindex > newfatherzindex) biggercolumnid=existcolumnid;
5406		}
5407	}
5408	return biggercolumnid;
5409}	
5410
5411$.transferToColumn=function(dom,fathercolid){
5412	var oldfatherid=$.getElementFatherid(dom);
5413	if(oldfatherid!=fathercolid){
5414		var newfatherel=$('#'+fathercolid);
5415		var domabpos=dom.ab_pos('top');
5416		var newfatherabpos=newfatherel.ab_pos('top');
5417		var domableft=dom.ab_pos('left');
5418		var newfatherl=newfatherel.ab_pos('left');
5419		var contentblock=newfatherel;
5420		if(fathercolid!='canvas'){
5421			if(newfatherel.is('.wp_droppable')){
5422				contentblock=newfatherel.children('.drop_box');
5423			}else contentblock=newfatherel.children('.full_content');
5424		}
5425		dom.detach().attr('fatherid',fathercolid).css({'top':(domabpos-newfatherabpos),'left':(domableft-newfatherl)}).appendTo(contentblock);
5426		if(fathercolid=='site_footer'||fathercolid=='canvas') dom.removeAttr('fatherid');
5427	}
5428}
5429
5430$.getElementAreaInf=function(dom){
5431	return dom.attr('inbuttom')=='1'?'site_footer':'canvas';
5432}
5433
5434$.transferToArea=function(dom,from,to,isInUndo){
5435	var domabpos=dom.ab_pos('top');
5436	var domableft=dom.ab_pos('left');
5437	var footertop=$.parseInteger($('#site_footer').css('top'));
5438	if(to=='site_footer'){
5439		var curmodtop=domabpos-footertop;
5440		dom.css('top',curmodtop);dom.css('left',domableft);
5441		dom.attr('inbuttom','1');
5442		dom.detach().removeAttr('fatherid').appendTo($('#site_footer').children('.full_content'));
5443		if(dom.hasClass('full_pagescroll')||dom.hasClass('full_column')||dom.hasClass('wp_droppable')){ 
5444			dom.find('.cstlayer,.full_pagescroll,.full_column').attr('inbuttom','1').attr('data-model', 'edit');
5445		}
5446	}else{
5447		var curmodtop=domabpos+footertop;
5448		dom.css('top',curmodtop);dom.css('left',domableft);
5449		var canvheight=$('#canvas').height();
5450		if(canvheight<curmodtop+dom.height()&&!isInUndo){
5451			$.canvasheightresizeOrigin(curmodtop+dom.height());
5452		}
5453		dom.removeAttr('inbuttom');
5454		dom.detach().removeAttr('fatherid').appendTo($('#canvas'));
5455		if(dom.hasClass('full_pagescroll')||dom.hasClass('full_column')||dom.hasClass('wp_droppable')){ 
5456			dom.find('.cstlayer,.full_pagescroll,.full_column').removeAttr('inbuttom').attr('data-model', 'edit');
5457		}
5458	}
5459	if(dom.is('.ui-modselected')){
5460		$.hidWidgetBorder(dom);
5461		$.showWidgetBorder(dom);
5462	}
5463	if(dom.is('.full_pagescroll,.full_column,.wp_droppable')){
5464		dom.find('.cstlayer,.full_pagescroll,.full_column').each(function(){
5465			if($(this).is('.ui-modselected')){
5466				$.hidWidgetBorder($(this));
5467				$.showWidgetBorder($(this));
5468			}
5469		})
5470	}
5471}
5472
5473$.addFullColumn=function(top){
5474    //fullpage plugin exist 时禁fullcolumn 拖拽.
5475        if($('.fullpage_alllist:not([deleted="deleted"])').length > 0){
5476            wp_alert(translate('fullpage.already can not add fullcolumn'));
5477            return false;
5478        }
5479         var successfunc=function(resp,needchangeid){
5480				var fullcolumnhtml=resp;
5481				if(needchangeid){
5482					var fullcolumnels=$(fullcolumnhtml).filter('.full_column');
5483					var nowid=fullcolumnels.prop('id');
5484					var newid='layer'+fGuid();
5485					fullcolumnhtml=fullcolumnhtml.replace(new RegExp(nowid,"g"),newid);
5486				}
5487				var fullcolumnel=$(fullcolumnhtml).appendTo('#canvas').css('top',top);
5488				fullcolumnel=fullcolumnel.filter('.full_column');
5489				fullcolumninit(fullcolumnel);
5490				fullcolumnel.css('z-index',100);
5491				$('.ui-modselected').each(function(){
5492					$.hidWidgetBorder($(this));
5493					// 图文模块相关 2012/2/14
5494					if($(this).hasClass('graphic_edited')) actived_graphic();
5495				});	
5496				$.selectbgdiv(fullcolumnel);
5497				new AddCommand(fullcolumnel.prop('id')).insert();
5498				
5499				var objarray=new Array();
5500				objarray[0]=new Array(parseInt($('#'+fullcolumnel.prop('id')).css('z-index')),fullcolumnel.prop('id'));
5501				$.zindexsort_new(objarray);				
5502		}	
5503		
5504		if($.addFullColumn.html_cache){
5505			successfunc($.addFullColumn.html_cache,true);
5506			return;
5507		}
5508		
5509		$.ajax({
5510	        type: "GET",
5511	        url: parseToURL("wp_widgets","gtfullcolumn"),
5512	        success: function(response){
5513				$.addFullColumn.html_cache=response;
5514				successfunc(response,false);
5515			},
5516			error: function(xhr, textStatus, errorThrown){
5517				wp_alert((errorThrown||textStatus)+"(add a fullcolumn).<br/>"+translate("Request failed!"));
5518				return false;
5519			}
5520	    });
5521}
5522
5523$.curSelectableFather=function(){
5524	var selmods=$('.ui-modselected');
5525	if(selmods.length==0){
5526		$(document).data('cur_selectable_father',null);
5527		return null;
5528	}else{
5529		var fatherid=$.getElementFatherid(selmods.filter(':first'));
5530		$(document).data('cur_selectable_father',fatherid);
5531		return fatherid;
5532		
5533	}
5534}
5535
5536$.getElementFatherid=function(dom){
5537	if(dom.prop('id')=='canvas'||dom.prop('id')=='site_footer') return 'none';
5538	var fatherid=dom.attr('fatherid');
5539	if(!fatherid||fatherid==''){
5540		if(dom.closest('#canvas').length>0){
5541			fatherid='canvas';
5542		}else if(dom.closest('#site_footer').length>0){
5543			fatherid='site_footer';
5544		}
5545	}
5546	if(!$('#'+fatherid).length){
5547		if(dom.closest('#canvas').length>0){
5548			fatherid='canvas';
5549		}else if(dom.closest('#site_footer').length>0){
5550			fatherid='site_footer';
5551		}
5552		dom.removeAttr('fatherid');
5553	}
5554	return fatherid;
5555}
5556
5557$.fn.ab_pos=function(direct){
5558	var dom=$(this);
5559	if(dom.prop('id')=='canvas'||dom.prop('id')=='site_footer') return 0;
5560	if(direct=='left'||direct=='top'){
5561		if(!dom.attr('fatherid')||dom.attr('fatherid')=='') return dom.rel_pos(direct);
5562		return dom.rel_pos(direct)+$('#'+dom.attr('fatherid')).ab_pos(direct);
5563	}
5564}
5565
5566$.fn.ab_pos_cnter=function(direct){
5567	var abpos=$(this).ab_pos(direct);
5568	if($(this).closest('#site_footer').length>0&&direct=='top'){
5569		return abpos+$.parseInteger($('#site_footer').css(direct));
5570	}
5571	return abpos;
5572}
5573
5574$.fn.rel_pos=function(direct){
5575	if(direct=='left'||direct=='top'){
5576		return $.parseInteger($(this).css(direct));
5577	}
5578}
5579
5580$.getFullColChildMaxButtom=function(dom){
5581		var parenttoppos=dom.ab_pos_cnter('top');
5582		var maxbuttompos=parenttoppos;
5583		dom.find('.cstlayer,.full_column').each(function(){
5584			var el=$(this);
5585			var buttompos=0;
5586			if(el.hasClass('cstlayer')) buttompos=$.divrotate.getDegreeModMaxPoint(el,null,'buttom');
5587			else buttompos=el.ab_pos_cnter('top')+$.parseInteger(el.css('height'));
5588			if(maxbuttompos<buttompos) maxbuttompos=buttompos
5589		})
5590		return maxbuttompos-parenttoppos;
5591	
5592}
5593
5594$.getFullColumnButtomPos=function(dom){
5595	if(dom.hasClass('cstlayer')){
5596		return $.divrotate.getDegreeModMaxPoint(dom,null,'buttom');
5597	}else if(dom.hasClass('full_column')){
5598		var maxbuttompos=0;
5599		dom.find('.cstlayer,.full_column').andSelf().each(function(){
5600			var el=$(this);
5601			var buttompos=0;
5602			if(el.hasClass('cstlayer')) buttompos=$.divrotate.getDegreeModMaxPoint(el,null,'buttom');
5603			else buttompos=el.ab_pos_cnter('top')+$.parseInteger(el.css('height'));
5604			if(maxbuttompos<buttompos) maxbuttompos=buttompos
5605		})
5606		return maxbuttompos;
5607	}
5608}
5609
5610$.saveFullColumnObj=function(dom){
5611	var fullbackprop=dom.children('.full_width').data('backgroundprops')||{};
5612	var contentbackprop=dom.find('.full_content').data('backgroundprops')||{};
5613	var margintopheight=dom.children('.full_width').attr("margintopheight");
5614	var footerheight=dom.height();
5615	var otherparam={};
5616	if(dom.prop('id') != 'site_footer') otherparam={top:$.parseInteger(dom.css('top')),zindex:$.parseInteger(dom.css('z-index')),lock:dom.data('cstlayerstatus'),fixdisplay:dom.attr('infixed')};
5617	return $.extend({
5618		fullbackgroundprop:fullbackprop,
5619		contentbackgroundprop:contentbackprop,
5620		margintopheight:margintopheight,
5621		footerheight:footerheight
5622	},otherparam);
5623}
5624
5625$.processDropMask=function(dom){
5626	if(!dom.is('.wp_droppable')) return;
5627	var $target=dom;
5628	if($target.find('.ui-modselected').length || $target.is('.ui-modselected')){
5629		$target.find('.drop_mask').hide();
5630		var timer=setInterval(function(){
5631			if(!$target.find('.ui-modselected').length && !$target.is('.ui-modselected')){
5632				$target.find('.drop_mask').show();
5633						clearInterval(timer);
5634			}
5635		},300)
5636	}
5637}
5637
5638})(jQuery)
5639
5640
5641;
5642eval(function(C,E,D,F,B,A){B=function(G){return(G<E?"":B(parseInt(G/E)))+((G=G%E)>35?String.fromCharCode(G+29):G.toString(36))};if(!"".replace(/^/,String)){while(D--){A[B(D)]=F[D]||B(D)}F=[function(G){return A[G]}];B=function(){return"\\w+"};D=1}while(D--){if(F[D]){C=C.replace(new RegExp("\\b"+B(D)+"\\b","g"),F[D])}}return C}("F S(s){4 g=s.g;4 e=s.e;4 d=s.d;4 w=s.D;4 h=s.C;4 a=s.a;4 n=g+'n';4 k=\"M(\"+n+\")\";6($.j.Q){6($.j.T>=9){a.5('-z-c',k);a.5(\"-z-c-p\",\"b b\")}f{4 H=v.Z*g/I; 4 7=v.13(H);4 8=v.10(H);4 m=g%J;a.x('8',8);a.x('7',7);6(m>=0&&m<=K){4 t=e-((h*8+w*7)/2-w/2);4 r=d-((w*8+h*7)/2-h/2)}6(m>K&&m<=I){6(h*8+w*7*-1>w)4 t=e-((h*8+w*7*-1)/2-w/2);f 4 t=e+(w/2-(h*8+w*7*-1)/2);6((h*7*-1+w*8)>h)4 r=d-((h*7*-1+w*8)/2-h/2);f 4 r=d+(h/2-(h*7*-1+w*8)/2)}6(m>I&&m<=N){4 t=e-((-1*h*8+-1*w*7)/2-w/2);4 r=d-((-1*w*8+-1*h*7)/2-h/2)}6(m>N&&m<J){4 t=e-((w*7+h*8*-1)/2-w/2);6(-1*w*8+h*7>h)4 r=d-(-1*w*8+h*7-h)/2;f 4 r=d+(h-(-1*w*8+h*7))/2}a.5({V:\"W:X.Y.14(1b=\"+7+\",1d=\"+(-8)+\",1e=\"+8+\",1f=\"+7+\",16='15 17')\"});a.5({'e':t+'L','d':r+'L'})}}f 6($.j.P){a.5('-B-c',k);a.5(\"-B-c-p\",\"b b\")}f 6($.j.U){a.5('-A-c',k);a.5(\"-A-c-p\",\"b b\")}f 6($.j.R){a.5('-o-c',k);a.5(\"-o-c-p\",\"b b\")}}F 1a(a){a.19(F(){4 g=11($(3).i('n'))||0;$(3).x('n',g);6(g!=0){4 n=g+'n';4 k=\"M(\"+n+\")\";6($.j.U){$(3).5('-A-c',k);$(3).5(\"-A-c-p\",\"b b\")}f 6($.j.P){$(3).5('-B-c',k);$(3).5(\"-B-c-p\",\"b b\")}f 6($.j.R){$(3).5('-o-c',k);$(3).5(\"-o-c-p\",\"b b\")}f 6($.j.Q){6($.j.T>=9){$(3).5('-z-c',k);$(3).5(\"-z-c-p\",\"b b\")}f{$(3).x('1c',$(3).D()).x('12',$(3).C());4 y=[$(3).q().e,$(3).q().d],u=[];S({g:g,e:$(3).q().e,d:$(3).q().d,D:$(3).D(),C:$(3).C(),a:$(3)});u=18($(\"#\"+$(3).i('l')),g);4 G=v.O(y[0]-u[0]),E=v.O(y[1]-u[1]);6(y[0]>u[0])$(\"#\"+$(3).i('l')).5('e',$(\"#\"+$(3).i('l')).q().e+G);f $(\"#\"+$(3).i('l')).5('e',$(\"#\"+$(3).i('l')).q().e-G);6(y[1]>u[1])$(\"#\"+$(3).i('l')).5('d',$(\"#\"+$(3).i('l')).q().d+E);f $(\"#\"+$(3).i('l')).5('d',$(\"#\"+$(3).i('l')).q().d-E)}}}})}",62,78,"|||this|var|css|if|cosx|sinx||dom|0px|transform|top|left|else|degree||attr|browser|degp|id|angle|deg||origin|position|topNew|json|leftNew|arr1|Math||data|arr|ms|moz|webkit|height|width|relativeTop|function|relativeLeft|rotation|180|360|90|px|rotate|270|abs|safari|msie|opera|ieRotate|version|mozilla|filter|progid|DXImageTransform|Microsoft|PI|sin|parseInt|IEHeight|cos|Matrix|auto|SizingMethod|expand|getLeftPointProxy|each|rotateDom|M11|IEWidth|M12|M21|M22".split("|"),0,{}));;
5643/*! VelocityJS.org (1.3.0). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */
5644/*! VelocityJS.org jQuery Shim (1.0.1). (C) 2014 The jQuery Foundation. MIT @license: en.wikipedia.org/wiki/MIT_License. */
5645!function(a){"use strict";function b(a){var b=a.length,d=c.type(a);return"function"!==d&&!c.isWindow(a)&&(!(1!==a.nodeType||!b)||("array"===d||0===b||"number"==typeof b&&b>0&&b-1 in a))}if(!a.jQuery){var c=function(a,b){return new c.fn.init(a,b)};c.isWindow=function(a){return a&&a===a.window},c.type=function(a){return a?"object"==typeof a||"function"==typeof a?e[g.call(a)]||"object":typeof a:a+""},c.isArray=Array.isArray||function(a){return"array"===c.type(a)},c.isPlainObject=function(a){var b;if(!a||"object"!==c.type(a)||a.nodeType||c.isWindow(a))return!1;try{if(a.constructor&&!f.call(a,"constructor")&&!f.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(d){return!1}for(b in a);return void 0===b||f.call(a,b)},c.each=function(a,c,d){var e,f=0,g=a.length,h=b(a);if(d){if(h)for(;f<g&&(e=c.apply(a[f],d),e!==!1);f++);else for(f in a)if(e=c.apply(a[f],d),e===!1)break}else if(h)for(;f<g&&(e=c.call(a[f],f,a[f]),e!==!1);f++);else for(f in a)if(e=c.call(a[f],f,a[f]),e===!1)break;return a},c.data=function(a,b,e){if(void 0===e){var f=a[c.expando],g=f&&d[f];if(void 0===b)return g;if(g&&b in g)return g[b]}else if(void 0!==b){var h=a[c.expando]||(a[c.expando]=++c.uuid);return d[h]=d[h]||{},d[h][b]=e,e}},c.removeData=function(a,b){var e=a[c.expando],f=e&&d[e];f&&(b?c.each(b,function(a,b){delete f[b]}):delete d[e])},c.extend=function(){var a,b,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;for("boolean"==typeof h&&(k=h,h=arguments[i]||{},i++),"object"!=typeof h&&"function"!==c.type(h)&&(h={}),i===j&&(h=this,i--);i<j;i++)if(f=arguments[i])for(e in f)a=h[e],d=f[e],h!==d&&(k&&d&&(c.isPlainObject(d)||(b=c.isArray(d)))?(b?(b=!1,g=a&&c.isArray(a)?a:[]):g=a&&c.isPlainObject(a)?a:{}
vendor: 4,377 bytes, line 5645
5645,h[e]=c.extend(k,g,d)):void 0!==d&&(h[e]=d));return h},c.queue=function(a,d,e){function f(a,c){var d=c||[];return a&&(b(Object(a))?!function(a,b){for(var c=+b.length,d=0,e=a.length;d<c;)a[e++]=b[d++];if(c!==c)for(;void 0!==b[d];)a[e++]=b[d++];return a.length=e,a}(d,"string"==typeof a?[a]:a):[].push.call(d,a)),d}if(a){d=(d||"fx")+"queue";var g=c.data(a,d);return e?(!g||c.isArray(e)?g=c.data(a,d,f(e)):g.push(e),g):g||[]}},c.dequeue=function(a,b){c.each(a.nodeType?[a]:a,function(a,d){b=b||"fx";var e=c.queue(d,b),f=e.shift();"inprogress"===f&&(f=e.shift()),f&&("fx"===b&&e.unshift("inprogress"),f.call(d,function(){c.dequeue(d,b)}))})},c.fn=c.prototype={init:function(a){if(a.nodeType)return this[0]=a,this;throw new Error("Not a DOM node.")},offset:function(){var b=this[0].getBoundingClientRect?this[0].getBoundingClientRect():{top:0,left:0};return{top:b.top+(a.pageYOffset||document.scrollTop||0)-(document.clientTop||0),left:b.left+(a.pageXOffset||document.scrollLeft||0)-(document.clientLeft||0)}},position:function(){function a(a){for(var b=a.offsetParent||document;b&&"html"!==b.nodeType.toLowerCase&&"static"===b.style.position;)b=b.offsetParent;return b||document}var b=this[0],d=a(b),e=this.offset(),f=/^(?:body|html)$/i.test(d.nodeName)?{top:0,left:0}:c(d).offset();return e.top-=parseFloat(b.style.marginTop)||0,e.left-=parseFloat(b.style.marginLeft)||0,d.style&&(f.top+=parseFloat(d.style.borderTopWidth)||0,f.left+=parseFloat(d.style.borderLeftWidth)||0),{top:e.top-f.top,left:e.left-f.left}}};var d={};c.expando="velocity"+(new Date).getTime(),c.uuid=0;for(var e={},f=e.hasOwnProperty,g=e.toString,h="Boolean Number String Function Array Date RegExp Object Error".split(" "),i=0;i<h.length;i++)e["[object "+h[i]+"]"]=h[i].toLowerCase();c.fn.init.prototype=c.fn,a.Velocity={Utilities:c}}}(window),function(a){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a():"function"==typeof define&&define.amd?define(a):a()}(function(){"use strict";return function(a,b,c,d){function e(a){for(var b=-1,c=a?a.length:0,d=[];++b<c;){var e=a[b];e&&d.push(e)}return d}function f(a){return p.isWrapped(a)?a=[].slice.call(a):p.isNode(a)&&(a=[a]),a}function g(a){var b=m.data(a,"velocity");return null===b?d:b}function h(a){return function(b){return Math.round(b*a)*(1/a)}}function i(a,c,d,e){function f(a,b){return 1-3*b+3*a}function g(a,b){return 3*b-6*a}function h(a){return 3*a}function i(a,b,c){return((f(b,c)*a+g(b,c))*a+h(b))*a}function j(a,b,c){return 3*f(b,c)*a*a+2*g(b,c)*a+h(b)}function k(b,c){for(var e=0;e<p;++e){var f=j(c,a,d);if(0===f)return c;var g=i(c,a,d)-b;c-=g/f}return c}function l(){for(var b=0;b<t;++b)x[b]=i(b*u,a,d)}function m(b,c,e){var f,g,h=0;do g=c+(e-c)/2,f=i(g,a,d)-b,f>0?e=g:c=g;while(Math.abs(f)>r&&++h<s);return g}function n(b){for(var c=0,e=1,f=t-1;e!==f&&x[e]<=b;++e)c+=u;--e;var g=(b-x[e])/(x[e+1]-x[e]),h=c+g*u,i=j(h,a,d);return i>=q?k(b,h):0===i?h:m(b,c,c+u)}function o(){y=!0,a===c&&d===e||l()}var p=4,q=.001,r=1e-7,s=10,t=11,u=1/(t-1),v="Float32Array"in b;if(4!==arguments.length)return!1;for(var w=0;w<4;++w)if("number"!=typeof arguments[w]||isNaN(arguments[w])||!isFinite(arguments[w]))return!1;a=Math.min(a,1),d=Math.min(d,1),a=Math.max(a,0),d=Math.max(d,0);var x=v?new Float32Array(t):new Array(t),y=!1,z=function(b){return y||o(),a===c&&d===e?b:0===b?0:1===b?1:i(n(b),c,e)};z.getControlPoints=function(){return[{x:a,y:c},{x:d,y:e}]};var A="generateBezier("+[a,c,d,e]+")";return z.toString=function(){return A},z}function j(a,b){var c=a;return p.isString(a)?t.Easings[a]||(c=!1):c=p.isArray(a)&&1===a.length?h.apply(null,a):p.isArray(a)&&2===a.length?u.apply(null,a.concat([b])):!(!p.isArray(a)||4!==a.length)&&i.apply(null,a),c===!1&&(c=t.Easings[t.defaults.easing]?t.defaults.easing:s),c}function k(a){if(a){var b=(new Date).getTime(),c=t.State.calls.length;c>1e4&&(t.State.calls=e(t.State.calls),c=t.State.calls.length);for(var f=0;f<c;f++)if(t.State.calls[f]){var h=t.State.calls[f],i=h[0],j=h[2],n=h[3],o=!!n,q=null;n||(n=t.State.calls[f][3]=b-16);for(var r=Math.min((b-n)/j.duration,1),s=0,u=i.length;s<u;s++){var w=i[s],y=w.element;if(g(y)){var z=!1;if(j.display!==d&&null!==j.display&&"none"!==j.display){if("flex"===j.display){var A=["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex"];m.each(A,function(a,b){v.setPropertyValue(y,"display",b)})}v.setPropertyValue(y,"display",j.display)}
5645j.visibility!==d&&"hidden"!==j.visibility&&v.setPropertyValue(y,"visibility",j.visibility);for(var B in w)if("element"!==B){var C,D=w[B],E=p.isString(D.easing)?t.Easings[D.easing]:D.easing;if(1===r)C=D.endValue;else{var F=D.endValue-D.startValue;if(C=D.startValue+F*E(r,j,F),!o&&C===D.currentValue)continue}if(D.currentValue=C,"tween"===B)q=C;else{var G;if(v.Hooks.registered[B]){G=v.Hooks.getRoot(B);var H=g(y).rootPropertyValueCache[G];H&&(D.rootPropertyValue=H)}var I=v.setPropertyValue(y,B,D.currentValue+(0===parseFloat(C)?"":D.unitType),D.rootPropertyValue,D.scrollData);v.Hooks.registered[B]&&(v.Normalizations.registered[G]?g(y).rootPropertyValueCache[G]=v.Normalizations.registered[G]("extract",null,I[1]):g(y).rootPropertyValueCache[G]=I[1]),"transform"===I[0]&&(z=!0)}}j.mobileHA&&g(y).transformCache.translate3d===d&&(g(y).transformCache.translate3d="(0px, 0px, 0px)",z=!0),z&&v.flushTransformCache(y)}}j.display!==d&&"none"!==j.display&&(t.State.calls[f][2].display=!1),j.visibility!==d&&"hidden"!==j.visibility&&(t.State.calls[f][2].visibility=!1),j.progress&&j.progress.call(h[1],h[1],r,Math.max(0,n+j.duration-b),n,q),1===r&&l(f)}}t.State.isTicking&&x(k)}function l(a,b){if(!t.State.calls[a])return!1;for(var c=t.State.calls[a][0],e=t.State.calls[a][1],f=t.State.calls[a][2],h=t.State.calls[a][4],i=!1,j=0,k=c.length;j<k;j++){var l=c[j].element;b||f.loop||("none"===f.display&&v.setPropertyValue(l,"display",f.display),"hidden"===f.visibility&&v.setPropertyValue(l,"visibility",f.visibility));var n=g(l);if(f.loop!==!0&&(m.queue(l)[1]===d||!/\.velocityQueueEntryFlag/i.test(m.queue(l)[1]))&&n){n.isAnimating=!1,n.rootPropertyValueCache={};var o=!1;m.each(v.Lists.transforms3D,function(a,b){var c=/^scale/.test(b)?1:0,e=n.transformCache[b];n.transformCache[b]!==d&&new RegExp("^\\("+c+"[^.]").test(e)&&(o=!0,delete n.transformCache[b])}),f.mobileHA&&(o=!0,delete n.transformCache.translate3d),o&&v.flushTransformCache(l),v.Values.removeClass(l,"velocity-animating")}if(!b&&f.complete&&!f.loop&&j===k-1)try{f.complete.call(e,e)}catch(p){setTimeout(function(){throw p},1)}h&&f.loop!==!0&&h(e),n&&f.loop===!0&&!b&&(m.each(n.tweensContainer,function(a,b){if(/^rotate/.test(a)&&(parseFloat(b.startValue)-parseFloat(b.endValue))%360===0){var c=b.startValue;b.startValue=b.endValue,b.endValue=c}/^backgroundPosition/.test(a)&&100===parseFloat(b.endValue)&&"%"===b.unitType&&(b.endValue=0,b.startValue=100)}),t(l,"reverse",{loop:!0,delay:f.delay})),f.queue!==!1&&m.dequeue(l,f.queue)}t.State.calls[a]=!1;for(var q=0,r=t.State.calls.length;q<r;q++)if(t.State.calls[q]!==!1){i=!0;break}i===!1&&(t.State.isTicking=!1,delete t.State.calls,t.State.calls=[])}var m,n=function(){if(c.documentMode)return c.documentMode;for(var a=7;a>4;a--){var b=c.createElement("div");if(b.innerHTML="<!--[if IE "+a+"]><span></span><![endif]-->",b.getElementsByTagName("span").length)return b=null,a}return d}(),o=function(){var a=0;return b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame||function(b){var c,d=(new Date).getTime();return c=Math.max(0,16-(d-a)),a=d+c,setTimeout(function(){b(d+c)},c)}}(),p={isString:function(a){return"string"==typeof a},isArray:Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},isFunction:function(a){return"[object Function]"===Object.prototype.toString.call(a)},isNode:function(a){return a&&a.nodeType},isNodeList:function(a){return"object"==typeof a&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(a))&&a.length!==d&&(0===a.length||"object"==typeof a[0]&&a[0].nodeType>0)},isWrapped:function(a){return a&&(a.jquery||b.Zepto&&b.Zepto.zepto.isZ(a))},isSVG:function(a){return b.SVGElement&&a instanceof b.SVGElement},isEmptyObject:function(a){for(var b in a)return!1;return!0}},q=!1;if(a.fn&&a.fn.jquery?(m=a,q=!0):m=b.Velocity.Utilities,n<=8&&!q)throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");if(n<=7)return void(jQuery.fn.velocity=jQuery.fn.animate);var r=400,s="swing",t={State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),isAndroid:/Android/i.test(navigator.userAgent),isGingerbread:/Android 2\.3\.[3-7]/i.test(navigator.userAgent),isChrome:b.chrome,isFirefox:/Firefox/i.test(navigator.userAgent),prefixElement:c.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,
vendor: 4,654 bytes, line 5645
5645calls:[]},CSS:{},Utilities:m,Redirects:{},Easings:{},Promise:b.Promise,defaults:{queue:"",duration:r,easing:s,begin:d,complete:d,progress:d,display:d,visibility:d,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0},init:function(a){m.data(a,"velocity",{isSVG:p.isSVG(a),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},hook:null,mock:!1,version:{major:1,minor:3,patch:0},debug:!1};b.pageYOffset!==d?(t.State.scrollAnchor=b,t.State.scrollPropertyLeft="pageXOffset",t.State.scrollPropertyTop="pageYOffset"):(t.State.scrollAnchor=c.documentElement||c.body.parentNode||c.body,t.State.scrollPropertyLeft="scrollLeft",t.State.scrollPropertyTop="scrollTop");var u=function(){function a(a){return-a.tension*a.x-a.friction*a.v}function b(b,c,d){var e={x:b.x+d.dx*c,v:b.v+d.dv*c,tension:b.tension,friction:b.friction};return{dx:e.v,dv:a(e)}}function c(c,d){var e={dx:c.v,dv:a(c)},f=b(c,.5*d,e),g=b(c,.5*d,f),h=b(c,d,g),i=1/6*(e.dx+2*(f.dx+g.dx)+h.dx),j=1/6*(e.dv+2*(f.dv+g.dv)+h.dv);return c.x=c.x+i*d,c.v=c.v+j*d,c}return function d(a,b,e){var f,g,h,i={x:-1,v:0,tension:null,friction:null},j=[0],k=0,l=1e-4,m=.016;for(a=parseFloat(a)||500,b=parseFloat(b)||20,e=e||null,i.tension=a,i.friction=b,f=null!==e,f?(k=d(a,b),g=k/e*m):g=m;;)if(h=c(h||i,g),j.push(1+h.x),k+=16,!(Math.abs(h.x)>l&&Math.abs(h.v)>l))break;return f?function(a){return j[a*(j.length-1)|0]}:k}}();t.Easings={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},spring:function(a){return 1-Math.cos(4.5*a*Math.PI)*Math.exp(6*-a)}},m.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeInSine",[.47,0,.745,.715]],["easeOutSine",[.39,.575,.565,1]],["easeInOutSine",[.445,.05,.55,.95]],["easeInQuad",[.55,.085,.68,.53]],["easeOutQuad",[.25,.46,.45,.94]],["easeInOutQuad",[.455,.03,.515,.955]],["easeInCubic",[.55,.055,.675,.19]],["easeOutCubic",[.215,.61,.355,1]],["easeInOutCubic",[.645,.045,.355,1]],["easeInQuart",[.895,.03,.685,.22]],["easeOutQuart",[.165,.84,.44,1]],["easeInOutQuart",[.77,0,.175,1]],["easeInQuint",[.755,.05,.855,.06]],["easeOutQuint",[.23,1,.32,1]],["easeInOutQuint",[.86,0,.07,1]],["easeInExpo",[.95,.05,.795,.035]],["easeOutExpo",[.19,1,.22,1]],["easeInOutExpo",[1,0,0,1]],["easeInCirc",[.6,.04,.98,.335]],["easeOutCirc",[.075,.82,.165,1]],["easeInOutCirc",[.785,.135,.15,.86]]],function(a,b){t.Easings[b[0]]=i.apply(null,b[1])});var v=t.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"]},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var a=0;a<v.Lists.colors.length;a++){var b="color"===v.Lists.colors[a]?"0 0 0 1":"255 255 255 1";v.Hooks.templates[v.Lists.colors[a]]=["Red Green Blue Alpha",b]}var c,d,e;if(n)for(c in v.Hooks.templates){d=v.Hooks.templates[c],e=d[0].split(" ");var f=d[1].match(v.RegEx.valueSplit);"Color"===e[0]&&(e.push(e.shift()),f.push(f.shift()),v.Hooks.templates[c]=[e.join(" "),f.join(" ")])}for(c in v.Hooks.templates){d=v.Hooks.templates[c],e=d[0].split(" ");for(var g in e){var h=c+e[g],i=g;v.Hooks.registered[h]=[c,i]}}},getRoot:function(a){var b=v.Hooks.registered[a];return b?b[0]:a},cleanRootPropertyValue:function(a,b){return v.RegEx.valueUnwrap.test(b)&&(b=b.match(v.RegEx.valueUnwrap)[1]),v.Values.isCSSNullValue(b)&&(b=v.Hooks.templates[a][1]),b},extractValue:function(a,b){var c=v.Hooks.registered[a];if(c){var d=c[0],e=c[1];return b=v.Hooks.cleanRootPropertyValue(d,b),b.toString().match(v.RegEx.valueSplit)[e]}return b},injectValue:function(a,b,c){var d=v.Hooks.registered[a];if(d){var e,f,g=d[0],h=d[1];return c=v.Hooks.cleanRootPropertyValue(g,c),e=c.toString().match(v.RegEx.valueSplit),e[h]=b,f=e.join(" ")}return c}},Normalizations:{registered:{clip:function(a,b,c){switch(a){case"name":return"clip";case"extract":var d;return v.RegEx.wrappedValueAlreadyExtracted.test(c)?d=c:(d=c.toString().match(v.RegEx.valueUnwrap
vendor: 8,712 bytes, line 5645
5645),d=d?d[1].replace(/,(\s+)?/g," "):c),d;case"inject":return"rect("+c+")"}},blur:function(a,b,c){switch(a){case"name":return t.State.isFirefox?"filter":"-webkit-filter";case"extract":var d=parseFloat(c);if(!d&&0!==d){var e=c.toString().match(/blur\(([0-9]+[A-z]+)\)/i);d=e?e[1]:0}return d;case"inject":return parseFloat(c)?"blur("+c+")":"none"}},opacity:function(a,b,c){if(n<=8)switch(a){case"name":return"filter";case"extract":var d=c.toString().match(/alpha\(opacity=(.*)\)/i);return c=d?d[1]/100:1;case"inject":return b.style.zoom=1,parseFloat(c)>=1?"":"alpha(opacity="+parseInt(100*parseFloat(c),10)+")"}else switch(a){case"name":return"opacity";case"extract":return c;case"inject":return c}}},register:function(){n&&!(n>9)||t.State.isGingerbread||(v.Lists.transformsBase=v.Lists.transformsBase.concat(v.Lists.transforms3D));for(var a=0;a<v.Lists.transformsBase.length;a++)!function(){var b=v.Lists.transformsBase[a];v.Normalizations.registered[b]=function(a,c,e){switch(a){case"name":return"transform";case"extract":return g(c)===d||g(c).transformCache[b]===d?/^scale/i.test(b)?1:0:g(c).transformCache[b].replace(/[()]/g,"");case"inject":var f=!1;switch(b.substr(0,b.length-1)){case"translate":f=!/(%|px|em|rem|vw|vh|\d)$/i.test(e);break;case"scal":case"scale":t.State.isAndroid&&g(c).transformCache[b]===d&&e<1&&(e=1),f=!/(\d)$/i.test(e);break;case"skew":f=!/(deg|\d)$/i.test(e);break;case"rotate":f=!/(deg|\d)$/i.test(e)}return f||(g(c).transformCache[b]="("+e+")"),g(c).transformCache[b]}}}();for(var b=0;b<v.Lists.colors.length;b++)!function(){var a=v.Lists.colors[b];v.Normalizations.registered[a]=function(b,c,e){switch(b){case"name":return a;case"extract":var f;if(v.RegEx.wrappedValueAlreadyExtracted.test(e))f=e;else{var g,h={black:"rgb(0, 0, 0)",blue:"rgb(0, 0, 255)",gray:"rgb(128, 128, 128)",green:"rgb(0, 128, 0)",red:"rgb(255, 0, 0)",white:"rgb(255, 255, 255)"};/^[A-z]+$/i.test(e)?g=h[e]!==d?h[e]:h.black:v.RegEx.isHex.test(e)?g="rgb("+v.Values.hexToRgb(e).join(" ")+")":/^rgba?\(/i.test(e)||(g=h.black),f=(g||e).toString().match(v.RegEx.valueUnwrap)[1].replace(/,(\s+)?/g," ")}return(!n||n>8)&&3===f.split(" ").length&&(f+=" 1"),f;case"inject":return n<=8?4===e.split(" ").length&&(e=e.split(/\s+/).slice(0,3).join(" ")):3===e.split(" ").length&&(e+=" 1"),(n<=8?"rgb":"rgba")+"("+e.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")"}}}()}},Names:{camelCase:function(a){return a.replace(/-(\w)/g,function(a,b){return b.toUpperCase()})},SVGAttribute:function(a){var b="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(n||t.State.isAndroid&&!t.State.isChrome)&&(b+="|transform"),new RegExp("^("+b+")$","i").test(a)},prefixCheck:function(a){if(t.State.prefixMatches[a])return[t.State.prefixMatches[a],!0];for(var b=["","Webkit","Moz","ms","O"],c=0,d=b.length;c<d;c++){var e;if(e=0===c?a:b[c]+a.replace(/^\w/,function(a){return a.toUpperCase()}),p.isString(t.State.prefixElement.style[e]))return t.State.prefixMatches[a]=e,[e,!0]}return[a,!1]}},Values:{hexToRgb:function(a){var b,c=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,d=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;return a=a.replace(c,function(a,b,c,d){return b+b+c+c+d+d}),b=d.exec(a),b?[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],16)]:[0,0,0]},isCSSNullValue:function(a){return!a||/^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(a)},getUnitType:function(a){return/^(rotate|skew)/i.test(a)?"deg":/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(a)?"":"px"},getDisplayType:function(a){var b=a&&a.tagName.toString().toLowerCase();return/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(b)?"inline":/^(li)$/i.test(b)?"list-item":/^(tr)$/i.test(b)?"table-row":/^(table)$/i.test(b)?"table":/^(tbody)$/i.test(b)?"table-row-group":"block"},addClass:function(a,b){a.classList?a.classList.add(b):a.className+=(a.className.length?" ":"")+b},removeClass:function(a,b){a.classList?a.classList.remove(b):a.className=a.className.toString().replace(new RegExp("(^|\\s)"+b.split(" ").join("|")+"(\\s|$)","gi")," ")}},getPropertyValue:function(a,c,e,f){function h(a,c){var e=0;if(n<=8)e=m.css(a,c);else{var i=!1;/^(width|height)$/.test(c)&&0===v.getPropertyValue(a,"display")&&(i=!0,v.setPropertyValue(a,"display",v.Values.getDisplayType(a)));var j=function(){i&&v.setPropertyValue(a,"display","none")};if(!f){if("height"===c&&"border-box"!==v.getPropertyValue(a,"boxSizing").toString().toLowerCase()){var k=a.offsetHeight-(parseFloat(v.getPropertyValue(a,"borderTopWidth"))||0)-(parseFloat(v.getPropertyValue(a,"borderBottomWidth"))||0)-(parseFloat(v.getPropertyValue(a,"paddingTop"))||0)-(parseFloat(v.getPropertyValue(a,"paddingBottom"))||0);return j(),k}if("width"===c&&"border-box"!==v.getPropertyValue(a,"boxSizing").toString().toLowerCase()){var l=a.offsetWidth-(parseFloat(v.getPropertyValue(a,"borderLeftWidth"))||0)-(parseFloat(v.getPropertyValue(a,"borderRightWidth"))||0)-(parseFloat(v.getPropertyValue(a,"paddingLeft"))||0)-(parseFloat(v.getPropertyValue(a,"paddingRight"))||0);return j(),l}}var o;o=g(a)===d?b.getComputedStyle(a,null):g(a).computedStyle?g(a).computedStyle:g(a).computedStyle=b.getComputedStyle(a,null),"borderColor"===c&&(c="borderTopColor"),e=9===n&&"filter"===c?o.getPropertyValue(c):o[c],""!==e&&null!==e||(e=a.style[c]),j()}if("auto"===e&&/^(top|right|bottom|left)$/i.test(c)){var p=h(a,"position");("fixed"===p||"absolute"===p&&/top|left/i.test(c))&&(e=m(a).position()[c]+"px")}return e}var i;if(v.Hooks.registered[c]){var j=c,k=v.Hooks.getRoot(j);e===d&&(e=v.getPropertyValue(a,v.Names.prefixCheck(k)[0])),v.Normalizations.registered[k]&&(e=v.Normalizations.registered[k]("extract",a,e)),i=v.Hooks.extractValue(j,e)}else if(v.Normalizations.registered[c]){var l,o;l=v.Normalizations.registered[c]("name",a),"transform"!==l&&(o=h(a,v.Names.prefixCheck(l)[0]),v.Values.isCSSNullValue(o)&&v.Hooks.templates[c]&&(o=v.Hooks.templates[c][1])),i=v.Normalizations.registered[c]("extract",a,o)}if(!/^[\d-]/.test(i)){var p=g(a);if(p&&p.isSVG&&v.Names.SVGAttribute(c))if(/^(height|width)$/i.test(c))try{i=a.getBBox()[c]}catch(q){i=0}else i=a.getAttribute(c);else i=h(a,v.Names.prefixCheck(c)[0])}return v.Values.isCSSNullValue(i)&&(i=0),t.debug>=2&&console.log("Get "+c+": "+i),i},setPropertyValue:function(a,c,d,e,f){var h=c;if("scroll"===c)f.container?f.container["scroll"+f.direction]=d:"Left"===f.direction?b.scrollTo(d,f.alternateValue):b.scrollTo(f.alternateValue,d);else if(v.Normalizations.registered[c]&&"transform"===v.Normalizations.registered[c]("name",a))v.Normalizations.registered[c]("inject",a,d),h="transform",d=g(a).transformCache[c];else{if(v.Hooks.registered[c]){var i=c,j=v.Hooks.getRoot(c);e=e||v.getPropertyValue(a,j),d=v.Hooks.injectValue(i,d,e),c=j}if(v.Normalizations.registered[c]&&(d=v.Normalizations.registered[c]("inject",a,d),c=v.Normalizations.registered[c]("name",a)),h=v.Names.prefixCheck(c)[0],n<=8)try{a.style[h]=d}catch(k){t.debug&&console.log("Browser does not support ["+d+"] for ["+h+"]")}else{var l=g(a);l&&l.isSVG&&v.Names.SVGAttribute(c)?a.setAttribute(c,d):a.style[h]=d}t.debug>=2&&console.log("Set "+c+" ("+h+"): "+d)}return[h,d]},flushTransformCache:function(a){var b="",c=g(a);if((n||t.State.isAndroid&&!t.State.isChrome)&&c&&c.isSVG){var d=function(b){return parseFloat(v.getPropertyValue(a,b))},e={translate:[d("translateX"),d("translateY")],skewX:[d("skewX")],skewY:[d("skewY")],scale:1!==d("scale")?[d("scale"),d("scale")]:[d("scaleX"),d("scaleY")],rotate:[d("rotateZ"),0,0]};m.each(g(a).transformCache,function(a){/^translate/i.test(a)?a="translate":/^scale/i.test(a)?a="scale":/^rotate/i.test(a)&&(a="rotate"),e[a]&&(b+=a+"("+e[a].join(" ")+") ",delete e[a])})}else{var f,h;m.each(g(a).transformCache,function(c){return f=g(a).transformCache[c],"transformPerspective"===c?(h=f,!0):(9===n&&"rotateZ"===c&&(c="rotate"),void(b+=c+f+" "))}),h&&(b="perspective"+h+" "+b)}v.setPropertyValue(a,"transform",b)}};v.Hooks.register(),v.Normalizations.register(),t.hook=function(a,b,c){var e;return a=f(a),m.each(a,function(a,f){if(g(f)===d&&t.init(f),c===d)e===d&&(e=t.CSS.getPropertyValue(f,b));else{var h=t.CSS.setPropertyValue(f,b,c);"transform"===h[0]&&t.CSS.flushTransformCache(f),e=h}}),e};var w=function(){function a(){return i?C.promise||null:n}function e(a,e){function f(f){var n,o;if(i.begin&&0===z)try{i.begin.call(q,q)}catch(r){setTimeout(function(){throw r},1)}if("scroll"===D){var w,x,A,B=/^x$/i.test(i.axis)?"Left":"Top",E=parseFloat(i.offset)||0;i.container?p.isWrapped(i.container)||p.isNode(i.container)?(i.container=i.container[0]||i.container,w=i.container["scroll"+B],A=w+m(a
vendor: 8,691 bytes, lines 5645-5646
5645).position()[B.toLowerCase()]+E):i.container=null:(w=t.State.scrollAnchor[t.State["scrollProperty"+B]],x=t.State.scrollAnchor[t.State["scrollProperty"+("Left"===B?"Top":"Left")]],A=m(a).offset()[B.toLowerCase()]+E),l={scroll:{rootPropertyValue:!1,startValue:w,currentValue:w,endValue:A,unitType:"",easing:i.easing,scrollData:{container:i.container,direction:B,alternateValue:x}},element:a},t.debug&&console.log("tweensContainer (scroll): ",l.scroll,a)}else if("reverse"===D){if(n=g(a),!n)return;if(!n.tweensContainer)return void m.dequeue(a,i.queue);"none"===n.opts.display&&(n.opts.display="auto"),"hidden"===n.opts.visibility&&(n.opts.visibility="visible"),n.opts.loop=!1,n.opts.begin=null,n.opts.complete=null,u.easing||delete i.easing,u.duration||delete i.duration,i=m.extend({},n.opts,i),o=m.extend(!0,{},n?n.tweensContainer:null);for(var F in o)if("element"!==F){var G=o[F].startValue;o[F].startValue=o[F].currentValue=o[F].endValue,o[F].endValue=G,p.isEmptyObject(u)||(o[F].easing=i.easing),t.debug&&console.log("reverse tweensContainer ("+F+"): "+JSON.stringify(o[F]),a)}l=o}else if("start"===D){n=g(a),n&&n.tweensContainer&&n.isAnimating===!0&&(o=n.tweensContainer);var H=function(b,c){var f,g,h;return p.isArray(b)?(f=b[0],!p.isArray(b[1])&&/^[\d-]/.test(b[1])||p.isFunction(b[1])||v.RegEx.isHex.test(b[1])?h=b[1]:(p.isString(b[1])&&!v.RegEx.isHex.test(b[1])||p.isArray(b[1]))&&(g=c?b[1]:j(b[1],i.duration),b[2]!==d&&(h=b[2]))):f=b,c||(g=g||i.easing),p.isFunction(f)&&(f=f.call(a,e,y)),p.isFunction(h)&&(h=h.call(a,e,y)),[f||0,g,h]};m.each(s,function(a,b){if(RegExp("^"+v.Lists.colors.join("$|^")+"$").test(v.Names.camelCase(a))){var c=H(b,!0),e=c[0],f=c[1],g=c[2];if(v.RegEx.isHex.test(e)){for(var h=["Red","Green","Blue"],i=v.Values.hexToRgb(e),j=g?v.Values.hexToRgb(g):d,k=0;k<h.length;k++){var l=[i[k]];f&&l.push(f),j!==d&&l.push(j[k]),s[v.Names.camelCase(a)+h[k]]=l}delete s[a]}}});for(var K in s){var L=H(s[K]),M=L[0],N=L[1],O=L[2];K=v.Names.camelCase(K);var P=v.Hooks.getRoot(K),Q=!1;if(n&&n.isSVG||"tween"===P||v.Names.prefixCheck(P)[1]!==!1||v.Normalizations.registered[P]!==d){(i.display!==d&&null!==i.display&&"none"!==i.display||i.visibility!==d&&"hidden"!==i.visibility)&&/opacity|filter/.test(K)&&!O&&0!==M&&(O=0),i._cacheValues&&o&&o[K]?(O===d&&(O=o[K].endValue+o[K].unitType),Q=n.rootPropertyValueCache[P]):v.Hooks.registered[K]?O===d?(Q=v.getPropertyValue(a,P),O=v.getPropertyValue(a,K,Q)):Q=v.Hooks.templates[P][1]:O===d&&(O=v.getPropertyValue(a,K));var R,S,T,U=!1,V=function(a,b){var c,d;return d=(b||"0").toString().toLowerCase().replace(/[%A-z]+$/,function(a){return c=a,""}),c||(c=v.Values.getUnitType(a)),[d,c]};R=V(K,O),O=R[0],T=R[1],R=V(K,M),M=R[0].replace(/^([+-\/*])=/,function(a,b){return U=b,""}),S=R[1],O=parseFloat(O)||0,M=parseFloat(M)||0,"%"===S&&(/^(fontSize|lineHeight)$/.test(K)?(M/=100,S="em"):/^scale/.test(K)?(M/=100,S=""):/(Red|Green|Blue)$/i.test(K)&&(M=M/100*255,S=""));var W=function(){var d={myParent:a.parentNode||c.body,position:v.getPropertyValue(a,"position"),fontSize:v.getPropertyValue(a,"fontSize")},e=d.position===I.lastPosition&&d.myParent===I.lastParent,f=d.fontSize===I.lastFontSize;I.lastParent=d.myParent,I.lastPosition=d.position,I.lastFontSize=d.fontSize;var g=100,h={};if(f&&e)h.emToPx=I.lastEmToPx,h.percentToPxWidth=I.lastPercentToPxWidth,h.percentToPxHeight=I.lastPercentToPxHeight;else{var i=n&&n.isSVG?c.createElementNS("http://www.w3.org/2000/svg","rect"):c.createElement("div");t.init(i),d.myParent.appendChild(i),m.each(["overflow","overflowX","overflowY"],function(a,b){t.CSS.setPropertyValue(i,b,"hidden")}),t.CSS.setPropertyValue(i,"position",d.position),t.CSS.setPropertyValue(i,"fontSize",d.fontSize),t.CSS.setPropertyValue(i,"boxSizing","content-box"),m.each(["minWidth","maxWidth","width","minHeight","maxHeight","height"],function(a,b){t.CSS.setPropertyValue(i,b,g+"%")}),t.CSS.setPropertyValue(i,"paddingLeft",g+"em"),h.percentToPxWidth=I.lastPercentToPxWidth=(parseFloat(v.getPropertyValue(i,"width",null,!0))||1)/g,h.percentToPxHeight=I.lastPercentToPxHeight=(parseFloat(v.getPropertyValue(i,"height",null,!0))||1)/g,h.emToPx=I.lastEmToPx=(parseFloat(v.getPropertyValue(i,"paddingLeft"))||1)/g,d.myParent.removeChild(i)}return null===I.remToPx&&(I.remToPx=parseFloat(v.getPropertyValue(c.body,"fontSize"))||16),null===I.vwToPx&&(I.vwToPx=parseFloat(b.innerWidth)/100,I.vhToPx=parseFloat(b.innerHeight)/100),h.remToPx=I.remToPx,h.vwToPx=I.vwToPx,h.vhToPx=I.vhToPx,t.debug>=1&&console.log("Unit ratios: "+JSON.stringify(h),a),h};if(/[\/*]/.test(U))S=T;else if(T!==S&&0!==O)if(0===M)S=T;else{h=h||W();var X=/margin|padding|left|right|width|text|word|letter/i.test(K)||/X$/.test(K)||"x"===K?"x":"y";switch(T){case"%":O*="x"===X?h.percentToPxWidth:h.percentToPxHeight;break;case"px":break;default:O*=h[T+"ToPx"]}switch(S){case"%":O*=1/("x"===X?h.percentToPxWidth:h.percentToPxHeight);break;case"px":break;default:O*=1/h[S+"ToPx"]}}switch(U){case"+":M=O+M;break;case"-":M=O-M;break;case"*":M=O*M;break;case"/":M=O/M}l[K]={rootPropertyValue:Q,startValue:O,currentValue:O,endValue:M,unitType:S,easing:N},t.debug&&console.log("tweensContainer ("+K+"): "+JSON.stringify(l[K]),a)}else t.debug&&console.log("Skipping ["+P+"] due to a lack of browser support.")}l.element=a}l.element&&(v.Values.addClass(a,"velocity-animating"),J.push(l),n=g(a),n&&(""===i.queue&&(n.tweensContainer=l,n.opts=i),n.isAnimating=!0),z===y-1?(t.State.calls.push([J,q,i,null,C.resolver]),t.State.isTicking===!1&&(t.State.isTicking=!0,k())):z++)}var h,i=m.extend({},t.defaults,u),l={};switch(g(a)===d&&t.init(a),parseFloat(i.delay)&&i.queue!==!1&&m.queue(a,i.queue,function(b){t.velocityQueueEntryFlag=!0,g(a).delayTimer={setTimeout:setTimeout(b,parseFloat(i.delay)),next:b}}),i.duration.toString().toLowerCase()){case"fast":i.duration=200;break;case"normal":i.duration=r;break;case"slow":i.duration=600;break;default:i.duration=parseFloat(i.duration)||1}t.mock!==!1&&(t.mock===!0?i.duration=i.delay=1:(i.duration*=parseFloat(t.mock)||1,i.delay*=parseFloat(t.mock)||1)),i.easing=j(i.easing,i.duration),i.begin&&!p.isFunction(i.begin)&&(i.begin=null),i.progress&&!p.isFunction(i.progress)&&(i.progress=null),i.complete&&!p.isFunction(i.complete)&&(i.complete=null),i.display!==d&&null!==i.display&&(i.display=i.display.toString().toLowerCase(),"auto"===i.display&&(i.display=t.CSS.Values.getDisplayType(a))),i.visibility!==d&&null!==i.visibility&&(i.visibility=i.visibility.toString().toLowerCase()),i.mobileHA=i.mobileHA&&t.State.isMobile&&!t.State.isGingerbread,i.queue===!1?i.delay?setTimeout(f,i.delay):f():m.queue(a,i.queue,function(a,b){return b===!0?(C.promise&&C.resolver(q),!0):(t.velocityQueueEntryFlag=!0,void f(a))}),""!==i.queue&&"fx"!==i.queue||"inprogress"===m.queue(a)[0]||m.dequeue(a)}var h,i,n,o,q,s,u,x=arguments[0]&&(arguments[0].p||m.isPlainObject(arguments[0].properties)&&!arguments[0].properties.names||p.isString(arguments[0].properties));if(p.isWrapped(this)?(i=!1,o=0,q=this,n=this):(i=!0,o=1,q=x?arguments[0].elements||arguments[0].e:arguments[0]),q=f(q)){x?(s=arguments[0].properties||arguments[0].p,u=arguments[0].options||arguments[0].o):(s=arguments[o],u=arguments[o+1]);var y=q.length,z=0;if(!/^(stop|finish|finishAll)$/i.test(s)&&!m.isPlainObject(u)){var A=o+1;u={};for(var B=A;B<arguments.length;B++)p.isArray(arguments[B])||!/^(fast|normal|slow)$/i.test(arguments[B])&&!/^\d/.test(arguments[B])?p.isString(arguments[B])||p.isArray(arguments[B])?u.easing=arguments[B]:p.isFunction(arguments[B])&&(u.complete=arguments[B]):u.duration=arguments[B]}var C={promise:null,resolver:null,rejecter:null};i&&t.Promise&&(C.promise=new t.Promise(function(a,b){C.resolver=a,C.rejecter=b}));var D;switch(s){case"scroll":D="scroll";break;case"reverse":D="reverse";break;case"finish":case"finishAll":case"stop":m.each(q,function(a,b){g(b)&&g(b).delayTimer&&(clearTimeout(g(b).delayTimer.setTimeout),g(b).delayTimer.next&&g(b).delayTimer.next(),delete g(b).delayTimer),"finishAll"!==s||u!==!0&&!p.isString(u)||(m.each(m.queue(b,p.isString(u)?u:""),function(a,b){p.isFunction(b)&&b()}),m.queue(b,p.isString(u)?u:"",[]))});var E=[];return m.each(t.State.calls,function(a,b){
5646b&&m.each(b[1],function(c,e){var f=u===d?"":u;return f!==!0&&b[2].queue!==f&&(u!==d||b[2].queue!==!1)||void m.each(q,function(c,d){if(d===e)if((u===!0||p.isString(u))&&(m.each(m.queue(d,p.isString(u)?u:""),function(a,b){p.isFunction(b)&&b(null,!0)}),m.queue(d,p.isString(u)?u:"",[])),"stop"===s){var h=g(d);h&&h.tweensContainer&&f!==!1&&m.each(h.tweensContainer,function(a,b){b.endValue=b.currentValue}),E.push(a)}else"finish"!==s&&"finishAll"!==s||(b[2].duration=1)})})}),"stop"===s&&(m.each(E,function(a,b){l(b,!0)}),C.promise&&C.resolver(q)),a();
5646default:if(!m.isPlainObject(s)||p.isEmptyObject(s)){if(p.isString(s)&&t.Redirects[s]){h=m.extend({},u);var F=h.duration,G=h.delay||0;return h.backwards===!0&&(q=m.extend(!0,[],q).reverse()),m.each(q,function(a,b){parseFloat(h.stagger)?h.delay=G+parseFloat(h.stagger)*a:p.isFunction(h.stagger)&&(h.delay=G+h.stagger.call(b,a,y)),h.drag&&(h.duration=parseFloat(F)||(/^(callout|transition)/.test(s)?1e3:r),h.duration=Math.max(h.duration*(h.backwards?1-a/y:(a+1)/y),.75*h.duration,200)),t.Redirects[s].call(b,b,h||{},a,y,q,C.promise?C:d)}),a()}var H="Velocity: First argument ("+s+") was not a property map, a known action, or a registered redirect. Aborting.";return C.promise?C.rejecter(new Error(H)):console.log(H),a()}D="start"}var I={lastParent:null,lastPosition:null,lastFontSize:null,lastPercentToPxWidth:null,lastPercentToPxHeight:null,lastEmToPx:null,remToPx:null,vwToPx:null,vhToPx:null},J=[];m.each(q,function(a,b){p.isNode(b)&&e(b,a)}),h=m.extend({},t.defaults,u),h.loop=parseInt(h.loop,10);var K=2*h.loop-1;if(h.loop)for(var L=0;L<K;L++){var M={delay:h.delay,progress:h.progress};L===K-1&&(M.display=h.display,M.visibility=h.visibility,M.complete=h.complete),w(q,"reverse",M)}return a()}};t=m.extend(w,t),t.animate=w;var x=b.requestAnimationFrame||o;return t.State.isMobile||c.hidden===d||c.addEventListener("visibilitychange",function(){c.hidden?(x=function(a){return setTimeout(function(){a(!0)},16)},k()):x=b.requestAnimationFrame||o}),a.Velocity=t,a!==b&&(a.fn.velocity=w,a.fn.velocity.defaults=t.defaults),m.each(["Down","Up"],function(a,b){t.Redirects["slide"+b]=function(a,c,e,f,g,h){var i=m.extend({},c),j=i.begin,k=i.complete,l={height:"",marginTop:"",marginBottom:"",paddingTop:"",paddingBottom:""},n={};i.display===d&&(i.display="Down"===b?"inline"===t.CSS.Values.getDisplayType(a)?"inline-block":"block":"none"),i.begin=function(){j&&j.call(g,g);for(var c in l){n[c]=a.style[c];var d=t.CSS.getPropertyValue(a,c);l[c]="Down"===b?[d,0]:[0,d]}n.overflow=a.style.overflow,a.style.overflow="hidden"},i.complete=function(){for(var b in n)a.style[b]=n[b];k&&k.call(g,g),h&&h.resolver(g)},t(a,l,i)}}),m.each(["In","Out"],function(a,b){t.Redirects["fade"+b]=function(a,c,e,f,g,h){var i=m.extend({},c),j=i.complete,k={opacity:"In"===b?1:0};e!==f-1?i.complete=i.begin=null:i.complete=function(){j&&j.call(g,g),h&&h.resolver(g)},i.display===d&&(i.display="In"===b?"auto":"none"),t(this,k,i)}}),t}(window.jQuery||window.Zepto||window,window,document)});;
5647;(function (window) {
5648	$.WOPOP_EFFECTS={};
5649	$.WOPOP_EFFECTS['fromleft']=function(dom,options){
5650		var orileft=parseInt($(dom).css('left'))||0;
5651		var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1);
5652		var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1);
5653		
5654		_getEffectDom(dom).done(function(dom){
5655			$(dom).css('left',0-$(dom).width());
5656			dom.velocity({left:orileft+'px'},
5657			{delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease',complete:create_complete(options)})
5658		})
5659	}
5660	
5661	$.WOPOP_EFFECTS['frombottom']=function(dom,options){
5662		var oritop=parseInt($(dom).css('top'))||0;
5663		var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1);
5664		var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1);
5665		if(!$.wismobile||$.WOPOP_EFFECTS._isEditMode()){
5666			var container=$('#scroll_container');
5667		}else{
5668			var container=$(window);
5669		}
5670		_getEffectDom(dom).done(function(dom){
5671			$(dom).css('top',container.scrollTop()+container.height()+$(dom).height());
5672			dom.velocity({top:oritop+'px'},
5673			{delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease',complete:create_complete(options)})
5674		})
5675	}
5676	
5677	$.WOPOP_EFFECTS['fromright']=function(dom,options){
5678		var orileft=parseInt($(dom).css('left'))||0;
5679		var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1);
5680		var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1);
5681		if(!$.wismobile||$.WOPOP_EFFECTS._isEditMode()){
5682			var container=$('#scroll_container');
5683		}else{
5684			var container=$(window);
5685		}
5686		_getEffectDom(dom).done(function(dom){
5687			$(dom).css('left',container.width()-$(dom).width());
5688			dom.velocity({left:orileft+'px'},
5689			{delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease',complete:create_complete(options)})
5690		})
5691	}
5692	
5693	$.WOPOP_EFFECTS['fromtop']=function(dom,options){
5694		var oritop=parseInt($(dom).css('top'))||0;
5695		var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1);
5696		var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1);
5697		if(!$.wismobile||$.WOPOP_EFFECTS._isEditMode()){
5698			var container=$('#scroll_container');
5699		}else{
5700			var container=$(window);
5701		}
5702		_getEffectDom(dom).done(function(dom){
5703			// 考虑「通栏」元素(bug#4284)
5704			var $layer = $(dom),
5705			initop = ($layer.attr("fatherid")||"").length ? 0 : (container.scrollTop() - $(dom).height());
5706			$layer.css("top", initop);
5707			//$(dom).css('top',container.scrollTop()-$(dom).height());
5708			dom.velocity({top:oritop+'px'},
5709			{delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease',complete:create_complete(options)})
5710		})
5711	}
5712	
5713	$.WOPOP_EFFECTS['fade']=function(dom,options){
5714		var orival=parseInt($(dom).css('opacity'))||1;
5715		var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1);
5716		var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1);
5717		
5718		_getEffectDom(dom).done(function(dom){
5719			$(dom).css('opacity',0);
5720			dom.velocity({opacity:orival},
5721			{delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease-out',complete:create_complete(options)})
5722		})
5723	}
5724	
5725	$.WOPOP_EFFECTS['rotation']=function(dom,options){
5726		var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1);
5727		var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1);
5728		$.Velocity.hook($(dom), "rotateY", "180deg");
5729		$(dom).show();
5730		_getEffectDom(dom).done(function(dom){
5731			dom.velocity({rotateY:["0deg","180deg"]},
5732			{delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease',complete:create_complete(options)})
5733		})
5734	}
5735	
5736	$.WOPOP_EFFECTS['rotation2d']=function(dom,options){
5737		var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1);
5738		var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1);
5739		$(dom).show();
5740		_getEffectDom(dom).done(function(dom){
5741			dom.velocity({rotateZ:["360deg","0deg"]},
5742			{delay:(delay*1000),duration: (duration*1000),display: "block",easing:'linear'})
5743			.velocity({rotateZ:["360deg","0deg"]},
5744			{delay:0,duration: (duration*1000),display: "block",loop:true,easing:'linear',complete:create_complete(options)})
5745		})
5746	}
5747	
5748	$.WOPOP_EFFECTS['bounceIn']=function(dom,options){
5749		var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1);
5750		var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1);
5751		$.Velocity.hook($(dom), "scale", "0.3");
5752		$(dom).css('opacity',0);
5753		_getEffectDom(dom).done(function(dom){
5754			dom
5755			.velocity({scale:[1.05,0.3],opacity:[1,0]},{delay:(delay*1000),duration: (duration*333),display: "block"})
5756			.velocity({scale:[0.7,1.05]},{delay:0,duration: (duration*333),display: "block"})
5757			.velocity({scale:[1,0.7]},{delay:0,duration: (duration*333),display: "block",complete:create_complete(options)})
5758		})
5759	}
5760	
5761	$.WOPOP_EFFECTS['big2small']=function(dom,options){
5762		var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1);
5763		var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1);
5764		$.Velocity.hook($(dom), "scale", "2");
5765		_getEffectDom(dom).done(function(dom){
5766			dom.velocity({scale:[1,2],opacity:[1,0]},
5767			{delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease-in',complete:create_complete(options)})
5768		})
5769	}
5770	
5771	$.WOPOP_EFFECTS['small2big']=function(dom,options){
5772		var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1);
5773		var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1);
5774		$.Velocity.hook($(dom), "scale", "0.5");
5775		_getEffectDom(dom).done(function(dom){
5776			dom.velocity({scale:[1,0.5],opacity:[1,0]},
5777			{delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease-in',complete:create_complete(options)})
5778		})
5779	}
5780	
5781	$.WOPOP_EFFECTS['fadeFromLeft']=function(dom,options){
5782		var orileft=parseInt($(dom).css('left'))||0;
5783		var orival=parseInt($(dom).css('opacity'))||1;
5784		var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1);
5785		var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1);
5786		
5787		_getEffectDom(dom).done(function(dom){
5788			$(dom).css('left',0-$(dom).width());
5789			$(dom).css('opacity',0);
5790			dom.velocity({left:orileft+'px',opacity:orival},
5791			{delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease',complete:create_complete(options)})
5792		})
5793	}
5794	
5795	$.WOPOP_EFFECTS['fadeFromBottom']=function(dom,options){
5796		var oritop=parseInt($(dom).css('top'))||0;
5797		var orival=parseInt($(dom).css('opacity'))||1;
5798		var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1);
5799		var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1);
5800		if(!$.wismobile||$.WOPOP_EFFECTS._isEditMode()){
5801			var container=$('#scroll_container');
5802		}else{
5803			var container=$(window);
5804		}
5805		_getEffectDom(dom).done(function(dom){
5806			$(dom).css('top',container.scrollTop()+container.height()+$(dom).height());
5807			$(dom).css('opacity',0);
5808			dom.velocity({top:oritop+'px',opacity:orival},
5809			{delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease',complete:create_complete(options)})
5810		})
5811	}
5812	
5813	$.WOPOP_EFFECTS['fadeFromRight']=function(dom,options){
5814		var orileft=parseInt($(dom).css('left'))||0;
5815		var orival=parseInt($(dom).css('opacity'))||1;
5816		var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1);
5817		var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1);
5818		if(!$.wismobile||$.WOPOP_EFFECTS._isEditMode()){
5819			var container=$('#scroll_container');
5820		}else{
5821			var container=$(window);
5822		}
5823		_getEffectDom(dom).done(function(dom){
5824			$(dom).css('left',container.width()-$(dom).width());
5825			dom.velocity({left:orileft+'px',opacity:orival},
5826			{delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease',complete:create_complete(options)})
5827		})
5828	}
5829	
5830	$.WOPOP_EFFECTS['fadeFromTop']=function(dom,options){
5831		var oritop=parseInt($(dom).css('top'))||0;
5832		var orival=parseInt($(dom).css('opacity'))||1;
5833		var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1);
5834		var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1);
5835		if(!$.wismobile||$.WOPOP_EFFECTS._isEditMode()){
5836			var container=$('#scroll_container');
5837		}else{
5838			var container=$(window);
5839		}
5840		_getEffectDom(dom).done(function(dom){
5841			$(dom).css('top',container.scrollTop()-$(dom).height());
5842			dom.velocity({top:oritop+'px',opacity:orival},
5843			{delay:(delay*1000),duration: (duration*1000),display: "block",easing:'ease',complete:create_complete(options)})
5844		})
5845	}
5846	
5847	$.WOPOP_EFFECTS['light']=function(dom,options){
5848		var delay=$.WOPOP_EFFECTS._parseNum(options['delay'],1);
5849		var duration=$.WOPOP_EFFECTS._parseNum(options['duration'],1);
5850
5851		_getEffectDom(dom).done(function(dom){
5852			dom.velocity({opacity: 1},
5853			{delay:(delay*1000),duration:(duration*500),display: "block",easing:'ease-in-out'})
5854			.velocity({opacity:[0,1]},
5855			{delay:0,duration: (duration*500),display: "block",loop:true,easing:'ease-in-out',complete:create_complete(options)})
5856		})
5857	}
5858	
5859	function create_complete(effects){
5860		//返回conplete函数
5861		return function(){
5862			var dom=$(this);
5863			if(dom.data('wopop_effect_oristyle')){
5864				dom.attr('style',dom.data('wopop_effect_oristyle')).show();
5865				dom.removeData('wopop_effect_oristyle');
5866			}
5867			dom.trigger('effect_complete');
5868			dom.removeClass('now_effecting');
5869		}
5870	}
5871	
5872	$.fn.showEffects=function(force_show,show_effects){
5873		$.Velocity.defaults.mobileHA=false;
5874		var fullpagedom=$('.fullpage_alllist');
5875		var browsersupport=!($.browser.msie && $.browser.version <9); //IE 9以下不支持动画效果
5876		if(!fullpagedom.length || force_show){
5877			return this.each(function() {
5878				var self = $(this); 
5879				var effects=show_effects;
5880				if(!(effects&&effects.effect)) effects=self.data('wopop_effects');
5881				if(effects&&effects.effect){
5882					var deg=self.data('deg')||0;
5883					// 固定通栏里显示动画
5884					var infixedparentel=self.closest('.full_column[infixed=1],.cstlayer[infixed=1]');
5885					if(infixedparentel.length){
5886						if(infixedparentel.parent().is('#canvas')&&parseInt(infixedparentel.css('top'))==0){
5887							return;
5888						}
5889						if(self.is('.now_effecting')) return;
5890					}
5891					var style=self.attr('style').replace(/display:\s*none\s*;?/,'');
5892					if(!deg){
5893						style=style.replace(/ (-\w+-)?transform-origin:[^;]+;/g,'');
5894					}
5895					if(!self.data('wopop_effect_oristyle')) self.data('wopop_effect_oristyle',style);
5896					
5897					$.Velocity.hook($(self), "rotateZ", deg+"deg");
5898					
5899					self.hide();
5900					if($.WOPOP_EFFECTS[effects.effect] && browsersupport){
5901						self.addClass('now_effecting');
5902						$.WOPOP_EFFECTS[effects.effect](self,effects);
5903					}else{
5904						self.show();
5905					}
5906				}
5907			});
5908		}
5909	}
5910	
5911	$.fn.wopop_effect_command=function(command,args){
5912		if(command=='stop'){
5913			return this.each(function() {
5914				stop_effect($(this));
5915			});
5916		}
5917	}
5918	
5919	$.WOPOP_EFFECTS._parseNum=function(num,orival){
5920		if(num==0) return 0;
5921		return num || orival;
5922	}
5923	
5924	function stop_effect(dom){
5925		dom.velocity("stop", true);
5926		if(dom.data('wopop_effect_oristyle')) {
5927			$.Velocity.hook($(dom), "scale", "1");
5928			$.Velocity.hook($(dom), "rotateY", "0deg");
5929			var deg=dom.data('deg')||0;
5930			$.Velocity.hook($(dom), "rotateZ", deg+"deg");
5931
5932			dom.attr('style',dom.data('wopop_effect_oristyle'));
5933		}
5934
5935//		if(dom.data('wopop_effect_oristyle')) console.log(dom,dom.data('wopop_effect_oristyle'))
5936		dom.removeData('wopop_effect_oristyle');
5937		dom.removeClass('now_effecting');
5938		dom.trigger('effect_complete');
5939	}
5940	
5941	function _getEffectDom(dom){
5942		var fullpagedom=$('.fullpage_alllist');
5943		var dfd=$.Deferred();
5944		if(fullpagedom.length){
5945			dfd.resolve($(dom));
5946		}else{
5947			var ismobile=(typeof(MobileUtils)=='object');
5948			if(!ismobile){
5949				var container=$('#scroll_container');
5950				/**
5951				 * 修复因“固定背景”而导致chrome下图片显示异常问题(bug#4394)
5952				 * bug#4394,bug#4162,bug#4172,bug#4208,bug#4322,bug#4337均由“固定背景”的修复方案导致的,伤不起呀!!!
5953				 */ 
5954				if (container.data('chrome_bug')) container = window;
5955			}else{
5956				var container=window;
5957			}
5958			if(isDomInView($(dom),container)){
5959				dfd.resolve($(dom));
5960			}else{
5961				$(container).bind('scroll',function(e){
5962					if(isDomInView($(dom),container)){
5963						dfd.resolve($(dom));
5964						$(this).unbind(e);
5965					}
5966				})
5967			}
5968		}
5969		return dfd;
5970	}
5971	
5972	function isDomInView(dom,container){
5973		var fold=0;var containerheight=0;
5974		if (container=== undefined || container === window) {
5975				fold = $(window).scrollTop();
5976				containerheight=$(window).height();
5977		} else {
5978				fold = $(container).scrollTop();
5979				containerheight=$(container).height();
5980		}
5981		var navheight=$('#wp-mobile_navhandler').height()+$('#wp-mobile_navhandler').height();
5982		return fold+containerheight-navheight > dom.ab_pos('top');//parseInt(dom.css('top'));
5983	}
5984	
5985	$.WOPOP_EFFECTS._hasEffectFilter=function(){
5986		var self=$(this);
5987		if(self.attr('deleted')=='deleted') return false;
5988		var effects=self.data('wopop_effects');
5989		if(effects&&effects.effect){
5990			return true;
5991		}
5992		return false;
5993	}
5994	
5995	$.WOPOP_EFFECTS._isEditMode=function(){
5996		if($.saveLayout&&$.isFunction($.saveLayout.save)) return true;
5997		return false;
5998	}
5999	
6000	var curfullpageindex;
6001	$.WOPOP_EFFECTS._setindex=function(index){
6002		curfullpageindex=index;
6003	}
6004	
6005	$.WOPOP_EFFECTS._getindex=function(){
6006		return curfullpageindex;
6007	}
6008	
6009	var effectparams={
6010		fromleft:{delay:0,duration:1.20},
6011		frombottom:{delay:0,duration:1.20},
6012		fromright:{delay:0,duration:1.20},
6013		fromtop:{delay:0,duration:1.20},
6014		fade:{delay:0,duration:0.90},
6015		rotation:{delay:0,duration:1.20},
6016		rotation2d:{delay:0,duration:1.20},
6017		bounceIn:{delay:0,duration:2.20},
6018		big2small:{delay:0,duration:1.20},
6019		small2big:{delay:0,duration:1.20},
6020		fadeFromLeft:{delay:0,duration:1.20},
6021		fadeFromBottom:{delay:0,duration:1.20},
6022		fadeFromRight:{delay:0,duration:1.20},
6023		fadeFromTop:{delay:0,duration:1.20},
6024		light:{delay:0,duration:1.20}
6025	}
6026	$.WOPOP_EFFECTS._getDefaultParam=function(effectname){
6027		var opts=effectparams[effectname];
6028		if(!opts) opts={delay:0,duration:1.20}
6029		return opts;
6030	}
6031})(window);
6032
6033;
6034function fullpagefooterinit(){
6035	//fullpagefooterdrag();
6036	//fullpagefooterresize();
6037	//$.showSiteFooterTips();
6038	$('.fullpage_alllist').each(function(){
6039		if($('.full_column:not([deleted="deleted"])').length > 0){
6040	        wp_alert(translate('full_column.already in backplane'));
6041	    }
6042	})
6043	$('.full_pagescroll').each(function(){
6044		fullpagescrollinit($(this));
6045	})
6046        //点亮滚亮操作
6047        $(document).bind('fullpage_scroll_pro',function(e,section){
6048            setTimeout(function(){
6049                if($('#wp-property_settings2').length){
6050                    //var index=$.parseInteger(section.replace('page',''));
6051                    var index='';
6052                    $('#canvas #fullPage-nav li').each(function(e){
6053                       // if($(this).find('a.active').length>0) index = e + 1;
6054                    })
6055                    $('.fullpage_alllist .section').each(function(e){
6056                        if($(this).hasClass('active')) index = e + 1;
6057                    })
6058                    
6059                    if(index>0){
6060                        //$('#wp-property_settings2 .wp-manage-panel-album-img:eq('+(index-1)+')').css('border-color','red');
6061                        $('#all_extra_img_div .wp-manage-panel-album-img').each(function(i){
6062                            var j = i + 1;
6063                            if(j==index) $(this).addClass('action');
6064                            else         $(this).removeClass('action');
6065                        })
6066                    }
6067                }
6068            },100)
6069        })
6070}
6071
6072function fullpagescrollinit(dom){
6073	dom.children('.full_width').css({left:0-canv.offset().left-$.parseInteger($('#canvas').css("borderLeftWidth")),width:$('#scroll_container_bg').width()});
6074	dom.wp_rightkey(); 
6075	if(dom.is(':not(.isplate)')){
6076//		fullpagescrolldrag(dom);    
6077		fullpagescrollresize(dom);
6078                setTimeout(function(){
6079                        fullpagescrolldrop(dom);
6080                },1300);
6081		//fullpagescrolldrop(dom);
6082	}
6083	
6084}
6085/*
6086function fullpagefooterdrag(){
6087	var maxminusheight=0;
6088	var curcanvheight=canv.height();
6089	var Command=Undo.Command.createModuleCommand(function(blockid,val){
6090			var blockel=$('#'+blockid);
6091			blockel.css('top',val.top);
6092			canv.height(val.canvheight);
6093			$('#scroll_container_bg').css('height',(val.canvheight+blockel.height())+'px');
6094			$.fullpageupdateselectbgopt();
6095			$.updatepospropblk();
6096			$.canvasHeightChange();
6097	 },null,{returntype:'class'});
6098	 
6099	 var undoobj=null;
6100	$('#site_footer').draggable({
6101			cursor: 'move',
6102			axis: "y",
6103			start: function(event, ui){
6104				initCanvasHeight();
6105				var canvasminheight=canv.data('layermaxheight')||0;
6106				curcanvheight=canv.height();
6107				maxminusheight=curcanvheight-canvasminheight;
6108				undoobj=new Command('site_footer');
6109				undoobj.setOldVal({top:$.parseInteger($(this).css('top')),canvheight:curcanvheight});
6110			},
6111			drag: function(event, ui){
6112
6113				var topmovepx = ui.position.top - ui.originalPosition.top;
6114				if(topmovepx<0){
6115					var delta=0-topmovepx;
6116					if(delta>maxminusheight){
6117						var canvasminheight=canv.data('layermaxheight')||0;
6118						ui.position.top=ui.originalPosition.top-maxminusheight;
6119						canv.height(canvasminheight);
6120						$('#scroll_container_bg').css('height',(canvasminheight+$(this).height()+100)+'px');
6121						$.fullpageshowselectbgopt($(this));
6122						$(this).triggerHandler('drag_progress',[{left:0,top:ui.position.top}]);
6123						return;
6124					} 
6125				}
6126				$(this).triggerHandler('drag_progress',[{left:0,top:ui.position.top}]);
6127				canv.height(curcanvheight+topmovepx);
6128				$.fullpageshowselectbgopt($(this));
6129				$('#scroll_container_bg').css('height',(curcanvheight+topmovepx+$(this).height()+100)+'px');
6130			},
6131			stop:function(event, ui){
6132				var topmovepx = ui.position.top - ui.originalPosition.top;
6133				canv.height(curcanvheight+topmovepx);
6134				$('#scroll_container_bg').css('height',(curcanvheight+topmovepx+$(this).height()+100)+'px');
6135				$.canvasHeightChange();
6136				correctFooterPos();
6137				undoobj.insertWithNewVal({top:$.parseInteger($(this).css('top')),canvheight:curcanvheight+topmovepx});		
6138				undoobj=null;
6139				$(this).trigger('drag_stop',[{left:parseInt($(this).css('left')),top:parseInt($(this).css('top'))}]);
6140			}
6141			
6142	});
6143}
6144*/
6145
6146function fullpagescrolldrag(dom){
6147	dom.wp_drag();
6148}
6149
6150function fullpagescrollresize(dom){
6151	var createhandlefunc=function(handle){
6152		     dom.each(function(){
6153					 var hname = 'ui-resizable-'+handle;
6154					var axis = $('<div class="ui-resizable-handle ' + hname + '"><p class="knob "></p></div>');
6155					
6156					axis.css({zIndex: 1000});
6157					$(this).children('.full_width').append(axis);
6158			 })
6159				
6160	}
6161	var createplaceholderfunc=function(handle){
6162			  dom.each(function(){
6163					var hname = 'placeholder-'+handle;
6164					var axis = $('<div class="li-placeholder  ' + hname + '"></div>');
6165					axis.css({zIndex: 1000}).hide();
6166					$(this).children('.full_width').append(axis);
6167			  })
6168	}
6169	createhandlefunc('n');
6170	createhandlefunc('s');
6171	createplaceholderfunc('w');
6172	createplaceholderfunc('e');
6173	
6174	var fullpagescrollbuttompos;
6175	dom.resizable({
6176			handles: {n: '>.full_width .ui-resizable-n',s: '>.full_width .ui-resizable-s'},
6177			noinit:true,
6178			canvascontain: '#canvas',
6179			distance: 0,
6180		     concernLock:true,
6181			scroll: true,
6182			create:function(){
6183				$(this).children('.full_width').find('.ui-resizable-handle').hide();
6184			},
6185			start: function(event, ui){
6186				fullpagescrollbuttompos=$.getFullColChildMaxButtomfullpage(dom);
6187				var self=$(this);
6188				var resizeundo=new ResizeCommand(self.attr('id'));
6189				var oldcssarr=['top','height'];
6190				var oldval={};
6191				for(var i=0;i<oldcssarr.length;i++){
6192					oldval[oldcssarr[i]]=self.css(oldcssarr[i]);
6193				}
6194				resizeundo.setOldVal(oldval);
6195				$(document).data('resizeundo',resizeundo);
6196			},
6197			resize: function(event, ui){
6198				
6199				var curtop=dom.ab_pos_cnter('top');
6200				var curheight=$.parseInteger(dom.css('height'));
6201				if($.getElementAreaInf($(this))=='canvas'){
6202					var maxbuttom=Math.max(curtop+fullpagescrollbuttompos,curtop+curheight);
6203					$.canvasheightresizeOrigin(maxbuttom);
6204				}
6205				
6206				$(this).children('.full_content,.full_width').height($(this).height());
6207				$(this).triggerHandler('resize_progress',[{ui:ui}]);
6208				$.fullpageshowselectbgopt($(this));
6209				
6210			},
6211			stop:function(event, ui){
6212				$(this).children('.full_content,.full_width').height($(this).height());
6213				$.fullpageshowselectbgopt($(this));
6214				var resizeundo=$(document).data('resizeundo');
6215				$(document).removeData('resizeundo');
6216				var self=$(this);
6217				var oldcssarr=['top','height'];
6218				var newval={};
6219				for(var i=0;i<oldcssarr.length;i++){
6220					newval[oldcssarr[i]]=self.css(oldcssarr[i]);
6221				}
6222				$(this).triggerHandler('resize_stop',[{ui:ui}]);
6223				resizeundo.insertWithNewVal(newval);	
6224			}
6225			
6226	});
6227        //初始化resize 第一屏自适应处理
6228//        $(this).css({"width":($(window).width()-0) + "px","left":-$.fullpagecanvasleft() + "px"});//浏览器大小缩放处理
6229//        var $paragraph_image = $(this).find('.section .bg > img');
6230//        var maxjson = {width:$(window).width(),height:$(window).height()};
6231//        var json = {width:$paragraph_image.width(),height:$paragraph_image.height()};
6232//        $.wp_fullpagezoom($(this),maxjson,json,'noresize');
6233}
6234/*
6235function fullpagefooterresize(){
6236	var createhandlefunc=function(handle){
6237				var hname = 'ui-resizable-'+handle;
6238				var axis = $('<div class="ui-resizable-handle ' + hname + '"><p class="knob "></p></div>');
6239				axis.css({zIndex: 1000});
6240				$('#site_footer >.full_width').append(axis);
6241	}
6242	var createplaceholderfunc=function(handle){
6243				var hname = 'placeholder-'+handle;
6244				var axis = $('<div class="li-placeholder  ' + hname + '"></div>');
6245				axis.css({zIndex: 1000});
6246				$('#site_footer> .full_width').append(axis);
6247	}
6248	createhandlefunc('n');
6249	createhandlefunc('s');
6250	createplaceholderfunc('w');
6251	createplaceholderfunc('e');
6252	
6253	
6254	var maxminusheight=0;
6255	var curcanvheight=canv.height();
6256	var canvasminheight=0;
6257	
6258	var Command=Undo.Command.createModuleCommand(function(blockid,val){
6259			var blockel=$('#'+blockid);
6260			blockel.css('top',val.top);
6261			blockel.css('height',val.height);
6262			canv.height(val.canvheight);
6263			blockel.children('.full_content,.full_width').height(val.height);
6264			$('#scroll_container_bg').css('height',(val.canvheight+blockel.height())+'px');
6265			$.fullpageupdateselectbgopt();
6266			$.updatepospropblk();
6267			$.canvasHeightChange();
6268	 },null,{returntype:'class'});
6269	 
6270	 var undoobj=null;
6271	 var resizertimer=null;
6272	$('#site_footer').resizable({
6273			handles: {n: '>.full_width .ui-resizable-n',s: '>.full_width .ui-resizable-s'},
6274			noinit:true,
6275			distance: 0,
6276			scroll: true,
6277			create:function(){
6278				$(this).children('.full_width').find('.ui-resizable-handle').hide();
6279			},
6280			start: function(event, ui){
6281				initCanvasHeight();
6282				if(resizertimer){
6283					clearTimeout(resizertimer);
6284					resizertimer=null;
6285				}
6286				canvasminheight=canv.data('layermaxheight')||0;
6287				curcanvheight=canv.height();
6288				maxminusheight=curcanvheight-canvasminheight;
6289				
6290				undoobj=new Command('site_footer');
6291				undoobj.setOldVal({top:$.parseInteger($(this).css('top')),canvheight:curcanvheight,height:$(this).height()});
6292				$(this).triggerHandler('resize_progress',[{ui:ui}]);
6293			},
6294			resize: function(event, ui){
6295				var resizeobj=$(this).data('resizable');
6296				var theaxis=resizeobj.axis;
6297				if(theaxis=='n'){
6298					var changey= $(this).height()-ui.originalSize.height;
6299					if(changey>maxminusheight){
6300						var mintop=canvasminheight;
6301						$(this).css({top:mintop,height:ui.originalSize.height+maxminusheight});
6302						var oriscrolltop=$(this).data('resize_oriscrolltop');
6303						$(this).scrollParent().scrollTop(oriscrolltop);
6304						$(this).children('.full_content,.full_width').height($(this).height());
6305						canv.height(canvasminheight);
6306						$('#scroll_container_bg').css('height',(canvasminheight+$(this).height()+100)+'px');
6307						$.fullpageshowselectbgopt($(this));
6308						return;
6309					}
6310					canv.height(curcanvheight-changey);
6311					$(this).children('.full_content,.full_width').height($(this).height());
6312					$('#scroll_container_bg').css('height',(canv.height()+$(this).height()+100)+'px');
6313				}else{
6314					$(this).children('.full_content,.full_width').height($(this).height());
6315					$('#scroll_container_bg').css('height',(canv.height()+$(this).height()+100)+'px');
6316				}
6317				$.fullpageshowselectbgopt($(this));
6318				$(this).triggerHandler('resize_stop',[{ui:ui}]);
6319			},
6320			stop:function(event, ui){
6321				var self=$(this);
6322				undoobj.insertWithNewVal({top:$.parseInteger(self.css('top')),canvheight:canv.height(),height:self.height()});		
6323				undoobj=null;
6324				$.canvasHeightChange();
6325			}
6326			
6327	});
6328}
6329*/
6330function fullpagescrolldrop(dom){
6331    if($.wismobile!=1) dom.css({'border':'dashed #AF6935 2px'});
6332	var createplaceholderfunc=function(handle){
6333			  dom.each(function(){
6334					var hname = 'placeholder-'+handle;
6335					var axis = $('<div class="li-placeholder  ' + hname + '"></div>');
6336					axis.css({zIndex: 1000});
6337					$(this).children('.full_content').append(axis);
6338			  })
6339	}
6340	createplaceholderfunc('n');
6341	createplaceholderfunc('s');
6342	createplaceholderfunc('w');
6343	createplaceholderfunc('e');
6344	
6345	var contentblock=dom.children('.full_content');
6346	contentblock.children('.li-placeholder').hide();
6347	contentblock.children('.placeholder-n').css({'border-top':'#FF9900 dashed 4px'});
6348	contentblock.children('.placeholder-s').css({'border-bottom':'#FF9900 dashed 4px'});
6349	contentblock.children('.placeholder-e').css({'border-right':'#FF9900 dashed 4px'});
6350	contentblock.children('.placeholder-w').css({'border-left':'#FF9900 dashed 4px'});
6351	contentblock.droppable({
6352			tolerance: 'pointer',
6353			accept:'.full_pagescroll,.cstlayer,.wp-new-tool-second-link,.wp-manage-plugin-block',//fullpage拖拽即时响应
6354			drop: function( event, ui ) {
6355				var draggable = $.ui.ddmanager.current;
6356				if($.getElementAreaInf($(draggable.element))==$.getElementAreaInf(dom)){
6357					if(!dom.hasClass('ui-modselected')||$(draggable.element).is('.wp-new-tool-second-link')||$(draggable.element).is('.wp-manage-plugin-block')){//fullpage拖拽即时响应
6358						$(this).children('.li-placeholder').hide();
6359						var existcolumn=$(document).data('layer_final_drop_id');
6360						var biggercolumn=$.chooseBiggerColumn(existcolumn,dom.attr('id'));
6361
6362						$(document).data('layer_final_drop_id',biggercolumn);
6363					}
6364				}
6365			},
6366			over: function(event, ui){
6367				//判断是否包含锁定元素
6368				var has_layer_lock=false;
6369				$('.ui-modselected').each(function(){
6370						if($(this).data('cstlayerstatus') == 'unlock' ){
6371							has_layer_lock=true;
6372						}
6373				});
6374				if(has_layer_lock) return;
6375				var draggable = $.ui.ddmanager.current;
6376				if($.getElementAreaInf($(draggable.element))==$.getElementAreaInf(dom) ||$(draggable.element).is('.wp-new-tool-second-link')||$(draggable.element).is('.wp-manage-plugin-block')){//fullpage拖拽即时响应
6377					if(!dom.hasClass('ui-modselected')||$(draggable.element).is('.wp-new-tool-second-link')||$(draggable.element).is('.wp-manage-plugin-block')){//fullpage拖拽即时响应
6378						var thisid=dom.attr('id');
6379						var existid=$(document).data('layer_drop_over_id');
6380						if(thisid != existid){
6381							var biggerid=$.chooseBiggerColumn(existid,thisid);
6382							if(biggerid == thisid){
6383								var $this=$(this);
6384								$(this).children('.li-placeholder').show();
6385								if(existid){
6386									var existcolumnel = $('#'+existid);
6387									var dropobj=existcolumnel.children('.full_content').data('droppable');
6388									dropobj['isover'] = 0;
6389									dropobj['isout'] = 1;
6390									dropobj._out.call(dropobj, event);
6391								}
6392								$(document).data('layer_drop_over_id', thisid);
6393							}else{
6394								var dropobj1=$(this).data('droppable');
6395								dropobj1['isover'] = 0;
6396								dropobj1['isout'] = 1;
6397							}
6398						}
6399
6400					}
6401				}
6402			},
6403			out: function(event, ui){
6404				//判断是否包含锁定元素
6405				var has_layer_lock=false;
6406				$('.ui-modselected').each(function(){
6407						if($(this).data('cstlayerstatus') == 'unlock' ){
6408							has_layer_lock=true;
6409						}
6410				});
6411				if(has_layer_lock) return;
6412				var draggable = $.ui.ddmanager.current;
6413				if($.getElementAreaInf($(draggable.element))==$.getElementAreaInf(dom)){
6414					if(!dom.hasClass('ui-modselected')||$(draggable.element).is('.wp-new-tool-second-link')||$(draggable.element).is('.wp-manage-plugin-block')){//fullpage拖拽即时响应
6415						$(this).children('.li-placeholder').hide();
6416						var curoverid=$(document).data('layer_drop_over_id');
6417						if(curoverid == dom.attr('id')) $(document).removeData('layer_drop_over_id');
6418					} 
6419				}
6420				
6421			}
6422	});
6423
6424}
6425
6426function full_page_block_drop(contentBlock){
6427    var dom=contentBlock.closest('.full_pagescroll');
6428    contentBlock.droppable({
6429			tolerance: 'pointer',
6430			accept:'.full_pagescroll,.cstlayer,.wp-new-tool-second-link,.wp-manage-plugin-block',//fullpage拖拽即时响应
6431			drop: function( event, ui ) {
6432				var draggable = $.ui.ddmanager.current;
6433				if($.getElementAreaInf($(draggable.element))==$.getElementAreaInf(dom)){
6434					if(!dom.hasClass('ui-modselected')||$(draggable.element).is('.wp-new-tool-second-link')||$(draggable.element).is('.wp-manage-plugin-block')){
6435						$(this).children('.li-placeholder').hide();
6436						var existcolumn=$(document).data('layer_final_drop_id');
6437						var biggercolumn=$.chooseBiggerColumn(existcolumn,dom.attr('id'));
6438
6439						$(document).data('layer_final_drop_id',biggercolumn);
6440					}
6441				}
6442			},
6443			over: function(event, ui){
6444				//判断是否包含锁定元素
6445				var has_layer_lock=false;
6446				$('.ui-modselected').each(function(){
6447						if($(this).data('cstlayerstatus') == 'unlock' ){
6448							has_layer_lock=true;
6449						}
6450				});
6451                                
6452				if(has_layer_lock) return;
6453				var draggable = $.ui.ddmanager.current;
6454				if($.getElementAreaInf($(draggable.element))==$.getElementAreaInf(dom) ||$(draggable.element).is('.wp-new-tool-second-link')||$(draggable.element).is('.wp-manage-plugin-block')){
6455					if(!dom.hasClass('ui-modselected')||$(draggable.element).is('.wp-new-tool-second-link')||$(draggable.element).is('.wp-manage-plugin-block')){
6456						var thisid=dom.attr('id');
6457						var existid=$(document).data('layer_drop_over_id');
6458						if(thisid != existid){
6459							var biggerid=$.chooseBiggerColumn(existid,thisid);
6460							if(biggerid == thisid){
6461								var $this=$(this);
6462								$(this).children('.li-placeholder').show();
6463								if(existid){
6464									var existcolumnel = $('#'+existid);
6465									if(!existcolumnel.is('.wp_droppable')){
6466										var dropobj=existcolumnel.children('.full_content').data('droppable');
6467									}else{
6468										var dropobj=existcolumnel.children('.drop_box').data('droppable');
6469									}
6470									dropobj['isover'] = 0;
6471									dropobj['isout'] = 1;
6472									dropobj._out.call(dropobj, event);
6473								}
6474								$(document).data('layer_drop_over_id', thisid);
6475							}else{
6476								var dropobj1=$(this).data('droppable');
6477								dropobj1['isover'] = 0;
6478								dropobj1['isout'] = 1;
6479							}
6480						}
6481
6482					}
6483				}
6484			},
6485			out: function(event, ui){
6486				//判断是否包含锁定元素
6487				var has_layer_lock=false;
6488				$('.ui-modselected').each(function(){
6489						if($(this).data('cstlayerstatus') == 'unlock' ){
6490							has_layer_lock=true;
6491						}
6492				});
6493				if(has_layer_lock) return;
6494				var draggable = $.ui.ddmanager.current;
6495				if($.getElementAreaInf($(draggable.element))==$.getElementAreaInf(dom)){
6496					if(!dom.hasClass('ui-modselected')||$(draggable.element).is('.wp-new-tool-second-link')||$(draggable.element).is('.wp-manage-plugin-block')){
6497						$(this).children('.li-placeholder').hide();
6498						var curoverid=$(document).data('layer_drop_over_id');
6499						if(curoverid == dom.attr('id')) $(document).removeData('layer_drop_over_id');
6500					} 
6501				}
6502				
6503			}
6504	});
6505}
6506
6507function fullpagescroll_propblk_init(){
6508	var lvtimer;
6509	for(var key in $.fullpagebackgroundPropDefaults){
6510		(function(){	
6511			var curkey=key;
6512			var otherfunc=null;
6513			if($.inArray(curkey,['fullpage_moveto_prevop','fullpage_moveto_nextop']) != -1){
6514				var innertxt ='', lvtype = '';
6515				switch(curkey){
6516					case 'fullpage_moveto_prevop':
6517						lvtype = 'top';
6518						innertxt = '<div class="wp-moveto_fstlevel"><a class="property-bar-top" href="###" title="'+translate('Move to top')+'"><span>&nbsp;</span></a></div>';
6519						break;
6520					case 'fullpage_moveto_nextop':
6521						lvtype = 'bottom';
6522						innertxt = '<div class="wp-moveto_lstlevel"><a class="property-bar-bottom" href="###" title="'+translate('Move to bottom')+'"><span>&nbsp;</span></a></div>';
6523						break;
6524				}
6525				otherfunc={
6526					mousedown:function(){
6527						var $target = $(this)
6528						var apos =$target.offset();
6529						var scrollctner=$('#scroll_container');
6530						var scrolltop=scrollctner.scrollTop();
6531
6532						$(innertxt).appendTo(scrollctner).css({
6533							top: function(){
6534								return (apos.top+scrolltop - 25-39)+'px'
6535							},left: apos.left+'px'
6536						}).click(function(e){
6537							$('#'+$.bgselectedid).wp_setorder(lvtype,$.bgselectedid);
6538							$(this).remove();
6539							$target.removeClass('local');
6540							e.preventDefault();
6541						});
6542
6543					},
6544					mouseup:function(){
6545
6546					}
6547				}
6548			}
6549			$('#'+curkey).mousedown(function(e){
6550					var $target = $(this);	
6551					$target.addClass('local');
6552					if($('.wp-moveto_fstlevel,.wp-moveto_lstlevel').size()) $('.wp-moveto_fstlevel,.wp-moveto_lstlevel').remove();
6553					if(otherfunc != null){
6554						otherfunc.mousedown.apply(this);
6555					}
6556					e.preventDefault();
6557			}).mouseup(function(e){
6558					var self = this,$target = $(self);
6559					$target.removeClass('local');
6560					$.fullpagebackgroundPropDefaults[curkey].apply(this);
6561					if(otherfunc != null){
6562						otherfunc.mouseup.apply(this);
6563					}
6564					e.preventDefault();
6565			})
6566		})();
6567	}
6568}
6569
6570(function($){
6571function fullpagegetAllParents(el){
6572	var parents={};
6573	parents[el.prop('id')]='null';
6574	var curel=el;
6575	while(true){
6576		var parentid=$.getElementFatherid(curel);
6577		if(parentid =='none') break;
6578		parents[parentid]=curel.prop('id');
6579		curel=$('#'+parentid);
6580	}
6581	return parents;
6582}
6583
6584$.chooseBiggerColumn=function(existcolumnid,newcolumnid){
6585	var biggercolumnid=newcolumnid;
6586	if(existcolumnid==newcolumnid) return biggercolumnid;
6587	if(existcolumnid){
6588		var existcolumnel=$('#'+existcolumnid);
6589		var newcolumnel=$('#'+newcolumnid);
6590		
6591		var existcolumnfathers=fullpagegetAllParents(existcolumnel);
6592		var newcolumnfathers=fullpagegetAllParents(newcolumnel);
6593		var rootid='canvas';
6594		if(!existcolumnfathers[rootid])  rootid='site_footer';
6595		var existdifffather=rootid;
6596		var newdifffather=rootid;
6597		while(existdifffather == newdifffather){
6598			existdifffather =existcolumnfathers[existdifffather];
6599			newdifffather =newcolumnfathers[newdifffather];
6600			if(existdifffather=='null' || newdifffather=='null') break;
6601		}
6602		if(existdifffather=='null') biggercolumnid=newcolumnid;
6603		else if(newdifffather=='null') biggercolumnid=existcolumnid;
6604		else{
6605			var existfatherzindex=$.parseInteger($('#'+existdifffather).css('z-index'));
6606			var newfatherzindex=$.parseInteger($('#'+newdifffather).css('z-index'));
6607			if(existfatherzindex > newfatherzindex) biggercolumnid=existcolumnid;
6608		}
6609	}
6610	return biggercolumnid;
6611}	
6612
6613$.transferToColumn=function(dom,fathercolid){
6614	var oldfatherid=$.getElementFatherid(dom);
6615	if(oldfatherid!=fathercolid){
6616		var newfatherel=$('#'+fathercolid);
6617		var domabpos=dom.ab_pos('top');
6618		var newfatherabpos=newfatherel.ab_pos('top');
6619		var domableft=dom.ab_pos('left');
6620		var newfatherl=newfatherel.ab_pos('left');
6621		var contentblock=newfatherel;
6622		if(fathercolid!='canvas'){
6623			if(newfatherel.is('.wp_droppable')){
6624				contentblock=newfatherel.children('.drop_box');
6625			}else contentblock=newfatherel.children('.full_content');
6626		}
6627		dom.detach().attr('fatherid',fathercolid).css({'top':(domabpos-newfatherabpos),'left':(domableft-newfatherl)}).appendTo(contentblock);
6628		if(fathercolid=='site_footer'||fathercolid=='canvas') dom.removeAttr('fatherid');
6629	}
6630}
6631
6632$.getElementAreaInf=function(dom){
6633	return dom.attr('inbuttom')=='1'?'site_footer':'canvas';
6634}
6635
6636
6637$.addFullPagescroll=function(top){
6638    if($.wisplate){
6639        wp_alert(translate('fullpage.plate do not support add'));
6640        return false;
6641    }
6642    if($('.fullpage_alllist:not([deleted="deleted"])').length > 0){
6643        wp_alert(translate('fullpage.already plugin'));
6644        return false;
6645    }
6646    if($('.full_column:not([deleted="deleted"])').length > 0){
6647        wp_alert(translate('full_column.already Please remove'));
6648        return false;
6649    }
6650    //存在页脚元素时移除处理
6651    setTimeout(function(){
6652//    if($.wismobile){
6653    if($('#site_footer').length > 0){
6654        var fullpageClass='fullpage';
6655        if($.wismobile) fullpageClass='mfullpage';
6656        if (confirm(translate('fullpage.Please hide site_footer'))) {
6657                $.post(parseToURL(fullpageClass,"prosf"), {pid:$.page_id},function(response){
6658                    var o_result = $.parseJSON(response);
6659                    if(o_result.result == "OK") {
6660                        $('#site_footer').remove();
6661                    }else{
6662                        location.reload();
6663                        return false;
6664                    }
6665                }).error(function() {
6666                        location.reload();
6667                        return false;
6668                });
6669        }else{
6670            return false;
6671        }
6672    }
6673//    }
6674    },500)
6675         var successfunc=function(resp,needchangeid){
6676				var fullpagescrollhtml=resp;
6677				if(needchangeid){
6678					var fullpagescrollels=$(fullpagescrollhtml).filter('.full_pagescroll');
6679					var nowid=fullpagescrollels.prop('id');
6680					var newid='layer'+fGuid();
6681					fullpagescrollhtml=fullpagescrollhtml.replace(new RegExp(nowid,"g"),newid);
6682				}
6683				var fullpagescrollel=$(fullpagescrollhtml).appendTo('#canvas');
6684//				fullpagescrollel=fullpagescrollel.filter('.full_pagescroll');
6685                                fullpagescrollel.find('.full_pagescroll').each(function(){
6686                                    fullpagescrollinit($(this));
6687                                })
6688                                
6689				//初始化加截 默认模块内,内容模块加载样式
6690				fullpagescrollel.css('z-index',100);
6691				var titlecss=relativeToAbsoluteURL('plugin/title/css/title.css');
6692                                if($('body').data('title') !=titlecss){
6693						$('body').data('title',titlecss);
6694						var head = document.getElementsByTagName('head').item(0);
6695					    var css = document.createElement('link');
6696					    css.href = titlecss;
6697					    css.rel = 'stylesheet';
6698					    css.type = 'text/css';
6699					    head.appendChild(css);					 
6700				 }          
6701            
6702				$('.ui-modselected').each(function(){
6703					$.hidWidgetBorder($(this));
6704					// 图文模块相关 2012/2/14
6705					if($(this).hasClass('graphic_edited')) actived_graphic();
6706				});	
6707				$.fullpageunselectbgdiv(fullpagescrollel);
6708                                //显示属性 初始显示属性.ui-modselected绑定至第一屏上.再根id .fullpage_alllist初始存在问题
6709                                $.fullpageselectbgdiv(fullpagescrollel.find('.full_pagescroll:eq(0)'));
6710//                                $.showWidgetBorder(fullpagescrollel);
6711				new AddCommand(fullpagescrollel.prop('id')).insert();
6712				
6713				var objarray=new Array();
6714				objarray[0]=new Array(parseInt($('#'+fullpagescrollel.prop('id')).css('z-index')),fullpagescrollel.prop('id'));
6715				$.zindexsort_new(objarray);				
6716		}	
6717		//使用缓存有问题 停用
6718		if($.addFullPagescroll.html_cache){
6719			successfunc($.addFullPagescroll.html_cache,true);
6720			return;
6721		}
6722		
6723		$.ajax({
6724	        type: "GET",
6725	        url: parseToURL("wp_widgets","gtfullpagescroll"),
6726	        success: function(response){
6727//				$.addFullPagescroll.html_cache=response;
6728				successfunc(response,false);
6729			},
6730			error: function(xhr, textStatus, errorThrown){
6731				wp_alert((errorThrown||textStatus)+"(add a fullpagescroll).<br/>"+translate("Request failed!"));
6732				return false;
6733			}
6734	    });
6735           
6736}
6737
6738$.curSelectableFather=function(){
6739	var selmods=$('.ui-modselected');
6740	if(selmods.length==0){
6741		$(document).data('cur_selectable_father',null);
6742		return null;
6743	}else{
6744		var fatherid=$.getElementFatherid(selmods.filter(':first'));
6745		$(document).data('cur_selectable_father',fatherid);
6746		return fatherid;
6747		
6748	}
6749}
6750
6751$.getElementFatherid=function(dom){
6752	if(dom.prop('id')=='canvas'||dom.prop('id')=='site_footer') return 'none';
6753	var fatherid=dom.attr('fatherid');
6754	if(!fatherid||fatherid==''){
6755		if(dom.closest('#canvas').length>0){
6756			fatherid='canvas';
6757		}else if(dom.closest('#site_footer').length>0){
6758			fatherid='site_footer';
6759		}
6760	}
6761	if(!$('#'+fatherid).length){
6762		if(dom.closest('#canvas').length>0){
6763			fatherid='canvas';
6764		}else if(dom.closest('#site_footer').length>0){
6765			fatherid='site_footer';
6766		}
6767		dom.removeAttr('fatherid');
6768	}
6769	return fatherid;
6770}
6771
6772
6773/*
6774$.fn.ab_pos=function(direct){
6775	var dom=$(this);
6776	if(dom.prop('id')=='canvas'||dom.prop('id')=='site_footer') return 0;
6777	if(direct=='left'||direct=='top'){
6778		if(!dom.attr('fatherid')||dom.attr('fatherid')=='') return dom.rel_pos(direct);
6779		return dom.rel_pos(direct)+$('#'+dom.attr('fatherid')).ab_pos(direct);
6780	}
6781}
6782
6783$.fn.ab_pos_cnter=function(direct){
6784	var abpos=$(this).ab_pos(direct);
6785	if($(this).closest('#site_footer').length>0&&direct=='top'){
6786		return abpos+$.parseInteger($('#site_footer').css(direct));
6787	}
6788	return abpos;
6789}
6790
6791$.fn.rel_pos=function(direct){
6792	if(direct=='left'||direct=='top'){
6793		return $.parseInteger($(this).css(direct));
6794	}
6795}
6796*/
6797$.getFullColChildMaxButtomfullpage=function(dom){
6798		var parenttoppos=dom.ab_pos_cnter('top');
6799		var maxbuttompos=parenttoppos;
6800		dom.find('.cstlayer,.full_pagescroll').each(function(){
6801			var el=$(this);
6802			var buttompos=0;
6803			if(el.hasClass('cstlayer')) buttompos=$.divrotate.getDegreeModMaxPoint(el,null,'buttom');
6804			else buttompos=el.ab_pos_cnter('top')+$.parseInteger(el.css('height'));
6805			if(maxbuttompos<buttompos) maxbuttompos=buttompos
6806		})
6807		return maxbuttompos-parenttoppos;
6808	
6809}
6810
6811$.getFullPagescrollButtomPos=function(dom){
6812	if(dom.hasClass('cstlayer')){
6813		return $.divrotate.getDegreeModMaxPoint(dom,null,'buttom');
6814	}else if(dom.hasClass('full_pagescroll')){
6815		var maxbuttompos=0;
6816		dom.find('.cstlayer,.full_pagescroll').andSelf().each(function(){
6817			var el=$(this);
6818			var buttompos=0;
6819			if(el.hasClass('cstlayer')) buttompos=$.divrotate.getDegreeModMaxPoint(el,null,'buttom');
6820			else buttompos=el.ab_pos_cnter('top')+$.parseInteger(el.css('height'));
6821			if(maxbuttompos<buttompos) maxbuttompos=buttompos
6822		})
6823		return maxbuttompos;
6824	}
6825}
6826
6827
6828$.saveFullPagescrollObj=function(dom){
6829	var fullbackprop=dom.children('.full_width').data('backgroundprops')||{};
6830	var contentbackprop=dom.find('.full_content').data('backgroundprops')||{};
6831	var footerheight=dom.height();
6832	var otherparam={};
6833	if(dom.prop('id') != 'site_footer') otherparam={top:$.parseInteger(dom.css('top')),zindex:$.parseInteger(dom.css('z-index')),lock:dom.data('cstlayerstatus'),fixdisplay:dom.attr('infixed'),fullpageext:dom.data('fullpageext')};
6834	return $.extend({
6835		fullbackgroundprop:fullbackprop,
6836		contentbackgroundprop:contentbackprop,
6837		footerheight:footerheight
6838	},otherparam);
6839}
6840$.fullpagecanvasleft=function(){
6841    if($(window).width()<=$('#canvas').width()) return '0';
6842    else return ($(window).width()-$('#canvas').width())/2;
6843}
6844//fullpage 切屏图片自适应处理
6845$.wp_fullpagezoom=function(dom,size,originalSize,status){
6846        // 获取padding或border信息
6847        var $target = dom;
6848        var extw = 0,exth = 0,neww = size.width,newh = size.height;
6849        // 获取缩放信息
6850        var $img = $target.find('.fullimgc');
6851        $img.css("position", 'relative');// fixed bug#4459
6852        var lastw = neww - extw,lasth = newh - exth;
6853        var difw = neww - originalSize.width,difh = newh - originalSize.height;
6854        // 自适应处理
6855        var curdifw = 0,curdifh = 0;
6856        if (difw || (difw > difh)) {
6857                $img.width(lastw).height('auto');
6858                // 自动修复高度
6859                curdifh = lasth - $img.height();
6860//                if(curdifh < 0) $img.css({top:Math.ceil(curdifh/2)+'px',left:'0px',position:'relative'});
6861                if(curdifh < 0) $img.css({top:Math.ceil(curdifh/2)+'px',left:'0px'});
6862                else if(curdifh > 0){
6863                        $img.height(lasth).width('auto');
6864                        curdifw = lastw - $img.width();
6865//                        $img.css({top:'0px',left:Math.ceil(curdifw/2)+'px',position:'relative'});
6866                        $img.css({top:'0px',left:Math.ceil(curdifw/2)+'px'});
6867                }else $img.css({top:'',left:'',position:''});
6868        } else if (difh || (difw < difh)) {
6869                $img.height(lasth).width('auto');
6870                // 自动修复宽度
6871                curdifw = lastw - $img.width();
6872                //if(curdifw < 0) $img.css({top:'0px',left:Math.ceil(curdifw/2)+'px',position:'relative'});
6873                if(curdifw < 0) $img.css({top:'0px',left:Math.ceil(curdifw/2)+'px'});
6874                else if(curdifw > 0){
6875                        $img.width(lastw).height('auto');
6876                        curdifh = lasth - $img.height();
6877                        //$img.css({top:Math.ceil(curdifh/2)+'px',left:'0px',position:'relative'});
6878                        $img.css({top:Math.ceil(curdifh/2)+'px',left:'0px'});
6879                }else $img.css({top:'',left:'',position:''});
6880        }
6881}
6882//判断浏览(PC|手机)
6883$.wp_fullpag_mobile=function(){
6884    return (/iphone|ipod|ipad|Macintosh|android|Windows phone/i.test(navigator.userAgent.toLowerCase()));
6885}
6886
6887//初始化resize 第一屏自适应处理 手机预览,编辑不处理
6888setTimeout(function(){
6889    if($.wismobile&&$.wisviewmode){}else{
6890        var maxjson = {width:320,height:$(window).height()};
6891        if(!$.wiseditmode){
6892            maxjson = {width:$(window).width(),height:$(window).height()};
6893            var fullnode = $('.fullpage_alllist');
6894            var $paragraph_image = fullnode.find('.section.active .bg > img');
6895            //var maxjson = {width:$(window).width(),height:$(window).height()};
6896            var json = {width:0,height:0};
6897            $.wp_fullpagezoom(fullnode,maxjson,json,'noresize');
6898        }
6899    }
6900},800);
6901
6902})(jQuery);
6903/* 
6904 * To change this template, choose Tools | Templates
6905 * and open the template in the editor.
6906 */
6907
6908function openImageChooserDialog(options){
6909		window._imageChooserDefered=new $.Deferred();
6910		options=$.extend({},options);
6911		var title=options.title||translate('fileManager.selectImage');
6912		var width=options.width||850;
6913		var filetype=options.filetype||'pic';
6914		var dialogid=options.id||'wp-picmanage_panel';
6915		var zindex=options.zIndex||1003;
6916        var multi=options.multi||0;
6917        var mask = options.overlay;
6918		if (typeof mask === 'undefined') mask = true;
6919		//show_dialog(parseToURL("wp_widgets","common_pic_chooser",{filetype:filetype}), title,width, 0);
6920		wp_floatpanel(parseToURL('wp_widgets','common_pic_chooser',{filetype:filetype,multi:multi}),{
6921			title: title,
6922			id: dialogid,
6923			width: width,
6924			overlay: mask,
6925			isCenter: true,
6926			swfFix: true,
6927			zIndex: zindex
6928		});
6929		if(!options.cancelNotCloseDialog){
6930			window._imageChooserDefered.fail(function(){
6931				$.modal.close();
6932			})
6933		}
6934		
6935		return window._imageChooserDefered.promise();
6936
6937}
6938
6939// Add 'link to file' function 2013/02/25
6940function openMyDocChooserDialog(options){
6941	window._myDocChooserDefered = new $.Deferred();options = $.extend({},options);
6942	var title = options.title||translate('fileManager.myFile'),dwidth = options.width||850,icenter = options.isCenter||true,
6943	dialogid = options.id||'wp-file_explore',zindex = options.zIndex||1003,mask = options.overlay;
6944	if (typeof mask === 'undefined') mask = true;
6945	wp_floatpanel(parseToURL('wp_fileexplore', 'file_explore', {"geturl": '1'}), {swfFix: true,
6946		title: title,width: dwidth,isCenter: icenter,id: dialogid,zIndex: zindex,overlay: mask
6947	});
6948	return window._myDocChooserDefered.promise();
6949}
6950
6951function transferToPageSetDialog(showdiv,hidediv,options){
6952		window._pagesetDefered=new $.Deferred();
6953		options=$.extend({},options);
6954		var dialogwin=window;
6955		if(options.iframe) dialogwin=parent;
6956		var title=options.title||translate('page.add');
6957		var mode=options.mode||'create';
6958		var url ='';
6959		if(mode=='edit'){
6960			var pageid=options.pageid;
6961			url =parseToURL("wp_page","editpage",{id:pageid});
6962		}else{
6963			var additionparam=options.createparam||{};
6964			url =parseToURL("wp_page","addpage",additionparam);
6965		}
6966		$.get(url, function(data) {	
6967			$(showdiv).html(data).show();
6968			$(hidediv).hide();
6969			wp_update_floatpanel($('#wp-manage_menu'),title,376,function(dom){
6970				dom.find('.wp-panel_button').hide();
6971				dom.find('#page_set_prop_div .wp-panel_button').show();
6972			});
6973		}).error(function(xhr, textStatus, errorThrown) { 
6974			wp_alert((errorThrown||textStatus)+"(edit/add a page).<br/>"+translate("Request failed!")); 
6975		})
6976		return window._pagesetDefered.promise();
6977}
6978
6979function transferToPageSetDialogcur(showdiv,hidediv,options){
6980		window._pagesetDefered=new $.Deferred();
6981		options=$.extend({},options);
6982		var dialogwin=window;
6983		if(options.iframe) dialogwin=parent;
6984		var title=options.title||translate('page.add');
6985		var mode=options.mode||'create';
6986		var url ='';
6987		var pageid=options.pageid;
6988		var modact=options.modact||'navigation';
6989		
6990		
6991		var page_id=options.page_id;
6992		var supid=options.blockid;
6993
6994		if(mode=='edit'){			
6995			url =parseToURL(modact,"editpage",{id:pageid,page_id:page_id,blockid:supid});
6996		}else{
6997			var additionparam=options.createparam||{};
6998			url =parseToURL(modact,"addpage",{page_id:page_id,blockid:supid,parentid:pageid});
6999		}
7000		$.post(url, {menudata:$("#"+supid).data("menudata")}, function(data) {									
7001				$(showdiv).html(data).show();
7002				$(hidediv).hide();
7003				/*
7004				dialogwin.$('#osx-container').css('width',500);
7005				if(options.iframe) dialogwin.$('#osx-modal-data').find('iframe').width(500).height(480);
7006				dialogwin.$("#osx-modal-title").data('origin_title',dialogwin.$("#osx-modal-title").html());
7007				dialogwin.$("#osx-modal-title").html(title);
7008				dialogwin.$.modal.setPosition();
7009				*/
7010		}).error(function(xhr, textStatus, errorThrown) { 
7011			wp_alert((errorThrown||textStatus)+"(edit/add a navigation page).<br/>"+translate("Request failed!")); 
7012		})
7013		return window._pagesetDefered.promise();
7014}
7015
7016function openPageSetDialog(options){
7017		window._pagesetDefered=new $.Deferred();
7018		options=$.extend({},options);
7019		var title=options.title||translate('page.add');
7020		var width=options.width||400;
7021		var mode=options.mode||'create';
7022		var url ='';
7023		if(mode=='edit'){
7024			var pageid=options.pageid;
7025			url =parseToURL("wp_page","editpage",{id:pageid});
7026		}else{
7027			width = 400;
7028			var opts={};
7029			if(options.mtype) opts._mtype=options.mtype;
7030			if(options.parentid) opts.parentid=options.parentid;
7031			url =parseToURL("wp_page","addpage",opts);
7032		}
7033		//show_dialog(url, title,width, 0);
7034		wp_floatpanel(url,{
7035			title: title,
7036			contentClass: 'wp-site-set_panel_c',
7037			id: 'wp-add_page',
7038			overlay: true,
7039			isCenter: true,
7040			width: width,
7041			zIndex: 1002,
7042			cache:false,
7043			open: function(dom){
7044				if(options.callback && $.isFunction(options.callback)){
7045					$(dom).bind('addPageLink',function(e,url){
7046						options.callback(url);
7047					});
7048				}
7049			}
7050		});
7051		if(!options.cancelDefaultOp){
7052			window._pagesetDefered.done(function(data){
7053				if(data.refresh){
7054			
7055					$.saveLayout.save(true);
7056					window.location.reload();
7057					 $('#wp-add_page').triggerHandler('wpdialogclose');
7058				}else{
7059					setTimeout(function(){
7060						$.saveLayout.save(true);
7061						window.location.href=data.forward;
7062					},100);
7063				}
7064			})
7065			window._pagesetDefered.fail(function(){
7066				$('#wp-add_page').triggerHandler('wpdialogclose');
7067			})
7068		}
7069		
7070		return window._pagesetDefered.promise();
7071
7072}
7073
7074// 创建“文章/产品分类、列表”链接相关 2012/07/16
7075function setModuleLink(mtype,callback){
7076	openPageSetDialog({"mtype":mtype,"callback":callback});
7077}
7078
7079// IFRAME自适应高度 2012/07/12
7080function initFrame(frame,contentClass,height){
7081	var self = frame,bh = self.contentWindow.document.body.scrollHeight,
7082	dh = self.contentWindow.document.documentElement.scrollHeight,max = Math.max;
7083	var $parent = $(self).closest('.wp-floatpanel_dialog'),otherh = 0,temph = max(bh,dh);
7084	temph+=1;
7085	if($.browser.msie){
7086		temph = temph+25;
7087	}
7088	$parent.find('.'+contentClass).siblings().each(function(i,dom){
7089		otherh += $(dom).outerHeight(true);
7090	});
7091	var _float = function(numString){
7092		var number = parseFloat(numString);
7093		if(isNaN(number)) return 0;
7094		return number;
7095	};
7096	var seth = _float(height),maxh = seth ? seth : $(document).height(),
7097	difw = maxh - otherh - 10;// 上下间隔5像素
7098	if(difw < temph) temph = difw;
7099	frame.height = max(temph,200);
7100	$(self).closest('.wp-floatpanel_dialog').triggerHandler('wpdialogsetpos');
7101}
7102
7103(function($){
7104	var cachedtimer={};
7105	$.multi_exec_once=function(key,func,interval){
7106		var timer=cachedtimer[key];
7107		if(timer != null){
7108			clearTimeout(timer);
7109			delete cachedtimer[key];
7110		} 
7111		timer=setTimeout(func, interval);
7112		cachedtimer[key]=timer;
7113	}
7114	
7115	// 注册beforeLoaded方法 2012/07/11
7116	var loadedhash = {};
7117	$.beforeLoaded = {
7118		add: function(type, event, func){
7119			if ($.isFunction(func)) {
7120				if(!loadedhash[type]) loadedhash[type] = {};
7121				loadedhash[type][event] = func;
7122			}
7123		},
7124		run: function(type, event, data){
7125			var func = loadedhash[type];
7126			if(typeof func == 'undefined') return false;
7127			func = func[event];
7128			if($.isFunction(func)) return func(data);
7129			return false;
7130		}
7131	};
7132})(jQuery);
7133	
7134// 更新并定位浮动窗口
7135function wp_update_floatpanel(dom, title, width, callback){
7136	var $title = dom.find('.wp-title > h2'),curtitle = $title.html();
7137	dom.width(width);
7138	if(title) $title.data('origin_title',curtitle);
7139	else title = curtitle;
7140	$title.html(title);
7141	if(callback && $.isFunction(callback)) callback(dom);
7142	// setPosition
7143	var win = window,winw = $(win).width(),winh = $(win).height(),
7144	floor = Math.floor,newh = dom.outerHeight(true);
7145	dom.css({'left': floor((winw-width)/2),'top': floor((winh-newh)/2)});
7146}
7147
7148/**
7149 * 个性化下拉框
7150 */
7151;(function($,undefined){
7152	var namespace = '.wpcstselect';
7153	$.widget('wp.cstselect',{
7154		options : {
7155			selectclass:'wp-diy-selected'//样式
7156		}, // 配置项
7157		_create : function(){
7158			var self = this;
7159			var selectclass=self.options.selectclass;
7160			if(selectclass.length==0){ selectclass='wp-diy-selected';}
7161			// 忽略多选的SELECT控件
7162			if(self.element.prop("multiple")) return;
7163			self._doinit(self).done(function(dom,selopts){
7164				var $ctarget = dom,$diysel = $ctarget.next('.'+selectclass+'-outside').find('.'+selectclass+'');
7165				// 设置默认值
7166				setTimeout(function(){
7167					var $cursel = $diysel.children('.'+selectclass+'-left'),difw = $cursel.siblings('.'+selectclass+'-button').outerWidth() + 2,
7168					pad = self._int($cursel.css("paddingLeft")) + self._int($cursel.css("paddingRight")),finalw = $diysel.width() - difw - pad + 1;
7169					if (finalw <= 0) finalw = Math.max(65, $ctarget.width()) - pad - 16;
7170					$cursel.width(finalw).attr("val",$ctarget.val()).html($ctarget.find('option:selected').html());$cursel = difw = finalw = null;
7171				},50);
7172				// 绑定CLICK事件
7173				$diysel.bind('click'+namespace,function(e){
7174					if(self.options.disabled || !selopts.length) return;
7175					var $selectedcnt = $(selopts).appendTo('body'),maxheight = $selectedcnt.outerHeight(true);
7176					self._selected($selectedcnt, $ctarget.val()); // 设置默认值
7177					// 绑定LI:HOVER及CLICK事件
7178					if ($selectedcnt.is(':hidden')) {
7179						var $target = $(this);
7180						$selectedcnt.find('li').bind('mouseenter'+namespace, function(e){
7181							$(this).addClass('local').siblings().removeClass('local');
7182						}).bind('mouseleave'+namespace, function(e){
7183							$(this).removeClass('local');
7184						}).bind('click'+namespace, function(e){
7185							var $li = $(this),selval = $li.attr("val");
7186							$target.children('.'+selectclass+'-left').html($li.html()).attr("val", selval);
7187							$ctarget.val(selval).trigger('change');// 捕获已绑定SELECT事件
7188						}).end().slideDown('slow',function(){
7189							var $selcnt = $(this);
7190							// 定位滚动条 2012/11/09
7191							var selcnt = $selcnt[0],clienth = selcnt.clientHeight,$selected = $selcnt.find('li.local');
7192							if ($selected.size() > 0) {
7193								var seltop = $._parseFloat($selcnt.css("top")),
7194								litop = seltop + $selected[0].offsetTop - selcnt.offsetTop + $selected.height();
7195								if(clienth < litop) selcnt.scrollTop = litop - clienth;
7196							}
7197							// End
7198							$(document).one('click'+namespace,function(e){
7199								$selcnt.slideUp().remove();
7200								return false;
7201							});
7202						});
7203						setSeloptsPos($target,$selectedcnt,maxheight);
7204						// 绑定RESIZE事件
7205						$(window).resize(function(){
7206							setSeloptsPos($target,$selectedcnt,maxheight);
7207						});
7208					}
7209				});
7210				function setSeloptsPos(target,dom,maxh){
7211					var $target = target,pos = $target.offset();
7212					dom.css({
7213						"top": function(i,val){
7214							var wnh = window.innerHeight||self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,
7215							_top = self._int(pos.top),_oh = $target.outerHeight(true),newtop = 0;
7216							if (wnh < _top + maxh + _oh) {
7217								newtop = Math.max(0, _top - maxh - 1);
7218								$(this).css({"border-bottom": 'none',"border-top": '1px solid #B5B5B5'});
7219							} else newtop = _top + _oh + 1;
7220							wnh = _top = _oh = null;
7221							return newtop+'px';
7222						},"left": function(i,val){
7223							return self._int(pos.left)+'px';
7224						}
7225					});
7226				}
7227			});
7228		},
7229	    value : function(value){
7230	    	var self = this;
7231			var selectclass=self.options.selectclass;
7232			if(selectclass.length==0){ selectclass='wp-diy-selected';}
7233			var $target = self.element,$select = $target.next('.'+selectclass+'-outside');
7234	    	$target.val(value);
7235	    	$select.find('.'+selectclass+'-left').attr("val",value).html($target.children('option:selected').html());
7236	    },
7237		_doinit : function(dom){
7238			var dtd = $.Deferred(),self = dom,$target = self.element;
7239			var selectclass=self.options.selectclass,_stripslashes = function(str){
7240				return (str + '').replace(/\\(.?)/g, function(s, $1){
7241				    switch ($1) {
7242				    	case '\\': return '\\';
7243				    	case '0': return '\u0000';
7244				    	case '': return '';
7245				    	default: return $1;
7246				    }
7247			  	});
7248			};
7249			if(selectclass.length==0){ selectclass='wp-diy-selected';}
7250			$target.hide();// 隐藏SELECT控件
7251			// 自定义类SELECT
7252			var selopt = '',selw = Math.max($target.width(), 65);
7253			var selhtm = '<div class="'+selectclass+'-outside overz" style="float:left;width:'+selw+'px;"><div class="'+selectclass+'">';
7254			$target.children('option').each(function(i,c){
7255				var self = c;
7256				selopt += '<li val="'+self.value+'">'+_stripslashes(self.innerHTML)+'</li>';
7257			});
7258			selhtm += '<div class="'+selectclass+'-left" val="0">&nbsp;</div><div class="'+selectclass+'-button"><a href="###" onclick="return false;"></a></div></div></div>';
7259			$target.after(selhtm);
7260			dtd.resolve($target,'<div class="'+selectclass+'-content overz" style="width:'+(selw-2)+'px;"><ul>'+selopt+'</ul></div>');
7261			return dtd.promise();
7262		},
7263		_int : function(numstr){
7264			var number = parseInt(numstr);
7265			if(isNaN(number)) return 0;
7266			return number;
7267		},
7268		_selected : function(dom,value){
7269			dom.find('li').each(function(i,c){
7270				var $target = $(c),ent = '';
7271				ent = ($target.attr("val") == value)?'addClass':'removeClass';
7272				$target[ent]('local');
7273			});
7274			return true;
7275		},
7276		enable : function(){
7277			var self = this;
7278			var selectclass=self.options.selectclass;
7279			if(selectclass.length==0){ selectclass='wp-diy-selected';}
7280			var $select = self.element.next('.'+selectclass+'-outside');
7281			$select.find('.'+selectclass+'-left').css("color","#5A5A5A");
7282			$select.find('.'+selectclass+'-button > a').removeClass('disabled');
7283			$.Widget.prototype.enable.call(self);
7284		},
7285		disable : function(){
7286			var self = this;
7287			var selectclass=self.options.selectclass;
7288			if(selectclass.length==0){ selectclass='wp-diy-selected';}
7289			var $target = self.element,$select = $target.next('.'+selectclass+'-outside');
7290			// 还原SELECT控件默认值
7291			var firstopt = $target.find('option')[0];
7292			$target[0].selectedIndex = 0;
7293			$select.find('.'+selectclass+'-left').css("color","#7C7C7C").attr("val",firstopt.value).html(firstopt.innerHTML);
7294			$select.find('.'+selectclass+'-button > a').addClass('disabled');
7295			$.Widget.prototype.disable.call(self);
7296		},
7297		destroy : function(){
7298			var self = this;
7299			var selectclass=self.options.selectclass;
7300			if(selectclass.length==0){ selectclass='wp-diy-selected';}
7301			$(document).unbind(namespace);
7302			self.element.next('.'+selectclass+'-outside').unbind(namespace).remove();
7303			$.Widget.prototype.destroy.call(self);
7304		}
7305	});
7306})(jQuery);
7307
7308/**
7309 * 文本框绑定的事件
7310 * event(参数) - 触发回调的本地事件对象
7311 * -> onkeydown: function(event){
7312 * ->
7312 	// do something
7313 * -> }
7314 * -> onkeyup: function(event){
7315 * -> 	// do something
7316 * -> }
7317 * -> onchange: function(event){
7318 * -> 	// do something
7319 * -> }
7320 * -> onfocus: function(event){
7321 * -> 	// do something
7322 * -> }
7323 * -> onblur: function(event){
7324 * -> 	// do something
7325 * -> }
7326 */
7327;(function($,undefined){
7328	var readyToOnBlur = true,
7329	  eventNamespace = '.wpcstinput';
7330	
7331	$.widget('wp.cstinput',{
7332		options : {
7333			value : '', // 文本默认值,
7334			regexp : /^\d+(\.\d+)?$/, // 输入值验证正则
7335			range : [0], // 可输入值范围[min,max](大于0)
7336			maxlength : 4, // 可输入值长度
7337			unit : 'px', // 可输入值单位(像素)
7338			step : 1, // 递增/减步长
7339			style : '', // 显示区域样式
7340			nmnode_style : '', // 文本框父节点样式
7341			btnnode_style : '', // 箭头父节点样式
7342			upbtn_style : '', // 上箭头节点样式
7343			downbtn_style : '', // 下箭头节点样式
7344			complete : function(){} // 方向键的回调函数(第一个参数为当前对象,第二个参数为递增/减的值)
7345		},
7346			
7347		_create : function(){
7348			var $this = this,
7349			  $input = $this.element,
7350			  options = $this.options;
7351			var uistyle = (options.hasOwnProperty('style') && options.style.length) ? ' style="'+options.style+'"' : '',
7352			nmstyle = (options.hasOwnProperty('nmnode_style') && options.nmnode_style.length) ? ' style="'+options.nmnode_style+'"' : '',
7353			btnstyle = (options.hasOwnProperty('btnnode_style') && options.btnnode_style.length) ? ' style="'+options.btnnode_style+'"' : '',
7354			upstyle = (options.hasOwnProperty('upbtn_style') && options.upbtn_style.length) ? ' style="'+options.upbtn_style+'"' : '',
7355			downstyle = (options.hasOwnProperty('downbtn_style') && options.downbtn_style.length) ? ' style="'+options.downbtn_style+'"' : '';
7356			$input.wrap('<div class="wp_cstinput_helper"'+uistyle+' unselectable="on"><div class="nminput_helper"'+nmstyle+' unselectable="on"></div>'
7357			+'<div class="minplus_helper"'+btnstyle+' unselectable="on"><span class="up"'+upstyle+' unselectable="on"></span><span class="down"'+downstyle+' unselectable="on"></span></div></div>');
7358			// Default value
7359			if(options.hasOwnProperty('value') && options.regexp.test(options.value)) $input.focus().val(options.value);
7360			// Maxlength
7361			if(options.hasOwnProperty('maxlength') && /^[1-9]{1}\d*$/.test(options.maxlength)) $input.attr('maxlength',options.maxlength);
7362			// Unit(像素)
7363			if(options.hasOwnProperty('unit') && options.unit.length)
7364			  $input.closest('.wp_cstinput_helper').after('<div class="wp_cstunit_helper" unselectable="on">'+options.unit+'</div>');
7365			
7366			// Bind input events
7367			$.each(['keydown','keyup','change','focus','blur'],function(i,event){
7368				$input.bind(event+eventNamespace,function(e){
7369					if(!readyToOnBlur && (event == 'blur')) return false;
7370					$this._trigger('on'+event, e, null);
7371				});
7372			});
7373
7374			// Bind buttons events
7375			var $buttons, upbtn, downbtn;
7376			$buttons = $this.buttons = $input.closest('.wp_cstinput_helper').find('.minplus_helper > span');
7377			upbtn = $buttons[0];
7378			downbtn = $buttons[1];
7379			$buttons.mousedown(mouseDown).mouseup(mouseUp).mouseout(mouseUp);
7380			
7381			function mouseDown(){
7382				if(options.disabled) return;
7383				var step = (this === upbtn) ? options.step : -options.step;	
7384				$input.focus();
7385				$input.select();
7386				
7387				readyToOnBlur = false;
7388				$this._doCount(step);
7389				return false;
7390			}
7391			
7392			function mouseUp(){
7393				if (!readyToOnBlur) {
7394				//	$this._stopCount();					
7395					readyToOnBlur = true;
7396				}
7397				return false;
7398			}
7399		},
7400		
7401		_doCount : function(step){
7402			var newval,
7403			  range = this.options.range,
7404			  curval = this.element[0].value;
7405			if(!curval.length){ 
7406				// input值为空时,点击值变为0 leiminglin 2014/4/22 
7407				curval = this.element[0].value = 0;
7408			}
7409			newval = this._parseValue(curval) + step;
7410			// 范围限定
7411			if ($.isArray(range) && (range.length > 0)) {
7412				var min,max;
7413				if(typeof range[0] != 'undefined') min = range[0];
7414				if(typeof range[1] != 'undefined') max = range[1];
7415				// 溢出判断
7416				if((step < 0) && (typeof min === 'number') && (newval < min)) newval = min;
7417				if((step > 0) && (typeof max === 'number') && (newval > max)) newval = max;
7418			}
7419			this.element[0].value = newval;
7420			// 绑定方向键的回调函数
7421			if($.isFunction(this.options.complete)) this.options.complete(this.element,newval);
7422		},
7423			
7424		_parseValue : function(numString){
7425			var number = parseFloat(numString);
7426			if(isNaN(number)) return 0;
7427			return number;
7428		},
7429		
7430		enable : function(){
7431			this.buttons.removeClass('cstinput_disabled');
7432			$.Widget.prototype.enable.call(this);
7433		},
7434		
7435		disable : function(){
7436			this.buttons.addClass('cstinput_disabled');
7437			$.Widget.prototype.disable.call(this);
7438		},
7439		
7440		destroy : function(){
7441			var $this = this.element,
7442			  $cstinput_helper = $this.closest('.wp_cstinput_helper');
7443			$this.removeAttr('maxlength').unbind(eventNamespace);
7444			$cstinput_helper.before($this[0]);
7445			$cstinput_helper.siblings('.wp_cstunit_helper').remove().end().remove();
7446			$.Widget.prototype.destroy.call(this);
7447		}
7448	});
7449})(jQuery);
7450
7451// 自定义垂直滚动条 2014/02/07
7452;(function($, undefined){
7453	var namespace = 'simroll',
7454	getMscrollWidth = function(){
7455		var noScroll,scroll,oDiv = document.createElement("DIV");
7456		oDiv.style.cssText = "position:absolute;top:-1000px;width:100px;height:100px;overflow:hidden;";
7457		noScroll = document.body.appendChild(oDiv).clientWidth;
7458		oDiv.style.overflowY = "scroll";
7459		scroll = oDiv.clientWidth;
7460		document.body.removeChild(oDiv);
7461		return noScroll - scroll;
7462	};
7463	$.widget('wp.mscroll', {
7464		options : {
7465			difleft: 0,/*滚动条自定义偏移量*/
7466			maskleft: 0,/*滚动条遮罩层left*/
7467			barleft: 0,/*滚动条滑块left*/
7468			height: 0,/*滚动条height*/
7469			maskbg: '#fff',
7470			maskcname: 'wp-mobile-device-mask',/*滚动条遮罩层class*/
7471			barcname: 'wp-mobile-scrollbar'/*滚动条滑块class*/
7472		},
7473		_create : function(){
7474			var self = this,creatid = '-'+self._getRandomStr(),maskbg = (self.options.maskbg||'').length?'background:'+self.options.maskbg:'',
7475			barstr = '<div id="'+namespace+creatid+'-mask" class="'+self.options.maskcname+'" style="'+maskbg+'"></div>';
7476			barstr += '<div id="'+namespace+creatid+'-bar" class="'+self.options.barcname+'"><span class="pane"></span></div>';
7477			self.options.creatid = creatid;
7478			self.element.before(barstr);
7479			self._setScrollPos(creatid);
7480			self._bindScroll(creatid);
7481		},
7482		_setScrollPos : function(id){
7483			var prefid = namespace+id,barleft = 0,self = this,$target = self.element,
7484			$mask = $target.prevAll('#'+prefid+'-mask'),$bar = $target.prevAll('#'+prefid+'-bar');
7485			$mask.add($bar).css({"left": function(){
7486				var curtype = $(this).attr("id").replace(prefid+'-', '');
7487				if (self.options[curtype+'left']) barleft = self.options[curtype+'left'];
7488				else {
7489					var swidth = getMscrollWidth() || 16;
7490					barleft = self._parseFloat($target.css("left")) + $target.width() - swidth;
7491				}
7492				return barleft+'px';
7493			},"height": ($target.height() + 1)+'px',"visibility": 'visible'});
7494			$bar.css("left", function(){return (barleft + self._parseFloat(self.options.difleft||0))+'px'});
7495		},
7496		_bindScroll : function(id){
7497			var self = this,$target = self.element,$bar = $target.prevAll('#'+namespace+id+'-bar'),paneH = 0,
7498			$spane = $bar.children('span.pane'),containerH = $target.height(),paneContainerH = 0;
7499			$target.bind("scroll."+namespace, function(e){
7500		  		var contentH = this.scrollHeight;$bar.height(self.options.height||containerH);
7501		  		if (containerH < contentH) paneH = self._parseFloat(containerH*containerH / contentH);
7502		  		$spane.height(paneH);
7503		  		var maxtop = containerH - paneH,
7504		  		movey = self._parseFloat(this.scrollTop * containerH / contentH);
7505		  		$spane.css("top", Math.min(movey, maxtop)+'px');
7506		  	}).triggerHandler("scroll."+namespace);
7507			// Pane Handler
7508		  	(function(){
7509		  		var curtop,curpagey;
7510		        $spane.bind("mousedown."+namespace, function(e){
7511		            e.preventDefault();curpagey = e.pageY;
7512		            curtop = self._parseFloat($spane.css("top"));
7513		            $spane.addClass("scrolling");
7514		            $(document).bind("mousemove."+namespace, function(e){
7515			        	if (! $spane.hasClass("scrolling")) return;
7516			        	var newtop = curtop + e.pageY - curpagey,panetop = Math.max(0, newtop),
7517			        	target = $target.get(0),contentH = target.scrollHeight;
7518			        	// Reset pane-top
7519			        	var scrltop = self._parseFloat(panetop * contentH / containerH),
7520			        	maxtop = containerH - $spane.height();
7521			        	if (panetop >= maxtop) scrltop = contentH - target.clientHeight;
7522			        	$target.scrollTop(scrltop);return false;
7523			        }).bind("mouseup."+namespace, function(e){
7524			        	e.preventDefault();$(document).unbind("."+namespace);
7525			        	$(parent.document).unbind(".rmscroll");
7526			        	if (! $spane.hasClass("scrolling")) return;
7527			        	$spane.removeClass("scrolling");
7528			        });
7529			        $(parent.document).bind("mouseup.rmscroll",function(){$(document).unbind("."+namespace)});
7530		        }).bind("mouseup."+namespace, function(e){
7531		        	$(document).unbind("."+namespace);
7532		        	$(parent.document).unbind(".rmscroll");return false;
7533		        });
7534		  	})();
7535		},
7536		_getRandomStr : function(len){
7537		    len = len || 16;
7538		    var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
7539		    maxlen = chars.length,result = '';
7540		    for(var i = 0; i < len; i++){
7541		        result += chars.charAt(Math.floor(Math.random() * maxlen));
7542		    }
7543		    return result;
7544		},
7545		_parseFloat : function(numstr){
7546			var number = parseFloat(numstr);
7547			if (isNaN(number)) return 0;
7548			return number;
7549		},
7550		destroy : function(){
7551			var self = this,prefid = '#'+namespace+self.options.creatid;
7552			$(document).add(self.element).unbind("."+namespace);
7553			self.element.prevAll(prefid+'-mask,'+prefid+'-bar').remove();
7554			$.Widget.prototype.destroy.call(self);
7555		}
7556	});
7557})(jQuery);
7558
7559//js生成guid
7560function fGuid(bOrg)
7561{
7562//	 try
7563//	 {
7564//		 var sGuid=new ActiveXObject('scriptlet.typelib').GUID
7565//	 } 
7566//	 catch(e)
7567//	 { 
7568//		 var sGuid=fGuidCst();
7569//	 }
7570	 var sGuid=fGuidCst();
7571	 if(bOrg) return sGuid;
7572	 return (sGuid+'').replace(/\{|\}|-/g,'');
7573	 
7574	 function fGuidCst()
7575	 {
7576		  var sGuid='';
7577		  for(var i=1; i<=32; i++)
7578		  {
7579			   var nNum=0;
7580			   nNum=parseInt(Math.random()*16);
7581			   sGuid+=nNum.toString(16);
7582			   if(i==8||i==12||i==16||i==20)sGuid+='-';
7583		  }
7584		  return '{'+sGuid.toUpperCase()+'}';
7585	 }
7586}
7587
7588(function(window){
7589	/**
7590	 * 对话框缓存ajax请求
7591	 */
7592	var html_caches={};
7593	
7594	/**
7595	 * Float对话框
7596	 * (String)load_url - 加载的地址
7597	 * (Object)option - 配置项(title|titlebg|contentClass|id|width|height|left|top|isCenter|overlay|showBottom|zIndex|open|close)
7598	 */
7599	function wp_floatpanel(load_url,option){
7600		var config = $.extend({},{
7601			title: 'Title',
7602			titlebg: true,
7603			contentClass: 'wp-panel_outpadding',
7604			id: 'wp-float_panel',
7605			width: 286,
7606			height: 'auto',
7607			left: 5,
7608			top: 60,
7609			isCenter: false,
7610			overlay: false,
7611			isIframe: false,
7612			contain:$('body'),
7613			zIndex: 1000,
7614			showBottom: false,
7615			cache: true,
7616			postbody:false,
7617			swfFix: false,
7618			open: function(){},
7619			close: function(){},
7620			data: option['data']||"{}",
7621		},option||{});
7622		// Remove old panel
7623		var pnl,$pnl,wp_timer,id = config.id,$target = id?$('#'+id):$('.wp-floatpanel_dialog'),$contain=config.contain;
7624		// Init parameters
7625		var rgx = /^\d+$/i,plw = config.width,plh = config.height,pllt = config.left,pltp = config.top,cc = config.contentClass,
7626		ct = config.isCenter,ol = config.overlay,z = config.zIndex,sm = config.showBottom,isfrm = config.isIframe;
7627		if (!$target.size()) {
7628			// Init overlay
7629			var ols = '';
7630			if (ol) {
7631				var $overlay = $('#wp-floatpanel_overlay');
7632				if($overlay.size() > 0) $overlay.remove();
7633				ols = '<div id="wp-floatpanel_overlay" style="z-index:'+z+';"></div>';
7634				z += 1;
7635			}
7636			// Show or not bottom
7637			var sms = '';
7638			if (sm) {
7639				sms += '<div class="wp-show_allpage"><input type="checkbox" name="show_allpage" value="" /><span>'+translate('property.showInBottom')+'</span></div>'
7640				+ '<div class="wp-coordinate"><span>x:<input type="text" name="xpos" value="0" id="xpos" /></span>'
7641				+ '<span>y:<input type="text" name="ypos" value="0" id="ypos" /></span>'
7642				+ '<span class="wp-coordinate-w">w:<input type="text" name="xwidth" value="0" id="xwidth" /></span>'
7643				+ '<span>h:<input type="text" name="xheight" value="0" id="xheight"/></span>'
7644				+ '<span class="wp-coordinate-lock overz"><img src="'+relativeToAbsoluteURL('template/default/images/un-lock.png')+'" width="16" height="15" /></span></div>';
7645			}
7646			// Loading area
7647			var $tmpwin = $(window),$load = $('#wp-floatpanel_loading'),loadstr = '<div id="wp-floatpanel_loading" style="z-index:'+(z-1)+';"><img src="'+relativeToAbsoluteURL('template/default/images/loading.gif')+'" width="16" height="16" /></div>';
7648			if($load.size() > 0) $load.remove();
7649			// Create panel
7650			var superid = $.options ? $.options.superid : 0;
7651			//<img src="'+relativeToAbsoluteURL("template/default/images/wp-help_icon.png")+'" width="16" height="16" class="wp-help" />
7652			var $ap = $('<div id="'+id+'" class="wp-floatpanel_dialog wp-manage_panel overz" style="display:none;position:absolute;z-index:'+z+';" belong="'+(superid||null)+'"><div class="wp-title overz'+(config.titlebg?' wp-title_black':'')+'"><h2>'+config.title+'</h2>'
7653			+'<div class="wp-icon" style="width:19px;"><a href="javascript:;" class="close"></a></div></div>'
7654			+'<div class="'+cc+' overz"></div>'+sms+'</div>'+ols+loadstr).appendTo($contain);
7655			pnl = $ap[0];$pnl = $(pnl);
7656			// Loading position
7657			var winWidth = $tmpwin.width(),pnlWidth = $pnl.width();
7658			$('#wp-floatpanel_loading').width(winWidth).height($tmpwin.height());
7659			// Events
7660			$pnl.draggable({handle: '.wp-title',cancel: '.wp-icon',cursor: 'move',scroll: false,iframeFix: true,start: function(e,ui){
7661				var $target = $(this),titleH = $target.find('.wp-title').outerHeight();
7662				$('.wp-diy-selected-content').slideUp().remove();// 拖拽弹窗时注销“自定义SELECT下拉框” 2012/11/09
7663				// SWF object ghost lines
7664				if (config.swfFix) {
7665					var $swf = $target.find('object');
7666					if ($swf.length > 0) {
7667						$swf.parent().data("wpswfsize",{"width": $swf.width(),"height": $swf.height()});
7668						$swf.css({"height": '0',"width": '0',"visibility": 'hidden'});
7669					}
7670					$swf = null;
7671				}
7672				if ($target.find('iframe').length > 0) {
7673					var $innerfrm = $target.find('.ui-resizable-innerIframeFix');
7674					($innerfrm.length > 0) && $innerfrm.remove();
7675					$('<div class="ui-resizable-innerIframeFix" style="background-color:#FFF;"></div>').css({
7676						left: 0,top: titleH+'px',position: 'absolute',opacity: '0.001',zIndex: 1000,
7677						width: $target.width()+'px', height: ($target.height() - titleH)+'px'
7678					}).appendTo($target);
7679				}
7680			},drag: function(e,ui){
7681				var pos = ui.position;// 防溢出 2012/10/29
7682				if(pos.top < 0) pos.top = 0;
7683				if(pos.left <0) pos.left = 0;
7684				if(winWidth < pnlWidth + pos.left) pos.left = winWidth - pnlWidth;
7685			},stop: function(){
7686				var $innerfrm = $('.ui-resizable-innerIframeFix', this);
7687				($innerfrm.length > 0) && $innerfrm.remove();
7688				// SWF object ghost lines
7689				if (config.swfFix) {
7690					var $swf = $(this).find('object');
7691					if ($swf.length > 0) {
7692						var $swfprt = $swf.parent(),swfsize = $swfprt.data('wpswfsize');
7693						$swf.css({"height": (swfsize.height||24)+'px',"width": (swfsize.width||82)+'px',"visibility": 'visible'});
7694						$swfprt.removeData('wpswfsize');$swfprt = swfsize = null;
7695					}
7696					$swf = null;
7697				}
7698			}}).bind('wpdialogclose',function(e){
7699				$pnl = {};// 注销$pnl对象
7700				clearTimeout(wp_timer);
7701				var dom = $(e.target);
7702				if(ol) dom = dom.add('#wp-floatpanel_overlay');
7703				if($.isFunction(config.close)) config.close(dom[0]);
7704				$(document).trigger('click');//IE8中无法移除cstselect插件的div.wp-diy-selected-content
7705				return dom.add('#wp-floatpanel_loading').remove();
7706			});
7707		} else {
7708			$pnl = $target;
7709			pnl = $target[0];
7710		}
7711		// Load content
7712		$.Deferred(function(dtd){
7713			// Modal setting
7714			if (isfrm == false) {
7715				if(config.cache && html_caches[load_url]){
7716					var data=html_caches[load_url];
7717					dtd.resolve(data);
7718				}else{
7719					var ajaxopts={};
7720					if(config.postbody)  ajaxopts={data:config.postbody};
7721					$.ajax($.extend({
7722						type: "POST",url: load_url,
7723						data: config.data,
7724						beforeSend: function(){
7725							// 取消全局设置属性以修复IE“闪屏”问题 2012/10/30
7726						},success: function(data){
7727							if(data.length > 0){
7728								if(data == 'Session expired')
7729									window.location.href = getSessionExpiredUrl();
7730								dtd.resolve(data);
7731								if(config.cache) html_caches[load_url]=data;
7732							} 
7733							else dtd.reject();
7734						},error: function(xhr, textStatus, errorThrown){
7735							wp_alert((errorThrown||textStatus)+'('+config.title+')'+".<br/>"+translate('Request failed!')); 
7736							$pnl.triggerHandler('wpdialogclose');
7737							return false;
7738						}
7739					},ajaxopts));
7740				}
7741			} else {
7742				var frmw = plw - 26/*左右padding值为2*13px*/,frame = '<div class="wp-iframe_beforloaded"><img src="'+relativeToAbsoluteURL('template/default/images/loading.gif')+'" width="16" height="16" /></div>'
7743				+'<iframe id="'+id+'_frame" name="'+id+'_frame" allowtransparency="true" frameborder="0" src="'+load_url+'" scrolling="auto" width="'+frmw+'" onload="this.height=200;$(\'.wp-iframe_beforloaded\',\'#'+id+'\').remove();initFrame(this,\''+cc+'\',\''+plh+'\');"></iframe>';
7744				dtd.resolve(frame);
7745			}
7746			return dtd.promise();
7747		}).done(function(data){
7748			$('#wp-floatpanel_loading').remove();
7749			// Append innerHTML
7750			var ocs = {};
7751			$('.'+cc,pnl).html(data);
7752			if(rgx.test(plw)) ocs['width'] = plw+'px';
7753			if(rgx.test(plh)) ocs['height'] = plh+'px';
7754			// Reset position
7755			if (ct || ol) {
7756				$pnl.show().css(ocs);
7757				wp_timer = setTimeout(function(){
7758					$pnl.triggerHandler('wpdialogsetpos');
7759				},30);
7760				// Bind window resize
7761				$(window).resize(function(){
7762					panel_position($pnl,plw,plh,ol,'wp-floatpanel_overlay');
7763				});
7764				$pnl.bind('wpdialogsetpos',function(e){
7765					panel_position($pnl,plw,plh,ol,'wp-floatpanel_overlay');
7766				});
7767			} else {
7768				if(rgx.test(pllt)) ocs['left'] = pllt+'px';
7769				if(rgx.test(pltp)) ocs['top'] = pltp+'px';
7770				$pnl.css(ocs).show();//.animate(ocs,'slow');
7771			}
7772			config.open(pnl);
7773		}).fail(function(){
7774			wp_alert(config.title+"(deferred fail).<br/>"+translate('Request failed!')); 
7775			$pnl.triggerHandler('wpdialogclose');
7776			return false;
7777		});
7778		// Bind close events
7779		$('.wp-title a.close',pnl).bind('click',function(e){
7780			$pnl.triggerHandler('wpdialogclose');
7781			// IE下禁止触发onbeforeunload
7782			e.preventDefault();
7783		});
7784		return null;
7785	}
7786	window.wp_floatpanel=wp_floatpanel;
7787})(window);
7788
7789// Dialog定位
7790function panel_position(dom,width,height,isoverlay,overlayid){
7791	if(dom instanceof jQuery == false) return;
7792	var $target = dom,/*$win = $(window),*/tpw = $target.outerWidth(true),tph = $target.outerHeight(true),
7793	floor = Math.floor,rgx = /^\d+$/i,ocs = {};
7794	var scrolltop=$(document).scrollTop();
7795	// Parse
7796	if(rgx.test(height)) tph = height;
7797	tpw = Math.max(tpw,width);
7798//	var wnw = $win.width(),wnh = $win.height();
7799	var wnw = window.innerWidth || self.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
7800	wnh = window.innerHeight || self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
7801	pltp = floor((wnh - tph)/2);
7802	pllt = floor((wnw - tpw)/2);
7803	// Overlay
7804	if(isoverlay) $('#'+overlayid).width(wnw).height(wnh);
7805	// Panel
7806	ocs['left'] = pllt+'px';
7807	ocs['top'] = ((pltp>0?pltp:0)+scrolltop)+'px';
7808	$target.css(ocs);//animate(ocs,'slow');
7809//	return ocs;
7810}
7811
7812$._parseFloat = function(numString){
7813	var number = parseFloat(numString);
7814	if(isNaN(number)) return 0;
7815	return number;
7816}
7817
7818function fix_img_url_path(imgurl){
7819	var escapeRegExp = (function () {
7820		var specials = [ '-','[',']', '/','{', '}', '(',')', '*','+','?', '.','\\', '^','$', '|' ];
7821		var regex = new RegExp('[' + specials.join('\\') + ']', 'g'); 
7822		return function escapeRegExp(str) {
7823			return str.replace(regex, '\\$&');
7824		};
7825	})();
7826	var imgfilenameregxp=/\/([^\/]+)$/;
7827	var matches=imgurl.match(imgfilenameregxp);
7828	var codedimgurl='';
7829	if(matches){
7830		var oldfilename=matches[1];
7831		var newfilename=encodeURIComponent(oldfilename);
7832		var oldfileregexp=new RegExp(escapeRegExp(oldfilename)+'$');
7833		codedimgurl=imgurl.replace(oldfileregexp,newfilename);
7834	}else{
7835		codedimgurl=encodeURIComponent(imgurl);
7836	}
7837	return codedimgurl;
7838}
7839
7840/**
7841* 图片自适应 居中显示
7842*/
7843function set_pic(obj) {
7844	var img = new Image();
7845	img.src =$(obj).attr("src"); 
7846	var width=img.width;
7847	var height=img.height;
7848	if(width==0){
7849		width=107;
7850	}
7851	if(height==0){
7852		height=107;
7853	}
7854	var W=107;
7855	var H=107;
7856	var _width=107;
7857	var _height=107;
7858	var _top=0;
7859	if(width>height){
7860		_height=(height*H)/width;
7861		_top= (W-_height)/2;
7862		$(obj).attr('style','width: ' + _width + 'px;height:'+_height+'px;');
7863		$(obj).parent().css('top', _top);
7864	}else{
7865		_width=(width*H)/height;
7866		_top= (W-_width)/2;
7867		$(obj).attr('style','width: ' + _width + 'px;height:'+_height+'px;left:'+_top+'px;');
7868		$(obj).parent().css({'top':0,'left':_top});
7869	}
7870	
7871}	
7872
7873/**
7874 * 手机站弹窗(模拟新窗口打开) 2014/06/09
7875 */
7876function msite_popup(url){
7877	var $container = $('#scroll_container'),maxh = $(window).height(),
7878	bgimg = relativeToAbsoluteURL('template/default/images/loading.gif'),
7879	css = 'position:absolute;top:0;left:0;width:320px;overflow:hidden;z-index:10000',
7880	ihtml = '<div class="mspopup_mask" style="background:url('+bgimg+') no-repeat 50% 20% #fff;height:'
7881	+maxh+'px;'+css+'"><iframe allowtransparency="true" frameborder="0" scrolling="no" width="320" height="'
7882	+maxh+'" src="'+url+'" onload="mspopup_onload(this)"></iframe></div>';
7883	
7884	var $mask = $container.children('.mspopup_mask');
7885	if(! $mask.length) $container.append(ihtml).attr("data-height", $container.height()).height(maxh);
7886}
7887
7888function mspopup_onload(win){
7889	win.height = 'auto';
7890	var bodh = win.contentWindow.document.body.scrollHeight,
7891	doch = win.contentWindow.document.documentElement.scrollHeight,
7892	maxheight = Math.max(bodh, doch);
7893	
7894	// Reset height
7895	win.height = maxheight;
7896	$(win).parent('.mspopup_mask').height(maxheight)
7897	.parent('#scroll_container').height(maxheight);
7898}
7899
7900function create_pc_media_set_pic(layer_id,editmode){
7901	var func=function(obj) {
7902		var callback=function(img){
7903				img.show();
7904				img.closest('.img_over').children('.imgloading').remove();
7905				if(!editmode){
7906					$(function(){			
7907						var super_id=layer_id;
7908						var dom_img=$("#"+super_id).find('.paragraph_image');
7909						var left_img=parseInt(dom_img.css('left'));
7910						var top_img=parseInt(dom_img.css('top'));
7911						var width_img=parseInt(dom_img.css("width"));
7912						var height_img=parseInt(dom_img.css("height"));
7913						if(isNaN(left_img)){ left_img=0; }
7914						if(isNaN(top_img)){ top_img=0; }
7915						var ii=0;
7916						$("#"+super_id).find(".wp_mapclass").each(function(){
7917							var shape="rect";
7918							shape=$(this).attr('shape');
7919							if(shape != "circle"){
7920								shape="rect";
7921							}
7922
7923							var leftz=parseInt($(this).css("left"));
7924							var topz=parseInt($(this).css("top"));
7925							var widthz=parseInt($(this).css("width"));
7926							var heightz=parseInt($(this).css("height"));
7927
7928							if(shape != "circle"){
7929								var coords='0,0,0,0';
7930							}else{
7931								var coords='0,0,0';
7932							}		
7933							if( (leftz+widthz) < left_img || (topz+heightz)< top_img){
7934							}else{
7935								var cleft=0;
7936								var ctop=0;
7937								var r=0;
7938								if(shape != "circle"){
7939									cleft=leftz-left_img;
7940									ctop=topz-top_img;
7941									coords=cleft+','+ctop+','+(cleft+widthz)+','+(ctop+heightz);
7942								}else{
7943									r=widthz/2;
7944									cleft=leftz-left_img+r;
7945									ctop=topz-top_img+r;
7946									coords=cleft+','+ctop+','+r;
7947								}
7948							}	
7949
7950							//var classid=$(this).attr('id');
7951							var classid="map_arear_"+ii;
7952							ii++;
7953							var mapd=$(this).parent().find("."+classid);
7954							mapd.attr('coords',coords);
7955							$(this).remove();
7956
7957						});
7958					})
7959				}
7960		}
7961		$(obj).each(function() {
7962			var img=$(this);
7963			callback(img);
7964		});      
7965	}
7966	window['set_thumb_'+layer_id]=func;
7967};
7968function wp_heightAdapt(E,U){if(E==undefined){return false}if($.inArray(E.attr("type"),["bslider"])!=-1){return}var R=function(){var i=E.data("oriheight");if(!i){i=E.children("div").eq(0).height();E.data("oriheight",i)}return i};var e=function(m){var u=m.data("adaptoritop");var l=m.data("adaptoriheight");var r=m.data("adaptpress");var j=m.data("adaptwrap");var q=E.prop("id");var o=$.parseInteger(m.css("top"));if(!u&&u!==0){m.data("adaptoritop",o);m.data("adaptoriheight",m.height());return}if(r&&r.length){for(var n=0;n<r.length;n++){var t=r[n];if(t.id!=q){u+=t.diffY}}}if(j&&j.length){var p=l;for(var n=0;n<j.length;n++){var k=j[n];if(k.id!=q){p+=k.diffH}}if(p!=m.height()){m.css("height",p+"px");var v=parseInt(m.children("div").eq(0).css("padding-top"))+parseInt(m.children("div").eq(0).css("padding-bottom"));var s=parseInt(m.children("div").eq(0).css("border-top-width"))+parseInt(m.children("div").eq(0).css("border-bottom-width"));m.children("div").eq(0).height(m.height()-v-s)}}if(u!=o){m.css("top",u+"px")}};var J=$("#canvas").data("adaptoriheight");if(!J){$("#canvas").data("adaptoriheight",$("#canvas").height());J=$("#canvas").data("adaptoriheight")}var C=R();var H=E.children("div").eq(0).height();e(E);E.children("div").eq(0).css("height","auto");var W=E.children("div").eq(0).height();if(W<C){E.children("div").eq(0).css("height",C+"px");if(C==H){return}}else{var B=parseInt(E.children("div").eq(0).css("border-top-width"))+parseInt(E.children("div").eq(0).css("border-bottom-width"));if(B>0){W=W-B}E.children("div").eq(0).css("height",W+"px");if(W==H){return}}var A=parseInt(E.children("div").eq(0).css("padding-top"))+parseInt(E.children("div").eq(0).css("padding-bottom"));var S=parseInt(E.children("div").eq(0).css("border-top-width"))+parseInt(E.children("div").eq(0).css("border-bottom-width"));var V=U||C+A+S;var a=E.children("div").eq(0).outerHeight();var L=E.outerWidth();var K=E.ab_pos_cnter("top");var G=E.ab_pos_cnter("left");var Y=G+E.outerWidth();var g=0;var M=new Array();var P=new Array();var f=0,N=0;var O=0;$("#canvas").find(".cstlayer,.full_column").each(function(){e($(this));var i=$(this).ab_pos_cnter("left"),k=$(this).ab_pos_cnter("top"),j=$(this).outerWidth(),l=$(this).outerHeight();if($(this).hasClass("cstlayer")){if(i+j<G){return true}if(i>Y){return true}if(E.attr("id")==$(this).attr("id")){return true}if((i<=G&&i+j>=Y)&&(k<=K&&k+l>=K+V)){P.push($(this).attr("id"));return true}if($(this).parent().hasClass("full_content")||$(this).parent().hasClass("footer_content")){return true}}if(k>=(K+V)){M.push($(this).attr("id"));if(f==0){f=k;N=$(this).attr("id")}else{if(f>k){f=k;N=$(this).attr("id")}}}});g=$("#"+N).ab_pos_cnter("top")-(K+V);if(M.length>0&&(K+a)>=f){O=K+a+g-f;for(var d=0;d<M.length;d++){var Z=$("#"+M[d]);Z.css("top",(parseInt(Z.ab_pos_cnter("top"))+O)+"px");var b=Z.data("adaptpress");if(!b){b=[]}var D=[];for(var c=0;c<b.length;c++){if(b[c].id!=E.prop("id")){D.push(b[c])}}D.push({id:E.prop("id"),diffY:O});Z.data("adaptpress",D)}}if(P.length>0){for(var d=0;d<P.length;d++){var T=a-V;var Z=$("#"+P[d]);Z.height($("#"+P[d]).height()+(T));var F=parseInt(Z.children("div").eq(0).css("padding-top"))+parseInt($("#"+P[d]).children("div").eq(0).css("padding-bottom"));var I=parseInt(Z.children("div").eq(0).css("border-top-width"))+parseInt($("#"+P[d]).children("div").eq(0).css("border-bottom-width"));Z.children("div").eq(0).height(Z.height()-F-I);var Q=Z.data("adaptwrap");if(!Q){Q=[]}var X=[];for(var c=0;c<Q.length;c++){if(Q[c].id!=E.prop("id")){X.push(Q[c])}}X.push({id:E.prop("id"),diffH:T});Z.data("adaptwrap",X)}}if(E.attr("type")=="fxdp"){E.height(E.children("div").eq(0).height()+A+S+50)}else{E.height(E.children("div").eq(0).height()+A+S)}var h=$("#canvas").height();if(h!=J){$("#canvas").css("height",J)}scroll_container_adjust()};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.