Файл: templates/Default/js/notW.js
Строк: 13460
<?php
(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=/^[^<]*(<[wW]+>)[^>]*$|^#([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(/"[^"\nr]*"|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=/[nt]/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(/[^ws.|`]/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:/#((?:[wu00c0-uFFFF-]|\.)+)/,CLASS:/.((?:[wu00c0-uFFFF-]|\.)+)/,NAME:/[name=['"]*((?:[wu00c0-uFFFF-]|\.)+)['"]*]/,ATTR:/[s*((?:[wu00c0-uFFFF-]|\.)+)s*(?:(S?=)s*(['"]*)(.*?)3|)s*]/,TAG:/^((?:[wu00c0-uFFFF*-]|\.)+)/,CHILD:/:(only|nth|last|first)-child(?:((even|odd|[dn+-]*)))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:((d*)))?(?=[^-]|$)/,PSEUDO:/:((?:[wu00c0-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(/[tn]/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/hd/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=/ jQueryd+="(?: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=/checkeds*(?:[^=]|=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);(function(a){a.fn.autoResize=function(j){var b=a.extend({onResize:function(){},animate:true,animateDuration:150,animateCallback:function(){},extraSpace:20,limit:1000},j);this.filter('textarea').each(function(){var c=a(this).css({resize:'none','overflow-y':'hidden'}),k=c.height(),f=(function(){var l=['height','width','lineHeight','textDecoration','letterSpacing'],h={};a.each(l,function(d,e){h[e]=c.css(e)});return c.clone().removeAttr('id').removeAttr('name').css({position:'absolute',top:0,left:-9999}).css(h).attr('tabIndex','-1').insertBefore(c)})(),i=null,g=function(){f.height(0).val(a(this).val()).scrollTop(10000);var d=Math.max(f.scrollTop(),k)+b.extraSpace,e=a(this).add(f);if(i===d){return}i=d;if(d>=b.limit){a(this).css('overflow-y','');return}b.onResize.call(this);b.animate&&c.css('display')==='block'?e.stop().animate({height:d},b.animateDuration,b.animateCallback):e.height(d)};c.unbind('.dynSiz').bind('keyup.dynSiz',g).bind('keydown.dynSiz',g).bind('change.dynSiz',g)});return this}})(jQuery);(function(k,e,i,j){k.fn.caret=function(b,l){var a,c,f=this[0],d=k.browser.msie;if(typeof b==="object"&&typeof b.start==="number"&&typeof b.end==="number"){a=b.start;c=b.end}else if(typeof b==="number"&&typeof l==="number"){a=b;c=l}else if(typeof b==="string")if((a=f.value.indexOf(b))>-1)c=a+b[e];else a=null;else if(Object.prototype.toString.call(b)==="[object RegExp]"){b=b.exec(f.value);if(b!=null){a=b.index;c=a+b[0][e]}}if(typeof a!="undefined"){if(d){d=this[0].createTextRange();d.collapse(true);d.moveStart("character",a);d.moveEnd("character",c-a);d.select()}else{this[0].selectionStart=a;this[0].selectionEnd=c}this[0].focus();return this}else{if(d){c=document.selection;if(this[0].tagName.toLowerCase()!="textarea"){d=this.val();a=c[i]()[j]();a.moveEnd("character",d[e]);var g=a.text==""?d[e]:d.lastIndexOf(a.text);a=c[i]()[j]();a.moveStart("character",-d[e]);var h=a.text[e]}else{a=c[i]();c=a[j]();c.moveToElementText(this[0]);c.setEndPoint("EndToEnd",a);g=c.text[e]-a.text[e];h=g+a.text[e]}}else{g=f.selectionStart;h=f.selectionEnd}a=f.value.substring(g,h);return{start:g,end:h,text:a,replace:function(m){return f.value.substring(0,g)+m+f.value.substring(h,f.value[e])}}}}})(jQuery,"length","createRange","duplicate");(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.14",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a,"tabindex"),d=isNaN(b);return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);;(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);;(function(b){var d=false;b(document).mousedown(function(){d=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.target,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+
this.widgetName)},_mouseDown:function(a){if(!d){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var c=this,f=a.which==1,g=typeof this.options.cancel=="string"?b(a.target).closest(this.options.cancel).length:false;if(!f||g||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();return true}}true===b.data(a.target,this.widgetName+".preventClickEvent")&&b.removeData(a.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(e){return c._mouseMove(e)};this._mouseUpDelegate=function(e){return c._mouseUp(e)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return d=true}},_mouseMove:function(a){if(b.browser.msie&&!(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);;(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="fixed";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b=this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;d(b.iframeFix===true?"iframe":b.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")});return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,a);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},_mouseUp:function(a){this.options.iframeFix===true&&d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});d.ui.ddmanager&&d.ui.ddmanager.dragStop(this,a);return d.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone().removeAttr("id"):this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[a.containment=="document"?0:d(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a.containment=="document"?0:d(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){a=d(a.containment);var b=a[0];if(b){a.offset();var c=d(b).css("overflow")!="hidden";this.containment=[(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=a}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+
this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,h=a.pageY;if(this.originalPosition){var g;if(this.containment){if(this.relative_container){g=this.relative_container.offset();g=[this.containment[0]+g.left,this.containment[1]+g.top,this.containment[2]+g.left,this.containment[3]+g.top]}else g=this.containment;if(a.pageX-this.offset.click.left<g[0])e=g[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<g[1])h=g[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>g[2])e=g[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>g[3])h=g[3]+this.offset.click.top}if(b.grid){h=b.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/b.grid[1])*b.grid[1]:this.originalPageY;h=g?!(h-this.offset.click.top<g[1]||h-this.offset.click.top>g[3])?h:!(h-this.offset.click.top<g[1])?h-b.grid[1]:h+b.grid[1]:h;e=b.grid[0]?this.originalPageX+Math.round((e-this.originalPageX)/b.grid[0])*b.grid[0]:this.originalPageX;e=g?!(e-this.offset.click.left<g[0]||e-this.offset.click.left>g[2])?e:!(e-this.offset.click.left<g[0])?e-b.grid[0]:e+b.grid[0]:e}}return{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left:e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c]);if(a=="drag")this.positionAbs=this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b,c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.14"});d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var h=d.data(this,"sortable");if(h&&!h.options.disabled){c.sortables.push({instance:h,shouldRevert:h.options.revert});h.refreshPositions();h._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},b,{item:c.element});d.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper;c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=d(this).data("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs=c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=d(f).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return b.helper[0]};a.target=this.instance.currentItem[0];this.instance._mouseCapture(a,true);this.instance._mouseStart(a,true,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top;c._trigger("toSortable",a);c.dropped=this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.instance.currentItem&&this.instance._mouseDrag(a)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",a,this.instance._uiHash(this.instance));this.instance._mouseStop(a,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();c._trigger("fromSortable",a);c.dropped=false}})}});d.ui.plugin.add("draggable","cursor",{start:function(){var a=d("body"),b=d(this).data("draggable").options;if(a.css("cursor"))b._cursor=a.css("cursor");a.css("cursor",b.cursor)},stop:function(){var a=d(this).data("draggable").options;a._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop+c.scrollSpeed;else if(a.pageY-b.overflowOffset.top<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop-c.scrollSpeed;if(!c.axis||c.axis!="y")if(b.overflowOffset.left+b.scrollParent[0].offsetWidth-a.pageX<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft+c.scrollSpeed;else if(a.pageX-b.overflowOffset.left<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(!c.axis||c.axis!="x")if(a.pageY-d(document).scrollTop()<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()-c.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()+c.scrollSpeed);if(!c.axis||c.axis!="y")if(a.pageX-d(document).scrollLeft()<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()-
c.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()+c.scrollSpeed)}f!==false&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(b,a)}});d.ui.plugin.add("draggable","snap",{start:function(){var a=d(this).data("draggable"),b=a.options;a.snapElements=[];d(b.snap.constructor!=String?b.snap.items||":data(draggable)":b.snap).each(function(){var c=d(this),f=c.offset();this!=a.element[0]&&a.snapElements.push({item:this,width:c.outerWidth(),height:c.outerHeight(),top:f.top,left:f.left})})},drag:function(a,b){for(var c=d(this).data("draggable"),f=c.options,e=f.snapTolerance,h=b.offset.left,g=h+c.helperProportions.width,n=b.offset.top,o=n+c.helperProportions.height,i=c.snapElements.length-1;i>=0;i--){var j=c.snapElements[i].left,l=j+c.snapElements[i].width,k=c.snapElements[i].top,m=k+c.snapElements[i].height;if(j-e<h&&h<l+e&&k-e<n&&n<m+e||j-e<h&&h<l+e&&k-e<o&&o<m+e||j-e<g&&g<l+e&&k-e<n&&n<m+e||j-e<g&&g<l+e&&k-e<o&&o<m+e){if(f.snapMode!="inner"){var p=Math.abs(k-o)<=e,q=Math.abs(m-n)<=e,r=Math.abs(j-g)<=e,s=Math.abs(l-h)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:k-c.helperProportions.height,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:m,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:j-c.helperProportions.width}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:l}).left-c.margins.left}var t=p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(k-n)<=e;q=Math.abs(m-o)<=e;r=Math.abs(j-h)<=e;s=Math.abs(l-g)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:k,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:m-c.helperProportions.height,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:j}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:l-c.helperProportions.width}).left-c.margins.left}if(!c.snapElements[i].snapping&&(p||q||r||s||t))c.options.snap.snap&&c.options.snap.snap.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[i].item}));c.snapElements[i].snapping=p||q||r||s||t}else{c.snapElements[i].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[i].item}));c.snapElements[i].snapping=false}}}});d.ui.plugin.add("draggable","stack",{start:function(){var a=d(this).data("draggable").options;a=d.makeArray(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"),10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(a.length){var b=parseInt(a[0].style.zIndex)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex");a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery);;(function(d){d.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var a=this.options,b=a.accept;this.isover=0;this.isout=1;this.accept=d.isFunction(b)?b:function(c){return c.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};d.ui.ddmanager.droppables[a.scope]=d.ui.ddmanager.droppables[a.scope]||[];d.ui.ddmanager.droppables[a.scope].push(this);a.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var a=d.ui.ddmanager.droppables[this.options.scope],b=0;b<a.length;b++)a[b]==this&&a.splice(b,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(a,b){if(a=="accept")this.accept=d.isFunction(b)?b:function(c){return c.is(b)};d.Widget.prototype._setOption.apply(this,arguments)},_activate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass);b&&this._trigger("activate",a,this.ui(b))},_deactivate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);b&&this._trigger("deactivate",a,this.ui(b))},_over:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass);this._trigger("over",a,this.ui(b))}},_out:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",a,this.ui(b))}},_drop:function(a,b){var c=b||d.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return false;var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var g=d.data(this,"droppable");if(g.options.greedy&&!g.options.disabled&&g.options.scope==c.options.scope&&g.accept.call(g.element[0],c.currentItem||c.element)&&d.ui.intersect(c,d.extend(g,{offset:g.element.offset()}),g.options.tolerance)){e=true;return false}});if(e)return false;if(this.accept.call(this.element[0],c.currentItem||c.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop",a,this.ui(c));return this.element}return false},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}});d.extend(d.ui.droppable,{version:"1.8.14"});d.ui.intersect=function(a,b,c){if(!b.offset)return false;var e=(a.positionAbs||a.position.absolute).left,g=e+a.helperProportions.width,f=(a.positionAbs||a.position.absolute).top,h=f+a.helperProportions.height,i=b.offset.left,k=i+b.proportions.width,j=b.offset.top,l=j+b.proportions.height;switch(c){case"fit":return i<=e&&g<=k&&j<=f&&h<=l;case"intersect":return i<e+a.helperProportions.width/2&&g-a.helperProportions.width/2<k&&j<f+a.helperProportions.height/2&&h-a.helperProportions.height/2<l;case"pointer":return d.ui.isOver((a.positionAbs||a.position.absolute).top+(a.clickOffset||a.offset.click).top,(a.positionAbs||a.position.absolute).left+(a.clickOffset||a.offset.click).left,j,i,b.proportions.height,b.proportions.width);case"touch":return(f>=j&&f<=l||h>=j&&h<=l||f<j&&h>l)&&(e>=i&&e<=k||g>=i&&g<=k||e<i&&g>k);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f<c.length;f++)if(!(c[f].options.disabled||a&&!c[f].accept.call(c[f].element[0],a.currentItem||a.element))){for(var h=0;h<g.length;h++)if(g[h]==c[f].element[0]){c[f].proportions.height=0;continue a}c[f].visible=c[f].element.css("display")!="none";if(c[f].visible){e=="mousedown"&&c[f]._activate.call(c[f],b);c[f].offset=c[f].element.offset();c[f].proportions={width:c[f].element[0].offsetWidth,height:c[f].element[0].offsetHeight}}}},drop:function(a,b){var c=false;d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(this.options){if(!this.options.disabled&&this.visible&&d.ui.intersect(a,this,this.options.tolerance))c=c||this._drop.call(this,b);if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],a.currentItem||a.element)){this.isout=1;this.isover=0;this._deactivate.call(this,b)}}});return c},dragStart:function(a,b){a.element.parentsUntil("body").bind("scroll.droppable",function(){a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)})},drag:function(a,b){a.options.refreshPositions&&d.ui.ddmanager.prepareOffsets(a,b);d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var c=d.ui.intersect(a,this,this.options.tolerance);if(c=!c&&this.isover==1?"isout":c&&this.isover==0?"isover":null){var e;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");if(g.length){e=d.data(g[0],"droppable");e.greedyChild=c=="isover"?1:0}}if(e&&c=="isover"){e.isover=0;e.isout=1;e._out.call(e,b)}this[c]=1;this[c=="isout"?"isover":"isout"]=0;this[c=="isover"?"_over":"_out"].call(this,b);if(e&&c=="isout"){e.isout=0;e.isover=1;e._over.call(e,b)}}}})},dragStop:function(a,b){a.element.parentsUntil("body").unbind("scroll.droppable");a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)}}})(jQuery);;(function(e){e.widget("ui.resizable",e.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,a=this.options;this.element.addClass("ui-resizable");e.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&e.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(e('<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")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d<c.length;d++){var f=e.trim(c[d]),g=e('<div class="ui-resizable-handle '+("ui-resizable-"+f)+'"></div>');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor==String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),l=0;l=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,l);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){if(!a.disabled){e(this).removeClass("ui-resizable-autohide");b._handles.show()}},function(){if(!a.disabled)if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio:this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis];if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize",b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height;f=f?0:c.sizeDiff.width;f={width:c.helper.width()-f,height:c.helper.height()-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f,{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",b);this._helper&&this.helper.remove();return false},_updateVirtualBoundaries:function(b){var a=this.options,c,d,f;a={minWidth:k(a.minWidth)?a.minWidth:0,maxWidth:k(a.maxWidth)?a.maxWidth:Infinity,minHeight:k(a.minHeight)?a.minHeight:0,maxHeight:k(a.maxHeight)?a.maxHeight:Infinity};if(this._aspectRatio||b){b=a.minHeight*this.aspectRatio;d=a.minWidth/this.aspectRatio;c=a.maxHeight*this.aspectRatio;f=a.maxWidth/this.aspectRatio;if(b>a.minWidth)a.minWidth=b;if(d>a.minHeight)a.minHeight=d;if(c<a.maxWidth)a.maxWidth=c;if(f<a.maxHeight)a.maxHeight=f}this._vBoundaries=a},_updateCache:function(b){this.offset=this.helper.offset();if(k(b.left))this.position.left=b.left;if(k(b.top))this.position.top=b.top;if(k(b.height))this.size.height=b.height;if(k(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;if(k(b.height))b.width=b.height*this.aspectRatio;else if(k(b.width))b.height=b.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(d=="nw"){b.top=a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this._vBoundaries,c=this.axis,d=k(b.width)&&a.maxWidth&&a.maxWidth<b.width,f=k(b.height)&&a.maxHeight&&a.maxHeight<b.height,g=k(b.width)&&a.minWidth&&a.minWidth>b.width,h=k(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height,l=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&l)b.left=i-a.minWidth;if(d&&l)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a<this._proportionallyResizeElements.length;a++){var c=this._proportionallyResizeElements[a];if(!this.borderDif){var d=[c.css("borderTopWidth"),c.css("borderRightWidth"),c.css("borderBottomWidth"),c.css("borderLeftWidth")],f=[c.css("paddingTop"),c.css("paddingRight"),c.css("paddingBottom"),c.css("paddingLeft")];this.borderDif=e.map(d,function(g,h){g=parseInt(g,10)||0;h=parseInt(f[h],10)||0;return g+h})}e.browser.msie&&(e(b).is(":hidden")||e(b).parents(":hidden").length)||c.css({height:b.height()-this.borderDif[0]-this.borderDif[2]||0,width:b.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var b=this.options;this.elementOffset=this.element.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+
a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+
c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,{version:"1.8.14"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top-
f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var l=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:l.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n=(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(l.css("position"))){c._revertToRelativePosition=true;l.css({position:"absolute",top:"auto",left:"auto"})}l.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition=false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement=e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top","Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset;var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset,f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left:a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top-
d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition,f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b=e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},k=function(b){return!isNaN(parseInt(b,10))}})(jQuery);;(function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,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:1E3},_create:function(){var a=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem=c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop+b.scrollSpeed;else if(a.pageY-this.overflowOffset.top<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop-b.scrollSpeed;if(this.overflowOffset.left+this.scrollParent[0].offsetWidth-a.pageX<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft+b.scrollSpeed;else if(a.pageX-this.overflowOffset.left<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft-b.scrollSpeed}else{if(a.pageY-d(document).scrollTop()<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()-
b.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()+b.scrollSpeed);if(a.pageX-d(document).scrollLeft()<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()-b.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()+b.scrollSpeed)}c!==false&&d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a)}this.positionAbs=this._convertPositionTo("absolute");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";for(b=this.items.length-1;b>=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a,c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")},toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+j<k&&b+l>g&&b+l<h;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?j:g<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<h&&i<e+this.helperProportions.height/2&&f-this.helperProportions.height/2<k},_intersectsWithPointer:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left,a.width);b=b&&a;a=this._getDragVerticalDirection();var c=this._getDragHorizontalDirection();if(!b)return false;return this.floating?c&&c=="right"||a=="down"?2:1:a&&(a=="down"?2:1)},_intersectsWithSides:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top+a.height/2,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left+a.width/2,a.width);var c=this._getDragVerticalDirection(),e=this._getDragHorizontalDirection();return this.floating&&e?e=="right"&&a||e=="left"&&!a:c&&(c=="down"&&b||c=="up"&&!b)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(a){this.items=[];this.containers=[this];var b=this.items,c=[[d.isFunction(this.options.items)?this.options.items.call(this.element[0],a,{item:this.currentItem}):d(this.options.items,this.element),this]],e=this._connectWith();if(e)for(var f=e.length-1;f>=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h<g;h++){i=d(e[h]);i.data("sortable-item",a);b.push({item:i,instance:a,width:0,height:0,left:0,top:0})}}},refreshPositions:function(a){if(this.offsetParent&&this.helper)this.offset.parent=this._getParentOffset();for(var b=this.items.length-1;b>=0;b--){var c=this.items[b];if(!(c.instance!=this.currentContainer&&this.currentContainer&&c.item[0]!=this.currentItem[0])){var e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-
f)<b){b=Math.abs(h-f);e=this.items[g]}}if(e||this.options.dropOnEmpty){this.currentContainer=this.containers[c];e?this._rearrange(a,e,null,true):this._rearrange(a,null,this.containers[c].element,true);this._trigger("change",a,this._uiHash());this.containers[c]._trigger("change",a,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}}},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a,this.currentItem])):b.helper=="clone"?this.currentItem.clone():this.currentItem;a.parents("body").length||d(b.appendTo!="parent"?b.appendTo:this.currentItem[0].parentNode)[0].appendChild(a[0]);if(a[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(a[0].style.width==""||b.forceHelperSize)a.width(this.currentItem.width());if(a[0].style.height==""||b.forceHelperSize)a.height(this.currentItem.height());return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.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 a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)){var b=d(a.containment)[0];a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();var f=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])f=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-
this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;f=this.originalPageX+Math.round((f-this.originalPageX)/b.grid[0])*b.grid[0];f=this.containment?!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:!(f-this.offset.click.left<this.containment[0])?f-b.grid[0]:f+b.grid[0]:f}}return{top:g-
this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())}},_rearrange:function(a,b,c,e){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var f=this,g=this.counter;window.setTimeout(function(){g==f.counter&&f.refreshPositions(!e)},0)},_clear:function(a,b){this.reverting=false;var c=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var e in this._storedCSS)if(this._storedCSS[e]=="auto"||this._storedCSS[e]=="static")this._storedCSS[e]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!b&&c.push(function(f){this._trigger("receive",f,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])&&!b)c.push(function(f){this._trigger("update",f,this._uiHash())});if(!d.ui.contains(this.element[0],this.currentItem[0])){b||c.push(function(f){this._trigger("remove",f,this._uiHash())});for(e=this.containers.length-1;e>=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",a,this._uiHash());for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}return false}b||this._trigger("beforeStop",a,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!b){for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){d.Widget.prototype._trigger.apply(this,arguments)===false&&this.cancel()},_uiHash:function(a){var b=a||this;return{helper:b.helper,placeholder:b.placeholder||d([]),position:b.position,originalPosition:b.originalPosition,offset:b.positionAbs,item:b.currentItem,sender:a?a.element:null}}});d.extend(d.ui.sortable,{version:"1.8.14"})})(jQuery);;jQuery.effects||function(f,j){function m(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb(s*([0-9]{1,3})s*,s*([0-9]{1,3})s*,s*([0-9]{1,3})s*)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb(s*([0-9]+(?:.[0-9]+)?)%s*,s*([0-9]+(?:.[0-9]+)?)%s*,s*([0-9]+(?:.[0-9]+)?)%s*)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba(0, 0, 0, 0)/.exec(c))return n.transparent;return n[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return m(b)}function o(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/-(w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function p(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d=a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function l(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=m(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var n={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},q=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b,d){if(f.isFunction(b)){d=b;b=null}return this.queue(function(){var e=f(this),g=e.attr("style")||" ",h=p(o.call(this)),r,v=e.attr("class");f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});r=p(o.call(this));e.attr("class",v);e.animate(u(h,r),{queue:false,duration:a,easing:b,complete:function(){f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments);f.dequeue(this)}})})};f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.14",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:function(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";return a},getBaseline:function(c,a){var b;switch(c[0]){case"top":b=0;break;case"middle":b=0.5;break;case"bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case"left":c=0;break;case"center":c=0.5;break;case"right":c=1;break;default:c=c[1]/a.width}return{x:c,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent();var a={width:c.outerWidth(true),height:c.outerHeight(true),"float":c.css("float")},b=f("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c);return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});return d.call(this,b)},_show:f.fn.show,show:function(c){if(l(c))return this._show.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(l(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(l(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g))+b},easeOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*a)*Math.sin((a*e-c)*2*Math.PI/g)+d+b},easeInOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e/2)==2)return b+d;g||(g=e*0.3*1.5);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);if(a<1)return-0.5*h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)+b;return h*Math.pow(2,-10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)*0.5+d+b},easeInBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*(a/=e)*a*((g+1)*a-g)+b},easeOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*((a=a/e-1)*a*((g+1)*a+g)+1)+b},easeInOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;if((a/=e/2)<1)return d/2*a*a*(((g*=1.525)+1)*a-g)+b;return d/2*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)+b},easeInBounce:function(c,a,b,d,e){return d-f.easing.easeOutBounce(c,e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:function(c,a,b,d,e){if(a<e/2)return f.easing.easeInBounce(c,a*2,0,d,e)*0.5+b;return f.easing.easeOutBounce(c,a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery);;(function(c){c.effects.drop=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right","opacity"],e=c.effects.setMode(a,d.options.mode||"hide"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a);var f=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var g=d.options.distance||(f=="top"?a.outerHeight({margin:true})/2:a.outerWidth({margin:true})/2);if(e=="show")a.css("opacity",0).css(f,b=="pos"?-g:g);var i={opacity:e=="show"?1:0};i[f]=(e=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+g;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){e=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);;(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&&this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);;$.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}expires='; expires='+date.toUTCString();}var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}return cookieValue;}};eval(function(p,a,c,k,e,r){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--)r[e(c)]=k[c]||e(c);k=[function(e){return r[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}('(9($){$.U=0;6 1v={7:9(1L){$.U++;6 a={1P:h,D:"2b",2j:"1D",17:"1j",t:0,O:0,1f:0,Q:0,1n:"2r",S:"#2z"};$.1z(a,1L);6 1H={g:$(5).2f("g"),X:2v+"/1D/2G.X",c:a.D+"2C"+$.U,H:a.D+"2K"+$.U};$.1z(a,1H);$(5).8("7.a",a);6 1b={11:9(e,f){6 c=$(5).8("7.a").c;6 m=$(5).8("7.y")(c);m.2n(f);$(5).l("7.F",u)},M:9(e){6 c=$(5).8("7.a").c;6 m=$(5).8("7.y")(c);6 r=m.2d();d(r){$(5).l("7.F",E)}},I:9(e){6 c=$(5).8("7.a").c;6 m=$(5).8("7.y")(c);6 r=m.2A();d(r){$(5).l("7.F",u)}},19:9(e){6 c=$(5).8("7.a").c;6 m=$(5).8("7.y")(c);6 r=m.2t();d(r){$(5).l("7.F",u)}},W:9(e,p){6 c=$(5).8("7.a").c;6 m=$(5).8("7.y")(c);6 r=m.2I(p);$(5).l("7.F",E)},K:9(e,v){6 c=$(5).8("7.a").c;6 m=$(5).8("7.y")(c);m.2l(v)},F:9(e,1x){6 Z=$(5).8("7.q.M");6 15=$(5).8("7.q.I");6 A=$(5).8("7.a").D;d(Z!=h&&15!=h){d(1x){6 13=$(5).8("7.1h.I");$("#"+Z).B("C","1p");$("#"+15).B("C",13)}s{6 13=$(5).8("7.1h.M");$("#"+Z).B("C",13);$("#"+15).B("C","1p")}}}};1F(6 1d 1B 1b){6 e="7."+1d;$(5).2h(e);$(5).2M(e,1b[1d])}6 y=9(c){d($.1S.1W){k 2x[c]}s{k 1r[c]}};$(5).8("7.y",y);d($.1S.1W){6 G='<1N g="'+a.c+'"';G+=' 2P="2p:2O-2T-2X-2Z-31"';G+=' 2E="1J://2V.1R.1U/2R/1l/2c/18/34.2H"';G+=' 1w="1M/x-1l-18"';G+=' t="'+a.t+'" O="'+a.O+'">';G+='</1N>';6 z=2s 2W();z[0]='<P L="2k" T="'+a.X+'" />';z[1]='<P L="17" T="1j" />';z[2]='<P L="1E" T="g='+V(a.g)+'&c='+V(a.c)+'" />';z[3]='<P L="1T" T="23" />';z[4]='<P L="S" T="'+a.S+'" />';6 1c=1r.1Z(G);1F(6 i=0;i<z.2g;i++){1c.35(1r.1Z(z[i]))}$(5).Y(1c)}s{6 N='<2L L="'+a.c+'" 2w="'+a.X+'"';N+=' t="'+a.t+'" O="'+a.O+'" S="'+a.S+'"';N+=' 17="1j" 1E="g='+V(a.g)+'&c='+V(a.c)+'"';N+=' 1T="23"';N+=' 1w="1M/x-1l-18" 37="1J://3b.1R.1U/30/39" />';$(5).Y(N)}6 1A='<1I g="'+a.H+'"></1I>';$(5).2o(1A);$(5).B({'1n':a.1n,'1f':a.1f,'Q':a.Q});$("#"+a.H).B({'2S-36':'-38'});k $(5)},11:9(f){$(5).l("7.11",f)},M:9(){$(5).l("7.M")},3a:9(f){$(5).l("7.11",f);$(5).l("7.M")},I:9(){$(5).l("7.I")},19:9(){$(5).l("7.19")},W:9(p){$(5).l("7.W",p)},K:9(v){$(5).l("7.K",v)},n:9(j,g){d(g!=h){6 1Q=1X("$(5)."+j);d(1Q!=h){$(5).8("7.q."+j,g);6 n=$(5).8("7.a").g;1X("6 21 = 9(e) { $(\"#"+n+"\")."+j+"(e); k u; }");$("#"+g).2D(21).33(5.1y,5.20).8("n",n);6 C=$("#"+g).B("C");$(5).8("7.1h."+j,C);d(j=="I"){$("#"+g).B("C","1p")}}s{26("2a 9 2e 1B: n( j="+j+", g="+g+" )")}}s{g=$(5).8("7.q."+j);d(g!=h){k g}s{26("2a 9 g 2u: n( j="+j+" )");k u}}},R:9(e){6 o=$(5).8("7.q.R");d(o!=h){6 J=$("#"+o).J();6 x=e.1O-J.Q;6 w=$("#"+o).t();6 p=1a*x/w;$(5).W(p)}},1G:9(e){5.R(e)},1g:9(j){$(5).8("7.12.1g",j)},2m:9(1o,1s,1V,24,28){6 o=$(5).8("7.q.R");d(o!=h){$("#"+o).t(1o+"%")}6 14=$(5).8("7.q.1G");d(14!=h){$("#"+14).t(1s+"%")}6 16=$(5).8("7.12.1g");d(16!=h){16(1o,1s,1V,24,28)}d(o!=h||14!=h||16!=h){5.1k();k E}s{k u}},2B:9(){$(5).K(0)},2i:9(){$(5).K(1a)},1e:9(e){6 10=$(5).8("7.q.1e");d(10!=h){6 J=$("#"+10).J();6 x=e.1O-J.Q;6 w=$("#"+10).t();6 p=1a*x/w;$(5).K(p)}},1C:9(e){5.1e(e)},2J:9(v){6 1t=$(5).8("7.q.1C");d(1t!=h){$("#"+1t).t(v+"%");5.1k();k E}},1m:9(j){$(5).8("7.12.1m",j)},2y:9(){6 1u=$(5).8("7.12.1m");$(5).l("7.F",u);d(1u!=h){1u();k E}s{k u}},2Q:9(b){6 o=$(5).8("7.q.R");d(o!=h){6 A=$(5).8("7.a").D;d(b){$("#"+o).22(A+"1K")}s{$("#"+o).27(A+"1K")}k E}s{k u}},29:9(){},2q:9(25){6 1i=$(5).8("7.q.29");d(1i!=h){$("#"+1i).Y(25);k E}s{k u}},1k:9(){6 H=$(5).8("7.a").H;$("#"+H).Y(2F.2U())},1y:9(){6 n=$(5).8("n");6 A=$("#"+n).8("7.a").D;$(5).22(A+"1Y")},20:9(){6 n=$(5).8("n");6 A=$("#"+n).8("7.a").D;$(5).27(A+"1Y")},2N:9(){6 1q=$(5).8("7.a").1P;d(1q!=h){1q()}}};$.2Y(1v,9(i){$.j[i]=5})})(32);',62,198,'|||||this|var|jPlayer|data|function|config||fid|if|||id|null||fn|return|trigger||jPlayerId|lbId||cssId||else|width|false||||getMovie|obj_param|prefix|css|display|cssPrefix|true|screenUpdate|html_obj|hid|pause|offset|volume|name|play|html_embed|height|param|left|loadBar|bgcolor|value|jPlayerCount|escape|playHead|swf|html|playId|vbId|change|jsFn|style|pbId|pauseId|onProgressChangeFn|quality|flash|stop|100|events|ie_dom|event|volumeBar|top|onProgressChange|cssDisplay|bmId|high|forceScreenUpdate|shockwave|onSoundComplete|position|loadPercent|none|readyFn|document|playedPercentRelative|vbvId|onSoundCompleteFn|methods|type|playing|rollOver|extend|html_hidden|in|volumeBarValue|js|FlashVars|for|playBar|configWithoutOptions|div|http|_buffer|options|application|object|pageX|ready|isValid|macromedia|browser|allowScriptAccess|com|playedPercentAbsolute|msie|eval|_hover|createElement|rollOut|myHandler|addClass|always|playedTime|msg|alert|removeClass|totalTime|bufferMsg|Unknown|jqjp|cabs|fl_play_mp3|assigned|attr|length|unbind|volumeMax|swfPath|movie|fl_volume_mp3|updateProgress|fl_change_mp3|append|clsid|setBufferMsg|absolute|new|fl_stop_mp3|requested|template_dir|src|window|finishedPlaying|ffffff|fl_pause_mp3|volumeMin|_flash_|click|codebase|Math|Jplayer|cab|fl_play_head_mp3|updateVolume|_force_|embed|bind|flashReady|d27cdb6e|classid|setBufferState|pub|text|ae6d|random|fpdownload|Array|11cf|each|96b8|go|444553540000|jQuery|hover|swflash|appendChild|indent|pluginspage|9999px|getflashplayer|changeAndPlay|www'.split('|'),0,{}));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))};while(c--)if(k[c])p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c]);return p}('(m($){1k W=2v.4N,D=2v.4M,F=2v.4L,u=2v.4K;m V(){C $("<4J/>")};$.N=m(T,c){1k O=$(T),2E,A=V(),1i=V(),I=V().r(V()).r(V()).r(V()),B=V().r(V()).r(V()).r(V()),E=$([]),1J,G,l,17={v:0,l:0},Q,M,1j,1f={v:0,l:0},12=0,1I="1G",2k,2j,1s,1r,S,1A,1z,2o,2n,14,1O,a,b,j,g,f={a:0,b:0,j:0,g:0,H:0,L:0},2u=R.4I,$p,d,i,o,w,h,2p;m 1m(x){C x+17.v-1f.v};m 1l(y){C y+17.l-1f.l};m 1a(x){C x-17.v+1f.v};m 19(y){C y-17.l+1f.l};m 1y(3H){C 3H.4H-1f.v};m 1x(3G){C 3G.4G-1f.l};m 13(30){1k 1h=30||1s,1g=30||1r;C{a:u(f.a*1h),b:u(f.b*1g),j:u(f.j*1h),g:u(f.g*1g),H:u(f.j*1h)-u(f.a*1h),L:u(f.g*1g)-u(f.b*1g)}};m 23(a,b,j,g,2Z){1k 1h=2Z||1s,1g=2Z||1r;f={a:u(a/1h||0),b:u(b/1g||0),j:u(j/1h||0),g:u(g/1g||0)};f.H=f.j-f.a;f.L=f.g-f.b};m 1e(){9(!O.H()){C}17={v:u(O.2t().v),l:u(O.2t().l)};Q=O.2X();M=O.3F();17.l+=(O.2Y()-M)>>1;17.v+=(O.2q()-Q)>>1;1A=u(c.4F/1s)||0;1z=u(c.4E/1r)||0;2o=u(F(c.4D/1s||1<<24,Q));2n=u(F(c.4C/1r||1<<24,M));9($().4B=="1.3.2"&&1I=="21"&&!2u["4A"]){17.l+=D(R.1p.2r,2u.2r);17.v+=D(R.1p.2s,2u.2s)}1f=/1G|4z/.1V(1j.q("1o"))?{v:u(1j.2t().v)-1j.2s(),l:u(1j.2t().l)-1j.2r()}:1I=="21"?{v:$(R).2s(),l:$(R).2r()}:{v:0,l:0};G=1m(0);l=1l(0);9(f.j>Q||f.g>M){1S()}};m 1T(3D){9(!1O){C}A.q({v:1m(f.a),l:1l(f.b)}).r(1i).H(w=f.H).L(h=f.L);1i.r(I).r(E).q({v:0,l:0});I.H(D(w-I.2q()+I.2X(),0)).L(D(h-I.2Y()+I.3F(),0));$(B[0]).q({v:G,l:l,H:f.a,L:M});$(B[1]).q({v:G+f.a,l:l,H:w,L:f.b});$(B[2]).q({v:G+f.j,l:l,H:Q-f.j,L:M});$(B[3]).q({v:G+f.a,l:l+f.g,H:w,L:M-f.g});w-=E.2q();h-=E.2Y();2N(E.3b){15 8:$(E[4]).q({v:w>>1});$(E[5]).q({v:w,l:h>>1});$(E[6]).q({v:w>>1,l:h});$(E[7]).q({l:h>>1});15 4:E.3E(1,3).q({v:w});E.3E(2,4).q({l:h})}9(3D!==Y){9($.N.1Z!=2Q){$(R).U($.N.1Z,$.N.3C)}9(c.1R){$(R)[$.N.1Z]($.N.3C=2Q)}}9($.1b.1E&&I.2q()-I.2X()==2){I.q("3B",0);3u(m(){I.q("3B","4y")},0)}};m 22(3A){1e();1T(3A);a=1m(f.a);b=1l(f.b);j=1m(f.j);g=1l(f.g)};m 27(2W,2w){c.1N?2W.4x(c.1N,2w):2W.1q()};m 1c(2V){1k x=1a(1y(2V))-f.a,y=19(1x(2V))-f.b;9(!2p){1e();2p=11;A.1F("4w",m(){2p=Y})}S="";9(c.2C){9(y<=c.1U){S="n"}X{9(y>=f.L-c.1U){S="s"}}9(x<=c.1U){S+="w"}X{9(x>=f.H-c.1U){S+="e"}}}A.q("2U",S?S+"-18":c.26?"4v":"");9(1J){1J.4u()}};m 2R(4t){$("1p").q("2U","");9(c.4s||f.H*f.L==0){27(A.r(B),m(){$(J).1q()})}$(R).U("P",2l);A.P(1c);c.2f(T,13())};m 2B(1W){9(1W.3w!=1){C Y}1e();9(S){$("1p").q("2U",S+"-18");a=1m(f[/w/.1V(S)?"j":"a"]);b=1l(f[/n/.1V(S)?"g":"b"]);$(R).P(2l).1F("1w",2R);A.U("P",1c)}X{9(c.26){2k=G+f.a-1y(1W);2j=l+f.b-1x(1W);A.U("P",1c);$(R).P(2S).1F("1w",m(){c.2f(T,13());$(R).U("P",2S);A.P(1c)})}X{O.1M(1W)}}C Y};m 1v(3z){9(14){9(3z){j=D(G,F(G+Q,a+W(g-b)*14*(j>a||-1)));g=u(D(l,F(l+M,b+W(j-a)/14*(g>b||-1))));j=u(j)}X{g=D(l,F(l+M,b+W(j-a)/14*(g>b||-1)));j=u(D(G,F(G+Q,a+W(g-b)*14*(j>a||-1))));g=u(g)}}};m 1S(){a=F(a,G+Q);b=F(b,l+M);9(W(j-a)<1A){j=a-1A*(j<a||-1);9(j<G){a=G+1A}X{9(j>G+Q){a=G+Q-1A}}}9(W(g-b)<1z){g=b-1z*(g<b||-1);9(g<l){b=l+1z}X{9(g>l+M){b=l+M-1z}}}j=D(G,F(j,G+Q));g=D(l,F(g,l+M));1v(W(j-a)<W(g-b)*14);9(W(j-a)>2o){j=a-2o*(j<a||-1);1v()}9(W(g-b)>2n){g=b-2n*(g<b||-1);1v(11)}f={a:1a(F(a,j)),j:1a(D(a,j)),b:19(F(b,g)),g:19(D(b,g)),H:W(j-a),L:W(g-b)};1T();c.2g(T,13())};m 2l(2T){j=/w|e|^$/.1V(S)||14?1y(2T):1m(f.j);g=/n|s|^$/.1V(S)||14?1x(2T):1l(f.g);1S();C Y};m 1u(3y,3x){j=(a=3y)+f.H;g=(b=3x)+f.L;$.2c(f,{a:1a(a),b:19(b),j:1a(j),g:19(g)});1T();c.2g(T,13())};m 2S(2m){a=D(G,F(2k+1y(2m),G+Q-f.H));b=D(l,F(2j+1x(2m),l+M-f.L));1u(a,b);2m.4r();C Y};m 2h(){$(R).U("P",2h);1e();j=a;g=b;1S();S="";9(!B.2y(":4q")){A.r(B).1q().2D(c.1N||0)}1O=11;$(R).U("1w",1L).P(2l).1F("1w",2R);A.U("P",1c);c.3v(T,13())};m 1L(){$(R).U("P",2h).U("1w",1L);27(A.r(B));23(1a(a),19(b),1a(a),19(b));9(!J 4p $.N){c.2g(T,13());c.2f(T,13())}};m 2z(2i){9(2i.3w!=1||B.2y(":4o")){C Y}1e();2k=a=1y(2i);2j=b=1x(2i);$(R).P(2h).1w(1L);C Y};m 2A(){22(Y)};m 2x(){2E=11;25(c=$.2c({1Q:"4n",26:11,20:"1p",2C:11,1U:10,3t:m(){},3v:m(){},2g:m(){},2f:m(){}},c));A.r(B).q({36:""});9(c.2F){1O=11;1e();1T();A.r(B).1q().2D(c.1N||0)}3u(m(){c.3t(T,13())},0)};1k 2Q=m(16){1k k=c.1R,d,t,2M=16.4m;d=!1K(k.2O)&&(16.2e||16.3q.2e)?k.2O:!1K(k.2a)&&16.3r?k.2a:!1K(k.2b)&&16.3s?k.2b:!1K(k.2P)?k.2P:10;9(k.2P=="18"||(k.2b=="18"&&16.3s)||(k.2a=="18"&&16.3r)||(k.2O=="18"&&(16.2e||16.3q.2e))){2N(2M){15 37:d=-d;15 39:t=D(a,j);a=F(a,j);j=D(t+d,a);1v();1t;15 38:d=-d;15 40:t=D(b,g);b=F(b,g);g=D(t+d,b);1v(11);1t;3p:C}1S()}X{a=F(a,j);b=F(b,g);2N(2M){15 37:1u(D(a-d,G),b);1t;15 38:1u(a,D(b-d,l));1t;15 39:1u(a+F(d,Q-1a(j)),b);1t;15 40:1u(a,b+F(d,M-19(g)));1t;3p:C}}C Y};m 1P(3o,2L){3m(2d 4l 2L){9(c[2d]!==1X){3o.q(2L[2d],c[2d])}}};m 25(K){9(K.20){(1j=$(K.20)).3g(A.r(B))}$.2c(c,K);1e();9(K.2K!=3n){E.1n();E=$([]);i=K.2K?K.2K=="4k"?4:8:0;3c(i--){E=E.r(V())}E.29(c.1Q+"-4j").q({1o:"1G",34:0,1H:12+1||1});9(!4i(E.q("H"))>=0){E.H(5).L(5)}9(o=c.2J){E.q({2J:o,2G:"3j"})}1P(E,{3k:"2I-28",3i:"2H-28",3l:"1d"})}1s=c.4h/Q||1;1r=c.4g/M||1;9(K.a!=3n){23(K.a,K.b,K.j,K.g);K.2F=!K.1q}9(K.1R){c.1R=$.2c({2b:1,2a:"18"},K.1R)}B.29(c.1Q+"-4f");1i.29(c.1Q+"-4e");3m(i=0;i++<4;){$(I[i-1]).29(c.1Q+"-2I"+i)}1P(1i,{4d:"2H-28",4c:"1d"});1P(I,{3l:"1d",2J:"2I-H"});1P(B,{4b:"2H-28",4a:"1d"});9(o=c.3k){$(I[0]).q({2G:"3j",3h:o})}9(o=c.3i){$(I[1]).q({2G:"49",3h:o})}A.3g(1i.r(I).r(1J).r(E));9($.1b.1E){9(o=B.q("3f").3e(/1d=(\d+)/)){B.q("1d",o[1]/1Y)}9(o=I.q("3f").3e(/1d=(\d+)/)){I.q("1d",o[1]/1Y)}}9(K.1q){27(A.r(B))}X{9(K.2F&&2E){1O=11;A.r(B).2D(c.1N||0);22()}}14=(d=(c.48||"").47(/:/))[0]/d[1];O.r(B).U("1M",2z);9(c.1D||c.1C===Y){A.U("P",1c).U("1M",2B);$(3d).U("18",2A)}X{9(c.1C||c.1D===Y){9(c.2C||c.26){A.P(1c).1M(2B)}$(3d).18(2A)}9(!c.46){O.r(B).1M(2z)}}c.1C=c.1D=1X};J.1n=m(){25({1D:11});A.r(B).1n()};J.45=m(){C c};J.31=25;J.44=13;J.43=23;J.42=1L;J.41=22;$p=O;3c($p.3b){12=D(12,!1K($p.q("z-3a"))?$p.q("z-3a"):12);9($p.q("1o")=="21"){1I="21"}$p=$p.20(":3Z(1p)")}12=c.1H||12;9($.1b.1E){O.3Y("3X","3W")}$.N.1Z=$.1b.1E||$.1b.3V?"3U":"3T";9($.1b.3S){1J=V().q({H:"1Y%",L:"1Y%",1o:"1G",1H:12+2||2})}A.r(B).q({36:"35",1o:1I,3R:"35",1H:12||"0"});A.q({1H:12+2||2});1i.r(I).q({1o:"1G",34:0});T.33||T.3Q=="33"||!O.2y("3P")?2x():O.1F("3O",2x);9($.1b.1E&&$.1b.3N>=7){T.32=T.32}};$.2w.N=m(Z){Z=Z||{};J.3M(m(){9($(J).1B("N")){9(Z.1n){$(J).1B("N").1n();$(J).3L("N")}X{$(J).1B("N").31(Z)}}X{9(!Z.1n){9(Z.1C===1X&&Z.1D===1X){Z.1C=11}$(J).1B("N",3K $.N(J,Z))}}});9(Z.3J){C $(J).1B("N")}C J}})(3I);',62,298,'|||||||||if|x1|y1|_7|||_23|y2|||x2||top|function||||css|add|||_4|left|||||_a|_d|return|_2|_e|_3|_10|width|_c|this|_53|height|_13|imgAreaSelect|_8|mousemove|_12|document|_1c|_6|unbind|_5|_1|else|false|_54||true|_16|_2c|_21|case|_4f|_11|resize|_29|_28|browser|_39|opacity|_30|_15|sy|sx|_b|_14|var|_27|_26|remove|position|body|hide|_1b|_1a|break|_44|_41|mouseup|evY|evX|_1e|_1d|data|enable|disable|msie|one|absolute|zIndex|_17|_f|isNaN|_49|mousedown|fadeSpeed|_22|_50|classPrefix|keys|_31|_32|resizeMargin|test|_3f|undefined|100|keyPress|parent|fixed|_35|_2e||_4e|movable|_37|color|addClass|ctrl|shift|extend|option|altKey|onSelectEnd|onSelectChange|_48|_4b|_19|_18|_3d|_47|_20|_1f|_25|outerWidth|scrollTop|scrollLeft|offset|_24|Math|fn|_4d|is|_4a|_4c|_3e|resizable|fadeIn|_9|show|borderStyle|background|border|borderWidth|handles|_52|key|switch|alt|arrows|_34|_3b|_40|_43|cursor|_3a|_38|innerWidth|outerHeight|_2f|_2d|setOptions|src|complete|fontSize|hidden|visibility||||index|length|while|window|match|filter|append|borderColor|borderColor2|solid|borderColor1|borderOpacity|for|null|_51|default|originalEvent|ctrlKey|shiftKey|onInit|setTimeout|onSelectStart|which|_46|_45|_42|_36|margin|onKeyPress|_33|slice|innerHeight|_2b|_2a|jQuery|instance|new|removeData|each|version|load|img|readyState|overflow|opera|keypress|keydown|safari|on|unselectable|attr|not||update|cancelSelection|setSelection|getSelection|getOptions|persistent|split|aspectRatio|dashed|outerOpacity|outerColor|selectionOpacity|selectionColor|selection|outer|imageHeight|imageWidth|parseInt|handle|corners|in|keyCode|imgareaselect|animated|instanceof|visible|preventDefault|autoHide|_3c|toggle|move|mouseout|fadeOut|auto|relative|getBoundingClientRect|jquery|maxHeight|maxWidth|minHeight|minWidth|pageY|pageX|documentElement|div|round|min|max|abs'.split('|')));(function(){var d=document,w=window;function get(element){if(typeof element=="string")
element=d.getElementById(element);return element;}
function addEvent(el,type,fn){if(w.addEventListener){el.addEventListener(type,fn,false);}else if(w.attachEvent){var f=function(){fn.call(el,w.event);};el.attachEvent('on'+type,f)}}
var toElement=function(){var div=d.createElement('div');return function(html){div.innerHTML=html;var el=div.childNodes[0];div.removeChild(el);return el;}}();function hasClass(ele,cls){return ele.className.match(new RegExp('(\s|^)'+cls+'(\s|$)'));}
function addClass(ele,cls){if(!hasClass(ele,cls))ele.className+=" "+cls;}
function removeClass(ele,cls){var reg=new RegExp('(\s|^)'+cls+'(\s|$)');ele.className=ele.className.replace(reg,' ');}
if(document.documentElement["getBoundingClientRect"]){var getOffset=function(el){var box=el.getBoundingClientRect(),doc=el.ownerDocument,body=doc.body,docElem=doc.documentElement,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,zoom=1;if(body.getBoundingClientRect){var bound=body.getBoundingClientRect();zoom=(bound.right-bound.left)/body.clientWidth;}
if(zoom>1){clientTop=0;clientLeft=0;}
var top=box.top/zoom+(window.pageYOffset||docElem&&docElem.scrollTop/zoom||body.scrollTop/zoom)-clientTop,left=box.left/zoom+(window.pageXOffset||docElem&&docElem.scrollLeft/zoom||body.scrollLeft/zoom)-clientLeft;return{top:top,left:left};}}else{var getOffset=function(el){if(w.jQuery){return jQuery(el).offset();}
var top=0,left=0;do{top+=el.offsetTop||0;left+=el.offsetLeft||0;}
while(el=el.offsetParent);return{left:left,top:top};}}
function getBox(el){var left,right,top,bottom;var offset=getOffset(el);left=offset.left;top=offset.top;right=left+el.offsetWidth;bottom=top+el.offsetHeight;return{left:left,right:right,top:top,bottom:bottom};}
function getMouseCoords(e){if(!e.pageX&&e.clientX){var zoom=1;var body=document.body;if(body.getBoundingClientRect){var bound=body.getBoundingClientRect();zoom=(bound.right-bound.left)/body.clientWidth;}
return{x:e.clientX/zoom+d.body.scrollLeft+d.documentElement.scrollLeft,y:e.clientY/zoom+d.body.scrollTop+d.documentElement.scrollTop};}
return{x:e.pageX,y:e.pageY};}
var getUID=function(){var id=0;return function(){return'ValumsAjaxUpload'+id++;}}();function fileFromPath(file){return file.replace(/.*(/|\)/,"");}
function getExt(file){return(/[.]/.exec(file))?/[^.]+$/.exec(file.toLowerCase()):'';}
Ajax_upload=AjaxUpload=function(button,options){if(button.jquery){button=button[0];}else if(typeof button=="string"&&/^#.*/.test(button)){button=button.slice(1);}
button=get(button);this._input=null;this._button=button;this._disabled=false;this._submitting=false;this._justClicked=false;this._parentDialog=d.body;if(window.jQuery&&jQuery.ui&&jQuery.ui.dialog){var parentDialog=jQuery(this._button).parents('.ui-dialog');if(parentDialog.length){this._parentDialog=parentDialog[0];}}
this._settings={action:'upload.php',name:'userfile',data:{},autoSubmit:true,responseType:false,onChange:function(file,extension){},onSubmit:function(file,extension){},onComplete:function(file,response){}};for(var i in options){this._settings[i]=options[i];}
this._createInput();this._rerouteClicks();}
AjaxUpload.prototype={setData:function(data){this._settings.data=data;},disable:function(){this._disabled=true;},enable:function(){this._disabled=false;},destroy:function(){if(this._input){if(this._input.parentNode){this._input.parentNode.removeChild(this._input);}
this._input=null;}},_createInput:function(){var self=this;var input=d.createElement("input");input.setAttribute('type','file');input.setAttribute('name',this._settings.name);var styles={'position':'absolute','margin':'-5px 0 0 -175px','padding':0,'width':'220px','height':'30px','fontSize':'14px','opacity':0,'cursor':'pointer','display':'none','zIndex':2147483583};for(var i in styles){input.style[i]=styles[i];}
if(!(input.style.opacity==="0")){input.style.filter="alpha(opacity=0)";}
this._parentDialog.appendChild(input);addEvent(input,'change',function(){var file=fileFromPath(this.value);if(self._settings.onChange.call(self,file,getExt(file))==false){return;}
if(self._settings.autoSubmit){self.submit();}});addEvent(input,'click',function(){self.justClicked=true;setTimeout(function(){self.justClicked=false;},3000);});this._input=input;},_rerouteClicks:function(){var self=this;var box,dialogOffset={top:0,left:0},over=false;addEvent(self._button,'mouseover',function(e){if(!self._input||over)return;over=true;box=getBox(self._button);if(self._parentDialog!=d.body){dialogOffset=getOffset(self._parentDialog);}});addEvent(document,'mousemove',function(e){var input=self._input;if(!input||!over)return;if(self._disabled){removeClass(self._button,'hover');input.style.display='none';return;}
var c=getMouseCoords(e);if((c.x>=box.left)&&(c.x<=box.right)&&(c.y>=box.top)&&(c.y<=box.bottom)){input.style.top=c.y-dialogOffset.top+'px';input.style.left=c.x-dialogOffset.left+'px';input.style.display='block';addClass(self._button,'hover');}else{over=false;if(!self.justClicked){input.style.display='none';}
removeClass(self._button,'hover');}});},_createIframe:function(){var id=getUID();var iframe=toElement('<iframe src="javascript:false;" name="'+id+'" />');iframe.id=id;iframe.style.display='none';d.body.appendChild(iframe);return iframe;},submit:function(){var self=this,settings=this._settings;if(this._input.value===''){return;}
var file=fileFromPath(this._input.value);if(!(settings.onSubmit.call(this,file,getExt(file))==false)){var iframe=this._createIframe();var form=this._createForm(iframe);form.appendChild(this._input);form.submit();d.body.removeChild(form);form=null;this._input=null;this._createInput();var toDeleteFlag=false;addEvent(iframe,'load',function(e){if(iframe.src=="javascript:'%3Chtml%3E%3C/html%3E';"||iframe.src=="javascript:'<html></html>';"){if(toDeleteFlag){setTimeout(function(){d.body.removeChild(iframe);},0);}
return;}
var doc=iframe.contentDocument?iframe.contentDocument:frames[iframe.id].document;if(doc.readyState&&doc.readyState!='complete'){return;}
if(doc.body&&doc.body.innerHTML=="false"){return;}
var response;if(doc.XMLDocument){response=doc.XMLDocument;}else if(doc.body){response=doc.body.innerHTML;if(settings.responseType&&settings.responseType.toLowerCase()=='json'){if(doc.body.firstChild&&doc.body.firstChild.nodeName.toUpperCase()=='PRE'){response=doc.body.firstChild.firstChild.nodeValue;}
if(response){response=window["eval"]("("+response+")");}else{response={};}}}else{var response=doc;}
settings.onComplete.call(self,file,response);toDeleteFlag=true;iframe.src="javascript:'<html></html>';";});}else{d.body.removeChild(this._input);this._input=null;this._createInput();}},_createForm:function(iframe){var settings=this._settings;var form=toElement('<form method="post" enctype="multipart/form-data"></form>');form.style.display='none';form.action=settings.action;form.target=iframe.name;d.body.appendChild(form);for(var prop in settings.data){var el=d.createElement("input");el.type='hidden';el.name=prop;el.value=settings.data[prop];form.appendChild(el);}
return form;}};})();;var uagent=navigator.userAgent.toLowerCase();var is_safari=((uagent.indexOf('safari')!=-1)||(navigator.vendor=="Apple Computer, Inc."));var is_ie=((uagent.indexOf('msie')!=-1)&&(!is_opera)&&(!is_safari)&&(!is_webtv));var is_ie4=((is_ie)&&(uagent.indexOf("msie 4.")!=-1));var is_moz=(navigator.product=='Gecko');var is_ns=((uagent.indexOf('compatible')==-1)&&(uagent.indexOf('mozilla')!=-1)&&(!is_opera)&&(!is_webtv)&&(!is_safari));var is_ns4=((is_ns)&&(parseInt(navigator.appVersion)==4));var is_opera=(uagent.indexOf('opera')!=-1);var is_kon=(uagent.indexOf('konqueror')!=-1);var is_webtv=(uagent.indexOf('webtv')!=-1);var is_win=((uagent.indexOf("win")!=-1)||(uagent.indexOf("16bit")!=-1));var is_mac=((uagent.indexOf("mac")!=-1)||(navigator.vendor=="Apple Computer, Inc."));var is_chrome=(uagent.match(/Chrome/w+.w+/i));if(is_chrome=='null'||!is_chrome||is_chrome==0)is_chrome='';var ua_vers=parseInt(navigator.appVersion);var req_href=location.href;var vii_interval=false;var vii_interval_im=false;var scrollTopForFirefox=0;var url_next_id=1;$(document).ready(function(){x=new Date();current=x;$.post('/index.php?act=success',{time:current});var mw=($('html, body').width()-800)/2;if($('.autowr').css('padding-left',mw+'px').css('padding-right',mw+'px')){$('body').show();history.pushState({link:location.href},'',location.href);}
$('.update_code').click(function(){var rndval=new Date().getTime();$('#sec_code').html('<img src="/antibot/antibot.php?rndval='+rndval+'" alt="" title="Показать другой код" width="120" height="50" />');return false;});$(window).scroll(function(){if($(document).scrollTop()>($(window).height()/2))
$('.scroll_fix_bg').fadeIn(200);else
$('.scroll_fix_bg').fadeOut(200);});});$(document).click(function(event){oi=(event.target)?event.target.id:((event.srcElement)?event.srcElement.id:null);if(oi!='fast_name'&&oi!='fast_img'&&oi!='search_selected_text'&&oi!='query'&&oi!='1'&&oi!='2'&&oi!='3'&&oi!='4'&&oi!='5')
$('.fast_search_bg').hide();});if(CheckRequestPhoto(req_href)){$(document).ready(function(){Photo.Show(req_href);});}
if(CheckRequestVideo(req_href)){$(document).ready(function(){var video_id=req_href.split('_');var section=req_href.split('sec=');var fuser=req_href.split('wall/fuser=');if(fuser[1])
var close_link='/u'+fuser[1];else
var close_link='';if(section[1]){var xSection=section[1].split('/');if(xSection[0]=='news')
var close_link='news';if(xSection[0]=='msg'){var msg_id=xSection[1].split('id=');var close_link='/messages/show/'+msg_id[1];}}
if(section[1]=='public'){var gh='1';}
videos.show(video_id[1],req_href,close_link,gh);});}
window.onload=function(){window.setTimeout(function(){window.addEventListener("popstate",function(e){e.preventDefault();if(CheckRequestPhoto(e.state.link))
Photo.Prev(e.state.link);else if(CheckRequestVideo(e.state.link))
videos.prev(e.state.link);else
Page.Prev(e.state.link);},false);},1);}
function CheckRequestPhoto(request){var pattern=new RegExp(/photo[0-9]/i);return pattern.test(request);}
function CheckRequestVideo(request){var pattern=new RegExp(/video[0-9]/i);return pattern.test(request);}
function onBodyResize(){var mw=($('html, body').width()-800)/2;$('.autowr').css('padding-left',mw+'px').css('padding-right',mw+'px');}
var Page={Loading:function(f){var top_pad=$(window).height()/2-50;if(f=='start'){$('#loading').remove();$('html, body').append('<div id="loading" style="margin-top:'+top_pad+'px"><div class="loadstyle"></div></div>');$('#loading').show();}
if(f=='stop'){$('#loading').remove();}},Go:function(h){history.pushState({link:h},null,h);$('.js_titleRemove').remove();$('body').removeClass('lm_opened');clearInterval(vii_interval);clearInterval(vii_interval_im);$('#sel_types, .fast_search_bg').hide();$('#query').val('Поиск').css('color','#c1cad0');Page.Loading('start');$('#page').load(h,{ajax:'yes'},function(data){Page.Loading('stop');$('html, body').scrollTop(0);$('.ladybug_ant').imgAreaSelect({remove:true});$('.photo_view, .box_pos, .box_info').remove();$('html, body').css('overflow-y','auto');}).css('min-height','0px');},Prev:function(h){clearInterval(vii_interval);clearInterval(vii_interval_im);$('#sel_types, .fast_search_bg').hide();$('#query').val('Поиск').css('color','#c1cad0');Page.Loading('start');$('#page').load(h,{ajax:'yes'},function(data){Page.Loading('stop');$('html, body').scrollTop(0);$('.ladybug_ant').imgAreaSelect({remove:true});$('.photo_view, .box_pos, .box_info').remove();$('html, body').css('overflow-y','auto');}).css('min-height','0px');}}
var Profile={LoadCity:function(id){$('#load_mini').show();if(id>0){$('#city').slideDown();$('#select_city').load('/index.php?go=loadcity',{country:id});}else{$('#city').slideUp();$('#load_mini').hide();}},miniature:function(){Page.Loading('start');$.post('/index.php?go=editprofile&act=miniature',function(d){Page.Loading('stop');if(d==1)
addAllErr('Вы пока что не загрузили фотографию.');else{if(is_moz&&!is_chrome)scrollTopForFirefox=$(window).scrollTop();$('html, body').css('overflow-y','hidden');if(is_moz&&!is_chrome)$(window).scrollTop(scrollTopForFirefox);$('body').append('<div id="newbox_miniature">'+d+'</div>');}
$(window).keydown(function(event){if(event.keyCode==27)Profile.miniatureClose();});});},preview:function(img,selection){if(!selection.width||!selection.height)return;var scaleX=100/selection.width;var scaleY=100/selection.height;var scaleX50=50/selection.width;var scaleY50=50/selection.height;$('#miniature_crop_100 img').css({width:Math.round(scaleX*$('#miniature_crop').width()),height:Math.round(scaleY*$('#miniature_crop').height()),marginLeft:-Math.round(scaleX*selection.x1),marginTop:-Math.round(scaleY*selection.y1)});$('#miniature_crop_50 img').css({width:Math.round(scaleX50*$('#miniature_crop').width()),height:Math.round(scaleY50*$('#miniature_crop').height()),marginLeft:-Math.round(scaleX50*selection.x1),marginTop:-Math.round(scaleY50*selection.y1)});},miniatureSave:function(){var i_left=$('#mi_left').val();var i_top=$('#mi_top').val();var i_width=$('#mi_width').val();var i_height=$('#mi_height').val();butloading('miniatureSave','111','disabled','');$.post('/index.php?go=editprofile&act=miniature_save',{i_left:i_left,i_top:i_top,i_width:i_width,i_height:i_height},function(d){if(d=='err')addAllErr('Ошибка');else window.location.href='/u'+d;butloading('miniatureSave','111','enabled','Сохранить изменения');});},miniatureClose:function(){$('#miniature_crop').imgAreaSelect({remove:true});$('#newbox_miniature').remove();$('html, body').css('overflow-y','auto');},webcam:function(){$.post('/index.php?go=editprofile&act=webcam',function(d){$('html, body').css({'overflow-y':'hidden','margin':'0 17px 0 0'});$('body').append('<div id="newbox_miniature">'+d+'</div>');});},LoadPhoto:function(){Page.Loading('start');$.get('/index.php?go=editprofile&act=load_photo',function(data){Box.Show('photo',400,lang_title_load_photo,data,lang_box_canсel);Page.Loading('stop');});},DelPhoto:function(){Box.Show('del_photo',400,lang_title_del_photo,'<div style="padding:15px;">'+lang_del_photo+'</div>',lang_box_canсel,lang_box_yes,'Profile.StartDelPhoto(); return false;');},StartDelPhoto:function(){$('#box_loading').show();$.get('/index.php?go=editprofile&act=del_photo',function(){$('#ava').html('<img src="/templates/Default/images/no_ava.gif" alt="" />');$('#del_pho_but').hide();Box.Close('del_photo');Page.Loading('stop');});},MoreInfo:function(){$('#moreInfo').show();$('#moreInfoText').text('Скрыть подробную информацию');$('#moreInfoLnk').attr('onClick','Profile.HideInfo()');},HideInfo:function(){$('#moreInfo').hide();$('#moreInfoText').text('Показать подробную информацию');$('#moreInfoLnk').attr('onClick','Profile.MoreInfo()');}}
var Box={Page:function(url,data,name,width,title,cancel_text,func_text,func,height,overflow,bg_show,bg_show_bottom,input_focus,cache){if(cache)
if(ge('box_'+name)){Box.Close(name,cache);$('#box_'+name).show();$('#box_content_'+name).scrollTop(0);if(is_moz&&!is_chrome)
scrollTopForFirefox=$(window).scrollTop();$('html').css('overflow','hidden');if(is_moz&&!is_chrome)
$(window).scrollTop(scrollTopForFirefox);return false;}
Page.Loading('start');$.post(url,data,function(html){if(!CheckRequestVideo(location.href))
Box.Close(name,cache);Box.Show(name,width,title,html,cancel_text,func_text,func,height,overflow,bg_show,bg_show_bottom,cache);Page.Loading('stop');if(input_focus)
$('#'+input_focus).focus();});},Show:function(name,width,title,content,close_text,func_text,func,height,overflow,bg_show,bg_show_bottom,cache){if(func_text)
var func_but='<div class="button_div fl_r" style="margin-right:10px;" id="box_but"><button onClick="'+func+'" id="box_butt_create">'+func_text+'</button></div>';else
var func_but='';var close_but='<div class="button_div_gray fl_r"><button onClick="Box.Close(''+name+'', '+cache+'); return false;">'+close_text+'</button></div>';var box_loading='<img id="box_loading" style="display:none;padding-top:8px;padding-left:5px;" src="/templates/Default/images/loading_mini.gif" alt="" />';if(height)
var top_pad=($(window).height()-150-height)/2;if(top_pad<0)
top_pad=100;if(overflow)
var overflow='overflow-y:scroll;';else
var overflow='';if(bg_show)
if(overflow)
var bg_show='<div class="bg_show" style="width:'+(width-19)+'px;"></div>';else
var bg_show='<div class="bg_show" style="width:'+(width-2)+'px;"></div>';else
var bg_show='';if(bg_show_bottom)
if(overflow)
var bg_show_bottom='<div class="bg_show_bottom" style="width:'+(width-17)+'px;"></div>';else
var bg_show_bottom='<div class="bg_show_bottom" style="width:'+(width-2)+'px;"></div>';else
var bg_show_bottom='';if(height)
var sheight='height:'+height+'px';else
var sheight='';$('body').append('<div id="modal_box"><div id="box_'+name+'" class="box_pos"><div class="box_bg" style="width:'+width+'px;margin-top:'+top_pad+'px;"><div class="box_title" id="box_title_'+name+'">'+title+'<div class="box_close" onClick="Box.Close(''+name+'', '+cache+'); return false;"></div></div><div class="box_conetnt" id="box_content_'+name+'" style="'+sheight+';'+overflow+'">'+bg_show+content+'<div class="clear"></div></div>'+bg_show_bottom+'<div class="box_footer"><div id="box_bottom_left_text" class="fl_l">'+box_loading+'</div>'+close_but+func_but+'</div></div></div></div>');$('#box_'+name).show();if(is_moz&&!is_chrome)
scrollTopForFirefox=$(window).scrollTop();$('html').css('overflow','hidden');if(is_moz&&!is_chrome)
$(window).scrollTop(scrollTopForFirefox);$(window).keydown(function(event){if(event.keyCode==27){Box.Close(name,cache);}});},Close:function(name,cache){if(!cache)
$('.box_pos').remove();else
$('.box_pos').hide();if(CheckRequestVideo(location.href)==false&&CheckRequestPhoto(location.href)==false)
$('html, body').css('overflow-y','auto');if(CheckRequestVideo(location.href))
$('#video_object').show();if(is_moz&&!is_chrome)
$(window).scrollTop(scrollTopForFirefox);},GeneralClose:function(){$('#modal_box').hide();},Info:function(bid,title,content,width,tout){var top_pad=($(window).height()-115)/2;$('body').append('<div id="'+bid+'" class="box_info"><div class="box_info_margin" style="width: '+width+'px; margin-top: '+top_pad+'px"><b><span>'+title+'</span></b><br /><br />'+content+'</div></div>');$(bid).show();if(!tout)
var tout=1400;setTimeout("Box.InfoClose()",tout);$(window).keydown(function(event){if(event.keyCode==27){Box.InfoClose();}});},InfoClose:function(){$('.box_info').fadeOut();}}
function ge(i){return document.getElementById(i);}
function butloading(i,w,d,t){if(d=='disabled'){$('#'+i).html('<div style="width:'+w+'px;text-align:center;"><img src="/templates/Default/images/loading_mini.gif" alt="" /></div>');ge(i).disabled=true;}else{$('#'+i).html(t);ge(i).disabled=false;}}
function textLoad(i){$('#'+i).html('<img src="/templates/Default/images/loading_mini.gif" alt="" />').attr('onClick','').attr('href','#');}
function updateNum(i,type){if(type)
$(i).text(parseInt($(i).text())+1);else
$(i).text($(i).text()-1);}
function setErrorInputMsg(i){$("#"+i).css('background','#ffefef');$("#"+i).focus();setTimeout("$('#"+i+"').css('background', '#fff').focus()",700);}
function addAllErr(text,tim){if(!tim)
var tim=2500;$('.privacy_err').remove();$('body').append('<div class="privacy_err no_display">'+text+'</div>');$('.privacy_err').fadeIn('fast');setTimeout("$('.privacy_err').fadeOut('fast')",tim);}
function langNumric(id,num,text1,text2,text3,text4,text5){strlen_num=num.length;if(num<=21){numres=num;}else if(strlen_num==2){parsnum=num.substring(1,2);numres=parsnum.replace('0','10');}else if(strlen_num==3){parsnum=num.substring(2,3);numres=parsnum.replace('0','10');}else if(strlen_num==4){parsnum=num.substring(3,4);numres=parsnum.replace('0','10');}else if(strlen_num==5){parsnum=num.substring(4,5);numres=parsnum.replace('0','10');}
if(numres<=0)
var gram_num_record=text5;else if(numres==1)
var gram_num_record=text1;else if(numres<5)
var gram_num_record=text2;else if(numres<21)
var gram_num_record=text3;else if(numres==21)
var gram_num_record=text4;else
var gram_num_record='';$('#'+id).html(gram_num_record);}
template_dir='/templates/Default';uploads_dir='/uploads';uploads_smile_dir='/uploads/smiles';lang_empty='Поля не должны быть пустыми.';lang_nosymbol='Специальные символы и пробелы запрещены.';lang_pass_none='Пароли не совпадают';lang_code_none='Код безопасности не соответствует отображённому';lang_please_code='Введите код с картинки';lang_bad_email='Неправильный адрес';lang_none_sex='Укажите Ваш пол';lang_no_vk='Указанная Вами ссылка не является сайтом в контакте';lang_no_od='Указанная Вами ссылка не является сайтом однаклассники';lang_no_fb='Указанная Вами ссылка не является сайтом facebook';lang_no_icq='Номер ICQ должен состоять только из цифр';lang_infosave='Изменения сохранены';lang_bad_format='Неверный формат файла';lang_bad_size='Файл не должен превышать 5 Mб';lang_bad_aaa='Неизвестная ошибка';lang_del_photo='Вы уверены, что хотите удалить фотографию?';lang_del_album='Вы уверены, что хотите удалить альбом?';lang_title_del_photo='Предупреждениe';lang_box_canсel='Отмена';lang_box_yes='Да';lang_box_send='Отправить';lang_box_save='Сохранить';lang_box_insert='Вставить';lang_title_load_photo='Загрузка главной фотографии';lang_title_new_album='Создание нового альбома';lang_album_create='Готово';lang_nooo_er='Код ошибки: 1';lang_del_comm='Комментарий успешно удален.';lang_edit_albums='Редактирование альбома';lang_edit_cover_album='Выберите фотографию на обложку';lang_demand_ok='Заявка отправлена';lang_demand_no='Повторно заявка отправлена не будет.';lang_demand_sending='Заявка отправляеться';lang_demand_sending_t='В данный момент заявка на дружбу отправляеться.';lang_demand_s_ok=' получил уведомление и подтвердит, что Вы его друг.';lang_take_ok='Заявка принята.';lang_take_no='Заявка отклонена.';lang_dd2f_no='Информация';lang_dd2f22_no='Этот пользователь есть у Вас в заявках.';lang_22dd2f22_no='Этот пользователь уже есть у Вас в друзьях.';lang_no_user_fave='Такого пользователя не существует.';lang_yes_user_fave='Этот пользователя уже есть у Вас в закладках.';lang_del_fave='Удалить из закладок';lang_add_fave='Добавить в закладки';lang_fave_info='Вы уверены, что хотите удалить этого пользователя из закладок?';lang_fave_no_users='<div class="info_center">Вы можете добавлять сюда страницы интересных Вам людей.<br />Из этого раздела у Вас всегда будет быстрый доступ к ним.</div>';lang_new_msg='Новое сообщение';lang_new_msg_send='Отправить';lang_msg_box='Сообщения';lang_msg_max_strlen='Ваше сообщение слишком длинное.';lang_msg_ok_title='Сообщение отправлено.';lang_msg_ok_text='Ваше сообщение успешно отправлено.';lang_msg_close='Закрыть';lang_photo_info_text='Фотография удалена либо еще не загружена.';lang_photo_info_delok='<br /><span class="online">Фотография удалена.</span>';lang_albums_add_photo='Описание фотографии';lang_albums_set_cover='Сделать обложкой альбома';lang_albums_del_photo='Удалить фотографию';lang_albums_save_descr='Сохранить описание';lang_notes_no_title='Введите заголовок заметки.';lang_notes_no_text='Введите текст заметки.';lang_del_note='Вы действительно хотите удалить эту заметку?';lang_del_process='Заметка удаляется...';lang_notes_comm_max='Ваш комментарий слишком длинный.';lang_notes_setting_addphoto='Настройки фотографии';lang_notes_setting_addvdeio='Настройки видеозаписи';lang_notes_preview='Как это будет после публикации';lang_wysiwyg_title='Настройки ссылки';lang_unsubscribe='Отписаться от обновлений';lang_subscription='Подписаться на обновления';lang_subscription_box_title='Подписки';lang_max_albums='Привышен лимит альбомов.';lang_video_new='Добавление нового видео';lang_videos_no_url='Введите ссылку на видеоролик.';lang_videos_no_url='Напишите название для видеоролика.';lang_videos_sending='В данный момент видео обрабатывается.';lang_videos_del_text='Вы действительно хотите удалить эту видеозапись?';lang_videos_deletes='Видеозапись удаляется...';lang_videos_delok='<div class="videos_delok">Видеозапись удалена.</div>';lang_videos_delok_2='<div class="online" style="margin-top:10px">Видеозапись удалена.</div>';lang_video_edit='Редактирование видеозаписи';lang_video_info_text='Видеозапись удалена либо еще не добавлена.';lang_scroll_loading='<span id="scroll_loading"><center><img src="/templates/Default/images/loading_mini.gif" alt="" /></center><br /></span>';lang_se_go='Найти';lang_bad_format='Загружать разрешено только фотографии в формате JPG, PNG, GIF.';lang_max_imgs='Привышен лимит фотографий в одном альбоме.';lang_max_size='Привышен максимальный размер изображения.';lang_news_prev='Показать предыдущие новости ↓';lang_editprof_text_1='Укажите Вашу подругу';lang_editprof_text_2='Укажите Вашу невесту';lang_editprof_text_3='Укажите Вашу жену';lang_editprof_text_4='Укажите Вашу любимую';lang_editprof_text_5='Укажите Вашего партнёра';lang_editprof_atext_1='Укажите Вашего друга';lang_editprof_atext_2='Укажите Вашего жениха';lang_editprof_atext_3='Укажите Вашего мужа';lang_editprof_atext_4='Укажите Вашего любимого';lang_editprof_atext_5='Укажите Вашего партнёра';lang_editprof_sptext_1='Подруга:';lang_editprof_sptext_2='Невеста:';lang_editprof_sptext_3='Жена:';lang_editprof_sptext_4='Любимая:';lang_editprof_sptext_5='Партнёр:';lang_editprof_asptext_1='Друг:';lang_editprof_asptext_2='Жених:';lang_editprof_asptext_3='Муж:';lang_editprof_asptext_4='Любимый:';lang_editprof_asptext_5='Партнёр:';lang_pr_no_title='Ошибка доступа';lang_pr_no_msg='Вы не можете отправить сообщение данному пользователю, так как он ограничивает круг лиц, которые могут присылать ему сообщения.';lang_support_text='Вы действительно хотите удалить вопрос? Это действие нельзя будет отменить.';lang_support_ltitle='Лимит';lang_support_ltext='Следующий вопрос Вы сможете задать через час.';lang_news_text='Вы действительно хотите удалить новость? Это действие нельзя будет отменить.';lang_gifts_title='Выберите подарок';lang_gifts_tnoubm='У Вас недостаточно убм для отправки этого подарка.';lang_gifts_oktitle='Подарок отправлен';lang_gifts_oktext='Ваш подарок был успешно отправлен.';lang_groups_new='Создание нового сообщества';lang_groups_cretate='Создать сообщество';lang_audio_add='Добавление новой песни';lang_audio_err='Формат не поддерживается либо ссылка является неправильной';lang_audio_wall_attatch='Выберите аудиозапись';lang_wall_tell_tes='Эта запись уже есть на стене';lang_wall_text='Что у Вас нового?';lang_wall_del_ok='<div class="color777">Запись успешно удалена.</div>';lang_wall_del_com_ok='<div class="online" style="margin-bottom:10px">Комментарий успешно удален.</div>';lang_wall_all_lnk='к предыдущим записям';lang_wall_hide_comm='Скрыть комментарии';lang_wall_atttach_addsmile='Выберите смайлик для отправки';lang_wall_attatch_photos='Выберите фотографию';lang_wall_attatch_videos='Выберите видеозапись';lang_wall_no_atttach='Не прикреплять';lang_wall_max_smiles='Максимально можно прикреплять 3 смайлика.';lang_wall_liked_users='Люди, которым это понравилось';lang_wall_attach_smiles='<img src="'+uploads_smile_dir+'/1.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/2.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/3.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/4.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/5.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/6.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/7.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/8.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/9.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/10.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/11.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/12.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/13.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/14.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/15.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/1.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/29.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/17.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/18.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/19.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/20.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/21.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/22.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/23.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/24.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/25.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/26.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/27.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/30.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/31.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/32.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/33.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/34.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/35.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/36.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/37.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/38.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/39.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/40.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/41.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/42.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/43.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/44.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/45.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/46.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" /><img src="'+uploads_smile_dir+'/47.gif" class="wall_attach_smile" onClick="wall.attach_insert('smile', this.src)" />';;var cover={init:function(i,hi){$('#cover_img').attr('src',i);$("#les10_ex2").draggable({axis:'y',stop:function(){$('.cover_addut, .cover_descring').show();},drag:function(event,ui){var d=ui.position.top;$('.cover_addut, .cover_descring').hide();if(d>=0){$("#les10_ex2").remove();$('#cover_restart').html('<div style="width:794px;height:'+hi+'px;position:relative;top:0px;z-index:1" id="les10_ex2"><img src="'+i+'" width="794" id="cover_img" /></div>');$('.cover_addut, .cover_descring').show();cover.init(i,hi);}
h=parseInt('-'+(hi-230));if(d<=h){$("#les10_ex2").remove();$('#cover_restart').html('<div style="width:794px;height:'+hi+'px;position:relative;top:'+h+'px;z-index:1" id="les10_ex2"><img src="'+i+'" width="794" id="cover_img" /></div>');$('.cover_addut, .cover_descring').show();cover.init(i,hi);}}});},del:function(public_id){$('.cover_descring, .cover_addut').hide();$('#upload_cover').show().text('Добавить обложку');$('.cover_newpos').css('margin-left','430px');$('#cover_img').attr('src','');$('.cover_loaddef_bg').css('cursor','default').hide();$('#cover_restart').html('');$("#les10_ex2").draggable('destroy');if(public_id)$.post('/index.php?go=groups&act=delcover&id='+public_id);else $.post('/index.php?go=editprofile&act=delcover');},save:function(public_id){cover.cancel();t=$("#les10_ex2").attr('style').split('top:');s=t[1].split('px');s[0]=s[0].replace('-','');if(public_id)$.post('/index.php?go=groups&act=savecoverpos&id='+public_id,{pos:s[0]});else $.post('/index.php?go=editprofile&act=savecoverpos',{pos:s[0]});},cancel:function(t){$('.cover_descring, .cover_addut').hide();$('.cover_addut_edit').show();$('.cover_newpos').css('margin-left','397px');$('.cover_loaddef_bg').css('cursor','default');$("#les10_ex2").draggable('destroy');if(t)$("#les10_ex2").css('top','-'+t+'px');},startedit:function(i,h,public_id){$('#upload_cover').show().text('Изменить фото');$('.cover_descring, .cover_addut').show();$('.cover_newpos').css('margin-left','197px');$('.cover_addut_edit').hide();$('.cover_loaddef_bg').css('cursor','move');cover.init(i,h);}}
var peers={show:function(id){if($('#audios').is('.cd')){$('#styler').remove();$('#auiossj').remove();$('#player_volume_bar').css({'margin':'4px 0 0 10px'});$('#pleybasr').show();$('#rands_1').show();if(id!='s'){if($('#audios').is('.cd')){$('#styler').remove();$('#player_volume_bar').css({'margin':'4px 0 0 10px'});$('#pleybasr').show();$('#rands_1').show();$.get('/audio'+id,function(data){$('#audios').html(data);$('#mini').hide();$('#myplaylist').show();});}}}else{if(id=='s'){$.get('/audio',function(data){$('#audios').html(data);$('#mini').hide();$('#myplaylist').hide();});}else{$.get('/audio'+id,function(data){$('#audios').html(data);$('#mini').hide();$('#myplaylist').show();});}
$('#audios').addClass('cd');$('#audios').show();}},hide:function(){$('#pleybasr').hide();$('#rands_1').hide();$('#player_volume_bar').css({'margin':'13px 0 0 -70px'});$('body').append('<script id="auiossj" type="text/javascript">$( init );function init() {$("#player_container").draggable();}</script><div id="styler"><style>#audios {margin:-450px 0 0 229px;}.player_container {background:#DEE5EB;border:1px solid #D9D9D9;height:36px;padding:1px 7px;width:170px;position:fixed;bottom:7%;left:5%;opacity:0.8;border-radius:5px;}.player_container:hover {opacity:1;}.player_ic {height:0;margin-right:10px;padding-top:7px;width:13px;cursor:pointer;}.player_ic_prev {height:10px;margin:15px 0 0 6px;width:14px;}.player_ic_next {height:10px;margin:15px 0 0;width:14px;}.player_track_name {margin:7px 0 0 -39px;max-height:14px;overflow:hidden;width:111px;}.player_time_text {margin:8px 0 0 144px;position:absolute;}.player_refresh {margin:7px 0 0 -8px;opacity:0.4;width:15px;}.player_rand {margin:8px 0 0 5px;opacity:0.4;width:15px;}.bottoms {display:none;}#audios .audio_onetrack {display:none;}</style></div>');}}
var vii_apps_search_delay=false;var vii_apps_search_val='';var apps_preload=true;var doload=5;var loads=20;var apps={close:function(h){history.pushState({link:h},null,h);$('#newbox_miniature').remove();$('html,body').css({'overflow':'auto','margin':'0'});},c:function(){$('#newbox_miniature').remove();},sendWall:function(id){$.post('/index.php?go=apps&act=mywall',{id:id},function(){Box.Info('msg_info','Приложения','Вы успешно рассказали друзьям.',300);});},gSearch:function(){var a=$('#query_games').val();if(!a){$('#apps_all').show();$('#apps_search').hide();$('#apps_se_load').fadeOut(100);apps_preload=true;}
if(a!=0){apps_preload=false;$('#apps_se_load').fadeIn('fast');0==vii_apps_search_val!=a&&a!=0<a.length&&(clearInterval(vii_apps_search_delay),vii_apps_search_delay=setInterval(function(){apps.xSearch();},600));}},xSearch:function(){clearInterval(vii_apps_search_delay);var a=$('#query_games').val();$.post('/index.php?go=apps&act=search',{query_games:a},function(d){if(a!=0){$('#apps_all').hide();$('#apps_search').show();$('#apps_se_load').fadeOut(100);$('#apps_search_res').html(d);$(".apps_last:last").css('border','0px');}else{$('#apps_all').show();$('#apps_search').hide();$('#apps_se_load').fadeOut(100);}});},showMore:function(){if($('#apps_text_load').text()=='Показать больше приложений'&&apps_preload){textLoad('apps_text_load');$.post('/index.php?go=apps&act=loads',{num:loads},function(d){loads=loads+20;row=d.split('||');$('#apps_pop').append(row[0]);$('#apps_new').append(row[1]);$('#apps_text_load').text('Показать больше приложений');if(!row[0]&&!row[1])$('.apps_but2').remove();});}},showMoreOld:function(){if($('#apps_text_load_old').text()=='Показать больше приложений'){textLoad('apps_text_load_old');$.post('/index.php?go=apps&act=doload',{num:doload},function(d){doload=doload+5;row=d.split('||');$('#apps_my_games').append(row[0]);$('#apps_activity').append(row[1]);$('#apps_text_load_old').text('Показать больше приложений');if(!row[0]&&!row[1])$('.apps_but').remove();});}},view:function(a,h,c){history.pushState({link:h},null,h);$('html,body').css({'overflow':'hidden','margin':'0 17px 0 0'});$.post('/index.php?go=apps&act=view',{id:a},function(d){$('body').append('<div id="newbox_miniature"><div class="miniature_box"><div class="miniature_pos" style="width: 607px;margin-top:30px;"><div class="miniature_title fl_l">Запуск игры</div><a class="cursor_pointer fl_r" onclick="apps.close('/apps')">Закрыть</a><div class="clear"></div>'+d+'</div></div></div>');});},mydel:function(i,t){if(t){$('.js_titleRemove').remove();$('#app'+i).html('<div align="center" style="color:#777;height:40px;padding-top:10px">Игра успешно удалена.</div>');}else
$('#apps_rdel_txt').html('<div class="fl_r" style="color:#777;margin-top:6px;font-weight:normal">Игра удалена из списках ваших игр</div>');$.post('/index.php?go=apps&act=mydel',{id:i});}}
var publics={CreatAlbum:function(i){Page.Loading('start');$.post('/index.php?go=public_albums&act=create_page',{id:i},function(data){Box.Show('albums',450,lang_title_new_album,data,lang_box_canсel,lang_album_create,'StartCreatAlbums(); return false;',0,0,1,1);$('#name').focus();Page.Loading('stop');});},Delete:function(aid,id){$.post('/index.php?go=public_albums&act=delete',{id:id,aid:aid},function(d){Page.Go('/public/albums/'+id);});},MsgDelete:function(aid){$.post('/index.php?go=public_albums&act=del_photo',{aid:aid},function(d){$('#a_photo_'+aid).remove();});},SetCover:function(aid){$.post('/index.php?go=public_albums&act=set_cover',{aid:aid},function(d){});},editAlbum:function(i){Page.Loading('start');$.post('/index.php?go=public_albums&act=edit',{id:i},function(data){Box.Show('albums',450,lang_title_new_album,data,lang_box_canсel,lang_album_create,'StarteditAlbums(); return false;',0,0,1,1);$('#name').focus();Page.Loading('stop');});},show:function(id,h){Page.Loading('start');history.pushState({link:id},null,id);$('body').css({'overflow':'hidden','margin':'0 17px 0 0'});$.post('/index.php?go=public_albums&act=show',{id:id,type:h},function(d){Page.Loading('stop');$('.photo_view').remove();$('body').append(d);});}}
var im_chat={chatOpen:function(){if($('#im_chat_block').is('.im_chat_block')){$('#im_chat_block').show();}else{$.post('/index.php?go=im_chat',function(s){$('body').append(s);});}
$('#ims').attr('onClick','im_chat.close();');}}
var rating={view:function(g){if(g==1||g>1){vg=g-1;if(g>=100){var but='<div class="button_div fl_l" style="margin:10px 0 0 143px;"><button id="sendbalance" onclick="rating.send(''+user_id+'')">Передать голоса</button></div>';var style='display:block';}
var title='Повышение рейтинга';var body='<div class="rating_text">Введите ниже, на сколько Вы хотите повысить рейтинг.<br>Обратите внимание, что услуга считается оказанной в момент зачисления рейтинга, возврат невозможен. </div> <div class="rating_iny">+<input id="rate_num" class="inpst" type="text" onkeyup="rating.update('+g+')" maxlength="3" value="1"><div class="rating_text_balance">У Вас<span id="rt"> останется</span> <b id="num">'+vg+' </b> dem</div><input id="balance" type="hidden" value="'+g+'"></div><div class="button_div fl_l" style="margin-left:140px"><button id="saverate" onclick="rating.save(''+user_id+'')">Повысить рейтинг</button></div><span style="display:none; '+style+';">'+but+'</span><div class="clear"></div>';}else{var title='<b style="color:#F00">У вас недостаточно голосов</b>';var body='<div class="rating_text"><b>Голоса</b> – это универсальная валюта для всех приложений на нашем сайте. Кроме этого, голосами можно оплатить подарки. Голосами нельзя оплатить рекламу. Обратите внимание, что услуга считается оказанной в момент зачисления голосов, возврат невозможен. Кроме этого за каждого приглашённого друга по вашей ссылке, вы будете получать по <b>10 голосов</b> , также каждый день на ваш счёт будет начислятся по <b>1 голосу</b>, если вы заходили в течении дня на сайт. <br><div class="rating_text_balance" style="text-align:center;">У Вас<span id="rt"></span> <b id="num">нет </b> голосов.</div></div><div class="button_div fl_l" style="margin:10px 0 0 139px;"><button id="saverate" onclick="Profile.miniatureClose();Page.Go('/balance?act=invite'); return false;">Получить голоса</button></div><div class="clear"></div>';}
$('body').append('<div id="newbox_miniature"><div class="miniature_box"><div class="miniature_pos" style="width: 400px;"><div class="miniature_title fl_l">'+title+'</div><a class="cursor_pointer fl_r" onclick="Profile.miniatureClose()">Закрыть</a><div class="clear"></div>'+body+'</div></div></div>');},update:function(g){var add=$('#rate_num').val();var new_rate=g-add;var pr=parseInt(add);if(!isNaN(pr))
$('#rate_num').val(parseInt(add));else
$('#rate_num').val('');if(add&&new_rate>=0){$('#num').text(new_rate);$('#rt').show();}else if(new_rate<=0||$('#balance').val()<=0){$('#num').text('недостаточно');$('#rt').hide();}else{$('#rt').show();$('#num').text($('#balance').val());}},save:function(id){var num=$('#rate_num').val();$.post('/index.php?go=rating&act=rating',{id:id,num:num},function(f){$('#profile_rate_num').html(f);$('#newbox_miniature').remove();Box.Info('msg_info','Рейтинг','Рейтинг успешно изменен.',300);});},send:function(id){var num=$('#rate_num').val();$.post('/index.php?go=rating&act=balance',{id:id,num:num},function(f){$('#newbox_miniature').remove();Box.Info('msg_info','Баланс','Баланс успешно отправлен.',300);});},people:function(id){$.post('/index.php?go=rating&act=peoples',{id:id},function(d){$('body').append(d);});}}
var photoeditor={start:function(img,id,h){var height=parseInt(h)+180;$('#ladybug_ant'+id).hide();$('#frameedito'+id).html('<iframe src="http://pixlr.com/express/?s=c&image='+escape(img)+'&title=photo&target='+escape('http://'+location.host+'/index.php?go=photo_editor&pid='+id)+'&exit='+escape('http://'+location.host+'/index.php?go=photo_editor&act=close&image='+img)+'" width="770" height="'+height+'" frameborder="0"></iframe>');}}
var Albums={CreatAlbum:function(){Page.Loading('start');$.post('/index.php?go=albums&act=create_page',function(data){Box.Show('albums',450,lang_title_new_album,data,lang_box_canсel,lang_album_create,'StartCreatAlbum(); return false;',0,0,1,1);$('#name').focus();Page.Loading('stop');});},Delete:function(id,hash){Box.Show('del_album_'+id,350,lang_title_del_photo,'<div style="padding:15px;">'+lang_del_album+'</div>',lang_box_canсel,lang_box_yes,'Albums.StartDelete('+id+', ''+hash+''); return false;');},StartDelete:function(id,hash){$('#box_loading').show();$.post('/index.php?go=albums&act=del_album',{id:id,hash:hash},function(d){Box.Close('del_album_'+id);$('#album_'+id).remove();updateNum('#albums_num');if($('.albums').size()<1)
Page.Go(location.href);});},Drag:function(){$("#dragndrop ul").sortable({cursor:'move',opacity:0.9,scroll:false,update:function(){var order=$(this).sortable("serialize");$.post("/index.php?go=albums&act=save_pos_albums",order,function(){});}});},EditBox:function(id){Page.Loading('start');$.post('/index.php?go=albums&act=edit_page',{id:id},function(d){Page.Loading('stop');Box.Show('edit_albums_'+id,450,lang_edit_albums,d,lang_box_canсel,lang_box_save,'Albums.SaveDescr('+id+'); return false',0,0,1,1);});},SaveDescr:function(id){var name=$("#name_"+id).val();var descr=$("#descr_t"+id).val();if(name!=0){$("#name_"+id).css('background','#fff');$('#box_loading').show();$.post('/index.php?go=albums&act=save_album',{id:id,name:name,descr:descr,privacy:$('#privacy').val(),privacy_comm:$('#privacy_comment').val()},function(data){$('#box_loading').hide();if(data=='no_name'){$('.err_red').show().text(lang_empty);ge('box_but').disabled=false;}else if(data=='no'){$('.err_red').show().text(lang_nooo_er);ge('box_but').disabled=false;}else{Box.Close('edit_albums_'+id);row=data.split('|#|||#row#|||#|');$('#descr_'+id).html('<div style="padding-top:4px;">'+row[1]+'</div>');$('#albums_name_'+id).html(row[0]);}});}else{$("#name_"+id).css('background','#ffefef');setTimeout("$('#name_"+id+"').css('background', '#fff').focus()",800);$('#box_loading').hide();}},EditCover:function(id,page_num){if(page_num)
page='&page='+page_num;else{page='';page_num=1;}
Box.Page('/index.php?go=albums&act=edit_cover','id='+id+page,'edit_cover_'+id+page_num,627,lang_edit_cover_album,lang_box_canсel,0,0,400,'overflow','bg_show_top','bg_show_bottom','',1);},SetCover:function(id,aid,photo){$('#box_loading').show();$.get('/index.php?go=albums&act=set_cover',{id:id},function(){$('#cover_'+aid).html('<img src="'+photo+'" alt="" />');Box.Close('edit_cover_'+aid);$('#box_loading').hide();});}}
var Photo={Drag:function(){$("#dragndrop ul").sortable({cursor:'move',scroll:false,update:function(){var order=$(this).sortable("serialize");$.post("/index.php?go=albums&act=save_pos_photos",order);}});},Show:function(h){Distinguish.GeneralClose();var id=h.split('_');var uid=id[0].split('photo');var section=h.split('sec=');var fuser=h.split('wall/fuser=');var note_id=h.split('notes/id=');var msg_id=h.split('msg/id=');if(fuser[1])
section[1]='wall';if(note_id[1]){section[1]='notes';fuser[1]=note_id[1];}
if(msg_id[1]){section[1]='msg';fuser[1]=msg_id[1];}
$('.photo_view').hide();if(is_moz&&!is_chrome)scrollTopForFirefox=$(window).scrollTop();$('html').css('overflow','hidden');if(is_moz&&!is_chrome)$(window).scrollTop(scrollTopForFirefox);if(ge('photo_view_'+id[1])){$('#photo_view_'+id[1]).show();history.pushState({link:h},null,h);}else{Photo.Loading('start');$.post('/index.php?go=photo',{uid:uid[1],pid:id[1],section:section[1],fuser:fuser[1]},function(d){if(d=='no_photo'){Photo.Loading('stop');Box.Info('no_video',lang_dd2f_no,lang_photo_info_text,300);$('html, body').css('overflow-y','auto');return false;}else if(d=='err_privacy'){Photo.Loading('stop');addAllErr(lang_pr_no_title);$('html, body').css('overflow-y','auto');}
if(section[1]!='loaded')
history.pushState({link:h},null,h);$('body').append(d);$('#photo_view_'+id[1]).show();Photo.Loading('stop');});}},mShow:function(h){Distinguish.GeneralClose();var id=h.split('_');var uid=id[0].split('photo');var section=h.split('sec=');var fuser=h.split('wall/fuser=');var note_id=h.split('notes/id=');var msg_id=h.split('msg/id=');if(fuser[1]){section[1]='wall';}
if(note_id[1]){section[1]='notes';fuser[1]=note_id[1];}
if(msg_id[1]){section[1]='msg';fuser[1]=msg_id[1];}
$('.photo_view').hide();if(ge('photo_view_'+id[1])){$('#photo_view_'+id[1]).show();history.pushState({link:h},null,h);}else{$.post('/index.php?go=photo',{uid:uid[1],pid:id[1],section:section[1],fuser:fuser[1]},function(d){if(d=='no_photo'){Box.Info('no_video',lang_dd2f_no,lang_photo_info_text,300);$('html, body').css('overflow-y','auto');return false;}else if(d=='err_privacy'){addAllErr(lang_pr_no_title);$('html, body').css('overflow-y','auto');}
if(section[1]!='loaded')
history.pushState({link:h},null,h);$('#page').html(d);$('#photo_view_'+id[1]).show();});}},Profile:function(uid,photo,type){Photo.Loading('start');$.post('/index.php?go=photo&act=profile',{uid:uid,photo:photo,type:type},function(d){Photo.Loading('stop');if(d=='no_photo'){Box.Info('no_video',lang_dd2f_no,lang_photo_info_text,300);$('html, body').css('overflow-y','auto');}else{$('body').append(d);$('#photo_view').show();$('html, body').css('overflow-y','hidden');}});},Prev:function(h){var id=h.split('_');$('.photo_view').hide();$('html, body').css('overflow','hidden');$('.pinfo, .photo_prev_but, .photo_next_but').show();$('.save_crop_text').hide();$('.ladybug_ant').imgAreaSelect({remove:true});if(ge('photo_view_'+id[1])){$('#photo_view_'+id[1]).show();return false;}else{Photo.Show(h);}},Close:function(close_link){$('.ladybug_ant').imgAreaSelect({remove:true});$('.photo_view').remove();$('html, body').css('overflow-y','auto');if(is_moz&&!is_chrome)$(window).scrollTop(scrollTopForFirefox);if(close_link!=false)
history.pushState({link:close_link},null,close_link);},Loading:function(f){if(f=='start'){if(is_moz&&!is_chrome)scrollTopForFirefox=$(window).scrollTop();$('html').css('overflow','hidden');if(is_moz&&!is_chrome)$(window).scrollTop(scrollTopForFirefox);var loadcontent='<div class="photo_view" id="photo_load" style="padding-right:17px" onClick="Photo.setEvent(event, false)">'+'<div class="photo_close" onClick="Photo.LoadingClose(); return false" style="right:15px;"></div>'+'<div class="photo_bg" style="height:310px;padding-top:290px;">'+'<center><img src="/templates/Default/images/progress.gif" alt="" /></center>'+'</div>'+'</div>';$('body').append(loadcontent);$('#photo_load').show();}
if(f=='stop')
$('#photo_load').remove();},LoadingClose:function(){$('#photo_load').remove();$('html, body').css('overflow-y','auto');},Init:function(target){this.target=$(target);var that=this;$(window).scroll(function(){if($(document).height()-$(window).height()<=$(window).scrollTop()){alert(1);}});},Panel:function(id,f){if(f=='show')
$('#albums_photo_panel_'+id).show();else
$('#albums_photo_panel_'+id).hide();},MsgDelete:function(id,aid,type){Box.Show('del_photo_'+id,'400',lang_title_del_photo,'<div style="padding:15px;">'+lang_del_photo+'</div>',lang_box_canсel,lang_box_yes,'Photo.Delete('+id+', '+aid+', '+type+'); return false');},Delete:function(id,aid,type){$('#box_loading').show();$.get('/index.php?go=albums&act=del_photo',{id:id},function(){Box.Close('del_photo_'+id);if(!type){$('#a_photo_'+id).remove();$('#p_jid'+id).remove();updateNum('#photo_num');}else
$('#pinfo_'+id).html(lang_photo_info_delok);});},SetCover:function(id,jid){Page.Loading('start');$.get('/index.php?go=albums&act=set_cover',{id:id},function(){$('.albums_new_cover').fadeOut();$('#albums_new_cover_'+jid).fadeIn();Page.Loading('stop');});},EditBox:function(id,r){Page.Loading('start');$.get('/index.php?go=albums&act=editphoto',{id:id},function(data){Box.Show('edit_photo_'+id,'400','Редактирование фотографии','<div class="box_ppad"><div style="color:#888;padding-bottom:5px;"><b>Описание фотографии</b></div><textarea class="inpst" id="descr_'+id+'" style="width:355px;height:71px;">'+data+'</textarea></div>','Отмена','Сохранить','Photo.SaveDescr('+id+', '+r+'); return false');Page.Loading('stop');});},SaveDescr:function(id,r){var descr=$('#descr_'+id).val();$('#box_loading').show();$.post('/index.php?go=albums&act=save_descr',{id:id,descr:descr},function(d){Box.Close('edit_photo_'+id);if(r==1)
$('.photo_view').remove();else
$('#photo_descr_'+id).html(d);});},setEvent:function(event,close_link){var oi=(event.target)?event.target.id:((event.srcElement)?event.srcElement.id:null);var el=oi.substring(0,10);if(el=='photo_view'||el=='photo_load')
Photo.Close(close_link);},Rotation:function(pos,id){$('#loading_gradus'+id).show();$.post('/index.php?go=photo&act=rotation',{id:id,pos:pos},function(d){var rndval=new Date().getTime();$('#ladybug_ant'+id).attr('src',d+'?'+rndval);$('#loading_gradus'+id).hide();});}}
var comments={add:function(id){var comment=$('#textcom_'+id).val();if(comment!=0){butloading('add_comm','56','disabled','');$.post('/index.php?go=photo&act=addcomm',{pid:id,comment:comment},function(data){if(data=='err_privacy'){addAllErr(lang_pr_no_title);}else{$('#comments_'+id).append(data);$('#textcom_'+id).val('');}
butloading('add_comm','56','enabled',lang_box_send);});}else{$('#textcom_'+id).val('');$('#textcom_'+id).focus();}},delet:function(id,hash){textLoad('del_but_'+id);$.post('/index.php?go=photo&act=del_comm',{hash:hash,id:id},function(){$('#comment_'+id).html('<div style="padding-bottom:5px;color:#777;">'+lang_del_comm+'</div>');});},delet_page_comm:function(id,hash){textLoad('full_del_but_'+id);$.post('/index.php?go=photo&act=del_comm',{hash:hash},function(){$('#comment_all_'+id).html('<div style="padding-bottom:5px;color:#777;">'+lang_del_comm+'</div>');});},all:function(id,num){textLoad('all_lnk_comm_'+id);$('#all_href_lnk_comm_'+id).attr('onClick','').attr('href','#');$.post('/index.php?go=photo&act=all_comm',{pid:id,num:num},function(d){$('#all_href_lnk_comm_'+id).hide();$('#all_comments_'+id).html(d);});},}
var friends={add:function(for_id,user_name){if(for_id){Page.Loading('start');if(user_name)
name=user_name;else
name=$('title').text();$.get('/friedns/send_demand/'+for_id,function(data){if(data=='yes_demand')
Box.Info('add_demand_'+for_id,lang_demand_ok,lang_demand_no,300);else if(data=='yes_demand2')
Box.Info('add_demand_k_'+for_id,lang_dd2f_no,lang_dd2f22_no,300);else if(data=='yes_friend')
Box.Info('add_demand_k_'+for_id,lang_dd2f_no,lang_22dd2f22_no,300);else
Box.Info('add_demand_ok_'+for_id,lang_demand_ok,'<b><a href="'+location.href+'" onClick="Page.Go(this.href); return false">'+name+'</a></b> '+lang_demand_s_ok,400);Page.Loading('stop');});}
$('.m').show();$('.ok').html('Заявка в друзья успешно отправлена.');},sending_demand:function(for_id){Box.Info('add_sending_demand_'+for_id,lang_demand_sending,lang_demand_sending_t);},take:function(take_user_id){Page.Loading('start');$.get('/friedns/take/'+take_user_id,function(data){Page.Loading('stop');$('#action_'+take_user_id).html(lang_take_ok).css('color','#777');});},reject:function(reject_user_id){Page.Loading('start');$.get('/friedns/reject/'+reject_user_id,function(data){Page.Loading('stop');$('#action_'+reject_user_id).html(lang_take_no);});},delet:function(user_id,atype){if(atype){var ava_s1=$('#ava_'+user_id).attr('src');var ava=ava_s1.replace('/users/'+user_id+'/','/users/'+user_id+'/100_');}else
var ava=$('#ava_'+user_id).attr('src');Box.Show('del_friend_'+user_id,410,lang_title_del_photo,'<div style="padding:15px;text-align:center"><img src="'+ava+'" alt="" /><br /><br />Вы уверены, что хотите удалить этого пользователя из списка друзей?</div>',lang_box_canсel,lang_box_yes,'friends.goDelte('+user_id+', '+atype+'); return false');},goDelte:function(user_id,atype){$('#box_loading').show();$.post('/index.php?go=friends&act=delete',{delet_user_id:user_id},function(data){if(atype>0){Page.Go(location.href);}else{$('#friend_'+user_id).remove();updateNum('#friend_num');}
Box.Close('del_friend_'+user_id);});}}
var fave={add:function(fave_id){$('#addfave_load').show();$.post('/index.php?go=fave&act=add',{fave_id:fave_id},function(data){if(data=='no_user')
Box.Info('add_fave_err_'+fave_id,lang_dd2f_no,lang_no_user_fave,300);else if(data=='yes_user')
Box.Info('add_fave_err_'+fave_id,lang_dd2f_no,lang_yes_user_fave,300);$('#addfave_but').attr('onClick','fave.delet('+fave_id+'); return false').attr('href','/');$('#text_add_fave').text(lang_del_fave);$('#addfave_load').hide();});},delet:function(fave_id){$('#addfave_load').show();$.post('/index.php?go=fave&act=delet',{fave_id:fave_id},function(data){$('#addfave_but').attr('onClick','fave.add('+fave_id+'); return false').attr('href','/');$('#text_add_fave').text(lang_add_fave);$('#addfave_load').hide();});},del_box:function(fave_id){Box.Show('del_fave',410,lang_title_del_photo,'<div style="padding:15px;">'+lang_fave_info+'</div>',lang_box_canсel,lang_box_yes,'fave.gDelet('+fave_id+'); return false');},gDelet:function(fave_id){$('#box_loading').show();$.post('/index.php?go=fave&act=delet',{fave_id:fave_id},function(data){$('#user_'+fave_id).remove();Box.Close('del_fave');fave_num=$('#fave_num').text();$('#fave_num').text(fave_num-1);if($('#fave_num').text()<1){$('#speedbar').text(lang_dd2f_no);$('#page').html(lang_fave_no_users);}});}}
var messages={new_:function(user_id){var content='<div style="padding:20px">'+'<div class="texta" style="width:100px">Тема:</div><input type="text" id="theme" class="inpst" maxlength="255" style="width:300px" /><div class="mgclr"></div>'+'<div class="texta" style="width:100px">Сообщение:</div><textarea id="msg" class="inpst" style="width:300px;height:120px;"></textarea><div class="mgclr"></div>'+'</div>';Box.Show('new_msg',460,lang_new_msg,content,lang_box_canсel,lang_new_msg_send,'messages.send('+user_id+'); return false');$('#msg').focus();},openmes:function(){$('#meseg').show();$('.prof').hide();},otm:function(){$('#meseg').hide();$('.prof').show();},send:function(for_user_id){var theme=$('#theme').val();var msg=$('#msg').val();if(msg!=0){$('#box_loading').show();$.post('/index.php?go=messages&act=send',{for_user_id:for_user_id,theme:theme,msg:msg},function(data){Box.Close('new_msg');if(data=='max_strlen')
Box.Info('msg_info',lang_dd2f_no,lang_msg_max_strlen,300);else if(data=='no_user')
Box.Info('msg_info',lang_dd2f_no,lang_no_user_fave,300);else if(data=='err_privacy')
Box.Info('msg_info',lang_pr_no_title,lang_pr_no_msg,400,4000);else
Box.Info('msg_info',lang_msg_ok_title,lang_msg_ok_text,300);});$('#meseg').hide();$('.prof').show();$('.m').show();$('.ok').html('Сообщение было успешно отправленно.');}else{$('#msg').val('');$('#msg').focus();}},search:function(folder){var msg_query=$('#msg_query').val();if(folder)
var se_folder='&act=outbox';else
var se_folder='';if(msg_query!=0&&msg_query!='Поиск по полученным сообщениям'&&msg_query!='Поиск по отправленным сообщениям'){var se_query='&se_query='+encodeURIComponent(msg_query);Page.Go('/index.php?go=messages'+se_folder+se_query);}else{$('#msg_query').val('');$('#msg_query').focus();$('#msg_query').css('color','#000');}},delet:function(mid,folder){$('#del_text_'+mid).remove();$('#del_load_'+mid).show();$.post('/index.php?go=messages&act=delet',{mid:mid,folder:folder},function(){$('#bmsg_'+mid).remove();$('#del_load_'+mid).remove();updateNum('#all_msg_num');myhtml.title_close(mid);});},reply:function(for_user_id,type){var theme=$('#theme_value').val();var msg=$('#msg_value').val();var attach_files=$('#vaLattach_files').val();if(msg!=0||attach_files!=0){if(type=='reply')
butloading('msg_sending',50,'disabled');else
butloading('msg_sending',56,'disabled');$.post('/index.php?go=messages&act=send',{for_user_id:for_user_id,theme:theme,msg:msg,attach_files:attach_files},function(data){if(data=='max_strlen')
Box.Info('msg_info',lang_dd2f_no,lang_msg_max_strlen,300);else if(data=='no_user')
Box.Info('msg_info',lang_dd2f_no,lang_no_user_fave,300);else if(data=='err_privacy')
Box.Info('msg_info',lang_pr_no_title,lang_pr_no_msg,400,4000);else
Page.Go('/messages/i');if(type=='reply')
butloading('msg_sending',50,'enabled','Ответить');else
butloading('msg_sending',56,'enabled','Отправить');});}else{$('#msg_value').val('');$('#msg_value').focus();}},history:function(for_user_id,page){textLoad('history_lnk');if(page)
Page.Loading('start');$.post('/index.php?go=messages&act=history',{for_user_id:for_user_id,page:page},function(data){$('#history_lnk').hide();$('.msg_view_history_title').show();$('#msg_historyies').html(data);if(page)
Page.Loading('stop');});}}
var notes={send:function(){var title=$('#title_n').val();var text=$('#text').val();if(title!=0){if(text!=0){butloading('notes_sending',74,'disabled');$.post('/index.php?go=notes&act=save',{title:title,text:text},function(d){if(d=='min_strlen')
Box.Info('msg_notes',lang_dd2f_no,lang_notes_no_text,300);else
Page.Go('/notes/view/'+d);butloading('notes_sending',74,'enabled','Опубликовать');});}else{$("#text").val('');$("#text").css('background','#ffefef').focus();setTimeout("$('#text').css('background', '#fff').focus()",800);}}else{$("#title").val('');$("#title").css('background','#ffefef').focus();setTimeout("$('#title').css('background', '#fff').focus()",800);}},sends:function(){var title=$('#title_n').val();var text=$('#text').val();if(title!=0){if(text!=0){butloading('notes_sending',74,'disabled');$.post('/index.php?go=notes&act=save',{title:title,text:text},function(d){if(d=='min_strlen'){Box.Info('msg_notes',lang_dd2f_no,lang_notes_no_text,300);}else{wall.attach_insert('note',title,d,'notes|'+d+'||');Profile.miniatureClose();}
butloading('notes_sending',74,'enabled','Опубликовать');});}else{$("#text").val('');$("#text").css('background','#ffefef').focus();setTimeout("$('#text').css('background', '#fff').focus()",800);}}else{$("#title").val('');$("#title").css('background','#ffefef').focus();setTimeout("$('#title').css('background', '#fff').focus()",800);}},shows:function(id,h){history.pushState({link:h},null,h);$('html').css({'overflow':'hidden','margin':'0 17px 0 0'});$.post('/index.php?go=notes&act=view',{note_id:id,notes:'1'},function(d){$('body').append('<div id="newbox_miniature"><div class="miniature_box"><div class="miniature_pos" style="width: 607px;margin-top:30px;">'+d+'</div></div></div>');});},edit:function(id){$('html').css({'overflow':'hidden','margin':'0 17px 0 0'});$.post('/index.php?go=notes&act=edit',{note_id:id,notes:'1'},function(d){$('body').append('<div id="newbox_miniature"><div class="miniature_box"><div class="miniature_pos" style="width: 607px;margin-top:30px;">'+d+'</div></div></div>');});},editsave:function(note_id){var title=$('#title_n').val();var text=$('#text').val();if(title!=0){if(text!=0){butloading('notes_sending',111,'disabled');$.post('/index.php?go=notes&act=editsave',{note_id:note_id,title:title,text:text},function(d){if(d=='min_strlen')
Box.Info('msg_notes',lang_dd2f_no,lang_notes_no_text,300);else
Page.Go('/notes/view/'+note_id);butloading('notes_sending',111,'enabled','Сохранить изменения');});}else{$("#text").val('');$("#text").css('background','#ffefef').focus();setTimeout("$('#text').css('background', '#fff').focus()",800);}}else{$("#title").val('');$("#title").css('background','#ffefef').focus();setTimeout("$('#title').css('background', '#fff').focus()",800);}},delet:function(note_id,lnk,uid){Box.Show('del_note_'+note_id,400,lang_title_del_photo,'<div style="padding:15px;" id="text_del_note_'+note_id+'">'+lang_del_note+'</div>',lang_box_canсel,lang_box_yes,'notes.startDel('+note_id+', '+lnk+', '+uid+'); return false');},startDel:function(note_id,lnk,uid){$('#box_loading').show();$('#text_del_note_'+note_id).text(lang_del_process);$.post('/index.php?go=notes&act=delet',{note_id:note_id},function(){if(lnk)
Page.Go('/notes');else{$('#note_'+note_id).remove();updateNum('#notes_num');}
Box.Close('del_note_'+note_id);});},addcomment:function(note_id){var textcom=$('#textcom').val();if(textcom!=0){butloading('add_comm_notes',119,'disabled');$.post('/index.php?go=notes&act=addcomment',{note_id:note_id,textcom:textcom},function(data){$('#resultadd').append(data);$('#textcom').val('');butloading('add_comm_notes',119,'enabled','Добавить комментарий');});}else{$('#textcom').focus();$('#textcom').val('');}},deletcomment:function(comm_id){textLoad('note_del_but_'+comm_id);$.post('/index.php?go=notes&act=delcomment',{comm_id:comm_id},function(d){$('#note_comment_'+comm_id).html(lang_del_comm);});},allcomments:function(note_id,comm_num){textLoad('all_lnk_comm');$('#all_href_lnk_comm').attr('onClick','').attr('href','#');$.post('/index.php?go=notes&act=allcomment',{note_id:note_id,comm_num:comm_num},function(data){$('#all_comments').html(data);$('#all_href_lnk_comm').hide();});},preview:function(){var title=$('#title_n').val();var text=$('#text').val();if(title!=0){if(text!=0){Box.Page('/index.php?go=notes&act=preview','text='+text+'&title='+title,'preview',820,lang_notes_preview,lang_msg_close,0,0,500,1,1,1,0,0);}else{$("#text").html('');$("#text").css('background','#ffefef').focus();setTimeout("$('#text').css('background', '#fff').focus()",800);}}else{$("#title").val('');$("#title").css('background','#ffefef').focus();setTimeout("$('#title').css('background', '#fff').focus()",800);}}}
var subscriptions={add:function(for_user_id){$('#addsubscription_load').show();$.post('/index.php?go=subscriptions&act=add',{for_user_id:for_user_id},function(d){$('#addsubscription_load').hide();$('#text_add_subscription').text(lang_unsubscribe);$('#lnk_unsubscription').attr('onClick','subscriptions.del('+for_user_id+'); return false');});},del:function(del_user_id){$('#addsubscription_load').show();$.post('/index.php?go=subscriptions&act=del',{del_user_id:del_user_id},function(){$('#addsubscription_load').hide();$('#text_add_subscription').text(lang_subscription);$('#lnk_unsubscription').attr('onClick','subscriptions.add('+del_user_id+'); return false');});},all:function(for_user_id,page_num,subscr_num){if(page_num)
page='&page='+page_num;else{page='';page_num=1;}
Box.Page('/index.php?go=subscriptions&act=all','for_user_id='+for_user_id+'&subscr_num='+subscr_num+page,'subscriptions_'+page_num,525,lang_subscription_box_title,lang_msg_close,0,0,345,1,1,1,0,1);}}
var at='';var Forum={New:function(i){if($('#title_n').val()!=0){if($('#text').val()!=0||$('#vaLattach_files').val()!=0){butloading('forum_sending',70,'disabled');$.post('/index.php?go=public_topic&act=new_send',{public_id:i,title:$('#title_n').val(),text:$('#text').val(),attach_files:$('#vaLattach_files').val()},function(d){Page.Go('/public/topic'+i+'_'+d);});}else
setErrorInputMsg('text');}else
setErrorInputMsg('title_n');},Page:function(p){if($('#load_forum_page_lnk').text()=='Показать больше тем'){textLoad('load_forum_page_lnk');$.post('/index.php?go=groups_forum&public_id='+p,{a:'1',page:page},function(d){page++;$('#ForumPage').append(d);$('#load_forum_page_lnk').text('Показать больше тем');if(!d){$('#'+$('.forum_bg2:last').attr('id')).css('margin-bottom','-15px');$('#forum_page_lnk').hide();$('#load_forum_page_lnk').text('');}});}},SendMsg:function(i){if($('#fast_text_1').val()!=0){butloading('msg_send',56,'disabled');$.post('/index.php?go=groups_forum&act=add_msg',{fid:i,msg:$('#fast_text_1').val(),answer_id:$('#answer_comm_id1').val()},function(d){updateNum('#msgNumJS',1);langNumric('langMsg',$('#msgNumJS').text(),'сообщение','сообщения','сообщений','сообщение','сообщение');$('#msg').append(d);$('#fast_text_1').val('').focus();butloading('msg_send',56,'enabled','Отправить');$('#answer_comm_for_1').html('');$('#answer_comm_id1').val('');});}else
setErrorInputMsg('fast_text_1');},MsgPage:function(f){if($('#load_forum_msg_lnk').text()=='Показать предыдущие сообщения'){textLoad('load_forum_msg_lnk');$.post('/index.php?go=groups_forum&act=prev_msg',{fid:f,first_id:$('.forum_msg_border2:first').attr('id'),page:page},function(d){page++;$('#msgPrev').html(d+$('#msgPrev').html());$('#load_forum_msg_lnk').text('Показать предыдущие сообщения');if(!d){$('#load_forum_msg_lnk').text('Скрыть сообщения').css('background','#fff');$('#forum_msg_lnk').attr('onClick','Forum.HidePage('+f+')');}});}},HidePage:function(f){$('#forum_msg_lnk').attr('onClick','Forum.MsgPage('+f+')');$('#load_forum_msg_lnk').text('Показать предыдущие сообщения').css('background','rgb(233, 237, 241)');$('#msgPrev').html('');page=1;},EditText:function(){at=$('#attach').html();$('#teckText, #editLnk').hide();$('#editTextTab').show();$('#editText').focus();},CloseEdit:function(){$('#teckText, #editLnk, #editClose').show();$('#editTextTab').hide();},SaveEdit:function(i){$('#editClose').hide();butloading('saveedit',55,'disabled');$.post('/index.php?go=groups_forum&act=saveedit',{text:$('#editText').val(),fid:i},function(d){if(!at)at='';$('#teckText').html(d+'<span id="attach">'+at+'</span>');Forum.CloseEdit();butloading('saveedit',55,'enabled','Сохранить');});},EditTitle:function(){settings.privacyClose('msg');$('#titleTeck').hide();$('#editTitle').show();$('#title').focus();},CloseEditTitle:function(){$('#titleTeck').show();$('#editTitle').hide();},SaveEditTitle:function(f){if($('#title').val()!=0){Forum.CloseEditTitle();$('#editTitleSaved').text($('#title').val());$.post('/index.php?go=groups_forum&act=savetitle',{fid:f,title:$('#title').val()});}else
setErrorInputMsg('title');},Fix:function(f){settings.privacyClose('msg');if($('#fix_text').text()=='Закрепить тему'){$('#fix_text').text('Не закреплять тему');$('.forum_infos_div').html('<b>Тема закреплена.</b><br />Теперь эта тема всегда будет выводиться над остальными в списке обсуждений.').fadeIn('fast');}else{$('#fix_text').text('Закрепить тему');$('.forum_infos_div').html('<b>Тема больше не закреплена.</b><br />Эта тема будет выводиться на своем месте в списке обсуждений.').fadeIn('fast');}
$.post('/index.php?go=groups_forum&act=fix',{fid:f});},Status:function(f){settings.privacyClose('msg');if($('#status_text').text()=='Закрыть тему'){$('#status_text').text('Открыть тему');$('.forum_infos_div').html('<b>Тема закрыта.</b><br />Участники сообщества больше не смогут оставлять сообщения в этой теме.').fadeIn('fast');$('.forum_addmsgbg').hide();}else{$('#status_text').text('Закрыть тему');$('.forum_infos_div').html('<b>Тема открыта.</b><br />Все участники сообщества смогут оставлять сообщения в этой теме.').fadeIn('fast');$('.forum_addmsgbg').show();}
$.post('/index.php?go=groups_forum&act=status',{fid:f});},DelBox:function(f,p){settings.privacyClose('msg');Box.Show('del_forthe',350,lang_title_del_photo,'<div style="padding:15px;" id="del_status_text_forum">Вы уверены, что хотите удалить эту тему?</div>',lang_box_canсel,lang_box_yes,'Forum.StartDelete('+f+', '+p+')');},StartDelete:function(f,p){$('#box_loading').show();ge('box_butt_create').disabled=true;$('#del_status_text_forum').text('Тема удаляется..');$.post('/index.php?go=groups_forum&act=del',{fid:f},function(d){Page.Go('/forum'+p);});},DelMsg:function(i){$('#'+i).html('<span class="color777">Сообщение удалено.</span>');updateNum('#msgNumJS');langNumric('langMsg',$('#msgNumJS').text(),'сообщение','сообщения','сообщений','сообщение','сообщение');$.post('/index.php?go=groups_forum&act=delmsg',{mid:i});},CreateVote:function(f){if($('#vote_title').val()!=0){if($('#vote_answer_1').val()!=0){butloading('savevote',75,'disabled','');$.post('/index.php?go=groups_forum&act=createvote',{fid:f,vote_title:$('#vote_title').val(),vote_answer_1:$('#vote_answer_1').val(),vote_answer_2:$('#vote_answer_2').val(),vote_answer_3:$('#vote_answer_3').val(),vote_answer_4:$('#vote_answer_4').val(),vote_answer_5:$('#vote_answer_5').val(),vote_answer_6:$('#vote_answer_6').val(),vote_answer_7:$('#vote_answer_7').val(),vote_answer_8:$('#vote_answer_8').val(),vote_answer_9:$('#vote_answer_9').val(),vote_answer_10:$('#vote_answer_10').val()},function(d){Page.Go(location.href);});}else
setErrorInputMsg('vote_answer_1');}else
setErrorInputMsg('vote_title');},RemoveForAttach:function(){$('#attach_block_vote').hide();$('#vote_title, #vote_answer_1, #vote_answer_2').val('');$('#addNewAnswer').html('<a class="cursor_pointer" onClick="Votes.AddInp()">добавить</a>');$('#addDelAnswer').html('удалить');$('#attatch_vote_title').text('');$('#answerNum').val('2');for(i=2;i<=10;i++)
$('#div_inp_answr_'+i).remove();},VoteDelBox:function(f){Box.Show('del_forthe',350,lang_title_del_photo,'<div style="padding:15px;" id="del_status_text_forum">Вы уверены, что хотите удалить опрос?</div>',lang_box_canсel,lang_box_yes,'Forum.StartVoteDelete('+f+')');},StartVoteDelete:function(f){Box.Close();$('#voteblockk').hide();$('#votelnk').html('<div class="sett_hover" onClick="settings.privacyClose('msg'); $('#attach_block_vote').slideDown(100); $('#vote_title').focus()">Прикрепить опрос</div>');$.post('/index.php?go=groups_forum&act=delvote',{fid:f});}}
var videos={add:function(notes){Box.Page('/index.php?go=videos&act=add','','add_video',510,lang_video_new,lang_box_canсel,lang_album_create,'videos.send('+notes+'); return false',0,0,1,1,'video_lnk');},min:function(id){$('#video_shows_'+id).addClass('shows');$('html,body').css({'overflow-y':'auto','margin':'0'});$('body').append("<script id="srip" type="text/javascript">$( init );function init() {$('.video_view').draggable();}</script>");},max:function(id){$('html,body').css({'overflow-y':'hidden','margin':'0 17px 0 0'});$('.video_view').removeClass('ui-draggable').css({'top':'0','left':'0'});$('#video_shows_'+id).removeClass('shows');$('#srip').attr('type','');},theme:function(theme){$.post('/index.php?go=videos&act=video_theme',{theme:theme},function(d){if(d==1)
Box.Info('msg_videos',lang_dd2f_no,'Плеер был успешно изменен',300);else
Box.Info('msg_videos',lang_dd2f_no,'У Вас уже установлен этот плеер',300);});},load:function(){video_lnk=$('#video_lnk').val();good_video_lnk=$('#good_video_lnk').val();if(videos.serviece(video_lnk)){if(video_lnk!=0){if(video_lnk!=good_video_lnk){$('#box_loading').show();$.post('/index.php?go=videos&act=load',{video_lnk:video_lnk},function(data){if(data=='no_serviece'){$('#no_serviece').show();}else{row=data.split(':|:');$('#result_load').show();$('#photo').html('<img src="'+row[0]+'" alt="" id="res_photo_ok" />');$('#title').val(row[1]);$('#descr').val(row[2]);$('#good_video_lnk').val(video_lnk);$('#no_serviece').hide();}
$('#box_but').show();$('#box_loading').hide();});}else
$('#no_serviece').hide();}else
$('#result_load').hide();}else
$('#no_serviece').show();},serviece:function(request){var pattern=new RegExp(/http://www.youtube.com|http://youtube.com|http://rutube.ru|http://www.rutube.ru|http://www.vimeo.com|http://vimeo.com|http://smotri.com|http://www.smotri.com/i);return pattern.test(request);},send:function(notes){title=$('#title').val();good_video_lnk=$('#good_video_lnk').val();descr=$('#descr').val();photo=$('#res_photo_ok').attr('src');if(good_video_lnk!=0){if(title!=0){$('#box_loading').show();$('#box_but').hide();$.post('/index.php?go=videos&act=send',{title:title,good_video_lnk:good_video_lnk,descr:descr,photo:photo,privacy:$('#privacy').val(),notes:notes},function(d){$('#box_loading').hide();Box.Close('add_video');d=d.split('|');if(notes==1)
wysiwyg.boxVideo('http://'+location.host+d[0],d[1],d[2]);else
Page.Go('/videos');});}else
Box.Info('msg_videos',lang_dd2f_no,lang_videos_no_url,300);}else
Box.Info('msg_videos',lang_dd2f_no,lang_videos_no_url,300);},page:function(){name=$('.scroll_page').attr('id');get_user_id=$('#user_id').val();last_id=$('#'+name+' input:last').attr('value');set_last_id=$('#set_last_id').val();videos_size=$('#videos_num').val();videos_opened_num=$('.onevideo').size();if(set_last_id!=last_id&&videos_size>20&&videos_size!=videos_opened_num){$('#'+name).append(lang_scroll_loading);$.post('/index.php?go=videos&act=page',{get_user_id:get_user_id,last_id:last_id},function(d){$('#'+name).append(d);$('#scroll_loading').remove();});$('#set_last_id').val(last_id);}},scroll:function(){$(window).scroll(function(){if($(document).height()-$(window).height()<=$(window).scrollTop()+250){videos.page();}});},delet:function(vid,type){Box.Show('del_video_'+vid,400,lang_title_del_photo,'<div style="padding:15px;" id="text_del_video_'+vid+'">'+lang_videos_del_text+'</div>',lang_box_canсel,lang_box_yes,'videos.startDel('+vid+', ''+type+''); return false');$('#video_object').hide();},startDel:function(vid,type){$('#box_but').hide();$('#box_loading').show();$('#text_del_video_'+vid).text(lang_videos_deletes);$.post('/index.php?go=videos&act=delet',{vid:vid},function(){$('#video_'+vid).html(lang_videos_delok);Box.Close('del_video_'+vid);updateNum('#nums');if(type==1)
$('#video_del_info').html(lang_videos_delok_2);});},editbox:function(vid){Box.Page('/index.php?go=videos&act=edit','vid='+vid,'edit_video',510,lang_video_edit,lang_box_canсel,lang_box_save,'videos.editsave('+vid+'); return false',255,0,1,1,0);$('#video_object').hide();},editsave:function(vid){var title=$('#title').val();var descr=$('#descr').val();$('#box_but').hide();$('#box_loading').fadeIn();$.post('/index.php?go=videos&act=editsave',{vid:vid,title:title,descr:descr,privacy:$('#privacy').val()},function(d){$('#video_title_'+vid+', #video_full_title_'+vid).text(title);$('#video_descr_'+vid+', #video_full_descr_'+vid).html(d);Box.Close('edit_video');$('#video_object').show();});},loading:function(f){if(f=='start'){$('html').css('overflow','hidden');var loadcontent='<div class="photo_view" id="video_load">'+'<div class="photo_close" onClick="videos.loadingClose(); return false" style="right:15px;"></div>'+'<div class="video_show_bg">'+'<div class="video_show_object" style="padding-top:230px;height:230px"><center><img src="/templates/Default/images/progress_gray.gif" alt="" /></center></div><div class="video_show_panel" style="height:20px"></div>'+'</div>'+'</div>';$('body').append(loadcontent);$('#video_load').show();}
if(f=='stop')
$('#video_load').remove();},loadingClose:function(){$('#video_load').remove();},show:function(vid,h,close_link,n,r){if(vid){videos.loading('start');$.post('/index.php?go=videos&act=view',{vid:vid,close_link:close_link,publick:n,search:r},function(data){videos.loading('stop');if(data=='no_video'){Box.Info('no_video',lang_dd2f_no,lang_video_info_text,300);$('html, body').css('overflow-y','auto');}else if(data=='err_privacy'){addAllErr(lang_pr_no_title);$('html, body').css('overflow-y','auto');}else{$('html').css('overflow','hidden');history.pushState({link:h},null,h);$('body').append(data);$('#video_show_'+vid).show();}});}},prev:function(req_href){filter_one=req_href.split('_');filter_two=filter_one[0].split('video');video_url='/video'+filter_two[1]+'_'+filter_one[1];videos.show(filter_one[1],video_url);},close:function(owner_id,close_link,id){$('#video_shows_'+id).remove();$('html, body').css({'overflow-y':'auto','margin':'0'});if(is_moz&&!is_chrome)$(window).scrollTop(scrollTopForFirefox);if(close_link)
history.pushState({link:close_link},null,close_link);else
history.pushState({link:'/videos/'+owner_id},null,'/videos/'+owner_id);},addcomment:function(vid){comment=$('#comment').val();if(comment!=0){butloading('add_comm','56','disabled','');$.post('/index.php?go=videos&act=addcomment',{vid:vid,comment:comment},function(d){$('#comments').append(d);$('#comment').val('');butloading('add_comm','56','enabled',lang_box_send);});}else{$('#comment').val('');$('#comment').focus();}},allcomment:function(vid,num,owner_id){textLoad('all_lnk_comm');$('#all_href_lnk_comm').attr('onClick','').attr('href','#');$.post('/index.php?go=videos&act=all_comm',{vid:vid,num:num,owner_id:owner_id},function(d){$('#all_href_lnk_comm').hide();$('#all_comments').html(d);});},deletcomm:function(comm_id){textLoad('video_del_but_'+comm_id);$.post('/index.php?go=videos&act=delcomment',{comm_id:comm_id},function(){$('#video_comment_'+comm_id).html(lang_del_comm);});},setEvent:function(event,owner_id,close_link){var oi=(event.target)?event.target.id:((event.srcElement)?event.srcElement.id:null);var el=oi.substring(0,10);if(el=='video_show')
videos.close(owner_id,close_link);},addmylist:function(vid){$('#addok').html('Добавлено');$.post('/index.php?go=videos&act=addmylist',{vid:vid});}}
var selenter=false;$('#search_types, #search_tab, #se_link').live('mouseenter',function(){selenter=true;});$('#search_types, #search_tab, #se_link').live('mouseleave',function(){selenter=false;});$(document).click(function(){if(!selenter){$('#sel_types, #search_tab, .fast_search_bg').hide();$('#query').val('');}});function CheckRequestSearch(request){var pattern=new RegExp(/search/i);return pattern.test(request);}
var gSearch={open_tab:function(){$('#search_tab').fadeIn('fast');$('#query').focus();if($('#fast_search_txt').text())
$('.fast_search_bg').fadeIn('fast');},open_types:function(id){$(id).show();},select_type:function(type,text){$('#se_type').val(type);$('#search_selected_text').text(text);$('.search_type_selected').removeClass();$('#'+type).addClass('search_type_selected');$('#sel_types').hide();$('#query').focus();},go:function(){var query=$('#query').val();var type=$('#se_type').val();if(query=='Поиск'||!query)
var query=$('#fast_search_txt').text();if(CheckRequestSearch(location.href)){query=$('#query_full').val();sex=$('#sex').val();day=$('#day').val();month=$('#month').val();year=$('#year').val();ver=$('#ver').val();country=$('#country').val();city=$('#select_city').val();type=$('#se_type_full').val();online=$('#online').val();user_photo=$('#user_photo').val();}
if(query=='Поиск'||query=='Начните вводить любое слово или имя'){query='';}
if(CheckRequestSearch(location.href)&&type==1){if(sex!=0)all_queryeis_sex='&sex='+sex;else all_queryeis_sex='';if(day!=0)all_queryeis_day='&day='+day;else all_queryeis_day='';if(month!=0)all_queryeis_month='&month='+month;else all_queryeis_month='';if(ver!=0)all_queryeis_ver='&ver='+ver;else all_queryeis_ver='';if(year!=0)all_queryeis_year='&year='+year;else all_queryeis_year='';if(country!=0)all_queryeis_country='&country='+country;else all_queryeis_country='';if(city!=0)all_queryeis_city='&city='+city;else all_queryeis_city='';if(online!=0)all_queryeis_online='&online='+online;else all_queryeis_online='';if(user_photo!=0)all_queryeis_user_photo='&user_photo='+user_photo;else all_queryeis_user_photo='';res_sort_query=all_queryeis_sex+all_queryeis_day+all_queryeis_month+all_queryeis_year+all_queryeis_ver+all_queryeis_country+all_queryeis_city+all_queryeis_online+all_queryeis_user_photo;}else
res_sort_query='';lnk='/?go=search&query='+encodeURIComponent(query)+'&type='+type+res_sort_query;Page.Loading('start');$.post(lnk,{ajax:'yes'},function(data){Page.Loading('stop');history.pushState({link:lnk},null,lnk);$('#page').html(data);$('html, body').scrollTop(0);$('.photo_view, .box_pos, .box_info').remove();$('html, body').css('overflow-y','auto');$('#sel_types, #search_tab, .fast_search_bg').hide();$('#query').val('');});}}
var payment={addBox:function(t){$.post('/index.php?go=payment&act=payment',{t:t},function(d){$('body').append('<div id="newbox_miniature">'+d+'</div>').css('margin','0 17px 0 0');});},update:function(){var add=$('#payment_num').val();var new_rate=$('#balance').val()-add;var pr=parseInt(add);if(!isNaN(pr))$('#payment_num').val(parseInt(add));else $('#payment_num').val('');if(add&&new_rate>=0){$('#num').text(new_rate);$('#rt').show();}else if(new_rate<=0||$('#balance').val()<=0){$('#num').text('Недостаточно');$('#rt').hide();}else{$('#rt').show();$('#num').text($('#balance').val());}},user:function(){var uid=$('#upage').val();$.post('/index.php?go=payment&act=payment',{uid:uid},function(d){$('#feedimg').attr('src',d);});},send:function(){var uid=$('#upage').val();var num=$('#payment_num').val();$.post('/index.php?go=payment&act=balance',{id:uid,num:num},function(){$('#newbox_miniature').remove();Box.Info('msg_info','Баланс','Баланс успешно отправлен.',300);});},show:function(t){$.post('/index.php?go=payment&act=type',{t:t},function(d){$('#payments_method').hide();$('#history').hide();$('.miniature_pos').append(d);});},returns:function(id){$('#'+id).remove();$('#payments_method').show();$('#history').show();}}
var jobs={send:function(){var text=$('#description').val();var id=$('#id').val();if(text.length>200){$.post('/index.php?go=jobs&act=send',{id:id,text:text},function(){$('#mess').show();});}else{Box.Info('msg_info','Ошибка','Необходимо в писать о себе не менее 200 символов.',300);}}}
var myhtml={checkbox:function(id){name='#'+id;$(name).addClass('html_checked');if(ge('checknox_'+id)){myhtml.checkbox_off(id);}else{$(name).append('<div id="checknox_'+id+'"><input type="hidden" id="'+id+'" /></div>');$(name).val('1');}},checkbox_off:function(id){name='#'+id;$('#checknox_'+id).remove();$(name).removeClass('html_checked');$(name).val('');},checked:function(arr){$.each(arr,function(){myhtml.checkbox(this);});},title:function(id,text,prefix_id,pad_left){if(!pad_left)
pad_left=5;$("body").append('<div id="js_title_'+id+'" class="js_titleRemove" style="position:absolute;z-index:1000;"><div id="easyTooltip">'+text+'</div><div class="tooltip"></div></div>');xOffset=$('#'+prefix_id+id).offset().left-pad_left;yOffset=$('#'+prefix_id+id).offset().top-32;$('#js_title_'+id).css("position","absolute").css("top",yOffset+"px").css("left",xOffset+"px").css("display","none").fadeIn('fast');$('#'+prefix_id+id).mouseout(function(){$('.js_titleRemove').remove();});},title_close:function(id){$('#js_title_'+id).remove();},updateAjaxNav:function(gc,pref,num,page){$.get('/updateAjaxNav',{gcount:gc,pref:pref,num:num,page:page},function(data){$('#nav').html(data);});},scrollTop:function(){$('.scroll_fix_bg').hide();$(window).scrollTop(0);}}
var wall={recomendation:function(){var id=$('#public_id').val();$.post('/index.php?go=groups&act=reccomend',{id:id},function(d){d=d.split('|||||');$('#walls_tabs').show();$('#walls').text('Вернуться к записям').attr('onClick','wall.openwall();');$('#wall_send').text('Предложить новость').attr('onClick','wall.send_g();');$('#public_wall_records').hide();$('#wall_recomendation').show().html(d[0]);$('#rec_num').text(d[1]);});},openwall:function(i){var id=$('#public_id').val();if(i)
$('#walls').text('Присланные новости').attr('onClick','wall.adminrec();');else
$('#walls').text('Предложить новость').attr('onClick','wall.recomendation();');$('#public_wall_records').show();$('#wall_tab').show();$('#walls_tabs').hide();$('#wall_recomendation').hide();$('#rec_num').text($('#rece_num').val());$('#wall_send').text('Отправить').attr('onClick','wall.send('+id+');');},adminrec:function(){var id=$('#public_id').val();$.post('/index.php?go=groups&act=myreccomend',{id:id},function(d){d=d.split('|||||');$('#walls_tabs').hide();$('#walls').text('Вернуться к записям').attr('onClick','wall.openwall(1);');$('#public_wall_records').hide();$('#wall_recomendation').show().html(d[0]);$('#rec_num').text(d[1]);});},sendwall:function(id){wall_text=$('#vaLattach_text'+id).val();attach_files=$('#vaLattach_filess'+id).val();for_user_id=$('#public_id').val();user_id=$('#vaLattach_u'+id).val();$.post('/index.php?go=groups&act=wall_sends',{wall_text:wall_text,id:for_user_id,attach_files:attach_files,user:user_id,aid:id},function(data){});},dellwall:function(id){var ids=$('#public_id').val();$.post('/index.php?go=groups&act=wall_dels',{id:ids,aid:id},function(d){$('#wall_record_'+id).html('<span class="color777">Запись удалена.</span>');});},form_open:function(){$('#wall_input').hide();$('#wall_textarea').show();$('#wall_text').val('');$('#wall_text').focus();},form_close:function(){wall_text=$('#wall_text').val();if(wall_text!=0){$('#wall_input').val($('#wall_text').val());}else{$('#wall_input').show();$('#wall_textarea').hide();$('#wall_input').val($('#wall_input_text').val());}},event:function(event){oi=(event.target)?event.target.id:((event.srcElement)?event.srcElement.id:null);fast_oi=oi.substring(0,9);attach_files=$('#vaLattach_files').val();if(oi!='wall_tab'&&oi!='wall_input'&&oi!='wall_textarea'&&oi!='wall_text'&&oi!='wall_send'&&oi!='wall_attach'&&oi!='wall_attach_link'&&!attach_files)
wall.form_close();if(fast_oi!='fast_form'&&fast_oi!='fast_link'&&fast_oi!='fast_inpt'&&fast_oi!='fast_text'&&fast_oi!='fast_buts')
wall.fast_form_close();if(oi!='set_status_bg'&&oi!='status_text'&&oi!='status_but'&&oi!='status_link'&&oi!='new_status')
gStatus.close();},send_g:function(){wall_text=$('#wall_text').val();attach_files=$('#vaLattach_files').val();for_user_id=$('#public_id').val();if(wall_text!=0||attach_files!=0){butloading('wall_send',56,'disabled');$.post('/index.php?go=wall&act=send_group',{wall_text:wall_text,for_user_id:for_user_id,attach_files:attach_files,vote_title:$('#vote_title').val(),vote_answer_1:$('#vote_answer_1').val(),vote_answer_2:$('#vote_answer_2').val(),vote_answer_3:$('#vote_answer_3').val(),vote_answer_4:$('#vote_answer_4').val(),vote_answer_5:$('#vote_answer_5').val(),vote_answer_6:$('#vote_answer_6').val(),vote_answer_7:$('#vote_answer_7').val(),vote_answer_8:$('#vote_answer_8').val(),vote_answer_9:$('#vote_answer_9').val(),vote_answer_10:$('#vote_answer_10').val()},function(data){if(data=='err_privacy'){addAllErr(lang_pr_no_title);}else{data=data.split('|');$('#wall_recomendation').html(data[0]);$('#wall_all_record').html('');$('#rec_num').text(data[1])
$('#wall_text').val('');$('#attach_files').hide();$('#attach_files').html('');$('#vaLattach_files').val('');wall.form_close();wall.RemoveAttachLnk();Votes.RemoveForAttach();}
butloading('wall_send',56,'enabled',lang_box_send);});}else{$('#wall_text').val('');$('#wall_text').focus();}},send:function(){wall_text=$('#wall_text').val();attach_files=$('#vaLattach_files').val();for_user_id=location.href.split('http://'+location.host+'/u');rec_num=parseInt($('#wall_rec_num').text())+1;if(!rec_num)
rec_num=1;if(wall_text!=0||attach_files!=0){butloading('wall_send',56,'disabled');$.post('/index.php?go=wall&act=send',{wall_text:wall_text,for_user_id:for_user_id[1],attach_files:attach_files,vote_title:$('#vote_title').val(),vote_answer_1:$('#vote_answer_1').val(),vote_answer_2:$('#vote_answer_2').val(),vote_answer_3:$('#vote_answer_3').val(),vote_answer_4:$('#vote_answer_4').val(),vote_answer_5:$('#vote_answer_5').val(),vote_answer_6:$('#vote_answer_6').val(),vote_answer_7:$('#vote_answer_7').val(),vote_answer_8:$('#vote_answer_8').val(),vote_answer_9:$('#vote_answer_9').val(),vote_answer_10:$('#vote_answer_10').val()},function(data){if(data=='err_privacy'){addAllErr(lang_pr_no_title);}else{$('#wall_records').html(data);$('#wall_all_record').html('');$('#wall_rec_num').text(rec_num)
$('#wall_text').val('');$('#attach_files').hide();$('#attach_files').html('');$('#vaLattach_files').val('');wall.form_close();wall.RemoveAttachLnk();Votes.RemoveForAttach();}
butloading('wall_send',56,'enabled',lang_box_send);});}else{$('#wall_text').val('');$('#wall_text').focus();}},delet:function(rid){var rec_num=parseInt($('#wall_rec_num').text())-1;if(!rec_num)
rec_num='';$('#wall_record_'+rid).html(lang_wall_del_ok);$('#wall_fast_block_'+rid).remove();$('#wall_rec_num').text(rec_num);myhtml.title_close(rid);$.post('/index.php?go=wall&act=delet',{rid:rid});},fast_comm_del:function(rid){$('#wall_fast_comment_'+rid).html(lang_wall_del_com_ok);$.post('/index.php?go=wall&act=delet',{rid:rid});},page:function(for_user_id){if($('#wall_link').text()=='к предыдущим записям'){textLoad('wall_link');$('#wall_l_href').attr('onClick','');last_id=$('.wallrecord:last').attr('id').replace('wall_record_','');rec_num=parseInt($('#wall_rec_num').text());$.post('/index.php?go=wall&act=page',{last_id:last_id,for_user_id:for_user_id},function(data){$('#wall_all_record').append(data);$('#wall_l_href').attr('onClick','wall.page('+for_user_id+'); return false');$('#wall_link').html(lang_wall_all_lnk);count_record=$('.wallrecord').size();if(count_record>=rec_num)
$('#wall_l_href').hide();});}},open_fast_form:function(rid){val=$('.wall_fast_text').val();$('.wall_fast_text').val('');$('.wall_fast_form, .wall_fast_texatrea').hide();$('.wall_fast_input, .fast_comm_link').show();$('#fast_form_'+rid).show();$('#fast_comm_link_'+rid).hide();},fast_form_close:function(){$('.wall_fast_text').val('');$('.wall_fast_form, .wall_fast_texatrea').hide();$('.wall_fast_input, .fast_comm_link').show();},fast_open_textarea:function(rid,type){$('.wall_fast_text').val('');if(type==2){$('.wall_fast_input').show();$('.wall_fast_texatrea, .wall_fast_form').hide();$('#fast_inpt_'+rid).hide();$('#fast_textarea_'+rid).show();$('#fast_text_'+rid).focus();$('.fast_comm_link').show();}else{$('#fast_textarea_'+rid).show();$('#fast_text_'+rid).focus();}},fast_send:function(rid,for_user_id,type){wall_text=$('#fast_text_'+rid).val();if(wall_text!=0){butloading('fast_buts_'+rid,56,'disabled');$.post('/index.php?go=wall&act=send',{wall_text:wall_text,for_user_id:for_user_id,rid:rid,type:type},function(data){if(data=='err_privacy'){addAllErr(lang_pr_no_title);}else{$('#ava_rec_'+rid).addClass('wall_ava_mini');$('#fast_form_'+rid).remove();$('#fast_textarea_'+rid).remove();$('#fast_comm_link_'+rid).remove();$('#wall_fast_block_'+rid).html(data);$('.wall_fast_text').val('');wall.fast_form_close();}
butloading('fast_buts_'+rid,56,'enabled',lang_box_send);});}else{$('#fast_text_'+rid).val('');$('#fast_text_'+rid).focus();}},all_comments:function(rid,for_user_id,type){textLoad('wall_all_comm_but_'+rid);$('#wall_all_but_link_'+rid).attr('onClick','');$.post('/index.php?go=wall&act=all_comm',{fast_comm_id:rid,for_user_id:for_user_id,type:type},function(data){if(data=='err_privacy')
addAllErr(lang_pr_no_title);else
$('#wall_fast_block_'+rid).html(data);});},all_liked_users:function(rid,page_num,liked_num){if(page_num)
page='&page='+page_num;else{page='';page_num=1;}
Box.Page('/index.php?go=wall&act=all_liked_users','rid='+rid+'&liked_num='+liked_num+page,'all_liked_users_'+rid+page_num,525,lang_wall_liked_users,lang_msg_close,0,0,345,1,1,1,0,1);},attach_menu:function(type,id,show_id){if(type=='open'){$('#'+id).addClass('wall_attach_selected');$('#'+show_id).show();}
if(type=='close'){$('#'+show_id).hide();$('#'+id).removeClass('wall_attach_selected');}},attach_insert:function(type,data,action_url,uid){if(!$('#wall_text').val())
wall.form_open();$('#attach_files').show();var attach_id=Math.floor(Math.random()*(1000-1+1))+1;var for_user_id=location.href.split('/u');if(uid)
for_user_id[1]=uid;if(type=='smile'){Box.Close('attach_smile',1);smile=data.split('smiles/');res_attach_id='smile_'+attach_id;$('#attach_files').append('<span id="attach_file_'+res_attach_id+'" class="attach_file"><img src="'+data+'" class="wall_attach_smile fl_l" onClick="wall.attach_delete(''+res_attach_id+'', 'smile|'+smile[1]+'||')" onMouseOver="myhtml.title(''+res_attach_id+'', ''+lang_wall_no_atttach+'', 'wall_smile_')" onMouseOut="myhtml.title_close(''+res_attach_id+'')" id="wall_smile_'+res_attach_id+'" style="margin-top:0px" /></span>');$('#vaLattach_files').val($('#vaLattach_files').val()+'smile|'+smile[1]+'||');}
if(type=='photo'){Box.Close('all_photos',1);res_attach_id='photo_'+attach_id;$('#attach_files').append('<span id="attach_file_'+res_attach_id+'" class="attach_file"><div class="wall_attach_photo fl_l"><div class="wall_attach_del" onMouseOver="myhtml.title(''+res_attach_id+'', ''+lang_wall_no_atttach+'', 'wall_photo_')" onMouseOut="myhtml.title_close(''+res_attach_id+'')" onClick="wall.attach_delete(''+res_attach_id+'', 'photo_u|'+action_url+'||')" id="wall_photo_'+res_attach_id+'"></div><img src="'+data+'" alt="" /></div></span>');$('#vaLattach_files').val($('#vaLattach_files').val()+'photo_u|'+action_url+'||');}
if(type=='video'){Box.Close('all_videos',1);res_attach_id='video_'+attach_id;aPslit=action_url.split('|');action_url=action_url.replace('http://vk-demo.com/uploads/videos/'+aPslit[2]+'/','');$('#attach_files').append('<span id="attach_file_'+res_attach_id+'" class="attach_file"><div class="wall_attach_photo fl_l"><div class="wall_attach_del" onMouseOver="myhtml.title(''+res_attach_id+'', ''+lang_wall_no_atttach+'', 'wall_video_')" onMouseOut="myhtml.title_close(''+res_attach_id+'')" onClick="wall.attach_delete(''+res_attach_id+'', 'video|'+action_url+'||')" id="wall_video_'+res_attach_id+'"></div><img src="'+data+'" alt="" /></div></span>');$('#vaLattach_files').val($('#vaLattach_files').val()+'video|'+action_url+'||');}
if(type=='audio'){var artist=$('#artis'+action_url).text();var name=$('#name'+action_url).text();Box.Close();res_attach_id='audio_'+attach_id;$('#attach_files').append('<span id="attach_file_'+res_attach_id+'" class="attach_file fl_l" style="display:block;width:100%"><div class="audio_wall_attach"><div class="fl_l"><b>'+artist+'</b> – '+name+'</div><img src="/templates/Default/images/close_a.png" onMouseOver="myhtml.title(''+res_attach_id+'', ''+lang_wall_no_atttach+'', 'wall_audio_')" onClick="wall.attach_delete(''+res_attach_id+'', 'audio|'+action_url+'||')" id="wall_audio_'+res_attach_id+'" class="fl_l cursor_pointer" style="margin-left:5px;margin-top:1px" /></span></div>');$('#vaLattach_files').val($('#vaLattach_files').val()+'audio|'+action_url+'||');}
if(type=='note'){Box.Close();res_attach_id='notes_'+attach_id;$('#attach_files').append('<span id="attach_file_'+res_attach_id+'" class="attach_file fl_l" style="display:block;width:100%">'+'<div class="audio_wall_attach"><div class="fl_l"><b>'+data+'</b>'+' </div><img src="/templates/Default/images/close_a.png" onMouseOver="myhtml.title(''+res_attach_id+'', ''+lang_wall_no_atttach+'', 'wall_notes_')" onClick="wall.attach_delete(''+res_attach_id+'', ''+uid+'')" id="wall_notes_'+res_attach_id+'" class="fl_l cursor_pointer" style="margin-left:5px;margin-top:1px" /></span></div>');$('#vaLattach_files').val($('#vaLattach_files').val()+uid);}
count=$('.attach_file').size();if(count>9)
$('#wall_attach').hide();},attach_delete:function(id,realId){$('#vaLattach_files').val($('#vaLattach_files').val().replace(realId,''));$('#attach_file_'+id).remove();myhtml.title_close(id);count=$('.attach_file').size();if(!count)
$('#attach_files').hide();if(count<10)
$('#wall_attach').show();},attach_addsmile:function(){wall.attach_menu('close','wall_attach','wall_attach_menu');Box.Show('attach_smile',395,lang_wall_atttach_addsmile,lang_wall_attach_smiles,lang_box_canсel,'','',0,1,1,1);},attach_addphoto:function(id,page_num,notes){wall.attach_menu('close','wall_attach','wall_attach_menu');if(page_num)
page='&page='+page_num;else{page='';page_num=1;}
if(notes)
notes='¬es=1';else
notes='';Box.Page('/index.php?go=albums&act=all_photos_box',page+notes,'all_photos_'+page_num,627,lang_wall_attatch_photos,lang_box_canсel,0,0,400,1,1,1,0,1);},attach_addvideo:function(id,page_num,notes){wall.attach_menu('close','wall_attach','wall_attach_menu');if(page_num)
page='&page='+page_num;else{page='';page_num=1;}
if(notes)
notes='¬es=1';else
notes='';Box.Page('/index.php?go=videos&act=all_videos',page+notes,'all_videos_'+page_num,627,lang_wall_attatch_videos,lang_box_canсel,0,0,400,1,1,1,0,1);},attach_addaudio:function(id,page_num){wall.attach_menu('close','wall_attach','wall_attach_menu');if(page_num)
page='page='+page_num;else{page='';page_num=1;}
Box.Page('/index.php?go=audio&act=allMyAudiosBox',page,'all_audios',627,lang_audio_wall_attatch,lang_box_canсel,0,0,400,1,1,1,0,0);music.jPlayerInc();},attach_addgraffiti:function(d){$.post('/index.php?go=graffiti',{id:d},function(a){$('html').css({'overflow':'hidden','margin':'0 17px 0 0'});$('body').append('<div id="newbox_miniature"><div class="miniature_box"><div class="miniature_pos" style="width: 607px;margin-top:30px;"><div class="miniature_title fl_l">Граффити на стену</div><a class="cursor_pointer fl_r" onclick="Profile.miniatureClose()">Закрыть</a><div class="clear"></div>'+a+'</div></div></div>');});},attach_note:function(){$.post('index.php?go=notes&act=add',{id:'1'},function(a){$('html').css({'overflow':'hidden','margin':'0 17px 0 0'});$('body').append('<div id="newbox_miniature"><div class="miniature_box"><div class="miniature_pos" style="width: 607px;margin-top:30px;"><div class="miniature_title fl_l">Создание заметки</div><a class="cursor_pointer fl_r" onclick="Profile.miniatureClose()">Закрыть</a><div class="clear"></div>'+a+'</div></div></div>');});},attach_addDoc:function(){Box.Page('/index.php?go=doc','','all_doc',627,'Выберите документ',lang_box_canсel,0,0,400,1,0,1,0,0);},tell:function(id){$('#wall_tell_'+id).hide();myhtml.title_close(id);$('#wall_ok_tell_'+id).fadeIn(150);$.post('/index.php?go=wall&act=tell',{rid:id},function(data){if(data==1)
addAllErr(lang_wall_tell_tes);});},CheckLinkText:function(val,f){if(!$('#attach_lnk_stared').val()){matches=val.split('http://');url=matches[1].split('r');if(!url[1])url=matches[1].split(' ');if(val=='http://'+url[0]&&f)fast_check=1;if(url[1]||fast_check){rUrl=url[0].split(' ');$('#attach_block_lnk').show();$('#teck_link_attach').val(rUrl[0]);txurl=rUrl[0].replace('http://','');spurl=txurl.split('/');$('#attatch_link_url').text(spurl[0]).attr('href','/away.php?url=http://'+rUrl[0]);$('#attach_lnk_stared').val('started');$.post('/index.php?go=wall&act=parse_link',{lnk:rUrl[0]},function(d){$('#loading_att_lnk').hide();rndval=new Date().getTime();row=d.split('<f>');if(d!=1){$('#attatch_link_title').html(row[0]);$('#attatch_link_descr').html(row[1]);}
if(row[2]&&d!=1)$('#attatch_link_img').attr('src',row[2]).show();if(!row[1])row[1]='0';if(d!=1){$('#vaLattach_files').val($('#vaLattach_files').val()+'link|http://'+rUrl[0]+'|'+row[0]+'|'+row[1]+'|'+row[2]+'||');$('#urlParseImgs').text(row[3]);}});}}},UrlNextImg:function(){neUrl=$('#urlParseImgs').text().split('|');if(!neUrl[url_next_id])url_next_id=0;$('#vaLattach_files').val($('#vaLattach_files').val().replace($('#attatch_link_img').attr('src'),neUrl[url_next_id]));$('#attatch_link_img').attr('src',neUrl[url_next_id]);url_next_id++;},RemoveAttachLnk:function(){delstr='link|http://'+$('#teck_link_attach').val()+'|'+$('#attatch_link_title').html()+'|'+$('#attatch_link_descr').html()+'|'+$('#attatch_link_img').attr('src')+'||';$('#vaLattach_files').val($('#vaLattach_files').val().replace(delstr,''));$('#attach_lnk_stared').val('');$('#attach_block_lnk').hide();$('.js_titleRemove').remove();$('#attatch_link_title, #attatch_link_descr').html('');$('#attatch_link_img').attr('src','').hide();$('#loading_att_lnk').show();$('#attatch_link_url').text('').attr('href','');$('#teck_link_attach').val('');$('#urlParseImgs').text('');},FullText:function(rid){$('#hide_wall_rec'+rid).css('max-height','none');$('#hide_wall_rec_lnk'+rid).hide();}}
var bbcodes={tag:function(ibTag,ibClsTag,source){if(!source)
source='';bbcodes.insert(ibTag+source,ibClsTag);},insert:function(ibTag,ibClsTag){var obj_ta=eval('document.entryform.text');var ss=obj_ta.selectionStart;var st=obj_ta.scrollTop;var es=obj_ta.selectionEnd;var start=(obj_ta.value).substring(0,ss);var middle=(obj_ta.value).substring(ss,es);var end=(obj_ta.value).substring(es,obj_ta.textLength);middle=ibTag+middle+ibClsTag;obj_ta.value=start+middle+end;var cpos=ss+(middle.length);obj_ta.selectionStart=cpos;obj_ta.selectionEnd=cpos;obj_ta.focus();}}
var wysiwyg={boxPhoto:function(img,uid,pid){Box.Close('all_photos',1);lang_notes_sett_box_content='<div style="padding:15px">'+'<div class="texta" style="width:90px">Ширина:</div><input type="text" id="width_'+pid+'" class="inpst" maxlength="3" size="3" value="140" /> px<div class="mgclr"></div>'+'<div class="texta" style="width:90px">Высота:</div><input type="text" id="height_'+pid+'" class="inpst" maxlength="3" size="3" value="100" /> px<div class="mgclr"></div>'+'<div class="texta" style="width:90px">Выравнивание:</div><div class="padstylej"><select class="inpst" id="pos_'+pid+'"><option value="0">стандартно</option><option value="1">по левому краю</option><option value="2">по правому краю</option><option value="3">по центру</option></select></div><div class="mgclr"></div>'+'<div class="texta" style="width:90px"> </div><div class="html_checkbox" id="img_link_'+pid+'" onClick="myhtml.checkbox(this.id)">Добавить ссылку</div><div class="mgclr"></div>'+'<div class="texta" style="width:90px"> </div><div class="html_checkbox" id="img_blank_'+pid+'" onClick="myhtml.checkbox(this.id)" style="margin-top:5px">Открывать в новом окне</div><div class="mgclr"></div>'+'<div class="texta" style="width:90px"> </div><div class="html_checkbox" id="img_border_'+pid+'" onClick="myhtml.checkbox(this.id)" style="margin-top:5px">Показывать рамку</div><div class="mgclr"></div>'+'</div>';Box.Show('note_add_photo_'+pid,300,lang_notes_setting_addphoto,lang_notes_sett_box_content,lang_box_canсel,lang_box_save,'wysiwyg.inPhoto(''+img+'', '+uid+', '+pid+')',0,0,0,0,1);myhtml.checked(['img_link_'+pid,'0']);},inPhoto:function(img,uid,pid){Box.Close('note_add_photo_'+pid,1);width=$('#width_'+pid).val();height=$('#height_'+pid).val();pos=$('#pos_'+pid).val();img_link=$('#img_link_'+pid).val();img_blank=$('#img_blank_'+pid).val();img_border=$('#img_border_'+pid).val();if(pos==3){spos='[center]';epos='[/center]';}else{spos='';epos='';}
bbcodes.tag(spos+'[photo]','[/photo]'+epos,uid+'|'+pid+'|'+img+'|'+width+'|'+height+'|'+img_border+'|'+img_blank+'|'+pos+'|'+img_link);},boxVideo:function(img,uid,vid){Box.Close('all_videos',1);lang_notes_sett_box_content='<div style="padding:15px">'+'<div class="texta" style="width:90px">Ширина:</div><input type="text" id="v_width_'+vid+'" class="inpst" maxlength="3" size="3" value="175" /> px<div class="mgclr"></div>'+'<div class="texta" style="width:90px">Высота:</div><input type="text" id="v_height_'+vid+'" class="inpst" maxlength="3" size="3" value="131" /> px<div class="mgclr"></div>'+'<div class="texta" style="width:90px">Выравнивание:</div><div class="padstylej"><select class="inpst" id="v_pos_'+vid+'"><option value="0">стандартно</option><option value="1">по левому краю</option><option value="2">по правому краю</option><option value="3">по центру</option></select></div><div class="mgclr"></div>'+'<div class="texta" style="width:90px"> </div><div class="html_checkbox" id="v_img_blank_'+vid+'" onClick="myhtml.checkbox(this.id)" style="margin-top:5px">Открывать в новом окне</div><div class="mgclr"></div>'+'<div class="texta" style="width:90px"> </div><div class="html_checkbox" id="v_img_border_'+vid+'" onClick="myhtml.checkbox(this.id)" style="margin-top:5px">Показывать рамку</div><div class="mgclr"></div>'+'</div>';Box.Show('note_add_video_'+vid,300,lang_notes_setting_addvdeio,lang_notes_sett_box_content,lang_box_canсel,lang_box_save,'wysiwyg.inVideo(''+img+'', '+uid+', '+vid+')',0,0,0,0,1);},inVideo:function(img,uid,vid){Box.Close('note_add_video_'+vid,1);width=$('#v_width_'+vid).val();height=$('#v_height_'+vid).val();pos=$('#v_pos_'+vid).val();img_blank=$('#v_img_blank_'+vid).val();img_border=$('#v_img_border_'+vid).val();if(pos==3){spos='[center]';epos='[/center]';}else{spos='';epos='';}
bbcodes.tag(spos+'[video]','[/video]'+epos,uid+'|'+vid+'|'+img+'|'+width+'|'+height+'|'+img_border+'|'+img_blank+'|'+pos);},linkBox:function(){lang_wysiwyg_box_content='<div style="padding:15px">'+'<div class="texta" style="width:90px">Адрес ссылки:</div><input type="text" id="l_http" class="inpst" style="width:300px" /><div class="mgclr"></div>'+'<div class="texta" style="width:90px">Текст ссылки:</div><input type="text" id="l_text" class="inpst" style="width:300px" /><div class="mgclr"></div>'+'</div>';Box.Show('w_link',450,lang_wysiwyg_title,lang_wysiwyg_box_content,lang_box_canсel,lang_box_save,'wysiwyg.insertLink()');$('#l_http').focus();},insertLink:function(){link=$('#l_http').val();link_text='|'+$('#l_text').val();if(!$('#l_text').val())
link_text='';if(link!=0)
bbcodes.tag('[link]','[/link]',link+link_text);Box.Close('w_link');}}
var gStatus={open:function(){$('#set_status_bg').fadeIn(100);$('#status_text').focus();$('#status_text').select();if($('#status_text').val()){$('.yes_status_text').show();$('.no_status_text').hide();}else{$('.yes_status_text').hide();$('.no_status_text').show();}
$('.status_tell_friends').hide();},close:function(){$('#set_status_bg').hide();$('#status_text').val($('#status_text').val());},set:function(clear){text=$('#status_text').val();if(clear){text='';$('#status_text').val('');}
if(text!=$('#new_status').text()){butloading('status_but',55,'disabled');$.post('/index.php?go=status',{text:text},function(data){if(data){$('#status_link').hide();gStatus.tell();$('#new_status').attr('onMouseOver','gStatus.tell()');}else
$('#status_link').show();$('#new_status').html(data);gStatus.close();butloading('status_but',55,'enabled',lang_box_save);});}else
gStatus.close();},sets:function(clear){var gr=$('#grupus').val();text=$('#status_text').val();if(clear){text='';$('#status_text').val('');}
if(text!=$('#new_status').text()){butloading('status_but',55,'disabled');$.post('/index.php?go=status&act=status',{text:text,gr:gr},function(data){if(data){$('#status_link').hide();gStatus.tell();$('#new_status').attr('onMouseOver','gStatus.tell()');}else
$('#status_link').show();$('#new_status').html(data);gStatus.close();butloading('status_but',55,'enabled',lang_box_save);});}else
gStatus.close();},tell:function(){$('.status_tell_friends').hide();pos=$('#tellBlockPos').position().top;$('.status_tell_friends').fadeIn('fast');setTimeout(function(){$('.status_tell_friends').fadeOut('fast');},2500);},startTell:function(){for_user_id=location.href.split('http://'+location.host+'/u');text=$('#status_text').val();tell_friends=$('#tell_friends').val();if(tell_friends){if(text!=0){$.post('/index.php?go=wall&act=send',{wall_text:text,for_user_id:for_user_id[1]},function(data){$('#wall_records').html(data);$('#wall_all_record').html('');updateNum('#wall_rec_num',1);});}}else{insert_id=$('.wallrecord:first').attr('id').replace('wall_record_','');wall.delet(insert_id);}}}
var news={page:function(){var type=$('#type').val();$('#wall_l_href_news').attr('onClick','');if($('#loading_news').text()=='Показать предыдущие новости'){textLoad('loading_news');$.post('/index.php?go=news&type='+type,{page:1,page_cnt:page_cnt},function(d){if(d!='no_news'){$('#news').append(d);$('#wall_l_href_news').attr('onClick','news.page(''+type+'')');$('#loading_news').html('Показать предыдущие новости');page_cnt++;}else
$('#wall_l_href_news').hide();});}},showWallText:function(id){var wh2=$('#2href_text_'+id).width();var wh=$('#href_text_'+id).width()-wh2-40;$('.news_wall_msg_bg').hide();$('#wall_text_'+id).fadeIn('fast').css('margin-left',wh);$('#wall_text_'+id).mouseover(function(){$('#wall_text_'+id).fadeOut('fast');});},hideWallText:function(id){$('#wall_text_'+id).fadeOut('fast');}}
var settings={logs:function(){$.post('/index.php?go=settings&act=logs',function(body){$('body').append('<div id="newbox_miniature"><div class="miniature_box"><div class="miniature_pos" style="width: 540px;padding:15px;"><div class="miniature_title fl_l">История активности</div><a class="cursor_pointer fl_r" onclick="Profile.miniatureClose()">Закрыть</a><div class="clear"></div>'+body+'</div></div></div>');});},savenewmail:function(){var email=$('#email').val();if(settings.isValidEmailAddress(email)){butloading('saveNewEmail','88','disabled','');$.post('/index.php?go=settings&act=change_mail',{email:email},function(d){if(d==1){$('#err_email').html('Этот E-Mail адрес уже занят.').show();}else{$('#err_email').hide();$('#ok_email').show();}
butloading('saveNewEmail','88','enabled','Сохранить адрес');});}else{$('#err_email').show();setErrorInputMsg('email');}},isValidEmailAddress:function(emailAddress){var pattern=new RegExp(/^(("[w-s]+")|([w-]+(?:.[w-]+)*)|("[w-s]+")([w-]+(?:.[w-]+)*))(@((?:[w-]+.)*w[w-]{0,66}).([a-z]{2,6}(?:.[a-z]{2})?)$)|(@[?((25[0-5].|2[0-4][0-9].|1[0-9]{2}.|[0-9]{1,2}.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2}).){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})]?$)/i);return pattern.test(emailAddress);},saveNewPwd:function(){var old_pass=$('#old_pass').val();var new_pass=$('#new_pass').val();var new_pass2=$('#new_pass2').val();if(old_pass!=0){if(new_pass!=0){if(new_pass2!=0){butloading('saveNewPwd',87,'disabled');$.post('/index.php?go=settings&act=newpass',{old_pass:old_pass,new_pass:new_pass,new_pass2:new_pass2},function(data){$('.pass_errors').hide();if(data==1)
$('#err_pass_1').show();else if(data==2)
$('#err_pass_2').show();else
$('#ok_pass').show();butloading('saveNewPwd',87,'enabled','Изменить пароль');});}else
setErrorInputMsg('new_pass2');}else
setErrorInputMsg('new_pass');}else
setErrorInputMsg('old_pass');},saveNewName:function(){var name=$('#name').val();var lastname=$('#lastname').val();if(name.length>=2&&name!=0&&settings.isValidName(name)){if(lastname.length>=2&&lastname!=0&&settings.isValidName(lastname)){butloading('saveNewName',69,'disabled');$.post('/index.php?go=settings&act=newname',{name:name,lastname:lastname},function(data){$('.name_errors').hide();$('#ok_name').show();butloading('saveNewName',69,'enabled','Изменить имя');});}else{$('.name_errors').hide();$('#err_name_1').show();setErrorInputMsg('lastname');}}else{$('.name_errors').hide();$('#err_name_1').show();setErrorInputMsg('name');}},isValidName:function(xname){var pattern=new RegExp(/^[a-zA-Zа-яА-Я]+$/);return pattern.test(xname);},privacyOpen:function(id){$('.sett_openmenu').hide();$('#privacyMenu_'+id).show();},privacyClose:function(id){$('#privacyMenu_'+id).fadeOut(120);},setPrivacy:function(val_id,mtext,opt,text_id){$('#'+val_id).val(opt);$('#'+text_id).text(mtext);$('#selected_p_'+text_id).text(mtext);settings.privacyClose(val_id);},event:function(event){var oi=(event.target)?event.target.id:((event.srcElement)?event.srcElement.id:null);var fast_oi=oi.substring(0,9);if(oi!='privacyMenu_msg'&&oi!='privacy_lnk_msg'&&oi!='privacyMenu_wall1'&&oi!='privacy_lnk_wall1'&&oi!='privacyMenu_wall2'&&oi!='privacy_lnk_wall2'&&oi!='privacyMenu_wall3'&&oi!='privacy_lnk_wall3'&&oi!='privacyMenu_info'&&oi!='privacy_lnk_info')
$('#privacyMenu_msg, #privacyMenu_wall1, #privacyMenu_wall2, #privacyMenu_wall3, #privacyMenu_info').fadeOut(120);},savePrivacy:function(){var val_msg=$('#val_msg').val();var val_wall1=$('#val_wall1').val();var val_wall2=$('#val_wall2').val();var val_wall3=$('#val_wall3').val();var val_info=$('#val_info').val();butloading('savePrivacy',55,'disabled');$.post('/index.php?go=settings&act=saveprivacy',{val_msg:val_msg,val_wall1:val_wall1,val_wall2:val_wall2,val_wall3:val_wall3,val_info:val_info},function(){$('#ok_update').show();butloading('savePrivacy',55,'enabled','Сохранить');});},addblacklist:function(bad_user_id){$('#addblacklist_load').show();$.post('/index.php?go=settings&act=addblacklist',{bad_user_id:bad_user_id},function(){$('#addblacklist_but').attr('onClick','settings.delblacklist('+bad_user_id+', 1); return false');$('#text_add_blacklist').text('Разблокировать');$('#addblacklist_load').hide();});},delblacklist:function(bad_user_id,type){$('#addblacklist_load').show();textLoad('del_'+bad_user_id);$.post('/index.php?go=settings&act=delblacklist',{bad_user_id:bad_user_id},function(){if(type){$('#addblacklist_but').attr('onClick','settings.addblacklist('+bad_user_id+'); return false');$('#text_add_blacklist').text('Заблокировать');$('#addblacklist_load').hide();}else{$('#u'+bad_user_id).remove();updateNum('#badlistnum');}});},verification:function(){var skype=$('#skype').val();var email=$('#email').val();var file1=$('#file1').val();var file2=$('#file2').val();var request=$('#prs').val();if(skype.length==0||email.length==0||file1.length==0||file2.length==0){$('#ok_verification').show().removeClass('err_yellow').addClass('err_red').html('Заполните все поля.');}else{if(request=='0'){window.location='/'}else{$.post('/index.php?go=settings&act=verification',{skype:skype,email:email,file1:file1,file2:file2},function(){$('#ok_verification').show().removeClass('err_red').addClass('err_yellow').html('Заявка на верификацию отправлена.<a class="cursor_pointer" onclick="settings.verification_cancel()">Отмена</a>');});}}},verification_cancel:function(){$.post('/index.php?go=settings&act=verification_cancel',function(){$('#ok_verification').show().removeClass('err_red').addClass('err_yellow').html('Заявка на верификацию отменена.');$('#bverb').show();$('#bver').hide();});},addeffects:function(id){$.post('/index.php?go=settings&act=addeffects',{id:id},function(data){$('.name_errors').hide();$('#ok_name').show();$('#addeffects'+id).html('<button style="width: 100%;" onclick="settings.deleffects(''+id+''); return false">Удалить</button>');});},deleffects:function(id){$.post('/index.php?go=settings&act=deleffects',{id:id},function(data){$('.name_errors').hide();$('#ok_name').show();$('#addeffects'+id).html('<button style="width: 100%;" onclick="settings.addeffects(''+id+''); return false">Установить</button>');});}}
var crop={start:function(id){$('.pinfo, .photo_prev_but, .photo_next_but').hide();$('#save_crop_text'+id).show();var x1w=$('#ladybug_ant'+id).width()-50;var y1h=$('#ladybug_ant'+id).height()-50;$('#i_left'+id).val('50');$('#i_top'+id).val('50');$('#i_width'+id).val(x1w);$('#i_height'+id).val(y1h);$('#ladybug_ant'+id).imgAreaSelect({minWidth:100,minHeight:100,handles:true,x1:50,y1:50,x2:x1w,y2:y1h,onSelectEnd:function(img,selection){$('#i_left'+id).val(selection.x1);$('#i_top'+id).val(selection.y1);$('#i_width'+id).val(selection.width);$('#i_height'+id).val(selection.height);}});},close:function(id){$('.pinfo, .photo_prev_but, .photo_next_but').show();$('#save_crop_text'+id).hide();$('#ladybug_ant'+id).imgAreaSelect({remove:true});},save:function(pid,uid){var i_left=$('#i_left'+pid).val();var i_top=$('#i_top'+pid).val();var i_width=$('#i_width'+pid).val();var i_height=$('#i_height'+pid).val();Page.Loading('start');$.post('/index.php?go=photo&act=crop',{i_left:i_left,i_top:i_top,i_width:i_width,i_height:i_height,pid:pid},function(data){Page.Go('/u'+uid);});}}
var support={send:function(){var title=$('#title').val();var question=$('#question').val();if(title!=0&&title!='Пожалуйста, добавьте заголовок к Вашему вопросу..'){if(question!=0&&question!='Пожалуйста, расскажите о Вашей проблеме чуть подробнее..'){$('#cancel').hide();butloading('send','56','disabled','');$.post('/index.php?go=support&act=send',{title:title,question:question},function(data){if(data=='limit'){Box.Info('err',lang_support_ltitle,lang_support_ltext,280,2000);}else{var qid=data.split('r|x');$('#data').html(qid[0]);history.pushState({link:'/support?act=show&qid='+qid[1]},null,'/support?act=show&qid='+qid[1]);}
butloading('send','56','enabled','Отправить');});}else
setErrorInputMsg('question');}else
setErrorInputMsg('title');},delquest:function(qid){Box.Show('del_quest',400,lang_title_del_photo,'<div style="padding:15px;" id="text_del_quest">'+lang_support_text+'</div>',lang_box_canсel,lang_box_yes,'support.startDel('+qid+'); return false');},startDel:function(qid){$('#box_loading').show();$.post('/index.php?go=support&act=delet',{qid:qid},function(){Page.Go('/support');});},answer:function(qid,uid){var answer=$('#answer').val();if(answer!=0&&answer!='Комментировать..'){butloading('send','56','disabled','');$.post('/index.php?go=support&act=answer',{answer:answer,qid:qid},function(data){if(uid==0)
$('#status').text('Есть ответ.');else
$('#status').text('Вопрос ожидает обработки.');$('#answers').append(data);$('#answer').val('');butloading('send','56','enabled',lang_box_send);});}else
setErrorInputMsg('answer');},delanswe:function(id){$('#asnwe_'+id).html(lang_del_comm);$.post('/index.php?go=support&act=delet_answer',{id:id});},close:function(qid){butloading('close','30','disabled','');$.post('/index.php?go=support&act=close',{qid:qid},function(){$('#status').text('Есть ответ.');$('#close_but').hide();});}}
var blog={add:function(){var title=$('#title').val();var text=$('#text').val();if(title!=0){if(text!=0){butloading('notes_sending',74,'disabled');$.post('/index.php?go=blog&act=send',{title:title,text:text},function(){Page.Go('/blog');});}else
setErrorInputMsg('text');}else
setErrorInputMsg('title');},del:function(id){Box.Show('del_quest',400,lang_title_del_photo,'<div style="padding:15px;" id="text_del_quest">'+lang_news_text+'</div>',lang_box_canсel,lang_box_yes,'blog.startDel('+id+'); return false');},startDel:function(id){$('#box_loading').show();$.post('/index.php?go=blog&act=del',{id:id},function(){Page.Go('/blog');});},save:function(id){var title=$('#title').val();var text=$('#text').val();if(title!=0){if(text!=0){butloading('notes_sending',55,'disabled');$.post('/index.php?go=blog&act=save',{id:id,title:title,text:text},function(){Page.Go('/blog?id='+id);});}else
setErrorInputMsg('text');}else
setErrorInputMsg('title');}}
var gifts={boxShow:function(id){$.post('/index.php?go=gifts&act=icons',{id:id},function(d){$('body').append(d);});},tab:function(id){$.post('/index.php?go=gifts&act=all_icons',{id:id},function(d){d=d.split('||||');$('#panel_ico').html(d[0]);$('#cont_ico').html(d[1]);});},box:function(user_id,c){if(c)
var cache=0;else
var cache=1;Box.Page('/index.php?go=gifts&act=view','user_id='+user_id,'gifts',679,lang_gifts_title,lang_box_canсel,0,0,450,1,1,1,0,cache);},boxs:function(user_id){$post('/index.php?go=gifts&act=view',{user_id:user_id},function(a){$('#page').html(a);});},showgift:function(id){$('#g'+id).show();},showhide:function(id){$('#g'+id).hide();},select:function(gid,fid){Box.Close(0,1);Box.Show('send_gift'+gid,460,lang_gifts_title,'<center><img src="/uploads/gifts/'+gid+'.jpg" style="margin-top:30px" /></center><div class="fl_l color777" style="padding:3px;margin-left:100px;margin-right:5px">Тип подарка:</div><div class="sett_privacy" onClick="settings.privacyOpen('privacy_comment'+gid+'')" id="privacy_lnk_privacy_comment'+gid+'">Виден всем</div><div class="sett_openmenu no_display" id="privacyMenu_privacy_comment'+gid+'" style="margin-top:-1px;margin-left:176px;width:100px"><div id="selected_p_privacy_lnk_privacy_comment'+gid+'" class="sett_selected" onClick="settings.privacyClose('privacy_comment'+gid+'')">Виден всем</div><div class="sett_hover" onClick="settings.setPrivacy('privacy_comment'+gid+'', 'Виден всем', '1', 'privacy_lnk_privacy_comment'+gid+'')">Виден всем</div><div class="sett_hover" onClick="settings.setPrivacy('privacy_comment'+gid+'', 'Личный', '2', 'privacy_lnk_privacy_comment'+gid+'')">Личный</div><div class="sett_hover" onClick="settings.setPrivacy('privacy_comment'+gid+'', 'Анонимный', '3', 'privacy_lnk_privacy_comment'+gid+'')">Анонимный</div></div><input type="hidden" id="privacy_comment'+gid+'" value="1" /><div class="clear"></div><div class="fl_l color777" style="margin-left:182px;margin-right:5px" id="addmsgtext'+gid+'"><a href="" onClick="gifts.addmssbox('+gid+'); return false">Добавить сообщение</a></div>',lang_box_canсel,lang_box_send,'gifts.send('+gid+', '+fid+')',340,0,0,0,0);},send:function(gfid,fid){var privacy=$('#privacy_comment'+gfid).val();var msgfgift=$('#msgfgift'+gfid).val();$('#box_loading').show().css('margin-top','-5px');$.post('/index.php?go=gifts&act=send',{for_user_id:fid,gift:gfid,privacy:privacy,msg:msgfgift},function(d){if(d==1){addAllErr(lang_gifts_tnoubm,3000);Box.Close();}else{Box.Close();Box.Info('giftok',lang_gifts_oktitle,lang_gifts_oktext,250,2000);}});},addmssbox:function(gid){$('.box_conetnt').css('height','375px');$('#addmsgtext'+gid).html('<textarea id="msgfgift'+gid+'" class="inpst" style="width:200px;height:40px"></textarea>');$('#msgfgift'+gid).focus();},delet:function(gid){$('#gift_'+gid).html('<div class="color777" style="margin-bottom:5px">Подарок удалён.</div>');updateNum('#num');$.post('/index.php?go=gifts&act=del',{gid:gid});}}
var Board={createTopic:function(id){var title=$('#bnt_title').val();var text=$('#bnt_text').val();if(title.length!=0&&text.length!=0){$.post('/index.php?go=public_topic&act=save',{text:text,title:title,id:id},function(d){Page.Go(d);});}},sendPost:function(id,ids){var text=$('#ba_text').val();if(text.length!=0){$.post('/index.php?go=public_topic&act=comm',{text:text,id:id,ids:ids},function(d){num=parseInt($('#nums').text())+1;$('#nums').html(num);var ava=$('#vatar').attr('src');var user_id=$('.ba_thumb').attr('href');var name=$('#names').val();$('#bt_rows').append('<div id="post'+ids+'_'+id+'" class="bp_post"><table class="bp_table" cellspacing="0" cellpadding="0"><tbody><tr><td class="bp_thumb_td"><a class="bp_thumb" onClick="Page.Go(this.href); return false;" href="/u'+user_id+'"><img width="50" src="'+ava+'"></a></td><td class="bp_info"><div class="bp_author_wrap"><a class="bp_author" onClick="Page.Go(this.href); return false;" href="/u'+user_id+'">'+name+'</a></div><div id="bp_data{group_id}_{post_id}"><div class="bp_text">'+text+'</div></div><div class="bp_bottom clear_fix"><div class="bp_edited_by"></div><div class="fl_l"><a class="bp_date">только что</a></div><div class="fl_l progress bp_progress"></div></div></td></tr></tbody></table></div>');$('#ba_text').val('');});}},show:function(){$('#rowsss').show();},hide:function(){$('#rowsss').hide();},edit:function(id){var title=$('#bt_title').text();$('body').append('<div id="newbox_miniature"><div class="miniature_box"><div class="miniature_pos" style="width: 607px;margin-top:30px;"><div class="miniature_title fl_l">Редоктирование названия</div><a class="cursor_pointer fl_r" onclick="Profile.miniatureClose()">Закрыть</a><div class="clear"></div><div style="margin:50px 0 ;"><center><input type="text" id="edittitle" class="videos_input" value="'+title+'"><center><div class="button_div" onclick="Board.editsave(''+id+'');" style="width: 89px;"><button>Сохранить</button></div></center></center></div></div></div></div>');},editsave:function(id){var title=$('#edittitle').val();if(title.length!=0){$.post('/index.php?go=public_topic&act=edittitle',{id:id,title:title},function(){$('#bt_title').html(title);$('#newbox_miniature').remove();});}},del:function(id,ids){$.post('/index.php?go=public_topic&act=del',{id:id},function(){Page.Go('/public/board'+ids);});},update:function(id){$.post('/index.php?go=public_topic&act=update',{num:'1',id:id},function(){$('#bt_pages').show().html('<div id="bt_msg" class="msg" style="background-color: rgb(249, 246, 231);"><b>Тема закрыта.</b><br>Участники сообщества больше не смогут оставлять сообщения в этой теме.</div>');$('#updi').attr('onClick','Board.updates(''+id+'')').html('Открыть тему');$('#ba_post_wrap').hide();});},updates:function(id){$.post('/index.php?go=public_topic&act=update',{num:'0',id:id},function(d){$('#bt_pages').hide();$('#updi').attr('onClick','Board.update(''+id+'')').html('Закрыть тему');$('#ba_post_wrap').html(d).show();});}}
var groups={createbox:function(){Box.Show('create',490,lang_groups_new,'<div style="padding:20px"><div class="videos_text">Название</div><input type="text" class="videos_input" id="title" maxlength="65" /></div>',lang_box_canсel,lang_groups_cretate,'groups.creat()',100,0,0,0,0,'title');$('#title').focus();},creat:function(){var title=$('#title').val();if(title!=0){$('#box_loading').show();ge('box_butt_create').disabled=true;$.post('/index.php?go=groups&act=send',{title:title},function(id){Box.Close();Page.Go('/public'+id);});}else
setErrorInputMsg('title');},exit:function(id){$('#exitlink'+id).html('<div class="color777" style="margin-top:6px;margin-right:7px">Вы вышли из сообщества.</div>');$.post('/index.php?go=groups&act=exit',{id:id});},exit2:function(id,user_id){$('#no').hide();$('#yes').fadeIn('fast');updateNum('#traf');updateNum('#traf2');if($('#traf').text()==0){$('#users_block').hide();$('#num2').html('<span class="color777">Вы будете первым.</span>');}
$('#subUser'+user_id).remove();$.post('/index.php?go=groups&act=exit',{id:id});},login:function(id,ids){$('#yes').hide();$('#no').fadeIn('fast');if($('#traf').text()==0)$('#users_block').show();updateNum('#traf',1);updateNum('#traf2',1);$.post('/index.php?go=groups&act=login',{id:id,ids:ids});},logins:function(id){$.post('/index.php?go=groups&act=logins',{id:id},function(){$('#lods'+id).html('Приглашение принято.');});},unlogin:function(id){$.post('/index.php?go=groups&act=unlogin',{id:id},function(){$('#lods'+id).html('Приглашение отклонено.');});},shared:function(id){$('html').css({'overflow-y':'hidden','margin':'0 17px 0 0'});$.post('/index.php?go=groups&act=shared',{id:id},function(d){$('body').append('<div id="newbox_miniature">'+d+'</div>');});},closer:function(){$('.miniature_box').remove();$('html').css({'overflow-y':'auto','margin':'0'});page_cnt_invite=20;},welcom:function(id,gid){$.post('/index.php?go=groups&act=welcom',{id:id,gid:gid},function(d){$('#frs'+id).html(d);});},loadphoto:function(id){Box.Page('/index.php?go=groups&act=loadphoto_page','id='+id,'loadphoto',400,lang_title_load_photo,lang_box_canсel,0,0,0,0,0,0,0,1);},delphoto:function(id){Box.Show('del_photo',400,lang_title_del_photo,'<div style="padding:15px;">'+lang_del_photo+'</div>',lang_box_canсel,lang_box_yes,'groups.startdelete('+id+')');},startdelete:function(id){$('#box_loading').show();ge('box_butt_create').disabled=true;$.post('/index.php?go=groups&act=delphoto',{id:id},function(){$('#ava').attr('src',template_dir+'/images/no_ava.gif');$('#del_pho_but').hide();Box.Close();});},addcontact:function(id){Box.Page('/index.php?go=groups&act=addfeedback_pg','id='+id,'addfeedback',400,'Добавление контактного лица',lang_box_canсel,'Сохранить','groups.savefeedback('+id+')',0,0,0,0,'upage',0);},savefeedback:function(id){var upage=$('#upage').val();var office=$('#office').val();var phone=$('#phone').val();var email=$('#email').val();if($('#feedimg').attr('src')!=template_dir+'/images/contact_info.png'){$('#box_loading').show();ge('box_butt_create').disabled=true;$.post('/index.php?go=groups&act=addfeedback_db',{id:id,upage:upage,office:office,phone:phone,email:email},function(d){if(d==1){Box.Info('err','Информация','Этот пользователь уже есть в списке контактов.',300,2000);ge('box_butt_create').disabled=false;$('#box_loading').hide();}else{Box.Close();Page.Go('/public'+id);}});}else
setErrorInputMsg('upage');},allfeedbacklist:function(id){Box.Page('/index.php?go=groups&act=allfeedbacklist','id='+id,'allfeedbacklist',450,'Контакты','Закрыть',0,0,300,1,1,1,0,0);},delfeedback:function(id,uid){$('#f'+uid+', #fb'+uid).remove();var si=$('.public_obefeed').size();updateNum('#fnumu');if(si<=0){$('#feddbackusers').html('<div class="line_height color777" align="center">Страницы представителей, номера телефонов, e-mail<br /><a href="/public'+id+'" onClick="groups.addcontact('+id+'); return false">Добавить контакты</a></div>');$('.box_conetnt').html('<div align="center" style="padding-top:10px;color:#777;font-size:13px;">Список контактов пуст.</div><style>#box_bottom_left_text{padding-top:6px}</style>');}
$.post('/index.php?go=groups&act=delfeedback',{id:id,uid:uid});},editfeedback:function(uid){$('#close_editf'+uid).hide();$('#editf'+uid).show();$('#email'+uid).val($('#email'+uid).val().replace(', ',''));},editfeeddave:function(id,uid){var office=$('#office'+uid).val();var phone=$('#phone'+uid).val();var email=$('#email'+uid).val();$('#close_editf'+uid).show();$('#editf'+uid).hide();$('#okoffice'+uid).text(office);$('#okphone'+uid).text(phone);if(phone!=0&&email!=0)
$('#okemail'+uid).text(', '+email);else
$('#okemail'+uid).text(email);$.post('/index.php?go=groups&act=editfeeddave',{id:id,uid:uid,office:office,phone:phone,email:email});},checkFeedUser:function(){var upage=$('#upage').val();var pattern=new RegExp(/^[0-9]+$/);if(pattern.test(upage)){$.post('/index.php?go=groups&act=checkFeedUser',{id:upage},function(d){d=d.split('|');if(d[0]){if(d[1])
$('#feedimg').attr('src','/uploads/users/'+upage+'/100_'+d[1]);else
$('#feedimg').attr('src',template_dir+'/images/100_no_ava.png');$('#office').focus();}else{setErrorInputMsg('upage');$('#feedimg').attr('src',template_dir+'/images/contact_info.png');}});}else
$('#feedimg').attr('src',template_dir+'/images/contact_info.png');},saveinfo:function(id){var title=$('#title').val();var descr=$('#descr').val();var adres_page=$('#adres_page').val();var comments=$('#comments').val();var board=$('#board').val();var board=$('#board').val();var val_wall2=$('#val_wall2').val();$('#e_public_title').text(title);if(descr!=0){$('#descr_display').show();$('#e_descr').html(descr);}
if(!adres_page)var adres_page='public'+id;var pattern=new RegExp(/^[a-zA-Z0-9_-]+$/);if(pattern.test(adres_page)){butloading('pubInfoSave',55,'disabled');$.post('/index.php?go=groups&act=saveinfo',{id:id,title:title,descr:descr,comments:comments,board:board,adres_page:adres_page,val_wall2:val_wall2},function(d){if(d=='err_adres')
Box.Info('err','Ошибка','Такой адрес уже занят',130,1500);else
if($('#prev_adres_page').val()==adres_page)
groups.editformClose();else if(d=='no_new')
Page.Go('/public'+id);else
Page.Go('/'+adres_page);butloading('pubInfoSave',55,'enabled','Сохранить');});}else{setErrorInputMsg('adres_page');Box.Info('err','Ошибка','Вы можете изменить короткий адрес Вашей страницы на более удобный и запоминающийся. Для этого введите имя страницы, состоящее из латинских букв, цифр или знаков «_» .',300,5500);}},editform:function(){$('#edittab1').slideDown('fast');$('#public_editbg_container').animate({scrollLeft:"+560"});},editformClose:function(){$('#public_editbg_container').animate({scrollLeft:"-560"},1000);setTimeout("$('#edittab1').slideUp('fast')",200);$('#edittab2').hide();},edittab_admin:function(id){$('#edittab2').show();$('#public_editbg_container').animate({scrollLeft:"+1120"});},addadmin:function(id){var new_admin_id=$('#new_admin_id').val().replace('http://site.ru/u','');var check_adm=$('#admin'+new_admin_id).text();if(new_admin_id&&!check_adm){Box.Page('/index.php?go=groups&act=new_admin','new_admin_id='+new_admin_id,'new_admin_id',400,'Назначение руководителя','Закрыть','Назначить руководителем','groups.send_new_admin('+id+', '+new_admin_id+')',130,0,0,0,0,0);}else
addAllErr('Этот пользователь уже есть в списке руководителей.');},send_new_admin:function(id,new_admin_id){var ava=$('#adm_ava').attr('src');var adm_name=$('#adm_name').text();var data='<div class="public_oneadmin" id="admin'+new_admin_id+'"><a href="/u'+new_admin_id+'" onClick="Page.Go(this.href); return false"><img src="'+ava+'" align="left" width="32" /></a><a href="/u'+new_admin_id+'" onClick="Page.Go(this.href); return false">'+adm_name+'</a><br /><a href="/" onClick="groups.deladmin(''+id+'', ''+new_admin_id+''); return false"><small>Удалить</small></a></div>';$('#admins_tab').append(data);Box.Close();$('#new_admin_id').val('');$.post('/index.php?go=groups&act=send_new_admin',{id:id,new_admin_id:new_admin_id});},deladmin:function(id,uid){$('#admin'+uid).remove();$.post('/index.php?go=groups&act=deladmin',{id:id,uid:uid});},wall_send:function(id){var wall_text=$('#wall_text').val();var attach_files=$('#vaLattach_files').val();if(wall_text!=0||attach_files!=0){butloading('wall_send',56,'disabled');$.post('/index.php?go=groups&act=wall_send',{id:id,wall_text:wall_text,attach_files:attach_files,vote_title:$('#vote_title').val(),vote_answer_1:$('#vote_answer_1').val(),vote_answer_2:$('#vote_answer_2').val(),vote_answer_3:$('#vote_answer_3').val(),vote_answer_4:$('#vote_answer_4').val(),vote_answer_5:$('#vote_answer_5').val(),vote_answer_6:$('#vote_answer_6').val(),vote_answer_7:$('#vote_answer_7').val(),vote_answer_8:$('#vote_answer_8').val(),vote_answer_9:$('#vote_answer_9').val(),vote_answer_10:$('#vote_answer_10').val()},function(data){if($('#rec_num').text()=='Нет записей')
$('.albtitle').html('<b id="rec_num">1</b> запись');else
updateNum('#rec_num',1);$('#wall_text').val('');$('#attach_files').hide();$('#attach_files').html('');$('#vaLattach_files').val('');wall.form_close();wall.RemoveAttachLnk();butloading('wall_send',56,'enabled',lang_box_send);$('#public_wall_records').html(data);if($('#rec_num').text()>10){$('#page_cnt').val('1');$('#wall_all_records').show();$('#load_wall_all_records').html('к предыдущим записям');}});}else
setErrorInputMsg('wall_text');},wall_send_comm:function(rec_id,public_id){var wall_text=$('#fast_text_'+rec_id).val();if(wall_text!=0){butloading('fast_buts_'+rec_id,56,'disabled');$.post('/index.php?go=groups&act=wall_send_comm',{rec_id:rec_id,wall_text:wall_text,public_id:public_id},function(data){$('#fast_form_'+rec_id+', #fast_comm_link_'+rec_id).remove();$('#wall_fast_block_'+rec_id).html(data);var pattern=new RegExp(/news/i);if(pattern.test(location.href))$('#fast_text_'+rec_id+', #fast_inpt_'+rec_id).css('width','688px');});}else
setErrorInputMsg('fast_text_'+rec_id);},wall_delet:function(rec_id){$('#wall_record_'+rec_id).html('<span class="color777">Запись удалена.</span>');$('#wall_fast_block_'+rec_id+', .wall_fast_opened_form').remove();$('#wall_record_'+rec_id).css('padding-bottom','5px');myhtml.title_close(rec_id);updateNum('#rec_num');$.post('/index.php?go=groups&act=wall_del',{rec_id:rec_id});},comm_wall_delet:function(rec_id,public_id){$('#wall_fast_comment_'+rec_id).html('<div class="color777" style="margin-bottom:7px">Комментарий удалён.</div>');$.post('/index.php?go=groups&act=wall_del',{rec_id:rec_id,public_id:public_id});},wall_all_comments:function(rec_id,public_id){textLoad('wall_all_comm_but_'+rec_id);$('#wall_all_but_link_'+rec_id).attr('onClick','');$.post('/index.php?go=groups&act=all_comm',{rec_id:rec_id,public_id:public_id},function(data){$('#wall_fast_block_'+rec_id).html(data);var pattern=new RegExp(/news/i);if(pattern.test(location.href))$('#fast_text_'+rec_id+', #fast_inpt_'+rec_id).css('width','688px');});},wall_page:function(){var page_cnt=$('#page_cnt').val();var public_id=$('#public_id').val();$('#wall_all_records').attr('onClick','');if($('#load_wall_all_records').text()=='к предыдущим записям'&&$('#rec_num').text()>10){textLoad('load_wall_all_records');$.post('/index.php?go=public&pid='+public_id,{page_cnt:page_cnt},function(data){$('#public_wall_records').append(data);$('#page_cnt').val((parseInt($('#page_cnt').val())+1));if($('.wallrecord').size()==$('#rec_num').text()){$('#wall_all_records').hide();}else{$('#wall_all_records').attr('onClick','groups.wall_page(''+public_id+'')');$('#load_wall_all_records').html('к предыдущим записям');}});}},wall_attach_addphoto:function(id,page_num,public_id){wall.attach_menu('close','wall_attach','wall_attach_menu');if(page_num)
page='&page='+page_num;else{page='';page_num=1;}
Box.Page('/index.php?go=groups&act=photos','public_id='+public_id+page,'c_all_photos_'+page_num,627,lang_wall_attatch_photos,lang_box_canсel,0,0,400,1,0,1,0,1);},wall_attach_insert:function(type,data,action_url){if(!$('#wall_text').val())
wall.form_open();$('#attach_files').show();var attach_id=Math.floor(Math.random()*(1000-1+1))+1;if(type=='photo'){Box.Close('all_photos',1);res_attach_id='photo_'+attach_id;$('#attach_files').append('<span id="attach_file_'+res_attach_id+'" class="attach_file"><div class="wall_attach_photo fl_l"><div class="wall_attach_del" onMouseOver="myhtml.title(''+res_attach_id+'', ''+lang_wall_no_atttach+'', 'wall_photo_')" onMouseOut="myhtml.title_close(''+res_attach_id+'')" onClick="wall.attach_delete(''+res_attach_id+'', 'photo|'+action_url+'||')" id="wall_photo_'+res_attach_id+'"></div><img src="'+data+'" alt="" /></div></span>');$('#vaLattach_files').val($('#vaLattach_files').val()+'photo|'+action_url+'||');}
if(type=='video'){Box.Close('attach_videos');res_attach_id='video_'+attach_id;$('#attach_files').append('<span id="attach_file_'+res_attach_id+'" class="attach_file"><div class="wall_attach_photo fl_l"><div class="wall_attach_del" onMouseOver="myhtml.title(''+res_attach_id+'', ''+lang_wall_no_atttach+'', 'wall_photo_')" onMouseOut="myhtml.title_close(''+res_attach_id+'')" onClick="wall.attach_delete(''+res_attach_id+'', 'video|'+action_url+'||')" id="wall_photo_'+res_attach_id+'"></div><img src="'+data+'" alt="" /></div></span>');$('#vaLattach_files').val($('#vaLattach_files').val()+'video|'+action_url+'||');}
var count=$('.attach_file').size();if(count>9)
$('#wall_attach').hide();},wall_photo_view:function(rec_id,public_id,src,pos){var photo=$('#photo_wall_'+rec_id+'_'+pos).attr('src').replace('c_','');var size=$('.page_num'+rec_id).size();if(size==1){var topTxt='Просмотр фотографии';var next='Photo.Close(''); return false';}else{var topTxt='Фотография <span id="pTekPost">'+pos+'</span> из '+size;var next='groups.wall_photo_view_next('+rec_id+'); return false';}
var content='<div id="photo_view" class="photo_view" onClick="groups.wall_photo_view_setEvent(event)">'+'<div class="photo_close" onClick="Photo.Close(''); return false;"></div>'+'<div class="photo_bg cursor_pointer" onClick="'+next+'" style="min-height:400px">'+'<div class="photo_com_title" style="padding-top:0px;">'+topTxt+'<div><a href="/" onClick="Photo.Close(''); return false">Закрыть</a></div></div>'+'<div class="photo_img_box"><img src="'+photo+'" id="photo_view_src" style="margin-bottom:7px" /></div><div class="line_height">'+'<input type="hidden" id="photo_pos" value="'+pos+'" />'+'</div><div class="clear"></div>'+'</div>'+'<div class="clear"></div>'+'</div>';$('body').append(content);$('#photo_view').show();if(is_moz&&!is_chrome)scrollTopForFirefox=$(window).scrollTop();$('html, body').css('overflow-y','hidden');if(is_moz&&!is_chrome)$(window).scrollTop(scrollTopForFirefox);},wall_photo_view_next:function(rec_id){var pos=parseInt($('#photo_pos').val())+1;if($('#photo_wall_'+rec_id+'_'+pos).attr('src'))
var next_src=$('#photo_wall_'+rec_id+'_'+pos).attr('src').replace('c_','');else
var next_src=false;$('#photo_pos').val(pos);$('#pTekPost').text(pos);if(pos>$('.page_num'+rec_id).size()){$('#photo_pos').val('1');$('#pTekPost').text('1');var next_src=$('#photo_wall_'+rec_id+'_1').attr('src').replace('c_','');}
$('#photo_view_src').attr('src',next_src);},wall_photo_view_setEvent:function(event){var oi=(event.target)?event.target.id:((event.srcElement)?event.srcElement.id:null);if(oi=='photo_view')
Photo.Close('');},wall_video_add_box:function(){wall.attach_menu('close','wall_attach','wall_attach_menu');Box.Show('attach_videos',400,'Ссылка видеозаписи на Vk-demo','<div style="padding:15px;"><input type="text" placeholder="Введите ссылку видеозаписи на УдинБала.." class="videos_input" id="video_attach_lnk" style="width:355px;margin-top:10px" /></div>',lang_box_canсel,'Прикрпепить','groups.wall_video_add_select()');$('#video_attach_lnk').focus();},wall_video_add_select:function(){var video_attach_lnk=$('#video_attach_lnk').val().replace('http://'+location.host+'/video','');var data=video_attach_lnk.split('_');if(video_attach_lnk!=0){$('#box_loading').show();ge('box_butt_create').disabled=true;$.post('/index.php?go=groups&act=select_video_info',{video_id:data[1]},function(row){if(row==1){addAllErr('Неверный адрес видеозаписи');$('#box_loading').hide();ge('box_butt_create').disabled=false;}else{groups.wall_attach_insert('video','/uploads/videos/'+data[0]+'/'+row,row+'|'+data[1]+'|'+data[0]);$('#video_attach_lnk').val('');}});}else
setErrorInputMsg('video_attach_lnk');},wall_add_like:function(rec_id,user_id,type){if($('#wall_like_cnt'+rec_id).text())
var wall_like_cnt=parseInt($('#wall_like_cnt'+rec_id).text())+1;else{$('#public_likes_user_block'+rec_id).show();$('#update_like'+rec_id).val('1');var wall_like_cnt=1;}
var av=$('#avatis'+rec_id).val();$('#wall_like_cnt'+rec_id).html(wall_like_cnt).css('color','#2f5879');$('#wall_active_ic'+rec_id).addClass('public_wall_like_yes');$('#wall_like_link'+rec_id).attr('onClick','groups.wall_remove_like('+rec_id+', '+user_id+', ''+type+'');return false;');$('#likes_users'+rec_id).prepend(av);updateNum('#like_text_num'+rec_id,1);if(type=='uPages')
$.post('/index.php?go=wall&act=like_yes',{rid:rec_id});else
$.post('/index.php?go=groups&act=wall_like_yes',{rec_id:rec_id});},wall_remove_like:function(rec_id,user_id,type){var wall_like_cnt=parseInt($('#wall_like_cnt'+rec_id).text())-1;if(wall_like_cnt<=0){var wall_like_cnt='';$('#public_likes_user_block'+rec_id).hide();}
$('#wall_like_cnt'+rec_id).html(wall_like_cnt).css('color','#95adc0');$('#wall_active_ic'+rec_id).removeClass('public_wall_like_yes');$('#wall_like_link'+rec_id).attr('onClick','groups.wall_add_like('+rec_id+', '+user_id+', ''+type+'');return false;');$('.like_user'+user_id+'_'+rec_id).hide();$('#Xlike_user'+user_id+'_'+rec_id).hide();updateNum('#like_text_num'+rec_id);if(type=='uPages')
$.post('/index.php?go=wall&act=like_no',{rid:rec_id});else
$.post('/index.php?go=groups&act=wall_like_remove',{rec_id:rec_id});},wall_like_users_five:function(rec_id,type){$('.public_likes_user_block').hide();if(!ge('like_cache_block'+rec_id)&&$('#wall_like_cnt'+rec_id).text()&&$('#update_like'+rec_id).val()==0){if(type=='uPages'){$.post('/index.php?go=wall&act=liked_users',{rid:rec_id},function(data){$('#likes_users'+rec_id).html(data+'<span id="like_cache_block'+rec_id+'"></span>');$('#public_likes_user_block'+rec_id).show();});}else{$.post('/index.php?go=groups&act=wall_like_users_five',{rec_id:rec_id},function(data){$('#likes_users'+rec_id).html(data+'<span id="like_cache_block'+rec_id+'"></span>');$('#public_likes_user_block'+rec_id).show();});}}else
if($('#wall_like_cnt'+rec_id).text())
$('#public_likes_user_block'+rec_id).show();},wall_like_users_five_hide:function(){$('.public_likes_user_block').hide();},wall_all_liked_users:function(rid,page_num,liked_num){$('.public_likes_user_block').hide();if(page_num)
page='&page='+page_num;else{page='';page_num=1;}
if(!liked_num)
liked_num=1;Box.Page('/index.php?go=groups&act=all_liked_users','rid='+rid+'&liked_num='+liked_num+page,'all_liked_users_'+rid+page_num,525,lang_wall_liked_users,lang_msg_close,0,0,345,1,1,1,0,1);},wall_tell:function(rec_id){$('#wall_tell_'+rec_id).hide();myhtml.title_close(rec_id);$('#wall_ok_tell_'+rec_id).fadeIn(150);$.post('/index.php?go=groups&act=wall_tell',{rec_id:rec_id},function(data){if(data==1)
addAllErr(lang_wall_tell_tes);});},all_people:function(public_id,page_num){if(page_num)
page='&page='+page_num;else{page='';page_num=1;}
var num=$('#traf').text();Box.Page('/index.php?go=groups&act=all_people','public_id='+public_id+'&num='+num+page,'all_peoples_users_'+public_id+page_num,525,'Подписчики',lang_msg_close,0,0,345,1,1,1,0,1);},all_groups_user:function(for_user_id,page_num){if(page_num)
page='&page='+page_num;else{page='';page_num=1;}
var num=$('#groups_num').text();Box.Page('/index.php?go=groups&act=all_groups_user','for_user_id='+for_user_id+'&num='+num+page,'all_groups_users_'+for_user_id+page_num,525,'Интересные страницы',lang_msg_close,0,0,345,1,1,1,0,1);},inviteSet:function(i){var check=$('#user'+i).attr('class').replace('grIntiveUser','');var numCheck=parseInt($('#usernum2').text());var limit=50;if(!check){if(numCheck>=limit){Box.Info('load_photo_er','????N„??N€???°N†??N?','?’N‹ ?????¶?µN‚?µ ??N€?????»?°N???N‚N? ?? N??????±N‰?µN?N‚???? ???µ ?±???»?µ?µ '+limit+' ??N€N??·?µ?? ?·?° ???????? N€?°?·.',380,3000);return false;}
if(numCheck<=0)$('#usernum, #buttomDiv').fadeIn('fast');$('#usernum2').text(numCheck+1);$('#user'+i).addClass('grIntiveUserActive');$('#userInviteList').val($('#userInviteList').val()+'|'+i+'|');}else{$('#user'+i).removeClass('grIntiveUserActive');$('#userInviteList').val($('#userInviteList').val().replace('|'+i+'|',''));$('#usernum2').text(numCheck-1);if(parseInt($('#usernum2').text())<=0)$('#usernum, #buttomDiv').fadeOut('fast');}},inviteSend:function(i){var userInviteList=$('#userInviteList').val();butloading('invSending',160,'disabled');$.post('/index.php?go=groups&act=welcom',{id:i,ulist:userInviteList},function(d){Box.Info('load_photo_er','Сообщение','Приглашения успешно отправлены.',300);groups.closer();});},inviteFriendsPage:function(i){textLoad('load_invite_prev_ubut');$.post('/index.php?go=groups&act=more',{page_cnt:page_cnt_invite,id:i},function(d){page_cnt_invite=page_cnt_invite+20;$('#inviteUsers').append(d);$('#load_invite_prev_ubut').text('Показать больше друзей');if(!d)$('#invite_prev_ubut').remove();});},InviteOk:function(i){$('#action_'+i).html('<span class="color777">?’N‹ ??N?N‚N??????»?? ?? N??????±N‰?µN?N‚????.</span>');$.post('/index.php?go=groups&act=login',{id:i});},InviteNo:function(i){$('#action_'+i).html('<span class="color777">?YN€?????»?°N??µ?????µ ??N‚???»?????µ????.</span>');$.post('/index.php?go=groups&act=invite_no',{id:i});},invitePage:function(){if($('#load_gr_invite_prev_ubut').text()=='?Y?????°?·?°N‚N? ?±???»N?N??µ ??N€?????»?°N??µ??????'){textLoad('load_gr_invite_prev_ubut');$.post('/index.php?go=groups&act=invites',{page_cnt:page_cnt_invite_gr},function(d){page_cnt_invite_gr++;$('#preLoadedGr').append(d);$('#load_gr_invite_prev_ubut').text('?Y?????°?·?°N‚N? ?±???»N?N??µ ??N€?????»?°N??µ??????');if(!d)$('#gr_invite_prev_ubut').remove();});}}}
var audio={addBox:function(){Box.Close();Box.Show('addaudio',510,lang_audio_add,'<div class="videos_pad"><div class="buttonsprofile albumsbuttonsprofile buttonsprofileSecond" style="height:22px;margin-bottom:20px;margin-top:-5px"><div class="buttonsprofileSec cursor_pointer"><a><div><b>По ссылке</b></div></a></div><a class="cursor_pointer" onClick="audio.addBoxComp()"><div><b>С компьютера</b></div></a></div><div class="videos_text">Вставьте ссылку на mp3 файл</div><input type="text" class="videos_input" id="audio_lnk" style="margin-top:5px" /><span id="vi_info">Например: <b>http://music.com/uploads/files/audio/2012/faxo_-_kalp.mp3</b></span></div>',lang_box_canсel,lang_album_create,'audio.send()',0,0,1,1);$('#audio_lnk').focus();},addBoxComp:function(){Box.Close();Box.Show('addaudio_comp',510,lang_audio_add,'<div class="videos_pad"><div class="buttonsprofile albumsbuttonsprofile buttonsprofileSecond" style="height:22px;margin-bottom:20px;margin-top:-5px"><a onClick="audio.addBox()" class="cursor_pointer"><div><b>По ссылке</b></div></a><div class="buttonsprofileSec cursor_pointer"><a><div><b>С компьютера</b></div></a></div></div><div class="videos_text">Ограничения<div class="clear"></div><li style="font-weight:normal;color:#000;font-size:11px;margin-top:10px">Аудиофайл не должен превышать 10 Мб и должен быть в формате MP3.</li><li style="font-weight:normal;color:#000;font-size:11px;margin-bottom:15px">Аудиофайл не должен нарушать авторские права.</li><div class="button_div fl_l" style="margin-left:170px"><button id="upload">Выбрать файл</button></div><div class="clear"></div><div style="margin-top:15px;font-size:11px;color:#000;font-weight:normal">Вы также можете добавить аудиозапись из числа уже загруженных файлов, воспользовавшись <a href="/?go=search&type=5"><b>поиском по аудио.</b></a></div></div></div>',lang_box_canсel,lang_album_create,'audio.send()',0,0,1,1);$('#audio_lnk').focus();$('#box_but').hide();Xajax=new AjaxUpload('upload',{action:'/index.php?go=audio&act=upload',name:'uploadfile',onSubmit:function(file,ext){if(!(ext&&/^(mp3)$/.test(ext))){Box.Info('load_photo_er',lang_dd2f_no,'Аудиофайл должен быть в формате MP3.',250);return false;}
butloading('upload','73','disabled','');},onComplete:function(file,data){butloading('upload','73','enabled','Выбрать файл');if(data==1)
Box.Info('load_photo_er',lang_dd2f_no,'Аудиофайл не должен превышать 10 Мб и должен быть в формате MP3.',250);else{Box.Close();Page.Go('/audio');}}});},send:function(){var lnk=$('#audio_lnk').val();if(lnk!=0){$('#box_loading').show();ge('box_butt_create').disabled=true;$.post('/index.php?go=audio&act=send',{lnk:lnk},function(d){if(d){addAllErr(lang_audio_err);ge('box_butt_create').disabled=false;}else{Box.Close();Page.Go('/audio');}
$('#box_loading').hide();});}else
setErrorInputMsg('audio_lnk');},page:function(){var page_cnt=$('#page_cnt').val();var uid=$('#uid').val();$('#wall_all_records').attr('onClick','');if($('#load_wall_all_records').text()=='Показать больше аудиозаписей'){textLoad('load_wall_all_records');$.post('/index.php?go=audio&uid='+uid,{page_cnt:page_cnt},function(data){$('#audioPage').append(data);$('#page_cnt').val((parseInt($('#page_cnt').val())+1));if(!data){$('#wall_all_records').hide();}else{$('#wall_all_records').attr('onClick','audio.page()');$('#load_wall_all_records').html('Показать больше аудиозаписей');}});}},edit:function(aid,pid){if(pid)funcsave='PublicAudioEditsave('+aid+', '+pid+')';else funcsave='audio.editsave('+aid+')';Box.Show('edit'+aid,510,'Редактирование аудиозаписи','<div class="videos_pad"><div class="videos_text">Исполнитель</div><input type="text" class="videos_input" id="valartis'+aid+'" style="margin-bottom:15px" value="'+$('#artis'+aid).html()+'" /><div class="videos_text">Название</div><input type="text" class="videos_input" id="vaname'+aid+'" value="'+$('#name'+aid).html()+'" /></div>',lang_box_canсel,'Сохранить',funcsave,0,0,1,1);$('#audio_lnk').focus();},editsave:function(aid){if($('#valartis'+aid).val()!=0)
$('#artis'+aid).text($('#valartis'+aid).val());else
$('#artis'+aid).text('Неизвестный исполнитель');if($('#vaname'+aid).val()!=0)
$('#name'+aid).text($('#vaname'+aid).val());else
$('#name'+aid).text('Без названия');$.post('/index.php?go=audio&act=editsave',{aid:aid,artist:$('#valartis'+aid).val(),name:$('#vaname'+aid).val()});Box.Close();},del:function(aid){Page.Loading('start');$('.js_titleRemove').hide();$.post('/index.php?go=audio&act=del',{aid:aid},function(d){Page.Go('/audio');});},addMyList:function(aid){$('.js_titleRemove').hide();$('#atrack_'+aid).remove();$('#atrackAddOk'+aid).show();$.post('/index.php?go=audio&act=addmylist',{aid:aid});}}
var music={jPlayerInc:function(){var hs=location.hash.replace('#','');if(hs>=1&&hs<=3){$('#teck_id').val(hs);}
if($('#typePlay').val()=='standart'){$("#jquery_jplayer").jPlayer();}else{$("#jquery_jplayer").jPlayer({ready:function(){var musId=$('#music_'+$('#teck_id').val()).attr('data');var musName=$('#music_'+$('#teck_id').val()).text();$('.teck_track_name').text(musName);$("#jquery_jplayer").change(musId);if(hs>=1&&hs<=3){music.nullPlay();}},cssPrefix:"different_prefix_example"});}
$("#jquery_jplayer").jPlayerId("play","player_play");$("#jquery_jplayer").jPlayerId("pause","player_pause");$("#jquery_jplayer").jPlayerId("stop","player_stop");$("#jquery_jplayer").jPlayerId("loadBar","player_progress_load_bar");$("#jquery_jplayer").jPlayerId("playBar","player_progress_play_bar");$("#jquery_jplayer").jPlayerId("volumeMin","player_volume_min");$("#jquery_jplayer").jPlayerId("volumeMax","player_volume_max");$("#jquery_jplayer").jPlayerId("volumeBar","player_volume_bar");$("#jquery_jplayer").jPlayerId("volumeBarValue","player_volume_bar_value");$("#jquery_jplayer").onProgressChange(function(loadPercent,playedPercentRelative,playedPercentAbsolute,playedTime,totalTime){var myPlayedTime=new Date(playedTime);var ptMin=(myPlayedTime.getMinutes()<10)?"0"+myPlayedTime.getMinutes():myPlayedTime.getMinutes();var ptSec=(myPlayedTime.getSeconds()<10)?"0"+myPlayedTime.getSeconds():myPlayedTime.getSeconds();if($('#typePlay').val()=='standart')
$("#play_time"+$('#teck_prefix').val()+$('#teck_id').val()).text(ptMin+":"+ptSec);else
$("#play_time").text(ptMin+":"+ptSec);var myTotalTime=new Date(totalTime);var ttMin=(myTotalTime.getMinutes()<10)?"0"+myTotalTime.getMinutes():myTotalTime.getMinutes();var ttSec=(myTotalTime.getSeconds()<10)?"0"+myTotalTime.getSeconds():myTotalTime.getSeconds();if(ttSec<=0)ttSec='';if(ptMin+ptSec==ttMin+ttSec){music.next();}});},newStartPlay:function(id,prefix){if(!prefix)var prefix='';if($('#typePlay').val()=='standart'){$('#ppbarPro'+$('#teck_prefix').val()+$('#teck_id').val()).html('').hide();$("#play_time"+$('#teck_prefix').val()+$('#teck_id').val()).hide();$('#ppbarPro'+prefix+id).html('<div id="player_progress_load_bar" onClick="$('#jquery_jplayer').loadBar(event)" style="height:5px"><div id="player_progress_play_bar" style="height:5px"></div></div>').show();$("#play_time"+prefix+id).show();}else{if(!prefix){var size=$('.audio_onetrack').size();var randId=Math.floor(Math.random()*size);if(randId==0)randId=1;if($('#rand').val()==1)
id=randId;var idUload=size-7;if(id>=idUload)
audio.page();}}
if($('#refresh').val()>0){$('#jquery_jplayer').stop();$('#jquery_jplayer').play();$('#icPlay_'+$('#teck_id').val()).addClass('audio_stopic').attr('onClick','$('#jquery_jplayer').pause(); music.pause()');}else{if($('#teck_prefix').val())
$('#icPlay_'+$('#teck_prefix').val()+$('#teck_id').val()).removeClass('audio_stopic').attr('onClick','music.newStartPlay('+$('#teck_id').val()+', '+$('#teck_prefix').val()+')');else
$('#icPlay_'+$('#teck_prefix').val()+$('#teck_id').val()).removeClass('audio_stopic').attr('onClick','music.newStartPlay('+$('#teck_id').val()+')');$('#teck_id').val(id);$('#jquery_jplayer').stop();$('#icPlay_'+prefix+id).addClass('audio_stopic').attr('onClick','$('#jquery_jplayer').pause(); music.pause()');$('#teck_prefix').val(prefix);if($('#music_'+prefix+$('#teck_id').val()).attr('data')){var musId=$('#music_'+prefix+$('#teck_id').val()).attr('data');var musName=$('#music_'+prefix+$('#teck_id').val()).text();$('.teck_track_name').text(musName);$("#jquery_jplayer").change(musId);$('#jquery_jplayer').play();}else
music.newStartPlay(1,$('#teck_prefix').val());}},next:function(){$('#icPlay_'+$('#teck_prefix').val()+$('#teck_id').val()).removeClass('audio_stopic');if($('#teck_prefix').val()){var size=$('.audioForSize'+$('#teck_prefix').val()).size();if(size>1&&$('#teck_id').val()<size){music.newStartPlay((parseInt($('#teck_id').val())+1),$('#teck_prefix').val());}else{$('#ppbarPro'+$('#teck_prefix').val()+$('#teck_id').val()).html('').hide();$("#play_time"+$('#teck_prefix').val()+$('#teck_id').val()).hide();$('#icPlay_'+$('#teck_prefix').val()+$('#teck_id').val()).removeClass('audio_stopic').attr('onClick','music.newStartPlay('+$('#teck_id').val()+', '+$('#teck_prefix').val()+')');}}else
music.newStartPlay((parseInt($('#teck_id').val())+1));},prev:function(){$('#icPlay_'+$('#teck_prefix').val()+$('#teck_id').val()).removeClass('audio_stopic');music.newStartPlay((parseInt($('#teck_id').val())-1));},pause:function(){$('#icPlay_'+$('#teck_prefix').val()+$('#teck_id').val()).removeClass('audio_stopic').attr('onClick','music.proceed()');},proceed:function(){$('#jquery_jplayer').play();$('#icPlay_'+$('#teck_prefix').val()+$('#teck_id').val()).addClass('audio_stopic').attr('onClick','$('#jquery_jplayer').pause(); music.pause()');},nullPlay:function(){$('#icPlay_'+$('#teck_id').val()).addClass('audio_stopic').attr('onClick','$('#jquery_jplayer').pause(); music.pause()');$('#jquery_jplayer').play();},nullPause:function(){$('#icPlay_'+$('#teck_id').val()).removeClass('audio_stopic').attr('onClick','music.nullPlay()');$('#jquery_jplayer').pause();},volumeOff:function(){$('.player_del_volume').css('opacity','1');$('.player_max_volume').css('opacity','0.5');$('#jquery_jplayer').volume(0);},volumeMax:function(){$('.player_del_volume').css('opacity','0.5');$('.player_max_volume').css('opacity','1');$('#jquery_jplayer').volume(100);},volume:function(){$('.player_max_volume, .player_del_volume').css('opacity','0.5');},refresh:function(){$('.player_refresh').css('opacity','1').attr('onClick','music.refreshOff()');$('#refresh').val($('#teck_id').val());music.randOff();},refreshOff:function(){$('.player_refresh').css('opacity','0.5').attr('onClick','music.refresh()');$('#refresh').val(0);},randOn:function(){$('.player_rand').css('opacity','1').attr('onClick','music.randOff()');$('#rand').val(1);music.refreshOff();},randOff:function(){$('.player_rand').css('opacity','0.5').attr('onClick','music.randOn()');$('#rand').val(0);}}
var i=0;var vii_typograf_delay=false;var vii_msg_te_val='';var vii_typograf=true;var im={typograf:function(){var for_user_id=$('#for_user_id').val();var a=$('#msg_text').val();if(vii_typograf){$.post('/index.php?go=im&act=typograf',{for_user_id:for_user_id});vii_typograf=false;}
if(!vii_typograf){0==vii_msg_te_val!=a&&a!=0<a.length&&(clearInterval(vii_typograf_delay),vii_typograf_delay=setInterval(function(){$.post('/index.php?go=im&act=typograf&stop=1',{for_user_id:for_user_id});vii_typograf=true;},3000));}},online:function(){$.post('/index.php?go=im&act=online',function(d){$('.im_flblock').html(d);});},all:function(){$.post('/index.php?go=im&act=all',function(d){$('.im_flblock').html(d);});},settTypeMsg:function(){Page.Loading('start');$.post('/index.php?go=messages&act=settTypeMsg',function(d){Page.Go('/messages');});},open:function(uid){$('.im_oneusr').removeClass('im_usactive');$('#dialog'+uid).addClass('im_usactive');$('#imViewMsg').html('<img src="'+template_dir+'/images/loading_im.gif" style="margin-left:225px;margin-top:220px" />');$.post('/index.php?go=im&act=history',{for_user_id:uid},function(d){$('#imViewMsg').html(d);$('.im_scroll').append('<div class="im_typograf"></div>').scrollTop(99999);var aco=$('.im_usactive').text().split(' ');$('.im_typograf').html('<div class="no_display" id="im_typograf"><img src="'+template_dir+'/images/typing.gif" /> '+aco[0]+' набирает сообщение..</div>');$('#msg_text').focus();});},read:function(msg_id,auth_id,my_id){if(auth_id!=my_id){var msg_num=parseInt($('#new_msg').text().replace(')','').replace('(',''))-1;$.post('/index.php?go=im&act=read',{msg_id:msg_id},function(){if(msg_num>0)
$('#new_msg').html("+"+msg_num);else
$('#new_msg').html('');updateNum('#msg_num'+auth_id);if($('#msg_num'+auth_id).text()<=0)
$('#msg_num'+auth_id).hide();$('#imMsg'+msg_id).css('background','#fff').attr('onMouseOver','');});}},send:function(for_user_id,my_name,my_ava){var msg_text=$('#msg_text').val();var attach_files=$('#vaLattach_files').val();if(msg_text!=0&&$('#status_sending').val()==1||attach_files!=0){butloading('sending',56,'disabled');$('#status_sending').val('0');$.post('/index.php?go=im&act=send',{for_user_id:for_user_id,my_name:my_name,my_ava:my_ava,msg:msg_text,attach_files:attach_files},function(data){if(data=='err_privacy')
Box.Info('msg_info',lang_pr_no_title,lang_pr_no_msg,400,4000);else{$('#im_scroll').append(data);$('.im_scroll').scrollTop(99999);$('#msg_text, #vaLattach_files').val('');$('#attach_files').html('');$('#msg_text').focus();$('#status_sending').val('1');butloading('sending',56,'enabled','Отправить');}});}else
setErrorInputMsg('msg_text');},delet:function(mid,folder){$('.js_titleRemove, #imMsg'+mid).remove();$.post('/index.php?go=messages&act=delet',{mid:mid,folder:folder});},update:function(){var for_user_id=$('#for_user_id').val();var last_id=$('.im_msg:last').attr('id').replace('imMsg','');$.post('/index.php?go=im&act=update',{for_user_id:for_user_id,last_id:last_id},function(d){if(d.length!='49'&&d!='no_new'){$('#im_scroll').html(d);$('.im_scroll').scrollTop(99999);}
if(d.length==49)$('#im_typograf').fadeIn();else $('#im_typograf').fadeOut()});},page:function(for_user_id){var first_id=$('.im_msg:first').attr('id').replace('imMsg','');$('#wall_all_records').attr('onClick','');if($('#load_wall_all_records').text()=='Показать предыдущие сообщения'){textLoad('load_wall_all_records');$.post('/index.php?go=im&act=history',{first_id:first_id,for_user_id:for_user_id},function(data){i++;var imHeiah=$('.im_scroll').height();$('#prevMsg').html('<div id="appMsgFScroll'+i+'" class="no_display">'+data+'</div>'+$('#prevMsg').html());$('.im_scroll').scrollTop($('#appMsgFScroll'+i).show().height()+imHeiah);if(!data){$('#wall_all_records').hide();}else{$('#wall_all_records').attr('onClick','im.page('+for_user_id+')');$('#load_wall_all_records').html('Показать предыдущие сообщения');}});}},box_del:function(u){Box.Show('im_del'+u,350,'Удалить все сообщения','<div style="padding:15px;" id="del_status_text_im">Вы действительно хотите удалить всю переписку с данным пользователем?<br /><br />Отменить это действие будет невозможно.</div>',lang_box_canсel,lang_box_yes,'im.del('+u+')');},del:function(u){$('#box_loading').show();ge('box_butt_create').disabled=true;$('#del_status_text_im').text('Переписка удаляется..');$.post('/index.php?go=im&act=del',{im_user_id:u},function(d){Box.Close('im_del'+u);Box.Info('ok_im','История переписки удалена','Все сообщения диалога были успешно удалены.',300,3000);$('#okim'+u).remove();});},updateDialogs:function(){$.post('/index.php?go=im&act=upDialogs',function(d){$('#updateDialogs').html(d);});}}
var Distinguish={Start:function(id){var x1w=$('#ladybug_ant'+id).width();var y1h=$('#ladybug_ant'+id).height();var scH=$(window).height();var scW=$(window).width();$('#i_left'+id).val('30');$('#i_top'+id).val('30');$('#i_width'+id).val(x1w);$('#i_height'+id).val(y1h);$('#ladybug_ant'+id).css('cursor','crosshair');if(!$('.distin_friends_list').text()){$('#friends_block').remove();$('html, body').append('<div id="friends_block"><div class="box_title">Введите имя<div class="box_close" onClick="Distinguish.Close('+id+')"></div></div><div class="distin_inpbg"><input type="text" id="filter" class="inpst" maxlength="50" value="" style="width:160px;" /></div><div class="distin_friends_list"><center><img src="/templates/Default/images/loading_mini.gif" style="margin-top:10px;margin-bottom:10px" /></center></div><div class="distin_inpbg"><div class="button_div fl_l"><button onClick="Distinguish.SelectUser(0, 0, '+id+', 0); return false">Добавить</button></div><div class="button_div_gray fl_l margin_left"><button onClick="Distinguish.Close('+id+'); return false;" >Отмена</button></div><div class="clear"></div></div></div>');}
$('#ladybug_ant'+id).imgAreaSelect({handles:true,onSelectEnd:function(img,selection){var pvW=$('#ladybug_ant'+id).position().left+selection.x1+selection.width+20;var pvH=$('#ladybug_ant'+id).position().top+selection.y1;$('#i_left'+id).val(selection.x1);$('#i_top'+id).val(selection.y1);$('#i_width'+id).val(selection.width);$('#i_height'+id).val(selection.height);$('#friends_block').css('margin-left',pvW+'px').css('top','0px').css('margin-top',pvH+'px').fadeIn(400);$('#filter').focus();if(!$('.distin_friends_list').text()){$.post('/index.php?go=distinguish&act=load_friends',{photo_id:id},function(d){$('.distin_friends_list').html(d).css('padding-bottom','3px').css('padding-top','3px');});}},onSelectChange:function(){$('#friends_block').hide();}});},ShowTag:function(left,top,width,height,id){Distinguish.HideTag();var imgHeight=$('#ladybug_ant'+id).height();var imgWidth=$('#ladybug_ant'+id).width();var aTop=$('#ladybug_ant'+id).position().top;var aLeft=$('#ladybug_ant'+id).position().left;if(aTop<56)
if($('#mark_userid_bg'+id).text())var aTop=114;else var aTop=55;if(aLeft<0)var aLeft=0;$('#distinguishSettings_left'+id).css('width',left+'px').css('height',imgHeight+'px').css('left',aLeft+'px');$('#distinguishSettings_top'+id).css('height',top+'px').css('width',(imgWidth-left)+'px').css('left',(aLeft+left)+'px');$('#distinguishSettings_right'+id).css('left',(width+aLeft+left)+'px').css('height',(imgHeight-top)+'px').css('width',(imgWidth-left-width)+'px').css('top',(aTop+top)+'px');$('#distinguishSettings_bottom'+id).css('top',(aTop+height+top)+'px').css('width',width+'px').css('height',(imgHeight-height-top)+'px').css('left',(aLeft+left)+'px');$('#distinguishSettingsBorder_left'+id).css('width',left+'px').css('height',height+'px').css('top',(aTop+top)+'px').css('left',aLeft+'px');$('#distinguishSettingsBorder_top'+id).css('width',width+'px').css('height',top+'px').css('left',(aLeft+left)+'px');$('#distinguishSettingsBorder_right'+id).css('left',(width+aLeft+left-3)+'px').css('height',height+'px').css('width',(imgWidth-left-width)+'px').css('top',(aTop+top)+'px');$('#distinguishSettingsBorder_bottom'+id).css('top',(aTop+height+top-3)+'px').css('width',width+'px').css('height',(imgHeight-height-top)+'px').css('left',(aLeft+left)+'px');$('#distinguishSettings'+id).show();},HideTag:function(id){$('#distinguishSettings'+id).hide();},Close:function(id){$('#ladybug_ant'+id).css('cursor','pointer');$('#friends_block').hide();$('#ladybug_ant'+id).imgAreaSelect({remove:true});},GeneralClose:function(){$('#friends_block, .distin_friends_list').remove();$('.distinguishSettings').hide();$('.ladybug_ant').css('cursor','pointer');$('.ladybug_ant').imgAreaSelect({remove:true});},FriendPage:function(page,photo_id){$.post('/index.php?go=distinguish&act=load_friends',{page:page,photo_id:photo_id},function(d){$('.distin_friends_list').append(d);});},SelectUser:function(user_id,user_name,photo_id,no_user){if(!user_name)var user_name=$('#filter').val();var i_left=$('#i_left'+photo_id).val();var i_top=$('#i_top'+photo_id).val();var i_width=$('#i_width'+photo_id).val();var i_height=$('#i_height'+photo_id).val();var size=$('.one_dis_user'+photo_id).size();if(size>=1){var comma='<div class="fl_l" style="margin-right:4px">, </div>';var comma2='';}else{var comma='';var comma2='<div class="fl_l" id="peopleOnPhotoText'+photo_id+'" style="margin-right:5px">На этой фотографии:</div>';}
Distinguish.Close(photo_id);Distinguish.Start(photo_id);if(no_user!=0){var lnk='<a href="/u'+user_id+'" id="selected_us_'+user_id+photo_id+'" onClick="Page.Go(this.href); return false" onMouseOver="Distinguish.ShowTag('+i_left+', '+i_top+', '+i_width+', '+i_height+', '+photo_id+')" onMouseOut="Distinguish.HideTag('+photo_id+')" class="one_dis_user'+photo_id+'">';var lnk_end='</a>';var user_ok='yes';}else{var lnk='<span style="color:#000" onMouseOver="Distinguish.ShowTag('+i_left+', '+i_top+', '+i_width+', '+i_height+', '+photo_id+')" onMouseOut="Distinguish.HideTag('+photo_id+')" class="one_dis_user'+photo_id+'">';var lnk_end='</span>';var user_id=0;var user_ok='no';}
if($('#selected_us_'+user_id+photo_id).text())
$('#selected_us_'+user_id+photo_id).attr('onMouseOver','Distinguish.ShowTag('+i_left+', '+i_top+', '+i_width+', '+i_height+', '+photo_id+')');else
$('#peoples_on_this_photos'+photo_id).append(comma2+'<span id="selectedDivIser'+user_id+photo_id+'">'+comma+'<div class="fl_l">'+lnk+user_name+lnk_end+'</div><div class="fl_l"><img src="/templates/Default/images/hide_lef.gif" class="distin_del_user" title="Удалить отметку" onClick="Distinguish.DeletUser('+user_id+', '+photo_id+')" /></div></span>');$('#filter').val('');$('.echoUsersList').show();if(user_ok=='yes')var user_name='';$.post('/index.php?go=distinguish&act=mark',{i_left:i_left,i_top:i_top,i_width:i_width,i_height:i_height,photo_id:photo_id,user_id:user_id,user_name:user_name,user_ok:user_ok});},DeletUser:function(user_id,photo_id,user_name){$('#mark_userid_bg'+photo_id).remove().text('');$('#selectedDivIser'+user_id+photo_id).remove();var size=$('.one_dis_user'+photo_id).size();if(size<=0)$('#peopleOnPhotoText'+photo_id).remove();if(user_name)var user_id=0;$.post('/index.php?go=distinguish&act=mark_del',{photo_id:photo_id,user_id:user_id,user_name:user_name});},OkUser:function(photo_id){$('#mark_userid_bg'+photo_id).remove().text('');$.post('/index.php?go=distinguish&act=mark_ok',{photo_id:photo_id});}}
var HappyFr={Show:function(){$('.profile_block_happy_friends').css('max-height',(($('.profile_onefriend_happy').size()-4)/2)*190+190+'px');$('#happyAllLnk').attr('onClick','HappyFr.Close()');$('.profile_block_happy_friends_lnk').text('Скрыть');},Close:function(){$('.profile_block_happy_friends').css('max-height','190px');$('#happyAllLnk').attr('onClick','HappyFr.Show()');$('.profile_block_happy_friends_lnk').text('Показать все');},HideSess:function(){$('.js_titleRemove').remove();$('#happyBLockSess').hide();$.post('/index.php?go=happy_friends_block_hide');}}
var vii_search_delay=false;var vii_search_val='';var FSE={Txt:function(){var a=$('#query').val();if(a.length>43){tch='..';nVal=a.substring(0,43);}else{tch='';nVal=a;}
$('#fast_search_txt').text(nVal+tch);0==a.length?$(".fast_search_bg").hide():vii_search_val!=a&&a!=0<a.length&&(clearInterval(vii_search_delay),vii_search_delay=setInterval(function(){FSE.GoSe(a);},600));if(a!=0)
$(".fast_search_bg").show();},GoSe:function(val){clearInterval(vii_search_delay);if(val!=0){if($('#se_type').val()==1||$('#se_type').val()==2||$('#se_type').val()==4){$.post('/index.php?go=fast_search',{query:val,se_type:$('#se_type').val()},function(d){$('#reFastSearch').html(d);});}else
$('#reFastSearch').html('');}else{$(".fast_search_bg").hide();$('#reFastSearch').html('');}
vii_search_val=val;},ClrHovered:function(id){for(i=0;i<=8;i++){$('#all_fast_res_clr'+i).css('background','#fff');}
$('#'+id).css('background','#eef3f5');}}
var Report={Box:function(act,id){Box.Close();if(act=='photo')lang_report='Жалоба на фотографию';else if(act=='video')lang_report='Жалоба на видеозапись';else if(act=='note')lang_report='Жалоба на заметку';else lang_report='';Box.Show('report',400,lang_report,'<div class="report_pad">Пожалуйста, выберите причину, по которой Вы хотите сообщить администрации сайта об этом материале.<div class="clear"></div><br /><select id="type_report" class="inpst" style="width:212px" onChange="if(this.value > 1) {$('#report_comm_block').show();$('#text_report').focus()} else {$('#report_comm_block').hide();$('#text_report').val('')}"><option value="1">Материал для взрослых</opyion><option value="2">Детская порнография</opyion><option value="3">Эктремизм</opyion><option value="4">Насилие</opyion><option value="5">Пропаганда наркотиков</opyion></select><div class="clear"></div><div id="report_comm_block" class="no_display"><br />Комментарий:<br /><br /><textarea id="text_report" class="inpst" style="width:200px;height:80px"></textarea></div></div>',lang_msg_close,lang_box_send,'Report.Send(''+act+'', '+id+')');$('#audio_lnk').focus();$('#video_object').hide();},Send:function(act,id){$('#box_loading').show();ge('box_butt_create').disabled=true;$.post('/index.php?go=report',{act:act,id:id,type_report:$('#type_report').val(),text_report:$('#text_report').val()},function(d){Box.Close();Box.Info('yes_report','Спасибо','Ваша жалоба отправлена администрации сайта и будет рассмотрена в ближайшее время.',300,3000);$('#video_object').show();});},WallSend:function(act,id){$('#wall_record_'+id).html('<div class="color777">Сообщение помечено как спам.</div>');$('#wall_fast_block_'+id).remove();$('.js_titleRemove').remove();$.post('/index.php?go=report',{act:act,id:id});}}
var Repost={Box:function(rec_id,g_tell){Box.Page('/index.php?go=repost&act=all','rec_id='+rec_id,'repost',430,'Отправка записи',lang_box_canсel,'Поделиться записью','Repost.Send('+rec_id+', '+g_tell+')',0,0,0,0,'comment_repost');},Send:function(rec_id,g_tell){comm=$('#comment_repost').val();type=$('#type_repost').val();if(type==1)cas='for_wall';else if(type==2)
if(g_tell)cas='groups_2';else cas='groups';else if(type==3)cas='message';else cas='';$('#box_loading').show();ge('box_butt_create').disabled=true;$.post('/index.php?go=repost&act='+cas,{rec_id:rec_id,comm:comm,sel_group:$('#sel_group').val(),g_tell:g_tell,for_user_id:$('#for_user_id').val()},function(d){if(d==1){$('#box_loading').hide();ge('box_butt_create').disabled=false;addAllErr(lang_wall_tell_tes);}else{if(type==1)Box.Info('yes_report','Запись отправлена.','Теперь эта запись появится в новостях у Ваших друзей.',300,2500);if(type==2)Box.Info('yes_report','Запись отправлена.','Теперь эта запись появится на странице сообщества.',300,2500);if(type==3)Box.Info('yes_report','Сообщение отправлено.','Ваше сообщение отправлено.',300,2500);Box.Close();}});}}
var Doc={AddAttach:function(name,id){if(!$('#wall_text').val())wall.form_open();$('#attach_files').show();attach_id=Math.floor(Math.random()*(1000-1+1))+1;Box.Close();ln=name.length;if(ln>50)name=name.substring(0,12)+'..'+name.substring(ln-4,ln);res_attach_id='doc_'+attach_id;$('#attach_files').append('<div style="padding-bottom:6px;padding-top:6px;display:block;width:100%" id="attach_file_'+res_attach_id+'" class="attach_file" ><div class="doc_attach_ic fl_l"></div><div class="doc_attach_text"><div class="fl_l">'+name+'</div><img class="fl_l cursor_pointer" style="margin-top:2px;margin-left:5px" src="'+template_dir+'/images/close_a.png" onMouseOver="myhtml.title(''+res_attach_id+'', ''+lang_wall_no_atttach+'', 'wall_doc_')" id="wall_doc_'+res_attach_id+'" onClick="wall.attach_delete(''+res_attach_id+'', 'doc|'+id+'||')" /></div><div class="clear"></div></div><div class="clear"></div>');$('#vaLattach_files').val($('#vaLattach_files').val()+'doc|'+id+'||');if($('.attach_file').size()>9)$('#wall_attach').hide();},Del:function(did){$('.js_titleRemove').remove();$('#doc_block'+did).html('Документ был удалён.');updateNum('#upDocNum');langNumric('langNumric',$('#upDocNum').text(),'документ','документа','документов','документ','документов');$.post('/index.php?go=doc&act=del',{did:did});},ShowEdit:function(did,id){$('#'+id+', #data_doc'+did).hide();$('#edit_doc_tab'+did).show();},CloseEdit:function(did,id){$('#'+id+', #data_doc'+did).show();$('#edit_doc_tab'+did).hide();},SaveEdit:function(did,id){if($('#edit_val'+did).val()!=0){$('#edit_doc_name'+did).text($('#edit_val'+did).val());$('#'+id+', #data_doc'+did).show();$('#edit_doc_tab'+did).hide();$.post('/index.php?go=doc&act=editsave',{did:did,name:$('#edit_val'+did).val()});}else
setErrorInputMsg('edit_val'+did);}}
var Votes={AddInp:function(){$('#answerNum').val(parseInt($('#answerNum').val())+1);$('#addAnswerInp').append('<div id="div_inp_answr_'+$('#answerNum').val()+'"><div class="texta"> </div><input type="text" id="vote_answer_'+$('#answerNum').val()+'" class="inpst vote_answer" maxlength="80" value="" style="width:355px;margin-left:5px" /><div class="mgclr"></div></div>');if($('#answerNum').val()==10)$('#addNewAnswer').html('добавить');if($('#answerNum').val()>2)$('#addDelAnswer').html('<a class="cursor_pointer" onClick="Votes.DelInp()">удалить</a>');$('#vote_answer_'+$('#answerNum').val()).focus();},DelInp:function(id){if($('#answerNum').val()>2){$('#answerNum').val(parseInt($('#answerNum').val())-1);$('#div_inp_answr_'+$('.vote_answer:last').attr('id').replace('vote_answer_','')).remove();$('#addNewAnswer').html('<a class="cursor_pointer" onClick="Votes.AddInp()">добавить</a>');}
if($('#answerNum').val()==2)$('#addDelAnswer').html('удалить');},RemoveForAttach:function(){$('#vaLattach_files').val($('#vaLattach_files').val().replace('vote|start||',''));$('.js_titleRemove').remove();$('#attach_block_vote').hide();$('#vote_title, #vote_answer_1, #vote_answer_2').val('');$('#addNewAnswer').html('<a class="cursor_pointer" onClick="Votes.AddInp()">добавить</a>');$('#addDelAnswer').html('удалить');$('#attatch_vote_title').text('');$('#answerNum').val('2');for(i=2;i<=10;i++)
$('#div_inp_answr_'+i).remove();},Send:function(answer_id,vote_id){$('#answer_load'+answer_id).append('<img src="'+template_dir+'/images/loading_mini.gif" style="margin-left:5px" />');for(i=0;i<=10;i++)
$('#wall_vote_oneanswe'+i).attr('onClick','');$.post('/index.php?go=votes',{vote_id:vote_id,answer_id:answer_id},function(d){$('#result_vote_block'+vote_id).html(d);});}}
?>