	// mixxt javascript core files
	/*!
 * jQuery JavaScript Library v1.4.2
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Sat Feb 13 22:33:48 2010 -0500
 */
(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(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(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=
e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=
e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=
a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit=
{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&
!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},
toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";
if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!==
"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},
serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,
global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&
e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===
false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=
false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||
d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);
g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===
"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;
if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");
this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration===
"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||
c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;
this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=
this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||
c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?
function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);
c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,
d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);	/*
$(document).ready(function() {
    var host  = window.location.host;
    var parts = host.split('.');
    host      = parts[parts.length-2]+'.'+parts[parts.length-1];
    document.domain = host;
});
*/
/* Javascript Debugging */
jsDebug = {
	isJsDebugToggled: false,
	sdlfjsldf: false,
	functionArr: new Array(),
	allowEmailDebug: true,
	allowHtmlDebug: false,

	printStackTrace: function(funcName) {
		var callstack		 = [];
		var isCallstackPopulated = false;
		try {
			i.dont.exist+=0; //doesn't exist- that's the point
		} catch(e) {
			if(e.stack) { //Firefox
				var lines = e.stack.split("\n");
				for(var i=0, len=lines.length; i<len; i++) {
					if (lines[i].match(/^\s*[A-Za-z0-9\-_\$]+\(/)) {
						callstack.push(lines[i]);
					}
				}
				//Remove call to printStackTrace() and call to _oldFunctionUsed
				callstack.shift();
				callstack.shift();
				isCallstackPopulated = true;
			}
			else if(window.opera && e.message) { //Opera
				var lines = e.message.split("\n");
				for(var i=0, len=lines.length; i<len; i++) {
					if(lines[i].match(/^\s*[A-Za-z0-9\-_\$]+\(/)) {
						var entry = lines[i];
						//Append next line also since it has the file info
						if(lines[i+1]) {
							entry += " at " + lines[i+1];
							i++;
						}
						callstack.push(entry);
					}
				}
				//Remove call to printStackTrace() and call to _oldFunctionUsed
				callstack.shift();
				callstack.shift();
				isCallstackPopulated = true;
			}
		}
		
		if(!isCallstackPopulated) { //IE and Safari
			var currentFunction = arguments.callee.caller;
			while(currentFunction) {
				var fn = currentFunction.toString();
				var fname = fn.substring(fn.indexOf("function") + 8, fn.indexOf("(")) || "anonymous";
				//callstack.push(fname);
				var args = currentFunction.arguments.length + ' args (';
				for(var i=0; i<currentFunction.arguments.length; i++) {
					//args += i + '=' + typeof(currentFunction.arguments[i]) + ' ';
					if(i!=0) {
						args += ', ';
					}
					args += typeof(currentFunction.arguments[i]);
				}
				args += ')';
				callstack.push(fname + ' ' + args)
				currentFunction = currentFunction.caller;
			}
			//Remove call to _oldFunctionUsed
			callstack.shift();    
		}
		jsDebug.jsOutput(callstack, funcName, jsDebug.allowHtmlDebug, jsDebug.allowEmailDebug);
	},

	jsOutput: function(callstack, funcName, asDebug, asMail) {
		var myMsg = "Hallo,\n";
		myMsg += "Leider habe ich (Das lamda Framework!) eine alte JavaScript Funktion gefunden...da habt ihr wohl nicht aufgepasst:\n\n";
		myMsg += "Der Fehler ist auf Folgender Seite aufgetreten: "+location.href+"\n\n";
		myMsg += "Der name der Funktion lautet: -> "+funcName+"\n\n";
		myMsg += "Hier ist der Stack Trace zu der Funktion:\n";
		myMsg += callstack.join("\n");
		myMsg += "\n\nViele Grüße und viel Spaß mit diesem Fehlerreport :)\n";
		myMsg += "Euer lamda Framework";
		
		if(asMail)
		{
			api.call('/api/js/general/wrongJavascript', { message: myMsg }, function(data) {});
		}
		
		if(asDebug)
		{
			$('#jsDebugList').append('<li><hr />'+funcName+' tritt <span id="'+funcName+'">1</span>x auf:<hr />'+callstack.join('<br />')+'</li>');
			if(jsDebug.isJsDebugToggled) {
				jsDebug.toggleJSDebug();
			}
		}
	},

	toggleJSDebug: function() {
		if(!jsDebug.isJsDebugToggled)
		{
			$('#jsDebugList').slideUp('normal');
			$('#JsDebug').css('background-color', 'darkred');
			$('#JsDebug').css('color', 'white');
			jsDebug.isJsDebugToggled = true;
		}
		else
		{
			$('#jsDebugList').slideDown('normal');
			$('#JsDebug').css('background-color', 'white');
			$('#JsDebug').css('color', 'darkred');
			jsDebug.isJsDebugToggled = false;
		}
	},
	
	_oldCallUsed: function() {
		if(!jsDebug.sdlfjsldf) {
			if(jsDebug.allowHtmlDebug) {
				$('body').prepend('<div id="debugtop" style="position: absolute; left: 10px; top: 5px; width: 150px; z-index: 10000; color: red; font-weight: bold">Old Javascript Function used</div>');
				$('body').append('<div id="JsDebug" style="position:fixed;left:10px;top:100px;border:1px solid black;padding:5px;z-index:10000;background-color:white;color:darkred;cursor:pointer;font-size:12px;" onclick="toggleJSDebug();"><b><u>JS-Debug:</u></b><ul id="jsDebugList" style="margin-left:10px;"><li>Liste:</li></ul></a>');
			}
			jsDebug.sdlfjsldf = true;
		}
		
		var isInArr = false;
		var str     = _oldCallUsed_DONT.caller.toString();
		str         = str.split(' ');
		str         = str[1];
		str	    = str.split('(');
		str	    = str[0];
		for(i=0;i<jsDebug.functionArr.length;i++)
		{
			if(jsDebug.functionArr[i] == str)
			{
				isInArr = true;
			}
		}
		if(isInArr == false)
		{
			jsDebug.functionArr.push(str);
			jsDebug.printStackTrace(str);
		}
		else
		{
			var count = parseInt($('#'+str).text());
			count = count + 1;
			$('#'+str).text(count);
			if(jsDebug.isJsDebugToggled) {
				jsDebug.toggleJSDebug();
			}
		}
	}
}
function _oldCallUsed_DONT() {
	jsDebug._oldCallUsed();
}

/* Niceforms shortcuts
 */
function initNiceforms() {
	if(niceforms_active) {
		init();
	}
}
function resetCheckboxesNiceforms() {
	if(niceforms_active) {
		resetCheckboxes();
	}
}

/* Neue Objektorientierte Implementation */
/* 		Experimental 		 */

/* Networks Namespace*/
/* Erweiterung erfolgt über die eingebundenen js Dateien
 * mittels networksClass.prototype.subObject = { macheWas: function(){ } };
 */
function networksClass(){ }
var networks = new networksClass();

/* General Namespace*/
/* Für alle General Template bezogenen Funktionen */
function generalClass(){ }
var general = new generalClass();

/* Global Namspace */
/* .. */
function globalClass(){ }
var global = new globalClass();

/* API Namespace */
/* Alle API Aufrufe die zentral abgelegt werden sollten */
function apiClass(){ }
var api = new apiClass();

/* Layout Namespace */
/* für Dinge wie die AlertBox oder auf-/zuklappen */
function layoutClass(){ }
var layout = new layoutClass();

/* Users Namespace */
var users = { };

/* Erweiterung der Objekte in den eingebundenen Dateien */
/* Ende OOP */

/*
CSS Browser Selector v0.3.5 (Feb 05, 2010) // alte Version: v0.3.1
Rafael Lima (http://rafael.adm.br)
http://rafael.adm.br/css_browser_selector
License: http://creativecommons.org/licenses/by/2.5/
Contributors: http://rafael.adm.br/css_browser_selector#contributors
*/
function css_browser_selector(u){var ua = u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1;},g='gecko',w='webkit',s='safari',o='opera',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?'mobile':is('iphone')?'iphone':is('ipod')?'ipod':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win':is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}; css_browser_selector(navigator.userAgent);

/* Serialize */
function phpserialize(f){var g=function(a){var b=typeof a,match;var c;if(b=='object'&&!a){return'null'}if(b=="object"){if(!a.constructor){return'object'}var d=a.constructor.toString();if(match=d.match(/(\w+)\(/)){d=match[1].toLowerCase()}var e=["boolean","number","string","array"];for(c in e){if(d==e[c]){b=e[c];break}}}return b};var h=g(f);var i,ktype='';switch(h){case"function":i="";break;case"undefined":i="N";break;case"boolean":i="b:"+(f?"1":"0");break;case"number":i=(Math.round(f)==f?"i":"d")+":"+f;break;case"string":i="s:"+stringLengthUTF8(f)+":\""+f+"\"";break;case"array":case"object":i="a";var j=0;var k="";var l;var m;for(m in f){ktype=g(f[m]);if(ktype=="function"){continue}l=(m.match(/^[0-9]+$/)?parseInt(m):m);k+=phpserialize(l)+phpserialize(f[m]);j++}i+=":"+j+":{"+k+"}";break}if(h!="object"&&h!="array")i+=";";return i}
function stringLengthUTF8(s){var c,b=0,l=s.length;while(l){c=s.charCodeAt(--l);b+=(c<128)?1:((c<2048)?2:((c<65536)?3:4))};return b};

/* nl2br */
function nl2br(t){return(t+'').replace(/([^>]?)\n/g,'$1<br />\n');}

/* Save MousePosition */
function saveMousePosition(a){var b=document.all?true:false;var c,tempY;if(!b)document.captureEvents(Event.MOUSEMOVE);if(!a){a=window.event}if(b){c=event.clientX+document.body.scrollLeft;tempY=event.clientY+document.body.scrollTop}else{c=a.pageX;tempY=a.pageY}if(c<0){c=0}if(tempY<0){tempY=0}if(!globalVals['mousePosition']){globalVals['mousePosition']=new Object()}globalVals['mousePosition']['x']=c;globalVals['mousePosition']['y']=tempY}document.onmousedown=saveMousePosition;

/* alert overwrite */
if(document.getElementById) {
	window.alert = function(message,caption,type,html,wait) {
		layout.openAlert(message,caption,type,html,wait);
	}
	if (!globalVals['alert']) { globalVals['alert'] = new Object(); }
	globalVals['alert']['overwritten'] = true;
}

/* Extracted from niceforms_mod_pe */
var isMac = new RegExp('(^|)'+'Apple'+'(|$)')
function findPosY(obj) {
	var posTop = 0;
	while (obj.offsetParent) {posTop += obj.offsetTop; obj = obj.offsetParent;}
	return posTop;
}
function findPosX(obj) {
	var posLeft = 0;
	while (obj.offsetParent) {posLeft += obj.offsetLeft; obj = obj.offsetParent;}
	return posLeft;
}


/* Detect Browser - new custom implementation to detect also google chrome....use: $.browser.(browsername) */
var userAgent = navigator.userAgent.toLowerCase();
jQuery.browser = {
	version: (userAgent.match( /.+(?:rv|it|ra|ie|me)[\/: ]([\d.]+)/ ) || [])[1],
	chrome: /chrome/.test( userAgent ),
	safari: /webkit/.test( userAgent ) && !/chrome/.test( userAgent ),
	opera: /opera/.test( userAgent ),
	msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
	mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
};

/* JavaScript Trim implemetation */
String.prototype.ltrim = function(clist) {
	if(clist) {
		return this.replace(new RegExp('^[' + clist + ']+'), '');
	}
	return this.replace(/^\s+/, '');
}
String.prototype.rtrim = function(clist) {
	if(clist) {
		return this.replace(new RegExp ('[' + clist + ']+$'), '');
	}
	return this.replace(/\s+$/, '');
}
String.prototype.trim = function(clist) {
	if(clist) {
		return this.ltrim(clist).rtrim(clist);
	}
	return this.ltrim().rtrim();
}

/*
function addLoadEvent(func) {
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		var oldonload = window.onload;
		window.onload = function() {
			oldonload();
			func();
		}
	}
}
*/	cookies = {
	setCookie: function(name,value,expires) {
		var time = new Date();
		if (!expires) {
			expires = 3600*24*365;
		}
		time = new Date(time.getTime() + expires);
		
		document.cookie = name+'='+value+';expires='+time.toGMTString()+';';
	},
	
	getCookie: function(name) {
		var c = document.cookie;
		var result = '';
		while(c != '') {
			cookiename = c.substring(0,c.search('='));
			search = (c.search(';') != -1) ? c.search(';') : c.length;
			cookievalue	= c.substring(c.search('=')+1,search);
			if(cookievalue == '') {
				cookievalue = c.substring(c.search('=')+1,c.length);
			}
			if(name == cookiename) {
				result = cookievalue;
			}
			i = c.search(';')+1;
			if(i == 0) {
				i = c.length;
			}
			c = c.substring(i,c.length);
			while (c.substr(0, 1)==' ') {
				c = c.substring(1, c.length);
			}
		}
		return result;
	},
	
	getSessionCookie: function() {
		return cookies.getCookie('sid');
	}
}	layout = layoutClass.prototype = {
	toggleBox: function(boxname, handle) {
		$('#'+boxname).slideToggle("normal");
		$(handle).toggleClass("arrow_right");
		$(handle).toggleClass("arrow_down");
	},
	
	expandSection: function(section) {
		$('#' + section + '>h5').toggleClass('section_open');
		$('#' + section + '>h6').toggleClass('section_open');
		$('#' + section + '>h5').toggleClass("arrow_down");
		$('#' + section + '>h6').toggleClass("arrow_down");
		$('#' + section + '>h5').toggleClass("arrow_right");
		$('#' + section + '>h6').toggleClass("arrow_right");
		$('#' + section + '>.section_ctr').toggleClass('hide');
	},
	
	openBox: function(elm) {
		$(elm).toggleClass('arrow_right').toggleClass('arrow_down');
		$(elm).parent().children('div').toggleClass('hide');
		$(elm).parent().children('p').toggleClass('hide');
	},
	
	openAlert: function(message,caption,type,html,wait) {
		var alertRandNumber	= Math.random();
		alertRandNumber 	= Math.round(alertRandNumber*10000);
		if (!globalVals['alert'][alertRandNumber]) {
			globalVals['alert'][alertRandNumber] = true;
			$('body').append('<div id="alertWindow_'+alertRandNumber+'" class="alertWindow"></div>');
			api.replaceFile('/templates/client/' + getLanguage('user') + '/general/alert/alertWindow.tpl', "#alertWindow_"+alertRandNumber, function() {
					if(niceforms_active != 'undefined') init();
					$("#alertWindow_"+alertRandNumber+" .content .button input").attr('title','randNumber_'+alertRandNumber);
					$("#alertWindow_"+alertRandNumber+" .alertClose a").attr('title','randNumber_'+alertRandNumber);
					
					if (caption) {
						$("#alertWindow_"+alertRandNumber+" .topCenter h1 span").html(caption);
					}
					if (type) {
						$("#alertWindow_"+alertRandNumber+" .content").addClass(type);
						if (!globalVals['alert']['types']) { globalVals['alert']['types'] = new Object(); }
						globalVals['alert']['types'][alertRandNumber] = type;
					}
					if (!html && message) {
						message = message.replace(/\&/g,'&amp;');
						message = message.replace(/\</g,'&lt;');
						message = message.replace(/\>/g,'&gt;');
						message = message.replace(/\"/g,'&quote;');
						message = nl2br(message);
					}
					
					if (message) {
						$("#alertWindow_"+alertRandNumber+" .content .text").html(message);
					}
					
					if (!globalVals['mousePosition']) { globalVals['mousePosition'] = new Object(); }
					if (!globalVals['mousePosition']['x']) { globalVals['mousePosition']['x'] = 0; }
					if (!globalVals['mousePosition']['y']) { globalVals['mousePosition']['y'] = 0; }
					
					
					posLeft = ($("body").width()/2) - ($("#alertWindow_"+alertRandNumber).width()/2);
					posLeft = Math.round(posLeft);
					posTop = globalVals['mousePosition']['y'] - ($("#alertWindow_"+alertRandNumber).height()/2);
					if (posTop < 0) {
						posTop = 200;
					}
					posTop = Math.round(posTop);
					
					$("#alertWindow_"+alertRandNumber).css({left:posLeft+'px',top:posTop+'px'});
					
					$("#alertWindow_"+alertRandNumber).fadeIn('slow', function() {
							$("#alertWindow_"+alertRandNumber).draggable(
								{
									handle:		'.topBar',
									zIndex:		10000
								}
							);
						}
					);
					
					$("#alertWindow_"+alertRandNumber+" .button input").focus();
				}
			);
		}
		if (wait) {
			alert('Der Wait-Parameter ist noch nicht implementiert ...');
			while(globalVals['alert'][alertRandNumber]) {
				//console.log('still true: '+alertRandNumber);
				break; // ein sleep wäre so schön ...
			}
		}
	},
	
	closeAlert: function(alertReference) {
		var alertRandNumber = $(alertReference).attr('title');
		alertRandNumber = alertRandNumber.substr(11,alertRandNumber.length);
		if (globalVals['alert']['types'] && globalVals['alert']['types'][alertRandNumber]) {
			// action for different types
			if (globalVals['alert']['types'][alertRandNumber] == 'error') {
				layout.error.display();
			}
		}
		globalVals['alert'][alertRandNumber] = false;
		$("#alertWindow_"+alertRandNumber).fadeOut('slow',function() {
			$("#alertWindow_"+alertRandNumber).draggable('destroy');
			$("#alertWindow_"+alertRandNumber).remove();
		});
		return true;
	},
	
	clearStd: function(elm, defaultStr) {
		var val = $(elm).val().trim();
		if(defaultStr) {
            if(val == defaultStr) {
                $(elm).val("");
            }
        } else {
            if(val == elm.defaultValue) {
                $(elm).val("");
            }
        }
	},
	
	fillStd: function(elm, defaultStr) {
		if($(elm).val().trim() == "") {
		    if(defaultStr) {
		        $(elm).val(defaultStr);
		    } else {
		        $(elm).val(elm.defaultValue);
			}
		}
	}
}	layout.error = {
    image: '/images/networks/ig_exclamation.png',
    display: function() {
        for (i=0;i<errorArray.length;i++) {
            if (errorArray[i] && document.getElementsByName(errorArray[i]).length > 0 && document.getElementsByName(errorArray[i])[0].type) {
                if(!$.browser.msie) {
                    document.getElementsByName(errorArray[i])[0].focus();
                }
                if (document.getElementsByName(errorArray[i])[0].id) {
                    $("#scrollTo_"+errorArray[i]).ScrollTo(400);
                }
                break;
            }
        }
        $('#errorDisplay').css('display','none');
    },
    check: function() {
        if (niceforms_active && !niceforms_done) {
            window.setTimeout("layout.error.check();",100);
            return 0;
        }
        for (i=0;i<errorArray.length;i++) {
            if (errorArray[i] && document.getElementsByName(errorArray[i]).length > 0 && document.getElementsByName(errorArray[i])[0].type) {
                x = findPosX(document.getElementsByName(errorArray[i])[0]);
                y = findPosY(document.getElementsByName(errorArray[i])[0]);
                var iconDiv = document.createElement('div');
                iconDiv.id = "errorElements"+i;
                document.getElementsByTagName('body')[0].appendChild(iconDiv);
                var scrollToDiv = document.createElement('div');
                scrollToDiv.id = "scrollTo_"+errorArray[i];
                document.getElementsByTagName('body')[0].appendChild(scrollToDiv);
                $('#scrollTo_'+errorArray[i]).css('position','absolute');
                $('#scrollTo_'+errorArray[i]).css('top',(y-50)+'px');
                $('#errorElements'+i).html('<img src="'+layout.error.image+'" width="16" height="16" alt="err" />');
                $('#errorElements'+i).css('position','absolute');
                if (document.getElementsByName(errorArray[i])[0].type == 'text' || document.getElementsByName(errorArray[i])[0].type == 'password') {
                    $('#errorElements'+i).css('left',(x-(!isMac.test(navigator.vendor)?13:12))+'px');
                    $('#errorElements'+i).css('top',(y+(!isMac.test(navigator.vendor)?4:1))+'px');
                } else if(document.getElementsByName(errorArray[i])[0].type == 'textarea') {
                    $('#errorElements'+i).css('left',(x-(!isMac.test(navigator.vendor)?20:13))+'px');
                    $('#errorElements'+i).css('top',(y-(!isMac.test(navigator.vendor)?8:0))+'px');
                } else {
                    $('#errorElements'+i).css('display','none');
                }
                $('#errorElements'+i).css('width','16px');
                $('#errorElements'+i).css('height','16px');
            }
        }
        $('#errorDisplay #confirmButton').focus();
    }
}	layout.ratings = {
	out: function(elem, item){
		$(elem).siblings().andSelf().removeClass('hover');
		$(elem).parent().removeClass('hover');
		$(elem).parent().find('a').each(function(i, val) {
			if(i < globalVals.items.ratings[item]) {
				$(this).addClass('rated');
			}
		});
	},
	over: function(elem, item){
		$(elem).siblings().andSelf().removeClass('rated');
		$(elem).prevAll().andSelf().addClass('hover');
		$(elem).parent().addClass('hover');
	}
}	// js/jquery/jquery.ui.js
	/*
 * jQuery UI 1.7.1
 *
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI
 */
;jQuery.ui || (function($) {

var _remove = $.fn.remove,
	isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);

//Helper functions and ui object
$.ui = {
	version: "1.7.1",

	// $.ui.plugin is deprecated.  Use the proxy pattern instead.
	plugin: {
		add: function(module, option, set) {
			var proto = $.ui[module].prototype;
			for(var i in set) {
				proto.plugins[i] = proto.plugins[i] || [];
				proto.plugins[i].push([option, set[i]]);
			}
		},
		call: function(instance, name, args) {
			var set = instance.plugins[name];
			if(!set || !instance.element[0].parentNode) { return; }

			for (var i = 0; i < set.length; i++) {
				if (instance.options[set[i][0]]) {
					set[i][1].apply(instance.element, args);
				}
			}
		}
	},

	contains: function(a, b) {
		return document.compareDocumentPosition
			? a.compareDocumentPosition(b) & 16
			: a !== b && a.contains(b);
	},

	hasScroll: function(el, a) {

		//If overflow is hidden, the element might have extra content, but the user wants to hide it
		if ($(el).css('overflow') == 'hidden') { return false; }

		var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
			has = false;

		if (el[scroll] > 0) { return true; }

		// TODO: determine which cases actually cause this to happen
		// if the element doesn't have the scroll set, see if it's possible to
		// set the scroll
		el[scroll] = 1;
		has = (el[scroll] > 0);
		el[scroll] = 0;
		return has;
	},

	isOverAxis: function(x, reference, size) {
		//Determines when x coordinate is over "b" element axis
		return (x > reference) && (x < (reference + size));
	},

	isOver: function(y, x, top, left, height, width) {
		//Determines when x, y coordinates is over "b" element
		return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
	},

	keyCode: {
		BACKSPACE: 8,
		CAPS_LOCK: 20,
		COMMA: 188,
		CONTROL: 17,
		DELETE: 46,
		DOWN: 40,
		END: 35,
		ENTER: 13,
		ESCAPE: 27,
		HOME: 36,
		INSERT: 45,
		LEFT: 37,
		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
	}
};

// WAI-ARIA normalization
if (isFF2) {
	var attr = $.attr,
		removeAttr = $.fn.removeAttr,
		ariaNS = "http://www.w3.org/2005/07/aaa",
		ariaState = /^aria-/,
		ariaRole = /^wairole:/;

	$.attr = function(elem, name, value) {
		var set = value !== undefined;

		return (name == 'role'
			? (set
				? attr.call(this, elem, name, "wairole:" + value)
				: (attr.apply(this, arguments) || "").replace(ariaRole, ""))
			: (ariaState.test(name)
				? (set
					? elem.setAttributeNS(ariaNS,
						name.replace(ariaState, "aaa:"), value)
					: attr.call(this, elem, name.replace(ariaState, "aaa:")))
				: attr.apply(this, arguments)));
	};

	$.fn.removeAttr = function(name) {
		return (ariaState.test(name)
			? this.each(function() {
				this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
			}) : removeAttr.call(this, name));
	};
}

//jQuery plugins
$.fn.extend({
	remove: function() {
		// Safari has a native remove event which actually removes DOM elements,
		// so we have to use triggerHandler instead of trigger (#3037).
		$("*", this).add(this).each(function() {
			$(this).triggerHandler("remove");
		});
		return _remove.apply(this, arguments );
	},

	enableSelection: function() {
		return this
			.attr('unselectable', 'off')
			.css('MozUserSelect', '')
			.unbind('selectstart.ui');
	},

	disableSelection: function() {
		return this
			.attr('unselectable', 'on')
			.css('MozUserSelect', 'none')
			.bind('selectstart.ui', function() { return false; });
	},

	scrollParent: function() {
		var scrollParent;
		if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
			scrollParent = this.parents().filter(function() {
				return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
			}).eq(0);
		} else {
			scrollParent = this.parents().filter(function() {
				return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
			}).eq(0);
		}

		return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
	}
});


//Additional selectors
$.extend($.expr[':'], {
	data: function(elem, i, match) {
		return !!$.data(elem, match[3]);
	},

	focusable: function(element) {
		var nodeName = element.nodeName.toLowerCase(),
			tabIndex = $.attr(element, 'tabindex');
		return (/input|select|textarea|button|object/.test(nodeName)
			? !element.disabled
			: 'a' == nodeName || 'area' == nodeName
				? element.href || !isNaN(tabIndex)
				: !isNaN(tabIndex))
			// the element and all of its ancestors must be visible
			// the browser may report that the area is hidden
			&& !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
	},

	tabbable: function(element) {
		var tabIndex = $.attr(element, 'tabindex');
		return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
	}
});


// $.widget is a factory to create jQuery plugins
// taking some boilerplate code out of the plugin code
function getter(namespace, plugin, method, args) {
	function getMethods(type) {
		var methods = $[namespace][plugin][type] || [];
		return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
	}

	var methods = getMethods('getter');
	if (args.length == 1 && typeof args[0] == 'string') {
		methods = methods.concat(getMethods('getterSetter'));
	}
	return ($.inArray(method, methods) != -1);
}

$.widget = function(name, prototype) {
	var namespace = name.split(".")[0];
	name = name.split(".")[1];

	// create plugin method
	$.fn[name] = function(options) {
		var isMethodCall = (typeof options == 'string'),
			args = Array.prototype.slice.call(arguments, 1);

		// prevent calls to internal methods
		if (isMethodCall && options.substring(0, 1) == '_') {
			return this;
		}

		// handle getter methods
		if (isMethodCall && getter(namespace, name, options, args)) {
			var instance = $.data(this[0], name);
			return (instance ? instance[options].apply(instance, args)
				: undefined);
		}

		// handle initialization and non-getter methods
		return this.each(function() {
			var instance = $.data(this, name);

			// constructor
			(!instance && !isMethodCall &&
				$.data(this, name, new $[namespace][name](this, options))._init());

			// method call
			(instance && isMethodCall && $.isFunction(instance[options]) &&
				instance[options].apply(instance, args));
		});
	};

	// create widget constructor
	$[namespace] = $[namespace] || {};
	$[namespace][name] = function(element, options) {
		var self = this;

		this.namespace = namespace;
		this.widgetName = name;
		this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
		this.widgetBaseClass = namespace + '-' + name;

		this.options = $.extend({},
			$.widget.defaults,
			$[namespace][name].defaults,
			$.metadata && $.metadata.get(element)[name],
			options);

		this.element = $(element)
			.bind('setData.' + name, function(event, key, value) {
				if (event.target == element) {
					return self._setData(key, value);
				}
			})
			.bind('getData.' + name, function(event, key) {
				if (event.target == element) {
					return self._getData(key);
				}
			})
			.bind('remove', function() {
				return self.destroy();
			});
	};

	// add widget prototype
	$[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);

	// TODO: merge getter and getterSetter properties from widget prototype
	// and plugin prototype
	$[namespace][name].getterSetter = 'option';
};

$.widget.prototype = {
	_init: function() {},
	destroy: function() {
		this.element.removeData(this.widgetName)
			.removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
			.removeAttr('aria-disabled');
	},

	option: function(key, value) {
		var options = key,
			self = this;

		if (typeof key == "string") {
			if (value === undefined) {
				return this._getData(key);
			}
			options = {};
			options[key] = value;
		}

		$.each(options, function(key, value) {
			self._setData(key, value);
		});
	},
	_getData: function(key) {
		return this.options[key];
	},
	_setData: function(key, value) {
		this.options[key] = value;

		if (key == 'disabled') {
			this.element
				[value ? 'addClass' : 'removeClass'](
					this.widgetBaseClass + '-disabled' + ' ' +
					this.namespace + '-state-disabled')
				.attr("aria-disabled", value);
		}
	},

	enable: function() {
		this._setData('disabled', false);
	},
	disable: function() {
		this._setData('disabled', true);
	},

	_trigger: function(type, event, data) {
		var callback = this.options[type],
			eventName = (type == this.widgetEventPrefix
				? type : this.widgetEventPrefix + type);

		event = $.Event(event);
		event.type = eventName;

		// copy original event properties over to the new event
		// this would happen if we could call $.event.fix instead of $.Event
		// but we don't have a way to force an event to be fixed multiple times
		if (event.originalEvent) {
			for (var i = $.event.props.length, prop; i;) {
				prop = $.event.props[--i];
				event[prop] = event.originalEvent[prop];
			}
		}

		this.element.trigger(event, data);

		return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
			|| event.isDefaultPrevented());
	}
};

$.widget.defaults = {
	disabled: false
};


/** Mouse Interaction Plugin **/

$.ui.mouse = {
	_mouseInit: function() {
		var self = this;

		this.element
			.bind('mousedown.'+this.widgetName, function(event) {
				return self._mouseDown(event);
			})
			.bind('click.'+this.widgetName, function(event) {
				if(self._preventClickEvent) {
					self._preventClickEvent = false;
					event.stopImmediatePropagation();
					return false;
				}
			});

		// Prevent text selection in IE
		if ($.browser.msie) {
			this._mouseUnselectable = this.element.attr('unselectable');
			this.element.attr('unselectable', 'on');
		}

		this.started = false;
	},

	// TODO: make sure destroying one instance of mouse doesn't mess with
	// other instances of mouse
	_mouseDestroy: function() {
		this.element.unbind('.'+this.widgetName);

		// Restore text selection in IE
		($.browser.msie
			&& this.element.attr('unselectable', this._mouseUnselectable));
	},

	_mouseDown: function(event) {
		// don't let more than one widget handle mouseStart
		// TODO: figure out why we have to use originalEvent
		event.originalEvent = event.originalEvent || {};
		if (event.originalEvent.mouseHandled) { return; }

		// we may have missed mouseup (out of window)
		(this._mouseStarted && this._mouseUp(event));

		this._mouseDownEvent = event;

		var self = this,
			btnIsLeft = (event.which == 1),
			elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
		if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
			return true;
		}

		this.mouseDelayMet = !this.options.delay;
		if (!this.mouseDelayMet) {
			this._mouseDelayTimer = setTimeout(function() {
				self.mouseDelayMet = true;
			}, this.options.delay);
		}

		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
			this._mouseStarted = (this._mouseStart(event) !== false);
			if (!this._mouseStarted) {
				event.preventDefault();
				return true;
			}
		}

		// these delegates are required to keep context
		this._mouseMoveDelegate = function(event) {
			return self._mouseMove(event);
		};
		this._mouseUpDelegate = function(event) {
			return self._mouseUp(event);
		};
		$(document)
			.bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
			.bind('mouseup.'+this.widgetName, this._mouseUpDelegate);

		// preventDefault() is used to prevent the selection of text here -
		// however, in Safari, this causes select boxes not to be selectable
		// anymore, so this fix is needed
		($.browser.safari || event.preventDefault());

		event.originalEvent.mouseHandled = true;
		return true;
	},

	_mouseMove: function(event) {
		// IE mouseup check - mouseup happened when mouse was out of window
		if ($.browser.msie && !event.button) {
			return this._mouseUp(event);
		}

		if (this._mouseStarted) {
			this._mouseDrag(event);
			return event.preventDefault();
		}

		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
			this._mouseStarted =
				(this._mouseStart(this._mouseDownEvent, event) !== false);
			(this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
		}

		return !this._mouseStarted;
	},

	_mouseUp: function(event) {
		$(document)
			.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
			.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);

		if (this._mouseStarted) {
			this._mouseStarted = false;
			this._preventClickEvent = (event.target == this._mouseDownEvent.target);
			this._mouseStop(event);
		}

		return false;
	},

	_mouseDistanceMet: function(event) {
		return (Math.max(
				Math.abs(this._mouseDownEvent.pageX - event.pageX),
				Math.abs(this._mouseDownEvent.pageY - event.pageY)
			) >= this.options.distance
		);
	},

	_mouseDelayMet: function(event) {
		return this.mouseDelayMet;
	},

	// These are placeholder methods, to be overriden by extending plugin
	_mouseStart: function(event) {},
	_mouseDrag: function(event) {},
	_mouseStop: function(event) {},
	_mouseCapture: function(event) { return true; }
};

$.ui.mouse.defaults = {
	cancel: null,
	distance: 1,
	delay: 0
};

})(jQuery);	// js/jquery/jquery.ui.*.js
	/*
 * jQuery UI Draggable 1.7.1
 *
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Draggables
 *
 * Depends:
 *	ui.core.js
 */
(function($) {

$.widget("ui.draggable", $.extend({}, $.ui.mouse, {

	_init: 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')) return;
		this.element
			.removeData("draggable")
			.unbind(".draggable")
			.removeClass("ui-draggable"
				+ " ui-draggable-dragging"
				+ " ui-draggable-disabled");
		this._mouseDestroy();
	},

	_mouseCapture: function(event) {

		var o = this.options;

		if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))
			return false;

		//Quit if we're not on a valid handle
		this.handle = this._getHandle(event);
		if (!this.handle)
			return false;

		return true;

	},

	_mouseStart: function(event) {

		var o = this.options;

		//Create and append the visible helper
		this.helper = this._createHelper(event);

		//Cache the helper size
		this._cacheHelperProportions();

		//If ddmanager is used for droppables, set the global draggable
		if($.ui.ddmanager)
			$.ui.ddmanager.current = this;

		/*
		 * - Position generation -
		 * This block generates everything position related - it's the core of draggables.
		 */

		//Cache the margins of the original element
		this._cacheMargins();

		//Store the helper's css position
		this.cssPosition = this.helper.css("position");
		this.scrollParent = this.helper.scrollParent();

		//The element's absolute position on the page minus margins
		this.offset = this.element.offset();
		this.offset = {
			top: this.offset.top - this.margins.top,
			left: this.offset.left - this.margins.left
		};

		$.extend(this.offset, {
			click: { //Where the click happened, relative to the element
				left: event.pageX - this.offset.left,
				top: event.pageY - this.offset.top
			},
			parent: this._getParentOffset(),
			relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
		});

		//Generate the original position
		this.originalPosition = this._generatePosition(event);
		this.originalPageX = event.pageX;
		this.originalPageY = event.pageY;

		//Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
		if(o.cursorAt)
			this._adjustOffsetFromHelper(o.cursorAt);

		//Set a containment if given in the options
		if(o.containment)
			this._setContainment();

		//Call plugins and callbacks
		this._trigger("start", event);

		//Recache the helper size
		this._cacheHelperProportions();

		//Prepare the droppable offsets
		if ($.ui.ddmanager && !o.dropBehaviour)
			$.ui.ddmanager.prepareOffsets(this, event);

		this.helper.addClass("ui-draggable-dragging");
		this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
		return true;
	},

	_mouseDrag: function(event, noPropagation) {

		//Compute the helpers position
		this.position = this._generatePosition(event);
		this.positionAbs = this._convertPositionTo("absolute");

		//Call plugins and callbacks and use the resulting position if something is returned
		if (!noPropagation) {
			var ui = this._uiHash();
			this._trigger('drag', event, ui);
			this.position = ui.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';
		if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);

		return false;
	},

	_mouseStop: function(event) {

		//If we are using droppables, inform the manager about the drop
		var dropped = false;
		if ($.ui.ddmanager && !this.options.dropBehaviour)
			dropped = $.ui.ddmanager.drop(this, event);

		//if a drop comes from outside (a sortable)
		if(this.dropped) {
			dropped = this.dropped;
			this.dropped = false;
		}

		if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
			var self = this;
			$(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
				self._trigger("stop", event);
				self._clear();
			});
		} else {
			this._trigger("stop", event);
			this._clear();
		}

		return false;
	},

	_getHandle: function(event) {

		var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
		$(this.options.handle, this.element)
			.find("*")
			.andSelf()
			.each(function() {
				if(this == event.target) handle = true;
			});

		return handle;

	},

	_createHelper: function(event) {

		var o = this.options;
		var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone() : this.element);

		if(!helper.parents('body').length)
			helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));

		if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position")))
			helper.css("position", "absolute");

		return helper;

	},

	_adjustOffsetFromHelper: function(obj) {
		if(obj.left != undefined) this.offset.click.left = obj.left + this.margins.left;
		if(obj.right != undefined) this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
		if(obj.top != undefined) this.offset.click.top = obj.top + this.margins.top;
		if(obj.bottom != undefined) this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
	},

	_getParentOffset: function() {

		//Get the offsetParent and cache its position
		this.offsetParent = this.helper.offsetParent();
		var po = this.offsetParent.offset();

		// This is a special case where we need to modify a offset calculated on start, since the following happened:
		// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
		if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
			po.left += this.scrollParent.scrollLeft();
			po.top += this.scrollParent.scrollTop();
		}

		if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
		|| (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
			po = { top: 0, left: 0 };

		return {
			top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
			left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
		};

	},

	_getRelativeOffset: function() {

		if(this.cssPosition == "relative") {
			var p = this.element.position();
			return {
				top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
				left: p.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)
		};
	},

	_cacheHelperProportions: function() {
		this.helperProportions = {
			width: this.helper.outerWidth(),
			height: this.helper.outerHeight()
		};
	},

	_setContainment: function() {

		var o = this.options;
		if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
		if(o.containment == 'document' || o.containment == 'window') this.containment = [
			0 - this.offset.relative.left - this.offset.parent.left,
			0 - this.offset.relative.top - this.offset.parent.top,
			$(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
			($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
		];

		if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {
			var ce = $(o.containment)[0]; if(!ce) return;
			var co = $(o.containment).offset();
			var over = ($(ce).css("overflow") != 'hidden');

			this.containment = [
				co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
				co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
				co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
				co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
			];
		} else if(o.containment.constructor == Array) {
			this.containment = o.containment;
		}

	},

	_convertPositionTo: function(d, pos) {

		if(!pos) pos = this.position;
		var mod = d == "absolute" ? 1 : -1;
		var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);

		return {
			top: (
				pos.top																	// The absolute mouse position
				+ this.offset.relative.top * mod										// Only for relative positioned nodes: Relative offset from element to offset parent
				+ this.offset.parent.top * mod											// The offsetParent's offset without borders (offset + border)
				- ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
			),
			left: (
				pos.left																// The absolute mouse position
				+ this.offset.relative.left * mod										// Only for relative positioned nodes: Relative offset from element to offset parent
				+ this.offset.parent.left * mod											// The offsetParent's offset without borders (offset + border)
				- ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
			)
		};

	},

	_generatePosition: function(event) {

		var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);

		// This is another very weird special case that only happens for relative elements:
		// 1. If the css position is relative
		// 2. and the scroll parent is the document or similar to the offset parent
		// we have to refresh the relative offset during the scroll so there are no jumps
		if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
			this.offset.relative = this._getRelativeOffset();
		}

		var pageX = event.pageX;
		var pageY = event.pageY;

		/*
		 * - Position constraining -
		 * Constrain the position to a mix of grid, containment.
		 */

		if(this.originalPosition) { //If we are not dragging yet, we won't check for options

			if(this.containment) {
				if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
				if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
				if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
				if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
			}

			if(o.grid) {
				var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
				pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;

				var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
				pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
			}

		}

		return {
			top: (
				pageY																// The absolute mouse position
				- this.offset.click.top													// Click offset (relative to the element)
				- this.offset.relative.top												// Only for relative positioned nodes: Relative offset from element to offset parent
				- this.offset.parent.top												// The offsetParent's offset without borders (offset + border)
				+ ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
			),
			left: (
				pageX																// The absolute mouse position
				- this.offset.click.left												// Click offset (relative to the element)
				- this.offset.relative.left												// Only for relative positioned nodes: Relative offset from element to offset parent
				- this.offset.parent.left												// The offsetParent's offset without borders (offset + border)
				+ ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
			)
		};

	},

	_clear: function() {
		this.helper.removeClass("ui-draggable-dragging");
		if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();
		//if($.ui.ddmanager) $.ui.ddmanager.current = null;
		this.helper = null;
		this.cancelHelperRemoval = false;
	},

	// From now on bulk stuff - mainly helpers

	_trigger: function(type, event, ui) {
		ui = ui || this._uiHash();
		$.ui.plugin.call(this, type, [event, ui]);
		if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins
		return $.widget.prototype._trigger.call(this, type, event, ui);
	},

	plugins: {},

	_uiHash: function(event) {
		return {
			helper: this.helper,
			position: this.position,
			absolutePosition: this.positionAbs, //deprecated
			offset: this.positionAbs
		};
	}

}));

$.extend($.ui.draggable, {
	version: "1.7.1",
	eventPrefix: "drag",
	defaults: {
		addClasses: true,
		appendTo: "parent",
		axis: false,
		cancel: ":input,option",
		connectToSortable: false,
		containment: false,
		cursor: "auto",
		cursorAt: false,
		delay: 0,
		distance: 1,
		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
	}
});

$.ui.plugin.add("draggable", "connectToSortable", {
	start: function(event, ui) {

		var inst = $(this).data("draggable"), o = inst.options,
			uiSortable = $.extend({}, ui, { item: inst.element });
		inst.sortables = [];
		$(o.connectToSortable).each(function() {
			var sortable = $.data(this, 'sortable');
			if (sortable && !sortable.options.disabled) {
				inst.sortables.push({
					instance: sortable,
					shouldRevert: sortable.options.revert
				});
				sortable._refreshItems();	//Do a one-time refresh at start to refresh the containerCache
				sortable._trigger("activate", event, uiSortable);
			}
		});

	},
	stop: function(event, ui) {

		//If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
		var inst = $(this).data("draggable"),
			uiSortable = $.extend({}, ui, { item: inst.element });

		$.each(inst.sortables, function() {
			if(this.instance.isOver) {

				this.instance.isOver = 0;

				inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
				this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)

				//The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'
				if(this.shouldRevert) this.instance.options.revert = true;

				//Trigger the stop of the sortable
				this.instance._mouseStop(event);

				this.instance.options.helper = this.instance.options._helper;

				//If the helper has been the original item, restore properties in the sortable
				if(inst.options.helper == 'original')
					this.instance.currentItem.css({ top: 'auto', left: 'auto' });

			} else {
				this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
				this.instance._trigger("deactivate", event, uiSortable);
			}

		});

	},
	drag: function(event, ui) {

		var inst = $(this).data("draggable"), self = this;

		var checkPos = function(o) {
			var dyClick = this.offset.click.top, dxClick = this.offset.click.left;
			var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;
			var itemHeight = o.height, itemWidth = o.width;
			var itemTop = o.top, itemLeft = o.left;

			return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);
		};

		$.each(inst.sortables, function(i) {
			
			//Copy over some variables to allow calling the sortable's native _intersectsWith
			this.instance.positionAbs = inst.positionAbs;
			this.instance.helperProportions = inst.helperProportions;
			this.instance.offset.click = inst.offset.click;
			
			if(this.instance._intersectsWith(this.instance.containerCache)) {

				//If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
				if(!this.instance.isOver) {

					this.instance.isOver = 1;
					//Now we fake the start of dragging for the sortable instance,
					//by cloning the list group item, appending it to the sortable and using it as inst.currentItem
					//We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
					this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true);
					this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
					this.instance.options.helper = function() { return ui.helper[0]; };

					event.target = this.instance.currentItem[0];
					this.instance._mouseCapture(event, true);
					this.instance._mouseStart(event, true, true);

					//Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
					this.instance.offset.click.top = inst.offset.click.top;
					this.instance.offset.click.left = inst.offset.click.left;
					this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
					this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;

					inst._trigger("toSortable", event);
					inst.dropped = this.instance.element; //draggable revert needs that
					//hack so receive/update callbacks work (mostly)
					inst.currentItem = inst.element;
					this.instance.fromOutside = inst;

				}

				//Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
				if(this.instance.currentItem) this.instance._mouseDrag(event);

			} else {

				//If it doesn't intersect with the sortable, and it intersected before,
				//we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
				if(this.instance.isOver) {

					this.instance.isOver = 0;
					this.instance.cancelHelperRemoval = true;
					
					//Prevent reverting on this forced stop
					this.instance.options.revert = false;
					
					// The out event needs to be triggered independently
					this.instance._trigger('out', event, this.instance._uiHash(this.instance));
					
					this.instance._mouseStop(event, true);
					this.instance.options.helper = this.instance.options._helper;

					//Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
					this.instance.currentItem.remove();
					if(this.instance.placeholder) this.instance.placeholder.remove();

					inst._trigger("fromSortable", event);
					inst.dropped = false; //draggable revert needs that
				}

			};

		});

	}
});

$.ui.plugin.add("draggable", "cursor", {
	start: function(event, ui) {
		var t = $('body'), o = $(this).data('draggable').options;
		if (t.css("cursor")) o._cursor = t.css("cursor");
		t.css("cursor", o.cursor);
	},
	stop: function(event, ui) {
		var o = $(this).data('draggable').options;
		if (o._cursor) $('body').css("cursor", o._cursor);
	}
});

$.ui.plugin.add("draggable", "iframeFix", {
	start: function(event, ui) {
		var o = $(this).data('draggable').options;
		$(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
			$('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
			.css({
				width: this.offsetWidth+"px", height: this.offsetHeight+"px",
				position: "absolute", opacity: "0.001", zIndex: 1000
			})
			.css($(this).offset())
			.appendTo("body");
		});
	},
	stop: function(event, ui) {
		$("div.ui-draggable-iframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers
	}
});

$.ui.plugin.add("draggable", "opacity", {
	start: function(event, ui) {
		var t = $(ui.helper), o = $(this).data('draggable').options;
		if(t.css("opacity")) o._opacity = t.css("opacity");
		t.css('opacity', o.opacity);
	},
	stop: function(event, ui) {
		var o = $(this).data('draggable').options;
		if(o._opacity) $(ui.helper).css('opacity', o._opacity);
	}
});

$.ui.plugin.add("draggable", "scroll", {
	start: function(event, ui) {
		var i = $(this).data("draggable");
		if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();
	},
	drag: function(event, ui) {

		var i = $(this).data("draggable"), o = i.options, scrolled = false;

		if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {

			if(!o.axis || o.axis != 'x') {
				if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
					i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
				else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity)
					i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
			}

			if(!o.axis || o.axis != 'y') {
				if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
					i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
				else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity)
					i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
			}

		} else {

			if(!o.axis || o.axis != 'x') {
				if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
					scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
				else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
					scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
			}

			if(!o.axis || o.axis != 'y') {
				if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
					scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
				else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
					scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
			}

		}

		if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
			$.ui.ddmanager.prepareOffsets(i, event);

	}
});

$.ui.plugin.add("draggable", "snap", {
	start: function(event, ui) {

		var i = $(this).data("draggable"), o = i.options;
		i.snapElements = [];

		$(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() {
			var $t = $(this); var $o = $t.offset();
			if(this != i.element[0]) i.snapElements.push({
				item: this,
				width: $t.outerWidth(), height: $t.outerHeight(),
				top: $o.top, left: $o.left
			});
		});

	},
	drag: function(event, ui) {

		var inst = $(this).data("draggable"), o = inst.options;
		var d = o.snapTolerance;

		var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
			y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;

		for (var i = inst.snapElements.length - 1; i >= 0; i--){

			var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
				t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;

			//Yes, I know, this is insane ;)
			if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
				if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
				inst.snapElements[i].snapping = false;
				continue;
			}

			if(o.snapMode != 'inner') {
				var ts = Math.abs(t - y2) <= d;
				var bs = Math.abs(b - y1) <= d;
				var ls = Math.abs(l - x2) <= d;
				var rs = Math.abs(r - x1) <= d;
				if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
				if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
				if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
				if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
			}

			var first = (ts || bs || ls || rs);

			if(o.snapMode != 'outer') {
				var ts = Math.abs(t - y1) <= d;
				var bs = Math.abs(b - y2) <= d;
				var ls = Math.abs(l - x1) <= d;
				var rs = Math.abs(r - x2) <= d;
				if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
				if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
				if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
				if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
			}

			if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))
				(inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
			inst.snapElements[i].snapping = (ts || bs || ls || rs || first);

		};

	}
});

$.ui.plugin.add("draggable", "stack", {
	start: function(event, ui) {

		var o = $(this).data("draggable").options;

		var group = $.makeArray($(o.stack.group)).sort(function(a,b) {
			return (parseInt($(a).css("zIndex"),10) || o.stack.min) - (parseInt($(b).css("zIndex"),10) || o.stack.min);
		});

		$(group).each(function(i) {
			this.style.zIndex = o.stack.min + i;
		});

		this[0].style.zIndex = o.stack.min + group.length;

	}
});

$.ui.plugin.add("draggable", "zIndex", {
	start: function(event, ui) {
		var t = $(ui.helper), o = $(this).data("draggable").options;
		if(t.css("zIndex")) o._zIndex = t.css("zIndex");
		t.css('zIndex', o.zIndex);
	},
	stop: function(event, ui) {
		var o = $(this).data("draggable").options;
		if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex);
	}
});

})(jQuery);	/*
 * jQuery UI Droppable 1.7.1
 *
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Droppables
 *
 * Depends:
 *	ui.core.js
 *	ui.draggable.js
 */
(function($) {

$.widget("ui.droppable", {

	_init: function() {

		var o = this.options, accept = o.accept;
		this.isover = 0; this.isout = 1;

		this.options.accept = this.options.accept && $.isFunction(this.options.accept) ? this.options.accept : function(d) {
			return d.is(accept);
		};

		//Store the droppable's proportions
		this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight };

		// Add the reference and positions to the manager
		$.ui.ddmanager.droppables[this.options.scope] = $.ui.ddmanager.droppables[this.options.scope] || [];
		$.ui.ddmanager.droppables[this.options.scope].push(this);

		(this.options.addClasses && this.element.addClass("ui-droppable"));

	},

	destroy: function() {
		var drop = $.ui.ddmanager.droppables[this.options.scope];
		for ( var i = 0; i < drop.length; i++ )
			if ( drop[i] == this )
				drop.splice(i, 1);

		this.element
			.removeClass("ui-droppable ui-droppable-disabled")
			.removeData("droppable")
			.unbind(".droppable");
	},

	_setData: function(key, value) {

		if(key == 'accept') {
			this.options.accept = value && $.isFunction(value) ? value : function(d) {
				return d.is(value);
			};
		} else {
			$.widget.prototype._setData.apply(this, arguments);
		}

	},

	_activate: function(event) {
		var draggable = $.ui.ddmanager.current;
		if(this.options.activeClass) this.element.addClass(this.options.activeClass);
		(draggable && this._trigger('activate', event, this.ui(draggable)));
	},

	_deactivate: function(event) {
		var draggable = $.ui.ddmanager.current;
		if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
		(draggable && this._trigger('deactivate', event, this.ui(draggable)));
	},

	_over: function(event) {

		var draggable = $.ui.ddmanager.current;
		if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element

		if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
			if(this.options.hoverClass) this.element.addClass(this.options.hoverClass);
			this._trigger('over', event, this.ui(draggable));
		}

	},

	_out: function(event) {

		var draggable = $.ui.ddmanager.current;
		if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element

		if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
			if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
			this._trigger('out', event, this.ui(draggable));
		}

	},

	_drop: function(event,custom) {

		var draggable = custom || $.ui.ddmanager.current;
		if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element

		var childrenIntersection = false;
		this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() {
			var inst = $.data(this, 'droppable');
			if(inst.options.greedy && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)) {
				childrenIntersection = true; return false;
			}
		});
		if(childrenIntersection) return false;

		if(this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
			if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
			if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
			this._trigger('drop', event, this.ui(draggable));
			return this.element;
		}

		return false;

	},

	ui: function(c) {
		return {
			draggable: (c.currentItem || c.element),
			helper: c.helper,
			position: c.position,
			absolutePosition: c.positionAbs, //deprecated
			offset: c.positionAbs
		};
	}

});

$.extend($.ui.droppable, {
	version: "1.7.1",
	eventPrefix: 'drop',
	defaults: {
		accept: '*',
		activeClass: false,
		addClasses: true,
		greedy: false,
		hoverClass: false,
		scope: 'default',
		tolerance: 'intersect'
	}
});

$.ui.intersect = function(draggable, droppable, toleranceMode) {

	if (!droppable.offset) return false;

	var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,
		y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;
	var l = droppable.offset.left, r = l + droppable.proportions.width,
		t = droppable.offset.top, b = t + droppable.proportions.height;

	switch (toleranceMode) {
		case 'fit':
			return (l < x1 && x2 < r
				&& t < y1 && y2 < b);
			break;
		case 'intersect':
			return (l < x1 + (draggable.helperProportions.width / 2) // Right Half
				&& x2 - (draggable.helperProportions.width / 2) < r // Left Half
				&& t < y1 + (draggable.helperProportions.height / 2) // Bottom Half
				&& y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
			break;
		case 'pointer':
			var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left),
				draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top),
				isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width);
			return isOver;
			break;
		case 'touch':
			return (
					(y1 >= t && y1 <= b) ||	// Top edge touching
					(y2 >= t && y2 <= b) ||	// Bottom edge touching
					(y1 < t && y2 > b)		// Surrounded vertically
				) && (
					(x1 >= l && x1 <= r) ||	// Left edge touching
					(x2 >= l && x2 <= r) ||	// Right edge touching
					(x1 < l && x2 > r)		// Surrounded horizontally
				);
			break;
		default:
			return false;
			break;
		}

};

/*
	This manager tracks offsets of draggables and droppables
*/
$.ui.ddmanager = {
	current: null,
	droppables: { 'default': [] },
	prepareOffsets: function(t, event) {

		var m = $.ui.ddmanager.droppables[t.options.scope];
		var type = event ? event.type : null; // workaround for #2317
		var list = (t.currentItem || t.element).find(":data(droppable)").andSelf();

		droppablesLoop: for (var i = 0; i < m.length; i++) {

			if(m[i].options.disabled || (t && !m[i].options.accept.call(m[i].element[0],(t.currentItem || t.element)))) continue;	//No disabled and non-accepted
			for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item
			m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; 									//If the element is not visible, continue

			m[i].offset = m[i].element.offset();
			m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };

			if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables

		}

	},
	drop: function(draggable, event) {

		var dropped = false;
		$.each($.ui.ddmanager.droppables[draggable.options.scope], function() {

			if(!this.options) return;
			if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance))
				dropped = this._drop.call(this, event);

			if (!this.options.disabled && this.visible && this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
				this.isout = 1; this.isover = 0;
				this._deactivate.call(this, event);
			}

		});
		return dropped;

	},
	drag: function(draggable, event) {

		//If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
		if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event);

		//Run through all droppables and check their positions based on specific tolerance options

		$.each($.ui.ddmanager.droppables[draggable.options.scope], function() {

			if(this.options.disabled || this.greedyChild || !this.visible) return;
			var intersects = $.ui.intersect(draggable, this, this.options.tolerance);

			var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null);
			if(!c) return;

			var parentInstance;
			if (this.options.greedy) {
				var parent = this.element.parents(':data(droppable):eq(0)');
				if (parent.length) {
					parentInstance = $.data(parent[0], 'droppable');
					parentInstance.greedyChild = (c == 'isover' ? 1 : 0);
				}
			}

			// we just moved into a greedy child
			if (parentInstance && c == 'isover') {
				parentInstance['isover'] = 0;
				parentInstance['isout'] = 1;
				parentInstance._out.call(parentInstance, event);
			}

			this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0;
			this[c == "isover" ? "_over" : "_out"].call(this, event);

			// we just moved out of a greedy child
			if (parentInstance && c == 'isout') {
				parentInstance['isout'] = 0;
				parentInstance['isover'] = 1;
				parentInstance._over.call(parentInstance, event);
			}
		});

	}
};

})(jQuery);	/*
 * jQuery UI Resizable 1.7.1
 *
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Resizables
 *
 * Depends:
 *	ui.core.js
 */
(function($) {

$.widget("ui.resizable", $.extend({}, $.ui.mouse, {

	_init: function() {

		var self = this, o = this.options;
		this.element.addClass("ui-resizable");

		$.extend(this, {
			_aspectRatio: !!(o.aspectRatio),
			aspectRatio: o.aspectRatio,
			originalElement: this.element,
			_proportionallyResizeElements: [],
			_helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null
		});

		//Wrap the element if it cannot hold child nodes
		if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {

			//Opera fix for relative positioning
			if (/relative/.test(this.element.css('position')) && $.browser.opera)
				this.element.css({ position: 'relative', top: 'auto', left: 'auto' });

			//Create a wrapper element and set the wrapper to the new current internal element
			this.element.wrap(
				$('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({
					position: this.element.css('position'),
					width: this.element.outerWidth(),
					height: this.element.outerHeight(),
					top: this.element.css('top'),
					left: this.element.css('left')
				})
			);

			//Overwrite the original this.element
			this.element = this.element.parent().data(
				"resizable", this.element.data('resizable')
			);

			this.elementIsWrapper = true;

			//Move margins to the wrapper
			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});

			//Prevent Safari textarea resize
			this.originalResizeStyle = this.originalElement.css('resize');
			this.originalElement.css('resize', 'none');

			//Push the actual element to our proportionallyResize internal array
			this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' }));

			// avoid IE jump (hard set the margin)
			this.originalElement.css({ margin: this.originalElement.css('margin') });

			// fix handlers offset
			this._proportionallyResize();

		}

		this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' });
		if(this.handles.constructor == String) {

			if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw';
			var n = this.handles.split(","); this.handles = {};

			for(var i = 0; i < n.length; i++) {

				var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle;
				var axis = $('<div class="ui-resizable-handle ' + hname + '"></div>');

				// increase zIndex of sw, se, ne, nw axis
				//TODO : this modifies original option
				if(/sw|se|ne|nw/.test(handle)) axis.css({ zIndex: ++o.zIndex });

				//TODO : What's going on here?
				if ('se' == handle) {
					axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se');
				};

				//Insert into internal handles object and append to element
				this.handles[handle] = '.ui-resizable-'+handle;
				this.element.append(axis);
			}

		}

		this._renderAxis = function(target) {

			target = target || this.element;

			for(var i in this.handles) {

				if(this.handles[i].constructor == String)
					this.handles[i] = $(this.handles[i], this.element).show();

				//Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
				if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {

					var axis = $(this.handles[i], this.element), padWrapper = 0;

					//Checking the correct pad and border
					padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();

					//The padding type i have to apply...
					var padPos = [ 'padding',
						/ne|nw|n/.test(i) ? 'Top' :
						/se|sw|s/.test(i) ? 'Bottom' :
						/^e$/.test(i) ? 'Right' : 'Left' ].join("");

					target.css(padPos, padWrapper);

					this._proportionallyResize();

				}

				//TODO: What's that good for? There's not anything to be executed left
				if(!$(this.handles[i]).length)
					continue;

			}
		};

		//TODO: make renderAxis a prototype function
		this._renderAxis(this.element);

		this._handles = $('.ui-resizable-handle', this.element)
			.disableSelection();

		//Matching axis name
		this._handles.mouseover(function() {
			if (!self.resizing) {
				if (this.className)
					var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
				//Axis, default = se
				self.axis = axis && axis[1] ? axis[1] : 'se';
			}
		});

		//If we want to auto hide the elements
		if (o.autoHide) {
			this._handles.hide();
			$(this.element)
				.addClass("ui-resizable-autohide")
				.hover(function() {
					$(this).removeClass("ui-resizable-autohide");
					self._handles.show();
				},
				function(){
					if (!self.resizing) {
						$(this).addClass("ui-resizable-autohide");
						self._handles.hide();
					}
				});
		}

		//Initialize the mouse interaction
		this._mouseInit();

	},

	destroy: function() {

		this._mouseDestroy();

		var _destroy = function(exp) {
			$(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
				.removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();
		};

		//TODO: Unwrap at same DOM position
		if (this.elementIsWrapper) {
			_destroy(this.element);
			var wrapper = this.element;
			wrapper.parent().append(
				this.originalElement.css({
					position: wrapper.css('position'),
					width: wrapper.outerWidth(),
					height: wrapper.outerHeight(),
					top: wrapper.css('top'),
					left: wrapper.css('left')
				})
			).end().remove();
		}

		this.originalElement.css('resize', this.originalResizeStyle);
		_destroy(this.originalElement);

	},

	_mouseCapture: function(event) {

		var handle = false;
		for(var i in this.handles) {
			if($(this.handles[i])[0] == event.target) handle = true;
		}

		return this.options.disabled || !!handle;

	},

	_mouseStart: function(event) {

		var o = this.options, iniPos = this.element.position(), el = this.element;

		this.resizing = true;
		this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() };

		// bugfix for http://dev.jquery.com/ticket/1749
		if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) {
			el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left });
		}

		//Opera fixing relative position
		if ($.browser.opera && (/relative/).test(el.css('position')))
			el.css({ position: 'relative', top: 'auto', left: 'auto' });

		this._renderProxy();

		var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top'));

		if (o.containment) {
			curleft += $(o.containment).scrollLeft() || 0;
			curtop += $(o.containment).scrollTop() || 0;
		}

		//Store needed variables
		this.offset = this.helper.offset();
		this.position = { left: curleft, top: curtop };
		this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
		this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
		this.originalPosition = { left: curleft, top: curtop };
		this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };
		this.originalMousePosition = { left: event.pageX, top: event.pageY };

		//Aspect Ratio
		this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1);

	    var cursor = $('.ui-resizable-' + this.axis).css('cursor');
	    $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor);

		el.addClass("ui-resizable-resizing");
		this._propagate("start", event);
		return true;
	},

	_mouseDrag: function(event) {

		//Increase performance, avoid regex
		var el = this.helper, o = this.options, props = {},
			self = this, smp = this.originalMousePosition, a = this.axis;

		var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0;
		var trigger = this._change[a];
		if (!trigger) return false;

		// Calculate the attrs that will be change
		var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff;

		if (this._aspectRatio || event.shiftKey)
			data = this._updateRatio(data, event);

		data = this._respectSize(data, event);

		// plugins callbacks need to be called first
		this._propagate("resize", event);

		el.css({
			top: this.position.top + "px", left: this.position.left + "px",
			width: this.size.width + "px", height: this.size.height + "px"
		});

		if (!this._helper && this._proportionallyResizeElements.length)
			this._proportionallyResize();

		this._updateCache(data);

		// calling the user callback at the end
		this._trigger('resize', event, this.ui());

		return false;
	},

	_mouseStop: function(event) {

		this.resizing = false;
		var o = this.options, self = this;

		if(this._helper) {
			var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
						soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
							soffsetw = ista ? 0 : self.sizeDiff.width;

			var s = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
				left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
				top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;

			if (!o.animate)
				this.element.css($.extend(s, { top: top, left: left }));

			self.helper.height(self.size.height);
			self.helper.width(self.size.width);

			if (this._helper && !o.animate) this._proportionallyResize();
		}

		$('body').css('cursor', 'auto');

		this.element.removeClass("ui-resizable-resizing");

		this._propagate("stop", event);

		if (this._helper) this.helper.remove();
		return false;

	},

	_updateCache: function(data) {
		var o = this.options;
		this.offset = this.helper.offset();
		if (isNumber(data.left)) this.position.left = data.left;
		if (isNumber(data.top)) this.position.top = data.top;
		if (isNumber(data.height)) this.size.height = data.height;
		if (isNumber(data.width)) this.size.width = data.width;
	},

	_updateRatio: function(data, event) {

		var o = this.options, cpos = this.position, csize = this.size, a = this.axis;

		if (data.height) data.width = (csize.height * this.aspectRatio);
		else if (data.width) data.height = (csize.width / this.aspectRatio);

		if (a == 'sw') {
			data.left = cpos.left + (csize.width - data.width);
			data.top = null;
		}
		if (a == 'nw') {
			data.top = cpos.top + (csize.height - data.height);
			data.left = cpos.left + (csize.width - data.width);
		}

		return data;
	},

	_respectSize: function(data, event) {

		var el = this.helper, o = this.options, pRatio = this._aspectRatio || event.shiftKey, a = this.axis,
				ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
					isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height);

		if (isminw) data.width = o.minWidth;
		if (isminh) data.height = o.minHeight;
		if (ismaxw) data.width = o.maxWidth;
		if (ismaxh) data.height = o.maxHeight;

		var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height;
		var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);

		if (isminw && cw) data.left = dw - o.minWidth;
		if (ismaxw && cw) data.left = dw - o.maxWidth;
		if (isminh && ch)	data.top = dh - o.minHeight;
		if (ismaxh && ch)	data.top = dh - o.maxHeight;

		// fixing jump error on top/left - bug #2330
		var isNotwh = !data.width && !data.height;
		if (isNotwh && !data.left && data.top) data.top = null;
		else if (isNotwh && !data.top && data.left) data.left = null;

		return data;
	},

	_proportionallyResize: function() {

		var o = this.options;
		if (!this._proportionallyResizeElements.length) return;
		var element = this.helper || this.element;

		for (var i=0; i < this._proportionallyResizeElements.length; i++) {

			var prel = this._proportionallyResizeElements[i];

			if (!this.borderDif) {
				var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')],
					p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')];

				this.borderDif = $.map(b, function(v, i) {
					var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0;
					return border + padding;
				});
			}

			if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length)))
				continue;

			prel.css({
				height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,
				width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0
			});

		};

	},

	_renderProxy: function() {

		var el = this.element, o = this.options;
		this.elementOffset = el.offset();

		if(this._helper) {

			this.helper = this.helper || $('<div style="overflow:hidden;"></div>');

			// fix ie6 offset TODO: This seems broken
			var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0),
			pxyoffset = ( ie6 ? 2 : -1 );

			this.helper.addClass(this._helper).css({
				width: this.element.outerWidth() + pxyoffset,
				height: this.element.outerHeight() + pxyoffset,
				position: 'absolute',
				left: this.elementOffset.left - ie6offset +'px',
				top: this.elementOffset.top - ie6offset +'px',
				zIndex: ++o.zIndex //TODO: Don't modify option
			});

			this.helper
				.appendTo("body")
				.disableSelection();

		} else {
			this.helper = this.element;
		}

	},

	_change: {
		e: function(event, dx, dy) {
			return { width: this.originalSize.width + dx };
		},
		w: function(event, dx, dy) {
			var o = this.options, cs = this.originalSize, sp = this.originalPosition;
			return { left: sp.left + dx, width: cs.width - dx };
		},
		n: function(event, dx, dy) {
			var o = this.options, cs = this.originalSize, sp = this.originalPosition;
			return { top: sp.top + dy, height: cs.height - dy };
		},
		s: function(event, dx, dy) {
			return { height: this.originalSize.height + dy };
		},
		se: function(event, dx, dy) {
			return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
		},
		sw: function(event, dx, dy) {
			return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
		},
		ne: function(event, dx, dy) {
			return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
		},
		nw: function(event, dx, dy) {
			return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
		}
	},

	_propagate: function(n, event) {
		$.ui.plugin.call(this, n, [event, this.ui()]);
		(n != "resize" && this._trigger(n, event, 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
		};
	}

}));

$.extend($.ui.resizable, {
	version: "1.7.1",
	eventPrefix: "resize",
	defaults: {
		alsoResize: false,
		animate: false,
		animateDuration: "slow",
		animateEasing: "swing",
		aspectRatio: false,
		autoHide: false,
		cancel: ":input,option",
		containment: false,
		delay: 0,
		distance: 1,
		ghost: false,
		grid: false,
		handles: "e,s,se",
		helper: false,
		maxHeight: null,
		maxWidth: null,
		minHeight: 10,
		minWidth: 10,
		zIndex: 1000
	}
});

/*
 * Resizable Extensions
 */

$.ui.plugin.add("resizable", "alsoResize", {

	start: function(event, ui) {

		var self = $(this).data("resizable"), o = self.options;

		_store = function(exp) {
			$(exp).each(function() {
				$(this).data("resizable-alsoresize", {
					width: parseInt($(this).width(), 10), height: parseInt($(this).height(), 10),
					left: parseInt($(this).css('left'), 10), top: parseInt($(this).css('top'), 10)
				});
			});
		};

		if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) {
			if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0];	_store(o.alsoResize); }
			else { $.each(o.alsoResize, function(exp, c) { _store(exp); }); }
		}else{
			_store(o.alsoResize);
		}
	},

	resize: function(event, ui){
		var self = $(this).data("resizable"), o = self.options, os = self.originalSize, op = self.originalPosition;

		var delta = {
			height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0,
			top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0
		},

		_alsoResize = function(exp, c) {
			$(exp).each(function() {
				var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, css = c && c.length ? c : ['width', 'height', 'top', 'left'];

				$.each(css || ['width', 'height', 'top', 'left'], function(i, prop) {
					var sum = (start[prop]||0) + (delta[prop]||0);
					if (sum && sum >= 0)
						style[prop] = sum || null;
				});

				//Opera fixing relative position
				if (/relative/.test(el.css('position')) && $.browser.opera) {
					self._revertToRelativePosition = true;
					el.css({ position: 'absolute', top: 'auto', left: 'auto' });
				}

				el.css(style);
			});
		};

		if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) {
			$.each(o.alsoResize, function(exp, c) { _alsoResize(exp, c); });
		}else{
			_alsoResize(o.alsoResize);
		}
	},

	stop: function(event, ui){
		var self = $(this).data("resizable");

		//Opera fixing relative position
		if (self._revertToRelativePosition && $.browser.opera) {
			self._revertToRelativePosition = false;
			el.css({ position: 'relative' });
		}

		$(this).removeData("resizable-alsoresize-start");
	}
});

$.ui.plugin.add("resizable", "animate", {

	stop: function(event, ui) {
		var self = $(this).data("resizable"), o = self.options;

		var pr = self._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
					soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
						soffsetw = ista ? 0 : self.sizeDiff.width;

		var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
					left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
						top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;

		self.element.animate(
			$.extend(style, top && left ? { top: top, left: left } : {}), {
				duration: o.animateDuration,
				easing: o.animateEasing,
				step: function() {

					var data = {
						width: parseInt(self.element.css('width'), 10),
						height: parseInt(self.element.css('height'), 10),
						top: parseInt(self.element.css('top'), 10),
						left: parseInt(self.element.css('left'), 10)
					};

					if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height });

					// propagating resize, and updating values for each animation step
					self._updateCache(data);
					self._propagate("resize", event);

				}
			}
		);
	}

});

$.ui.plugin.add("resizable", "containment", {

	start: function(event, ui) {
		var self = $(this).data("resizable"), o = self.options, el = self.element;
		var oc = o.containment,	ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;
		if (!ce) return;

		self.containerElement = $(ce);

		if (/document/.test(oc) || oc == document) {
			self.containerOffset = { left: 0, top: 0 };
			self.containerPosition = { left: 0, top: 0 };

			self.parentData = {
				element: $(document), left: 0, top: 0,
				width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight
			};
		}

		// i'm a node, so compute top, left, right, bottom
		else {
			var element = $(ce), p = [];
			$([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); });

			self.containerOffset = element.offset();
			self.containerPosition = element.position();
			self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) };

			var co = self.containerOffset, ch = self.containerSize.height,	cw = self.containerSize.width,
						width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);

			self.parentData = {
				element: ce, left: co.left, top: co.top, width: width, height: height
			};
		}
	},

	resize: function(event, ui) {
		var self = $(this).data("resizable"), o = self.options,
				ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position,
				pRatio = self._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement;

		if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co;

		if (cp.left < (self._helper ? co.left : 0)) {
			self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left));
			if (pRatio) self.size.height = self.size.width / o.aspectRatio;
			self.position.left = o.helper ? co.left : 0;
		}

		if (cp.top < (self._helper ? co.top : 0)) {
			self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top);
			if (pRatio) self.size.width = self.size.height * o.aspectRatio;
			self.position.top = self._helper ? co.top : 0;
		}

		self.offset.left = self.parentData.left+self.position.left;
		self.offset.top = self.parentData.top+self.position.top;

		var woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ),
					hoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height );

		var isParent = self.containerElement.get(0) == self.element.parent().get(0),
		    isOffsetRelative = /relative|absolute/.test(self.containerElement.css('position'));

		if(isParent && isOffsetRelative) woset -= self.parentData.left;

		if (woset + self.size.width >= self.parentData.width) {
			self.size.width = self.parentData.width - woset;
			if (pRatio) self.size.height = self.size.width / self.aspectRatio;
		}

		if (hoset + self.size.height >= self.parentData.height) {
			self.size.height = self.parentData.height - hoset;
			if (pRatio) self.size.width = self.size.height * self.aspectRatio;
		}
	},

	stop: function(event, ui){
		var self = $(this).data("resizable"), o = self.options, cp = self.position,
				co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement;

		var helper = $(self.helper), ho = helper.offset(), w = helper.outerWidth() - self.sizeDiff.width, h = helper.outerHeight() - self.sizeDiff.height;

		if (self._helper && !o.animate && (/relative/).test(ce.css('position')))
			$(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });

		if (self._helper && !o.animate && (/static/).test(ce.css('position')))
			$(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });

	}
});

$.ui.plugin.add("resizable", "ghost", {

	start: function(event, ui) {

		var self = $(this).data("resizable"), o = self.options, cs = self.size;

		self.ghost = self.originalElement.clone();
		self.ghost
			.css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 })
			.addClass('ui-resizable-ghost')
			.addClass(typeof o.ghost == 'string' ? o.ghost : '');

		self.ghost.appendTo(self.helper);

	},

	resize: function(event, ui){
		var self = $(this).data("resizable"), o = self.options;
		if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width });
	},

	stop: function(event, ui){
		var self = $(this).data("resizable"), o = self.options;
		if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0));
	}

});

$.ui.plugin.add("resizable", "grid", {

	resize: function(event, ui) {
		var self = $(this).data("resizable"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey;
		o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid;
		var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1);

		if (/^(se|s|e)$/.test(a)) {
			self.size.width = os.width + ox;
			self.size.height = os.height + oy;
		}
		else if (/^(ne)$/.test(a)) {
			self.size.width = os.width + ox;
			self.size.height = os.height + oy;
			self.position.top = op.top - oy;
		}
		else if (/^(sw)$/.test(a)) {
			self.size.width = os.width + ox;
			self.size.height = os.height + oy;
			self.position.left = op.left - ox;
		}
		else {
			self.size.width = os.width + ox;
			self.size.height = os.height + oy;
			self.position.top = op.top - oy;
			self.position.left = op.left - ox;
		}
	}

});

var num = function(v) {
	return parseInt(v, 10) || 0;
};

var isNumber = function(value) {
	return !isNaN(parseInt(value, 10));
};

})(jQuery);	/*
 * jQuery UI Selectable 1.7.1
 *
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Selectables
 *
 * Depends:
 *	ui.core.js
 */
(function($) {

$.widget("ui.selectable", $.extend({}, $.ui.mouse, {

	_init: function() {
		var self = this;

		this.element.addClass("ui-selectable");

		this.dragged = false;

		// cache selectee children based on filter
		var selectees;
		this.refresh = function() {
			selectees = $(self.options.filter, self.element[0]);
			selectees.each(function() {
				var $this = $(this);
				var pos = $this.offset();
				$.data(this, "selectable-item", {
					element: this,
					$element: $this,
					left: pos.left,
					top: pos.top,
					right: pos.left + $this.outerWidth(),
					bottom: pos.top + $this.outerHeight(),
					startselected: false,
					selected: $this.hasClass('ui-selected'),
					selecting: $this.hasClass('ui-selecting'),
					unselecting: $this.hasClass('ui-unselecting')
				});
			});
		};
		this.refresh();

		this.selectees = selectees.addClass("ui-selectee");

		this._mouseInit();

		this.helper = $(document.createElement('div'))
			.css({border:'1px dotted black'})
			.addClass("ui-selectable-helper");
	},

	destroy: function() {
		this.element
			.removeClass("ui-selectable ui-selectable-disabled")
			.removeData("selectable")
			.unbind(".selectable");
		this._mouseDestroy();
	},

	_mouseStart: function(event) {
		var self = this;

		this.opos = [event.pageX, event.pageY];

		if (this.options.disabled)
			return;

		var options = this.options;

		this.selectees = $(options.filter, this.element[0]);

		this._trigger("start", event);

		$(options.appendTo).append(this.helper);
		// position helper (lasso)
		this.helper.css({
			"z-index": 100,
			"position": "absolute",
			"left": event.clientX,
			"top": event.clientY,
			"width": 0,
			"height": 0
		});

		if (options.autoRefresh) {
			this.refresh();
		}

		this.selectees.filter('.ui-selected').each(function() {
			var selectee = $.data(this, "selectable-item");
			selectee.startselected = true;
			if (!event.metaKey) {
				selectee.$element.removeClass('ui-selected');
				selectee.selected = false;
				selectee.$element.addClass('ui-unselecting');
				selectee.unselecting = true;
				// selectable UNSELECTING callback
				self._trigger("unselecting", event, {
					unselecting: selectee.element
				});
			}
		});

		$(event.target).parents().andSelf().each(function() {
			var selectee = $.data(this, "selectable-item");
			if (selectee) {
				selectee.$element.removeClass("ui-unselecting").addClass('ui-selecting');
				selectee.unselecting = false;
				selectee.selecting = true;
				selectee.selected = true;
				// selectable SELECTING callback
				self._trigger("selecting", event, {
					selecting: selectee.element
				});
				return false;
			}
		});

	},

	_mouseDrag: function(event) {
		var self = this;
		this.dragged = true;

		if (this.options.disabled)
			return;

		var options = this.options;

		var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY;
		if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; }
		if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; }
		this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1});

		this.selectees.each(function() {
			var selectee = $.data(this, "selectable-item");
			//prevent helper from being selected if appendTo: selectable
			if (!selectee || selectee.element == self.element[0])
				return;
			var hit = false;
			if (options.tolerance == 'touch') {
				hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
			} else if (options.tolerance == 'fit') {
				hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
			}

			if (hit) {
				// SELECT
				if (selectee.selected) {
					selectee.$element.removeClass('ui-selected');
					selectee.selected = false;
				}
				if (selectee.unselecting) {
					selectee.$element.removeClass('ui-unselecting');
					selectee.unselecting = false;
				}
				if (!selectee.selecting) {
					selectee.$element.addClass('ui-selecting');
					selectee.selecting = true;
					// selectable SELECTING callback
					self._trigger("selecting", event, {
						selecting: selectee.element
					});
				}
			} else {
				// UNSELECT
				if (selectee.selecting) {
					if (event.metaKey && selectee.startselected) {
						selectee.$element.removeClass('ui-selecting');
						selectee.selecting = false;
						selectee.$element.addClass('ui-selected');
						selectee.selected = true;
					} else {
						selectee.$element.removeClass('ui-selecting');
						selectee.selecting = false;
						if (selectee.startselected) {
							selectee.$element.addClass('ui-unselecting');
							selectee.unselecting = true;
						}
						// selectable UNSELECTING callback
						self._trigger("unselecting", event, {
							unselecting: selectee.element
						});
					}
				}
				if (selectee.selected) {
					if (!event.metaKey && !selectee.startselected) {
						selectee.$element.removeClass('ui-selected');
						selectee.selected = false;

						selectee.$element.addClass('ui-unselecting');
						selectee.unselecting = true;
						// selectable UNSELECTING callback
						self._trigger("unselecting", event, {
							unselecting: selectee.element
						});
					}
				}
			}
		});

		return false;
	},

	_mouseStop: function(event) {
		var self = this;

		this.dragged = false;

		var options = this.options;

		$('.ui-unselecting', this.element[0]).each(function() {
			var selectee = $.data(this, "selectable-item");
			selectee.$element.removeClass('ui-unselecting');
			selectee.unselecting = false;
			selectee.startselected = false;
			self._trigger("unselected", event, {
				unselected: selectee.element
			});
		});
		$('.ui-selecting', this.element[0]).each(function() {
			var selectee = $.data(this, "selectable-item");
			selectee.$element.removeClass('ui-selecting').addClass('ui-selected');
			selectee.selecting = false;
			selectee.selected = true;
			selectee.startselected = true;
			self._trigger("selected", event, {
				selected: selectee.element
			});
		});
		this._trigger("stop", event);

		this.helper.remove();

		return false;
	}

}));

$.extend($.ui.selectable, {
	version: "1.7.1",
	defaults: {
		appendTo: 'body',
		autoRefresh: true,
		cancel: ":input,option",
		delay: 0,
		distance: 0,
		filter: '*',
		tolerance: 'touch'
	}
});

})(jQuery);	/*
 * jQuery UI Sortable 1.7.1
 *
 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Sortables
 *
 * Depends:
 *	ui.core.js
 */
(function($) {

$.widget("ui.sortable", $.extend({}, $.ui.mouse, {
	_init: function() {

		var o = this.options;
		this.containerCache = {};
		this.element.addClass("ui-sortable");

		//Get the items
		this.refresh();

		//Let's determine if the items are floating
		this.floating = this.items.length ? (/left|right/).test(this.items[0].item.css('float')) : false;

		//Let's determine the parent's offset
		this.offset = this.element.offset();

		//Initialize mouse events for interaction
		this._mouseInit();

	},

	destroy: function() {
		this.element
			.removeClass("ui-sortable ui-sortable-disabled")
			.removeData("sortable")
			.unbind(".sortable");
		this._mouseDestroy();

		for ( var i = this.items.length - 1; i >= 0; i-- )
			this.items[i].item.removeData("sortable-item");
	},

	_mouseCapture: function(event, overrideHandle) {

		if (this.reverting) {
			return false;
		}

		if(this.options.disabled || this.options.type == 'static') return false;

		//We have to refresh the items data once first
		this._refreshItems(event);

		//Find out if the clicked node (or one of its parents) is a actual item in this.items
		var currentItem = null, self = this, nodes = $(event.target).parents().each(function() {
			if($.data(this, 'sortable-item') == self) {
				currentItem = $(this);
				return false;
			}
		});
		if($.data(event.target, 'sortable-item') == self) currentItem = $(event.target);

		if(!currentItem) return false;
		if(this.options.handle && !overrideHandle) {
			var validHandle = false;

			$(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == event.target) validHandle = true; });
			if(!validHandle) return false;
		}

		this.currentItem = currentItem;
		this._removeCurrentsFromItems();
		return true;

	},

	_mouseStart: function(event, overrideHandle, noActivation) {

		var o = this.options, self = this;
		this.currentContainer = this;

		//We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
		this.refreshPositions();

		//Create and append the visible helper
		this.helper = this._createHelper(event);

		//Cache the helper size
		this._cacheHelperProportions();

		/*
		 * - Position generation -
		 * This block generates everything position related - it's the core of draggables.
		 */

		//Cache the margins of the original element
		this._cacheMargins();

		//Get the next scrolling parent
		this.scrollParent = this.helper.scrollParent();

		//The element's absolute position on the page minus margins
		this.offset = this.currentItem.offset();
		this.offset = {
			top: this.offset.top - this.margins.top,
			left: this.offset.left - this.margins.left
		};

		// Only after we got the offset, we can change the helper's position to absolute
		// TODO: Still need to figure out a way to make relative sorting possible
		this.helper.css("position", "absolute");
		this.cssPosition = this.helper.css("position");

		$.extend(this.offset, {
			click: { //Where the click happened, relative to the element
				left: event.pageX - this.offset.left,
				top: event.pageY - this.offset.top
			},
			parent: this._getParentOffset(),
			relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
		});

		//Generate the original position
		this.originalPosition = this._generatePosition(event);
		this.originalPageX = event.pageX;
		this.originalPageY = event.pageY;

		//Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
		if(o.cursorAt)
			this._adjustOffsetFromHelper(o.cursorAt);

		//Cache the former DOM position
		this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };

		//If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way
		if(this.helper[0] != this.currentItem[0]) {
			this.currentItem.hide();
		}

		//Create the placeholder
		this._createPlaceholder();

		//Set a containment if given in the options
		if(o.containment)
			this._setContainment();

		if(o.cursor) { // cursor option
			if ($('body').css("cursor")) this._storedCursor = $('body').css("cursor");
			$('body').css("cursor", o.cursor);
		}

		if(o.opacity) { // opacity option
			if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity");
			this.helper.css("opacity", o.opacity);
		}

		if(o.zIndex) { // zIndex option
			if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex");
			this.helper.css("zIndex", o.zIndex);
		}

		//Prepare scrolling
		if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML')
			this.overflowOffset = this.scrollParent.offset();

		//Call callbacks
		this._trigger("start", event, this._uiHash());

		//Recache the helper size
		if(!this._preserveHelperProportions)
			this._cacheHelperProportions();


		//Post 'activate' events to possible containers
		if(!noActivation) {
			 for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, self._uiHash(this)); }
		}

		//Prepare possible droppables
		if($.ui.ddmanager)
			$.ui.ddmanager.current = this;

		if ($.ui.ddmanager && !o.dropBehaviour)
			$.ui.ddmanager.prepareOffsets(this, event);

		this.dragging = true;

		this.helper.addClass("ui-sortable-helper");
		this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position
		return true;

	},

	_mouseDrag: function(event) {

		//Compute the helpers position
		this.position = this._generatePosition(event);
		this.positionAbs = this._convertPositionTo("absolute");

		if (!this.lastPositionAbs) {
			this.lastPositionAbs = this.positionAbs;
		}

		//Do scrolling
		if(this.options.scroll) {
			var o = this.options, scrolled = false;
			if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') {

				if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
					this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
				else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)
					this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;

				if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
					this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
				else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)
					this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;

			} else {

				if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
					scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
				else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
					scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);

				if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
					scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
				else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
					scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);

			}

			if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
				$.ui.ddmanager.prepareOffsets(this, event);
		}

		//Regenerate the absolute position used for position checks
		this.positionAbs = this._convertPositionTo("absolute");

		//Set the helper 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';

		//Rearrange
		for (var i = this.items.length - 1; i >= 0; i--) {

			//Cache variables and intersection, continue if no intersection
			var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item);
			if (!intersection) continue;

			if(itemElement != this.currentItem[0] //cannot intersect with itself
				&&	this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before
				&&	!$.ui.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked
				&& (this.options.type == 'semi-dynamic' ? !$.ui.contains(this.element[0], itemElement) : true)
			) {

				this.direction = intersection == 1 ? "down" : "up";

				if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) {
					this._rearrange(event, item);
				} else {
					break;
				}

				this._trigger("change", event, this._uiHash());
				break;
			}
		}

		//Post events to containers
		this._contactContainers(event);

		//Interconnect with droppables
		if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);

		//Call callbacks
		this._trigger('sort', event, this._uiHash());

		this.lastPositionAbs = this.positionAbs;
		return false;

	},

	_mouseStop: function(event, noPropagation) {

		if(!event) return;

		//If we are using droppables, inform the manager about the drop
		if ($.ui.ddmanager && !this.options.dropBehaviour)
			$.ui.ddmanager.drop(this, event);

		if(this.options.revert) {
			var self = this;
			var cur = self.placeholder.offset();

			self.reverting = true;

			$(this.helper).animate({
				left: cur.left - this.offset.parent.left - self.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),
				top: cur.top - this.offset.parent.top - self.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)
			}, parseInt(this.options.revert, 10) || 500, function() {
				self._clear(event);
			});
		} else {
			this._clear(event, noPropagation);
		}

		return false;

	},

	cancel: function() {

		var self = this;

		if(this.dragging) {

			this._mouseUp();

			if(this.options.helper == "original")
				this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
			else
				this.currentItem.show();

			//Post deactivating events to containers
			for (var i = this.containers.length - 1; i >= 0; i--){
				this.containers[i]._trigger("deactivate", null, self._uiHash(this));
				if(this.containers[i].containerCache.over) {
					this.containers[i]._trigger("out", null, self._uiHash(this));
					this.containers[i].containerCache.over = 0;
				}
			}

		}

		//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
		if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
		if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove();

		$.extend(this, {
			helper: null,
			dragging: false,
			reverting: false,
			_noFinalSort: null
		});

		if(this.domPosition.prev) {
			$(this.domPosition.prev).after(this.currentItem);
		} else {
			$(this.domPosition.parent).prepend(this.currentItem);
		}

		return true;

	},

	serialize: function(o) {

		var items = this._getItemsAsjQuery(o && o.connected);
		var str = []; o = o || {};

		$(items).each(function() {
			var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
			if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));
		});

		return str.join('&');

	},

	toArray: function(o) {

		var items = this._getItemsAsjQuery(o && o.connected);
		var ret = []; o = o || {};

		items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); });
		return ret;

	},

	/* Be careful with the following core functions */
	_intersectsWith: function(item) {

		var x1 = this.positionAbs.left,
			x2 = x1 + this.helperProportions.width,
			y1 = this.positionAbs.top,
			y2 = y1 + this.helperProportions.height;

		var l = item.left,
			r = l + item.width,
			t = item.top,
			b = t + item.height;

		var dyClick = this.offset.click.top,
			dxClick = this.offset.click.left;

		var isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r;

		if(	   this.options.tolerance == "pointer"
			|| this.options.forcePointerForContainers
			|| (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])
		) {
			return isOverElement;
		} else {

			return (l < x1 + (this.helperProportions.width / 2) // Right Half
				&& x2 - (this.helperProportions.width / 2) < r // Left Half
				&& t < y1 + (this.helperProportions.height / 2) // Bottom Half
				&& y2 - (this.helperProportions.height / 2) < b ); // Top Half

		}
	},

	_intersectsWithPointer: function(item) {

		var isOverElementHeight = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
			isOverElementWidth = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
			isOverElement = isOverElementHeight && isOverElementWidth,
			verticalDirection = this._getDragVerticalDirection(),
			horizontalDirection = this._getDragHorizontalDirection();

		if (!isOverElement)
			return false;

		return this.floating ?
			( ((horizontalDirection && horizontalDirection == "right") || verticalDirection == "down") ? 2 : 1 )
			: ( verticalDirection && (verticalDirection == "down" ? 2 : 1) );

	},

	_intersectsWithSides: function(item) {

		var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
			isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
			verticalDirection = this._getDragVerticalDirection(),
			horizontalDirection = this._getDragHorizontalDirection();

		if (this.floating && horizontalDirection) {
			return ((horizontalDirection == "right" && isOverRightHalf) || (horizontalDirection == "left" && !isOverRightHalf));
		} else {
			return verticalDirection && ((verticalDirection == "down" && isOverBottomHalf) || (verticalDirection == "up" && !isOverBottomHalf));
		}

	},

	_getDragVerticalDirection: function() {
		var delta = this.positionAbs.top - this.lastPositionAbs.top;
		return delta != 0 && (delta > 0 ? "down" : "up");
	},

	_getDragHorizontalDirection: function() {
		var delta = this.positionAbs.left - this.lastPositionAbs.left;
		return delta != 0 && (delta > 0 ? "right" : "left");
	},

	refresh: function(event) {
		this._refreshItems(event);
		this.refreshPositions();
	},

	_connectWith: function() {
		var options = this.options;
		return options.connectWith.constructor == String
			? [options.connectWith]
			: options.connectWith;
	},
	
	_getItemsAsjQuery: function(connected) {

		var self = this;
		var items = [];
		var queries = [];
		var connectWith = this._connectWith();

		if(connectWith && connected) {
			for (var i = connectWith.length - 1; i >= 0; i--){
				var cur = $(connectWith[i]);
				for (var j = cur.length - 1; j >= 0; j--){
					var inst = $.data(cur[j], 'sortable');
					if(inst && inst != this && !inst.options.disabled) {
						queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper"), inst]);
					}
				};
			};
		}

		queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper"), this]);

		for (var i = queries.length - 1; i >= 0; i--){
			queries[i][0].each(function() {
				items.push(this);
			});
		};

		return $(items);

	},

	_removeCurrentsFromItems: function() {

		var list = this.currentItem.find(":data(sortable-item)");

		for (var i=0; i < this.items.length; i++) {

			for (var j=0; j < list.length; j++) {
				if(list[j] == this.items[i].item[0])
					this.items.splice(i,1);
			};

		};

	},

	_refreshItems: function(event) {

		this.items = [];
		this.containers = [this];
		var items = this.items;
		var self = this;
		var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]];
		var connectWith = this._connectWith();

		if(connectWith) {
			for (var i = connectWith.length - 1; i >= 0; i--){
				var cur = $(connectWith[i]);
				for (var j = cur.length - 1; j >= 0; j--){
					var inst = $.data(cur[j], 'sortable');
					if(inst && inst != this && !inst.options.disabled) {
						queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
						this.containers.push(inst);
					}
				};
			};
		}

		for (var i = queries.length - 1; i >= 0; i--) {
			var targetData = queries[i][1];
			var _queries = queries[i][0];

			for (var j=0, queriesLength = _queries.length; j < queriesLength; j++) {
				var item = $(_queries[j]);

				item.data('sortable-item', targetData); // Data for target checking (mouse manager)

				items.push({
					item: item,
					instance: targetData,
					width: 0, height: 0,
					left: 0, top: 0
				});
			};
		};

	},

	refreshPositions: function(fast) {

		//This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
		if(this.offsetParent && this.helper) {
			this.offset.parent = this._getParentOffset();
		}

		for (var i = this.items.length - 1; i >= 0; i--){
			var item = this.items[i];

			//We ignore calculating positions of all connected containers when we're not over them
			if(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0])
				continue;

			var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;

			if (!fast) {
				item.width = t.outerWidth();
				item.height = t.outerHeight();
			}

			var p = t.offset();
			item.left = p.left;
			item.top = p.top;
		};

		if(this.options.custom && this.options.custom.refreshContainers) {
			this.options.custom.refreshContainers.call(this);
		} else {
			for (var i = this.containers.length - 1; i >= 0; i--){
				var p = this.containers[i].element.offset();
				this.containers[i].containerCache.left = p.left;
				this.containers[i].containerCache.top = p.top;
				this.containers[i].containerCache.width	= this.containers[i].element.outerWidth();
				this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
			};
		}

	},

	_createPlaceholder: function(that) {

		var self = that || this, o = self.options;

		if(!o.placeholder || o.placeholder.constructor == String) {
			var className = o.placeholder;
			o.placeholder = {
				element: function() {

					var el = $(document.createElement(self.currentItem[0].nodeName))
						.addClass(className || self.currentItem[0].className+" ui-sortable-placeholder")
						.removeClass("ui-sortable-helper")[0];

					if(!className)
						el.style.visibility = "hidden";

					return el;
				},
				update: function(container, p) {

					// 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that
					// 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
					if(className && !o.forcePlaceholderSize) return;

					//If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item
					if(!p.height()) { p.height(self.currentItem.innerHeight() - parseInt(self.currentItem.css('paddingTop')||0, 10) - parseInt(self.currentItem.css('paddingBottom')||0, 10)); };
					if(!p.width()) { p.width(self.currentItem.innerWidth() - parseInt(self.currentItem.css('paddingLeft')||0, 10) - parseInt(self.currentItem.css('paddingRight')||0, 10)); };
				}
			};
		}

		//Create the placeholder
		self.placeholder = $(o.placeholder.element.call(self.element, self.currentItem));

		//Append it after the actual current item
		self.currentItem.after(self.placeholder);

		//Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
		o.placeholder.update(self, self.placeholder);

	},

	_contactContainers: function(event) {
		for (var i = this.containers.length - 1; i >= 0; i--){

			if(this._intersectsWith(this.containers[i].containerCache)) {
				if(!this.containers[i].containerCache.over) {

					if(this.currentContainer != this.containers[i]) {

						//When entering a new container, we will find the item with the least distance and append our item near it
						var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[i].floating ? 'left' : 'top'];
						for (var j = this.items.length - 1; j >= 0; j--) {
							if(!$.ui.contains(this.containers[i].element[0], this.items[j].item[0])) continue;
							var cur = this.items[j][this.containers[i].floating ? 'left' : 'top'];
							if(Math.abs(cur - base) < dist) {
								dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];
							}
						}

						if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled
							continue;

						this.currentContainer = this.containers[i];
						itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[i].element, true);
						this._trigger("change", event, this._uiHash());
						this.containers[i]._trigger("change", event, this._uiHash(this));

						//Update the placeholder
						this.options.placeholder.update(this.currentContainer, this.placeholder);

					}

					this.containers[i]._trigger("over", event, this._uiHash(this));
					this.containers[i].containerCache.over = 1;
				}
			} else {
				if(this.containers[i].containerCache.over) {
					this.containers[i]._trigger("out", event, this._uiHash(this));
					this.containers[i].containerCache.over = 0;
				}
			}

		};
	},

	_createHelper: function(event) {

		var o = this.options;
		var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem);

		if(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already
			$(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);

		if(helper[0] == this.currentItem[0])
			this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") };

		if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width());
		if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height());

		return helper;

	},

	_adjustOffsetFromHelper: function(obj) {
		if(obj.left != undefined) this.offset.click.left = obj.left + this.margins.left;
		if(obj.right != undefined) this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
		if(obj.top != undefined) this.offset.click.top = obj.top + this.margins.top;
		if(obj.bottom != undefined) this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
	},

	_getParentOffset: function() {


		//Get the offsetParent and cache its position
		this.offsetParent = this.helper.offsetParent();
		var po = this.offsetParent.offset();

		// This is a special case where we need to modify a offset calculated on start, since the following happened:
		// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
		if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
			po.left += this.scrollParent.scrollLeft();
			po.top += this.scrollParent.scrollTop();
		}

		if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
		|| (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
			po = { top: 0, left: 0 };

		return {
			top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
			left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
		};

	},

	_getRelativeOffset: function() {

		if(this.cssPosition == "relative") {
			var p = this.currentItem.position();
			return {
				top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
				left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
			};
		} else {
			return { top: 0, left: 0 };
		}

	},

	_cacheMargins: function() {
		this.margins = {
			left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
			top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
		};
	},

	_cacheHelperProportions: function() {
		this.helperProportions = {
			width: this.helper.outerWidth(),
			height: this.helper.outerHeight()
		};
	},

	_setContainment: function() {

		var o = this.options;
		if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
		if(o.containment == 'document' || o.containment == 'window') this.containment = [
			0 - this.offset.relative.left - this.offset.parent.left,
			0 - this.offset.relative.top - this.offset.parent.top,
			$(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
			($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
		];

		if(!(/^(document|window|parent)$/).test(o.containment)) {
			var ce = $(o.containment)[0];
			var co = $(o.containment).offset();
			var over = ($(ce).css("overflow") != 'hidden');

			this.containment = [
				co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
				co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
				co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
				co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
			];
		}

	},

	_convertPositionTo: function(d, pos) {

		if(!pos) pos = this.position;
		var mod = d == "absolute" ? 1 : -1;
		var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);

		return {
			top: (
				pos.top																	// The absolute mouse position
				+ this.offset.relative.top * mod										// Only for relative positioned nodes: Relative offset from element to offset parent
				+ this.offset.parent.top * mod											// The offsetParent's offset without borders (offset + border)
				- ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
			),
			left: (
				pos.left																// The absolute mouse position
				+ this.offset.relative.left * mod										// Only for relative positioned nodes: Relative offset from element to offset parent
				+ this.offset.parent.left * mod											// The offsetParent's offset without borders (offset + border)
				- ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
			)
		};

	},

	_generatePosition: function(event) {

		var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);

		// This is another very weird special case that only happens for relative elements:
		// 1. If the css position is relative
		// 2. and the scroll parent is the document or similar to the offset parent
		// we have to refresh the relative offset during the scroll so there are no jumps
		if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
			this.offset.relative = this._getRelativeOffset();
		}

		var pageX = event.pageX;
		var pageY = event.pageY;

		/*
		 * - Position constraining -
		 * Constrain the position to a mix of grid, containment.
		 */

		if(this.originalPosition) { //If we are not dragging yet, we won't check for options

			if(this.containment) {
				if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
				if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
				if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
				if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
			}

			if(o.grid) {
				var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
				pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;

				var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
				pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
			}

		}

		return {
			top: (
				pageY																// The absolute mouse position
				- this.offset.click.top													// Click offset (relative to the element)
				- this.offset.relative.top												// Only for relative positioned nodes: Relative offset from element to offset parent
				- this.offset.parent.top												// The offsetParent's offset without borders (offset + border)
				+ ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
			),
			left: (
				pageX																// The absolute mouse position
				- this.offset.click.left												// Click offset (relative to the element)
				- this.offset.relative.left												// Only for relative positioned nodes: Relative offset from element to offset parent
				- this.offset.parent.left												// The offsetParent's offset without borders (offset + border)
				+ ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
			)
		};

	},

	_rearrange: function(event, i, a, hardRefresh) {

		a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling));

		//Various things done here to improve the performance:
		// 1. we create a setTimeout, that calls refreshPositions
		// 2. on the instance, we have a counter variable, that get's higher after every append
		// 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
		// 4. this lets only the last addition to the timeout stack through
		this.counter = this.counter ? ++this.counter : 1;
		var self = this, counter = this.counter;

		window.setTimeout(function() {
			if(counter == self.counter) self.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
		},0);

	},

	_clear: function(event, noPropagation) {

		this.reverting = false;
		// We delay all events that have to be triggered to after the point where the placeholder has been removed and
		// everything else normalized again
		var delayedTriggers = [], self = this;

		// We first have to update the dom position of the actual currentItem
		// Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
		if(!this._noFinalSort && this.currentItem[0].parentNode) this.placeholder.before(this.currentItem);
		this._noFinalSort = null;

		if(this.helper[0] == this.currentItem[0]) {
			for(var i in this._storedCSS) {
				if(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = '';
			}
			this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
		} else {
			this.currentItem.show();
		}

		if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
		if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
		if(!$.ui.contains(this.element[0], this.currentItem[0])) { //Node was moved out of the current element
			if(!noPropagation) delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
			for (var i = this.containers.length - 1; i >= 0; i--){
				if($.ui.contains(this.containers[i].element[0], this.currentItem[0]) && !noPropagation) {
					delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); };  }).call(this, this.containers[i]));
					delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this));  }; }).call(this, this.containers[i]));
				}
			};
		};

		//Post events to containers
		for (var i = this.containers.length - 1; i >= 0; i--){
			if(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); };  }).call(this, this.containers[i]));
			if(this.containers[i].containerCache.over) {
				delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); };  }).call(this, this.containers[i]));
				this.containers[i].containerCache.over = 0;
			}
		}

		//Do what was originally in plugins
		if(this._storedCursor) $('body').css("cursor", this._storedCursor); //Reset cursor
		if(this._storedOpacity) this.helper.css("opacity", this._storedOpacity); //Reset cursor
		if(this._storedZIndex) this.helper.css("zIndex", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index

		this.dragging = false;
		if(this.cancelHelperRemoval) {
			if(!noPropagation) {
				this._trigger("beforeStop", event, this._uiHash());
				for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events
				this._trigger("stop", event, this._uiHash());
			}
			return false;
		}

		if(!noPropagation) this._trigger("beforeStop", event, this._uiHash());

		//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
		this.placeholder[0].parentNode.removeChild(this.placeholder[0]);

		if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null;

		if(!noPropagation) {
			for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events
			this._trigger("stop", event, this._uiHash());
		}

		this.fromOutside = false;
		return true;

	},

	_trigger: function() {
		if ($.widget.prototype._trigger.apply(this, arguments) === false) {
			this.cancel();
		}
	},

	_uiHash: function(inst) {
		var self = inst || this;
		return {
			helper: self.helper,
			placeholder: self.placeholder || $([]),
			position: self.position,
			absolutePosition: self.positionAbs, //deprecated
			offset: self.positionAbs,
			item: self.currentItem,
			sender: inst ? inst.element : null
		};
	}

}));

$.extend($.ui.sortable, {
	getter: "serialize toArray",
	version: "1.7.1",
	eventPrefix: "sort",
	defaults: {
		appendTo: "parent",
		axis: false,
		cancel: ":input,option",
		connectWith: false,
		containment: false,
		cursor: 'auto',
		cursorAt: false,
		delay: 0,
		distance: 1,
		dropOnEmpty: true,
		forcePlaceholderSize: false,
		forceHelperSize: false,
		grid: false,
		handle: false,
		helper: "original",
		items: '> *',
		opacity: false,
		placeholder: false,
		revert: false,
		scroll: true,
		scrollSensitivity: 20,
		scrollSpeed: 20,
		scope: "default",
		tolerance: "intersect",
		zIndex: 1000
	}
});

})(jQuery);	// /js/trimpath.js
	/**
 * TrimPath Template. Release 1.0.38.
 * Copyright (C) 2004, 2005 Metaha.
 * 
 * TrimPath Template is licensed under the GNU General Public License
 * and the Apache License, Version 2.0, as follows:
 */
var TrimPath; (function(){if(TrimPath==null){TrimPath=new Object()}if(TrimPath.evalEx==null){TrimPath.evalEx=function(a){return eval(a)}}var r;if(Array.prototype.pop==null){Array.prototype.pop=function(){if(this.length===0){return r}return this[--this.length]}}if(Array.prototype.push==null){Array.prototype.push=function(){for(var i=0;i<arguments.length;++i){this[this.length]=arguments[i]}return this.length}};TrimPath.parseTemplate=function(a,b,c){if(c==null)c=TrimPath.parseTemplate_etc;var d=t(a,b,c);var e=TrimPath.evalEx(d,b,1);if(e!=null)return new c.Template(b,a,d,e,c);return null};try{String.prototype.process=function(a,b){var c=TrimPath.parseTemplate(this,null);if(c!=null){return c.process(a,b)}return this}}catch(e){};TrimPath.parseTemplate_etc={};TrimPath.parseTemplate_etc.statementTag="forelse|for|if|elseif|else|var|macro";TrimPath.parseTemplate_etc.statementDef={"if":{delta:1,prefix:"if (",suffix:") {",paramMin:1},"else":{delta:0,prefix:"} else {"},"elseif":{delta:0,prefix:"} else if (",suffix:") {",paramDefault:"true"},"/if":{delta:-1,prefix:"}"},"for":{delta:1,paramMin:3,prefixFunc:function(a,b,c,d){if(a[2]!="in")throw new d.ParseError(c,b.line,"bad for loop statement: "+a.join(' '));var e=a[1];var f="__LIST__"+e;return["var ",f," = ",a[3],";","var __LENGTH_STACK__;","if (typeof(__LENGTH_STACK__) == 'undefined' || !__LENGTH_STACK__.length) __LENGTH_STACK__ = new Array();","__LENGTH_STACK__[__LENGTH_STACK__.length] = 0;","if ((",f,") != null) { ","var ",e,"_ct = 0;","for (var ",e,"_index in ",f,") { ",e,"_ct++;","if (typeof(",f,"[",e,"_index]) == 'function') {continue;}","__LENGTH_STACK__[__LENGTH_STACK__.length - 1]++;","var ",e," = ",f,"[",e,"_index];"].join("")}},"forelse":{delta:0,prefix:"} } if (__LENGTH_STACK__[__LENGTH_STACK__.length - 1] == 0) { if (",suffix:") {",paramDefault:"true"},"/for":{delta:-1,prefix:"} }; delete __LENGTH_STACK__[__LENGTH_STACK__.length - 1];"},"var":{delta:0,prefix:"var ",suffix:";"},"macro":{delta:1,prefixFunc:function(a,b,c,d){var e=a[1].split('(')[0];return["var ",e," = function",a.slice(1).join(' ').substring(e.length),"{ var _OUT_arr = []; var _OUT = { write: function(m) { if (m) _OUT_arr.push(m); } }; "].join('')}},"/macro":{delta:-1,prefix:" return _OUT_arr.join(''); };"}};TrimPath.parseTemplate_etc.modifierDef={"eat":function(v){return""},"escape":function(s){return String(s).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},"capitalize":function(s){return String(s).toUpperCase()},"default":function(s,d){return s!=null?s:d}};TrimPath.parseTemplate_etc.modifierDef.h=TrimPath.parseTemplate_etc.modifierDef.escape;TrimPath.parseTemplate_etc.Template=function(h,i,j,l,n){this.process=function(b,c){if(b==null){b={}}if(b._MODIFIERS==null){b._MODIFIERS={}}if(b.defined==null){b.defined=function(a){return(b[a]!=undefined)}}for(var k in n.modifierDef){if(b._MODIFIERS[k]==null){b._MODIFIERS[k]=n.modifierDef[k]}}if(c==null){c={}}var d=[];var f={write:function(m){d.push(m)}};try{l(f,b,c)}catch(e){if(c.throwExceptions==true){throw e;}var g=new String(d.join("")+"[ERROR: "+e.toString()+(e.message?'; '+e.message:'')+"]");g["exception"]=e;return g}return d.join("")};this.name=h;this.source=i;this.sourceFunc=j;this.toString=function(){return"TrimPath.Template ["+h+"]"}};TrimPath.parseTemplate_etc.ParseError=function(a,b,c){this.name=a;this.line=b;this.message=c};TrimPath.parseTemplate_etc.ParseError.prototype.toString=function(){return("TrimPath template ParseError in "+this.name+": line "+this.line+", "+this.message)};var t=function(a,b,c){a=A(a);var d=["var TrimPath_Template_TEMP = function(_OUT, _CONTEXT, _FLAGS) { with (_CONTEXT) {"];var e={stack:[],line:1};var f=-1;while(f+1<a.length){var g=f;g=a.indexOf("{",g+1);while(g>=0){var h=a.indexOf('}',g+1);var i=a.substring(g,h);var j=i.match(/^\{(cdata|minify|eval)/);if(j){var k=j[1];var l=g+k.length+1;var m=a.indexOf('}',l);if(m>=0){var n;if(m-l<=0){n="{/"+k+"}"}else{n=a.substring(l+1,m)}var o=a.indexOf(n,m+1);if(o>=0){w(a.substring(f+1,g),d);var p=a.substring(m+1,o);if(k=='cdata'){y(p,d)}else if(k=='minify'){y(B(p),d)}else if(k=='eval'){if(p!=null&&p.length>0)d.push('_OUT.write( (function() { '+p+' })() );')}g=f=o+n.length-1}}}else if(a.charAt(g-1)!='$'&&a.charAt(g-1)!='\\'){var q=(a.charAt(g+1)=='/'?2:1);if(a.substring(g+q,g+10+q).search(TrimPath.parseTemplate_etc.statementTag)==0)break}g=a.indexOf("{",g+1)}if(g<0)break;var h=a.indexOf("}",g+1);if(h<0)break;w(a.substring(f+1,g),d);u(a.substring(g,h+1),e,d,b,c);f=h}w(a.substring(f+1),d);if(e.stack.length!=0)throw new c.ParseError(b,e.line,"unclosed, unmatched statement(s): "+e.stack.join(","));d.push("}}; TrimPath_Template_TEMP");return d.join("")};var u=function(a,b,c,d,e){var f=a.slice(1,-1).split(' ');var g=e.statementDef[f[0]];if(g==null){w(a,c);return}if(g.delta<0){if(b.stack.length<=0)throw new e.ParseError(d,b.line,"close tag does not match any previous statement: "+a);b.stack.pop()}if(g.delta>0)b.stack.push(a);if(g.paramMin!=null&&g.paramMin>=f.length)throw new e.ParseError(d,b.line,"statement needs more parameters: "+a);if(g.prefixFunc!=null)c.push(g.prefixFunc(f,b,d,e));else c.push(g.prefix);if(g.suffix!=null){if(f.length<=1){if(g.paramDefault!=null)c.push(g.paramDefault)}else{for(var i=1;i<f.length;i++){if(i>1)c.push(' ');c.push(f[i])}}c.push(g.suffix)}};var w=function(a,b){if(a.length<=0)return;var c=0;var d=a.length-1;while(c<a.length&&(a.charAt(c)=='\n'))c++;while(d>=0&&(a.charAt(d)==' '||a.charAt(d)=='\t'))d--;if(d<c)d=c;if(c>0){b.push('if (_FLAGS.keepWhitespace == true) _OUT.write("');var s=a.substring(0,c).replace('\n','\\n');if(s.charAt(s.length-1)=='\n')s=s.substring(0,s.length-1);b.push(s);b.push('");')}var e=a.substring(c,d+1).split('\n');for(var i=0;i<e.length;i++){x(e[i],b);if(i<e.length-1)b.push('_OUT.write("\\n");\n')}if(d+1<a.length){b.push('if (_FLAGS.keepWhitespace == true) _OUT.write("');var s=a.substring(d+1).replace('\n','\\n');if(s.charAt(s.length-1)=='\n')s=s.substring(0,s.length-1);b.push(s);b.push('");')}};var x=function(a,b){var c='}';var d=-1;while(d+c.length<a.length){var e="${",endMark="}";var f=a.indexOf(e,d+c.length);if(f<0)break;if(a.charAt(f+2)=='%'){e="${%";endMark="%}"}var g=a.indexOf(endMark,f+e.length);if(g<0)break;y(a.substring(d+c.length,f),b);var h=a.substring(f+e.length,g).replace(/\|\|/g,"#@@#").split('|');for(var k in h){if(h[k].replace)h[k]=h[k].replace(/#@@#/g,'||')}b.push('_OUT.write(');z(h,h.length-1,b);b.push(');');d=g;c=endMark}y(a.substring(d+c.length),b)};var y=function(a,b){if(a==null||a.length<=0)return;a=a.replace(/\\/g,'\\\\');a=a.replace(/\n/g,'\\n');a=a.replace(/"/g,'\\"');b.push('_OUT.write("');b.push(a);b.push('");')};var z=function(a,b,c){var d=a[b];if(b<=0){c.push(d);return}var e=d.split(':');c.push('_MODIFIERS["');c.push(e[0]);c.push('"](');z(a,b-1,c);if(e.length>1){c.push(',');c.push(e[1])}c.push(')')};var A=function(a){a=a.replace(/\t/g,"    ");a=a.replace(/\r\n/g,"\n");a=a.replace(/\r/g,"\n");a=a.replace(/^(\s*\S*(\s+\S+)*)\s*$/,'$1');return a};var B=function(a){a=a.replace(/^\s+/g,"");a=a.replace(/\s+$/g,"");a=a.replace(/\s+/g," ");a=a.replace(/^(\s*\S*(\s+\S+)*)\s*$/,'$1');return a};TrimPath.parseDOMTemplate=function(a,b,c){if(b==null)b=document;var d=b.getElementById(a);var e=d.value;if(e==null)e=d.innerHTML;e=e.replace(/&lt;/g,"<").replace(/&gt;/g,">");return TrimPath.parseTemplate(e,a,c)};TrimPath.processDOMTemplate=function(a,b,c,d,e){return TrimPath.parseDOMTemplate(a,d,e).process(b,c)}}) ();	// NEW Implementation /js/api/api.js !!
	//api = apiClass.prototype = {
api = {
	errorHandling: function(p1,p2,p3) {
		// DEBUG
		p1_lines = '';
		for (myline in p1) {
			try {
				p1_lines += myline + ": " + p1[myline] + "\n";
			} catch(e) {}
		}
		if (p3 == undefined) {
			//console.log('Undefined error occured!');
		} else {
			//console.log('XMLHttpRequest object: ' + p1_lines);
			//console.log('Description: '+ p2);
			//console.log('Optional exception object: '+ p3);
		}
	},
	
	replaceTemplate: function(templateUrl, jsonUrl, data, jquery, callback, noIndicator, append) {
		$.transforms.clear(jquery);
		if (!noIndicator) {
			$(jquery).empty();
			$(jquery).append('<img src="/images/ajax_indicator.gif" width="16" height="16" class="ajax_indicator" />');
		}
		api.loadTemplate(templateUrl, jsonUrl, data, function(text, variables) {
			if(!append){ 
				$(jquery).empty();
			}
			$(jquery).append(text);
			if (callback) {
				callback(variables);
			}
			$.transforms.mixxtInit(jquery);
		});
	},
	
	replaceFile: function(url, jquery, callback, noIndicator) {
		$.transforms.clear(jquery);
		if (!noIndicator) {
			$(jquery).empty();
			$(jquery).append('<img src="/images/ajax_indicator.gif" width="16" height="16" class="ajax_indicator" />');
		}
		api.loadUrl(url, function(text) {
			$(jquery).empty();
			$(jquery).append(text);
			if (callback) {
				callback();
			}
			$.transforms.mixxtInit(jquery);
		});
	},
	
	replaceFileWithParameters: function(url, data, jquery, callback, noIndicator) {
		$.transforms.clear(jquery);
		if (!noIndicator) {
			$(jquery).empty();
			$(jquery).append('<img src="/images/ajax_indicator.gif" width="16" height="16" class="ajax_indicator" />');
		}
		api.loadUrlWithParameters(url, data, function(text) {
			$(jquery).empty();
			$(jquery).append(text);
			if (callback) {
				callback();
			}
			$.transforms.mixxtInit(jquery);
		});
	},
	
	loadTemplate: function(templateUrl, jsonUrl, sendData, callback) {
		var template = false;
		var variables = false;
		// erster ajax-aufruf holt das template
		$.ajax({
			type: "GET",
			url: api.uncacheUrl(templateUrl),
			success: function(tmplcontent) {
				template = tmplcontent;
				checkFinished();
			},
			error: function(p1,p2,p3) {
				api.errorHandling(p1,p2,'GET '+p3);
			}
		});
		if ((typeof jsonUrl)=="string") {
			// zweiter ajax-aufruf holt die inhalte
			$.ajax({
				type: "POST",
				dataType: "json",
				url: api.uncacheUrl(jsonUrl),
				data: sendData,
				dataType: "json",
				success: function(json_data) {
					variables = json_data;
					checkFinished();
				},
				error: function(p1,p2,p3) {
					api.errorHandling(p1,p2,'POST '+p3);
				}
			});
		} else {
			variables = jsonUrl;
		}
		function checkFinished() {
			if (template && variables) {
				if (variables["error"] != 1) {
					if (callback) {
						try {
							var trimpath = TrimPath.parseTemplate(template).process(variables, {throwExceptions: true});
						} catch (e) {
							api.errorHandling('checkFinished','error',e);
						}
					}
				}
				callback(trimpath, variables);
			}
		}
	},
	
	loadUrl: function(url, callback) {
		$.ajax({
			type: "GET",
			url: api.uncacheUrl(url),
			success: function(content) {
				if (callback) {
					callback(content);
				}
			},
			error: function(p1,p2,p3) {
				api.errorHandling(p1,p2,p3);
			}
		});
	},
	
	loadUrlWithParameters: function(url, data, callback) {
		$.ajax({
			type: "GET",
			url: api.uncacheUrl(url),
			data: data,
			success: function(content) {
				if (callback) {
					callback(content);
				}
			},
			error: function(p1,p2,p3) {
				api.errorHandling(p1,p2,p3);
			}
		});
	},
	
	callSync: function(url, data) {
		return $.ajax({
			async: false,
			type: "POST",
			data: data,
			url: api.uncacheUrl(url),
			error: function(p1,p2,p3) {
				api.errorHandling(p1,p2,p3);
			}
		}).responseText;
	},
	
	callSyncJSON: function(url, data) {
		return eval('(' + $.ajax({
			async: false,
			type: "POST",
			data: data,
			url: api.uncacheUrl(url),
			error: function(p1,p2,p3) {
				api.errorHandling(p1,p2,p3);
			}
		}).responseText + ')');
	},
	
	loadSync: function(url) {
		return $.ajax({
			async: false,
			type: "GET",
			url: api.uncacheUrl(url),
			error: function(p1,p2,p3) {
				api.errorHandling(p1,p2,p3);
			}
		}).responseText;
	},
	
	call: function(url, data, callback) {
		$.ajax({
			type: "POST",
			url: api.uncacheUrl(url),
			data: data,
			success: function(returndata) {
				if (callback) {
					callback(returndata);
				}
			},
			error: function(p1,p2,p3) {
				api.errorHandling(p1,p2,p3);
			}
		});
	},
	
	callJSON: function(url, data, callback) {
		$.ajax({
			type: "POST",
			url: api.uncacheUrl(url),
			data: data,
			dataType: "json",
			success: function(returndata) {
				if (callback) {
					callback(returndata);
				}
			},
			error: function(p1,p2,p3) {
				api.errorHandling(p1,p2,p3);
			}
		});
	},
	
	callJSONP: function(url, data, callback) {
		/*$.getJSON(
			api.uncacheUrl(url),
			data,
			callback
		);*/
		$.ajax({
			url: api.uncacheUrl(url),
			data: data,
			dataType: "jsonp",
			success: callback
		});
	},
	
	uncacheUrl: function(url) {
		var today = new Date();
		if (url.match(/[?]/)) {
			url += '&date=' + today.getTime();
		} else {
			url += '?' + today.getTime();
		}
		typeof(mixxtHost) != 'undefined' && (url = mixxtHost + url);
		return url;
	}
}	// /js/api.js
	function api_errorHandling(p1,p2,p3) {
	return api.errorHandling(p1,p2,p3);
}

function api_replaceTemplate(templateUrl, jsonUrl, data, jquery, callback, noIndicator, append) {
	return api.replaceTemplate(templateUrl, jsonUrl, data, jquery, callback, noIndicator, append);
}

function api_replaceFile(url, jquery, callback, noIndicator) {
	return api.replaceFile(url, jquery, callback, noIndicator);
}

function api_loadTemplate(templateUrl, jsonUrl, sendData, callback) {
	return api.loadTemplate(templateUrl, jsonUrl, sendData, callback);
}

function api_loadUrl(url, callback) {
	return api.loadUrl(url, callback);
}

function api_callSync(url, data) {
	return api.callSync(url, data);
}

function api_callSync_json(url, data) {
	return api.callSyncJSON(url, data);
}

function api_loadSync(url) {
	return api.loadSync(url);
}

function api_call(url, data, callback) {
	return api.call(url, data, callback);
}

function api_call_json(url, data, callback) {
	return api.callJSON(url, data, callback);
}

function uncacheUrl(url) {
	return api.uncacheUrl(url);
}	// /js/lang.js
	var lang_strings  = new Array();
var lang_initDone = false;

function _() {
	if(!lang_initDone) {
		lang_init();
	}
	
	var str = arguments[0];

	if(lang_strings[str]) {
		str = lang_strings[str];
	}
	for(var i=1;i<arguments.length;i++) {
		var re = new RegExp('%'+i);
		str = str.replace(re,arguments[i]);
	}
	return str;
}

function lang_init() {
	lang_parse_po();
	lang_initDone = true;
}

function lang_parse_po() {
	var re   = /^\s*(msgid|msgstr)?\s*"((?:\\"|[^"])*)"/;
	var file = api.loadSync('/locale/js/'+getLanguage('user'));
	var lines = file.split('\n');
	var thisId;
	var mode = '';
	for(var myline in lines) {
		if(re.exec(lines[myline]) != null) {
			if(RegExp.$1=='msgid') {
				thisId=RegExp.$2;mode='msgid';
			}
			else {
				if(RegExp.$1=='msgstr') {
					lang_strings[thisId] = stripslashes(RegExp.$2);
					mode='msgstr';
				}
				else {
					if(mode=='msgid') {
						thisId += RegExp.$2;
					}
					else if(mode=='msgstr') {
						lang_strings[thisId] += stripslashes(RegExp.$2);
					}
				}
			}
		}
	}
}

function stripslashes(str) {
	str = str.replace(/\\n/g,'\n');
	return str.replace(/\\("|\\)/g,'$1')
}

function getLanguage(type) {
	switch(type) {
		case 'network':
			if(LOCALE['network']) {
				return LOCALE['network'];
			}
		case 'user':
			if(LOCALE['user']) {
				return LOCALE['user'];
			}
		default:
			return LOCALE['session']
	}
}

function formatDate(formatIdent,dateObj) {
	var formatStr = _('static.general.format.'+formatIdent+'.js');
	formatStr = formatStr.replace(/%d/g,dateObj.getDate());
	formatStr = formatStr.replace(/%m/g,dateObj.getMonth()+1);
	formatStr = formatStr.replace(/%Y/g,dateObj.getFullYear());
	formatStr = formatStr.replace(/%H/g,dateObj.getHours());
	formatStr = formatStr.replace(/%M/g,dateObj.getMinutes());
	return formatStr
}

function setLanguageCookie(lang) {
	if(document.cookie) {
		document.cookie = "setLocale="+lang+"; path=/";document.location.reload();
	}
}	// Niceforms Reworked
	$(function () { 
	$.transforms.mixxtInit('.niceform');
});

function init() { }
var niceforms_active = false;

/* transforms by Christoph Geschwind (mixxt) */
/* some minor changes and fixes by Axel Wahlen (mixxt) */
/* inspired by niceforms (Lucian Slatineanu) modified by Philipp Ellenbeck (mixxt) */
/* Version: beta0.8  */

(function($) {
	$.fn.transforms = function(options) {
		return $.transforms(this, options);
	};

	$.transforms = function(obj, options) {
		$.transforms.init(obj, options);
	};

var transforms = {
	selectRightSideWidth: 21,
	selectLeftSideWidth: 8,
	selectAreaHeight: 21,
	selectAreaOptionsOverlap: 2,
	$radiosChecked: {},
	radios: [],
	settings: [],
	options: [],
	selectDivs: [],
	count: -1,
	thisObject: {},
	init: function(selectedObject, options){
		var defaults = {
			callback: function(){},
			imageBasePath: 'images/',
			exclude: false,
			imageType: '.png'
		};
		
		this.settings.push($.extend({}, defaults, options));
		this.count++;
		this.settings[this.count].exclude = (this.settings[this.count].exclude) ? ':not('+this.settings[this.count].exclude+')' : '';
		this.settings[this.count].radioCheckboxImageType = options.radioCheckboxImageType || options.imageType || defaults.imageType;
		
		/* Init Object */
		this.$radiosChecked = $('input:radio:checked'+$.transforms.settings[$.transforms.count].exclude);
		
		//  Push to Array with name as index => No need to refresh after change
		/*$selectedObject.find(':radio').each(function(){
			if(!$.transforms.radios[this.name])
				$.transforms.radios[this.name] = [];
			$.transforms.radios[this.name].push(this);
		});*/
		// ToDo: use it instead of updating $radiosChecked
		var $selectedObject = $(selectedObject);
		/* Init Elements */
		this.replaceRadios($selectedObject);
		this.replaceCheckboxes($selectedObject);
		this.replaceSelects($selectedObject);
		this.replaceTextinput($selectedObject);
		this.replaceTextareas($selectedObject);
		this.replaceButtons($selectedObject);
		
		// Callback Execution
		this.settings[$.transforms.count].callback.call(selectedObject);
		
		this.preloadImages(['txtarea_cntr_xon','txtarea_l_xon','txtarea_tr_xon','txtarea_tl_xon',
					'txtarea_br_xon','txtarea_bl_xon','input_left_xon','input_right_xon',
					'button_left_xon','button_right_xon']);
		
		return $selectedObject;
	},
	preloadImages: function(img){
		for(var i = 0; i<img.length; i++){
			$('<img>').attr('src', this.settings[this.count].imageBasePath +''+ img[i] +''+$.transforms.settings[$.transforms.count].imageType);
		}
	},
	
	/*************************/
	/*************************/
	/***                   ***/
	/***   Radio Buttons   ***/
	/***                   ***/
	/*************************/
	/*************************/
	
	replaceRadios: function($selectedObject) {
		$selectedObject.find(':radio'+$.transforms.settings[$.transforms.count].exclude).each(function(){
				if($(this).hasClass('tfHidden')){
					return;
				}
			var $radio = $(this).addClass('tfHidden').attr('transformed',$.transforms.count);
			/* visual change */
			var radioDiv = document.createElement('div');
			radioDiv.className = ($radio.attr('checked')) ? "tfRadioChecked" : "tfRadio";
			$(radioDiv).css('backgroundImage','url('+ $.transforms.settings[$.transforms.count].imageBasePath +'radio'+$.transforms.settings[$.transforms.count].radioCheckboxImageType+')');
			$radio.wrap(radioDiv);
			/* Events */
			if($radio.attr('onclick')){
				$radio.parent().click($.transforms.onclickRadio);
			}
			$radio.change($.transforms.updateRadio);
			$radio.parent().click($.transforms.clickRadio).css('margin','1px');
			$radio.focus($.transforms.focusRadioCheckbox);
			$radio.blur($.transforms.blurRadioCheckbox);
			if($.browser.safari || $.browser.chrome){
				$radio.keyup(function(){$(this).change();});
			}
		});
	},
	onclickRadio: function(event){ // support for onclick on radio button
		if(event.originalTarget && event.originalTarget.tagName == 'DIV'){
			$(event.originalTarget).children('input').attr('onclick').call();
		}
		else if(window.event && window.event.srcElement.tagName == 'DIV'){
			$(window.event.srcElement).children('input').attr('onclick').call();
		}
	},
	clickRadio: function(event){
		if(event.originalTarget && (event.originalTarget.tagName == 'INPUT' || event.originalTarget.className == 'tfRadioChecked')) {
			return;
		}
		if(window.event && (window.event.srcElement.tagName == 'INPUT' || window.event.srcElement.className == 'tfRadioChecked')){ 
			if($.browser.msie){
				window.event.srcElement.blur(); 
				window.event.srcElement.focus();
			}
			return;
		}
		$(event.currentTarget).find('input').change();		
	},
	updateRadio: function(event){
		if(typeof(tf) != 'undefined' && !tf) return;
		var radio = event.target;
		if(radio.disabled) return;
		var radioDiv = $(radio).parent()[0];
		var $thisRadioChecked = $.transforms.$radiosChecked.filter('[name="'+ radio.name +'"]');
		if($thisRadioChecked.length > 0){
			$thisRadioChecked.parent()[0].className = "tfRadio";
			$thisRadioChecked.removeAttr('checked');
		}
		radio.checked = true;
		radioDiv.className = "tfRadioChecked";
		$.transforms.$radiosChecked = $($.transforms.$radiosChecked.selector);
	},
	focusRadioCheckbox: function(event) {
		$(this).parent().css({'border': '1px dotted #333', 'margin': '0'});
		if(($.browser.chrome || $.browser.safari) && !$(this).attr('checked')){
			$(this).change();
		}
	},
	blurRadioCheckbox: function(event) {
		$(this).parent().css({'border': '0', 'margin': '1px'});
	},
	updateVisualRadio: function(elem){
		if(typeof(tf) != 'undefined' && !tf) return;
			$(elem).parent().toggleClass("tfRadioChecked",elem.checked).toggleClass("tfRadio",!elem.checked);
	},
	
	/**********************/
	/**********************/
	/***                ***/
	/***   Checkboxes   ***/
	/***                ***/
	/**********************/
	/**********************/
	
	replaceCheckboxes: function($selectedObject) {
		$selectedObject.find(':checkbox'+$.transforms.settings[$.transforms.count].exclude).each(function(){
			if($(this).hasClass('tfHidden')){
				return;
			}
			var $checkbox = $(this).addClass('tfHidden').attr('transformed',$.transforms.count);
			/* visual change */
			var checkboxDiv = document.createElement('div');
			checkboxDiv.className = ($checkbox.attr('checked')) ? "tfCheckboxChecked" : "tfCheckbox";
			$(checkboxDiv).css('backgroundImage','url('+ $.transforms.settings[$.transforms.count].imageBasePath +'checkbox'+$.transforms.settings[$.transforms.count].radioCheckboxImageType+')');
			$checkbox.wrap(checkboxDiv);
			/* Events */
			if($checkbox.attr('onclick')){
				$checkbox.parent().click($.transforms.onclickCheckbox);
			}
			$checkbox.change($.transforms.updateCheckbox);
			$checkbox.parent().click($.transforms.clickCheckbox).css('margin','1px');
			$checkbox.focus($.transforms.focusRadioCheckbox);
			$checkbox.blur($.transforms.blurRadioCheckbox);
		});
	},
	onclickCheckbox: function(event){ // support for onclick on checkbox button
		if(event.originalTarget && event.originalTarget.tagName == 'DIV'){
			$(event.originalTarget).children('input').attr('onclick').call();
		}
		else if(window.event && window.event.srcElement.tagName == 'DIV'){
			$(window.event.srcElement).children('input').attr('onclick').call();
		}
	},
	clickCheckbox: function(event){
		if(event.originalTarget && event.originalTarget.tagName == 'INPUT') {
			return;
		}
		if(window.event && window.event.srcElement.tagName == 'INPUT'){ 
			if($.browser.msie){
				window.event.srcElement.blur(); 
				window.event.srcElement.focus();
			}
			return;
		}
		$(event.currentTarget).find('input').change();		
	},
	updateCheckbox: function(e){
		var checkbox = e.currentTarget;
		if(checkbox.disabled) return;
		if(!e.originalEvent){
			checkbox.checked = !checkbox.checked;
		}
		$.transforms.updateVisualCheckbox(checkbox);
	},
	updateVisualCheckbox: function(elem){
		if(typeof(tf) != 'undefined' && !tf) return;
			$(elem).parent().toggleClass("tfCheckboxChecked",elem.checked).toggleClass("tfCheckbox",!elem.checked);
	},
	
	/*************************/
	/*************************/
	/***                   ***/
	/***      Selects      ***/
	/***                   ***/
	/*************************/
	/*************************/
	
	replaceSelects: function($selectedObject){
		$selectedObject.find('select'+$.transforms.settings[$.transforms.count].exclude).each(function(){
				if($(this).hasClass('tfHidden')){
					return;
				}
				var width = parseInt($(this).css('width'));
				if(width < 48){
					width = 48;
				}
				if (this.className && this.className.indexOf("width_") != -1) {
					width = parseInt(this.className.replace(/width_/g, ""), 10);
				}
				var $divWrap = $(this).addClass('tfHidden').wrap('<div tfSelect="'+$.transforms.options.length+'" class="tfSelect" style="width:'+(width)+'px; background-image: url('+$.transforms.settings[$.transforms.count].imageBasePath+'select_bg'+$.transforms.settings[$.transforms.count].imageType+')"></div>')
						.parent().append('<div class="left specHigh1" style="background-image: url('+$.transforms.settings[$.transforms.count].imageBasePath+'select_left'+$.transforms.settings[$.transforms.count].imageType+')"></div><div class="center" style="width:'+(width-29)+'px"></div><div class="right specHigh1" style="background-image: url('+$.transforms.settings[$.transforms.count].imageBasePath+'select_right'+$.transforms.settings[$.transforms.count].imageType+')"></div>');
				var $ul = $('<ul tfSelect="'+$.transforms.options.length+'" class="tfSelectOptions" style="z-index: 10000; width:'+(width-7)+'px;"></ul>');
				var fontSettings = {'fontFamily': $(this).css('fontFamily'),'fontSize': $(this).css('fontSize')};
				$ul.css(fontSettings);
				var $text = $divWrap.children('.center');
				for(var i = 0; i < this.options.length; i++) {
					var $a = $('<a href="#" tfIndex="'+i+'"></a>').text(this.options[i].text);
					if (this.options[i].selected){
						$text.text(this.options[i].text);
						$a.addClass('selected');
					}
					$a.click($.transforms.clickOption);
					var $li = $('<li></li>').append($a);
					$ul.append($li);
				}
				$.transforms.options.push($ul.appendTo('body'));
				
				$divWrap.click($.transforms.clickSelect);
				$(this).change($.transforms.changeSelect);
				$(this).focus($.transforms.focusSelect).blur($.transforms.blurSelect);
				$(this).keydown($.transforms.keydownSelect);
				
				$.transforms.selectDivs.push($divWrap);
		});
	},
	
	clickSelect: function(event, close){
		if($.browser.msie && window.event.srcElement.tagName == "SELECT"){
			return;
		}
			
		if(close || $(this).hasClass('tfopen')){
			$(this).removeClass('tfopen');
			$.transforms.openOptions && $.transforms.openOptions.hide();
		}
		else{
			if($.transforms.openOptions){
				$.transforms.openOptions.hide();
				$.transforms.selectDivs[$.transforms.openOptions.attr('tfSelect')].removeClass('tfopen');
			}
			$(this).addClass('tfopen').children('select')[0].focus();
			var offset = $(this).offset();
			$.transforms.openOptions = $($.transforms.options[$(this).attr('tfSelect')]).css({'left': (offset.left+3)+'px', 'top': offset.top+22+'px'}).show();
			$('body').one('click', $.transforms.closeOpenOption);
		}
		return false;
	},
	
	closeOpenOption: function(){
		if($.transforms.openOptions) {
			$.transforms.selectDivs[$.transforms.openOptions.attr('tfSelect')].removeClass('tfopen');
			$.transforms.openOptions.hide();
		}
	},
	clickOption: function(event){
		var $target = $(event.target);
		var index = $target.attr('tfIndex');
		var $ul = $target.parents('ul');
		var $selectDiv = $($.transforms.selectDivs[$ul.attr('tfSelect')]);
		var $select = $selectDiv.children('select');
		var option = $select[0].options[index];
		if(!option.selected) {
			option.selected = true;
			$select.change();
		}
		else {
			$.transforms.clickSelect.call($selectDiv);
		}
		return false;
	},
	changeSelect: function(event){
		$.transforms.clickSelect.call($(this).parent(), null, true);
		$.transforms.updateSelect(this, this.selectedIndex);
	},
	focusSelect: function(event){
		$(this).parent().css({'border': '1px dotted #000000', 'margin':'-1px'});
		$.transforms.updateSelect(this, this.selectedIndex);
		if($.browser.msie){
			$(this).css('zoom','1');
		}
	},
	blurSelect: function(event){
		$(this).parent().css({'border': '0', 'margin':'0'});
	},
	keydownSelect: function(event){
		switch(event.keyCode){
		case (39&&!$.browser.msie) || 40:
			try{
				$.transforms.updateSelect(event.target, event.target.selectedIndex+1);
			}
			catch(e1){}
			break;
		case (37&&!$.browser.msie) || 38:
			try{
				$.transforms.updateSelect(event.target, event.target.selectedIndex-1);
			}
			catch(e2){}
			break;
		default:
			window.setTimeout(function(obj){
				if(!$.browser.msie){
					$.transforms.updateSelect(event.target, event.target.selectedIndex);
				}
			}, 50);
			break;
		}
	},
	updateSelect: function(obj, index) {
		$(obj).siblings('.center').text(obj.options[index].text);
		$($.transforms.options[$(obj).parent().attr('tfSelect')]).children().children().each(function(){
				if($(this).attr('tfindex') == index){
					this.className = 'selected';
				}
				else{
					this.className = '';
				}
				
		});
		return false;
	},
	
	/*************************/
	/*************************/
	/***                   ***/
	/***     Textinput     ***/
	/***                   ***/
	/*************************/
	/*************************/
	
	replaceTextinput: function($selectedObject){
		$selectedObject.find(':text'+$.transforms.settings[$.transforms.count].exclude+', :password'+$.transforms.settings[$.transforms.count].exclude).each(function(){
				if($(this).parent().hasClass('tfTextInput')) {/* ToDo */
					return;
				}
				if(this.id == 'recaptcha_response_field') return;
				var width = this.clientWidth;
				if(width === 0){
					if($(this).css('width') != 'auto'){
						width = $(this).css('width').replace(/px/g, '');
					}
				}
				$(this).wrap('<div class="tfTextInput"></div>');
				$(this).parent().prepend('<img src="'+$.transforms.settings[$.transforms.count].imageBasePath+'input_left'+$.transforms.settings[$.transforms.count].imageType+'"/>')
						.append('<img src="'+$.transforms.settings[$.transforms.count].imageBasePath+'input_right'+$.transforms.settings[$.transforms.count].imageType+'"/>');
				/*if(this.size>0 && width > 0 && !$.browser.msie && !$.browser.safari && !$.browser.chrome){
					$(this).css('cssText', 'width: '+ width +'px !important').parent().css('width',(width+16) +'px');
				}
				else*/ if(width > 0){
					$(this).css('cssText', 'width: '+ (width-16) +'px !important').parent().css('width',width+'px');
				}
				$(this).focus($.transforms.focusblurTextinput).blur($.transforms.focusblurTextinput);
				$(this).css('backgroundImage','url('+ $.transforms.settings[$.transforms.count].imageBasePath +'input_bg'+$.transforms.settings[$.transforms.count].imageType+')');
		});
	},
	focusblurTextinput: function(event){
		var xon = '';
		if(event.type=='focus'){
			xon = '_xon';
		}
		$(this).toggleClass('focus',event.type=='focus');
		this.previousSibling.src = $.transforms.settings[$.transforms.count].imageBasePath + "input_left"+xon+""+$.transforms.settings[$.transforms.count].imageType+"";
		this.nextSibling.src = $.transforms.settings[$.transforms.count].imageBasePath + "input_right"+xon+""+$.transforms.settings[$.transforms.count].imageType+"";
	},
	
	/*************************/
	/*************************/
	/***                   ***/
	/***      Textarea     ***/
	/***                   ***/
	/*************************/
	/*************************/
	
	replaceTextareas: function($selectedObject) {
		$selectedObject.find('textarea'+$.transforms.settings[$.transforms.count].exclude).each(function(){
				if($(this).parent().parent().hasClass('tfTxtarea')) {
					return;
				}
				var width = this.clientWidth;
				if(width === 0 || $(this).css('width') != 'auto'){
					var tmpwidth = $(this).css('width');
					if(tmpwidth != 'auto' && tmpwidth != '0px'){
						width = tmpwidth.replace(/px/g, '');
					}
					else{
						width = $(this).attr('cols')*10;
					}
				}
				
				var height = this.clientHeight;
				if(height === 0){
					var tmpheight = $(this).css('height');
					if(tmpheight != 'auto' && tmpheight != '0px'){
						height = tmpheight.replace(/px/g, '');
					}
					else{
						height = $(this).attr('rows')*10;
					}
				}
				
				$(this).css('cssText', 'height: '+ (height-20) +'px !important; width: '+ (width-20) +'px !important');
				$(this).wrap('<div class="tfTxtarea" style="width:'+(width)+'px; height:'+(height)+'px"></div>').wrap('<div class="cntr" style="background-image: url('+ $.transforms.settings[$.transforms.count].imageBasePath +'txtarea_cntr'+$.transforms.settings[$.transforms.count].imageType+')"></div>');
				$(this).parent().prepend('<div class="cntr_l" style="height:'+ (height-10) +'px; background-image: url('+ $.transforms.settings[$.transforms.count].imageBasePath +'txtarea_l'+$.transforms.settings[$.transforms.count].imageType+')"/>')
						.parent().prepend('<div class="tr" style="background-image: url('+ $.transforms.settings[$.transforms.count].imageBasePath +'txtarea_tr'+$.transforms.settings[$.transforms.count].imageType+')"><img class="txt_corner specHigh1" src="'+$.transforms.settings[$.transforms.count].imageBasePath+'txtarea_tl'+$.transforms.settings[$.transforms.count].imageType+'"/></div>')
							 .append('<div class="br" style="background-image: url('+ $.transforms.settings[$.transforms.count].imageBasePath +'txtarea_br'+$.transforms.settings[$.transforms.count].imageType+')"><img class="txt_corner specHigh1" src="'+$.transforms.settings[$.transforms.count].imageBasePath+'txtarea_bl'+$.transforms.settings[$.transforms.count].imageType+'"/></div>');
							 
				$(this).focus($.transforms.focusblurTextarea).blur($.transforms.focusblurTextarea);
		});
	},
	focusblurTextarea: function(event){
		var xon = '';
		if(event.type=='focus'){
			xon = '_xon';
		}
		$(this.parentNode).css('backgroundImage', 'url('+$.transforms.settings[$.transforms.count].imageBasePath +'txtarea_cntr'+xon+''+$.transforms.settings[$.transforms.count].imageType+')');
		$(this.previousSibling).css('backgroundImage', 'url('+$.transforms.settings[$.transforms.count].imageBasePath +'txtarea_l'+xon+''+$.transforms.settings[$.transforms.count].imageType+')');
		$(this.parentNode.previousSibling).css('backgroundImage', 'url('+$.transforms.settings[$.transforms.count].imageBasePath +'txtarea_tr'+xon+''+$.transforms.settings[$.transforms.count].imageType+')');
		this.parentNode.previousSibling.getElementsByTagName("img")[0].src = $.transforms.settings[$.transforms.count].imageBasePath + 'txtarea_tl'+xon+''+$.transforms.settings[$.transforms.count].imageType+'';
		$(this.parentNode.nextSibling).css('backgroundImage', 'url('+$.transforms.settings[$.transforms.count].imageBasePath +'txtarea_br'+xon+''+$.transforms.settings[$.transforms.count].imageType+')');
		this.parentNode.nextSibling.getElementsByTagName("img")[0].src = $.transforms.settings[$.transforms.count].imageBasePath + 'txtarea_bl'+xon+''+$.transforms.settings[$.transforms.count].imageType+'';
	},
	
	/*************************/
	/*************************/
	/***                   ***/
	/***      Buttons      ***/
	/***                   ***/
	/*************************/
	/*************************/
	
	replaceButtons: function($selectedObject){
		$selectedObject.find(':button'+$.transforms.settings[$.transforms.count].exclude+', :submit'+$.transforms.settings[$.transforms.count].exclude).each(function(){
				if($(this).attr('transformed')){
					return;
				}
				var width = this.clientWidth;
				if(width === 0){
					if($(this).css('width') != 'auto'){
						width = parseInt($(this).css('width').replace(/px/g, ''));
					}
				}
				
				$(this).wrap('<div class="tfButton"></div>');
				$(this).parent().prepend('<img src="'+$.transforms.settings[$.transforms.count].imageBasePath+'button_left'+$.transforms.settings[$.transforms.count].imageType+'"/>')
						.append('<img src="'+$.transforms.settings[$.transforms.count].imageBasePath+'button_right'+$.transforms.settings[$.transforms.count].imageType+'"/>');
				if(width > 0 && !$(this).hasClass('noresize')){
					$(this).css('width',width+'px').parent().css('width',(width+12)+'px');
				}
				
				$(this).hover($.transforms.hoverButton,$.transforms.hoverButton);
				$(this).attr('transformed',$.transforms.count).css('backgroundImage','url('+$.transforms.settings[$.transforms.count].imageBasePath+'button_bg'+$.transforms.settings[$.transforms.count].imageType+')');
				
		});
	},
	hoverButton: function(event){
		var settingsid = $(this).attr('transformed');
		var xon = '';
		if(event.type=="mouseenter"){
			xon = '_xon';
		}
		$(this).toggleClass("hover", event.type=="mouseenter");
		this.previousSibling.src = $.transforms.settings[settingsid].imageBasePath + "button_left"+xon+""+$.transforms.settings[$.transforms.count].imageType+"";
		this.nextSibling.src = $.transforms.settings[settingsid].imageBasePath + "button_right"+xon+""+$.transforms.settings[$.transforms.count].imageType+"";
	},
	
	/************************/
	/************************/
	/***                  ***/
	/***   Miscellanous   ***/
	/***                  ***/
	/************************/
	/************************/
	
	debug: function(msg){
		if (window.console && window.console.log){
			window.console.log(msg);
		}
		$('.debug').append(msg+" ");
	},
	
	clear: function(selector){
		$(selector +' select').each(function(){
			var id = $(this).parent().attr('tfSelect');
			$($.transforms.options[id]).remove();
			$.transforms.options[id] = null;
			$.transforms.selectDivs[id] = null;
		});
		$.transforms.openOptions = false;
	},
	
	update: function() {
		
	}
};

$.extend($.transforms, transforms);

$.transforms.mixxtInit = function(selector) {
	if (typeof(imagesPath) != 'undefined') {
		var extensionTemp 	   = '.png';
		if (typeof(imagesExtension) != 'undefined' && imagesExtension !== "") {
			extensionTemp = '.'+imagesExtension;
		}
		if (typeof(transformsExclude) == 'undefined') {
			transformsExclude = ".noniceform, .notransforms";
		}
		else {
			transformsExclude += ", .noniceform, .notransforms";
		}
		var tfSettings = {
			callback: 	function(){
						$(this).addClass('niceform_active');
					},
			imageBasePath:	imagesPath,
			exclude: transformsExclude,
			imageType: extensionTemp
		}
		if(typeof(radioCheckboxExtension) != 'undefined') {
			tfSettings.radioCheckboxImageType = '.'+radioCheckboxExtension;
		}
		$(selector).transforms(tfSettings);
	}
};

})(jQuery);



	// /js/jquery/jquery.interface.scroll.js
	/*
 * Interface elements for jQuery - http://interface.eyecon.ro
 *
 * Copyright (c) 2006 Stefan Petre
 * Dual licensed under the MIT (MIT-LICENSE.txt) 
 * and GPL (GPL-LICENSE.txt) licenses.
 */
 eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('4.15={3S:d(e){6 x=0;6 y=0;6 1I=1a;6 A=e.19;7(4(e).H(\'R\')==\'T\'){1E=A.17;2s=A.M;A.17=\'1T\';A.R=\'25\';A.M=\'22\';1I=24}6 8=e;2g(8){x+=8.3s+(8.1B&&!4.38.3r?F(8.1B.2T)||0:0);y+=8.3v+(8.1B&&!4.38.3r?F(8.1B.2M)||0:0);8=8.3G}8=e;2g(8&&8.3q&&8.3q.2R()!=\'Q\'){x-=8.1Q||0;y-=8.1z||0;8=8.2f}7(1I){A.R=\'T\';A.M=2s;A.17=1E}f{x:x,y:y}},5a:d(8){6 x=0,y=0;2g(8){x+=8.3s||0;y+=8.3v||0;8=8.3G}f{x:x,y:y}},3i:d(e){6 w=4.H(e,\'30\');6 h=4.H(e,\'2O\');6 1r=0;6 1q=0;6 A=e.19;7(4(e).H(\'R\')!=\'T\'){1r=e.2V;1q=e.2Z}k{1E=A.17;2s=A.M;A.17=\'1T\';A.R=\'25\';A.M=\'22\';1r=e.2V;1q=e.2Z;A.R=\'T\';A.M=2s;A.17=1E}f{w:w,h:h,1r:1r,1q:1q}},58:d(8){f{1r:8.2V||0,1q:8.2Z||0}},57:d(e){6 h,w,1F;7(e){w=e.28;h=e.2a}k{1F=G.Y;w=2q.3j||2c.3j||(1F&&1F.28)||G.Q.28;h=2q.3h||2c.3h||(1F&&1F.2a)||G.Q.2a}f{w:w,h:h}},36:d(e){6 t,l,w,h,1n,1o;7(e&&e.2A.2R()!=\'Q\'){t=e.1z;l=e.1Q;w=e.2S;h=e.2J;1n=0;1o=0}k{7(G.Y&&G.Y.1z){t=G.Y.1z;l=G.Y.1Q;w=G.Y.2S;h=G.Y.2J}k 7(G.Q){t=G.Q.1z;l=G.Q.1Q;w=G.Q.2S;h=G.Q.2J}1n=2c.3j||G.Y.28||G.Q.28||0;1o=2c.3h||G.Y.2a||G.Q.2a||0}f{t:t,l:l,w:w,h:h,1n:1n,1o:1o}},3n:d(e,1U){6 8=4(e);6 t=8.H(\'1Z\')||\'\';6 r=8.H(\'1V\')||\'\';6 b=8.H(\'1W\')||\'\';6 l=8.H(\'1X\')||\'\';7(1U)f{t:F(t)||0,r:F(r)||0,b:F(b)||0,l:F(l)};k f{t:t,r:r,b:b,l:l}},5c:d(e,1U){6 8=4(e);6 t=8.H(\'4c\')||\'\';6 r=8.H(\'46\')||\'\';6 b=8.H(\'48\')||\'\';6 l=8.H(\'4d\')||\'\';7(1U)f{t:F(t)||0,r:F(r)||0,b:F(b)||0,l:F(l)};k f{t:t,r:r,b:b,l:l}},5g:d(e,1U){6 8=4(e);6 t=8.H(\'2M\')||\'\';6 r=8.H(\'3L\')||\'\';6 b=8.H(\'3l\')||\'\';6 l=8.H(\'2T\')||\'\';7(1U)f{t:F(t)||0,r:F(r)||0,b:F(b)||0,l:F(l)||0};k f{t:t,r:r,b:b,l:l}},5f:d(27){6 x=27.5e||(27.5d+(G.Y.1Q||G.Q.1Q))||0;6 y=27.56||(27.54+(G.Y.1z||G.Q.1z))||0;f{x:x,y:y}},39:d(12,35){35(12);12=12.3t;2g(12){4.15.39(12,35);12=12.4W}},4V:d(12){4.15.39(12,d(8){P(6 1h 1u 8){7(2H 8[1h]===\'d\'){8[1h]=1v}}})},4U:d(8,N){6 16=$.15.36();6 3c=$.15.3i(8);7(!N||N==\'4T\')$(8).H({X:16.t+((18.3p(16.h,16.1o)-16.t-3c.1q)/2)+\'Z\'});7(!N||N==\'4X\')$(8).H({V:16.l+((18.3p(16.w,16.1n)-16.l-3c.1r)/2)+\'Z\'})},53:d(8,3E){6 3w=$(\'3F[@2C*="2F"]\',8||G),2F;3w.2h(d(){2F=C.2C;C.2C=3E;C.19.51="4Z:5h.5i.5y(2C=\'"+2F+"\')"})}};[].3J||(5w.5v.3J=d(v,n){n=(n==1v)?0:n;6 m=C.1l;P(6 i=n;i<m;i++)7(C[i]==v)f i;f-1});4.3u=d(e){7(/^5z$|^5A$|^5D$|^5C$|^5B$|^5u$|^5t$|^5m$|^5l$|^Q$|^5k$|^4S$|^5n$|^5o$|^5s$|^5r$|^5q$/i.29(e.2A))f 1a;k f 24};4.u.5p=d(e,1i){6 c=e.3t;6 1m=c.19;1m.M=1i.M;1m.1Z=1i.1b.t;1m.1X=1i.1b.l;1m.1W=1i.1b.b;1m.1V=1i.1b.r;1m.X=1i.X+\'Z\';1m.V=1i.V+\'Z\';e.2f.3I(c,e);e.2f.4m(e)};4.u.4t=d(e){7(!4.3u(e))f 1a;6 t=4(e);6 A=e.19;6 1I=1a;6 K={};K.M=t.H(\'M\');7(t.H(\'R\')==\'T\'){1E=t.H(\'17\');A.17=\'1T\';A.R=\'\';1I=24}K.2K=4.15.3i(e);K.1b=4.15.3n(e);6 3e=e.1B?e.1B.3z:t.H(\'4p\');K.X=F(t.H(\'X\'))||0;K.V=F(t.H(\'V\'))||0;6 3H=\'4k\'+F(18.4o()*3W);6 1w=G.4s(/^3F$|^4q$|^4r$|^4i$|^4h$|^4j$|^3g$|^4l$|^4n$|^4R$|^4K$|^4J$|^4I$|^4H$/i.29(e.2A)?\'4L\':e.2A);4.1h(1w,\'4u\',3H);1w.3N=\'4P\';6 O=1w.19;6 X=0;6 V=0;7(K.M==\'3b\'||K.M==\'22\'){X=K.X;V=K.V}O.R=\'T\';O.X=X+\'Z\';O.V=V+\'Z\';O.M=K.M!=\'3b\'&&K.M!=\'22\'?\'3b\':K.M;O.2G=\'1T\';O.2O=K.2K.1q+\'Z\';O.30=K.2K.1r+\'Z\';O.1Z=K.1b.t;O.1V=K.1b.r;O.1W=K.1b.b;O.1X=K.1b.l;7(4.38.4y){O.3z=3e}k{O.4w=3e}e.2f.3I(1w,e);A.1Z=\'1P\';A.1V=\'1P\';A.1W=\'1P\';A.1X=\'1P\';A.M=\'22\';A.4C=\'T\';A.X=\'1P\';A.V=\'1P\';7(1I){A.R=\'T\';A.17=1E}1w.6K(e);O.R=\'25\';f{K:K,6I:4(1w)}};4.u.23={6N:[0,D,D],6R:[3K,D,D],6Q:[3o,3o,6P],6O:[0,0,0],6H:[0,0,D],6G:[3D,42,42],6z:[0,D,D],6y:[0,0,1H],6x:[0,1H,1H],6T:[2L,2L,2L],6v:[0,6w,0],6A:[6B,6F,3x],6E:[1H,0,1H],6D:[6C,3x,47],6S:[D,3B,0],78:[77,50,79],74:[1H,0,0],76:[72,6W,6V],73:[6U,0,2t],6X:[D,0,D],6Y:[D,71,0],70:[0,1y,0],6Z:[75,0,6t],5X:[3K,3C,3B],5W:[5V,5T,3C],5U:[3y,D,D],5Y:[3A,5Z,3A],63:[2t,2t,2t],62:[D,6u,60],5S:[D,D,3y],5K:[0,D,0],5J:[D,0,D],5I:[1y,0,0],5G:[0,0,1y],5H:[1y,1y,0],5L:[D,3D,0],5Q:[D,2w,5P],5O:[1y,0,1y],64:[D,0,0],65:[2w,2w,2w],6l:[D,D,D],6k:[D,D,0]};4.u.1A=d(14,3m){7(4.u.23[14])f{r:4.u.23[14][0],g:4.u.23[14][1],b:4.u.23[14][2]};k 7(L=/^1K\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)$/.2n(14))f{r:F(L[1]),g:F(L[2]),b:F(L[3])};k 7(L=/1K\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)$/.2n(14))f{r:10(L[1])*2.55,g:10(L[2])*2.55,b:10(L[3])*2.55};k 7(L=/^#([a-1R-1G-9])([a-1R-1G-9])([a-1R-1G-9])$/.2n(14))f{r:F("1L"+L[1]+L[1]),g:F("1L"+L[2]+L[2]),b:F("1L"+L[3]+L[3])};k 7(L=/^#([a-1R-1G-9]{2})([a-1R-1G-9]{2})([a-1R-1G-9]{2})$/.2n(14))f{r:F("1L"+L[1]),g:F("1L"+L[2]),b:F("1L"+L[3])};k f 3m==24?1a:{r:D,g:D,b:D}};4.u.3O={3l:1,2T:1,3L:1,2M:1,68:1,66:1,2O:1,V:1,67:1,6b:1,1W:1,1X:1,1V:1,1Z:1,6f:1,6e:1,6d:1,4E:1,1j:1,6g:1,6c:1,48:1,4d:1,46:1,4c:1,69:1,6a:1,X:1,30:1,2j:1};4.u.41={6h:1,6i:1,6p:1,6q:1,6r:1,14:1,6s:1};4.u.20=[\'6o\',\'6n\',\'6j\',\'6m\'];4.u.2X={\'2Q\':[\'21\',\'4a\'],\'2d\':[\'21\',\'3f\'],\'2m\':[\'2m\',\'\'],\'2l\':[\'2l\',\'\']};4.40.3a({5N:d(1k,11,q,2v){f C.1O(d(){6 2u=4.11(11,q,2v);6 e=1p 4.3Q(C,2u,1k)})},2Y:d(11,2v){f C.1O(d(){6 2u=4.11(11,2v);6 e=1p 4.2Y(C,2u)})},5M:d(U){f C.2h(d(){7(C.1f)4.32(C,U)})},5R:d(U){f C.2h(d(){7(C.1f)4.32(C,U);7(C.1O&&C.1O[\'u\'])C.1O.u=[]})}});4.3a({2Y:d(B,I){6 z=C,4f;z.U=d(){7(4.45(I.2I))I.2I.4b(B)};z.1g=2P(d(){z.U()},I.W);B.1f=z},q:{4g:d(p,n,3Z,3V,W){f((-18.33(p*18.2N)/2)+0.5)*3V+3Z}},3Q:d(B,I,1k){6 z=C,4f;6 y=B.19;6 3T=4.H(B,"2G");6 1J=4.H(B,"R");6 E={};z.2B=(1p 2y()).2b();I.q=I.q&&4.q[I.q]?I.q:\'4g\';z.2D=d(J,S){7(4.u.3O[J]){7(S==\'2E\'||S==\'2z\'||S==\'3X\'){7(!B.1s)B.1s={};6 r=10(4.1x(B,J));B.1s[J]=r&&r>-3W?r:(10(4.H(B,J))||0);S=S==\'3X\'?(1J==\'T\'?\'2E\':\'2z\'):S;I[S]=24;E[J]=S==\'2E\'?[0,B.1s[J]]:[B.1s[J],0];7(J!=\'1j\')y[J]=E[J][0]+(J!=\'2j\'&&J!=\'31\'?\'Z\':\'\');k 4.1h(y,"1j",E[J][0])}k{E[J]=[10(4.1x(B,J)),10(S)||0]}}k 7(4.u.41[J])E[J]=[4.u.1A(4.1x(B,J)),4.u.1A(S)];k 7(/^2m$|2l$|21$|2d$|2Q$/i.29(J)){6 m=S.1t(/\\s+/g,\' \').1t(/1K\\s*\\(\\s*/g,\'1K(\').1t(/\\s*,\\s*/g,\',\').1t(/\\s*\\)/g,\')\').6M(/([^\\s]+)/g);6J(J){1Y\'2m\':1Y\'2l\':1Y\'2Q\':1Y\'2d\':m[3]=m[3]||m[1]||m[0];m[2]=m[2]||m[0];m[1]=m[1]||m[0];P(6 i=0;i<4.u.20.1l;i++){6 1e=4.u.2X[J][0]+4.u.20[i]+4.u.2X[J][1];E[1e]=J==\'2d\'?[4.u.1A(4.1x(B,1e)),4.u.1A(m[i])]:[10(4.1x(B,1e)),10(m[i])]}3P;1Y\'21\':P(6 i=0;i<m.1l;i++){6 34=10(m[i]);6 2k=!6L(34)?\'4a\':(!/61|T|1T|5j|4B|4D|5F|4A|4z|4v|4x/i.29(m[i])?\'3f\':1a);7(2k){P(6 j=0;j<4.u.20.1l;j++){1e=\'21\'+4.u.20[j]+2k;E[1e]=2k==\'3f\'?[4.u.1A(4.1x(B,1e)),4.u.1A(m[i])]:[10(4.1x(B,1e)),34]}}k{y[\'4F\']=m[i]}}3P}}k{y[J]=S}f 1a};P(p 1u 1k){7(p==\'19\'){6 1c=4.2U(1k[p]);P(1S 1u 1c){C.2D(1S,1c[1S])}}k 7(p==\'3N\'){7(G.2x)P(6 i=0;i<G.2x.1l;i++){6 1N=G.2x[i].1N||G.2x[i].4G||1v;7(1N){P(6 j=0;j<1N.1l;j++){7(1N[j].4N==\'.\'+1k[p]){6 1M=1p 4O(\'\\.\'+1k[p]+\' {\');6 1d=1N[j].19.4M;6 1c=4.2U(1d.1t(1M,\'\').1t(/}/g,\'\'));P(1S 1u 1c){C.2D(1S,1c[1S])}}}}}}k{C.2D(p,1k[p])}}y.R=1J==\'T\'?\'25\':1J;y.2G=\'1T\';z.U=d(){6 t=(1p 2y()).2b();7(t>I.W+z.2B){37(z.1g);z.1g=1v;P(p 1u E){7(p=="1j")4.1h(y,"1j",E[p][1]);k 7(2H E[p][1]==\'3g\')y[p]=\'1K(\'+E[p][1].r+\',\'+E[p][1].g+\',\'+E[p][1].b+\')\';k y[p]=E[p][1]+(p!=\'2j\'&&p!=\'31\'?\'Z\':\'\')}7(I.2z||I.2E)P(6 p 1u B.1s)7(p=="1j")4.1h(y,p,B.1s[p]);k y[p]="";y.R=I.2z?\'T\':(1J!=\'T\'?1J:\'25\');y.2G=3T;B.1f=1v;7(4.45(I.2I))I.2I.4b(B)}k{6 n=t-C.2B;6 26=n/I.W;P(p 1u E){7(2H E[p][1]==\'3g\'){y[p]=\'1K(\'+F(4.q[I.q](26,n,E[p][0].r,(E[p][1].r-E[p][0].r),I.W))+\',\'+F(4.q[I.q](26,n,E[p][0].g,(E[p][1].g-E[p][0].g),I.W))+\',\'+F(4.q[I.q](26,n,E[p][0].b,(E[p][1].b-E[p][0].b),I.W))+\')\'}k{6 3k=4.q[I.q](26,n,E[p][0],(E[p][1]-E[p][0]),I.W);7(p=="1j")4.1h(y,"1j",3k);k y[p]=3k+(p!=\'2j\'&&p!=\'31\'?\'Z\':\'\')}}}};z.1g=2P(d(){z.U()},13);B.1f=z},32:d(B,U){7(U)B.1f.2B-=4Q;k{2q.37(B.1f.1g);B.1f=1v;4.3R(B,"u")}}});4.2U=d(1d){6 1c={};7(2H 1d==\'5E\'){1d=1d.2R().3d(\';\');P(6 i=0;i<1d.1l;i++){1M=1d[i].3d(\':\');7(1M.1l==2){1c[4.3Y(1M[0].1t(/\\-(\\w)/g,d(m,c){f c.5x()}))]=4.3Y(1M[1])}}}f 1c};4.40.3a({2i:d(11,N,q){o=4.11(11);f C.1O(\'43\',d(){1p 4.u.2i(C,o,N,q)})},52:d(11,N,q){f C.2h(d(){4(\'a[@3U*="#"]\',C).4Y(d(e){3M=C.3U.3d(\'#\');4(\'#\'+3M[1]).2i(11,N,q);f 1a})})}});4.u.2i=d(e,o,N,q){6 z=C;z.o=o;z.e=e;z.N=/44|49/.29(N)?N:1a;z.q=q;p=4.15.3S(e);s=4.15.36();z.4e=d(){37(z.1g);z.1g=1v;4.3R(z.e,\'43\')};z.t=(1p 2y).2b();s.h=s.h>s.1o?(s.h-s.1o):s.h;s.w=s.w>s.1n?(s.w-s.1n):s.w;z.2e=p.y>s.h?s.h:p.y;z.2r=p.x>s.w?s.w:p.x;z.1C=s.t;z.1D=s.l;z.U=d(){6 t=(1p 2y).2b();6 n=t-z.t;6 p=n/z.o.W;7(t>=z.o.W+z.t){z.4e();5b(d(){z.2W(z.2e,z.2r)},13)}k{7(!z.N||z.N==\'44\'){7(!4.q||!4.q[z.q]){2o=((-18.33(p*18.2N)/2)+0.5)*(z.2e-z.1C)+z.1C}k{2o=4.q[z.q](p,n,z.1C,(z.2e-z.1C),z.o.W)}}k{2o=z.1C}7(!z.N||z.N==\'49\'){7(!4.q||!4.q[z.q]){2p=((-18.33(p*18.2N)/2)+0.5)*(z.2r-z.1D)+z.1D}k{2p=4.q[z.q](p,n,z.1D,(z.2r-z.1D),z.o.W)}}k{2p=z.1D}z.2W(2o,2p)}};z.2W=d(t,l){2q.59(l,t)};z.1g=2P(d(){z.U()},13)};',62,444,'||||jQuery||var|if|el|||||function||return|||||else||||||easing||||fx||||||es|elem|this|255|props|parseInt|document|css|options|tp|oldStyle|result|position|axis|wrs|for|body|display|vp|none|step|left|duration|top|documentElement|px|parseFloat|speed|nodeEl||color|iUtil|clientScroll|visibility|Math|style|false|margins|newStyles|styles|nmp|animationHandler|timer|attr|old|opacity|prop|length|cs|iw|ih|new|hb|wb|orig|replace|in|null|wr|curCSS|128|scrollTop|parseColor|currentStyle|startTop|startLeft|oldVisibility|de|F0|139|restoreStyle|oldDisplay|rgb|0x|rule|cssRules|queue|0px|scrollLeft|fA|np|hidden|toInteger|marginRight|marginBottom|marginLeft|case|marginTop|cssSides|border|absolute|namedColors|true|block|pr|event|clientWidth|test|clientHeight|getTime|self|borderColor|endTop|parentNode|while|each|ScrollTo|zIndex|sideEnd|padding|margin|exec|st|sl|window|endLeft|oldPosition|211|opt|callback|192|styleSheets|Date|hide|nodeName|startTime|src|getValues|show|png|overflow|typeof|complete|scrollHeight|sizes|169|borderTopWidth|PI|height|setInterval|borderWidth|toLowerCase|scrollWidth|borderLeftWidth|parseStyle|offsetWidth|scroll|cssSidesEnd|pause|offsetHeight|width|fontWeight|stopAnim|cos|floatVal|func|getScroll|clearInterval|browser|traverseDOM|extend|relative|windowSize|split|oldFloat|Color|object|innerHeight|getSize|innerWidth|pValue|borderBottomWidth|notColor|getMargins|245|max|tagName|opera|offsetLeft|firstChild|fxCheckTag|offsetTop|images|107|224|styleFloat|144|140|230|165|emptyGIF|img|offsetParent|wid|insertBefore|indexOf|240|borderRightWidth|parts|className|cssProps|break|fxe|dequeue|getPosition|oldOverflow|href|delta|10000|toggle|trim|firstNum|fn|colorCssProps||interfaceFX|vertical|isFunction|paddingRight||paddingBottom|horizontal|Width|apply|paddingTop|paddingLeft|clear|values|linear|select|hr|textarea|w_|iframe|removeChild|button|random|float|br|input|createElement|buildWrapper|id|inset|cssFloat|outset|msie|ridge|groove|dashed|listStyle|solid|minWidth|borderStyle|rules|ol|dl|ul|table|div|cssText|selectorText|RegExp|fxWrapper|100000000|form|script|vertically|centerEl|purgeEvents|nextSibling|horizontally|click|progid||filter|ScrollToAnchors|fixPNG|clientY||pageY|getClient|getSizeLite|scrollTo|getPositionLite|setTimeout|getPadding|clientX|pageX|getPointer|getBorder|DXImageTransform|Microsoft|dotted|header|th|colgroup|frame|frameset|destroyWrapper|meta|optgroup|option|col|tfoot|prototype|Array|toUpperCase|AlphaImageLoader|tr|td|thead|caption|tbody|string|double|navy|olive|maroon|magenta|lime|orange|stop|animate|purple|203|pink|stopAll|lightyellow|216|lightcyan|173|lightblue|khaki|lightgreen|238|193|transparent|lightpink|lightgrey|red|silver|fontSize|letterSpacing|bottom|right|textIndent|lineHeight|outlineWidth|minHeight|maxWidth|maxHeight|outlineOffset|backgroundColor|borderBottomColor|Bottom|yellow|white|Left|Right|Top|borderLeftColor|borderRightColor|borderTopColor|outlineColor|130|182|darkgreen|100|darkcyan|darkblue|cyan|darkkhaki|189|85|darkolivegreen|darkmagenta|183|brown|blue|wrapper|switch|appendChild|isNaN|match|aqua|black|220|beige|azure|darkorange|darkgrey|148|122|150|fuchsia|gold|indigo|green|215|233|darkviolet|darkred||darksalmon|153|darkorchid|204'.split('|'),0,{}))
	// /js/jquery/jquery.interface.sort.js
	/**
 * Interface Elements for jQuery
 *
 * http://interface.eyecon.ro
 *
 * Copyright (c) 2006 Stefan Petre
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * modification for jQuery 1.3.2 by mixxt
 *
 */

jQuery.iDrop={fit:function(zonex,zoney,zonew,zoneh)
{return zonex<=jQuery.iDrag.dragged.dragCfg.nx&&(zonex+zonew)>=(jQuery.iDrag.dragged.dragCfg.nx+jQuery.iDrag.dragged.dragCfg.oC.w)&&zoney<=jQuery.iDrag.dragged.dragCfg.ny&&(zoney+zoneh)>=(jQuery.iDrag.dragged.dragCfg.ny+jQuery.iDrag.dragged.dragCfg.oC.h)?true:false;},intersect:function(zonex,zoney,zonew,zoneh)
{return!(zonex>(jQuery.iDrag.dragged.dragCfg.nx+jQuery.iDrag.dragged.dragCfg.oC.w)||(zonex+zonew)<jQuery.iDrag.dragged.dragCfg.nx||zoney>(jQuery.iDrag.dragged.dragCfg.ny+jQuery.iDrag.dragged.dragCfg.oC.h)||(zoney+zoneh)<jQuery.iDrag.dragged.dragCfg.ny)?true:false;},pointer:function(zonex,zoney,zonew,zoneh)
{return zonex<jQuery.iDrag.dragged.dragCfg.currentPointer.x&&(zonex+zonew)>jQuery.iDrag.dragged.dragCfg.currentPointer.x&&zoney<jQuery.iDrag.dragged.dragCfg.currentPointer.y&&(zoney+zoneh)>jQuery.iDrag.dragged.dragCfg.currentPointer.y?true:false;},overzone:false,highlighted:{},count:0,zones:{},highlight:function(elm)
{if(jQuery.iDrag.dragged==null){return;}
var i;jQuery.iDrop.highlighted={};var oneIsSortable=false;for(i in jQuery.iDrop.zones){if(jQuery.iDrop.zones[i]!=null){var iEL=jQuery.iDrop.zones[i].get(0);if(jQuery(jQuery.iDrag.dragged).is('.'+iEL.dropCfg.a)){if(iEL.dropCfg.m==false){iEL.dropCfg.p=jQuery.extend(jQuery.iUtil.getPositionLite(iEL),jQuery.iUtil.getSizeLite(iEL));iEL.dropCfg.m=true;}
if(iEL.dropCfg.ac){jQuery.iDrop.zones[i].addClass(iEL.dropCfg.ac);}
jQuery.iDrop.highlighted[i]=jQuery.iDrop.zones[i];if(jQuery.iSort&&iEL.dropCfg.s&&jQuery.iDrag.dragged.dragCfg.so){iEL.dropCfg.el=jQuery('.'+iEL.dropCfg.a,iEL);elm.style.display='none';jQuery.iSort.measure(iEL);iEL.dropCfg.os=jQuery.iSort.serialize(jQuery.attr(iEL,'id')).hash;elm.style.display=elm.dragCfg.oD;oneIsSortable=true;}
if(iEL.dropCfg.onActivate){iEL.dropCfg.onActivate.apply(jQuery.iDrop.zones[i].get(0),[jQuery.iDrag.dragged]);}}}}
if(oneIsSortable){jQuery.iSort.start();}},remeasure:function()
{jQuery.iDrop.highlighted={};for(i in jQuery.iDrop.zones){if(jQuery.iDrop.zones[i]!=null){var iEL=jQuery.iDrop.zones[i].get(0);if(jQuery(jQuery.iDrag.dragged).is('.'+iEL.dropCfg.a)){iEL.dropCfg.p=jQuery.extend(jQuery.iUtil.getPositionLite(iEL),jQuery.iUtil.getSizeLite(iEL));if(iEL.dropCfg.ac){jQuery.iDrop.zones[i].addClass(iEL.dropCfg.ac);}
jQuery.iDrop.highlighted[i]=jQuery.iDrop.zones[i];if(jQuery.iSort&&iEL.dropCfg.s&&jQuery.iDrag.dragged.dragCfg.so){iEL.dropCfg.el=jQuery('.'+iEL.dropCfg.a,iEL);elm.style.display='none';jQuery.iSort.measure(iEL);elm.style.display=elm.dragCfg.oD;}}}}},checkhover:function(e)
{if(jQuery.iDrag.dragged==null){return;}
jQuery.iDrop.overzone=false;var i;var applyOnHover=false;var hlt=0;for(i in jQuery.iDrop.highlighted)
{var iEL=jQuery.iDrop.highlighted[i].get(0);if(jQuery.iDrop.overzone==false&&jQuery.iDrop[iEL.dropCfg.t](iEL.dropCfg.p.x,iEL.dropCfg.p.y,iEL.dropCfg.p.wb,iEL.dropCfg.p.hb)){if(iEL.dropCfg.hc&&iEL.dropCfg.h==false){jQuery.iDrop.highlighted[i].addClass(iEL.dropCfg.hc);}
if(iEL.dropCfg.h==false&&iEL.dropCfg.onHover){applyOnHover=true;}
iEL.dropCfg.h=true;jQuery.iDrop.overzone=iEL;if(jQuery.iSort&&iEL.dropCfg.s&&jQuery.iDrag.dragged.dragCfg.so){jQuery.iSort.helper.get(0).className=iEL.dropCfg.shc;jQuery.iSort.checkhover(iEL);}
hlt++;}else if(iEL.dropCfg.h==true){if(iEL.dropCfg.onOut){iEL.dropCfg.onOut.apply(iEL,[e,jQuery.iDrag.helper.get(0).firstChild,iEL.dropCfg.fx]);}
if(iEL.dropCfg.hc){jQuery.iDrop.highlighted[i].removeClass(iEL.dropCfg.hc);}
iEL.dropCfg.h=false;}}
if(jQuery.iSort&&!jQuery.iDrop.overzone&&jQuery.iDrag.dragged.so){jQuery.iSort.helper.get(0).style.display='none';}
if(applyOnHover){jQuery.iDrop.overzone.dropCfg.onHover.apply(jQuery.iDrop.overzone,[e,jQuery.iDrag.helper.get(0).firstChild]);}},checkdrop:function(e)
{var i;for(i in jQuery.iDrop.highlighted){var iEL=jQuery.iDrop.highlighted[i].get(0);if(iEL.dropCfg.ac){jQuery.iDrop.highlighted[i].removeClass(iEL.dropCfg.ac);}
if(iEL.dropCfg.hc){jQuery.iDrop.highlighted[i].removeClass(iEL.dropCfg.hc);}
if(iEL.dropCfg.s){jQuery.iSort.changed[jQuery.iSort.changed.length]=i;}
if(iEL.dropCfg.onDrop&&iEL.dropCfg.h==true){iEL.dropCfg.h=false;iEL.dropCfg.onDrop.apply(iEL,[e,iEL.dropCfg.fx]);}
iEL.dropCfg.m=false;iEL.dropCfg.h=false;}
jQuery.iDrop.highlighted={};},destroy:function()
{return this.each(function()
{if(this.isDroppable){if(this.dropCfg.s){id=jQuery.attr(this,'id');jQuery.iSort.collected[id]=null;jQuery('.'+this.dropCfg.a,this).DraggableDestroy();}
jQuery.iDrop.zones['d'+this.idsa]=null;this.isDroppable=false;this.f=null;}});},build:function(o)
{return this.each(function()
{if(this.isDroppable==true||!o.accept||!jQuery.iUtil||!jQuery.iDrag){return;}
this.dropCfg={a:o.accept,ac:o.activeclass||false,hc:o.hoverclass||false,shc:o.helperclass||false,onDrop:o.ondrop||o.onDrop||false,onHover:o.onHover||o.onhover||false,onOut:o.onOut||o.onout||false,onActivate:o.onActivate||false,t:o.tolerance&&(o.tolerance=='fit'||o.tolerance=='intersect')?o.tolerance:'pointer',fx:o.fx?o.fx:false,m:false,h:false};if(o.sortable==true&&jQuery.iSort){id=jQuery.attr(this,'id');jQuery.iSort.collected[id]=this.dropCfg.a;this.dropCfg.s=true;if(o.onChange){this.dropCfg.onChange=o.onChange;this.dropCfg.os=jQuery.iSort.serialize(id).hash;}}
this.isDroppable=true;this.idsa=parseInt(Math.random()*10000);jQuery.iDrop.zones['d'+this.idsa]=jQuery(this);jQuery.iDrop.count++;});}};jQuery.fn.extend({DroppableDestroy:jQuery.iDrop.destroy,Droppable:jQuery.iDrop.build});jQuery.recallDroppables=jQuery.iDrop.remeasure;jQuery.iDrag={helper:null,dragged:null,destroy:function()
{return this.each(function()
{if(this.isDraggable){this.dragCfg.dhe.unbind('mousedown',jQuery.iDrag.draginit);this.dragCfg=null;this.isDraggable=false;if(jQuery.browser.msie){this.unselectable="off";}else{this.style.MozUserSelect='';this.style.KhtmlUserSelect='';this.style.userSelect='';}}});},draginit:function(e)
{if(jQuery.iDrag.dragged!=null){jQuery.iDrag.dragstop(e);return false;}
var elm=this.dragElem;jQuery(document).bind('mousemove',jQuery.iDrag.dragmove).bind('mouseup',jQuery.iDrag.dragstop);elm.dragCfg.pointer=jQuery.iUtil.getPointer(e);elm.dragCfg.currentPointer=elm.dragCfg.pointer;elm.dragCfg.init=false;elm.dragCfg.fromHandler=this!=this.dragElem;jQuery.iDrag.dragged=elm;if(elm.dragCfg.si&&this!=this.dragElem){parentPos=jQuery.iUtil.getPosition(elm.parentNode);sliderSize=jQuery.iUtil.getSize(elm);sliderPos={x:parseInt(jQuery.css(elm,'left'))||0,y:parseInt(jQuery.css(elm,'top'))||0};dx=elm.dragCfg.currentPointer.x-parentPos.x-sliderSize.wb/2-sliderPos.x;dy=elm.dragCfg.currentPointer.y-parentPos.y-sliderSize.hb/2-sliderPos.y;jQuery.iSlider.dragmoveBy(elm,[dx,dy]);}
return jQuery.selectKeyHelper||false;},dragstart:function(e)
{var elm=jQuery.iDrag.dragged;elm.dragCfg.init=true;var dEs=elm.style;elm.dragCfg.oD=jQuery.css(elm,'display');elm.dragCfg.oP=jQuery.css(elm,'position');if(!elm.dragCfg.initialPosition)
elm.dragCfg.initialPosition=elm.dragCfg.oP;elm.dragCfg.oR={x:parseInt(jQuery.css(elm,'left'))||0,y:parseInt(jQuery.css(elm,'top'))||0};elm.dragCfg.diffX=0;elm.dragCfg.diffY=0;if(jQuery.browser.msie){var oldBorder=jQuery.iUtil.getBorder(elm,true);elm.dragCfg.diffX=oldBorder.l||0;elm.dragCfg.diffY=oldBorder.t||0;}
elm.dragCfg.oC=jQuery.extend(jQuery.iUtil.getPosition(elm),jQuery.iUtil.getSize(elm));if(elm.dragCfg.oP!='relative'&&elm.dragCfg.oP!='absolute'){dEs.position='relative';}
jQuery.iDrag.helper.empty();var clonedEl=$(elm).clone(true).get(0);jQuery(clonedEl).css({display:'block',left:'0px',top:'0px'});clonedEl.style.marginTop='0';clonedEl.style.marginRight='0';clonedEl.style.marginBottom='0';clonedEl.style.marginLeft='0';jQuery.iDrag.helper.append(clonedEl);var dhs=jQuery.iDrag.helper.get(0).style;if(elm.dragCfg.autoSize){dhs.width='auto';dhs.height='auto';}else{dhs.height=elm.dragCfg.oC.hb+'px';dhs.width=elm.dragCfg.oC.wb+'px';}
dhs.display='block';dhs.marginTop='0px';dhs.marginRight='0px';dhs.marginBottom='0px';dhs.marginLeft='0px';jQuery.extend(elm.dragCfg.oC,jQuery.iUtil.getSize(clonedEl));if(elm.dragCfg.cursorAt){if(elm.dragCfg.cursorAt.left){elm.dragCfg.oR.x+=elm.dragCfg.pointer.x-elm.dragCfg.oC.x-elm.dragCfg.cursorAt.left;elm.dragCfg.oC.x=elm.dragCfg.pointer.x-elm.dragCfg.cursorAt.left;}
if(elm.dragCfg.cursorAt.top){elm.dragCfg.oR.y+=elm.dragCfg.pointer.y-elm.dragCfg.oC.y-elm.dragCfg.cursorAt.top;elm.dragCfg.oC.y=elm.dragCfg.pointer.y-elm.dragCfg.cursorAt.top;}
if(elm.dragCfg.cursorAt.right){elm.dragCfg.oR.x+=elm.dragCfg.pointer.x-elm.dragCfg.oC.x-elm.dragCfg.oC.hb+elm.dragCfg.cursorAt.right;elm.dragCfg.oC.x=elm.dragCfg.pointer.x-elm.dragCfg.oC.wb+elm.dragCfg.cursorAt.right;}
if(elm.dragCfg.cursorAt.bottom){elm.dragCfg.oR.y+=elm.dragCfg.pointer.y-elm.dragCfg.oC.y-elm.dragCfg.oC.hb+elm.dragCfg.cursorAt.bottom;elm.dragCfg.oC.y=elm.dragCfg.pointer.y-elm.dragCfg.oC.hb+elm.dragCfg.cursorAt.bottom;}}
elm.dragCfg.nx=elm.dragCfg.oR.x;elm.dragCfg.ny=elm.dragCfg.oR.y;if(elm.dragCfg.insideParent||elm.dragCfg.containment=='parent'){parentBorders=jQuery.iUtil.getBorder(elm.parentNode,true);elm.dragCfg.oC.x=elm.offsetLeft+(jQuery.browser.msie?0:jQuery.browser.opera?-parentBorders.l:parentBorders.l);elm.dragCfg.oC.y=elm.offsetTop+(jQuery.browser.msie?0:jQuery.browser.opera?-parentBorders.t:parentBorders.t);jQuery(elm.parentNode).append(jQuery.iDrag.helper.get(0));}
if(elm.dragCfg.containment){jQuery.iDrag.getContainment(elm);elm.dragCfg.onDragModifier.containment=jQuery.iDrag.fitToContainer;}
if(elm.dragCfg.si){jQuery.iSlider.modifyContainer(elm);}
dhs.left=elm.dragCfg.oC.x-elm.dragCfg.diffX+'px';dhs.top=elm.dragCfg.oC.y-elm.dragCfg.diffY+'px';dhs.width=elm.dragCfg.oC.wb+'px';dhs.height=elm.dragCfg.oC.hb+'px';jQuery.iDrag.dragged.dragCfg.prot=false;if(elm.dragCfg.gx){elm.dragCfg.onDragModifier.grid=jQuery.iDrag.snapToGrid;}
if(elm.dragCfg.zIndex!=false){jQuery.iDrag.helper.css('zIndex',elm.dragCfg.zIndex);}
if(elm.dragCfg.opacity){jQuery.iDrag.helper.css('opacity',elm.dragCfg.opacity);if(window.ActiveXObject){jQuery.iDrag.helper.css('filter','alpha(opacity='+elm.dragCfg.opacity*100+')');}}
if(elm.dragCfg.frameClass){jQuery.iDrag.helper.addClass(elm.dragCfg.frameClass);jQuery.iDrag.helper.get(0).firstChild.style.display='none';}
if(elm.dragCfg.onStart)
elm.dragCfg.onStart.apply(elm,[clonedEl,elm.dragCfg.oR.x,elm.dragCfg.oR.y]);if(jQuery.iDrop&&jQuery.iDrop.count>0){jQuery.iDrop.highlight(elm);}
if(elm.dragCfg.ghosting==false){dEs.display='none';}
return false;},getContainment:function(elm)
{if(elm.dragCfg.containment.constructor==String){if(elm.dragCfg.containment=='parent'){elm.dragCfg.cont=jQuery.extend({x:0,y:0},jQuery.iUtil.getSize(elm.parentNode));var contBorders=jQuery.iUtil.getBorder(elm.parentNode,true);elm.dragCfg.cont.w=elm.dragCfg.cont.wb-contBorders.l-contBorders.r;elm.dragCfg.cont.h=elm.dragCfg.cont.hb-contBorders.t-contBorders.b;}else if(elm.dragCfg.containment=='document'){var clnt=jQuery.iUtil.getClient();elm.dragCfg.cont={x:0,y:0,w:clnt.w,h:clnt.h};}}else if(elm.dragCfg.containment.constructor==Array){elm.dragCfg.cont={x:parseInt(elm.dragCfg.containment[0])||0,y:parseInt(elm.dragCfg.containment[1])||0,w:parseInt(elm.dragCfg.containment[2])||0,h:parseInt(elm.dragCfg.containment[3])||0};}
elm.dragCfg.cont.dx=elm.dragCfg.cont.x-elm.dragCfg.oC.x;elm.dragCfg.cont.dy=elm.dragCfg.cont.y-elm.dragCfg.oC.y;},hidehelper:function(dragged)
{if(dragged.dragCfg.insideParent||dragged.dragCfg.containment=='parent'){jQuery('body',document).append(jQuery.iDrag.helper.get(0));}
jQuery.iDrag.helper.empty().hide().css('opacity',1);if(window.ActiveXObject){jQuery.iDrag.helper.css('filter','alpha(opacity=100)');}},dragstop:function(e)
{jQuery(document).unbind('mousemove',jQuery.iDrag.dragmove).unbind('mouseup',jQuery.iDrag.dragstop);if(jQuery.iDrag.dragged==null){return;}
var dragged=jQuery.iDrag.dragged;jQuery.iDrag.dragged=null;if(dragged.dragCfg.init==false){return false;}
if(dragged.dragCfg.so==true){jQuery(dragged).css('position',dragged.dragCfg.oP);}
var dEs=dragged.style;if(dragged.si){jQuery.iDrag.helper.css('cursor','move');}
if(dragged.dragCfg.frameClass){jQuery.iDrag.helper.removeClass(dragged.dragCfg.frameClass);}
if(dragged.dragCfg.revert==false){if(dragged.dragCfg.fx>0){if(!dragged.dragCfg.axis||dragged.dragCfg.axis=='horizontally'){var x=new jQuery.fx(dragged,{duration:dragged.dragCfg.fx},'left');x.custom(dragged.dragCfg.oR.x,dragged.dragCfg.nRx);}
if(!dragged.dragCfg.axis||dragged.dragCfg.axis=='vertically'){var y=new jQuery.fx(dragged,{duration:dragged.dragCfg.fx},'top');y.custom(dragged.dragCfg.oR.y,dragged.dragCfg.nRy);}}else{if(!dragged.dragCfg.axis||dragged.dragCfg.axis=='horizontally')
dragged.style.left=dragged.dragCfg.nRx+'px';if(!dragged.dragCfg.axis||dragged.dragCfg.axis=='vertically')
dragged.style.top=dragged.dragCfg.nRy+'px';}
jQuery.iDrag.hidehelper(dragged);if(dragged.dragCfg.ghosting==false){jQuery(dragged).css('display',dragged.dragCfg.oD);}}else if(dragged.dragCfg.fx>0){dragged.dragCfg.prot=true;var dh=false;if(jQuery.iDrop&&jQuery.iSort&&dragged.dragCfg.so){dh=jQuery.iUtil.getPosition(jQuery.iSort.helper.get(0));}
jQuery.iDrag.helper.animate({left:dh?dh.x:dragged.dragCfg.oC.x,top:dh?dh.y:dragged.dragCfg.oC.y},dragged.dragCfg.fx,function()
{dragged.dragCfg.prot=false;if(dragged.dragCfg.ghosting==false){dragged.style.display=dragged.dragCfg.oD;}
jQuery.iDrag.hidehelper(dragged);});}else{jQuery.iDrag.hidehelper(dragged);if(dragged.dragCfg.ghosting==false){jQuery(dragged).css('display',dragged.dragCfg.oD);}}
if(jQuery.iDrop&&jQuery.iDrop.count>0){jQuery.iDrop.checkdrop(dragged);}
if(jQuery.iSort&&dragged.dragCfg.so){jQuery.iSort.check(dragged);}
if(dragged.dragCfg.onChange&&(dragged.dragCfg.nRx!=dragged.dragCfg.oR.x||dragged.dragCfg.nRy!=dragged.dragCfg.oR.y)){dragged.dragCfg.onChange.apply(dragged,dragged.dragCfg.lastSi||[0,0,dragged.dragCfg.nRx,dragged.dragCfg.nRy]);}
if(dragged.dragCfg.onStop)
dragged.dragCfg.onStop.apply(dragged);return false;},snapToGrid:function(x,y,dx,dy)
{if(dx!=0)
dx=parseInt((dx+(this.dragCfg.gx*dx/Math.abs(dx))/2)/this.dragCfg.gx)*this.dragCfg.gx;if(dy!=0)
dy=parseInt((dy+(this.dragCfg.gy*dy/Math.abs(dy))/2)/this.dragCfg.gy)*this.dragCfg.gy;return{dx:dx,dy:dy,x:0,y:0};},fitToContainer:function(x,y,dx,dy)
{dx=Math.min(Math.max(dx,this.dragCfg.cont.dx),this.dragCfg.cont.w+this.dragCfg.cont.dx-this.dragCfg.oC.wb);dy=Math.min(Math.max(dy,this.dragCfg.cont.dy),this.dragCfg.cont.h+this.dragCfg.cont.dy-this.dragCfg.oC.hb);return{dx:dx,dy:dy,x:0,y:0}},dragmove:function(e)
{if(jQuery.iDrag.dragged==null||jQuery.iDrag.dragged.dragCfg.prot==true){return;}
var dragged=jQuery.iDrag.dragged;dragged.dragCfg.currentPointer=jQuery.iUtil.getPointer(e);if(dragged.dragCfg.init==false){distance=Math.sqrt(Math.pow(dragged.dragCfg.pointer.x-dragged.dragCfg.currentPointer.x,2)+Math.pow(dragged.dragCfg.pointer.y-dragged.dragCfg.currentPointer.y,2));if(distance<dragged.dragCfg.snapDistance){return;}else{jQuery.iDrag.dragstart(e);}}
var dx=dragged.dragCfg.currentPointer.x-dragged.dragCfg.pointer.x;var dy=dragged.dragCfg.currentPointer.y-dragged.dragCfg.pointer.y;for(var i in dragged.dragCfg.onDragModifier){var newCoords=dragged.dragCfg.onDragModifier[i].apply(dragged,[dragged.dragCfg.oR.x+dx,dragged.dragCfg.oR.y+dy,dx,dy]);if(newCoords&&newCoords.constructor==Object){dx=i!='user'?newCoords.dx:(newCoords.x-dragged.dragCfg.oR.x);dy=i!='user'?newCoords.dy:(newCoords.y-dragged.dragCfg.oR.y);}}
dragged.dragCfg.nx=dragged.dragCfg.oC.x+dx-dragged.dragCfg.diffX;dragged.dragCfg.ny=dragged.dragCfg.oC.y+dy-dragged.dragCfg.diffY;if(dragged.dragCfg.si&&(dragged.dragCfg.onSlide||dragged.dragCfg.onChange)){jQuery.iSlider.onSlide(dragged,dragged.dragCfg.nx,dragged.dragCfg.ny);}
if(dragged.dragCfg.onDrag)
dragged.dragCfg.onDrag.apply(dragged,[dragged.dragCfg.oR.x+dx,dragged.dragCfg.oR.y+dy]);if(!dragged.dragCfg.axis||dragged.dragCfg.axis=='horizontally'){dragged.dragCfg.nRx=dragged.dragCfg.oR.x+dx;jQuery.iDrag.helper.get(0).style.left=dragged.dragCfg.nx+'px';}
if(!dragged.dragCfg.axis||dragged.dragCfg.axis=='vertically'){dragged.dragCfg.nRy=dragged.dragCfg.oR.y+dy;jQuery.iDrag.helper.get(0).style.top=dragged.dragCfg.ny+'px';}
if(jQuery.iDrop&&jQuery.iDrop.count>0){jQuery.iDrop.checkhover(dragged);}
return false;},build:function(o)
{if(!jQuery.iDrag.helper){jQuery('body',document).append('<div id="dragHelper"></div>');jQuery.iDrag.helper=jQuery('#dragHelper');var el=jQuery.iDrag.helper.get(0);var els=el.style;els.position='absolute';els.display='none';els.cursor='move';els.listStyle='none';els.overflow='hidden';if(window.ActiveXObject){el.unselectable="on";}else{els.mozUserSelect='none';els.userSelect='none';els.KhtmlUserSelect='none';}}
if(!o){o={};}
return this.each(function()
{if(this.isDraggable||!jQuery.iUtil)
return;if(window.ActiveXObject){this.onselectstart=function(){return false;};this.ondragstart=function(){return false;};}
var el=this;var dhe=o.handle?jQuery(o.handle,this):jQuery(this);if(jQuery.browser.msie){dhe.each(function()
{this.unselectable="on";});}else{dhe.css('-moz-user-select','none');dhe.css('user-select','none');dhe.css('-khtml-user-select','none');}
this.dragCfg={dhe:dhe,revert:o.revert?true:false,ghosting:o.ghosting?true:false,so:o.so?o.so:false,si:o.si?o.si:false,insideParent:o.insideParent?o.insideParent:false,zIndex:o.zIndex?parseInt(o.zIndex)||0:false,opacity:o.opacity?parseFloat(o.opacity):false,fx:parseInt(o.fx)||null,hpc:o.hpc?o.hpc:false,onDragModifier:{},pointer:{},onStart:o.onStart&&o.onStart.constructor==Function?o.onStart:false,onStop:o.onStop&&o.onStop.constructor==Function?o.onStop:false,onChange:o.onChange&&o.onChange.constructor==Function?o.onChange:false,axis:/vertically|horizontally/.test(o.axis)?o.axis:false,snapDistance:o.snapDistance?parseInt(o.snapDistance)||0:0,cursorAt:o.cursorAt?o.cursorAt:false,autoSize:o.autoSize?true:false,frameClass:o.frameClass||false};if(o.onDragModifier&&o.onDragModifier.constructor==Function)
this.dragCfg.onDragModifier.user=o.onDragModifier;if(o.onDrag&&o.onDrag.constructor==Function)
this.dragCfg.onDrag=o.onDrag;if(o.containment&&((o.containment.constructor==String&&(o.containment=='parent'||o.containment=='document'))||(o.containment.constructor==Array&&o.containment.length==4))){this.dragCfg.containment=o.containment;}
if(o.fractions){this.dragCfg.fractions=o.fractions;}
if(o.grid){if(typeof o.grid=='number'){this.dragCfg.gx=parseInt(o.grid)||1;this.dragCfg.gy=parseInt(o.grid)||1;}else if(o.grid.length==2){this.dragCfg.gx=parseInt(o.grid[0])||1;this.dragCfg.gy=parseInt(o.grid[1])||1;}}
if(o.onSlide&&o.onSlide.constructor==Function){this.dragCfg.onSlide=o.onSlide;}
this.isDraggable=true;dhe.each(function(){this.dragElem=el;});dhe.bind('mousedown',jQuery.iDrag.draginit);})}};jQuery.fn.extend({DraggableDestroy:jQuery.iDrag.destroy,Draggable:jQuery.iDrag.build});jQuery.iSort={changed:[],collected:{},helper:false,inFrontOf:null,start:function()
{if(jQuery.iDrag.dragged==null){return;}
var shs,margins,c,cs;jQuery.iSort.helper.get(0).className=jQuery.iDrag.dragged.dragCfg.hpc;shs=jQuery.iSort.helper.get(0).style;shs.display='block';jQuery.iSort.helper.oC=jQuery.extend(jQuery.iUtil.getPosition(jQuery.iSort.helper.get(0)),jQuery.iUtil.getSize(jQuery.iSort.helper.get(0)));shs.width=jQuery.iDrag.dragged.dragCfg.oC.wb+'px';shs.height=jQuery.iDrag.dragged.dragCfg.oC.hb+'px';margins=jQuery.iUtil.getMargins(jQuery.iDrag.dragged);shs.marginTop=margins.t;shs.marginRight=margins.r;shs.marginBottom=margins.b;shs.marginLeft=margins.l;if(jQuery.iDrag.dragged.dragCfg.ghosting==true){c=jQuery.iDrag.dragged.cloneNode(true);cs=c.style;cs.marginTop='0px';cs.marginRight='0px';cs.marginBottom='0px';cs.marginLeft='0px';cs.display='block';jQuery.iSort.helper.empty().append(c);}
jQuery(jQuery.iDrag.dragged).after(jQuery.iSort.helper.get(0));jQuery.iDrag.dragged.style.display='none';},check:function(e)
{if(!e.dragCfg.so&&jQuery.iDrop.overzone.sortable){if(e.dragCfg.onStop)
e.dragCfg.onStop.apply(dragged);jQuery(e).css('position',e.dragCfg.initialPosition||e.dragCfg.oP);jQuery(e).DraggableDestroy();jQuery(jQuery.iDrop.overzone).SortableAddItem(e);}
jQuery.iSort.helper.removeClass(e.dragCfg.hpc).html('&nbsp;');jQuery.iSort.inFrontOf=null;var shs=jQuery.iSort.helper.get(0).style;shs.display='none';jQuery.iSort.helper.after(e);if(e.dragCfg.fx>0){jQuery(e).fadeIn(e.dragCfg.fx);}
jQuery('body').append(jQuery.iSort.helper.get(0));var ts=[];var fnc=false;for(var i=0;i<jQuery.iSort.changed.length;i++){var iEL=jQuery.iDrop.zones[jQuery.iSort.changed[i]].get(0);var id=jQuery.attr(iEL,'id');var ser=jQuery.iSort.serialize(id);if(iEL.dropCfg.os!=ser.hash){iEL.dropCfg.os=ser.hash;if(fnc==false&&iEL.dropCfg.onChange){fnc=iEL.dropCfg.onChange;}
ser.id=id;ts[ts.length]=ser;}}
jQuery.iSort.changed=[];if(fnc!=false&&ts.length>0){fnc(ts);}},checkhover:function(e,o)
{if(!jQuery.iDrag.dragged)
return;var cur=false;var i=0;if(e.dropCfg.el.size()>0){for(i=e.dropCfg.el.size();i>0;i--){if(e.dropCfg.el.get(i-1)!=jQuery.iDrag.dragged){if(!e.sortCfg.floats){if((e.dropCfg.el.get(i-1).pos.y+e.dropCfg.el.get(i-1).pos.hb/2)>jQuery.iDrag.dragged.dragCfg.ny){cur=e.dropCfg.el.get(i-1);}else{break;}}else{if((e.dropCfg.el.get(i-1).pos.x+e.dropCfg.el.get(i-1).pos.wb/2)>jQuery.iDrag.dragged.dragCfg.nx&&(e.dropCfg.el.get(i-1).pos.y+e.dropCfg.el.get(i-1).pos.hb/2)>jQuery.iDrag.dragged.dragCfg.ny){cur=e.dropCfg.el.get(i-1);}}}}}
if(cur&&jQuery.iSort.inFrontOf!=cur){jQuery.iSort.inFrontOf=cur;jQuery(cur).before(jQuery.iSort.helper.get(0));}else if(!cur&&(jQuery.iSort.inFrontOf!=null||jQuery.iSort.helper.get(0).parentNode!=e)){jQuery.iSort.inFrontOf=null;jQuery(e).append(jQuery.iSort.helper.get(0));}
jQuery.iSort.helper.get(0).style.display='block';},measure:function(e)
{if(jQuery.iDrag.dragged==null){return;}
e.dropCfg.el.each(function()
{this.pos=jQuery.extend(jQuery.iUtil.getSizeLite(this),jQuery.iUtil.getPositionLite(this));});},serialize:function(s)
{var i;var h='';var o={};if(s){if(jQuery.iSort.collected[s]){o[s]=[];jQuery('#'+s+' .'+jQuery.iSort.collected[s]).each(function()
{if(h.length>0){h+='&';}
h+=s+'[]='+jQuery.attr(this,'id');o[s][o[s].length]=jQuery.attr(this,'id');});}else{for(a in s){if(jQuery.iSort.collected[s[a]]){o[s[a]]=[];jQuery('#'+s[a]+' .'+jQuery.iSort.collected[s[a]]).each(function()
{if(h.length>0){h+='&';}
h+=s[a]+'[]='+jQuery.attr(this,'id');o[s[a]][o[s[a]].length]=jQuery.attr(this,'id');});}}}}else{for(i in jQuery.iSort.collected){o[i]=[];jQuery('#'+i+' .'+jQuery.iSort.collected[i]).each(function()
{if(h.length>0){h+='&';}
h+=i+'[]='+jQuery.attr(this,'id');o[i][o[i].length]=jQuery.attr(this,'id');});}}
return{hash:h,o:o};},addItem:function(e)
{if(!e.childNodes){return;}
return this.each(function()
{if(!this.sortCfg||!jQuery(e).is('.'+this.sortCfg.accept))
jQuery(e).addClass(this.sortCfg.accept);jQuery(e).Draggable(this.sortCfg.dragCfg);});},destroy:function()
{return this.each(function()
{jQuery('.'+this.sortCfg.accept).DraggableDestroy();jQuery(this).DroppableDestroy();this.sortCfg=null;this.isSortable=null;});},build:function(o)
{if(o.accept&&jQuery.iUtil&&jQuery.iDrag&&jQuery.iDrop){if(!jQuery.iSort.helper){jQuery('body',document).append('<div id="sortHelper">&nbsp;</div>');jQuery.iSort.helper=jQuery('#sortHelper');jQuery.iSort.helper.get(0).style.display='none';}
this.Droppable({accept:o.accept,activeclass:o.activeclass?o.activeclass:false,hoverclass:o.hoverclass?o.hoverclass:false,helperclass:o.helperclass?o.helperclass:false,onHover:o.onHover||o.onhover,onOut:o.onOut||o.onout,sortable:true,onChange:o.onChange||o.onchange,fx:o.fx?o.fx:false,ghosting:o.ghosting?true:false,tolerance:o.tolerance?o.tolerance:'intersect'});return this.each(function()
{var dragCfg={revert:o.revert?true:false,zindex:3000,opacity:o.opacity?parseFloat(o.opacity):false,hpc:o.helperclass?o.helperclass:false,fx:o.fx?o.fx:false,so:true,ghosting:o.ghosting?true:false,handle:o.handle?o.handle:null,containment:o.containment?o.containment:null,onStart:o.onStart&&o.onStart.constructor==Function?o.onStart:false,onDrag:o.onDrag&&o.onDrag.constructor==Function?o.onDrag:false,onStop:o.onStop&&o.onStop.constructor==Function?o.onStop:false,axis:/vertically|horizontally/.test(o.axis)?o.axis:false,snapDistance:o.snapDistance?parseInt(o.snapDistance)||0:false,cursorAt:o.cursorAt?o.cursorAt:false};jQuery('.'+o.accept,this).Draggable(dragCfg);this.isSortable=true;this.sortCfg={accept:o.accept,revert:o.revert?true:false,zindex:3000,opacity:o.opacity?parseFloat(o.opacity):false,hpc:o.helperclass?o.helperclass:false,fx:o.fx?o.fx:false,so:true,ghosting:o.ghosting?true:false,handle:o.handle?o.handle:null,containment:o.containment?o.containment:null,floats:o.floats?true:false,dragCfg:dragCfg}});}}};jQuery.fn.extend({Sortable:jQuery.iSort.build,SortableAddItem:jQuery.iSort.addItem,SortableDestroy:jQuery.iSort.destroy});jQuery.SortSerialize=jQuery.iSort.serialize;	// /js/jquery/jquery.interface.iutil
	/**
 * Interface Elements for jQuery
 *
 * http://interface.eyecon.ro
 *
 * Copyright (c) 2006 Stefan Petre
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * modification for jQuery 1.3.2 by mixxt
 *
 */

jQuery.iUtil={getPosition:function(e)
{var x=0;var y=0;var es=e.style;var restoreStyles=false;if(jQuery(e).css('display')=='none'){var oldVisibility=es.visibility;var oldPosition=es.position;restoreStyles=true;es.visibility='hidden';es.display='block';es.position='absolute';}
var el=e;while(el){x+=el.offsetLeft+(el.currentStyle&&!jQuery.browser.opera?parseInt(el.currentStyle.borderLeftWidth)||0:0);y+=el.offsetTop+(el.currentStyle&&!jQuery.browser.opera?parseInt(el.currentStyle.borderTopWidth)||0:0);el=el.offsetParent;}
el=e;while(el&&el.tagName&&el.tagName.toLowerCase()!='body')
{x-=el.scrollLeft||0;y-=el.scrollTop||0;el=el.parentNode;}
if(restoreStyles==true){es.display='none';es.position=oldPosition;es.visibility=oldVisibility;}
return{x:x,y:y};},getPositionLite:function(el)
{var x=0,y=0;while(el){x+=el.offsetLeft||0;y+=el.offsetTop||0;el=el.offsetParent;}
return{x:x,y:y};},getSize:function(e)
{var w=jQuery.css(e,'width');var h=jQuery.css(e,'height');var wb=0;var hb=0;var es=e.style;if(jQuery(e).css('display')!='none'){wb=e.offsetWidth;hb=e.offsetHeight;}else{var oldVisibility=es.visibility;var oldPosition=es.position;es.visibility='hidden';es.display='block';es.position='absolute';wb=e.offsetWidth;hb=e.offsetHeight;es.display='none';es.position=oldPosition;es.visibility=oldVisibility;}
return{w:w,h:h,wb:wb,hb:hb};},getSizeLite:function(el)
{return{wb:el.offsetWidth||0,hb:el.offsetHeight||0};},getClient:function(e)
{var h,w,de;if(e){w=e.clientWidth;h=e.clientHeight;}else{de=document.documentElement;w=window.innerWidth||self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;h=window.innerHeight||self.innerHeight||(de&&de.clientHeight)||document.body.clientHeight;}
return{w:w,h:h};},getScroll:function(e)
{var t=0,l=0,w=0,h=0,iw=0,ih=0;if(e&&e.nodeName.toLowerCase()!='body'){t=e.scrollTop;l=e.scrollLeft;w=e.scrollWidth;h=e.scrollHeight;iw=0;ih=0;}else{if(document.documentElement){t=document.documentElement.scrollTop;l=document.documentElement.scrollLeft;w=document.documentElement.scrollWidth;h=document.documentElement.scrollHeight;}else if(document.body){t=document.body.scrollTop;l=document.body.scrollLeft;w=document.body.scrollWidth;h=document.body.scrollHeight;}
iw=self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;ih=self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0;}
return{t:t,l:l,w:w,h:h,iw:iw,ih:ih};},getMargins:function(e,toInteger)
{var el=jQuery(e);var t=el.css('marginTop')||'';var r=el.css('marginRight')||'';var b=el.css('marginBottom')||'';var l=el.css('marginLeft')||'';if(toInteger)
return{t:parseInt(t)||0,r:parseInt(r)||0,b:parseInt(b)||0,l:parseInt(l)};else
return{t:t,r:r,b:b,l:l};},getPadding:function(e,toInteger)
{var el=jQuery(e);var t=el.css('paddingTop')||'';var r=el.css('paddingRight')||'';var b=el.css('paddingBottom')||'';var l=el.css('paddingLeft')||'';if(toInteger)
return{t:parseInt(t)||0,r:parseInt(r)||0,b:parseInt(b)||0,l:parseInt(l)};else
return{t:t,r:r,b:b,l:l};},getBorder:function(e,toInteger)
{var el=jQuery(e);var t=el.css('borderTopWidth')||'';var r=el.css('borderRightWidth')||'';var b=el.css('borderBottomWidth')||'';var l=el.css('borderLeftWidth')||'';if(toInteger)
return{t:parseInt(t)||0,r:parseInt(r)||0,b:parseInt(b)||0,l:parseInt(l)||0};else
return{t:t,r:r,b:b,l:l};},getPointer:function(event)
{var x=event.pageX||(event.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))||0;var y=event.pageY||(event.clientY+(document.documentElement.scrollTop||document.body.scrollTop))||0;return{x:x,y:y};},traverseDOM:function(nodeEl,func)
{func(nodeEl);nodeEl=nodeEl.firstChild;while(nodeEl){jQuery.iUtil.traverseDOM(nodeEl,func);nodeEl=nodeEl.nextSibling;}},purgeEvents:function(nodeEl)
{jQuery.iUtil.traverseDOM(nodeEl,function(el)
{for(var attr in el){if(typeof el[attr]==='function'){el[attr]=null;}}});},centerEl:function(el,axis)
{var clientScroll=jQuery.iUtil.getScroll();var windowSize=jQuery.iUtil.getSize(el);if(!axis||axis=='vertically')
jQuery(el).css({top:clientScroll.t+((Math.max(clientScroll.h,clientScroll.ih)-clientScroll.t-windowSize.hb)/2)+'px'});if(!axis||axis=='horizontally')
jQuery(el).css({left:clientScroll.l+((Math.max(clientScroll.w,clientScroll.iw)-clientScroll.l-windowSize.wb)/2)+'px'});},fixPNG:function(el,emptyGIF){var images=jQuery('img[@src*="png"]',el||document),png;images.each(function(){png=this.src;this.src=emptyGIF;this.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+png+"')";});}};[].indexOf||(Array.prototype.indexOf=function(v,n){n=(n==null)?0:n;var m=this.length;for(var i=n;i<m;i++)
if(this[i]==v)
return i;return-1;});
	// /js/network_blog.js
	function blogClass() { }
networksClass.prototype.blog = new blogClass();

var togglePromotionAction = false;
var postPromotionAction = false;
var commentModerationAction = false;
var action = false;
var deleteCommentItemList = new Object();
var commentboxAction = false;
var postboxAction = false;

networks.blog = blogClass.prototype = {
	promotePost: function(userLink, postID, item) {
		if (!postPromotionAction) {
			postPromotionAction = true;
			oldsrc = $('#postPromotionItem_'+item).find('.accept_img').attr('src');
			$('#postPromotionItem_'+item).find('.accept_img').attr('src','/images/ajax_indicator.gif');
			api.callJSON("/api/js/network/blog/promote_post", { userLink: userLink, postID: postID }, function (result) {
					if (result["error"] == 0) {
						$('#postPromotionItem_'+item).find('.before_action_reject').css('visibility','hidden');
						$('#postPromotionItem_'+item).find('.before_action_promote').find('a').removeAttr('onclick');
						$('#postPromotionItem_'+item).find('.accept_img').attr('src',oldsrc);
						$('#postPromotionItem_'+item).find('.before_action_status').html(_("networks.features.blog.module.promotion.post.status.changed.js"));
					} else {
						alert(_("networks.features.blog.module.promotion.post.status.error.js"));
					}
					postPromotionAction = false;
				}
			);
		}
	},
	
	rejectPost: function(userLink, postID, item) {
		if (!postPromotionAction) {
			postPromotionAction = true;
			oldsrc = $('#postPromotionItem_'+item).find('.delete_img').attr('src');
			$('#postPromotionItem_'+item).find('.delete_img').attr('src','/images/ajax_indicator.gif');
			api.callJSON("/api/js/network/blog/reject_post", { userLink: userLink, postID: postID }, function (result) {
					if(result["error"]==0) {
						$('#postPromotionItem_'+item).find('.before_action_promote').css('visibility','hidden');
						$('#postPromotionItem_'+item).find('.before_action_reject').find('a').removeAttr('onclick');
						$('#postPromotionItem_'+item).find('.delete_img').attr('src',oldsrc);
						$('#postPromotionItem_'+item).find('.before_action_status').html(_("networks.features.blog.module.promotion.post.status.changed.js"));
					} else {
						alert(_("networks.features.blog.module.promotion.post.status.error.js"));
					}
					postPromotionAction = false;
				}
			);
		}
	},
	
	approveComment: function(postID, commentID) {
		if (!commentModerationAction) {
			commentModerationAction = true;
			oldsrc = $('#commentModerationItem_'+postID+'_'+commentID).find('.approve_img').attr('src');
			$('#commentModerationItem_'+postID+'_'+commentID).find('.approve_img').attr('src','/images/ajax_indicator.gif');
			api.callJSON("/api/js/network/blog/approve_comment", { postID: postID, commentID: commentID }, function (result) {
					if(result["error"]==0) {
						$('#commentModerationItem_'+postID+'_'+commentID).find('.before_action_delete').css('visibility','hidden');
						$('#commentModerationItem_'+postID+'_'+commentID).find('.before_action_ban').css('visibility','hidden');
						$('#commentModerationItem_'+postID+'_'+commentID).find('.before_action_approve').find('.lable').html(_('Comment approved'));
						$('#commentModerationItem_'+postID+'_'+commentID).find('.before_action_approve').find('a').removeAttr('onclick');
						$('#commentModerationItem_'+postID+'_'+commentID).find('.approve_img').attr('src',oldsrc);
					} else {
						alert(_("networks.features.blog.module.post.comment.post.error.js"));
					}
					commentModerationAction = false;
				}
			);
		}
	},
	
	banComment: function(postID, commentID) {
		if (!commentModerationAction) {
			commentModerationAction = true;
			oldsrc = $('#commentModerationItem_'+postID+'_'+commentID).find('.ban_img').attr('src');
			$('#commentModerationItem_'+postID+'_'+commentID).find('.ban_img').attr('src','/images/ajax_indicator.gif');
			api.callJSON("/api/js/network/blog/ban_comment", { postID: postID, commentID: commentID }, function (result) {
					if(result["error"]==0) {
						$('#commentModerationItem_'+postID+'_'+commentID).find('.before_action_approve').css('visibility','hidden');
						$('#commentModerationItem_'+postID+'_'+commentID).find('.before_action_delete').css('visibility','hidden');
						$('#commentModerationItem_'+postID+'_'+commentID).find('.before_action_ban').find('.lable').html(_('Marked as spam'));
						$('#commentModerationItem_'+postID+'_'+commentID).find('.before_action_ban').find('a').removeAttr('onclick');
						$('#commentModerationItem_'+postID+'_'+commentID).find('.ban_img').attr('src',oldsrc);
					} else {
						alert(_("networks.features.blog.module.post.comment.post.error.js"));
					}
					commentModerationAction = false;
				}
			);
		}
	},
	
	deleteComment: function(postID, commentID){
		if (!commentModerationAction) {
			commentModerationAction = true;
			oldsrc = $('#commentModerationItem_'+postID+'_'+commentID).find('.delete_img').attr('src');
			$('#commentModerationItem_'+postID+'_'+commentID).find('.delete_img').attr('src','/images/ajax_indicator.gif');
			api.callJSON("/api/js/network/blog/delete_comment", { postID: postID, commentID: commentID }, function (result) {
					if(result["error"]==0) {
						$('#commentModerationItem_'+postID+'_'+commentID).find('.before_action_approve').css('visibility','hidden');
						$('#commentModerationItem_'+postID+'_'+commentID).find('.before_action_ban').css('visibility','hidden');
						$('#commentModerationItem_'+postID+'_'+commentID).find('.before_action_delete').find('.lable').html(_('Comment deleted'));
						$('#commentModerationItem_'+postID+'_'+commentID).find('.before_action_delete').find('a').removeAttr('onclick');
						$('#commentModerationItem_'+postID+'_'+commentID).find('.delete_img').attr('src',oldsrc);
					} else {
						alert(_("networks.features.blog.module.post.comment.post.error.js"));
					}
					commentModerationAction = false;
				}
			);
		}
	},
	
	mycApproveAll: function() {
		/*
		$(".confirmall").empty().append('<img src="/images/ajax_indicator.gif" width="16" height="16" class="ajax_indicator" /> <a href="javascript:void(0);" onclick="networks.mypage.confirmAll(\'{$membername_url}\');">Approve all comments</a>');
		api.call("/api/js/network/blog/approve_all_comments", "", function (data) {
				location.reload();
		});
		*/
	},
	
	closeCommentForm: function() {
		$('#net_commentTextContainer').slideUp(500); // blind replaced
		$('#leave_message').css("visibility","visible");
		$('#net_commentText').val('');
		$('#net_commentTextContainer').find('input').removeAttr('style');
	},
	
	postComment: function(memberUrl, postID) {
		var content = $('#net_commentText').val();
		content = content.replace(/\r\n/g, "\n");
		
		document.getElementById('net_commentText').readOnly = true;
		var tmp_submit = $('#net_commentButton').val();
		$('#net_commentButton').val('sending');
	
		if (content.length > 0) {
			if (!action) {
				action = true;
				api.callJSON("/api/js/network/blog/post_comment", { text: content, memberUrl: memberUrl, postID: postID }, function (result) {
						if (result['status'] > 0 && $('#net_commentContainer')) {
							var commentContainer = $('#net_commentTemplate');
							commentContainer.find('.commentTemplateText').html(result['comment']);
							
							$('#net_commentText').val('');
							$('#net_commentContainer').before(commentContainer.html());
						} else {
							alert(_("networks.features.blog.module.post.comment.post.error.js"));
						}
						
						$('#no_comments').attr('style','display:none;');
						action = false;
					}
				);
			}
		}
		
		$('#net_commentButton').val(tmp_submit);
		document.getElementById('net_commentText').readOnly = false;
	
	},
	
	deleteCommentItem: function(commentID, postID) {
		if (commentID > 0 && postID > 0) {
			if (!deleteCommentItemList[commentID]) {
				deleteCommentItemList[commentID] = true;
				$('#blog_comment_id_'+commentID).find('.comment_item_close').blur();
				$('#blog_comment_id_'+commentID).find('.comment_item_close').attr('src','/images/ajax_indicator.gif');
				$('#blog_comment_id_'+commentID).find('.comment_item_close').attr('width','16');
				$('#blog_comment_id_'+commentID).find('.comment_item_close').attr('height','16');
				api.callJSON("/api/js/network/blog/delete_comment", { commentID: commentID, postID: postID }, function (result) {
						if (result["error"] == 0) {
							$('#blog_comment_id_'+commentID).slideUp(300, // blind replaced
								function () {
									$('#blog_comment_id_'+commentID).css({ top: "0", left: "0" });
									window.setTimeout("$('#blog_comment_id_"+commentID+"').remove();",500);
								}
							);
						}
					}
				);
			}
		}
	},

	editCommentBox: function() {
		if (!commentboxAction) {
			commentboxAction = true;
			tempImgSrc = $('#commentbox_link_edit').find('img').attr('src');
			$('#commentbox_link_edit').find('img').attr('src','/images/ajax_indicator.gif');
			api.callJSON("/api/js/network/blog/get_commentbox", {}, function(data) {
					$('#commentbox_link_edit').find('img').attr('src',tempImgSrc);
					if (data["error"] != 1) {
						$('#commentbox_input').attr('class','');
						$('#commentbox_headline').attr('class','hide');
						$('#commentbox_headlinelink').attr('class','hide');
						$('#commentbox_link_save').attr('class','');
						$('#commentbox_link_edit').attr('class','hide');
						$('#commentbox_editor').attr('class','');
						$('#commentbox_content').attr('class','hide');
						
						$('#commentbox_items').val(data['items']);
						
						if (niceforms_active) {
							init();
							resetSelects();
						}
					} else {
						commentboxAction = false;
					}
				}
			);
		}
	},
	
	saveCommentBox: function() {
		if (commentboxAction) {
			tempImgSrc = $('#commentbox_link_save').find('img').attr('src');
			$('#commentbox_link_save').find('img').attr('src','/images/ajax_indicator.gif');
			
			var items = $('#commentbox_items option:selected').attr('value');
			
			$('#commentbox_content').attr('class','');
			tempBlogFeed = $('#commentbox_content').html();
			
			$('#commentbox_editor').attr('class','hide');
			api.replaceTemplate("/templates/client/" + getLanguage('network') + "/networks/blog/reload_recent_comments.tpl","/api/js/network/blog/update_commentbox", {items: items},'#commentbox_content', function (result) {
					$('#commentbox_link_save').find('img').attr('src',tempImgSrc);
					$('#commentbox_input').attr('class','hide');
					$('#commentbox_headline').attr('class','');
					$('#commentbox_headlinelink').attr('class','');
					$('#commentbox_link_save').attr('class','hide');
					$('#commentbox_link_edit').attr('class','');
					if (result["error"] == 1) {
						$('#commentbox_content').html(tempBlogFeed);
					}
					commentboxAction = false;
				}
			);
		}
	},

	editPostBox: function() {
		if (!postboxAction) {
			postboxAction = true;
			tempImgSrc = $('#postbox_link_edit').find('img').attr('src');
			$('#postbox_link_edit').find('img').attr('src','/images/ajax_indicator.gif');
			api.callJSON("/api/js/network/blog/get_postbox", {}, function(data) {
				$('#postbox_link_edit').find('img').attr('src',tempImgSrc);
				if (data["error"] != 1) {
					$('#postbox_input').attr('class','');
					$('#postbox_headline').attr('class','hide');
					$('#postbox_headlinelink').attr('class','hide');
					$('#postbox_link_save').attr('class','');
					$('#postbox_link_edit').attr('class','hide');
					$('#postbox_editor').attr('class','');
					$('#postbox_content').attr('class','hide');
					
					$('#postbox_items').val(data['items']);
					
					if (niceforms_active) {
						init();
						resetSelects();
					}
				} else {
					postboxAction = false;
				}
			});
		}
	},
	
	savePostBox: function() {
		if (postboxAction) {
			tempImgSrc = $('#postbox_link_save').find('img').attr('src');
			$('#postbox_link_save').find('img').attr('src','/images/ajax_indicator.gif');
			
			var items = $('#postbox_items option:selected').attr('value');
			
			$('#postbox_content').attr('class','');
			tempBlogFeed = $('#postbox_content').html();
			
			$('#postbox_editor').attr('class','hide');
			api.replaceTemplate("/templates/client/" + getLanguage('network') + "/networks/blog/reload_recent_posts.tpl","/api/js/network/blog/update_postbox", {items: items},'#postbox_content', function (result) {
				$('#postbox_link_save').find('img').attr('src',tempImgSrc);
				$('#postbox_input').attr('class','hide');
				$('#postbox_headline').attr('class','');
				$('#postbox_headlinelink').attr('class','');
				$('#postbox_link_save').attr('class','hide');
				$('#postbox_link_edit').attr('class','');
				if (result["error"] == 1) {
					$('#postbox_content').html(tempBlogFeed);
				}
				postboxAction = false;
			});
		}
	},
	
	markAll: function(action, max) {
		for (var item=0; item <= max; item++) {
			document.getElementById("nochange-" + item).disabled = true;
			document.getElementById("delete-" + item).checked = true;
		}
	},
	
	togglePromotion: function() {
		if (!togglePromotionAction) {
			togglePromotionAction = true;
			var promotion_enabled = $('#promotion_enabled:checked').val();
			if (promotion_enabled == null) {
				promotion_enabled = 0;
			} else {
				promotion_enabled = 1;
			}

			api_call_json("/api/js/network/blog/enable_promotion", { moderation: promotion_enabled }, function (result) {
				if (result["error"] == 0) {
					if (promotion_enabled == 1) {
						alert(_("networks.features.blog.module.admin.promotion.enabled.js"));
					} else {
						alert(_("networks.features.blog.module.admin.promotion.disabled.js"));
					}
					togglePromotionAction = false;
				} else {
					alert(_("networks.features.blog.module.admin.promotion.error"));
				}
			});    
		}
	}

}	function promotePost(userLink, postID, item) {
	_oldCallUsed_DONT();
	return networks.blog.promotePost(userLink, postID, item);
}

function rejectPost(userLink, postID, item) {
	_oldCallUsed_DONT();
	return networks.blog.rejectPost(userLink, postID, item);
}

function approveComment(postID, commentID) {
	_oldCallUsed_DONT();
	return networks.blog.approveComment(postID, commentID);
}

function banComment(postID, commentID) {
	_oldCallUsed_DONT();
	return networks.blog.banComment(postID, commentID);
}

function deleteComment(postID, commentID) {
	_oldCallUsed_DONT();
	return networks.blog.deleteComment(postID, commentID);
}

function myc_approveAll() {
	_oldCallUsed_DONT();
	return networks.blog.mycApproveAll();
}

function net_closeCommentForm() {
	_oldCallUsed_DONT();
	return networks.blog.closeCommentForm();
}

function net_postComment(memberUrl, postID) {
	_oldCallUsed_DONT();
	return networks.blog.postComment(memberUrl, postID);
}

function net_deleteCommentItem(commentID, postID) {
	_oldCallUsed_DONT();
	return networks.blog.deleteCommentItem(commentID, postID);
}

function net_editCommentBox() {
	_oldCallUsed_DONT();
	return networks.blog.editCommentBox();
}

function net_saveCommentBox() {
	_oldCallUsed_DONT();
	return networks.blog.saveCommentBox();
}

function net_editPostBox() {
	_oldCallUsed_DONT();
	return networks.blog.editPostBox();
}

function net_savePostBox() {
	_oldCallUsed_DONT();
	return networks.blog.savePostBox();
}

function markAll(action, max) {
	_oldCallUsed_DONT();
	return networks.blog.markAll(action, max);
} 	// /js/network_members.js
	function membersClass() { }
networksClass.prototype.members = new membersClass();

imageboxAction 		= false;
var pinboardAction 	= false;
var deletePinboardItemList = new Object();

globalVals['imageScroll'] = false;

networks.members = membersClass.prototype = {
	
	gotoProfile: function gotoProfile(memberHash) {
	},
	
	prependZero: function prependZero(text) {
		text += '';
		if (text.length==1) {
			return '0' + text;
		} else {
			return text;
		}
	},

	showPinboardForm: function() {
		$('#net_pinboardText').val('');
		$('#leave_message').css("visibility","hidden");
		$('#net_pinboardTextContainer').slideDown(500);
	},

	closePinboardForm: function() {
		$('#net_pinboardTextContainer').slideUp(500);
		$('#leave_message').css("visibility","visible");
		$('#net_pinboardText').val('');
	},

	postPinboard: function(memberUrl,myName,myUrl,myImg) {
		var content = $('#net_pinboardText').val();
		content = content.replace(/\r\n/g, "\n");
		if (content.length > 0) {
			if (!pinboardAction) {
				pinboardAction = true;
				api.callJSON("/api/js/network/post_pinboard", { text: content, memberUrl: memberUrl }, function (data) {
						if (data.pinPostID > 0 && $("#lastpost")) {
							$('#pinnwand_noComment').slideUp(300);
							$('#net_pinboardText').val('');
							$('.pinnboardTemplateText').html(data.text);
							$('#leave_message').css("visibility","visible");
							$('#lastpost').find('.pinnwand_new_id').attr('class',data.pinPostID);
							$('#lastpost').find('.pinnboardTemplateText').removeAttr("class");
							$('#lastpost').attr('id','pinnwand_comment_id_'+data.pinPostID);
						} else {
							$('#lastpost').remove();
							$('#leave_message').css("visibility","hidden");
							$('#net_pinboardTextContainer').slideDown(500);
						}
						pinboardAction = false;
					}
				);
			}
			$('#net_pinboardTextContainer').after('<li id="lastpost">' + $('#net_pinnboardTemplate').html() + '</li>');
		} else {
			$('#net_pinboardButton').removeAttr('disabled');
			$('#net_pinboardOpener').css("visibility","visible");
		}
		$('#net_pinboardTextContainer').slideUp(500);
	},

	deletePinboardItem: function(id) {
		if (id > 0) {
			if (!deletePinboardItemList[id]) {
				deletePinboardItemList[id] = true;
				$('#pinnwand_comment_id_'+id).find('.pinnwand_item_close').blur();
				$('#pinnwand_comment_id_'+id).find('.pinnwand_item_close').attr('src','/images/ajax_indicator.gif');
				api.callJSON("/api/js/network/delete_pinboard", { pinPostID: id }, function (result) {
						if (result.error == 0) {
							$('#pinnwand_comment_id_'+id).slideUp(300,
								function () {
									$('#pinnwand_comment_id_'+id).css({ top: "0", left: "0" });
									window.setTimeout("$('#pinnwand_comment_id_"+id+"').remove();",500);
								}
							);
						} else {
							alert('Error: ' + result.error);
							$('#pinnwand_comment_id_'+id).find('.pinnwand_item_close').attr('src','/images/networks/ig_contentMarker.png');			
						}
					}
				);
			}
		}
	},

	sendMessage: function(recp) {
		if(!recp) {
			alert(_('networks.members.sendMessage.noMember.js'));
		} else {
			global.mixxtbar.messages.sendMessage(recp);
		}
	},
	
	connect: function pro_connect(id,name){
		$("#con > img").attr("src","/images/ajax_indicator.gif");
		api.callJSON("/api/js/network/connect_buddy", { handle: id }, function(data){
			$("#con > img").attr("src","/images/networks/ig_add_user.png");
			$("#con").hide();
			$("#awa").show();
		});
	},
	
	disconnect: function(id,name){
		$("#dis > img").attr("src","/images/ajax_indicator.gif");
		if(confirm(_('networks.members.friends.end.confirm.js',name))){
			api.callJSON("/api/js/network/disconnect_buddy", { handle: id }, function(data){
				$("#dis > img").attr("src","/images/networks/ig_delete_user.png");
				$("#dis").hide();
				$("#con").show();
			});
		} else {
			$("#dis > img").attr("src","/images/networks/ig_delete_user.png");
		}
	},

	socialGrooming: function(id) {
		var temp = $("#sogr > img").attr("src");
		$("#sogr > img").attr("src","/images/ajax_indicator.gif");
		api.callJSON("/api/js/network/socialgrooming/poke", { memberHandle: id }, function(data){
			switch(data['status']*1) {
			case 1:
				alert(_("networks.features.socialGrooming.notification.success.js"));
				break;
			case 2:  
				alert(_("networks.features.socialGrooming.notification.noRepeatedGrooming.js"));
				break;
			}
			$("#sogr > img").attr("src",temp);
		});
	},

	changeImageBox: function(type,member) {
		if (!imageboxAction) {
			imageboxAction = true;
			if (type != "Albums" && type != "Images") {
				imageboxAction = false;
				return;
			}
			api.replaceTemplate("/templates/client/" + getLanguage('network') + "/networks/images/profile_recent" + type + ".tpl","/api/js/network/images/profile_recent" + type, { memberUrl: member },'#imagebox_content', function (data) {
					if (data["error"]!=1) {
						$('#imageModule #imagebox_headline').html(data["boxTitle"]);
						if (type == "Albums") {
							$('#imageModule .linkAlbums').toggleClass('hide');
							$('#imageModule .linkImages').toggleClass('hide');
						} else {
							$('#imageModule .linkImages').toggleClass('hide');
							$('#imageModule .linkAlbums').toggleClass('hide');
						}
					}
				}
			);
			imageboxAction = false;
		}
	},

	sfonConnectAndHide: function(id,name,html_id) {
		$("#add_img_"+id).attr("src","/images/ajax_indicator.gif");
		api.callJSON("/api/js/network/connect_buddy", { handle: id }, function(data){
			$("#add_img_"+id).attr("src","/images/networks/ig_add_user.png");		
		});
		networks.members.sfonHide(id,html_id);
	},

	sfonHide: function(id,html_id) {
		$("#"+html_id).slideUp(500);
		contact_count--;
		if(contact_count==1){
			$(".confirmall").hide();
		} else if(contact_count==0){
			$("#nocontactsleft").fadeIn('slow');
		}
		if(contacts.indexOf(id) != -1) {
			contacts.splice(contacts.indexOf(id),1);
		}
	},

	sfonAddAllContacts: function() {
		$(".addall").attr("src","/images/ajax_indicator.gif");
		var ids = new Object();
		for(c in contacts){
			ids['blubber['+c+'][handle]'] = contacts[c];
		}
		api.callJSON("/api/js/network/connect_buddies", ids, function(data){
			$(".confirmall").hide();
			$(".contact_question").hide();		
			$("#nocontactsleft").fadeIn('slow');
		});
	},

	confirmMemberLeave: function() {
		if (confirm(_('networks.members.leave.confirm.js'))) {
			return true;
		} else {
			return false;
		}
	},

	gotoPage: function(page) {
		$("#page").val(page);
		document.getElementById('profile_search_form').submit();
	},
	
	expandSection: function(section) {
		$('#' + section + ' h6').toggleClass('arrow_right');
		$('#' + section + ' h6').toggleClass('arrow_down');
		$('#' + section + ' .section_ctr').toggleClass('hide');
		this.initImageScroll();
	},
	initImageScroll: function() {
		// Init Slider
		$('#userpic_toggle #myp_gallery #myp_gallery_inner ul').css('width',$('#userpic_toggle #myp_gallery #myp_gallery_inner ul li').size()*75);
	},	
	imageScroll: function(action) {
		if(!globalVals['imagesScroll'] && action == 0 && parseInt($('#userpic_toggle #myp_gallery #myp_gallery_inner ul').css('left'))!=0) {
			globalVals['imagesScroll'] = true;
			
			if($("#myp_go_right").css('opacity')*1 == 0) {
				$("#myp_go_right").fadeTo(200, 1.0);
			}
			if(parseInt($('#myp_gallery #myp_gallery_inner ul').css('left'))+75 == 0) {
				$("#myp_go_left").fadeTo(200, 0.0);
			}
			
			$('#userpic_toggle #myp_gallery #myp_gallery_inner ul').animate({
				left: parseInt($('#userpic_toggle #myp_gallery #myp_gallery_inner ul').css('left'))+75},150,function() {
						globalVals['imagesScroll'] = false
			});
		}
		if(!globalVals['imagesScroll'] && action==1 && $('#userpic_toggle #myp_gallery #myp_gallery_inner ul li').size() > 7 && parseInt($('#userpic_toggle #myp_gallery #myp_gallery_inner ul').css('left'))!=($('#userpic_toggle #myp_gallery #myp_gallery_inner ul li').size()-7)*-75) {
			
			if($("#myp_go_left").css('opacity')*1 == 0) {
				$("#myp_go_left").fadeTo(200, 1.0);
			}
			if(parseInt($('#myp_gallery #myp_gallery_inner ul').css('left'))-75 == ($('#myp_gallery #myp_gallery_inner ul li').size()-7)*-75) {
				$("#myp_go_right").fadeTo(200, 0.0);
			}
			
			globalVals['imagesScroll'] = true;
			$('#userpic_toggle #myp_gallery #myp_gallery_inner ul').animate({
				left: parseInt($('#userpic_toggle #myp_gallery #myp_gallery_inner ul').css('left'))-75},150,function() {
					globalVals['imagesScroll'] = false;
			});
		}
	},
	
	chooseProfileImageAtJoin: function(imageHash) {
		$("#joinimage").fadeTo(250, 0.0, function() { $("#joinimage").attr('src', '/storage/images/profiles/' + imageHash + '_medium.jpg').fadeTo(250, 1.0); });
		$("#imageHash").val(imageHash);
	},
	
	updateProfileImageAtJoin: function(hash, uri) {
		$("#joinimage_div").css('background','');
		$("#joinimage").attr('src', uri).fadeTo(250, 1.0);
		$("#imageHash").val(hash);
		globalVals['imageUploadInProgress'] = false;
	},
	
	submitImg: function() {
		if (!globalVals['imageUploadInProgress']) {
			globalVals['imageUploadInProgress'] = true;
			$("#joinimage_div").css('background','url(/images/ajax_indicator.gif) no-repeat center');
			$("#joinimage").fadeTo(250, 0.0);
			
			document.getElementById('join_imguploadform').submit();
			document.getElementById('join_imguploadform').reset();
		}
	},
	transferNickname: function() {
		$('#nickname').val($('#nickname_temp').val());
		return true;
	}
	
}	function gotoProfile(memberHash) {
	_oldCallUsed_DONT();
	return networks.members.gotoProfile(memberHash);
}

function prependZero(text) {
	_oldCallUsed_DONT();
	return networks.members.prependZero(text);
}

function net_showPinboardForm() {
	_oldCallUsed_DONT();
	return networks.members.showPinboardForm();
}

function net_closePinboardForm() {
	_oldCallUsed_DONT();
	return networks.members.closePinboardForm();
}

function net_postPinboard(memberUrl,myName,myUrl,myImg) {
	_oldCallUsed_DONT();
	return networks.members.postPinboard(memberUrl,myName,myUrl,myImg);
}

function net_deletePinboardItem(id) {
	_oldCallUsed_DONT();
	return networks.members.deletePinboardItem(id);
}

function pro_connect(id,name) {
	_oldCallUsed_DONT();
	return networks.members.connect(id,name);
}

function pro_disconnect(id,name) {
	_oldCallUsed_DONT();
	return networks.members.disconnect(id,name);
}

function pro_socialGrooming(id) {
	_oldCallUsed_DONT();
	return networks.members.socialGrooming(id);
}

function pro_changeImageBox(type,member) {
	_oldCallUsed_DONT();
	return networks.members.changeImageBox(type,member);
}

function pro_sendMessage(recp) {
	_oldCallUsed_DONT();
	return networks.members.sendMessage(recp);
}

function sfon_connectAndHide(id,name,html_id) {
	_oldCallUsed_DONT();
	return networks.members.connectAndHide(id,name,html_id);
}

function sfon_hide(id,html_id) {
	_oldCallUsed_DONT();
	return networks.members.sfonHide(id,html_id);
}

function sfon_addAllContacts() {
	_oldCallUsed_DONT();
	return networks.members.sfonAddAllContacts()
}

function confirmMemberLeave() {
	_oldCallUsed_DONT();
	return networks.members.confirmMemberLeave();
}

function memb_gotoPage(page) {
	_oldCallUsed_DONT();
	return networks.members.gotoPage(page);
}