/*! jQuery v1.7.1 jquery.com | jquery.org/license */ (function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(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;g0){if(c!=="border")for(;g=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)?parseFloat(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)[^>]*$|#([\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.1",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(;j0)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&&typeof a=="object"&&"setInterval"in a},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){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(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?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
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.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:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});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-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.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];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=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=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){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),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=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;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?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;h0){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+~,(\[\\]+)+|[>+~])(\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;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=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 bc[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=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));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.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.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="

";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="
";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;h0)for(h=g;h=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-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|canvas|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:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_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
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},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.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){if(a===b)return this[0]&&this[0].nodeType===1?this[0].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>");try{for(var c=0,d=this.length;c1&&l0?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||!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;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.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(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$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)));return c}),c.documentElement.currentStyle&&(bB=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)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,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)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.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("
").append(c.replace(bN,"")).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||bO.test(this.nodeName)||bI.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(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\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:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},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:bZ(bT),ajaxTransport:bZ(bU),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?cb(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=cc(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=bH.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(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.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]!=="*"?", "+bX+"; 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=b$(bU,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)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.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(ce,l),b.url===j&&(e&&(k=k.replace(ce,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 cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,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,cf&&delete ch[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),m.text=h.responseText;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=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=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-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(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); /*! * jQuery UI 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI */ (function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.16", 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}});c.fn.extend({propAttr:c.fn.prop||c.fn.attr,_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d= this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this, "overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart": "mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight, outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a, "tabindex"),d=isNaN(b);return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&& a.element[0].parentNode)for(var e=0;e0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted= false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_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(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); ;/* * jQuery UI Position 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Position */ (function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY, left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+= k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-= m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left= d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+= a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b), g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery); ;/* * jQuery UI Draggable 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Draggables * * Depends: * jquery.ui.core.js * jquery.ui.mouse.js * jquery.ui.widget.js */ (function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== "original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;if(b.iframeFix)d(b.iframeFix===true?"iframe":b.iframeFix).each(function(){d('
').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")});return true},_mouseStart:function(a){var b=this.options; this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}); this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,a);return true}, _mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b= false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration, 10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},_mouseUp:function(a){this.options.iframeFix===true&&d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});d.ui.ddmanager&&d.ui.ddmanager.dragStop(this,a);return d.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle|| !d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone().removeAttr("id"):this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&& a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent= this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"), 10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"), 10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[a.containment=="document"?0:d(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a.containment=="document"?0:d(window).scrollTop()-this.offset.relative.top-this.offset.parent.top, (a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){a=d(a.containment);var b=a[0];if(b){a.offset();var c=d(b).css("overflow")!= "hidden";this.containment=[(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"), 10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=a}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+ this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&& !(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,h=a.pageY;if(this.originalPosition){var g;if(this.containment){if(this.relative_container){g=this.relative_container.offset();g=[this.containment[0]+g.left,this.containment[1]+g.top,this.containment[2]+g.left,this.containment[3]+g.top]}else g=this.containment;if(a.pageX-this.offset.click.leftg[2])e=g[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>g[3])h=g[3]+this.offset.click.top}if(b.grid){h=b.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/b.grid[1])*b.grid[1]:this.originalPageY;h=g?!(h-this.offset.click.topg[3])?h:!(h-this.offset.click.topg[2])?e:!(e-this.offset.click.left=0;i--){var j=c.snapElements[i].left,l=j+c.snapElements[i].width,k=c.snapElements[i].top,m=k+c.snapElements[i].height;if(j-e=j&&f<=l||h>=j&&h<=l||fl)&&(e>= i&&e<=k||g>=i&&g<=k||ek);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f
').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".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"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),l=0;l=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,l);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection(); this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){if(!a.disabled){e(this).removeClass("ui-resizable-autohide");b._handles.show()}},function(){if(!a.disabled)if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy(); var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a= false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"}); this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff= {width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio:this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis]; if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize",b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false}, _mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height;f=f?0:c.sizeDiff.width;f={width:c.helper.width()-f,height:c.helper.height()-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f, {top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",b);this._helper&&this.helper.remove();return false},_updateVirtualBoundaries:function(b){var a=this.options,c,d,f;a={minWidth:k(a.minWidth)?a.minWidth:0,maxWidth:k(a.maxWidth)?a.maxWidth:Infinity,minHeight:k(a.minHeight)?a.minHeight:0,maxHeight:k(a.maxHeight)?a.maxHeight: Infinity};if(this._aspectRatio||b){b=a.minHeight*this.aspectRatio;d=a.minWidth/this.aspectRatio;c=a.maxHeight*this.aspectRatio;f=a.maxWidth/this.aspectRatio;if(b>a.minWidth)a.minWidth=b;if(d>a.minHeight)a.minHeight=d;if(cb.width,h=k(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height,l=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&l)b.left=i-a.minWidth;if(d&&l)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left= null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+ a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+ c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]); b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,{version:"1.8.16"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(), 10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top- f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var l=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:l.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n=(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(l.css("position"))){c._revertToRelativePosition=true;l.css({position:"absolute",top:"auto",left:"auto"})}l.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType? e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition=false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a= e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing, step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement= e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top","Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset; var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset,f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left: a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top- d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition, f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25, display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b= e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height= d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},k=function(b){return!isNaN(parseInt(b,10))}})(jQuery); ;/* * jQuery UI Selectable 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Selectables * * Depends: * jquery.ui.core.js * jquery.ui.mouse.js * jquery.ui.widget.js */ (function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("
")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX, c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting", c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d= this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.righti||a.bottomb&&a.rightg&&a.bottom *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){var a=this.options;this.containerCache={};this.element.addClass("ui-sortable"); this.refresh();this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a=== "disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&& !b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem=c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top, left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]}; this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!= document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a); return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0], e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a,c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset(); c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"): this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null, dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")}, toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+jg&&b+la[this.floating?"width":"height"]?j:g0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith(); if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h=0;b--){var c=this.items[b];if(!(c.instance!=this.currentContainer&&this.currentContainer&&c.item[0]!=this.currentItem[0])){var e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b= this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f= d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")|| 0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out", a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h- f)this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g- this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?f:!(f-this.offset.click.left=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this, this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop", a,this._uiHash());for(e=0;e li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"); a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom"); if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var h=d.closest(".ui-accordion-header");a.active=h.length?h:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion", function(f){return a._keydown(f)}).next().attr("role","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(f){a._clickHandler.call(a,f,this);f.preventDefault()})},_createIcons:function(){var a= this.options;if(a.icons){c("").addClass("ui-icon "+a.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"); this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons(); b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,h=this.headers.index(a.target),f=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:f=this.headers[(h+1)%d];break;case b.LEFT:case b.UP:f=this.headers[(h-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target); a.preventDefault()}if(f){c(a.target).attr("tabIndex",-1);c(f).attr("tabIndex",0);f.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+ c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options; if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){var h=this.active;j=a.next();g=this.active.next();e={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):j,oldContent:g};var f=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(j,g,e,b,f);h.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header); if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);a.next().addClass("ui-accordion-content-active")}}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var g=this.active.next(), e={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:g},j=this.active=c([]);this._toggle(j,g,e)}},_toggle:function(a,b,d,h,f){var g=this,e=g.options;g.toShow=a;g.toHide=b;g.data=d;var j=function(){if(g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data);g.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&h?{toShow:c([]),toHide:b,complete:j,down:f,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:f,autoHeight:e.autoHeight|| e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;h=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!h[k]&&!c.easing[k])k="slide";h[k]||(h[k]=function(l){this.slide(l,{easing:k,duration:i||700})});h[k](d)}else{if(e.collapsible&&h)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false", "aria-selected":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.16", animations:{slide:function(a,b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),h=0,f={},g={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){g[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/); f[i]={value:j[1],unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(g,{step:function(j,i){if(i.prop=="height")h=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=h*f[i.prop].value+f[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide", paddingTop:"hide",paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery); ;/* * jQuery UI Autocomplete 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Autocomplete * * Depends: * jquery.ui.core.js * jquery.ui.widget.js * jquery.ui.position.js */ (function(d){var e=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.propAttr("readOnly"))){g= false;var f=d.ui.keyCode;switch(c.keyCode){case f.PAGE_UP:a._move("previousPage",c);break;case f.PAGE_DOWN:a._move("nextPage",c);break;case f.UP:a._move("previous",c);c.preventDefault();break;case f.DOWN:a._move("next",c);c.preventDefault();break;case f.ENTER:case f.NUMPAD_ENTER:if(a.menu.active){g=true;c.preventDefault()}case f.TAB:if(!a.menu.active)return;a.menu.select(c);break;case f.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!= a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay);break}}}).bind("keypress.autocomplete",function(c){if(g){g=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)}; this.menu=d("
    ").addClass("ui-autocomplete").appendTo(d(this.options.appendTo||"body",b)[0]).mousedown(function(c){var f=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(h){h.target!==a.element[0]&&h.target!==f&&!d.ui.contains(f,h.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,f){f=f.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:f})&&/^key/.test(c.originalEvent.type)&& a.element.val(f.value)},selected:function(c,f){var h=f.item.data("item.autocomplete"),i=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=i;setTimeout(function(){a.previous=i;a.selectedItem=h},1)}false!==a._trigger("select",c,{item:h})&&a.element.val(h.value);a.term=a.element.val();a.close(c);a.selectedItem=h},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"); d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0]);a==="disabled"&& b&&this.xhr&&this.xhr.abort()},_initSource:function(){var a=this,b,g;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,f){f(d.ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source==="string"){g=this.options.source;this.source=function(c,f){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:g,data:c,dataType:"json",autocompleteRequest:++e,success:function(h){this.autocompleteRequest===e&&f(h)},error:function(){this.autocompleteRequest===e&&f([])}})}}else this.source= this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length").data("item.autocomplete",b).append(d("").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.element}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&")},filter:function(a,b){var g=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return g.test(c.label||c.value||c)})}})})(jQuery); (function(d){d.widget("ui.menu",{_create:function(){var e=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(a){if(d(a.target).closest(".ui-menu-item a").length){a.preventDefault();e.select(a)}});this.refresh()},refresh:function(){var e=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex", -1).mouseenter(function(a){e.activate(a,d(this).parent())}).mouseleave(function(){e.deactivate()})},activate:function(e,a){this.deactivate();if(this.hasScroll()){var b=a.offset().top-this.element.offset().top,g=this.element.scrollTop(),c=this.element.height();if(b<0)this.element.scrollTop(g+b);else b>=c&&this.element.scrollTop(g+b-c+a.height())}this.active=a.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",e,{item:a})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id"); this._trigger("blur");this.active=null}},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},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(e,a,b){if(this.active){e=this.active[e+"All"](".ui-menu-item").eq(0);e.length?this.activate(b,e):this.activate(b,this.element.children(a))}else this.activate(b, this.element.children(a))},nextPage:function(e){if(this.hasScroll())if(!this.active||this.last())this.activate(e,this.element.children(".ui-menu-item:first"));else{var a=this.active.offset().top,b=this.element.height(),g=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-a-b+d(this).height();return c<10&&c>-10});g.length||(g=this.element.children(".ui-menu-item:last"));this.activate(e,g)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active|| this.last()?":first":":last"))},previousPage:function(e){if(this.hasScroll())if(!this.active||this.first())this.activate(e,this.element.children(".ui-menu-item:last"));else{var a=this.active.offset().top,b=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var g=d(this).offset().top-a+b-d(this).height();return g<10&&g>-10});result.length||(result=this.element.children(".ui-menu-item:first"));this.activate(e,result)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active|| this.first()?":last":":first"))},hasScroll:function(){return this.element.height()").addClass("ui-button-text").html(this.options.label).appendTo(a.empty()).text(),e=this.options.icons,f=e.primary&&e.secondary,d=[];if(e.primary||e.secondary){if(this.options.text)d.push("ui-button-text-icon"+(f?"s":e.primary?"-primary":"-secondary"));e.primary&&a.prepend("");e.secondary&&a.append("");if(!this.options.text){d.push(f?"ui-button-icons-only": "ui-button-icon-only");this.hasTitle||a.attr("title",c)}}else d.push("ui-button-text-only");a.addClass(d.join(" "))}}});b.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(a,c){a==="disabled"&&this.buttons.button("option",a,c);b.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var a=this.element.css("direction")=== "ltr";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(a?"ui-corner-left":"ui-corner-right").end().filter(":last").addClass(a?"ui-corner-right":"ui-corner-left").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"); b.Widget.prototype.destroy.call(this)}})})(jQuery); ;/* * jQuery UI Dialog 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Dialog * * Depends: * jquery.ui.core.js * jquery.ui.widget.js * jquery.ui.button.js * jquery.ui.draggable.js * jquery.ui.mouse.js * jquery.ui.position.js * jquery.ui.resizable.js */ (function(c,l){var m={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},n={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},o=c.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false, position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("
    ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+ b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&!i.isDefaultPrevented()&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("
    ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g), h=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("").addClass("ui-dialog-title").attr("id", e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!== b.uiDialog[0]){e=c(this).css("z-index");isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()};c.ui.dialog.maxZ+=1; d.uiDialog.css("z-index",c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target=== f[0]&&e.shiftKey){g.focus(1);return false}}});c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("
    ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("
    ").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a, function(){return!(d=true)});if(d){c.each(a,function(f,h){h=c.isFunction(h)?{click:h,text:f}:h;var i=c('').click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.each(h,function(j,k){if(j!=="click")j in o?i[j](k):i.attr(j,k)});c.fn.button&&i.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close", handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition, originalSize:f.originalSize,position:f.position,size:f.size}}a=a===l?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize", f,b(h))},stop:function(f,h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "): [a[0],a[1]];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f); if(g in m)e=true;if(g in n)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"): e.removeClass("ui-dialog-disabled");break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||" "));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a= this.options,b,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height- b,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.16",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "), create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&& c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(b.range==="min"||b.range==="max"?" ui-slider-range-"+b.range:""))}for(var j=c.length;j"); this.handles=c.add(d(e.join("")).appendTo(a.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)d(this).blur();else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(g){d(this).data("index.ui-slider-handle", g)});this.handles.keydown(function(g){var k=true,l=d(this).data("index.ui-slider-handle"),i,h,m;if(!a.options.disabled){switch(g.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:k=false;if(!a._keySliding){a._keySliding=true;d(this).addClass("ui-state-active");i=a._start(g,l);if(i===false)return}break}m=a.options.step;i=a.options.values&&a.options.values.length? (h=a.values(l)):(h=a.value());switch(g.keyCode){case d.ui.keyCode.HOME:h=a._valueMin();break;case d.ui.keyCode.END:h=a._valueMax();break;case d.ui.keyCode.PAGE_UP:h=a._trimAlignValue(i+(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=a._trimAlignValue(i-(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(i===a._valueMax())return;h=a._trimAlignValue(i+m);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(i===a._valueMin())return;h=a._trimAlignValue(i- m);break}a._slide(g,l,h);return k}}).keyup(function(g){var k=d(this).data("index.ui-slider-handle");if(a._keySliding){a._keySliding=false;a._stop(g,k);a._change(g,k);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},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(a){var b=this.options,c,f,e,j,g;if(b.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:a.pageX,y:a.pageY});f=this._valueMax()-this._valueMin()+1;j=this;this.handles.each(function(k){var l=Math.abs(c-j.values(k));if(f>l){f=l;e=d(this);g=k}});if(b.range===true&&this.values(1)===b.min){g+=1;e=d(this.handles[g])}if(this._start(a,g)===false)return false; this._mouseSliding=true;j._handleIndex=g;e.addClass("ui-state-active").focus();b=e.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-e.width()/2,top:a.pageY-b.top-e.height()/2-(parseInt(e.css("borderTopWidth"),10)||0)-(parseInt(e.css("borderBottomWidth"),10)||0)+(parseInt(e.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(a,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(a){var b= this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,b);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b;if(this.orientation==="horizontal"){b= this.elementSize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}b=a/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation==="vertical")b=1-b;a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*a)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(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 f;if(this.options.values&&this.options.values.length){f=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c>f||b===1&&c1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}else if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;f=arguments[0];for(e=0;e=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b;a=a-c;if(Math.abs(c)*2>=b)a+=c>0?b:-b;return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a= this.options.range,b=this.options,c=this,f=!this._animateOff?b.animate:false,e,j={},g,k,l,i;if(this.options.values&&this.options.values.length)this.handles.each(function(h){e=(c.values(h)-c._valueMin())/(c._valueMax()-c._valueMin())*100;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";d(this).stop(1,1)[f?"animate":"css"](j,b.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(h===0)c.range.stop(1,1)[f?"animate":"css"]({left:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({width:e- g+"%"},{queue:false,duration:b.animate})}else{if(h===0)c.range.stop(1,1)[f?"animate":"css"]({bottom:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({height:e-g+"%"},{queue:false,duration:b.animate})}g=e});else{k=this.value();l=this._valueMin();i=this._valueMax();e=i!==l?(k-l)/(i-l)*100:0;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[f?"animate":"css"](j,b.animate);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[f?"animate":"css"]({width:e+"%"}, b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-e+"%"},{queue:false,duration:b.animate});if(a==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":"css"]({height:e+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-e+"%"},{queue:false,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.16"})})(jQuery); ;/* * jQuery UI Tabs 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Tabs * * Depends: * jquery.ui.core.js * jquery.ui.widget.js */ (function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
    ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
  • #{label}
  • "},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&& e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b= d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]|| (q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected= this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))[0]))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")); this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+ g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal", function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")}; this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected= -1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier."; d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e= d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b, e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]); j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove(); if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null, this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this}, load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c, "cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this}, url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.16"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k'))}function N(a){return a.bind("mouseout", function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");b.length&&b.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!(d.datepicker._isDisabledDatepicker(J.inline?a.parent()[0]:J.input[0])||!b.length)){b.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"); b.addClass("ui-state-hover");b.hasClass("ui-datepicker-prev")&&b.addClass("ui-datepicker-prev-hover");b.hasClass("ui-datepicker-next")&&b.addClass("ui-datepicker-next-hover")}})}function H(a,b){d.extend(a,b);for(var c in b)if(b[c]==null||b[c]==C)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.16"}});var B=(new Date).getTime(),J;d.extend(M.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv}, setDefaults:function(a){H(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g, "\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:N(d('
    '))}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker", function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b);b.settings.disabled&&this._disableDatepicker(a)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&b.append.remove();if(c){b.append=d(''+c+"");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c== "focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('').addClass(this._triggerClass).html(f==""?c:d("").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker(): d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;gh){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a, b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b);this._updateAlternate(b);b.settings.disabled&&this._disableDatepicker(a);b.dpDiv.css("display","block")}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+= 1;this._dialogInput=d('');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}H(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/ 2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b= d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e= a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().removeClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a, "datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().addClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f== a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input", a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);if(d.datepicker._curInst&&d.datepicker._curInst!=b){d.datepicker._datepickerShowing&&d.datepicker._triggerOnClose(d.datepicker._curInst);d.datepicker._curInst.dpDiv.stop(true,true)}var c=d.datepicker._get(b,"beforeShow");c=c?c.apply(a,[a,b]):{};if(c!==false){H(b.settings,c);b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value= "";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b); c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.datepicker._datepickerShowing= true;d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}}},_updateDatepicker:function(a){this.maxRows=4;var b=d.datepicker._getBorders(a.dpDiv);J=a;a.dpDiv.empty().append(this._generateHTML(a));var c=a.dpDiv.find("iframe.ui-datepicker-cover");c.length&&c.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}); a.dpDiv.find("."+this._dayOverClass+" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");c>1&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(b[0]!=1||b[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&& !a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var e=a.yearshtml;setTimeout(function(){e===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);e=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(), h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b= this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_triggerOnClose:function(a){var b=this._get(a,"onClose");if(b)b.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a])},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b); this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();d.datepicker._triggerOnClose(b);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")}, _checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"): 0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e["selected"+(c=="M"? "Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a); this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField"); if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"? b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=A+1-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,j-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=j||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd", COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames: null)||this._defaults.monthNames;var i=function(o){(o=k+1 12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&& a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay? new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&nn;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a)); n=this._canAdjustMonth(a,-1,m,g)?''+n+"":f?"":''+n+"";var s=this._get(a,"nextText");s=!h?s:this.formatDate(s,this._daylightSavingAdjust(new Date(m, g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?''+s+"":f?"":''+s+"";j=this._get(a,"currentText");s=this._get(a,"gotoCurrent")&& a.currentDay?u:b;j=!h?j:this.formatDate(j,s,this._getFormatConfig(a));h=!a.inline?'":"";e=e?'
    '+(c?h:"")+(this._isInRange(a,s)?'":"")+(c?"":h)+"
    ":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");s=this._get(a,"dayNames");this._get(a,"dayNamesShort");var q=this._get(a,"dayNamesMin"),A=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),D=this._get(a,"showOtherMonths"),K=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var E=this._getDefaultDate(a),w="",x=0;x1)switch(G){case 0:y+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:y+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:y+=" ui-datepicker-group-middle";t="";break}y+='">'}y+='
    '+(/all|left/.test(t)&& x==0?c?f:n:"")+(/all|right/.test(t)&&x==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,x>0||G>0,A,v)+'
    ';var z=j?'":"";for(t=0;t<7;t++){var r=(t+h)%7;z+="=5?' class="ui-datepicker-week-end"':"")+'>'+q[r]+""}y+=z+"";z=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay, z);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;z=Math.ceil((t+z)/7);this.maxRows=z=l?this.maxRows>z?this.maxRows:z:z;r=this._daylightSavingAdjust(new Date(m,g,1-t));for(var Q=0;Q";var R=!j?"":'";for(t=0;t<7;t++){var I=p?p.apply(a.input?a.input[0]:null,[r]):[true,""],F=r.getMonth()!=g,L=F&&!K||!I[0]||k&&ro;R+='";r.setDate(r.getDate()+1);r=this._daylightSavingAdjust(r)}y+=R+""}g++;if(g>11){g=0;m++}y+="
    '+this._get(a,"weekHeader")+"
    '+this._get(a,"calculateWeek")(r)+""+(F&&!D?" ":L?''+ r.getDate()+"":''+r.getDate()+"")+"
    "+(l?""+(i[0]>0&&G==i[1]-1?'
    ':""):"");O+=y}w+=O}w+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'': "");a._keyEvent=false;return w},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='
    ',o="";if(h||!j)o+=''+i[b]+"";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='"}u||(k+=o+(h||!(j&&l)?" ":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+=''+c+"";else{g=this._get(a,"yearRange").split(":");var s=(new Date).getFullYear();i=function(q){q=q.match(/c[+-].*/)?c+parseInt(q.substring(1),10):q.match(/[+-].*/)?s+parseInt(q,10):parseInt(q,10);return isNaN(q)?s:q};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b, e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='";k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?" ":"")+o;k+="
    ";return k},_adjustInstDate:function(a,b,c){var e=a.drawYear+(c=="Y"?b:0),f=a.drawMonth+ (c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&ba?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");if(b)b.apply(a.input? a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);c=this._daylightSavingAdjust(new Date(c, e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a, "dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=function(a){if(!this.length)return this; if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));return this.each(function(){typeof a== "string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new M;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.16";window["DP_jQuery_"+B]=d})(jQuery); ;/* * jQuery UI Progressbar 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Progressbar * * Depends: * jquery.ui.core.js * jquery.ui.widget.js */ (function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("
    ").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100* this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.16"})})(jQuery); ;/* * jQuery UI Effects 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/ */ jQuery.effects||function(f,j){function m(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1], 16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return n.transparent;return n[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return m(b)}function o(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle, a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function p(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d= a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function l(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor", "borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=m(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var n={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0, 0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211, 211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},q=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b, d){if(f.isFunction(b)){d=b;b=null}return this.queue(function(){var e=f(this),g=e.attr("style")||" ",h=p(o.call(this)),r,v=e.attr("class");f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});r=p(o.call(this));e.attr("class",v);e.animate(u(h,r),{queue:false,duration:a,easing:b,complete:function(){f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments);f.dequeue(this)}})})}; f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this, [{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.16",save:function(c,a){for(var b=0;b").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}), d=document.activeElement;c.wrap(b);if(c[0]===d||f.contains(c[0],d))f(d).focus();b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(e,g){a[g]=c.css(g);if(isNaN(parseInt(a[g],10)))a[g]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){var a,b=document.activeElement; if(c.parent().is(".ui-effects-wrapper")){a=c.parent().replaceWith(c);if(c[0]===b||f.contains(c[0],b))f(b).focus();return a}return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)}); return d.call(this,b)},_show:f.fn.show,show:function(c){if(l(c))return this._show.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(l(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(l(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this, arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/ 2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b, d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c, a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b, d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+ e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery); ;/* * jQuery UI Effects Fade 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/Fade * * Depends: * jquery.effects.core.js */ (function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery); ;/* * jQuery UI Effects Fold 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/Fold * * Depends: * jquery.effects.core.js */ (function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1], 10)/100*f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery); ;/* * jQuery UI Effects Highlight 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/Highlight * * Depends: * jquery.effects.core.js */ (function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&& this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); ;/* * jQuery UI Effects Pulsate 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/Pulsate * * Depends: * jquery.effects.core.js */ (function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments); b.dequeue()})})}})(jQuery); ; /* * jQuery Address Plugin v1.4 * http://www.asual.com/jquery/address/ * * Copyright (c) 2009-2010 Rostislav Hristov * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Date: 2011-05-04 14:22:12 +0300 (Wed, 04 May 2011) */ (function(c){c.address=function(){var v=function(a){c(c.address).trigger(c.extend(c.Event(a),function(){for(var b={},e=c.address.parameterNames(),f=0,p=e.length;f"+n.title.replace("'","\\'")+"'); } else if (substr($sFile, -4) == '.css') { var sCustomId = ''; if (substr($sFile, -10) == 'custom.css'){ sCustomHistoryUrl = $sFile; sCustomId = 'js_custom_css_loader'; } $('head').append(''); } else { eval($sFile); } } else{ if (substr($sFile, -10) == 'custom.css'){ sCustomHistoryUrl = $sFile; } } }); if (!empty(sCustomHistoryUrl)){ $('#js_custom_css_loader').remove(); $('head').append(''); } } $Behavior.globalInit = function() { // Confirm before deleting an item $('.sJsConfirm').click(function() { if (confirm(getPhrase('core.are_you_sure'))) { return true; } return false; }); $('#select_lang_pack').click(function() { tb_show(oTranslations['core.language_packages'], $.ajaxBox('language.select', 'height=300&width=300')); return false; }); if (!oCore['core.is_admincp']) { if ($('#country_iso').length > 0 && !empty(oCore['core.country_iso'])) { if (empty($('#country_iso').val())) { $('#js_country_iso_option_' + oCore['core.country_iso']).attr('selected', true); } } } $('.js_item_active').click(function() { $(this).parent().find('.js_item_active input').attr('checked', false); if ($(this).hasClass('item_is_active')) { $(this).parent().find('.item_is_active input').attr('checked', true); } else { $(this).parent().find('.item_is_not_active input').attr('checked', true); } }); if ($('.moderate_link').length > 0) { $('.moderation_drop').click(function() { if (parseInt($('.js_global_multi_total').html()) === 0) { return false; } if ($(this).hasClass('is_clicked')) { $('.moderation_holder ul').hide(); $(this).removeClass('is_clicked'); } else { $('.moderation_holder ul').show(); $('.moderation_holder ul').css({'margin-top': '-' + ($(this).height() + $('.moderation_holder ul').height() + 4) + 'px'}); $(this).addClass('is_clicked'); } return false; }); var iEmptyModLinks = 0; $('.moderate_link').each(function() { var sName = 'js_item_m_' + $(this).attr('rel') + '_' + $(this).attr('href').replace('#', ''); if (getCookie(sName)) { $(this).addClass('moderate_link_active'); } else { iEmptyModLinks++; } }); if (iEmptyModLinks === 0) { $('.moderation_action_unselect').show(); $('.moderation_action_select').hide(); } } $('.moderation_process_action').click(function() { if ($(this).attr('rel') == 'mail.mailThreadAction' && $(this).attr('href').replace('#', '') == 'forward'){ var sGlobalModeration = ''; $('.js_global_item_moderate').each(function(){ sGlobalModeration += ',' + parseInt($(this).val()); }); $Core.box('mail.compose', 500, 'forward_thread_id=' + $('#js_forward_thread_id').val() + '&forwards=' + sGlobalModeration); $Core.moderationLinkClear(); } else if ($(this).attr('rel') == 'mail.archive' && $(this).attr('href').replace('#', '') == 'export'){ $(this).parents('form:first').submit(); $Core.moderationLinkClear(); } else if ($(this).attr('rel') == 'mail.moderation' && $(this).attr('href').replace('#', '') == 'move'){ $Core.box('mail.listFolders', 400); } else{ $('.moderation_process').show(); $('#js_global_multi_form_holder').ajaxCall($(this).attr('rel'), 'action=' + $(this).attr('href').replace('#', '')); $Core.moderationLinkClear(); } return false; }); $('.moderation_clear_all').click(function() { $Core.moderationLinkClear(); return false; }); $('.moderation_action').click(function() { var sType = $(this).attr('rel'); $(this).hide(); if (sType == 'select') { $('.moderation_action_unselect').show(); } else { $('.moderation_action_select').show(); } $('.moderate_link').each(function() { $Core.moderationLinkClick(this, sType); }); return false; }); $('.moderate_link').click(function() { return $Core.moderationLinkClick(this); }); $('.page_section_menu ul li a').click(function() { var sRel = $(this).attr('rel'); if (empty(sRel)) { return true; } $('.page_section_menu ul li').removeClass('active'); $('.page_section_menu_holder').hide(); $('#' + sRel).show(); $(this).parent().addClass('active'); if ($('#page_section_menu_form').length > 0) { $('#page_section_menu_form').val(sRel); } return false; }); if ($('.js_date_picker').length > 0) { var sFormat = oParams['sDateFormat']; sFormat = sFormat.charAt(0) + '/' + sFormat.charAt(1) + '/' + sFormat.charAt(2); sFormat = sFormat.replace('D','d').replace('M','m').replace('Y','yy'); $('.js_date_picker').datepicker('destroy'); $('.js_date_picker').datepicker( { dateFormat: sFormat, // minDate: new Date(oParams['user.date_of_birth_start'], new Date().getMonth(), new Date().getDate()), // maxDate: new Date(oParams['user.date_of_birth_end'], new Date().getMonth(), new Date().getDate()), onSelect: function(dateText, inst) { var aParts = explode('/', dateText); var sMonth; var sDay; var sYear; switch (oParams['sDateFormat']){ case 'YMD': sMonth = ltrim(aParts[1], '0'); sDay = ltrim(aParts[2], '0'); sYear = aParts[0]; break; case 'DMY': sMonth = ltrim(aParts[1], '0'); sDay = ltrim(aParts[0], '0'); sYear = aParts[2]; break; default: sMonth = ltrim(aParts[0], '0'); sDay = ltrim(aParts[1], '0'); sYear = aParts[2]; break; } $(this).parents('.js_datepicker_holder:first').find('.js_datepicker_month').val(sMonth); $(this).parents('.js_datepicker_holder:first').find('.js_datepicker_day').val(sDay); $(this).parents('.js_datepicker_holder:first').find('.js_datepicker_year').val(sYear); } }); $('.js_datepicker_image').each(function(){ $(this).click(function(){ $(this).parent().find('.js_date_picker').datepicker('show'); }); }); } $('#js_login_as_page').click(function(){ $Core.box('pages.login', 500); return false; }); $('.mobile_view_options').click(function(){ $('#js_mobile_form_holder').toggle(); return false; }); if ($.browser.msie && parseInt($.browser.version, 10) < 8 && !getParam('bJsIsMobile')){ $('#js_update_internet_explorer').show(); } } $Core.pageSectionMenuShow = function(sId) { $('.page_section_menu_holder').hide(); $('.page_section_menu ul li').removeClass('active'); $(sId).show(); $('.page_section_menu ul li a').each(function() { if ($(this).attr('rel') == sId.replace('#', '')) { $(this).parent().addClass('active'); return false; } }); } $Core.moderationLinkClear = function() { var aCookies = document.cookie.split(';'); $(aCookies).each(function(sKey, sValue) { if (sValue.match(/js_item_m/i)) { var aParts = explode('=', sValue); deleteCookie(trim(aParts[0].replace(getParam('sJsCookiePrefix'), ''))); } }); $('.moderate_link').removeClass('moderate_link_active'); $('#js_global_multi_form_ids').html(''); $('.js_global_multi_total').html('0'); $('.moderation_drop').addClass('not_active'); $('.moderation_holder ul').hide(); $('.moderation_action_unselect').hide(); $('.moderation_action_select').show(); } $Core.moderationLinkClick = function(oObj, sType) { var sName = 'js_item_m_' + $(oObj).attr('rel') + '_' + $(oObj).attr('href').replace('#', ''); var iTotalItems = parseInt($('.js_global_multi_total').html()); if (($(oObj).hasClass('moderate_link_active') && sType != 'select') || sType == 'unselect') { $(oObj).removeClass('moderate_link_active'); $('#js_global_multi_form_ids').find('.' + sName).remove(); deleteCookie(sName); iTotalItems--; } else { if (!$(oObj).hasClass('moderate_link_active')) { $(oObj).addClass('moderate_link_active'); $('#js_global_multi_form_ids').append('
    '); setCookie(sName, $(oObj).attr('rel') + '_' + $(oObj).attr('href').replace('#', ''), 1); iTotalItems++; } } iTotalItems = $('.moderate_link_active').length; $('.js_global_multi_total').html(iTotalItems); if (iTotalItems) { $('.moderation_drop').removeClass('not_active'); } else { $('.moderation_drop').addClass('not_active'); } return false; } $Behavior.privacySettingDropDown = function() { $('body').click(function() { $('.privacy_setting_active').each(function() { if ($(this).hasClass('is_active')) { $(this).parent().find('.privacy_setting_holder').hide(); $(this).removeClass('is_active'); } }); }); $('.privacy_setting_active').click(function() { var $oParent = $(this).parent().find('.privacy_setting_holder'); if ($(this).hasClass('is_active')) { $oParent.hide(); $(this).removeClass('is_active'); } else { $('.privacy_setting_active').each(function() { if ($(this).hasClass('is_active')) { $(this).parent().find('.privacy_setting_holder').hide(); $(this).removeClass('is_active'); } }); $oParent.show(); $(this).addClass('is_active'); } $('#js_global_tooltip').hide() .html('') .css('top', '0px') .css('left', '0px'); return false; }); $('.privacy_setting_holder ul li a').click(function() { var $oParent = $(this).parents('.privacy_setting_div:first').find('.privacy_setting_active'); var $sContent = $(this).html(); if ($sContent.toLowerCase().indexOf('') > -1) { var $aParts = explode('', $sContent); if (!isset($aParts[1])) { $aParts = explode('', $sContent); } $sContent = $aParts[0]; } $oParent.html('' + $sContent + '' + $sContent + ''); $(this).parents('.privacy_setting_div:first').find('.privacy_setting_holder').hide(); $oParent.removeClass('is_active'); $(this).parents('.privacy_setting_div:first').find('input').val($(this).attr('rel')); $('.privacy_setting_holder ul li a').removeClass('is_active_image'); $(this).addClass('is_active_image'); return false; }); } var cacheShadownInfo = false; var shadow = null; var minHeight = null; $Core.resizeTextarea = function(oObj) { if (cacheShadownInfo === false) { var lineHeight = oObj.css('lineHeight'); minHeight = oObj.height(); cacheShadownInfo = true; shadow = $('
    ').css( { position: 'absolute', top: -10000, left: -10000, width: oObj.width(), fontSize: oObj.css('fontSize'), fontFamily: oObj.css('fontFamily'), lineHeight: oObj.css('lineHeight'), resize: 'none' }).appendTo(document.body); } var val = oObj.val().replace(//g, '>') .replace(/&/g, '&') .replace(/\n/g, '
    '); shadow.html(val); oObj.css('height', Math.max(shadow.height() + 20, minHeight)); } $Core.getObjectPosition = function(sId) { if ($('#' + sId).length <= 0) { return false; } var curleft = 0; var curtop = 0; var obj = document.getElementById(sId); if (obj.offsetParent) { do { curleft += obj.offsetLeft; curtop += obj.offsetTop; } while (obj = obj.offsetParent); } return {left: curleft, top: curtop}; } $Core.getFriends = function(aParams) { tb_show('', $.ajaxBox('friend.search', 'height=410&width=600&input=' + aParams['input'] + '&type=' + (isset(aParams['type']) ? aParams['type'] : '') + '')); } $Core.browseUsers = function(aParams) { tb_show('', $.ajaxBox('user.browse', 'height=410&width=600&input=' + aParams['input'] + '')); } $Core.composeMessage = function(aParams) { if (aParams === undefined) { aParams = new Array(); } tb_show('', $.ajaxBox('mail.compose', 'height=300&width=500' + (!isset(aParams['user_id']) ? '' : '&id=' + aParams['user_id']) + '&no_remove_box=true')); } $Core.addAsFriend = function(iUserId) { tb_show('', $.ajaxBox('friend.request', 'width=420&user_id=' + iUserId + '')); return false; } $Core.getParams = function(sHref) { var aParams = new Array(); var aUrlParts = explode('/', sHref); var iRequest = 0; for (i in aUrlParts) { if (empty(aUrlParts[i])) { continue; } aUrlParts[i] = aUrlParts[i].replace('#', ''); if (aUrlParts[i].match(/_/i)) { var aUrlParams = explode('_', aUrlParts[i]); aParams[aUrlParams[0]] = aUrlParams[1]; } else { iRequest++; aParams['req' + iRequest] = aUrlParts[i]; } } return aParams; } $Core.getRequests = function(sHref, bReturnPath) { var sParams = ''; var sUrlString = ''; var sModuleName = oCore['core.section_module']; switch (oCore['core.url_rewrite']) { case '1': var oReq = new RegExp("" + getParam('sJsHome') + "(.*?)$","i"); var aMatches = oReq.exec(sHref); var aParts = explode('/', aMatches[1]); sUrlString = '/' + aMatches[1]; break; case '3': if (oCore['profile.is_user_profile']) { var aProfileMatches = sHref.match(/http:\/\/(.*?)\.(.*?)/i); sModuleName = aProfileMatches[1]; } var oReq = new RegExp("" + oParams['sJsHome'] + "(.*?)$","i"); var aMatches = oReq.exec(sHref); sUrlString = sModuleName + '/' + (aMatches != null && isset(aMatches[1]) ? aMatches[1] : ''); break; default: var oReq = new RegExp("(.*?)=\/(.*?)$","i"); var aMatches = oReq.exec(sHref); if (aMatches !== null) { var aParts = explode('/', aMatches[2]); sUrlString = aMatches[2]; } break; } if (bReturnPath === true) { return '/' + ltrim(sUrlString, '/'); } return $Core.parseUrlString(sUrlString); } $Core.parseUrlString = function(sUrlString) { var sParams = ''; var aUrlParts = explode('/', sUrlString); var iRequest = 0; var iLoadCount = 0; for (i in aUrlParts) { if (empty(aUrlParts[i]) || aUrlParts[i] == '#') { continue; } iLoadCount++; if (iLoadCount != 1 && aUrlParts[i].match(/_/i)) { var aUrlParams = explode('_', aUrlParts[i]); sParams += '&' + aUrlParams[0] + '=' + aUrlParams[1]; } else { iRequest++; sParams += '&req' + iRequest + '=' + aUrlParts[i]; } } return sParams; } $Core.reverseUrl = function(sForm, aSkip) { var aForms = explode('&', sForm); var sUrlParam = ''; for (i in aForms) { var aFormParts = aForms[i].match(/(.*?)=(.*?)$/i); if (aFormParts !== null) { if (isset(aSkip)) { if (in_array(aFormParts[1], aSkip)) { continue; } } sUrlParam += aFormParts[1] + '_' + encodeURIComponent(aFormParts[2]) + '/'; } } return sUrlParam; } $Core.getHashParam = function(sHref) { var sParams = ''; var aParams = $.getParams(sHref); for (var sKey in aParams) { sParams += '&' + sKey + '=' + aParams[sKey]; } sParams = ltrim(sParams, '&'); return sParams; } $Core.box = function($sRequest, $sWidth, $sParams) { tb_show('', $.ajaxBox($sRequest, 'width=' + $sWidth + ($sParams ? '&' + $sParams : ''))); return false; } $Core.ajax = function(sCall, $oParams) { var sParams = '&' + getParam('sGlobalTokenName') + '[ajax]=true&' + getParam('sGlobalTokenName') + '[call]=' + sCall; if (!sParams.match(/\[security_token\]/i)) { sParams += '&' + getParam('sGlobalTokenName') + '[security_token]=' + oCore['log.security_token']; } if (isset($oParams['params'])) { if (typeof($oParams['params']) == 'string') { sParams += $oParams['params']; } else { $.each($oParams['params'], function($sKey, $sValue) { sParams += '&' + $sKey + '=' + encodeURIComponent($sValue) + ''; }); } } $.ajax( { type: (isset($oParams['type']) ? $oParams['type'] : 'GET'), url: getParam('sJsStatic') + "ajax.php", dataType: 'html', data: sParams, success: $oParams['success'] }); } $Core.popup = function(sUrl, aParams) { oDate = new Date(); iId = oDate.getTime(); var sParams = ''; var iCount = 0; var bCenter = false; for (i in aParams) { if (i == 'center') { bCenter = true; continue; } iCount++; if (iCount != 1) { sParams += ','; } sParams += i + '=' + aParams[i]; } if (bCenter === true) { sParams += ',left=' + (($(window).width() - aParams['width']) / 2) + ',top=' + (($(window).height() - aParams['height']) / 2) + ''; } window.open(sUrl, iId, sParams); } $Core.ajaxMessage = function() { $('#global_ajax_message').html(getPhrase('core.saving')).animate({opacity: 0.9}).slideDown(); } /** * Used for the accordion effect on sections with many categories */ $Core.toggleCategory = function(sName, iId) { $('.' + sName).toggle(); $('#show_more_' + iId).toggle(); $('#show_less_' + iId).toggle(); } if (substr(window.location.hash, 0, 2) == '#!') { if (oCore['core.url_rewrite'] == '1') { var sUrl = trim(getParam('sJsHome'), '/'); } else { var sUrl = getParam('sJsHome') + 'index.php?' + getParam('sGetMethod') + '='; } window.location = sUrl + window.location.hash.replace('#!', ''); } $Core.page = function($aParams) { if (typeof CorePageAjaxBrowsingStart == 'function') { CorePageAjaxBrowsingStart($aParams); } if (isset($aParams['phrases'])) { for (sKey in $aParams['phrases']) { if (!isset(oTranslations[sKey])) { oTranslations[sKey] = $aParams['phrases'][sKey]; } } } $('.js_user_tool_tip_holder').remove(); $('#js_user_profile_css').remove(); if (isset($aParams['profilecss'])){ $('body').append($aParams['profilecss']); } if (!empty($aParams['files'])) { $Core.loadStaticFiles($aParams['files']); } if (isset($aParams['customcss'])){ var sCustomCss = ''; $('#js_global_custom_css').remove(); for (sKey in $aParams['customcss']){ sCustomCss += $aParams['customcss'][sKey]; } if (!empty(sCustomCss)){ // $('body').append() } } document.title = $aParams['title']; $('#main_content_holder').html('' + $aParams['content'] + ''); /* if (isset($aParams['ads'])) { for (sKey in $aParams['ads']){ $('#js_ad_space_content_' + sKey).html($aParams['ads'][sKey]); } } */ $('body').css('cursor', 'auto'); $oEventHistory[($Core.hasPushState() ? $Core.getRequests(window.location, true) : window.location.hash.replace('#!', ''))] = $aParams['content']; $Core.loadInit(); scroll(0,0); $Behavior.loadTinymceEditor = function () {}; } $Core.updatePageHistory = function() { var $sLocation = window.location.hash.replace('#!', ''); if (empty($sLocation)) { $sLocation = '/'; } $oEventHistory[$sLocation] = $('#main_content_holder').html(); } var bAjaxLinkIsClicked = false; var bCanByPassClick = false; var sClickProfileName = ''; $Behavior.linkClickAll = function() { if ($.browser.msie && $.browser.version == '7.0') { return false; } if (!oCore['core.site_wide_ajax_browsing']) { return false; } $('a').click(function() { var $sLink = $(this).attr('href'); if (!$sLink) { return; } if (substr($sLink, 0, 7) != 'http://' || substr($sLink, -1) == '#') { return; } if ($(this).hasClass('photo_holder_image') && !getParam('bPhotoTheaterMode')){ } else{ if ($(this).hasClass('no_ajax_link') || $(this).hasClass('thickbox') || $(this).hasClass('sJsConfirm')) { return; } } $('.js_box_image_holder_full').remove(); var $aUrlParts = parse_url($sLink); if ($aUrlParts['host'] != getParam('sJsHostname')) { return; } if (!isset($aUrlParts['query'])) { var sTempHost = $aUrlParts['scheme'] + '://' + $aUrlParts['host'] + $aUrlParts['path']; $aUrlParts['query'] = sTempHost.replace(getParam('sJsHome'), '/'); } if (isset($aUrlParts['query'])) { var aUrlParts = explode('/', $aUrlParts['query']); var sAdminPath = 'admincp'; if (getParam('sAdminCPLocation') != ''){ sAdminPath = getParam('sAdminCPLocation'); } if (aUrlParts[1] == sAdminPath) { return; } if (aUrlParts[1] == 'user' && aUrlParts[2] == 'logout') { return; } } if (bCanByPassClick === true && aUrlParts[1] != sClickProfileName){ bCanByPassClick = false; return; } if ($('#noteform').length > 0) { $('#noteform').hide(); } if ($('#js_photo_view_image').length > 0) { $('#js_photo_view_image').imgAreaSelect({ hide: true }); } if ($('#user_profile_photo').length > 0) { $('#user_profile_photo').imgAreaSelect({ hide: true }); } $('.ajax_link_reset').hide(); bAjaxLinkIsClicked = true; $('body').css('cursor', 'wait'); $('.js_user_tool_tip_holder').hide(); $('#js_global_tooltip').hide(); $(this).addClass('is_built'); $Core.addUrlPager(this); if (typeof BehaviorlinkClickAllAClick == 'function') { BehaviorlinkClickAllAClick($aUrlParts); } $.ajaxCall('core.page', 'ajax_page_display=true' + $Core.getRequests(this) + '&do=' + $Core.getRequests(this, true), 'GET'); return false; }); } $Core.loadInit = function() { debug('$Core.loadInit() Loaded'); $('*').unbind(); $.each($Behavior, function() { this(this); }); } $Core.init = function() { if (!$Core.hasPushState() && oCore['core.disable_hash_bang_support']) { oCore['core.site_wide_ajax_browsing'] = false; } $bDocumentIsLoaded = true; $(document).ready(function() { $.each($Behavior, function() { this(this); }); }); $('script,link').each(function() { if (!empty(this.src)) { var $sVar = this.src; if (this.src.indexOf('f=') !== -1) { var $aFiles = explode('f=', $sVar); var $aParts = explode('&v=', $aFiles[1]); var $aGetFiles = explode(',', $aParts[0]); $($aGetFiles).each(function($sKey, $sFile) { if (substr($sFile, 0, 7) == 'module/') { $oStaticHistory[getParam('sJsHome') + $sFile] = true; } else { $oStaticHistory[getParam('sJsStatic') + 'jscript/' + $sFile] = true; } }); return; } } else if (!empty(this.href)) { var $sVar = this.href; if (this.href.indexOf('f=') !== -1) { var $aFiles = explode('f=', $sVar); var $aParts = explode('&v=', $aFiles[1]); var $aGetFiles = explode(',', $aParts[0]); $($aGetFiles).each(function($sKey, $sFile) { $oStaticHistory[getParam('sJsHome') + $sFile] = true; }); return; } } if (!empty($sVar)) { var $aParts = explode('?', $sVar); $oStaticHistory[$aParts[0]] = true; } }); if (isset($Cache['post_static_files'])) { $($Cache['post_static_files']).each(function($sKey, $mValue) { $Core.loadStaticFiles($mValue); }); } if (oCore['core.site_wide_ajax_browsing']) { if ($.browser.msie && $.browser.version == '7.0') { } else { if ($Core.hasPushState()){ $oEventHistory[$Core.getRequests(window.location, true)] = $('#main_content_holder').html(); var $iTotalCount = 0; $(window).bind('popstate', function(event) { $iTotalCount++; if($.browser.safari && $iTotalCount == 1){ return } /* if (getParam('sEditor') == 'tiny_mce' && isset(LoadedTinymceEditors)){ for (sEditor in LoadedTinymceEditors){ delete LoadedTinymceEditors[sEditor]; } } */ $Core.changeHistoryState({path: $Core.getRequests(window.location, true)}); }); } else{ $.address.change(function(event) { $Core.changeHistoryState(event); }); } } } } $Core.hasPushState = function(){ return (typeof(window.history.pushState) == 'function' ? true : false); } /** * Adds a hash to the URL string, which is used to emulate a AJAX page * * @param object oObject Is the anchor object (this) */ $Core.addUrlPager = function(oObject, bShort) { if ($Core.hasPushState()){ window.history.pushState('', '', oObject.href); } else{ window.location = '#!' + (bShort ? oObject.href : $Core.getRequests(oObject.href, true)); } } $Core.changeHistoryState = function(event){ $('.js_box').each(function() { if (!$(this).hasClass('js_box_no_remove')) { var $sLink = $(this).find('.js_box_history:first').html(); if (isset($aBoxHistory[$sLink])) { delete $aBoxHistory[$sLink]; } $(this).remove(); } }); if ($Core.hasPushState()){ bAjaxLinkIsClicked = false; } if (isset($oEventHistory[event.path]) && !bAjaxLinkIsClicked) { $('#main_content_holder').html($oEventHistory[event.path].replace('$Core.loadInit();', '').replace('$Core.updatePageHistory();', '')); $Core.loadInit(); scroll(0,0); } else { if (empty($oEventHistory)) { if (event.path == '/') { if (isset($oEventHistory[$Core.getRequests(window.location, true)])) { $('#main_content_holder').html($oEventHistory[$Core.getRequests(window.location, true)].replace('$Core.loadInit();', '').replace('$Core.updatePageHistory();', '')); $Core.loadInit(); scroll(0,0); } else { $oEventHistory[$Core.getRequests(window.location, true)] = $('#main_content_holder').html(); } } } else { if (event.path == '/') { if (isset($oEventHistory[$Core.getRequests(window.location, true)])) { $('#main_content_holder').html($oEventHistory[$Core.getRequests(window.location, true)].replace('$Core.loadInit();', '').replace('$Core.updatePageHistory();', '')); $Core.loadInit(); scroll(0,0); } } } } if (bAjaxLinkIsClicked) { bAjaxLinkIsClicked = false; } } $Behavior.addModerationListener = function() { $(window).on('moderation_ended', function(){ /* Search for moderation rows */ if ($('.moderation_row:visible').length < 1) { /* Check if we have a pager */ if ( $('a.pager_next_link').length > 0) { window.location.href = $('a.pager_next_link:first').attr('href'); } else if ($('a.pager_previous_link').length > 0) { window.location.href = $('a.pager_previous_link:first').attr('href'); } else { wndow.location.href=window.location.href; } } else if ( $('.moderation_row:first').is(':animated') ) { setTimeout('$(window).trigger("moderation_ended");', 1000); } else { /* console.log('Moderation_rows still exist and are not being animated');*/ } }); } /** * Creates an AJAX call using jQuery.load() * Data is inserted into DOM * * @param string sCall Name of the Component * @param string sExtra Extra params we plan to pass */ $.ajaxBox = function(sCall, sExtra) { var sParams = getParam('sJsAjax') + '?' + getParam('sGlobalTokenName') + '[ajax]=true&' + getParam('sGlobalTokenName') + '[call]=' + sCall; if (sExtra) { sParams += '&' + sExtra; } if (!sParams.match(/\[security_token\]/i)) { sParams += '&' + getParam('sGlobalTokenName') + '[security_token]=' + oCore['log.security_token']; } return sParams; } var oCacheAjaxRequest = null; var aCacheAjaxLastCall = {}; window.onbeforeunload = function() { if (oCacheAjaxRequest !== null) { oCacheAjaxRequest.abort(); } } /** * Create AJAX Call * * @param string sFunction Name of the function we plan to use * @param string sId Form ID */ $.fn.ajaxCall = function(sCall, sExtra, bNoForm, sType) { if (empty(sType)) { sType = 'POST'; } switch (sCall){ case 'share.friend': case 'share.email': case 'share.bookmark': case 'share.post': sType = 'POST'; break; default: break; } var sUrl = getParam('sJsAjax'); if (typeof oParams['im_server'] != 'undefined' && sCall.indexOf('im.') > (-1)) { sUrl = getParam('sJsAjax').replace(getParam('sJsHome'),getParam('im_server')); } var sParams = '&' + getParam('sGlobalTokenName') + '[ajax]=true&' + getParam('sGlobalTokenName') + '[call]=' + sCall + '' + (bNoForm ? '' : this.getForm()); if (sExtra) { sParams += '&' + ltrim(sExtra, '&'); } if (!sParams.match(/\[security_token\]/i)) { sParams += '&' + getParam('sGlobalTokenName') + '[security_token]=' + oCore['log.security_token']; } sParams += '&' + getParam('sGlobalTokenName') + '[is_admincp]=' + (oCore['core.is_admincp'] ? '1' : '0'); sParams += '&' + getParam('sGlobalTokenName') + '[is_user_profile]=' + (oCore['profile.is_user_profile'] ? '1' : '0'); sParams += '&' + getParam('sGlobalTokenName') + '[profile_user_id]=' + (oCore['profile.user_id'] ? oCore['profile.user_id'] : '0'); if (getParam('bJsIsMobile')){ sParams += '&js_mobile_version=true'; } oCacheAjaxRequest = $.ajax( { type: sType, url: sUrl,//getParam('sJsStatic') + "ajax.php", dataType: "script", data: sParams } ); return oCacheAjaxRequest; } $.ajaxCall = function(sCall, sExtra, sType) { return $.fn.ajaxCall(sCall, sExtra, true, sType); } /** * Get form details * @param string frm Form ID or Element ID * @return string Return parsed URL string */ $.fn.getForm = function() { var objForm = this.get(0); var prefix = ""; var submitDisabledElements = false; if (arguments.length > 1 && arguments[1] == true) { submitDisabledElements = true; } if(arguments.length > 2) { prefix = arguments[2]; } var sXml = ''; if (objForm && objForm.tagName == 'FORM') { var formElements = objForm.elements; for(var i=0; i < formElements.length; i++) { if (!formElements[i].name) { continue; } if (formElements[i].name.substring(0, prefix.length) != prefix) { continue; } if (formElements[i].type && (formElements[i].type == 'radio' || formElements[i].type == 'checkbox') && formElements[i].checked == false) { continue; } if (formElements[i].disabled && formElements[i].disabled == true && submitDisabledElements == false) { continue; } var name = formElements[i].name; if (name) { sXml += '&'; if(formElements[i].type=='select-multiple') { for (var j = 0; j < formElements[i].length; j++) { if (formElements[i].options[j].selected == true) { sXml += name+"="+encodeURIComponent(formElements[i].options[j].value)+"&"; } } } else { sXml += name+"="+encodeURIComponent(formElements[i].value); } } } } if ( !sXml && objForm) { sXml += "&" + objForm.name + "="+ encodeURIComponent(objForm.value); } return sXml; } var $iBoxTotalOpen = 0; var $iCurrentZIndex = 1; var $aBoxHistory = {}; var iImageIterationCount = 0; var iCurrentImageIterationCount = 0; var $sCurrentId = null; var sLastOpenUrl = null; var bIsPhotoImage = false; $Behavior.addDraggableToBoxes = function() { if ($('.js_box').length > 0 && !$.ui) { $Core.loadStaticFile(getParam('sJsHome') + 'static/jscript/jquery/ui.js'); } $('.js_box').each(function() { $(this).draggable('destroy'); tb_draggable(this); }); $('a.thickbox').click(function() { var aExtra = $(this).html().match(/userid="([0-9a-z]?)"/i); var sHref = this.href; if (aExtra != null && isset(aExtra[1])) { sHref += 'userid_' + aExtra[1] + '/'; } var bReturn = tb_show('', sHref, this); if (bReturn === true){ return true; } return false; }); } function js_box_remove($oObj) { $('#main_core_body_holder').show(); $('.imgareaselect-outer').remove(); $('#noteform').remove(); $('.imgareaselect-border1').remove(); $('.imgareaselect-border2').remove(); $('.imgareaselect-border3').remove(); $('.imgareaselect-border4').remove(); var $oParent = $($oObj).parents('.js_box:first'); var $oBoxParent = $($oObj).parents('.js_box_image_holder_full:first'); var $sLink = $oParent.find('.js_box_history:first').html(); if (isset($aBoxHistory[$sLink])) { delete $aBoxHistory[$sLink]; } $oBoxParent.fadeOut(100, function() { $(this).remove(); }); $oParent.fadeOut(100, function() { $(this).remove(); }); $('#global_attachment_list_inline').hide(); if (bIsPhotoImage){ bIsPhotoImage = false; // $Core.addUrlPager({'href': sLastOpenUrl.replace('/#!', '')}, true); } return false; } function tb_show_new_image(thisObject, sSrc, imageWidth, imageHeight, iCurrentIte) { $('.js_box_image_gallery img').removeClass('is_active'); $(thisObject).find('img').addClass('is_active'); iCurrentImageIterationCount = iCurrentIte; $('#js_thickbox_core_image').attr({ 'src': sSrc, 'width': imageWidth, 'height': imageHeight }); } function js_box_next_image() { iCurrentImageIterationCount++; var thisObject = $('#js_next_image_thumb_' + iCurrentImageIterationCount); if (thisObject.length <= 0) { iCurrentImageIterationCount = 0; return js_box_next_image(); } var aParts = explode('|', thisObject.attr('rel')) tb_show_new_image('#js_next_image_thumb_' + iCurrentImageIterationCount, '' + thisObject.attr('href') + '', aParts[0], aParts[1], iCurrentImageIterationCount); return false; } function tb_show(caption, url, thisObject, sForceMessage, bForceNoCilck) { var baseURL; if (url.indexOf("?")!==-1) { baseURL = url.substr(0, url.indexOf("?")); } else { baseURL = url; } var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/; var urlType = baseURL.toLowerCase().match(urlString); if (urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp') { imgPreloader = new Image(); imgPreloader.onload = function() { imgPreloader.onload = null; var pagesize = tb_getPageSize(); var x = pagesize[0] - 150; var y = pagesize[1] - 150; var imageWidth = imgPreloader.width; var imageHeight = imgPreloader.height; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; } } else if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; } } TB_WIDTH = imageWidth + 30; TB_HEIGHT = imageHeight + 60; $('.js_box_image_holder').remove(); $('.js_box_image_holder').unbind('click'); var sHtml = ''; sHtml += '
    '; if ($(thisObject).parents('.js_box_thumbs_holder').length > 0) { var sCurrentSource = $(thisObject).find('img:first').attr('src'); var sNewSource = ''; var SubimgPreloaderImageWidth = ''; var SubimgPreloaderImageHeight = ''; var SubArrayWidth = new Array(); var SubArrayHeight = new Array(); var sSubHtml = ''; var aUrlParts = new Array(); var aUrlPartsNew = new Array(); // p('Current: ' + sCurrentSource); iImageIterationCount = 0; iCurrentImageIterationCount = 0; sHtml += '
    '; $(thisObject).parents('.js_box_thumbs_holder').find('.js_box_image_holder_thumbs').find('.thickbox').each(function() { iImageIterationCount++; sNewSource = $(this).find('img').attr('src'); aUrlParts = explode('_', sCurrentSource); aUrlPartsNew = explode('_', sNewSource); if (aUrlParts[0] == aUrlPartsNew[0]) { iCurrentImageIterationCount = iImageIterationCount; } // if (sCurrentSource != sNewSource) { SubimgPreloader = new Image(); SubimgPreloader.src = $(this).attr('href'); SubimgPreloaderImageWidth = SubimgPreloader.width; SubimgPreloaderImageHeight = SubimgPreloader.height; if (SubimgPreloaderImageWidth > x) { SubimgPreloaderImageHeight = SubimgPreloaderImageHeight * (x / SubimgPreloaderImageWidth); SubimgPreloaderImageWidth = x; if (imageHeight > y) { SubimgPreloaderImageWidth = SubimgPreloaderImageWidth * (y / SubimgPreloaderImageHeight); imageHeight = y; } } else if (imageHeight > y) { SubimgPreloaderImageWidth = SubimgPreloaderImageWidth * (y / SubimgPreloaderImageHeight); SubimgPreloaderImageHeight = y; if (SubimgPreloaderImageWidth > x) { SubimgPreloaderImageHeight = SubimgPreloaderImageHeight * (x / SubimgPreloaderImageWidth); SubimgPreloaderImageWidth = x; } } SubArrayWidth.push(SubimgPreloaderImageWidth); SubArrayHeight.push(SubimgPreloaderImageHeight); sSubHtml += ''; } }); TB_WIDTH = ((Math.max.apply(Math, SubArrayWidth)) + 30); TB_HEIGHT = ((Math.max.apply(Math, SubArrayHeight))); sHtml += '
    '; sHtml += ''; sHtml += ''; sHtml += '
    '; sHtml += '
    '; } else { sHtml += ''; } sHtml += '
    '; $('body').prepend(sHtml); $('.js_box_image').css( { top: (($(window).height() - $('.js_box_image').outerHeight()) / 2) + "px", left: (($(window).width() - $('.js_box_image').outerWidth()) / 2) + "px", display: 'block' }); var bCanCloseImageBox = true; $('.js_box').click(function() { bCanCloseImageBox = false; }); $('.js_box_image_holder').click(function() { if (!bCanCloseImageBox) { bCanCloseImageBox = true; } else { $(this).remove(); } }); if ($.browser.msie && $.browser.version == '7.0') { $Behavior.ie7FixZindex(); } }; imgPreloader.src = url; return false; } var bIsAlreadyOpen = false; if ($(thisObject).hasClass('photo_holder_image') && !empty($(thisObject).attr('rel'))) { if (!getParam('bPhotoTheaterMode')){ return true; } if (getParam('bJsIsMobile')){ return true; } if ($Core.exists('.js_box_image_holder_full')){ $('#photo_view_ajax_loader').show(); } sLastOpenUrl = (empty(window.location.hash) ? $Core.getRequests(window.location, true) : '/' + window.location.hash); // $Core.addUrlPager(thisObject); var sUserId = url.match(/userid_([0-9]+)/); var sAlbumId = url.match(/albumid_([0-9]+)/); var queryString = '' + getParam('sGlobalTokenName') + '[call]=photo.view&width=940' + (typeof sPhotoCategory != 'undefined' ? '&category=' + sPhotoCategory : '') + '&req2=' + $(thisObject).attr('rel') + '&theater=true&no_remove_box=true' + (sUserId != null && isset(sUserId[1]) ? '&userid='+sUserId[1] :'') + (sAlbumId != null && isset(sAlbumId[1]) ? '&albumid='+sAlbumId[1] :''); var params = tb_parseQuery(queryString); bIsPhotoImage = true; if (isset($aBoxHistory[params['' + getParam('sGlobalTokenName') + '[call]']])) { bIsAlreadyOpen = true; } if ($('#noteform').length > 0) { $('#noteform').hide(); } if ($('#js_photo_view_image').length > 0) { $('#js_photo_view_image').imgAreaSelect({ hide: true }); } } else { if ($Core.exists('.js_box_image_holder_full')){ js_box_remove($('.js_box_image_holder_full').find('.js_box_content:first')); } if (url.indexOf('#') != -1) { var aParams = url.split('#'); url = '#' + aParams[1]; } var queryString = url.replace(/^[^\?]+\??/,''); var params = tb_parseQuery(queryString); } if (!bIsPhotoImage && isset($aBoxHistory[params['' + getParam('sGlobalTokenName') + '[call]']])) { return false; } if (!bIsAlreadyOpen) { $iBoxTotalOpen++; $iCurrentZIndex++; $aBoxHistory[params[getParam('sGlobalTokenName') + '[call]']] = true; $sCurrentId = 'js_box_id_' + $iBoxTotalOpen; } if (caption === null) { caption = ''; } var bIsFullMode = false; if (params['width'] == 'full') { params['width'] = ($(window).width()); params['height'] = ($(window).height()); bIsFullMode = true; } else if (params['width'] == 'scan') { params['width'] = ($(window).width() - (oCore['core.is_admincp'] ? 100 : 150)); params['height'] = ($(window).height() - (oCore['core.is_admincp'] ? 100 : 150)); } TB_WIDTH = (!empty(params['width']) ? ((params['width']*1) + 30) : 630); TB_HEIGHT = (params['height']*1) + 40 || 440; var pagesize = tb_getPageSize(); if (TB_HEIGHT > pagesize[1]) { TB_HEIGHT = (pagesize[1] - 75); } if (TB_WIDTH > pagesize[0]) { TB_WIDTH = (pagesize[0] - 75); } ajaxContentW = TB_WIDTH - 30; ajaxContentH = TB_HEIGHT - 45; if (!bIsAlreadyOpen) { var sHtml = ''; if (bIsPhotoImage){ $('.js_box_image_holder').remove(); $('.js_box_image_holder').unbind('click'); sHtml += '
    '; sHtml += '
    '; sHtml += ''; sHtml += '
    '; } else{ if (bIsPhotoImage) { $('.js_box_image_holder').remove(); $('.js_box_image_holder').unbind('click'); sHtml += '
    '; } if (bForceNoCilck){ sHtml += '
    '; } sHtml += '
    '; if (!bIsPhotoImage) { sHtml += '
    ' + caption + '
    '; } sHtml += '
    ' + oTranslations['core.loading'] + '...
    '; // if (!bIsPhotoImage) { sHtml += '
    ' + oTranslations['core.close'] + '' + params[getParam('sGlobalTokenName') + '[call]'] + '
    '; } sHtml += '
    '; if (bIsPhotoImage) { sHtml += '
    '; } if (bForceNoCilck){ sHtml += '
    '; } } $('body').prepend(sHtml); var $oNew = $('#' + $sCurrentId + ''); tb_position($oNew, (bIsFullMode ? bIsFullMode : '')); if (!bIsPhotoImage){ $oNew.show(); } else { $('.js_box_image_holder_full_loader').css({ 'margin-left': '-' + ($('.js_box_image_holder_full_loader').find('img:first').width() / 2) + 'px', 'margin-top': '-' + ($('.js_box_image_holder_full_loader').find('img:first').height() / 2) + 'px' }); } } else { $oNew = $('.js_box_image_holder_full').find('.js_box:first'); } if (getParam('bJsIsMobile')){ queryString += '&js_mobile_version=true'; } if(url.indexOf('TB_inline') != -1){ if (params['type']) { switch(params['type']) { case 'delete': var sHtml = ''; sHtml += '
    '; if (!params['call']) { sHtml += '
    '; sHtml += '
    '; } sHtml += '
    '; sHtml += getPhrase('core.are_you_sure'); sHtml += '
    '; sHtml += ' '; if (!params['call']) { sHtml += ' '; } else { sHtml += ' '; } sHtml += ' '; sHtml += '
    '; sHtml += '
    '; if (!params['call']) { sHtml += ''; } sHtml += '
    '; break; } $oNew.find('.js_box_content').html(''); $oNew.find('.js_box_content').html(sHtml); } else { var sHtml = $('#' + params['inlineId']).children(); } $oNew.find('.js_box_content').html(''); $oNew.find('.js_box_content').html(sHtml); return; } else if (isset(params['TB_iframe'])){ var sIframe = ''; $oNew.find('.js_box_content').html(''); $oNew.find('.js_box_content').html(sIframe); } else{ if (!empty(sForceMessage)){ $oNew.find('.js_box_content').html(''); $oNew.find('.js_box_content').html(sForceMessage); return; } var sAjaxType = 'GET'; if (params['' + getParam('sGlobalTokenName') + '[call]'] == 'share.popup'){ sAjaxType = 'POST'; } $.ajax( { type: sAjaxType, dataType: 'html', url: getParam('sJsAjax'), data: queryString, success: function(sMsg) { $oNew.find('.js_box_content').html(''); $oNew.find('.js_box_content').html(sMsg); if (!empty($oNew.find('.js_box_title_store:first').html())) { $oNew.find('.js_box_title:first').html($oNew.find('.js_box_title_store:first').html()); } $oNew.find('.js_box_title:first').show(); $oNew.find('.js_box_close:first').show(); if (bIsFullMode){ $oNew.find('.js_box_content').height(ajaxContentH); } if (bIsPhotoImage) { var thisHeight = $(window).height(); var thisBodyHeight = $('body').height(); var newHeight = (thisHeight > thisBodyHeight ? thisHeight : thisBodyHeight); // var newHeight = $('body').height(); $('.js_box_image_holder_full').css({'top': '0px', 'height': (newHeight + 50) + 'px'}); var bCanCloseImageBox = true; $Behavior.onCloseThickbox = function() { $('.js_box').click(function() { bCanCloseImageBox = false; }); $('.js_box a').click(function() { bCanCloseImageBox = false; }); $('.js_box_image_holder_full').click(function() { if (!bCanCloseImageBox) { bCanCloseImageBox = true; } else { $('#main_core_body_holder').show(); if ($('#noteform').length > 0) { $('#noteform').hide(); } if ($('#js_photo_view_image').length > 0) { $('#js_photo_view_image').imgAreaSelect({ hide: true }); } bIsPhotoImage = false; $(this).remove(); delete $aBoxHistory[params[getParam('sGlobalTokenName') + '[call]']]; // $Core.addUrlPager({'href': sLastOpenUrl.replace('/#!', '')}, true); } }); } $Behavior.onCloseThickbox(); } } }); } } $Behavior.thickboxBrowser = function(){ if ($Core.exists('.js_box_image_holder_full')){ $(document).keyup(function(e){ if (e.keyCode == 27){ js_box_remove($('.js_box_image_holder_full').find('.js_box_content')); } }); } } function tb_get_active() { var $aAllBoxIndex = new Array(); var $aAllBoxIndexHolder = new Array(); $('.js_box').each(function() { $aAllBoxIndex[parseInt($(this).css('z-index'))] = $(this).attr('id'); $aAllBoxIndexHolder.push(parseInt($(this).css('z-index'))); }); var $iFocusBox = parseInt(Math.max.apply(Math, $aAllBoxIndexHolder)); if (isset($aAllBoxIndex[$iFocusBox]) && $('#' + $aAllBoxIndex[$iFocusBox]).length > 0) { return $aAllBoxIndex[$iFocusBox]; } return null; } function tb_remove() { $('#main_core_body_holder').show(); var $aAllBoxIndex = new Array(); var $aAllBoxIndexHolder = new Array(); $('.js_box').each(function() { $aAllBoxIndex[parseInt($(this).css('z-index'))] = $(this).attr('id'); $aAllBoxIndexHolder.push(parseInt($(this).css('z-index'))); }); var $iFocusBox = parseInt(Math.max.apply(Math, $aAllBoxIndexHolder)); if (isset($aAllBoxIndex[$iFocusBox]) && $('#' + $aAllBoxIndex[$iFocusBox]).length > 0) { var $sLink = $('#' + $aAllBoxIndex[$iFocusBox]).find('.js_box_history:first').html(); $('#' + $aAllBoxIndex[$iFocusBox]).fadeOut('fast'); $('#' + $aAllBoxIndex[$iFocusBox]).parent('.js_box_image_holder').fadeOut('fast'); delete $aBoxHistory[$sLink]; } $('#global_attachment_list_inline').hide(); return false; } function tb_draggable($oObj) { if ($($oObj).parent().hasClass('js_box_image_holder_full')) { return false; } $($oObj).draggable( { handle: '.js_box_title', opacity: 0.35, zIndex: 3000, start: function(event, ui) { if ($('#global_attachment_list_inline').length > 0) { $('#global_attachment_list_inline').hide(); } }, stop: function(event, ui) { if ($('#global_attachment_list_inline').length > 0) { $Core.updateInlineBox(); $('#global_attachment_list_inline').show(); } } }); } function tb_position($oObj, bFull) { if (bFull !== true) { if (!$.ui) { $Core.loadStaticFile(getParam('sJsHome') + 'static/jscript/jquery/ui.js'); } tb_draggable('.js_box'); } var $aAllBoxIndex = new Array(); $('.js_box').each(function() { $aAllBoxIndex.push(parseInt($(this).css('z-index'))); }); $('.js_box').unbind('click'); $('.js_box').click(function() { var $aAllBoxIndexInner = new Array(); $('.js_box').each(function() { $aAllBoxIndexInner.push(parseInt($(this).css('z-index'))); }); $(this).css( { 'z-index': (parseInt(Math.max.apply(Math, $aAllBoxIndexInner)) + 1) }); }); if (bFull === true) { $($oObj).css( { top: getPageScroll()[1], left: '50%', 'margin-left': '-' + (($($oObj).width() / 2) + 12) + 'px', 'z-index': (parseInt(Math.max.apply(Math, $aAllBoxIndex)) + 1) }); } else { $($oObj).css( { top: getPageScroll()[1] + (getPageHeight() / 5), left: '50%', 'margin-left': '-' + (($($oObj).width() / 2) + 12) + 'px', 'z-index': (parseInt(Math.max.apply(Math, $aAllBoxIndex)) + 1) }); } if ($.browser.msie && $.browser.version == '7.0') { $Behavior.ie7FixZindex(); } } function tb_parseQuery(query) { var Params = {}; if (!query) { return Params; } var Pairs = query.split(/[;&]/); for (var i = 0; i < Pairs.length; i++) { var KeyVal = Pairs[i].split('='); if (!KeyVal || KeyVal.length != 2) { continue; } var key = unescape(KeyVal[0]); var val = unescape(KeyVal[1]); val = val.replace(/\+/g, ' '); Params[key] = val; } return Params; } function tb_getPageSize() { var de = document.documentElement; var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth; var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight; arrayPageSize = [w,h]; return arrayPageSize; } $Core.searchFriendsInput = { aParams: {}, iCnt: 0, aFoundUsers: {}, aLiveUsers: {}, sId: '', bNoSearch: false, aFoundUser: {}, // Store the found user here sHtml : '', // Store the final html here. Useful for onBeforePrepend init: function($aParams) { this.aParams = $aParams; if (!isset(this.aParams['search_input_id'])) { this.aParams['search_input_id'] = 'search_input_name_' + Math.round(Math.random() * 10000); } if (this._get('no_build')){ this.sId = $aParams['id'].replace('#', ''); } else{ this.sId = $aParams['id'].replace('#', '').replace('.', '') + '__tmp__'; } this.build(); }, build: function() { var $sHtml = ''; if (!this._get('no_build')){ $sHtml += '
    '; $sHtml += ''; $sHtml += ''; $sHtml += '
    '; $(this._get('id')).html($sHtml); } else{ $sHtml += ''; $('#' + this.sId).find('form:first').append($sHtml); } $('#' + this.sId).find('.js_temp_friend_search_input').keypress(function(e) { switch (e.keyCode) { case 9: case 40: case 38: var $iNextCnt = 0; $('.js_friend_search_link').each(function() { $iNextCnt++; if ($(this).hasClass('js_temp_friend_search_form_holder_focus')) { $(this).removeClass('js_temp_friend_search_form_holder_focus'); return false; } }); if (!$iNextCnt) { return false; } $Core.searchFriendsInput.bNoSearch = true; var $iNewCnt = 0; var $iActualFocus = 0; $('.js_friend_search_link').each(function() { $iNewCnt++; if ((e.keyCode == 38 ? ($iNextCnt - 1) == $iNewCnt : ($iNextCnt + 1) == $iNewCnt)) { $iActualFocus++; $(this).addClass('js_temp_friend_search_form_holder_focus'); return false; } }); if (!$iActualFocus) { $('.js_friend_search_link').each(function() { $(this).addClass('js_temp_friend_search_form_holder_focus'); return false; }); } return false; break; case 13: $Core.searchFriendsInput.bNoSearch = true; $('.js_friend_search_link').each(function() { if ($(this).hasClass('js_temp_friend_search_form_holder_focus')) { $Core.searchFriendsInput.processClick(this, $(this).attr('rel')); } }); break; default: // p(e.keyCode); break; } }); }, buildFriends: function($oObj) { $($oObj).val(''); if (empty($Cache.friends) && !isset(this.aParams['is_mail'])) { $.ajaxCall('friend.buildCache', (this._get('allow_custom') ? '&allow_custom=1' : ''), 'GET'); } }, getFriends: function($oObj) { if (empty($oObj.value)) { this.closeSearch($oObj); return; } if (this.bNoSearch) { this.bNoSearch = false; return; } if (isset(this.aParams['is_mail']) && this.aParams['is_mail'] == true) { $.ajaxCall('friend.getLiveSearch', 'parent_id=' + $($oObj).attr('id') + '&search_for=' + $($oObj).val() + '&width=' + this._get('width') + '&total_search=' + $Core.searchFriendsInput._get('max_search'), 'GET'); return; } var $iFound = 0; var $sHtml = ''; $($Cache.friends).each(function($sKey, $aUser) { var $mRegSearch = new RegExp($oObj.value, 'i'); if ($aUser['full_name'].match($mRegSearch)) { if (isset($Core.searchFriendsInput.aLiveUsers[$aUser['user_id']])) { return; } $iFound++; $Core.searchFriendsInput.storeUser($aUser['user_id'], $aUser); $sHtml += '
  • ' + $aUser['full_name'] + '
  • '; if ($iFound > $Core.searchFriendsInput._get('max_search')) { return false; } } }); if ($iFound) { if (this._get('global_search')){ $sHtml += '
  • ' + oTranslations['friend.show_more_results_for_search_term'].replace('{search_term}',htmlspecialchars($oObj.value)) + '
  • '; } $($oObj).parent().find('.js_temp_friend_search_form').html('
      ' + $sHtml + '
    ').show(); } else { $($oObj).parent().find('.js_temp_friend_search_form').html('').hide(); } }, storeUser: function($iUserId, $aData) { this.aFoundUsers[$iUserId] = $aData; }, processClick: function($oObj, $iUserId) { if (!isset(this.aFoundUsers[$iUserId])) { return false; } if (isset(this.aLiveUsers[$iUserId])) { return false; } this.aLiveUsers[$iUserId] = true; $Behavior.reloadLiveUsers = function(){ $Core.searchFriendsInput.aLiveUsers = {}; $Behavior.reloadLiveUsers = function(){} } this.bNoSearch = false; var $aUser = this.aFoundUser = this.aFoundUsers[$iUserId]; var $oPlacement = $(this._get('placement')); //$($oObj).parents('.js_friend_search_form:first').find('.js_temp_friend_search_input').val('').focus(); $($oObj).parents('.js_friend_search_form:first').find('.js_temp_friend_search_form').html('').hide(); var $sHtml = ''; $sHtml += '
  • '; $sHtml += 'Remove'; if (!this._get('inline_bubble')) { $sHtml += '
    '; } $sHtml += '
    ' + $aUser['full_name'] + '
    '; if (!this._get('inline_bubble')) { $sHtml += '
    '; } $sHtml += '
    '; $sHtml += '
  • '; this.sHtml = $sHtml; if (empty($oPlacement.html())) { $oPlacement.html('
    ' + (this._get('inline_bubble') ? '
    ' : '') + '
    '); } if (this._get('onBeforePrepend')) { this._get('onBeforePrepend')(this._get('onBeforePrepend')); } $oPlacement.find('ul').prepend(this.sHtml); if (this._get('onclick')) { this._get('onclick')(this._get('onclick')); } if (this._get('global_search')){ window.location.href = $aUser['user_profile']; $($oObj).parents('.js_temp_friend_search_form:first').hide(); } this.aFoundUsers = {}; if (this._get('inline_bubble')){ $('#' + this._get('search_input_id') + '').val('').focus(); } return false; }, closeSearch: function($oObj) { $($oObj).parent().find('.js_temp_friend_search_form').html('').hide(); }, _get: function($sParam) { return (isset(this.aParams[$sParam]) ? this.aParams[$sParam] : ''); } } /* * @name BeautyTips * @desc a tooltips/baloon-help plugin for jQuery * * @author Jeff Robbins - Lullabot - http://www.lullabot.com * @version 0.9.5 release candidate 1 (5/20/2009) */ jQuery.bt = {version: '0.9.5-rc1'}; /* * @type jQuery * @cat Plugins/bt * @requires jQuery v1.2+ (not tested on versions prior to 1.2.6) * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Encourage development. If you use BeautyTips for anything cool * or on a site that people have heard of, please drop me a note. * - jeff ^at lullabot > com * * No guarantees, warranties, or promises of any kind * */ ;(function($) { /** * @credit Inspired by Karl Swedberg's ClueTip * (http://plugins.learningjquery.com/cluetip/), which in turn was inspired * by Cody Lindley's jTip (http://www.codylindley.com) * * @fileoverview * Beauty Tips is a jQuery tooltips plugin which uses the canvas drawing element * in the HTML5 spec in order to dynamically draw tooltip "talk bubbles" around * the descriptive help text associated with an item. This is in many ways * similar to Google Maps which both provides similar talk-bubbles and uses the * canvas element to draw them. * * The canvas element is supported in modern versions of FireFox, Safari, and * Opera. However, Internet Explorer needs a separate library called ExplorerCanvas * included on the page in order to support canvas drawing functions. ExplorerCanvas * was created by Google for use with their web apps and you can find it here: * http://excanvas.sourceforge.net/ * * Beauty Tips was written to be simple to use and pretty. All of its options * are documented at the bottom of this file and defaults can be overwritten * globally for the entire page, or individually on each call. * * By default each tooltip will be positioned on the side of the target element * which has the most free space. This is affected by the scroll position and * size of the current window, so each Beauty Tip is redrawn each time it is * displayed. It may appear above an element at the bottom of the page, but when * the page is scrolled down (and the element is at the top of the page) it will * then appear below it. Additionally, positions can be forced or a preferred * order can be defined. See examples below. * * To fix z-index problems in IE6, include the bgiframe plugin on your page * http://plugins.jquery.com/project/bgiframe - BeautyTips will automatically * recognize it and use it. * * BeautyTips also works with the hoverIntent plugin * http://cherne.net/brian/resources/jquery.hoverIntent.html * see hoverIntent example below for usage * * Usage * The function can be called in a number of ways. * $(selector).bt(); * $(selector).bt('Content text'); * $(selector).bt('Content text', {option1: value, option2: value}); * $(selector).bt({option1: value, option2: value}); * * For more/better documentation and lots of examples, visit the demo page included with the distribution * */ jQuery.fn.bt = function(content, options) { if (typeof content != 'string') { var contentSelect = true; options = content; content = false; } else { var contentSelect = false; } // if hoverIntent is installed, use that as default instead of hover if (jQuery.fn.hoverIntent && jQuery.bt.defaults.trigger == 'hover') { jQuery.bt.defaults.trigger = 'hoverIntent'; } return this.each(function(index) { var opts = jQuery.extend(false, jQuery.bt.defaults, jQuery.bt.options, options); // clean up the options opts.spikeLength = numb(opts.spikeLength); opts.spikeGirth = numb(opts.spikeGirth); opts.overlap = numb(opts.overlap); var ajaxTimeout = false; /** * This is sort of the "starting spot" for the this.each() * These are the init functions to handle the .bt() call */ if (opts.killTitle) { $(this).find('[title]').andSelf().each(function() { if (!$(this).attr('bt-xTitle')) { $(this).attr('bt-xTitle', $(this).attr('title')).attr('title', ''); } }); } if (typeof opts.trigger == 'string') { opts.trigger = [opts.trigger]; } if (opts.trigger[0] == 'hoverIntent') { var hoverOpts = jQuery.extend(opts.hoverIntentOpts, { over: function() { this.btOn(); }, out: function() { this.btOff(); }}); $(this).hoverIntent(hoverOpts); } else if (opts.trigger[0] == 'hover') { $(this).hover( function() { this.btOn(); }, function() { this.btOff(); } ); } else if (opts.trigger[0] == 'now') { // toggle the on/off right now // note that 'none' gives more control (see below) if ($(this).hasClass('bt-active')) { this.btOff(); } else { this.btOn(); } } else if (opts.trigger[0] == 'none') { // initialize the tip with no event trigger // use javascript to turn on/off tip as follows: // $('#selector').btOn(); // $('#selector').btOff(); } else if (opts.trigger.length > 1 && opts.trigger[0] != opts.trigger[1]) { $(this) .bind(opts.trigger[0], function() { this.btOn(); }) .bind(opts.trigger[1], function() { this.btOff(); }); } else { // toggle using the same event $(this).bind(opts.trigger[0], function() { if ($(this).hasClass('bt-active')) { this.btOff(); } else { this.btOn(); } }); } /** * The BIG TURN ON * Any element that has been initiated */ this.btOn = function () { if (typeof $(this).data('bt-box') == 'object') { // if there's already a popup, remove it before creating a new one. this.btOff(); } // trigger preBuild function // preBuild has no argument since the box hasn't been built yet opts.preBuild.apply(this); // turn off other tips $(jQuery.bt.vars.closeWhenOpenStack).btOff(); // add the class to the target element (for hilighting, for example) // bt-active is always applied to all, but activeClass can apply another $(this).addClass('bt-active ' + opts.activeClass); if (contentSelect && opts.ajaxPath == null) { // bizarre, I know if (opts.killTitle) { // if we've killed the title attribute, it's been stored in 'bt-xTitle' so get it.. $(this).attr('title', $(this).attr('bt-xTitle')); } // then evaluate the selector... title is now in place content = $.isFunction(opts.contentSelector) ? opts.contentSelector.apply(this) : eval(opts.contentSelector); if (opts.killTitle) { // now remove the title again, so we don't get double tips $(this).attr('title', ''); } } // ---------------------------------------------- // All the Ajax(ish) stuff is in this next bit... // ---------------------------------------------- if (opts.ajaxPath != null && content == false) { if (typeof opts.ajaxPath == 'object') { var url = eval(opts.ajaxPath[0]); url += opts.ajaxPath[1] ? ' ' + opts.ajaxPath[1] : ''; } else { var url = opts.ajaxPath; } var off = url.indexOf(" "); if ( off >= 0 ) { var selector = url.slice(off, url.length); url = url.slice(0, off); } // load any data cached for the given ajax path var cacheData = opts.ajaxCache ? $(document.body).data('btCache-' + url.replace(/\./g, '')) : null; if (typeof cacheData == 'string') { content = selector ? $("
    ").append(cacheData.replace(//g, "")).find(selector) : cacheData; } else { var target = this; // set up the options var ajaxOpts = jQuery.extend(false, { type: opts.ajaxType, data: opts.ajaxData, cache: opts.ajaxCache, url: url, complete: function(XMLHttpRequest, textStatus) { if (textStatus == 'success' || textStatus == 'notmodified') { if (opts.ajaxCache) { $(document.body).data('btCache-' + url.replace(/\./g, ''), XMLHttpRequest.responseText); } ajaxTimeout = false; content = selector ? // Create a dummy div to hold the results $("
    ") // inject the contents of the document in, removing the scripts // to avoid any 'Permission Denied' errors in IE .append(XMLHttpRequest.responseText.replace(//g, "")) // Locate the specified elements .find(selector) : // If not, just inject the full result XMLHttpRequest.responseText; } else { if (textStatus == 'timeout') { // if there was a timeout, we don't cache the result ajaxTimeout = true; } content = opts.ajaxError.replace(/%error/g, XMLHttpRequest.statusText); } // if the user rolls out of the target element before the ajax request comes back, don't show it if ($(target).hasClass('bt-active')) { target.btOn(); } } }, opts.ajaxOpts); // do the ajax request jQuery.ajax(ajaxOpts); // load the throbber while the magic happens content = opts.ajaxLoading; } } // // now we start actually figuring out where to place the tip // figure out how to compensate for the shadow, if present var shadowMarginX = 0; // extra added to width to compensate for shadow var shadowMarginY = 0; // extra added to height var shadowShiftX = 0; // amount to shift the tip horizontally to allow for shadow var shadowShiftY = 0; // amount to shift vertical if (opts.shadow && !shadowSupport()) { // if browser doesn't support drop shadows, turn them off opts.shadow = false; // and bring in the noShadows options jQuery.extend(opts, opts.noShadowOpts); } if (opts.shadow) { // figure out horizontal placement if (opts.shadowBlur > Math.abs(opts.shadowOffsetX)) { shadowMarginX = opts.shadowBlur * 2; } else { shadowMarginX = opts.shadowBlur + Math.abs(opts.shadowOffsetX); } shadowShiftX = (opts.shadowBlur - opts.shadowOffsetX) > 0 ? opts.shadowBlur - opts.shadowOffsetX : 0; // now vertical if (opts.shadowBlur > Math.abs(opts.shadowOffsetY)) { shadowMarginY = opts.shadowBlur * 2; } else { shadowMarginY = opts.shadowBlur + Math.abs(opts.shadowOffsetY); } shadowShiftY = (opts.shadowBlur - opts.shadowOffsetY) > 0 ? opts.shadowBlur - opts.shadowOffsetY : 0; } if (opts.offsetParent){ // if offsetParent is defined by user var offsetParent = $(opts.offsetParent); var offsetParentPos = offsetParent.offset(); var pos = $(this).offset(); var top = numb(pos.top) - numb(offsetParentPos.top) + numb($(this).css('margin-top')) - shadowShiftY; // IE can return 'auto' for margins var left = numb(pos.left) - numb(offsetParentPos.left) + numb($(this).css('margin-left')) - shadowShiftX; } else { // if the target element is absolutely positioned, use its parent's offsetParent instead of its own var offsetParent = ($(this).css('position') == 'absolute') ? $(this).parents().eq(0).offsetParent() : $(this).offsetParent(); var pos = $(this).btPosition(); var top = numb(pos.top) + numb($(this).css('margin-top')) - shadowShiftY; // IE can return 'auto' for margins var left = numb(pos.left) + numb($(this).css('margin-left')) - shadowShiftX; } var width = $(this).btOuterWidth(); var height = $(this).outerHeight(); if (typeof content == 'object') { // if content is a DOM object (as opposed to text) // use a clone, rather than removing the original element // and ensure that it's visible var original = content; var clone = $(original).clone(true).show(); // also store a reference to the original object in the clone data // and a reference to the clone in the original var origClones = $(original).data('bt-clones') || []; origClones.push(clone); $(original).data('bt-clones', origClones); $(clone).data('bt-orig', original); $(this).data('bt-content-orig', {original: original, clone: clone}); content = clone; } if (typeof content == 'null' || content == '') { // if content is empty, bail out... return; } // create the tip content div, populate it, and style it var $text = $('
    ').append(content).css({padding: opts.padding, position: 'absolute', width: (opts.shrinkToFit ? 'auto' : opts.width), zIndex: opts.textzIndex, left: shadowShiftX, top: shadowShiftY}).css(opts.cssStyles); // create the wrapping box which contains text and canvas // put the content in it, style it, and append it to the same offset parent as the target var $box = $('
    ').append($text).addClass(opts.cssClass).css({position: 'absolute', width: opts.width, zIndex: opts.wrapperzIndex, visibility:'hidden'}).appendTo(offsetParent); // use bgiframe to get around z-index problems in IE6 // http://plugins.jquery.com/project/bgiframe if (jQuery.fn.bgiframe) { $text.bgiframe(); $box.bgiframe(); } $(this).data('bt-box', $box); // see if the text box will fit in the various positions var scrollTop = numb($(document).scrollTop()); var scrollLeft = numb($(document).scrollLeft()); var docWidth = numb($(window).width()); var docHeight = numb($(window).height()); var winRight = scrollLeft + docWidth; var winBottom = scrollTop + docHeight; var space = new Object(); var thisOffset = $(this).offset(); space.top = thisOffset.top - scrollTop; space.bottom = docHeight - ((thisOffset + height) - scrollTop); space.left = thisOffset.left - scrollLeft; space.right = docWidth - ((thisOffset.left + width) - scrollLeft); var textOutHeight = numb($text.outerHeight()); var textOutWidth = numb($text.btOuterWidth()); if (opts.positions.constructor == String) { opts.positions = opts.positions.replace(/ /, '').split(','); } if (opts.positions[0] == 'most') { // figure out which is the largest var position = 'top'; // prime the pump for (var pig in space) { // <------- pigs in space! position = space[pig] > space[position] ? pig : position; } } else { for (var x in opts.positions) { var position = opts.positions[x]; // @todo: acommodate shadow space in the following lines... if ((position == 'left' || position == 'right') && space[position] > textOutWidth + opts.spikeLength) { break; } else if ((position == 'top' || position == 'bottom') && space[position] > textOutHeight + opts.spikeLength) { break; } } } // horizontal (left) offset for the box var horiz = left + ((width - textOutWidth) * .5); // vertical (top) offset for the box var vert = top + ((height - textOutHeight) * .5); var points = new Array(); var textTop, textLeft, textRight, textBottom, textTopSpace, textBottomSpace, textLeftSpace, textRightSpace, crossPoint, textCenter, spikePoint; // Yes, yes, this next bit really could use to be condensed // each switch case is basically doing the same thing in slightly different ways switch(position) { // =================== TOP ======================= case 'top': // spike on bottom $text.css('margin-bottom', opts.spikeLength + 'px'); $box.css({top: (top - $text.outerHeight(true)) + opts.overlap, left: horiz}); // move text left/right if extends out of window textRightSpace = (winRight - opts.windowMargin) - ($text.offset().left + $text.btOuterWidth(true)); var xShift = shadowShiftX; if (textRightSpace < 0) { // shift it left $box.css('left', (numb($box.css('left')) + textRightSpace) + 'px'); xShift -= textRightSpace; } // we test left space second to ensure that left of box is visible textLeftSpace = ($text.offset().left + numb($text.css('margin-left'))) - (scrollLeft + opts.windowMargin); if (textLeftSpace < 0) { // shift it right $box.css('left', (numb($box.css('left')) - textLeftSpace) + 'px'); xShift += textLeftSpace; } textTop = $text.btPosition().top + numb($text.css('margin-top')); textLeft = $text.btPosition().left + numb($text.css('margin-left')); textRight = textLeft + $text.btOuterWidth(); textBottom = textTop + $text.outerHeight(); textCenter = {x: textLeft + ($text.btOuterWidth()*opts.centerPointX), y: textTop + ($text.outerHeight()*opts.centerPointY)}; // points[points.length] = {x: x, y: y}; points[points.length] = spikePoint = {y: textBottom + opts.spikeLength, x: ((textRight-textLeft) * .5) + xShift, type: 'spike'}; crossPoint = findIntersectX(spikePoint.x, spikePoint.y, textCenter.x, textCenter.y, textBottom); // make sure that the crossPoint is not outside of text box boundaries crossPoint.x = crossPoint.x < textLeft + opts.spikeGirth/2 + opts.cornerRadius ? textLeft + opts.spikeGirth/2 + opts.cornerRadius : crossPoint.x; crossPoint.x = crossPoint.x > (textRight - opts.spikeGirth/2) - opts.cornerRadius ? (textRight - opts.spikeGirth/2) - opts.CornerRadius : crossPoint.x; points[points.length] = {x: crossPoint.x - (opts.spikeGirth/2), y: textBottom, type: 'join'}; points[points.length] = {x: textLeft, y: textBottom, type: 'corner'}; // left bottom corner points[points.length] = {x: textLeft, y: textTop, type: 'corner'}; // left top corner points[points.length] = {x: textRight, y: textTop, type: 'corner'}; // right top corner points[points.length] = {x: textRight, y: textBottom, type: 'corner'}; // right bottom corner points[points.length] = {x: crossPoint.x + (opts.spikeGirth/2), y: textBottom, type: 'join'}; points[points.length] = spikePoint; break; // =================== LEFT ======================= case 'left': // spike on right $text.css('margin-right', opts.spikeLength + 'px'); $box.css({top: vert + 'px', left: ((left - $text.btOuterWidth(true)) + opts.overlap) + 'px'}); // move text up/down if extends out of window textBottomSpace = (winBottom - opts.windowMargin) - ($text.offset().top + $text.outerHeight(true)); var yShift = shadowShiftY; if (textBottomSpace < 0) { // shift it up $box.css('top', (numb($box.css('top')) + textBottomSpace) + 'px'); yShift -= textBottomSpace; } // we ensure top space second to ensure that top of box is visible textTopSpace = ($text.offset().top + numb($text.css('margin-top'))) - (scrollTop + opts.windowMargin); if (textTopSpace < 0) { // shift it down $box.css('top', (numb($box.css('top')) - textTopSpace) + 'px'); yShift += textTopSpace; } textTop = $text.btPosition().top + numb($text.css('margin-top')); textLeft = $text.btPosition().left + numb($text.css('margin-left')); textRight = textLeft + $text.btOuterWidth(); textBottom = textTop + $text.outerHeight(); textCenter = {x: textLeft + ($text.btOuterWidth()*opts.centerPointX), y: textTop + ($text.outerHeight()*opts.centerPointY)}; points[points.length] = spikePoint = {x: textRight + opts.spikeLength, y: ((textBottom-textTop) * .5) + yShift, type: 'spike'}; crossPoint = findIntersectY(spikePoint.x, spikePoint.y, textCenter.x, textCenter.y, textRight); // make sure that the crossPoint is not outside of text box boundaries crossPoint.y = crossPoint.y < textTop + opts.spikeGirth/2 + opts.cornerRadius ? textTop + opts.spikeGirth/2 + opts.cornerRadius : crossPoint.y; crossPoint.y = crossPoint.y > (textBottom - opts.spikeGirth/2) - opts.cornerRadius ? (textBottom - opts.spikeGirth/2) - opts.cornerRadius : crossPoint.y; points[points.length] = {x: textRight, y: crossPoint.y + opts.spikeGirth/2, type: 'join'}; points[points.length] = {x: textRight, y: textBottom, type: 'corner'}; // right bottom corner points[points.length] = {x: textLeft, y: textBottom, type: 'corner'}; // left bottom corner points[points.length] = {x: textLeft, y: textTop, type: 'corner'}; // left top corner points[points.length] = {x: textRight, y: textTop, type: 'corner'}; // right top corner points[points.length] = {x: textRight, y: crossPoint.y - opts.spikeGirth/2, type: 'join'}; points[points.length] = spikePoint; break; // =================== BOTTOM ======================= case 'bottom': // spike on top $text.css('margin-top', opts.spikeLength + 'px'); $box.css({top: (top + height) - opts.overlap, left: horiz}); // move text up/down if extends out of window textRightSpace = (winRight - opts.windowMargin) - ($text.offset().left + $text.btOuterWidth(true)); var xShift = shadowShiftX; if (textRightSpace < 0) { // shift it left $box.css('left', (numb($box.css('left')) + textRightSpace) + 'px'); xShift -= textRightSpace; } // we ensure left space second to ensure that left of box is visible textLeftSpace = ($text.offset().left + numb($text.css('margin-left'))) - (scrollLeft + opts.windowMargin); if (textLeftSpace < 0) { // shift it right $box.css('left', (numb($box.css('left')) - textLeftSpace) + 'px'); xShift += textLeftSpace; } textTop = $text.btPosition().top + numb($text.css('margin-top')); textLeft = $text.btPosition().left + numb($text.css('margin-left')); textRight = textLeft + $text.btOuterWidth(); textBottom = textTop + $text.outerHeight(); textCenter = {x: textLeft + ($text.btOuterWidth()*opts.centerPointX), y: textTop + ($text.outerHeight()*opts.centerPointY)}; points[points.length] = spikePoint = {x: ((textRight-textLeft) * .5) + xShift, y: shadowShiftY, type: 'spike'}; crossPoint = findIntersectX(spikePoint.x, spikePoint.y, textCenter.x, textCenter.y, textTop); // make sure that the crossPoint is not outside of text box boundaries crossPoint.x = crossPoint.x < textLeft + opts.spikeGirth/2 + opts.cornerRadius ? textLeft + opts.spikeGirth/2 + opts.cornerRadius : crossPoint.x; crossPoint.x = crossPoint.x > (textRight - opts.spikeGirth/2) - opts.cornerRadius ? (textRight - opts.spikeGirth/2) - opts.cornerRadius : crossPoint.x; points[points.length] = {x: crossPoint.x + opts.spikeGirth/2, y: textTop, type: 'join'}; points[points.length] = {x: textRight, y: textTop, type: 'corner'}; // right top corner points[points.length] = {x: textRight, y: textBottom, type: 'corner'}; // right bottom corner points[points.length] = {x: textLeft, y: textBottom, type: 'corner'}; // left bottom corner points[points.length] = {x: textLeft, y: textTop, type: 'corner'}; // left top corner points[points.length] = {x: crossPoint.x - (opts.spikeGirth/2), y: textTop, type: 'join'}; points[points.length] = spikePoint; break; // =================== RIGHT ======================= case 'right': // spike on left $text.css('margin-left', (opts.spikeLength + 'px')); $box.css({top: vert + 'px', left: ((left + width) - opts.overlap) + 'px'}); // move text up/down if extends out of window textBottomSpace = (winBottom - opts.windowMargin) - ($text.offset().top + $text.outerHeight(true)); var yShift = shadowShiftY; if (textBottomSpace < 0) { // shift it up $box.css('top', (numb($box.css('top')) + textBottomSpace) + 'px'); yShift -= textBottomSpace; } // we ensure top space second to ensure that top of box is visible textTopSpace = ($text.offset().top + numb($text.css('margin-top'))) - (scrollTop + opts.windowMargin); if (textTopSpace < 0) { // shift it down $box.css('top', (numb($box.css('top')) - textTopSpace) + 'px'); yShift += textTopSpace; } textTop = $text.btPosition().top + numb($text.css('margin-top')); textLeft = $text.btPosition().left + numb($text.css('margin-left')); textRight = textLeft + $text.btOuterWidth(); textBottom = textTop + $text.outerHeight(); textCenter = {x: textLeft + ($text.btOuterWidth()*opts.centerPointX), y: textTop + ($text.outerHeight()*opts.centerPointY)}; points[points.length] = spikePoint = {x: shadowShiftX, y: ((textBottom-textTop) * .5) + yShift, type: 'spike'}; crossPoint = findIntersectY(spikePoint.x, spikePoint.y, textCenter.x, textCenter.y, textLeft); // make sure that the crossPoint is not outside of text box boundaries crossPoint.y = crossPoint.y < textTop + opts.spikeGirth/2 + opts.cornerRadius ? textTop + opts.spikeGirth/2 + opts.cornerRadius : crossPoint.y; crossPoint.y = crossPoint.y > (textBottom - opts.spikeGirth/2) - opts.cornerRadius ? (textBottom - opts.spikeGirth/2) - opts.cornerRadius : crossPoint.y; points[points.length] = {x: textLeft, y: crossPoint.y - opts.spikeGirth/2, type: 'join'}; points[points.length] = {x: textLeft, y: textTop, type: 'corner'}; // left top corner points[points.length] = {x: textRight, y: textTop, type: 'corner'}; // right top corner points[points.length] = {x: textRight, y: textBottom, type: 'corner'}; // right bottom corner points[points.length] = {x: textLeft, y: textBottom, type: 'corner'}; // left bottom corner points[points.length] = {x: textLeft, y: crossPoint.y + opts.spikeGirth/2, type: 'join'}; points[points.length] = spikePoint; break; } // var canvas = document.createElement('canvas'); $(canvas).attr('width', (numb($text.btOuterWidth(true)) + opts.strokeWidth*2 + shadowMarginX)).attr('height', (numb($text.outerHeight(true)) + opts.strokeWidth*2 + shadowMarginY)).appendTo($box).css({position: 'absolute', zIndex: opts.boxzIndex}); // if excanvas is set up, we need to initialize the new canvas element if (typeof G_vmlCanvasManager != 'undefined') { canvas = G_vmlCanvasManager.initElement(canvas); } if (opts.cornerRadius > 0) { // round the corners! var newPoints = new Array(); var newPoint; for (var i=0; i 0) { $box.css('top', (numb($box.css('top')) - (opts.shadowOffsetX + opts.shadowBlur - shadowOverlap))); } break; case 'right': if (shadowShiftX - shadowOverlap > 0) { $box.css('left', (numb($box.css('left')) + shadowShiftX - shadowOverlap)); } break; case 'bottom': if (shadowShiftY - shadowOverlap > 0) { $box.css('top', (numb($box.css('top')) + shadowShiftY - shadowOverlap)); } break; case 'left': if (opts.shadowOffsetY + opts.shadowBlur - shadowOverlap > 0) { $box.css('left', (numb($box.css('left')) - (opts.shadowOffsetY + opts.shadowBlur - shadowOverlap))); } break; } } drawIt.apply(ctx, [points], opts.strokeWidth); ctx.fillStyle = opts.fill; if (opts.shadow) { ctx.shadowOffsetX = opts.shadowOffsetX; ctx.shadowOffsetY = opts.shadowOffsetY; ctx.shadowBlur = opts.shadowBlur; ctx.shadowColor = opts.shadowColor; } ctx.closePath(); ctx.fill(); if (opts.strokeWidth > 0) { ctx.shadowColor = 'rgba(0, 0, 0, 0)'; //remove shadow from stroke ctx.lineWidth = opts.strokeWidth; ctx.strokeStyle = opts.strokeStyle; ctx.beginPath(); drawIt.apply(ctx, [points], opts.strokeWidth); ctx.closePath(); ctx.stroke(); } // trigger preShow function // function receives the box element (the balloon wrapper div) as an argument opts.preShow.apply(this, [$box[0]]); // switch from visibility: hidden to display: none so we can run animations $box.css({display:'none', visibility: 'visible'}); // Here's where we show the tip opts.showTip.apply(this, [$box[0]]); if (opts.overlay) { // EXPERIMENTAL AND FOR TESTING ONLY!!!! var overlay = $('
    ').css({ position: 'absolute', backgroundColor: 'blue', top: top, left: left, width: width, height: height, opacity: '.2' }).appendTo(offsetParent); $(this).data('overlay', overlay); } if ((opts.ajaxPath != null && opts.ajaxCache == false) || ajaxTimeout) { // if ajaxCache is not enabled or if there was a server timeout, // remove the content variable so it will be loaded again from server content = false; } // stick this element into the clickAnywhereToClose stack if (opts.clickAnywhereToClose) { jQuery.bt.vars.clickAnywhereStack.push(this); $(document).click(jQuery.bt.docClick); } // stick this element into the closeWhenOthersOpen stack if (opts.closeWhenOthersOpen) { jQuery.bt.vars.closeWhenOpenStack.push(this); } // trigger postShow function // function receives the box element (the balloon wrapper div) as an argument opts.postShow.apply(this, [$box[0]]); }; // this.btOff = function() { var box = $(this).data('bt-box'); // trigger preHide function // function receives the box element (the balloon wrapper div) as an argument opts.preHide.apply(this, [box]); var i = this; // set up the stuff to happen AFTER the tip is hidden i.btCleanup = function(){ var box = $(i).data('bt-box'); var contentOrig = $(i).data('bt-content-orig'); var overlay = $(i).data('bt-overlay'); if (typeof box == 'object') { $(box).remove(); $(i).removeData('bt-box'); } if (typeof contentOrig == 'object') { var clones = $(contentOrig.original).data('bt-clones'); $(contentOrig).data('bt-clones', arrayRemove(clones, contentOrig.clone)); } if (typeof overlay == 'object') { $(overlay).remove(); $(i).removeData('bt-overlay'); } // remove this from the stacks jQuery.bt.vars.clickAnywhereStack = arrayRemove(jQuery.bt.vars.clickAnywhereStack, i); jQuery.bt.vars.closeWhenOpenStack = arrayRemove(jQuery.bt.vars.closeWhenOpenStack, i); // remove the 'bt-active' and activeClass classes from target $(i).removeClass('bt-active ' + opts.activeClass); // trigger postHide function // no box argument since it has been removed from the DOM opts.postHide.apply(i); } opts.hideTip.apply(this, [box, i.btCleanup]); }; // var refresh = this.btRefresh = function() { this.btOff(); this.btOn(); }; }); // function drawIt(points, strokeWidth) { this.moveTo(points[0].x, points[0].y); for (i=1;i /** * For odd stroke widths, round to the nearest .5 pixel to avoid antialiasing * http://developer.mozilla.org/en/Canvas_tutorial/Applying_styles_and_colors */ function round5(num, strokeWidth) { var ret; strokeWidth = numb(strokeWidth); if (strokeWidth%2) { ret = num; } else { ret = Math.round(num - .5) + .5; } return ret; }; // /** * Ensure that a number is a number... or zero */ function numb(num) { return parseInt(num) || 0; }; // /** * Remove an element from an array */ function arrayRemove(arr, elem) { var x, newArr = new Array(); for (x in arr) { if (arr[x] != elem) { newArr.push(arr[x]); } } return newArr; }; // /** * Does the current browser support canvas? * This is a variation of http://code.google.com/p/browser-canvas-support/ */ function canvasSupport() { var canvas_compatible = false; try { canvas_compatible = !!(document.createElement('canvas').getContext('2d')); // S60 } catch(e) { canvas_compatible = !!(document.createElement('canvas').getContext); // IE } return canvas_compatible; } /** * Does the current browser support canvas drop shadows? */ function shadowSupport() { // to test for drop shadow support in the current browser, uncomment the next line // return true; // until a good feature-detect is found, we have to look at user agents try { var userAgent = navigator.userAgent.toLowerCase(); if (/webkit/.test(userAgent)) { // WebKit.. let's go! return true; } else if (/gecko|mozilla/.test(userAgent) && parseFloat(userAgent.match(/firefox\/(\d+(?:\.\d+)+)/)[1]) >= 3.1){ // Mozilla 3.1 or higher return true; } } catch(err) { // if there's an error, just keep going, we'll assume that drop shadows are not supported } return false; } // /** * Given two points, find a point which is dist pixels from point1 on a line to point2 */ function betweenPoint(point1, point2, dist) { // figure out if we're horizontal or vertical var y, x; if (point1.x == point2.x) { // vertical y = point1.y < point2.y ? point1.y + dist : point1.y - dist; return {x: point1.x, y: y}; } else if (point1.y == point2.y) { // horizontal x = point1.x < point2.x ? point1.x + dist : point1.x - dist; return {x:x, y: point1.y}; } }; // function centerPoint(arcStart, corner, arcEnd) { var x = corner.x == arcStart.x ? arcEnd.x : arcStart.x; var y = corner.y == arcStart.y ? arcEnd.y : arcStart.y; var startAngle, endAngle; if (arcStart.x < arcEnd.x) { if (arcStart.y > arcEnd.y) { // arc is on upper left startAngle = (Math.PI/180)*180; endAngle = (Math.PI/180)*90; } else { // arc is on upper right startAngle = (Math.PI/180)*90; endAngle = 0; } } else { if (arcStart.y > arcEnd.y) { // arc is on lower left startAngle = (Math.PI/180)*270; endAngle = (Math.PI/180)*180; } else { // arc is on lower right startAngle = 0; endAngle = (Math.PI/180)*270; } } return {x: x, y: y, type: 'center', startAngle: startAngle, endAngle: endAngle}; }; // /** * Find the intersection point of two lines, each defined by two points * arguments are x1, y1 and x2, y2 for r1 (line 1) and r2 (line 2) * It's like an algebra party!!! */ function findIntersect(r1x1, r1y1, r1x2, r1y2, r2x1, r2y1, r2x2, r2y2) { if (r2x1 == r2x2) { return findIntersectY(r1x1, r1y1, r1x2, r1y2, r2x1); } if (r2y1 == r2y2) { return findIntersectX(r1x1, r1y1, r1x2, r1y2, r2y1); } // m = (y1 - y2) / (x1 - x2) // <-- how to find the slope // y = mx + b // the 'classic' linear equation // b = y - mx // how to find b (the y-intersect) // x = (y - b)/m // how to find x var r1m = (r1y1 - r1y2) / (r1x1 - r1x2); var r1b = r1y1 - (r1m * r1x1); var r2m = (r2y1 - r2y2) / (r2x1 - r2x2); var r2b = r2y1 - (r2m * r2x1); var x = (r2b - r1b) / (r1m - r2m); var y = r1m * x + r1b; return {x: x, y: y}; }; // /** * Find the y intersection point of a line and given x vertical */ function findIntersectY(r1x1, r1y1, r1x2, r1y2, x) { if (r1y1 == r1y2) { return {x: x, y: r1y1}; } var r1m = (r1y1 - r1y2) / (r1x1 - r1x2); var r1b = r1y1 - (r1m * r1x1); var y = r1m * x + r1b; return {x: x, y: y}; }; // /** * Find the x intersection point of a line and given y horizontal */ function findIntersectX(r1x1, r1y1, r1x2, r1y2, y) { if (r1x1 == r1x2) { return {x: r1x1, y: y}; } var r1m = (r1y1 - r1y2) / (r1x1 - r1x2); var r1b = r1y1 - (r1m * r1x1); // y = mx + b // your old friend, linear equation // x = (y - b)/m // linear equation solved for x var x = (y - r1b) / r1m; return {x: x, y: y}; }; // }; // /** * jQuery's compat.js (used in Drupal's jQuery upgrade module, overrides the $().position() function * this is a copy of that function to allow the plugin to work when compat.js is present * once compat.js is fixed to not override existing functions, this function can be removed * and .btPosion() can be replaced with .position() above... */ jQuery.fn.btPosition = function() { function num(elem, prop) { return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0; }; var left = 0, top = 0, results; if ( this[0] ) { // Get *real* offsetParent var offsetParent = this.offsetParent(), // Get correct offsets offset = this.offset(), parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset(); // Subtract element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 offset.top -= num( this, 'marginTop' ); offset.left -= num( this, 'marginLeft' ); // Add offsetParent borders parentOffset.top += num( offsetParent, 'borderTopWidth' ); parentOffset.left += num( offsetParent, 'borderLeftWidth' ); // Subtract the two offsets results = { top: offset.top - parentOffset.top, left: offset.left - parentOffset.left }; } return results; }; // /** * jQuery's dimensions.js overrides the $().btOuterWidth() function * this is a copy of original jQuery's outerWidth() function to * allow the plugin to work when dimensions.js is present */ jQuery.fn.btOuterWidth = function(margin) { function num(elem, prop) { return elem[0] && parseInt(jQuery.curCSS(elem[0], prop, true), 10) || 0; }; return this["innerWidth"]() + num(this, "borderLeftWidth") + num(this, "borderRightWidth") + (margin ? num(this, "marginLeft") + num(this, "marginRight") : 0); }; // /** * A convenience function to run btOn() (if available) * for each selected item */ jQuery.fn.btOn = function() { return this.each(function(index){ if (jQuery.isFunction(this.btOn)) { this.btOn(); } }); }; // /** * * A convenience function to run btOff() (if available) * for each selected item */ jQuery.fn.btOff = function() { return this.each(function(index){ if (jQuery.isFunction(this.btOff)) { this.btOff(); } }); }; // jQuery.bt.vars = {clickAnywhereStack: [], closeWhenOpenStack: []}; /** * This function gets bound to the document's click event * It turns off all of the tips in the click-anywhere-to-close stack */ jQuery.bt.docClick = function(e) { if (!e) { var e = window.event; }; // if clicked element is a child of neither a tip NOR a target // and there are tips in the stack if (!$(e.target).parents().andSelf().filter('.bt-wrapper, .bt-active').length && jQuery.bt.vars.clickAnywhereStack.length) { // if clicked element isn't inside tip, close tips in stack $(jQuery.bt.vars.clickAnywhereStack).btOff(); $(document).unbind('click', jQuery.bt.docClick); } }; // /** * Defaults for the beauty tips * * Note this is a variable definition and not a function. So defaults can be * written for an entire page by simply redefining attributes like so: * * jQuery.bt.options.width = 400; * * Be sure to use *jQuery.bt.options* and not jQuery.bt.defaults when overriding * * This would make all Beauty Tips boxes 400px wide. * * Each of these options may also be overridden during * * Can be overriden globally or at time of call. * */ jQuery.bt.defaults = { trigger: 'hover', // trigger to show/hide tip // use [on, off] to define separate on/off triggers // also use space character to allow multiple to trigger // examples: // ['focus', 'blur'] // focus displays, blur hides // 'dblclick' // dblclick toggles on/off // ['focus mouseover', 'blur mouseout'] // multiple triggers // 'now' // shows/hides tip without event // 'none' // use $('#selector').btOn(); and ...btOff(); // 'hoverIntent' // hover using hoverIntent plugin (settings below) // note: // hoverIntent becomes default if available clickAnywhereToClose: true, // clicking anywhere outside of the tip will close it closeWhenOthersOpen: false, // tip will be closed before another opens - stop >= 2 tips being on shrinkToFit: false, // should short single-line content get a narrower balloon? width: '200px', // width of tooltip box padding: '10px', // padding for content (get more fine grained with cssStyles) spikeGirth: 10, // width of spike spikeLength: 15, // length of spike overlap: 0, // spike overlap (px) onto target (can cause problems with 'hover' trigger) overlay: false, // display overlay on target (use CSS to style) -- BUGGY! killTitle: true, // kill title tags to avoid double tooltips textzIndex: 9999, // z-index for the text boxzIndex: 9998, // z-index for the "talk" box (should always be less than textzIndex) wrapperzIndex: 9997, offsetParent: null, // DOM node to append the tooltip into. // Must be positioned relative or absolute. Can be selector or object positions: ['most'], // preference of positions for tip (will use first with available space) // possible values 'top', 'bottom', 'left', 'right' as an array in order of // preference. Last value will be used if others don't have enough space. // or use 'most' to use the area with the most space fill: "rgb(255, 255, 102)", // fill color for the tooltip box, you can use any CSS-style color definition method // http://www.w3.org/TR/css3-color/#numerical - not all methods have been tested windowMargin: 10, // space (px) to leave between text box and browser edge strokeWidth: 1, // width of stroke around box, **set to 0 for no stroke** strokeStyle: "#000", // color/alpha of stroke cornerRadius: 5, // radius of corners (px), set to 0 for square corners // following values are on a scale of 0 to 1 with .5 being centered centerPointX: .5, // the spike extends from center of the target edge to this point centerPointY: .5, // defined by percentage horizontal (x) and vertical (y) shadow: false, // use drop shadow? (only displays in Safari and FF 3.1) - experimental shadowOffsetX: 2, // shadow offset x (px) shadowOffsetY: 2, // shadow offset y (px) shadowBlur: 3, // shadow blur (px) shadowColor: "#000", // shadow color/alpha shadowOverlap: false, // when shadows overlap the target element it can cause problem with hovering // set this to true to overlap or set to a numeric value to define the amount of overlap noShadowOpts: {strokeStyle: '#999'}, // use this to define 'fall-back' options for browsers which don't support drop shadows cssClass: '', // CSS class to add to the box wrapper div (of the TIP) cssStyles: {}, // styles to add the text box // example: {fontFamily: 'Georgia, Times, serif', fontWeight: 'bold'} activeClass: 'bt-active', // class added to TARGET element when its BeautyTip is active contentSelector: "$(this).attr('title')", // if there is no content argument, use this selector to retrieve the title // a function which returns the content may also be passed here ajaxPath: null, // if using ajax request for content, this contains url and (opt) selector // this will override content and contentSelector // examples (see jQuery load() function): // '/demo.html' // '/help/ajax/snip' // '/help/existing/full div#content' // ajaxPath can also be defined as an array // in which case, the first value will be parsed as a jQuery selector // the result of which will be used as the ajaxPath // the second (optional) value is the content selector as above // examples: // ["$(this).attr('href')", 'div#content'] // ["$(this).parents('.wrapper').find('.title').attr('href')"] // ["$('#some-element').val()"] ajaxError: 'ERROR: %error', // error text, use "%error" to insert error from server ajaxLoading: 'Loading...', // yes folks, it's the blink tag! ajaxData: {}, // key/value pairs ajaxType: 'GET', // 'GET' or 'POST' ajaxCache: true, // cache ajax results and do not send request to same url multiple times ajaxOpts: {}, // any other ajax options - timeout, passwords, processing functions, etc... // see http://docs.jquery.com/Ajax/jQuery.ajax#options preBuild: function(){}, // function to run before popup is built preShow: function(box){}, // function to run before popup is displayed showTip: function(box){ $(box).show(); }, postShow: function(box){}, // function to run after popup is built and displayed preHide: function(box){}, // function to run before popup is removed hideTip: function(box, callback) { $(box).hide(); callback(); // you MUST call "callback" at the end of your animations }, postHide: function(){}, // function to run after popup is removed hoverIntentOpts: { // options for hoverIntent (if installed) interval: 300, // http://cherne.net/brian/resources/jquery.hoverIntent.html timeout: 500 } }; // jQuery.bt.options = {}; })(jQuery); // @todo // use larger canvas (extend to edge of page when windowMargin is active) // add options to shift position of tip vert/horiz and position of spike tip // create drawn (canvas) shadows // use overlay to allow overlap with hover // experiment with making tooltip a subelement of the target // handle non-canvas-capable browsers elegantly $Core.registration = { iStep: 1, iTotalSteps: 2, submitForm: function() { $('#core_js_messages').html(''); $('#js_signup_error_message').html(''); $('#js_register_accept').hide(); $('#js_registration_holder').hide(); $('#js_registration_process').css('height', $('#js_registration_holder').height() + 'px'); $('#js_registration_process').show(); $('#js_form').ajaxCall('user.getRegistrationStep', 'step=' + this.iStep + '&last=' + (this.iStep == this.iTotalSteps ? '1' : '0') + '&next=' + ((this.iStep + 1) == this.iTotalSteps ? '1' : '0') + ''); }, updateForm: function(sHtml) { $('#js_register_step' + this.iStep).hide(); $('#js_signup_block').append(sHtml); $('#js_registration_process').hide(); $('#js_registration_process').css('height', $('#js_registration_holder').height() + 'px'); $('#js_registration_holder').show(); // $('#js_registration_submit').val(oTranslations['user.continue']); this.iStep++; }, showCaptcha: function() { $('#js_register_capthca_image').show(); }, useSuggested: function(oObj) { $('#user_name').val($(oObj).html()); $('#js_verify_username').hide(); $('#js_signup_user_name').html('' + $(oObj).html() + ''); } } $(function() { $('#js_submit_register_form').click(function() { return $Core.registration.submitForm(); }); /*$("#user_name").bt({ trigger: ['focus'], clickAnywhereToClose: true, positions: ['right', 'most'], fill: '#F4F4F4', strokeStyle: '#666666', spikeLength: 15, spikeGirth: 10, width: 180, overlap: 0, centerPointY: 1, cornerRadius: 0, cssStyles: { fontFamily: '"Lucida Grande",Helvetica,Arial,Verdana,sans-serif', fontSize: '12px', padding: '10px 14px' }, shadow: true, shadowColor: 'rgba(0,0,0,.5)', shadowBlur: 8, shadowOffsetX: 4, shadowOffsetY: 4, shrinkToFit: true });*/ }); $Behavior.countryIsoChange = function() { $('#country_iso').change(function() { var sChildValue = $('#js_country_child_id_value').val(); var sExtra = ''; $('#js_country_child_id').html(''); $('#country_iso').after('' + $.ajaxProcess('no_message') + ''); if ($('#js_country_child_is_search').length > 0) { sExtra += '&country_child_filter=true'; } $.ajaxCall('core.getChildren', 'country_iso=' + this.value + '&country_child_id=' + sChildValue + sExtra, 'GET'); }); } /* jQuery plugin: PutCursorAtEnd 1.0 http://plugins.jquery.com/project/PutCursorAtEnd by teedyay Puts the cursor at the end of a textbox/ textarea codesnippet: 691e18b1-f4f9-41b4-8fe8-bc8ee51b48d4 */ $Behavior.putCursorAtEnd = function() { jQuery.fn.putCursorAtEnd = function() { return this.each(function() { $(this).focus() /* If this function exists...*/ if (this.setSelectionRange) { /* ... then use it (Doesn't work in IE) Double the length because Opera is inconsistent about whether a carriage return is one character or two. Sigh.*/ var len = $(this).val().length * 2; this.setSelectionRange(len, len); } else { /* ... otherwise replace the contents with itself (Doesn't work in Google Chrome)*/ $(this).val($(this).val()); } /* Scroll to the bottom, in case we're in a tall textarea (Necessary for Firefox and Google Chrome)*/ this.scrollTop = 999999; }); }; } if (typeof(oEditor) == 'undefined') { debug('oEditor not defined.'); } var bAllowEditor = true; if (oEditor['wysiwyg'] === false) { bAllowEditor = false; } var Editor = { sVersion: '1.0', sEditorId: 'text', sImagePath: getParam('sJsStaticImage') + 'editor/', sEditor: getParam('sEditor'), aEditors: new Array(), setId: function(sId) { this.sEditorId = sId; this.aEditors[sId] = true; return this; }, getId: function() { return this.sEditorId; }, getEditors: function() { for (sEditor in this.aEditors) { this.sEditorId = sEditor; this.getEditor(); } }, fullScreen: function(sEditorId) { tb_show(oTranslations['core.full_screen_editor'], '#?TB_inline=true&type=textarea&parent_id=' + sEditorId); return false; }, getEditor: function(bReturn) { var sHtml; if (this.sEditor == 'tinymce' && typeof(tinyMCE) == 'object' && tinyMCE.getInstanceById(this.sEditorId) == null) { this.sEditor = 'default'; } if (!bAllowEditor) { this.sEditor = 'default'; } sHtml = ''; /* if (!isset(oEditor['no_fullscreen']) && !getParam('bJsIsMobile')) { sHtml += ''; } */ $(oEditor['images']).each(function($iKey, $aValue) { if (isset($aValue[0]) && $aValue[0] == 'separator') { sHtml += Editor.getSeparator(); } else { if (isset($aValue['command'])) { sHtml += Editor.getBBCode($aValue['image'], $aValue['command'], $aValue['phrase']); } else { sHtml += ''; } } }); /* if ((bAllowEditor || oEditor['toggle']) && getParam('bWysiwyg')) { sHtml += this.getSeparator(); sHtml += '' + getPhrase('core.toggle') + ''; } */ sHtml += '
    '; if (bReturn) { return sHtml; } $('#js_editor_menu_' + this.getId()).html(sHtml); $('#js_editor_menu_' + this.getId()).show(); $('#editor_toggle').blur(); return true; }, getList: function($sType) { var $sList = ($sType == 'bullet' ? 'ul' : 'ol'); Editor.createBBtag("[" + $sList + "]", "\n[/" + $sList + "]\n", this.sEditorId); this.getListReply(); }, getListReply: function() { var $sReply = prompt('Enter text to build your list. Once you are done click cancel.', ''); if (!empty($sReply)) { Editor.createBBtag("\n[*]", "", this.sEditorId, $sReply); this.getListReply(); } }, ajaxCall: function($oObject, $sCall) { if (!empty($($oObject).parent().find('.editor_drop_content').html())) { $($oObject).parent().find('.editor_drop_holder').toggle(); return; } var $sQuery = ''; $sQuery = getParam('sGlobalTokenName') + '[ajax]=true&' + getParam('sGlobalTokenName') + '[call]=' + $sCall + '&editor_id=' + this.getId(); $.ajax( { type: 'GET', dataType: 'html', url: getParam('sJsAjax'), data: $sQuery, success: function($sOutput) { $($oObject).parent().find('.editor_drop_content').html($sOutput); $($oObject).parent().find('.editor_drop_holder').show(); } }); }, getAttachments: function(sEditorId) { tb_show('' + getPhrase('attachment.attach_files') + '', $.ajaxBox('attachment.add', 'height=500&width=600&category_id=' + Attachment['sCategory'] + '&attachments=' + $('#js_attachment').val() + '&item_id=' + Attachment['iItemId'] + '&editor_id=' + sEditorId)); return false; }, promptUrl: function(sEditorId) { tb_show('', $.ajaxBox('core.prompt', 'height=200&width=300&type=url&editor=' + sEditorId)); return false; }, promptImg: function(sEditorId) { tb_show('', $.ajaxBox('core.prompt', 'height=200&width=300&type=img&editor=' + sEditorId)); return false; }, toggle: function(sEditorId) { if (tinyMCE.getInstanceById(sEditorId) == null) { this.sEditor = 'tinymce'; if (oEditor['toggle']) { customTinyMCE_init(sEditorId); } tinyMCE.execCommand('mceAddControl', false, sEditorId); $('#js_editor_menu_' + sEditorId).hide(); debug('Enabled WYSIWYG text editor'); deleteCookie('editor_wysiwyg'); } else { tinyMCE.execCommand('mceRemoveControl', false, sEditorId); if (oEditor['toggle']) { $('#layer_text').html('
    '); } debug('Disabled WYSIWYG text editor'); setCookie('editor_wysiwyg', true, 360); if ($('#js_editor_menu_' + sEditorId).html() != '') { $('#js_editor_menu_' + sEditorId).show(); $('#editor_toggle').blur(); return false; } this.getEditor(); } return false; }, getSeparator: function() { return '
    '; }, getBBCode: function(sName, sCode, sTitle) { sHtml = '
    '; sHtml += '' + this.getImage(sName, sTitle) + ''; sHtml += '
    '; return sHtml; }, getImage: function(sName, sTitle) { return '' + sTitle + ''; }, setContent: function(mValue) { eval('var sContent = ' + this.sEditor + '_wysiwyg_setContent(mValue);'); }, getContent: function() { eval('var sContent = ' + this.sEditor + '_wysiwyg_getContent();'); return sContent; }, insert: function(mValue) { eval(this.sEditor + '_wysiwyg_insert(mValue);'); $('.editor_drop_holder').hide(); return true; }, remove: function(mValue) { eval(this.sEditor + '_wysiwyg_remove(mValue);'); return true; }, createBBtag: function(openerTag, closerTag, areaId, sEmptyValue) { if(bIsIE && bIsWin) { this.createBBtag_IE( openerTag , closerTag , areaId, sEmptyValue ); } else { this.createBBtag_nav( openerTag , closerTag , areaId, sEmptyValue ); } $('#' + areaId).putCursorAtEnd(); return false; }, createBBtag_IE: function( openerTag , closerTag , areaId, sEmptyValue ) { var txtArea = document.getElementById( areaId ); var aSelection = document.selection.createRange().text; var range = txtArea.createTextRange(); if(aSelection) { document.selection.createRange().text = openerTag + aSelection + closerTag; txtArea.focus(); range.move('textedit'); range.select(); } else { if (!empty(sEmptyValue)) { openerTag = openerTag + sEmptyValue; } var oldStringLength = range.text.length + openerTag.length; txtArea.value += openerTag + closerTag; txtArea.focus(); range.move('character',oldStringLength); range.collapse(false); range.select(); } return; }, createBBtag_nav: function( openerTag , closerTag , areaId, sEmptyValue ) { var txtArea = document.getElementById( areaId ); if (txtArea.selectionEnd && (txtArea.selectionEnd - txtArea.selectionStart > 0) ) { var preString = (txtArea.value).substring(0,txtArea.selectionStart); var newString = openerTag + (txtArea.value).substring(txtArea.selectionStart,txtArea.selectionEnd) + closerTag; var postString = (txtArea.value).substring(txtArea.selectionEnd); txtArea.value = preString + newString + postString; txtArea.focus(); } else { if (!empty(sEmptyValue)) { openerTag = openerTag + sEmptyValue; } var offset = txtArea.selectionStart; var preString = (txtArea.value).substring(0,offset); var newString = openerTag + closerTag; var postString = (txtArea.value).substring(offset); txtArea.value = preString + newString + postString; txtArea.selectionStart = offset + openerTag.length; txtArea.selectionEnd = offset + openerTag.length; txtArea.focus(); } return; } }; if (!bAllowEditor) { var bForceDefaultEditor = true; } function default_wysiwyg_getContent() { return $('#' + Editor.getId()).val(); } function default_wysiwyg_insert(mValue) { switch(mValue['type']) { case 'emoticon': sValue = '' + mValue['text'] + ''; break; case 'image': sValue = '[img]' + mValue['path'] + '[/img]'; break; case 'attachment': sValue = '[attachment="' + mValue['id'] + '"]' + mValue['name'] + '[/attachment]'; break; case 'video': sValue = '[video]' + mValue['id'] + '[/video]'; break; } // Reset the editor ID# in case we have more then one editor open if (mValue['editor_id']) { Editor.setId(mValue['editor_id']); } var myField = document.getElementById(Editor.getId()); if (document.selection) { myField.focus(); sel = document.selection.createRange(); sel.text = sValue; } else if (myField.selectionStart || myField.selectionStart == '0') { var startPos = myField.selectionStart; var endPos = myField.selectionEnd; myField.value = myField.value.substring(0, startPos) + sValue + myField.value.substring(endPos, myField.value.length); myField.focus(); } else { myField.value += sValue; } return false; } function default_wysiwyg_remove(mValue) { switch(mValue['type']) { case 'attachment': break; } } function default_wysiwyg_setContent(mValue) { $('#' + Editor.getId()).val(mValue); } var $aMailOldHistory = {}; var $aNotificationOldHistory = {}; var $bNoCloseNotify = false; var bCloseShareHolder = true; $Behavior.globalThemeInit = function() { /** * ############################### * Global functions * ############################### */ $('#holder_notify ul li').click(function() { $bNoCloseNotify = true; }); $('.feed_share_on_item a').click(function() { bCloseShareHolder = false; }); // body clicks $((getParam('bJsIsMobile') ? '#content' : 'body')).click(function() { $('.action_drop_holder').hide(); $('.header_bar_drop').removeClass('is_clicked'); /* if (bCloseShareHolder){ $('.feed_share_on_holder').hide(); } */ $('.item_bar_action').parent().find('ul:first').hide(); $('.item_bar_action').removeClass('item_bar_action_clicked'); $('.row_edit_bar_holder').hide(); $('.row_edit_bar_action').removeClass('row_edit_bar_action_clicked'); $('#header_menu_holder ul li ul').removeClass('active'); $('#header_menu_holder ul li a').removeClass('active'); if (!$bNoCloseNotify) { $('#holder_notify ul li').removeClass('is_active'); $('#holder_notify ul li').find('.holder_notify_drop').hide(); } $bNoCloseNotify = false; bCloseShareHolder = true; $('#section_menu_drop').hide(); $('.welcome_info_holder').hide(); $('.welcome_quick_link ul li a').removeClass('is_active'); $('.moderation_drop').removeClass('is_clicked'); $('.moderation_holder ul').hide(); $('#header_sub_menu_search_input').parent().find('.js_temp_friend_search_form:first').hide(); $('.feed_sort_holder').hide(); }); $('.feed_sort_order_link').click(function(){ $('.feed_sort_holder').toggle(); return false; }); $('.feed_sort_holder ul li a').click(function(){ $('.feed_sort_holder ul li a').removeClass('active'); $('.feed_sort_holder ul li a').removeClass('process'); $(this).addClass('active'); $(this).addClass('process'); $.ajaxCall('user.updateFeedSort', 'order=' + $(this).attr('rel')); return false; }); $('.activity_feed_share_this_one_link').click(function(){ var sRel = $(this).attr('rel'); if ($(this).hasClass('is_active')){ $('.' + sRel).hide(); $(this).removeClass('is_active'); } else { $('.timeline_date_holder').hide(); $('.activity_feed_share_this_one_link').removeClass('is_active'); $('.' + sRel).show(); $(this).addClass('is_active'); } return false; }); $('#header_menu_holder li a.has_drop_down').click(function() { $('#holder_notify ul li').removeClass('is_active'); $('#holder_notify ul li').find('.holder_notify_drop').hide(); if ($(this).hasClass('active')) { $(this).parent().find('ul').removeClass('active'); $(this).removeClass('active'); } else { $('#header_menu_holder').find('ul').removeClass('active'); $('#header_menu_holder').find('ul li a').removeClass('active'); $(this).parent().find('ul').addClass('active'); $(this).addClass('active'); } return false; }); $('#header_menu_holder ul li ul li a').click(function() { $('#header_menu_holder ul li ul').removeClass('active'); $('#header_menu_holder ul li a').removeClass('active'); }); $('#holder_notify ul li a').click(function() { var $oParent = $(this).parent(); var $oChild = $oParent.find('.holder_notify_drop'); $('#header_menu_holder ul li ul').removeClass('active'); $('#header_menu_holder ul li a').removeClass('active'); if ($oParent.hasClass('is_active')) { $oParent.removeClass('is_active'); $oChild.hide(); } else { $('#holder_notify ul li').removeClass('is_active'); $('#holder_notify ul li').find('.holder_notify_drop').hide(); $oParent.addClass('is_active'); $oChild.show(); /* if ($oChild.find('.holder_notify_drop_data').find('.holder_notify_drop_loader').length > 0) { */ $Core.ajax($(this).attr('rel'), { params: { 'no_page_update': true }, success: function($sData) { $oChild.find('.holder_notify_drop_data').html($sData); } }); /* } else { if ($(this).attr('rel') == 'mail.getLatest') { if (isset($aMailOldHistory)) { for ($iKey in $aMailOldHistory) { $('#js_mail_read_' + $iKey).find('a:first').removeClass('is_new'); } } } else if ($(this).attr('rel') == 'notification.getAll') { if (isset($aNotificationOldHistory)) { for ($iKey in $aNotificationOldHistory) { $('#js_notification_read_' + $iKey).find('a:first').removeClass('is_new'); } } } } */ } return false; }); // Hide the left sidebar if (empty($('#left').html())) { $('#main_content').addClass('no_sidebar'); if (empty($('#right').html())) { $('#content').removeClass('content_float'); } else { $('#content').addClass('content4'); $('#content').removeClass('content2'); $('#content').removeClass('content3'); } $('#left').remove(); } // Hide the right sidebar // if (empty($('#right').html()) || empty(trim(strip_tags($('#right').html())))) if (empty($('#right').html())) { $('#content').removeClass('content3'); $('#right').remove(); } $('#section_menu_more').click(function() { $('#section_menu_drop').toggle(); return false; }); /** * ############################### * Global site search * ############################### */ $('#header_sub_menu_search_input').before(''); $('#header_sub_menu_search_input').focus(function(){ if (getParam('bJsIsMobile')){ $(this).parent().find('#header_sub_menu_search_input').addClass('focus'); $(this).val(''); return; } $(this).parent().find('#header_sub_menu_search_input').addClass('focus'); if ($(this).val() == $('#header_sub_menu_search_input_value').html()){ $(this).val(''); if ((isset(oModules['friend']) )) { $Core.searchFriendsInput.init({ 'id': 'header_sub_menu_search', 'max_search': (getParam('bJsIsMobile') ? 5 : 10), 'no_build': true, 'global_search': true, 'allow_custom': true }); $Core.searchFriendsInput.buildFriends(this); } } }); $('#header_sub_menu_search_input').blur(function(){ $(this).parent().find('#header_sub_menu_search_input').removeClass('focus'); }); if ((isset(oModules['friend']) )) { $('#header_sub_menu_search_input').keyup(function(){ $Core.searchFriendsInput.getFriends(this); }); } /** * ############################### * Global section search tool * ############################### */ $('.header_bar_search .txt_input').focus(function() { $(this).parent().find('.header_bar_search_input').addClass('focus'); $(this).addClass('input_focus'); if ($('.header_bar_search_default').html() == $(this).val()) { $(this).val(''); } }).blur(function() { $(this).parent().find('.header_bar_search_input').removeClass('focus'); if (empty($(this).val())) { $(this).val($('.header_bar_search_default').html()); $(this).removeClass('input_focus'); } }); $('.header_bar_drop').click(function() { $('.header_bar_drop').each(function() { if (!$(this).hasClass('is_clicked')) { $(this).parents('.header_bar_drop_holder').find('.action_drop_holder').hide(); } }); if ($(this).hasClass('is_clicked')) { $(this).parents('.header_bar_drop_holder').find('.action_drop_holder').hide(); $(this).removeClass('is_clicked'); } else { $(this).parents('.header_bar_drop_holder').find('.action_drop_holder').show(); $('.header_bar_drop').removeClass('is_clicked'); $(this).addClass('is_clicked'); } return false; }); $('.item_bar_action').click(function() { $(this).parent().find('ul:first').toggle(); $(this).blur(); if ($(this).hasClass('item_bar_action_clicked')) { $(this).removeClass('item_bar_action_clicked'); } else { $(this).addClass('item_bar_action_clicked'); } return false; }); $('.row_edit_bar_action').click(function() { $(this).parents('.row_edit_bar_parent:first').find('.row_edit_bar_holder:first').toggle(); $(this).blur(); if ($(this).hasClass('row_edit_bar_action_clicked')) { $(this).removeClass('row_edit_bar_action_clicked'); } else { $(this).addClass('row_edit_bar_action_clicked'); } return false; }); $('#js_comment_form_holder #text').keydown(function(){$Core.resizeTextarea($(this));}); $('#js_compose_new_message #message').keydown(function(){$Core.resizeTextarea($(this));}); $('.welcome_quick_link ul li a').click(function(e) { if ($(this).hasClass('is_active')) { $(this).parent().find('.welcome_info_holder:first').hide(); $(this).removeClass('is_active'); return false; } if (oCore['core.site_wide_ajax_browsing'] == false) { if (this.href.indexOf('#') < 0) { window.location = this.href; return false; } else { } } else { if (this.href.indexOf('#') > (-1)) { } else { return false; } } var aParts = explode('#', this.href); var sTempCacheId = aParts[1].replace('.', '_'); $('.welcome_info_holder').hide(); $('.welcome_quick_link ul li a').removeClass('is_active'); $(this).addClass('is_active'); /* if ($(this).hasClass('is_cached')) { $(this).parent().find('.welcome_info_holder:first').show(); return false; } */ $(this).addClass('is_cached'); var sRel = $(this).attr('rel'); sCustomClass= ''; if (!empty(sRel)){ sCustomClass = ' welcome_info_holder_custom'; } $(this).parent().append('
    '); $.ajaxCall(aParts[1], 'temp_id=' + sTempCacheId, 'GET'); return false; }); $('.profile_image').mouseover(function() { $(this).find('.p_4:first').show(); }); $('.profile_image').mouseout(function() { $(this).find('.p_4:first').hide(); }); } /* * Author: Teamwurkz Technologies Inc. * tm-jqueryfx simple tabslide 1.1 * */ function tmtabslide(tabname, fxtype, fxspeed, autoplay, playtime, fxcaption, fxcapspeed, captiontype, playcont,autohidearrows, isloader, slicetotal, slicedelay) { // initialize variables var tabwidth = $("#"+tabname).css('width').replace('px', ''); var panelsize = tabwidth*($('#'+tabname+' ul.tm_tab_panel li').size()+1); var listItem = $('#'+tabname+' ul.tm_tab_menu li'); var totalSlide = $('#'+tabname+' ul.tm_tab_menu li').size(); var slidecounter = 0; var prevcounter = 0; var startslide; var isloaded = 0; if(fxtype=='random'){ var sliderndNum = Math.ceil(Math.random()*4); } // for slice effect var prev_image_src; // initialize loader if(isloader === true){ $("#"+tabname+" div.tm_tab_panel_container ul li img").load(function(){ $("#"+tabname+" div.loader").css('display','none'); }); } // initialize css $('#'+tabname+' ul.tm_tab_menu li a:first').addClass('active'); $("#"+tabname+" div.tm_tab_panel_container").css("width",panelsize+"px"); $("#"+tabname+" div.tm_tab_panel_container ul li").css("width",tabwidth+"px") // initialize special effects if(fxtype != ''){ $("#"+tabname+" div.tm_tab_panel_container ul li").css('position','absolute'); $("#"+tabname+" div.tm_tab_panel_container ul li").hide(); if(fxtype=='random' || fxtype=='slice-box-fade' || fxtype=='slice-left-down' || fxtype=='slice-alternate' || fxtype=='slice-alternate-horizontal' || fxtype=='slice-blinds-vertical'){ prev_image_src = $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li div.tm_img_holder").eq(prevcounter).css('background-image'); $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li").eq(prevcounter).css('background-image',prev_image_src) } $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li").eq(prevcounter).fadeIn(fxspeed); } // initialize caption if(fxcaption===true) { var captionheight = $('#'+tabname+' ul.tm_tab_panel li div.scaption').css('height'); var captionanime = parseInt($('#'+tabname+' ul.tm_tab_panel li').css('height').replace('px', '')) - parseInt($('#'+tabname+' ul.tm_tab_panel li div.scaption').css('height').replace('px','')); captionplay(); } // autoplay is true if(autoplay===true){ startslide = setTimeout(slidetrigger,playtime); } // play slideshow function slidetrigger() { slidecounter = slidecounter + 1; playslide(); } function playslide() { // if fade effect lets fadeout if(fxtype == 'fade'){ $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li").eq(prevcounter).fadeOut(fxspeed-500); } else if(fxtype=='random' || fxtype=='slice-box-fade' || fxtype=='slice-left-down' || fxtype=='slice-alternate' || fxtype=='slice-alternate-horizontal' || fxtype=='slice-blinds-vertical'){ prev_image_src = $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li div.tm_img_holder").eq(prevcounter).css('background-image'); $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li").eq(prevcounter).css('display','none'); $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li").eq(slidecounter).css('background-image',prev_image_src); } captionout(); prevcounter = slidecounter; if(slidecounter < totalSlide){ menuActive(); // effects showeffects(); captionplay(); } else { slidecounter = 0; prevcounter = 0; menuActive(); // effects showeffects(true); captionplay(); } // randomize if(fxtype=='random'){ sliderndNum = Math.ceil(Math.random()*5); } startslide = setTimeout(slidetrigger,playtime); } // tab menu onclick $("#"+tabname+" ul.tm_tab_menu li a").click( function(){ showcontinue(); // randomize if(fxtype=='random'){ sliderndNum = Math.ceil(Math.random()*5); } slidecounter = $("#"+tabname+" ul.tm_tab_menu li a").index(this); menuActive(); // initialize slice if(fxtype=='random' || fxtype=='slice-box-fade' || fxtype=='slice-alternate' || fxtype=='slice-left-down' || fxtype=='slice-alternate-horizontal' || fxtype=='slice-blinds-vertical'){ var animBuffer = 0; var slice_delay = slicedelay; var slice_total = slicetotal; var slice_width = tabwidth / slice_total; var slice_height = $('#'+tabname).css('height').replace('px',''); var bg_position = 0; var image_src = $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li div.tm_img_holder").eq(slidecounter).css('background-image'); var slicepanel = "#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li" ; } // effects if(fxtype == 'fade'){ $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li").eq(prevcounter).fadeOut(fxspeed-500); $('#'+tabname+' ul.tm_tab_panel li div.scaption').eq(prevcounter).animate({top:$('#'+tabname+' ul.tm_tab_panel li').css('height')},fxcapspeed-1000); $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li").eq($("#"+tabname+" ul.tm_tab_menu li a").index(this)).fadeIn(fxspeed); } else if(fxtype=='slice-box-fade' || sliderndNum=='1'){ setimagebg(); var rowCount = 4; var itemCount = 0; for( var i=0, l = slice_total; i < l; i++){ for( var r=0, rl = rowCount; r < rl; r++){ bg_position = -(i*slice_height); $(slicepanel).eq(slidecounter).append('
    '); $(slicepanel).eq(slidecounter).children('div.tm_slice').css('background-image',image_src); $(slicepanel).eq(slidecounter).children('div.tm_slice').css('background-color','#fff'); $(slicepanel+' div.tm_slice').css('width',slice_width+'px'); $(slicepanel+' div.tm_slice').css('height',(slice_height/rowCount)+'px'); $(slicepanel+' div.tm_slice').eq(itemCount).css('left',(i*slice_width)+'px'); $(slicepanel+' div.tm_slice').eq(itemCount).css('opacity',1-(r*0.2)); $(slicepanel+' div.tm_slice').eq(itemCount).css('top',(r*(slice_height/rowCount))+'px'); $(slicepanel+' div.tm_slice').slice(itemCount).css('background-position',(-(i*slice_width))+'px '+(-(r*(slice_height/rowCount)))+'px'); // $(slicepanel+' div.tm_slice').eq(r).css('display','none'); $(slicepanel+' div.tm_slice').eq(itemCount).css('display','none'); itemCount++; } } var islice = 0; gosliceanimate(); } else if(fxtype=='slice-alternate-horizontal' || sliderndNum=='2'){ setimagebg(); slice_height = slice_height / slice_total; for( var i=0, l = slice_total; i < l; i++){ bg_position = -(i*slice_height); $(slicepanel).eq(slidecounter).append('
    '); $(slicepanel).eq(slidecounter).children('div.tm_slice').css('background-image',image_src); $(slicepanel+' div.tm_slice').css('height',slice_height+'px'); $(slicepanel+' div.tm_slice').eq(i).css('top',(i*slice_height)+'px'); if(i%2==0){ $(slicepanel+' div.tm_slice').eq(i).css('left','0px'); } else { $(slicepanel+' div.tm_slice').eq(i).css('right','0px'); } $(slicepanel+' div.tm_slice').slice(i).css('background-position','0px '+bg_position+'px'); } var islice = 0; gosliceanimate(); } else if(fxtype=='slice-alternate' || sliderndNum=='3'){ setimagebg(); for( var i=0, l = slice_total; i < l; i++){ bg_position = -(i*slice_width); $(slicepanel).eq(slidecounter).append('
    '); $(slicepanel).eq(slidecounter).children('div.tm_slice').css('background-image',image_src); $(slicepanel+' div.tm_slice').css('width',slice_width+'px'); if(i%2==0){ $(slicepanel+' div.tm_slice').eq(i).css('bottom','0px'); } $(slicepanel+' div.tm_slice').slice(i).css('background-position',bg_position+'px 0px'); } var islice = 0; gosliceanimate(); } else if(fxtype=='slice-blinds-vertical' || sliderndNum=='4'){ setimagebg(); for( var i=0, l = slice_total; i < l; i++){ bg_position = -(i*slice_width); $(slicepanel).eq(slidecounter).append('
    '); $(slicepanel).eq(slidecounter).children('div.tm_slice').css('background-image',image_src); $(slicepanel+' div.tm_slice').css('height',slice_height+'px'); $(slicepanel+' div.tm_slice').slice(i).css('background-position',bg_position+'px 0px'); } var islice = 0; gosliceanimate(); } else if(fxtype=='slice-left-down' || sliderndNum=='5'){ setimagebg(); for( var i=0, l = slice_total; i < l; i++){ bg_position = -(i*slice_width); $(slicepanel).eq(slidecounter).append('
    '); $(slicepanel).eq(slidecounter).children('div.tm_slice').css('background-image',image_src); $(slicepanel+' div.tm_slice').css('width',slice_width+'px'); $(slicepanel+' div.tm_slice').slice(i).css('background-position',bg_position+'px 0px'); } var islice = 0; gosliceanimate(); } else { $("#"+tabname+" div.tm_tab_panel_container").animate({marginLeft: -($("#"+tabname+" ul.tm_tab_menu li a").index(this)*tabwidth)}, fxspeed); } captionout(); prevcounter = $("#"+tabname+" ul.tm_tab_menu li a").index(this); captionplay(); function setimagebg(){ $(slicepanel).children('.tm_slice').remove(); prev_image_src = $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li div.tm_img_holder").eq(prevcounter).css('background-image'); $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li").eq(prevcounter).css('display','none'); $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li").eq(slidecounter).css('background-image',prev_image_src); $(slicepanel).eq(slidecounter).show(); } // end setimagebg function gosliceanimate(){ $(slicepanel+' div.tm_slice').each( function(){ var slicethis = $(this); if(fxtype=='slice-blinds-vertical' || sliderndNum=='4'){ $(this).css('left',islice*slice_width); setTimeout(function(){ slicethis.animate({width:slice_width, opacity:1},islice*slice_delay+500); } , animBuffer); } else if(fxtype=='slice-box-fade' || sliderndNum=='1'){ setTimeout(function(){ slicethis.show(islice*slice_delay+500); slicethis.animate({opacity:1},islice*slice_delay+500); } , animBuffer); } else if(fxtype=='slice-alternate-horizontal' || sliderndNum=='2'){ setTimeout(function(){ slicethis.animate({width:tabwidth, opacity:1},islice*slice_delay+500); } , animBuffer); } else { $(this).css('left',islice*slice_width); setTimeout(function(){ slicethis.animate({height:slice_height, opacity:1},islice*slice_delay+500); } , animBuffer); } animBuffer +=slice_delay*4; islice++; if(islice == slice_total) { islice=0; } } ); } // end gosliceanimate } ); // show effects function showeffects(resetslide){ if(resetslide===true){ slidecontainer_width = 0 ; } else { slidecontainer_width = -(slidecounter*tabwidth); } if(fxtype=='random' || fxtype=='slice-box-fade' || fxtype=='slice-alternate' || fxtype=='slice-left-down' || fxtype=='slice-alternate-horizontal' || fxtype=='slice-blinds-vertical'){ var animBuffer = 0; var slice_delay = slicedelay; var slice_total = slicetotal; var slice_width = tabwidth / slice_total; var slice_height = $('#'+tabname).css('height').replace('px',''); var bg_position = 0; var image_src = $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li div.tm_img_holder").eq(slidecounter).css('background-image'); var slicepanel = "#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li" ; } if(fxtype == 'fade'){ $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li").eq(slidecounter).fadeIn(fxspeed); } else if(fxtype=='slice-box-fade' || sliderndNum=='1'){ setimagebgshow(); var rowCount = 4; var itemCount = 0; for( var i=0, l = slice_total; i < l; i++){ for( var r=0, rl = rowCount; r < rl; r++){ bg_position = -(i*slice_height); $(slicepanel).eq(slidecounter).append('
    '); $(slicepanel).eq(slidecounter).children('div.tm_slice').css('background-image',image_src); $(slicepanel).eq(slidecounter).children('div.tm_slice').css('background-color','#fff'); $(slicepanel+' div.tm_slice').css('width',slice_width+'px'); $(slicepanel+' div.tm_slice').css('height',(slice_height/rowCount)+'px'); $(slicepanel+' div.tm_slice').eq(itemCount).css('left',(i*slice_width)+'px'); $(slicepanel+' div.tm_slice').eq(itemCount).css('opacity',1-(r*0.2)); $(slicepanel+' div.tm_slice').eq(itemCount).css('top',(r*(slice_height/rowCount))+'px'); $(slicepanel+' div.tm_slice').slice(itemCount).css('background-position',(-(i*slice_width))+'px '+(-(r*(slice_height/rowCount)))+'px'); //$(slicepanel+' div.tm_slice').eq(r).css('display','none'); $(slicepanel+' div.tm_slice').eq(itemCount).css('display','none'); itemCount++; } } var islice = 0; gosliceanimateshow(); } else if(fxtype=='slice-blinds-vertical' || sliderndNum=='4'){ setimagebgshow(); for( var i=0, l = slice_total; i < l; i++){ bg_position = -(i*slice_width); $(slicepanel).eq(slidecounter).append('
    '); $(slicepanel).eq(slidecounter).children('div.tm_slice').css('background-image',image_src); $(slicepanel+' div.tm_slice').css('height',slice_height+'px'); if(i%2==0){ $(slicepanel+' div.tm_slice').eq(i).css('bottom','0px'); } $(slicepanel+' div.tm_slice').slice(i).css('background-position',bg_position+'px 0px'); } var islice = 0; gosliceanimateshow(); } else if(fxtype=='slice-alternate' || sliderndNum=='3'){ setimagebgshow(); for( var i=0, l = slice_total; i < l; i++){ bg_position = -(i*slice_width); $(slicepanel).eq(slidecounter).append('
    '); $(slicepanel).eq(slidecounter).children('div.tm_slice').css('background-image',image_src); $(slicepanel+' div.tm_slice').css('width',slice_width+'px'); if(i%2==0){ $(slicepanel+' div.tm_slice').eq(i).css('bottom','0px'); } $(slicepanel+' div.tm_slice').slice(i).css('background-position',bg_position+'px 0px'); } var islice = 0; gosliceanimateshow(); } else if(fxtype=='slice-alternate-horizontal' || sliderndNum=='2'){ setimagebgshow(); slice_height = slice_height / slice_total; for( var i=0, l = slice_total; i < l; i++){ bg_position = -(i*slice_height); $(slicepanel).eq(slidecounter).append('
    '); $(slicepanel).eq(slidecounter).children('div.tm_slice').css('background-image',image_src); $(slicepanel+' div.tm_slice').css('height',slice_height+'px'); $(slicepanel+' div.tm_slice').eq(i).css('top',(i*slice_height)+'px'); if(i%2==0){ $(slicepanel+' div.tm_slice').eq(i).css('left','0px'); } else { $(slicepanel+' div.tm_slice').eq(i).css('right','0px'); } $(slicepanel+' div.tm_slice').slice(i).css('background-position','0px '+bg_position+'px'); } var islice = 0; gosliceanimateshow(); } else if(fxtype=='slice-left-down' || sliderndNum=='5'){ setimagebgshow(); for( var i=0, l = slice_total; i < l; i++){ bg_position = -(i*slice_width); $(slicepanel).eq(slidecounter).append('
    '); $(slicepanel).eq(slidecounter).children('div.tm_slice').css('background-image',image_src); $(slicepanel+' div.tm_slice').css('width',slice_width+'px'); $(slicepanel+' div.tm_slice').slice(i).css('background-position',bg_position+'px 0px'); } var islice = 0; gosliceanimateshow(); } else { $("#"+tabname+" div.tm_tab_panel_container").animate({marginLeft: slidecontainer_width}, fxspeed); } function setimagebgshow(){ $(slicepanel).children('.tm_slice').remove(); if(slidecounter==0){ prev_image_src = $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li div.tm_img_holder").eq(totalSlide-1).css('background-image'); $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li").eq(prevcounter).css('display','none'); $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li").eq(slidecounter).css('background-image',prev_image_src); } $(slicepanel).eq(slidecounter).show(); } // end setimagebgshow function gosliceanimateshow(){ $(slicepanel+' div.tm_slice').each( function(){ var slicethis = $(this); if(fxtype=='slice-blinds-vertical' || sliderndNum=='4'){ $(this).css('left',islice*slice_width); setTimeout(function(){ slicethis.animate({width:slice_width, opacity:1},islice*slice_delay+500); } , animBuffer); } else if(fxtype=='slice-box-fade' || sliderndNum=='1'){ setTimeout(function(){ slicethis.show(islice*slice_delay+500); slicethis.animate({opacity:1},islice*slice_delay+500); } , animBuffer); } else if(fxtype=='slice-alternate-horizontal' || sliderndNum=='2'){ setTimeout(function(){ slicethis.animate({width:tabwidth, opacity:1},islice*slice_delay+500); } , animBuffer); } else { $(this).css('left',islice*slice_width); setTimeout(function(){ slicethis.animate({height:slice_height, opacity:1},islice*slice_delay+500); } , animBuffer); } animBuffer +=slice_delay*4; islice++; if(islice == slice_total) { islice=0; } } ); } // end gosliceanimateshow } function arrowtrigger() { menuActive(); // randomize if(fxtype=='random'){ sliderndNum = Math.ceil(Math.random()*5); } // initialize effects if(fxtype=='random' || fxtype=='slice-box-fade' || fxtype=='slice-alternate' || fxtype=='slice-left-down' || fxtype=='slice-alternate-horizontal' || fxtype=='slice-blinds-vertical'){ captionout(); prev_image_src = $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li div.tm_img_holder").eq(prevcounter).css('background-image'); $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li").eq(prevcounter).css('display','none'); $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li").eq(slidecounter).css('background-image',prev_image_src); prevcounter = slidecounter; var animBuffer = 0; var slice_delay = slicedelay; var slice_total = slicetotal; var slice_width = tabwidth / slice_total; var slice_height = $('#'+tabname).css('height').replace('px',''); var bg_position = 0; var image_src = $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li div.tm_img_holder").eq(slidecounter).css('background-image'); var slicepanel = "#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li" ; $(slicepanel).children('.tm_slice').remove(); $(slicepanel).eq(slidecounter).show(); } //play effects if(fxtype == 'fade'){ $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li").eq(prevcounter).fadeOut(fxspeed-500); $('#'+tabname+' ul.tm_tab_panel li div.scaption').eq(prevcounter).animate({top:$('#'+tabname+' ul.tm_tab_panel li').css('height')},fxcapspeed-1000); prevcounter = slidecounter; $("#"+tabname+" div.tm_tab_panel_container ul.tm_tab_panel li").eq(slidecounter).fadeIn(fxspeed); } else if(fxtype=='slice-box-fade' || sliderndNum=='1'){ var rowCount = 4; var itemCount = 0; for( var i=0, l = slice_total; i < l; i++){ for( var r=0, rl = rowCount; r < rl; r++){ bg_position = -(i*slice_height); $(slicepanel).eq(slidecounter).append('
    '); $(slicepanel).eq(slidecounter).children('div.tm_slice').css('background-image',image_src); $(slicepanel).eq(slidecounter).children('div.tm_slice').css('background-color','#fff'); $(slicepanel+' div.tm_slice').css('width',slice_width+'px'); $(slicepanel+' div.tm_slice').css('height',(slice_height/rowCount)+'px'); $(slicepanel+' div.tm_slice').eq(itemCount).css('left',(i*slice_width)+'px'); $(slicepanel+' div.tm_slice').eq(itemCount).css('opacity',1-(r*0.2)); $(slicepanel+' div.tm_slice').eq(itemCount).css('top',(r*(slice_height/rowCount))+'px'); $(slicepanel+' div.tm_slice').slice(itemCount).css('background-position',(-(i*slice_width))+'px '+(-(r*(slice_height/rowCount)))+'px'); //$(slicepanel+' div.tm_slice').eq(r).css('display','none'); $(slicepanel+' div.tm_slice').eq(itemCount).css('display','none'); itemCount++; } } var islice = 0; goslicetrigger(); } else if(fxtype=='slice-alternate-horizontal' || sliderndNum=='2'){ slice_height = slice_height / slice_total; for( var i=0, l = slice_total; i < l; i++){ bg_position = -(i*slice_height); $(slicepanel).eq(slidecounter).append('
    '); $(slicepanel).eq(slidecounter).children('div.tm_slice').css('background-image',image_src); $(slicepanel+' div.tm_slice').css('height',slice_height+'px'); $(slicepanel+' div.tm_slice').eq(i).css('top',(i*slice_height)+'px'); if(i%2==0){ $(slicepanel+' div.tm_slice').eq(i).css('left','0px'); } else { $(slicepanel+' div.tm_slice').eq(i).css('right','0px'); } $(slicepanel+' div.tm_slice').slice(i).css('background-position','0px '+bg_position+'px'); } var islice = 0; goslicetrigger(); } else if(fxtype == 'slice-blinds-vertical' || sliderndNum=='4'){ for( var i=0, l = slice_total; i < l; i++){ bg_position = -(i*slice_width); $(slicepanel).eq(slidecounter).append('
    '); $(slicepanel).eq(slidecounter).children('div.tm_slice').css('background-image',image_src); $(slicepanel+' div.tm_slice').css('height',slice_height+'px'); if(i%2==0){ $(slicepanel+' div.tm_slice').eq(i).css('bottom','0px'); } $(slicepanel+' div.tm_slice').slice(i).css('background-position',bg_position+'px 0px'); } var islice = 0; goslicetrigger(); } else if(fxtype == 'slice-alternate' || sliderndNum=='3'){ for( var i=0, l = slice_total; i < l; i++){ bg_position = -(i*slice_width); $(slicepanel).eq(slidecounter).append('
    '); $(slicepanel).eq(slidecounter).children('div.tm_slice').css('background-image',image_src); $(slicepanel+' div.tm_slice').css('width',slice_width+'px'); if(i%2==0){ $(slicepanel+' div.tm_slice').eq(i).css('bottom','0px'); } $(slicepanel+' div.tm_slice').slice(i).css('background-position',bg_position+'px 0px'); } var islice = 0; goslicetrigger(); } else if(fxtype == 'slice-left-down' || sliderndNum=='5'){ for( var i=0, l = slice_total; i < l; i++){ bg_position = -(i*slice_width); $(slicepanel).eq(slidecounter).append('
    '); $(slicepanel).eq(slidecounter).children('div.tm_slice').css('background-image',image_src); $(slicepanel+' div.tm_slice').css('width',slice_width+'px'); $(slicepanel+' div.tm_slice').slice(i).css('background-position',bg_position+'px 0px'); } var islice = 0; goslicetrigger(); } else { $("#"+tabname+" div.tm_tab_panel_container").animate({marginLeft: -(slidecounter*tabwidth)}, fxspeed); } function goslicetrigger(){ $(slicepanel+' div.tm_slice').each( function(){ var slicethis = $(this); if(fxtype=='slice-blinds-vertical' || sliderndNum=='4'){ $(this).css('left',islice*slice_width); setTimeout(function(){ slicethis.animate({width:slice_width, opacity:1},islice*slice_delay+500); } , animBuffer); } else if(fxtype=='slice-box-fade' || sliderndNum=='1'){ setTimeout(function(){ slicethis.show(islice*slice_delay+500); slicethis.animate({opacity:1},islice*slice_delay+500); } , animBuffer); } else if(fxtype=='slice-alternate-horizontal' || sliderndNum=='2'){ setTimeout(function(){ slicethis.animate({width:tabwidth, opacity:1},islice*slice_delay+500); } , animBuffer); } else { $(this).css('left',islice*slice_width); setTimeout(function(){ slicethis.animate({height:slice_height, opacity:1},islice*slice_delay+500); } , animBuffer); } animBuffer +=slice_delay*4; islice++; if(islice == slice_total) { islice=0; } } ); } // end captionplay(); } // panel mouseover if(autohidearrows===true){ $("#"+tabname).hover( function(){ $("#"+tabname+" .tm_arrownav a").css('display','inline'); }, function(){ $("#"+tabname+" .tm_arrownav a").css('display','none'); } ); } $("#"+tabname+"_container a#aLeft").click( function(){ showcontinue(); prevcounter=slidecounter; if(slidecounter != 0 ){ slidecounter = slidecounter - 1; } else { slidecounter = totalSlide-1; } arrowtrigger(); } ); $("#"+tabname+"_container a#aRight").click( function(){ showcontinue(); prevcounter=slidecounter; if(slidecounter != (totalSlide-1) ){ slidecounter = slidecounter + 1; } else { slidecounter = 0 ; } arrowtrigger(); } ); function captionplay(){ // caption if(fxcaption===true) { if(captiontype=='vertical'){ $('#'+tabname+' ul.tm_tab_panel li div.scaption').eq(slidecounter).animate({top:captionanime+'px'},fxcapspeed); } else { $('#'+tabname+' ul.tm_tab_panel li div.scaption').eq(slidecounter).fadeIn(fxcapspeed); } } } function captionout(){ if(captiontype=='vertical'){ $('#'+tabname+' ul.tm_tab_panel li div.scaption').eq(prevcounter).animate({top:$('#'+tabname+' ul.tm_tab_panel li').css('height')},fxcapspeed-1000); } else { $('#'+tabname+' ul.tm_tab_panel li div.scaption').eq(prevcounter).hide(fxcapspeed); } } function showcontinue(){ if(playcont===false){ clearTimeout(startslide); } else { clearTimeout(startslide); startslide = setTimeout(slidetrigger,playtime*3); } } function menuActive() { $('#'+tabname+' ul.tm_tab_menu li a.active').removeClass('active'); $('#'+tabname+' ul.tm_tab_menu li a').eq(slidecounter).addClass('active'); } } /* ----------------- */ /* BEGIN ABSTRACT JS */ function abstractJQueryAjaxA( sHost, sQuery, sResponseId, sDisplayType, sEffect, sEffectSpeed, sPostEffect, sPostEffectSpeed, sPostResponseId, sResponseNature, sEffectNature, sPostEffectNature ) { $.ajax({ type: 'POST', dataType: 'text', cache: false, url: sHost + 'abstractbridge/ajax/', data: sQuery, success: function(data){ /*Determine Display State */ if(sEffect == 'slideDown' || sEffect == 'show'){ var cssdisplay = 'none'; }else{ var cssdisplay = ''; } /*Default Natures*/ if(sResponseNature == '' || sResponseNature == null){ sResponseNature = '#'; } if(sEffectNature == '' || sEffectNature == null){ sEffectNature = '#'; } if(sPostEffectNature == '' || sPostEffectNature == null){ sPostEffectNature = '#'; } if(sEffectNature == '#'){ elementidnature = 'id'; }else{ elementidnature = 'class'; } /*Default Speeds*/ if(sEffectSpeed == '' || sEffectSpeed == null){ sEffectSpeed = 'slow'; } if(sPostEffectSpeed == '' || sPostEffectSpeed == null){ sPostEffectSpeed = 'slow'; } /*Generate Unique Element Id & Container*/ var elementid = Math.floor( 100000000 * Math.random() ); var text = ''+data+''; /*Positioning Nature */ if(sDisplayType == 'prepend'){ $(sResponseNature+sResponseId).prepend(text); } if(sDisplayType == 'html'){ $(sResponseNature+sResponseId).html(text); } if(sDisplayType == 'append'){ $(sResponseNature+sResponseId).append(text); } /*Effect*/ if(sEffect == 'slideDown'){ $(sEffectNature+elementid).slideDown(sEffectSpeed); } if(sEffect == 'slideUp'){ $(sEffectNature+elementid).slideUp(sEffectSpeed); } if(sEffect == 'show'){ $(sEffectNature+elementid).show(sEffectSpeed); } if(sEffect == 'hide'){ $(sEffectNature+elementid).hide(sEffectSpeed); } /*PostResponseId*/ if(sPostResponseId == '' || sPostResponseId == null){ sPostResponseId = elementid; } /*Post Effect*/ if(sPostEffect == 'slideDown'){ $(sPostEffectNature+sPostResponseId).slideDown(sPostEffectSpeed); } if(sPostEffect == 'slideUp'){ $(sPostEffectNature+sPostResponseId).slideUp(sPostEffectSpeed); } if(sPostEffect == 'show'){ $(sPostEffectNature+sPostResponseId).show(sPostEffectSpeed); } if(sPostEffect == 'hide'){ $(sPostEffectNature+sPostResponseId).hide(sPostEffectSpeed); } } }); } function abstractAjaxA(sModuleInfo, sPrefix, sResponseId, sType, sHost) { var xmlHttp; var url = sHost + "abstractbridge/ajax/"; abstractProcessPrePostAjax(sPrefix, '_pre'); var sSendVars = abstractProcessPrePostAjax(sPrefix, '_send'); sSendVars += "&module=" + encodeURIComponent(sModuleInfo); xmlHttp=abstractGetXmlHttpObjectA(); if (xmlHttp==null) { alert ("Your browser does not support AJAX!"); return; } xmlHttp.open("POST",url,true); xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp.setRequestHeader("Content-length", sSendVars.length); xmlHttp.setRequestHeader("Connection", "close"); xmlHttp.onreadystatechange=function () { if (xmlHttp.readyState==4) { abstractProcessPrePostAjax(sPrefix, '_postA'); if(sType=='innerHTML') { document.getElementById(sResponseId).innerHTML=xmlHttp.responseText; } if(sType=='value') { document.getElementById(sResponseId).value=xmlHttp.responseText; } if(sType=='prepend') { document.getElementById(sResponseId).innerHTML=xmlHttp.responseText+document.getElementById(sResponseId).innerHTML; } if(sType=='append') { document.getElementById(sResponseId).innerHTML=document.getElementById(sResponseId).innerHTML+xmlHttp.responseText; } abstractProcessPrePostAjax(sPrefix, '_postB'); } } xmlHttp.send(sSendVars); } function abstractGetXmlHttpObjectA() { var xmlHttp=null; try { /*Firefox, Opera 8.0+, Safari*/ xmlHttp=new XMLHttpRequest(); } catch (e) { /*Internet Explorer*/ try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } function abstractGetElementsByClassName(oElm, strTagName, strClassName) { var arrElements = (strTagName == "*" && document.all)? document.all : oElm.getElementsByTagName(strTagName); var arrReturnElements = new Array(); strClassName = strClassName.replace(/\-/g, "\\-"); var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\w|$)"); var oElement; for(var i=0; i0) { return sSendVars; } /*END Return sSendVars*/ } /*END FUNCTION abstractProcessPrePostAjax*/ /*Auto Resize Textboxes When Typing*/ function abstractAutoTextboxRows(textArea) { while (textArea.rows > 2 && textArea.scrollHeight < textArea.offsetHeight) { textArea.rows--; } while (textArea.scrollHeight > textArea.offsetHeight) { textArea.rows++; } return; } /*Max Characters On Textareas*/ function abstractLimitCharsTextArea(textArea,limitDisplayId,maxlimit) { var limitDisplay = document.getElementById(limitDisplayId); if (textArea.value.length > maxlimit){ textArea.value = textArea.value.substring(0, maxlimit); limitDisplay.style.color='red'; }else{ limitDisplay.innerHTML = maxlimit - textArea.value.length; limitDisplay.style.color=''; if( (maxlimit-textArea.value.length) <= 5){ limitDisplay.style.color='red'; } } return; } /*Javascript Url Forwarding*/ function abstractGotoUrl(url) { window.location=url; } /*Just For Testing Purposes*/ function abstractTestAlert(var1,var2) { alert('test-'+var1+var2+'-test'); } /*Print Page*/ function abstractprintpage() { window.print(); } /* SWFObject v2.2 is released under the MIT License */ var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y0){for(var af=0;af0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad'}}aa.outerHTML='"+af+"";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab