(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return!!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return!!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return+new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return!o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return-1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return!!T.firstChild},empty:function(T){return!T.firstChild},has:function(V,U,T){return!!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex"in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return!F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<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>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();var player=null;var duration=0;var mouse_play_volume=0;var mouse_volume=50;var current_radio_page=1;var current_radio_sort='rate';var current_radio_ord='d';var global_country_id=3159;var is_player_stoped=true;var radio_timeout;var player_sort=false;var player_circle=false;var player_show_page=false;var player_from=0;var player_position=0;var comment_area_id='comment_single_area';var now_update=false;var currentState=document.location.hash;var current_play_history_id=-1;var current_play_list_element_id=-1;var current_plater_song_id=-1;var last_selected_pl_id=0;var current_music_position='main';var current_music_page=1;var current_music_sort='date';var current_music_ord='desc';var current_music_start_date='01.01.1980';var current_music_end_date='';var current_music_author='Исполнитель';var current_music_name='Композиция';var current_music_styles='';var current_playlists_position='main';var current_playlists_page=1;var current_playlists_sort='publish_date';var current_playlists_ord='desc';var current_playlists_user='Пользователь';var current_playlists_name='Название';var current_playlists_decsription='Описание';var current_playlists_styles='';var current_top_flag='topsorttoday';var current_news_page=1;var current_news_sort='date';var current_news_ord='desc';var current_news_start_date='01.01.2010';var current_news_end_date='';var current_news_title='Содержит';var current_news_categories='';var user_id_gal=0;var curr_user_gl=0;var loaded_galery=0;var loaded_pict=0;var max_queue_photos=0;var add_file_hash='';var def_ent=0;function load_page(page_name){switch(page_name){case'radio':generate_radio_page(current_radio_page);break;case'relax':show_alert('ОШИБКА','<br /><br />Раздел Meelelahutus будет реализован позже.<br/>(Meelelahutus c эстонского - развлечения.<br /> Там будут люди, группы, галереи)<br />Почему с эстонского? Да ну как не упомянуть эту нацию, да и <small class="blue">"МЕЭЛЕЛАХУТУС сегодня?"</small> как то по новому. xD');break;case'forum':show_alert('ОШИБКА','<br /><br /><br />Раздел с форумом будет реализован позже.');break;case'clubs':show_alert('ОШИБКА','<br /><br /><br />Раздел "Клубы" в процессе.');break;case'news':generate_news_page();break;case'music':generate_music_page();break;case'add_single':generate_add_file_page();break;case'register':generate_registration_page();break;case'profile':generate_profile_page();break;case'home':generate_index_page();break;case'exit':exit_login();break;case'enter':show_login_page();break;case'playlists':generate_playlist_page();break;}}
function reloadProcessor(gosub){if((document.location.href==request_0)||(document.location.href==request_0+'#')){if(typeof(gosub)!='undefined'){if(gosub==2){generate_index_page();}}
return true;}
if(str_replace(urldecode(document.location.hash),'',str_replace(request_0,'',urldecode(document.location.href))).length==0){s='';if(substr(document.location.hash,0,1)=='#'){arr=split('-',substr(document.location.hash,1));if(arr.length>0){switch(arr[0])
{case'rules':document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Загружаю...</b></center>');generate_rules_page();break;case'edit_friends':document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Загружаю...</b></center>');generate_edit_friends();break;case'edit_present':document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Загружаю...</b></center>');generate_edit_present();break;case'edit_playlists':document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Загружаю...</b></center>');generate_edit_playlists();break;case'edit_photo':document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Загружаю...</b></center>');generate_edit_photo();break;case'profile':document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Загружаю...</b></center>');generate_profile_page();break;case'register':document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Загружаю...</b></center>');generate_registration_page();break;case'add_single':document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Загружаю...</b></center>');generate_add_file_page();break;case'edit_wall':document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Загружаю...</b></center>');generate_edit_wall();break;case'login':show_login_page();break;case'singles':document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Загружаю...</b></center>');if(arr.length>1){song_id=arr[1];}else return true;if(arr.length>2){page_id=arr[2];}else page_id=1;generate_song_page(song_id,page_id);break;case'news_single':document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Загружаю...</b></center>');if(arr.length>1){n_id=arr[1];}else return true;if(arr.length>2){n_page_id=arr[2];}else n_page_id=1;generate_single_news_page(n_id,n_page_id);break;case'radio':document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Загружаю...</b></center>');if(arr.length>1){current_radio_page=arr[1];}else{current_radio_page=1;}
if(arr.length>2){current_radio_sort=arr[2];}
if(arr.length>3){current_radio_ord=arr[3];}
generate_radio_page(current_radio_page);break;case'music':document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Загружаю...</b></center>');if(arr.length>1){if((arr[1]=='mixes')||(arr[1]=='albums')||(arr[1]=='realtones')||(arr[1]=='main')){current_music_position=arr[1];}}
if(arr.length>2){current_music_page=arr[2]-1+1;}
if(arr.length>3){current_music_sort=arr[3];}
if(arr.length>4){current_music_ord=arr[4];}
if(arr.length>5){current_music_author=arr[5];}
if(arr.length>6){current_music_name=arr[6];}
if(arr.length>7){current_music_start_date=arr[7];}
if(arr.length>8){current_music_end_date=arr[8];}
if(arr.length>9){current_music_styles=arr[9];}
generate_music_page();break;case'playlists':document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Загружаю...</b></center>');if(arr.length>1){if((arr[1]=='is_system')||(arr[1]=='main')){current_playlists_position=arr[1];}}
if(arr.length>2){current_playlists_page=arr[2]-1+1;}
if(arr.length>3){current_playlists_sort=arr[3];}
if(arr.length>4){current_playlists_ord=arr[4];}
if(arr.length>5){current_playlists_user=arr[5];}
if(arr.length>6){current_playlists_name=arr[6];}
if(arr.length>7){current_playlists_decsription=arr[7];}
if(arr.length>9){current_playlists_styles=arr[9];}
generate_playlist_page();break;case'news':document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Загружаю...</b></center>');if(arr.length>1){current_news_page=arr[1];}else current_news_page=1;if(arr.length>2){current_news_sort=arr[2];}
if(arr.length>3){current_news_ord=arr[3];}
if(arr.length>4){current_news_title=arr[4];}
if(arr.length>5){current_news_start_date=arr[5];}
if(arr.length>6){current_news_end_date=arr[6];}
if(arr.length>7){current_news_categories=arr[7];}
generate_news_page();break;case'user_profile':document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Загружаю...</b></center>');if(arr.length>1){pfuid=arr[1];}else pfuid=0;showUserProfile(pfuid);break;case'user_friends':document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Загружаю...</b></center>');if(arr.length>1){pfuid=arr[1];}else pfuid=0;showUserFriends(pfuid);break;case'user_add_present':document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Загружаю...</b></center>');if(arr.length>1){pfuid=arr[1];}else pfuid=0;showUserPresents(pfuid);break;case'user_messages':document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Загружаю...</b></center>');if(arr.length>1){pfuid=arr[1];}else pfuid=0;showUserMessages(pfuid);break;case'user_wall':document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Загружаю...</b></center>');if(arr.length>1){pfuid=arr[1];}else{pfuid=0;}
if(arr.length>2){pfuidp=arr[2];}else{pfuidp=1;}
showUserWall(pfuid,pfuidp);break;case'messages':document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Загружаю...</b></center>');if(arr.length>1){pfuid=arr[1];}else{pfuid=0;}
LoadMessagesList(false,null,pfuid);break;case'user_photo':document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Загружаю...</b></center>');if(arr.length>1){pfuid=arr[1];}else{pfuid=0;}
if(arr.length>2){pfuidp=arr[2];}else{pfuidp=1;}
if(arr.length>3){pfuidpph=arr[3];}else{pfuidpph=1;}
showUserGallery(pfuid,pfuidp,pfuidpph);break;default:break;}}}}else{$('body').html('');hs=str_replace(request_0,'',document.location.href);hs='#'+str_replace('/','-',hs);document.location=request_0+hs;}}
function nextThemeProcessor(attr_minuse){if(typeof(attr_minuse)=='undefined'){attr_minuse=1;}
if($('#play_mute').css('display')!='none'){is_player_stoped=true;$('#play_panel_play').show();$('#play_panel_pause').hide();return false;}
if(player_from==2){is_player_stoped=true;$('#play_panel_play').show();$('#play_panel_pause').hide();}
if(player_from==1){elms=$('#history_table tr');if(elms.length>0){if(player_sort){if(elms.length>1){while(true){ei=rand(0,elms.length-1);if(substr($(elms[ei]).attr('id'),7)!=current_play_history_id){break;}}}else{if(player_circle){is_player_stoped=true;$('#play_panel_play').show();$('#play_panel_pause').hide();return false;}
ei=0;}
tds=$(elms[ei]).find('td');$(tds[1]).dblclick();if(player_show_page)$(tds[3]).find('img').click();}else{if(current_play_history_id==-1){tds=$(elms[0]).find('td');$(tds[1]).dblclick();if(player_show_page)$(tds[3]).find('img').click();}else{if(attr_minuse==2){nextid=$(elms[0]);is_sr=true;finded=true;}else{nextget=false;nextid=0;finded=false;}
for(i=0;i<elms.length;i++){if(attr_minuse==2){if(substr($(elms[i]).attr('id'),7)==current_play_history_id){is_sr=false;}
if(is_sr){nextid=$(elms[i]);}}else{if(nextget){nextget=false;nextid=$(elms[i]);finded=true;}else{if(substr($(elms[i]).attr('id'),7)==current_play_history_id){nextget=true;}}}}
if(finded){tds=nextid.find('td');$(tds[1]).dblclick();if(player_show_page)$(tds[3]).find('img').click();}else{if(nextget&&!player_circle){tds=$(elms[0]).find('td');$(tds[1]).dblclick();if(player_show_page)$(tds[3]).find('img').click();}else{is_player_stoped=true;$('#play_panel_play').show();$('#play_panel_pause').hide();return false;}}}}}}
if(player_from==0){scroll_position=-1;elms=$('#playlistparent li');if(elms.length>0){if(player_sort){if(elms.length>1){while(true){ei=rand(0,elms.length-1);if(substr($(elms[ei]).attr('id'),9)!=current_play_list_element_id){break;}}}else{if(player_circle){is_player_stoped=true;$('#play_panel_play').show();$('#play_panel_pause').hide();return false;}
ei=0;}
scroll_position=0;for(i=0;i<elms.length;i++){scroll_position+=elms[i].offsetHeight;if(elms[ei]==elms[i]){break;}}
scroll_position-=100;if(scroll_position>0){$('#pane1pllist')[0].scrollTo(scroll_position);}else{$('#pane1pllist')[0].scrollTo(0);}
elms.removeClass('nowplay');$(elms[ei]).addClass('nowplay');tds=$(elms[ei]).find('td');$(tds[2]).dblclick();if(player_show_page)$(tds[3]).find('img').click();}else{if(current_play_list_element_id==-1){tds=$(elms[0]).find('td');$(tds[2]).dblclick();if(player_show_page)$(tds[3]).find('img').click();}else{if(attr_minuse==2){nextid=$(elms[0]);is_sr=true;finded=true;}else{nextget=false;nextid=0;finded=false;}
get_scr=true;for(i=0;i<elms.length;i++){if(attr_minuse==2){if(substr($(elms[i]).attr('id'),9)==current_play_list_element_id){is_sr=false;}
if(is_sr){nextid=$(elms[i]);scroll_position+=elms[i].offsetHeight;}}else{if(nextget){nextget=false;nextid=$(elms[i]);finded=true;}else{if(get_scr){scroll_position+=elms[i].offsetHeight;}
if(substr($(elms[i]).attr('id'),9)==current_play_list_element_id){nextget=true;get_scr=false;}}}}
scroll_position-=100;if(scroll_position>0){try{$('#pane1pllist')[0].scrollTo(scroll_position);}catch(err){}}else{try{$('#pane1pllist')[0].scrollTo(0);}catch(err){}}
if(finded){if(((attr_minuse==2)&&(current_play_list_element_id==substr($(elms[0]).attr('id'),9)))){tds=$(elms[elms.length-1]).find('td');$(tds[2]).dblclick();if(player_show_page)$(tds[3]).find('img').click();elms.removeClass('nowplay');$($(elms[elms.length-1])).addClass('nowplay');$('#pane1pllist')[0].scrollTo(999999);}else{tds=nextid.find('td');$(tds[2]).dblclick();if(player_show_page)$(tds[3]).find('img').click();elms.removeClass('nowplay');nextid.addClass('nowplay');}}else{if(nextget&&!player_circle){tds=$(elms[0]).find('td');$(tds[2]).dblclick();if(player_show_page)$(tds[3]).find('img').click();elms.removeClass('nowplay');$(elms[0]).addClass('nowplay');$('#pane1pllist')[0].scrollTo(0);}else{is_player_stoped=true;$('#play_panel_play').show();$('#play_panel_pause').hide();return false;}}}}}}}
function setPlayerSort(){if(player_sort){setCookie('player_sort',0,'Thu, 2 Aug 2223 20:47:11 UTC');player_sort=false;$('#play_sort').attr('src',request_0+'images/sort_normal.gif');$('#play_sort').attr('alt','Сортировка по порядку');$('#play_sort').attr('title','Сортировка по порядку');}else{setCookie('player_sort',1,'Thu, 2 Aug 2223 20:47:11 UTC');player_sort=true;$('#play_sort').attr('src',request_0+'images/sort_random.gif');$('#play_sort').attr('alt','Сортировка случайно');$('#play_sort').attr('title','Сортировка случайно');}}
function setPlayerCircle(){if(player_circle){setCookie('play_circle',0,'Thu, 2 Aug 2223 20:47:11 UTC');player_circle=false;$('#play_circle').attr('src',request_0+'images/play_circle.gif');$('#play_circle').attr('alt','Играть по кругу');$('#play_circle').attr('title','Играть по кругу');}else{setCookie('play_circle',1,'Thu, 2 Aug 2223 20:47:11 UTC');player_circle=true;$('#play_circle').attr('src',request_0+'images/play_no_circle.gif');$('#play_circle').attr('alt','Играть до конца списка');$('#play_circle').attr('title','Играть до конца списка');}}
function setPlayerShowPage(){if(player_show_page){player_show_page=false;$('#play_show_page').attr('src',request_0+'images/dont_show_page.gif');$('#play_show_page').attr('alt','Не загружать страничку трека при окончании текущего');$('#play_show_page').attr('title','Не загружать страничку трека при окончании текущего');}else{player_show_page=true;$('#play_show_page').attr('src',request_0+'images/show_page.gif');$('#play_show_page').attr('alt','Автоматически загружать страничку трека при окончании текущего (с истории или плей-листа)');$('#play_show_page').attr('title','Автоматически загружать страничку трека при окончании текущего (с истории или плей-листа)');}}
function setPlayerFrom(){if(player_from==0){player_from=1;$('#play_from').attr('src',request_0+'images/play_history.gif');$('#play_from').attr('alt','Играть с истории');$('#play_from').attr('title','Играть с истории');}else if(player_from==1){player_from=2;$('#play_from').attr('src',request_0+'images/play_one_song.gif');$('#play_from').attr('alt','Играть только текущую загрузку');$('#play_from').attr('title','Играть только текущую загрузку');}else if(player_from==2){player_from=0;$('#play_from').attr('src',request_0+'images/play_list.gif');$('#play_from').attr('alt','Играть с плей-листа');$('#play_from').attr('title','Играть с плей-листа');}}
function setcircle(id){for(var i=1;i<=10;i++){if(id<i){$('#r'+i).attr('class','crclempty');}else{$('#r'+i).attr('class','crclfill');}}}
function playerReady(obj){player=document.getElementById('player1');addListeners();}
function createRadioPlayerParam(id,title,desc,streamurl){player=null;jwplayer("placeholder1").setup({flashplayer:player_src,file:streamurl,provider:"video",height:1,width:1});jwplayer().play();$('#play_mode').html('Радио');$('#play_name').html(title);$('#play_desc').html(desc);if($('#nowplay').css('display')=='none'){show_hide_status();}
set_volume();clearTimeout(radio_timeout);$('#play_desc').html('');CompositionNameRadioTimeout(streamurl,true);current_plater_song_id=-1;$('#play_add_to_playlist').hide();}
function createRadioPlayer(el){player=null;var id=substr($(el).attr('id'),5);var streamurl=$('#strurl'+id).html();jwplayer("placeholder1").setup({flashplayer:player_src,file:streamurl,provider:"sound",height:1,width:1});jwplayer().play();$('#play_mode').html('Радио');$('#play_name').html($(el).attr('title'));$('#play_desc').html($('#radiodesc'+id).html());if($('#nowplay').css('display')=='none'){show_hide_status();}
set_volume();clearTimeout(radio_timeout);$('#play_desc').html('');CompositionNameRadioTimeout(streamurl,true);removeSelection();current_plater_song_id=-1;$('#play_add_to_playlist').hide();}
function removeSelection(){if(window.getSelection){window.getSelection().removeAllRanges();}
else if(document.selection&&document.selection.clear)
document.selection.clear();}
function createSongPlayer(el){var id=substr($(el).attr('id'),5);add_to_history(id,'single');return createSongPlayerParam(id,$(el).attr('title'),$('#songdesc'+id).html(),$('#strurl'+id).html());player=null;var id=substr($(el).attr('id'),5);var streamurl=$('#strurl'+id).html();var tpe='video';if(streamurl.substr(-3)=='mp3'){tpe='sound';}
streamurl=urldecode(streamurl);jwplayer("placeholder1").setup({flashplayer:player_src,file:streamurl,provider:tpe,height:1,width:1});jwplayer().play();$('#play_mode').html('Трек');$('#play_name').html($(el).attr('title'));$('#play_desc').html($('#songdesc'+id).html());if($('#nowplay').css('display')=='none'){show_hide_status();}
set_volume();clearTimeout(radio_timeout);add_to_history(id,'single');current_plater_song_id=id;$('#play_add_to_playlist').show();}
function addSongPlayList(el){var id=substr($(el).attr('id'),12);if(!current_playlist_is_your){if($('#chat_message').length){html_text='<div id="pdsl"><select id="my_listes_select" name="my_listes_select" class="stand required"">'+$('#my_listes').html()+'</select></div>';show_alert_submit("ВЫБИРИТЕ ПЛЕЙ-ЛИСТ","<br /><br /><br /><br /><center>"+html_text+"</u><br /></center>",'addSongPlayListFromPopup('+id+')');if(last_selected_pl_id>0){$('#my_listes_select').val(last_selected_pl_id);}
$('#my_listes_select').selectbox();$('#my_listes_select_input').css('width','235px');$('#my_listes_select_container').css('width','235px').css('margin-left','80px');return false;}else{show_alert("ОШИБКА ДОБАВЛЕНИЯ В ПЛЕЙ-ЛИСТ","<br /><br /><br />Вы можете добавлять треки только имея свой плей лист.<br /> Для этого необходимо зарегестрироваться. <br /><br />");}
return false;}
var streamurl=$('#strurl'+id).html();pname=$(el).attr('title');pdesc=$('#songdesc'+id).html();$('#ajaxload').show();$.getJSON(request_0+'jx/add_plist/',{element_id:id,element_flag:'single',plist_id:current_playlist_id,plist_y:current_playlist_is_your?1:0},function(j){if(j.value.is_new){html_text='<li class="class'+j.value.new_element_plist_id+'" id="pllistel_'+j.value.element.id+'"><table class="plist_table" cellpadding="0" cellspacing="0"><tr><td>';html_text+='</td><td><img src="'+request_0+'images/trash.gif" class="trash" onclick="DeletePlaylistElement('+current_playlist_id+', '+j.value.new_element_plist_id+','+j.value.element.id+');" alt="Удалить из плей листа" /></td>';html_text+='<td class="pllist_el" ondblclick="current_play_list_element_id='+j.value.new_element_plist_id+';';html_text+='createSongPlayerParam(\''+j.value.element.id+'\',\''+str_replace("'",'`',j.value.element.author)+'\',\''+str_replace("'",'`',j.value.element.singlename)+'\', \''+j.value.element.lissen_link+'\');return false;">';html_text+=j.value.element.author+' <small class="blue">- '+j.value.element.singlename+'</small></td><td><img src="'+request_0+'images/goto.gif" class="gotopage" onclick="generate_song_page('+j.value.element.id+', 1);" alt="Перейти к странице" /></td></tr></table></li>';$('#playlistparent').append(html_text);color_blink('playplaylistn','color_blue',6,true);$('#pane1pllist').jScrollPane({showArrows:true});if($('#playlist .jScrollArrowUp').length>0){try{$('#pane1pllist')[0].scrollTo(9999999);}catch(err){}}}else{show_alert("ОШИБКА ДОБАВЛЕНИЯ В ПЛЕЙ-ЛИСТ","<br /><br />"+j.value.error_message+"");}
$('#ajaxload').hide();});}
function addPlaylistFromPlayer(){id=current_plater_song_id;if($('#del_favorite_song_set_area').length>0){html_text='<small class="f11 blue">'+truncate($('#play_name').html(),35)+'</small><br /> <small class="f11">'+truncate($('#play_desc').html(),35)+'</small>';$('#set_single').html(html_text);$('#favorite_song').val(id);$('#set_single_selector').remove();$('#change_favorite_song').html('Изменить');$('#change_favorite_song').removeClass('invise');$('#del_favorite_song').removeClass('invise');return false;}
if(!current_playlist_is_your){if($('#chat_message').length){html_text='<select id="my_listes_select" name="my_listes_select" class="stand required"">'+$('#my_listes').html()+'</select>';show_alert_submit("ВЫБИРИТЕ ПЛЕЙ-ЛИСТ","<br /><br /><br /><br /><center>"+html_text+"</u><br /></center>",'addSongPlayListFromPopup('+id+')');if(last_selected_pl_id>0){$('#my_listes_select').val(last_selected_pl_id);}
$('#my_listes_select').selectbox();$('#my_listes_select_input').css('width','235px');$('#my_listes_select_container').css('width','235px').css('margin-left','80px');return false;}else{show_alert("ОШИБКА ДОБАВЛЕНИЯ В ПЛЕЙ-ЛИСТ","<br /><br />Вы можете добавлять треки только имея свой плей лист.<br /> Для этого необходимо зарегестрироваться.  <br />");}
return false;}
$('#ajaxload').show();$.getJSON(request_0+'jx/add_plist/',{element_id:id,element_flag:'single',plist_id:current_playlist_id,plist_y:current_playlist_is_your?1:0},function(j){if(j.value.is_new){html_text='<li class="class'+j.value.new_element_plist_id+'" id="pllistel_'+id+'"><table class="plist_table" cellpadding="0" cellspacing="0"><tr><td>';html_text+='</td><td><img src="'+request_0+'images/trash.gif" class="trash" onclick="DeletePlaylistElement('+current_playlist_id+', '+j.value.new_element_plist_id+', '+j.value.element.id+');" alt="Удалить из плей листа" /></td>';html_text+='<td class="pllist_el" ondblclick="current_play_list_element_id='+j.value.new_element_plist_id+';';html_text+='createSongPlayerParam(\''+id+'\',\''+str_replace("'",'`',j.value.element.author)+'\',\''+str_replace("'",'`',j.value.element.singlename)+'\', \''+j.value.element.lissen_link+'\');return false;">';html_text+=j.value.element.author+' <small class="blue">- '+j.value.element.singlename+'</small></td><td><img src="'+request_0+'images/goto.gif" class="gotopage" onclick="generate_song_page('+j.value.element.id+', 1);" alt="Перейти к странице" /></td></tr></table></li>';$('#playlistparent').append(html_text);color_blink('playplaylistn','color_blue',6,true);$('#pane1pllist').jScrollPane({showArrows:true});if($('#playlist .jScrollArrowUp').length>0){try{$('#pane1pllist')[0].scrollTo(9999999);}catch(err){}}}else{show_alert("ОШИБКА ДОБАВЛЕНИЯ В ПЛЕЙ-ЛИСТ","<br /><br />"+j.value.error_message+"");}});$('#ajaxload').hide();}
function addSongPlayListFromPopup(el_id){$('#ajaxload').show();$.getJSON(request_0+'jx/add_plist/',{element_id:el_id,element_flag:'single',plist_id:$('#my_listes_select').val(),plist_y:1},function(j){last_selected_pl_id=$('#my_listes_select').val();$('#close_buttn').click();if(j.value.is_new){color_blink('playplaylistn','color_blue',6,true);}else{show_alert("ОШИБКА ДОБАВЛЕНИЯ В ПЛЕЙ-ЛИСТ","<br /><br />"+j.value.error_message+"");}
$('#ajaxload').hide();});}
function DeletePlaylistElement(pllist_id,el_id,pid){$('#ajaxload').show();$.getJSON(request_0+'jx/del_from_plist/',{element_id:el_id,playlist:pllist_id},function(j){if(j.value.is_done){$('#pllistel_'+pid).remove();$('#pane1pllist').jScrollPane({showArrows:true});}else{show_alert("ОШИБКА УДАЛЕНИЯ ИЗ ПЛЕЙ-ЛИСТА","<br /><br /><center><b>"+j.value.error_message+"</b></center>");}
$('#ajaxload').hide();});}
function createSongPlayerParam(id,title,desc,streamurl){player=null;var tpe='video';if(streamurl.substr(-3)=='mp3'){tpe='sound';}
streamurl=urldecode(streamurl);jwplayer("placeholder1").setup({flashplayer:player_src,file:streamurl,provider:tpe,height:1,width:1});jwplayer().play();$('#play_mode').html('Трек');$('#play_name').html(title);$('#play_desc').html(desc);if($('#nowplay').css('display')=='none'){show_hide_status();}
set_volume();clearTimeout(radio_timeout);removeSelection();current_plater_song_id=id;$('#play_add_to_playlist').show();}
function show_hide_status(){show_status();setTimeout("close_status()",4000);}
function close_status(){$('#nowplay').fadeTo("fast",0.0,function(){$('#nowplay').hide();$('#nowplayshow').show();});}
function show_status(){$('#nowplay').show();$('#nowplay').fadeTo("fast",0.9);}
function close_history(){$('#history').fadeTo("fast",0.0,function(){$('#history').hide();});}
function show_history(){$('#history').show();$('#history').fadeTo("fast",0.9);}
function close_playlist(){$('#playlist').fadeTo("fast",0.0,function(){$('#playlist').hide();});}
function show_playlist(){$('#playlist').show();$('#playlist').fadeTo("fast",0.9);$('#pane1pllist').jScrollPane({showArrows:true});}
function addListeners(){jwplayer().onVolume(function(event){volumeListener(event);});jwplayer().onTime(function(event){positionListener(event);});jwplayer().onBufferChange(function(event){loadedListener(event);});jwplayer().onMute(function(event){muteListener(event);});jwplayer().onPlay(function(){playListener();});jwplayer().onPause(function(){pauseListener();});jwplayer().onComplete(function(event){nextThemeProcessor();});jwplayer().onError(function(event){nextThemeProcessor();});set_volume();}
function muteListener(obj){if(jwplayer()){currentMute=jwplayer().getMute();if(currentMute){$('#play_mute').show();$('#play_unmute').hide();}else{$('#play_unmute').show();$('#play_mute').hide();}}}
function positionListener(obj){currentPosition=obj.position;player_position=obj.position;duration=obj.duration;$('#player_now_time').css('width',intval((200/obj.duration)*currentPosition));$('#time_2').html(sec_to_min(duration));$('#time_1').html(sec_to_min(currentPosition));if((duration==currentPosition)&&(current_play_list_element_id>0)){nextThemeProcessor();}}
function sec_to_min(sk){min=intval(sk/60);sek=intval(((sk/60)-min)*60);if(min<10){min='0'+min;}
if(sek<10){sek='0'+sek;}
return min+":"+sek;}
function loadedListener(obj){currentLoaded=obj.bufferPercent;$('#player_time').css('width',intval(2*currentLoaded));}
function volumeListener(obj){$('#player_volume').css('width',obj.volume);if(obj.volume>6){sv=obj.percentage-3;fl=Math.floor(sv/5);sv=3+(fl*5);}else{sv=obj.volume;}
$('#player_volume').css('width',sv);$('#vol_perc').html(obj.volume+'%');}
function playListener(){$('#play_panel_stop').show();$('#play_panel_play').hide();is_player_stoped=false;$('#play_panel_pause').show();}
function pauseListener(){$('#play_panel_stop').show();is_player_stoped=true;$('#play_panel_play').show();$('#play_panel_pause').hide();}
function player_play(){if(jwplayer()){jwplayer().play();}}
function player_stop(){if(jwplayer()){jwplayer().stop();}}
function set_volume(){setCookie('vol',mouse_volume,'Thu, 2 Aug 2223 20:47:11 UTC');if(mouse_volume>6){sv=mouse_volume-3;fl=Math.floor(sv/5);sv=3+(fl*5);}else{sv=mouse_volume;}
$('#player_volume').css('width',sv);$('#vol_perc').html(mouse_volume+'%');jwplayer().setVolume(mouse_volume);}
function set_position(){jwplayer().seek(intval((duration/200)*mouse_play_volume));}
function set_mute(){if(jwplayer()){jwplayer().setMute();}}
function add_to_history(element_id,element_flag){$('#ajaxload').show();$.getJSON(request_0+'jx/add_history/',{element_id:element_id,element_flag:element_flag},function(j){$('#empty_history').remove();if(j.value.error){return false;}else
if(j.value.isnew){switch(element_flag){case'radio':html_text='<tr id="pllist_'+j.value.isnew.id+'" class="width14"><td><img alt="Радио" src="'+request_0+'images/radio.gif"/></td><td ondblclick="current_play_history_id='+j.value.isnew.id+';createRadioPlayerParam(\''+j.value.isnew.element_id+'\', \''+str_replace("'","~",j.value.isnew.element.name)+'\', \''+str_replace("'","~",j.value.isnew.element.description)+'\',\''+j.value.isnew.element.streamurl+'\');" class="history_el">'+j.value.isnew.element.name+'</td><td id="pllistime_'+j.value.isnew.id+'" class="fsize9">'+substr(j.value.isnew.visit_time,11,5)+'</td><td>&nbsp;</td></tr>';$('#history_table tbody').html(html_text+$('#history_table tbody').html());color_blink('playhistoryn','color_blue',6,true);try{$('#pane1').jScrollPane({showArrows:true});}catch(err){}
break;case'single':html_text='<tr id="pllist_'+j.value.isnew.id+'" class="width14"><td>&nbsp;</td><td ondblclick="current_play_history_id='+j.value.isnew.id+';createSongPlayerParam(\''+j.value.isnew.element_id+'\', \''+str_replace("'","~",j.value.isnew.element.author)+'\', \''+str_replace("'","~",j.value.isnew.element.singlename)+'\',\''+j.value.isnew.element.lissen_link+'\');" class="history_el">'+j.value.isnew.element.author+' <small class="blue">- '+j.value.isnew.element.singlename+'</small></td><td id="pllistime_'+j.value.isnew.id+'" class="fnormal padd2 padhor3">'+substr(j.value.isnew.visit_time,11,5)+'</td><td><img class="gotopage" onclick="generate_song_page('+j.value.isnew.element_id+', 1);" alt="Перейти к странице" src="'+request_0+'images/goto.gif"/></td></tr>';$('#history_table tbody').html(html_text+$('#history_table tbody').html());color_blink('playhistoryn','color_blue',6,true);try{$('#pane1').jScrollPane({showArrows:true});}catch(err){}
break;}}else{$('#pllistime_'+j.value.up_row).html(j.value.up_row_time);el_html=$('#pllist_'+j.value.up_row).html();$('#pllist_'+j.value.up_row).remove();$('#history_table tbody').html('<tr id="pllist_'+j.value.up_row+'">'+el_html+'</tr>'+$('#history_table tbody').html());color_blink('playhistoryn','color_red',6,true);}
$('.history_el').parent().mouseover(function(){$(this).addClass('hovered');});$('.history_el').parent().mouseout(function(){$(this).removeClass('hovered');});});$('#ajaxload').hide();$('.lissened'+element_id).attr('src',request_0+'images/lissened.png');}
var color_blink_iteration=0;function color_blink(element_id,blink_color,iteration,isnew){if(isnew){color_blink_iteration=0;}
color_blink_iteration++;if(color_blink_iteration%2==0){$('#'+element_id).addClass(blink_color);}else{$('#'+element_id).removeClass(blink_color);}
if(iteration>=color_blink_iteration){setTimeout('color_blink("'+element_id+'","'+blink_color+'",'+iteration+', false)',500);}}
function add_voting(id,element_flag){$('#ajaxload').show();$.ajax({async:false,timeout:3000,type:'POST',url:request_0+"jx/add_voting/",data:{element_id:id,element_flag:element_flag},success:function(answ){if(answ=="K"){$('#rvtd_'+id).html('&nbsp;');$('#radio_voting_'+id).html($('#radio_voting_'+id).html()-1+2);}else{show_alert("ЗАПРЕЩЁННОЕ ДЕЙСТВИЕ","<br /><br />"+answ);}}});$('#ajaxload').hide();}
function take_away_voting(id,element_flag){$('#ajaxload').show();$.ajax({async:false,timeout:3000,type:'POST',url:request_0+"jx/remove_voting/",data:{element_id:id,element_flag:element_flag},success:function(answ){if(answ=="K"){$('#rvtd_'+id).html('&nbsp;');$('#radio_voting_'+id).html($('#radio_voting_'+id).html()-1);}else{show_alert("ЗАПРЕЩЁННОЕ ДЕЙСТВИЕ","<br /><br />"+answ);}}});$('#ajaxload').hide();}
function add_download(element_id,element_flag){$('#ajaxload').show();$.ajax({async:false,timeout:3000,type:'POST',url:request_0+"jx/add_download/",data:{element_id:element_id,element_flag:element_flag},success:function(answ){if(answ=="K"){if(element_flag=='radio')
$('#radio_click_'+element_id).html($('#radio_click_'+element_id).html()-1+2);if(element_flag=='single'){$('#musdownl'+element_id).html($('#musdownl'+element_id).html()-1+2);$('#mdvnl'+element_id).attr('href',urldecode($('#mdvnl'+element_id).attr('href').replace(/%fb6/gi,'%')));}}}});$('#ajaxload').hide();}
function change_check(el,img_id){if($(el).attr('checked')){$('#'+img_id).attr('src',request_0+'images/checked.gif');}else{$('#'+img_id).attr('src',request_0+'images/unchecked.gif');}}
function select_radio(element_selected,class_radios){$('.'+class_radios).attr('src',request_0+'images/unselected.gif');$('#'+element_selected).attr('src',request_0+'images/selected.gif');}
function set_select_radio(element_id,element_selected,class_radios){$('#'+element_id).attr('checked','checked');select_radio(element_selected,class_radios);}
function set_check(element_id,img){$('#'+element_id).attr('checked',$('#'+element_id).attr('checked')?null:'checked');if(!$('#'+element_id).attr('checked')){$(img).attr('src',request_0+'images/checked.gif');}else{$(img).attr('src',request_0+'images/unchecked.gif');}}
function LisinerChangeCountry(country_id){global_country_id=country_id;$(".ac_results").remove();$("#city_id").autocomplete(request_0+'jx/city_list/'+country_id+'/',{maxItemsToShow:29});}
function refrech_captcha(capcha_img_id,public_key_id){$('#ajaxload').show();$.getJSON(request_0+'jx/refresh_capcha/',{old_value:$('#'+public_key_id).val()},function(j){$('#'+public_key_id).val(j.value.key);$('#'+capcha_img_id).attr('src',j.value.image);$("#captcha").rules("add",{remote:request_0+'jx/ajax_check/'+j.value.key+'/'});});$('#ajaxload').hide();}
function show_alert_submit(header_text,html_text,click_f){$.modal('<div class="alert_top"></div><div class="alert_center"><h3>'+header_text+'</h3><div class="modal_body">'+html_text+'</div><center><input type="button" onclick="'+click_f+'" value="ОК" class="modal_inp"> &nbsp; <input type="button" id="close_buttn" value="Закрыть" class="modal_close simplemodal-close"></center></div><div class="alert_bottom"></div>',{minHeight:200,minWidth:450});}
function show_alert(header_text,html_text){$.modal('<div class="alert_top"></div><div class="alert_center"><h3>'+header_text+'</h3><div class="modal_body">'+html_text+'</div><center><input type="button" id="close_butt" value="Закрыть" class="modal_close simplemodal-close"></center></div><div class="alert_bottom"></div>');}
function show_modal_page(page_name,title,callback){switch(page_name){case'site_rules':$('#ajaxload').show();$.getJSON(request_0+'jx/rules/',{},function(j){$('#ajaxload').hide();var cssObj={'height':'715px','width':'700px'};$.modal('<div class="bgmod"><div class="topmod1"></div><div class="mod1"><h3>'+title+'</h3><div class="big_modal_body">'+j.value.content+'</div><br /><br /><br /><center> <input type="button" class="modal_close simplemodal-close" value="Закрыть" id="close_butt"/></center></div><div class="bottmod1"></div></div>',{containerCss:cssObj});$('.main_content_height_block').addClass('main_content_height_block_popup');rulesReady();if(typeof(callback)!='undefined'){$('#toPage').click(function(){eval(callback);});}});break;}}
function show_login_page(){$('#ajaxload').show();$.getJSON(request_0+'jx/login_page/',{},function(j){$('#ajaxload').hide();var cssObj={'height':'300px','width':'400px'};html_text='<div class="empty_sep7"></div><form method="post" id="login_form" action="'+request_0+'jx/login/"><div class="login"><table class="login_table"><tr><td colspan="2" id="login_error">';html_text+='</td></tr><tr><td><input value="" type="text" id="login" name="login" /></td><td class="left">Логин</td></tr><tr><td><input value="" type="password" id="pass" name="password" />';html_text+='<input type="hidden" id="h_password" name="h_password" /></td><td class="left">Пароль</td></tr><tr><td colspan="2"><div class="empty_sep7"></div><table cellpadding="0" cellspacing="0" class="widthauto mar_left75"><tr><td>';html_text+='<label for="remember" id="remblbl" onclick="$(\'#focusinp\').focus();"><img src="'+request_0+'images/';if(!j.value.remember){html_text+='un';}
html_text+='checked.gif" id="remember_img" class="finger" onclick="$(\'#remblbl\').click();" alt="" /><input';if(j.value.remember){html_text+=' checked="checked"';}
html_text+=' type="checkbox" class="hidden" name="remember" onchange="change_check(this, \'remember_img\');" id="remember" />&nbsp; Запомнить меня</label>';html_text+='</td><td>&nbsp; <label for="prov" id="provlb"onclick="$(\'#focusinp\').focus();"><img src="'+request_0+'images/';if(!j.value.prov){html_text+='un';}
html_text+='checked.gif" id="prov_img" class="finger" onclick="$(\'#provlb\').click();" alt="" /><input';if(j.value.prov){html_text+=' checked="checked"';}
html_text+='  type="checkbox" class="hidden" name="prov" onchange="change_check(this, \'prov_img\');" id="prov" />&nbsp; За мной следит интерпол</label>';html_text+='</td><td>&nbsp;<img id="login_help" title="Пароль шифруется на стороне клиента,<br /> затем посылаеться на сервер <br /><small>(дабы избежать перехвата на proxy)</small>" src="'+request_0+'images/question.gif" alt="Подсказка" />';html_text+='</td></tr></table><div class="empty_sep7"></div></td></tr><tr><td colspan="2"><input type="submit" class="subm" id="log_submit" value="Вход" /> &nbsp; <input type="button" id="close_butt" value="Закрыть" class="modal_close simplemodal-close"></td></tr><tr><td class="right" colspan="2"><a id="torem" class="blue" href="'+request_0+'login/">Я не помню пароль</a>';html_text+='</td></tr></table></div></form>';html_text+='<form method="post" id="remember_form" action="'+request_0+'jx/remember/"><div class="login"><table class="login_table"><tr><td colspan="2" id="remember_error">';html_text+='</td></tr><tr><td colspan="2" id="remember_success"></td></tr><tr><td><input type="text" id="login" name="login" /></td><td class="nobr">Логин или E-mail';html_text+='</td></tr><tr><td colspan="2"><div class="empty_sep7"></div><input type="submit" class="subm" id="log_submit" value="Выслать" /> &nbsp; <input type="button" id="close_butt" value="Закрыть" class="modal_close simplemodal-close"></td></tr><tr><td class="right" colspan="2"><a id="tolog" href="'+request_0+'login/" class="blue">Назад</a>';html_text+='</td></tr></table></div></form>';$.modal('<div class="alert_top"></div><div class="alert_center"><h3>ВХОД В ПОРТАЛ</h3><div class="big_modal_body">'+html_text+'<input type="button" id="close_butt" value="Закрыть" style="border:none;overflow:hidden;height:0px;width:0px;" class="modal_close simplemodal-close"></div></div><div class="alert_bottom"></div>',{containerCss:cssObj});loginReady();});}
function generate_user_profile_page(user_id){}
function HintElement(ele,default_val){$(ele).focus(function(){if($(this).val()==default_val)$(this).val('');});$(ele).blur(function(){if($(this).val()=='')$(this).val(default_val);});}
function HintElementStyle(ele,default_val){$(ele).focus(function(){if($(this).val()==default_val)$(this).val('');$('#styles_div').show();});$(ele).blur(function(){if($(this).val()=='')$(this).val(default_val);$('#styles_div').hide();});}
function add_style_value(id){values=split(';',trim($('#filter_style').val(),';'));new_value='';new_string='';if((values.length>0)&&(strlen($('#filter_style').val())>0)){for(i=0;i<values.length;i++){if(values[i]!=id){new_value+=values[i]+';';new_string+=$('#styles_label_'+values[i]).html()+' / ';}}}
if($('#style_'+id).attr('checked')){new_value+=id+';';new_string+=$('#styles_label_'+id).html();}else{new_string=substr(new_string,0,-3);}
$('#filter_style').val(new_value);if(strlen(new_value)>0){$('#filter_style_name').val(new_string);}else{$('#filter_style_name').val('Стили');}}
function setSingleVote(single_id,score){$('#ajaxload').show();$.getJSON(request_0+'jx/add_voting/',{element_id:single_id,score:score,element_flag:'single'},function(j){if(j.value.correct==1){html_text='';for(i=1;i<11;i++){html_text+='<td';if(score>(i-1)){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td>';}
$('#single_vote').html('<tr>'+html_text+'</tr>');$('#sort_rate_div').css('width',j.value.pecent+'%');$('#song_rate_percent').html(j.value.pecent);$('#song_voting_count').html(j.value.count);$('#remvotpar').html('<img id="remvot" src="'+request_0+'images/delete.gif" class="finger" onclick="removeVoting('+single_id+')" alt="удалить голос" />');}
$('#ajaxload').hide();});}
function topSortClick(element_id){$('#ajaxload').show();$.getJSON(request_0+'jx/gettopsort/',{element_id:element_id},function(j){if(j.value.correct==1){html_text='';for(var i in j.value.list){html_text+='<tr><td><a class="ttlink" id="ttl'+j.value.list[i].id+'" href="'+request_0+'singles/'+j.value.list[i].id+'/">'+j.value.list[i].full_name+'</a></td></tr>';}
current_top_flag=element_id;$('#topmain').html(html_text);$('#topsorttoday').attr('class','');$('#topsortweek').attr('class','');$('#topsortmonth').attr('class','');$('#topsortall').attr('class','');$('#'+element_id).attr('class','selected');$('#topmain a.ttlink').click(function(){generate_song_page(substr($(this).attr('id'),3),1);return false;});}
$('#ajaxload').hide();});return false;}
function ChangeSortPlist(element_id,pos){if(!current_playlist_is_your){return false;}
$('#ajaxload').show();$.getJSON(request_0+'jx/change_pos_pllist/',{element:element_id,position:pos,plist:current_playlist_id},function(j){$('#ajaxload').hide();});return false;}
function clearMusicForm(){$('#filter_artist').val('Исполнитель');$('#filter_name').val('Композиция');var boxes=$('body').find('INPUT:checkbox');for(i=0;i<boxes.length;i++){if((boxes[i].id.substr(0,6)=='style_')&&boxes[i].checked){change_check(boxes[i],'styles_img_'+boxes[i].id.substr(6));boxes[i].click();}}
return false;}
function clearPlaylistsForm(){$('#filter_user').val('Пользователь');$('#filter_name').val('Название');$('#filter_decsription').val('Описание');var boxes=$('body').find('INPUT:checkbox');for(i=0;i<boxes.length;i++){if((boxes[i].id.substr(0,6)=='style_')&&boxes[i].checked){change_check(boxes[i],'styles_img_'+boxes[i].id.substr(6));boxes[i].click();}}
return false;}
function clearNewsForm(){$('#filter_news').val('Содержит');var boxes=$('body').find('INPUT:checkbox');for(i=0;i<boxes.length;i++){if((boxes[i].id.substr(0,6)=='style_')&&boxes[i].checked){change_check(boxes[i],'styles_img_'+boxes[i].id.substr(6));boxes[i].click();}}
return false;}
function changeMyPlaylist(){if(($('#my_listes').val()==current_playlist_id)&&(current_playlist_is_your)){return false;}else{$('#my_listes_input').hide();$('#my_listes_input').after('<img src="'+request_0+'images/load2.gif" class="lg2">');$.getJSON(request_0+'jx/change_plist/',{plist_id:$('#my_listes').val(),plist_y:1},function(j){if(j.value.is_loaded){current_playlist_id=$('#my_listes').val();current_playlist_is_your=true;$('#favorite_listes_input').val('...');html_text='';for(i in j.value.elements){html_text+='<li class="class'+j.value.elements[i].id+'" id="pllistel_'+j.value.elements[i].element_id+'"><table class="plist_table" cellpadding="0" cellspacing="0"><tr><td></td><td><img src="'+request_0+'images/trash.gif" class="trash" onclick="DeletePlaylistElement(';html_text+=$('#my_listes').val()+', '+j.value.elements[i].id+','+j.value.element_id+');" alt="Удалить из плей листа" /></td><td class="pllist_el" ondblclick="current_play_list_element_id='+j.value.elements[i].id+';';if(j.value.elements[i].element_flag=='radio'){html_text+='createRadioPlayerParam('+j.value.elements[i].element_id+', \''+str_replace("'","`",j.value.elements[i].radio_name)+'\', \''+str_replace("'","`",j.value.elements[i].radio_description)+'\', \''+j.value.elements[i].streamurl+'\')';}
if(j.value.elements[i].element_flag=='single'){html_text+='PlistDblClick('+j.value.elements[i].element_id+', \''+str_replace("'","`",j.value.elements[i].auth)+'\', \''+str_replace("'","`",j.value.elements[i].s_name)+'\', \''+j.value.elements[i].lissen_link+'\')';}
html_text+=';return false;">';if(j.value.elements[i].element_flag=='radio'){html_text+=j.value.elements[i].radio_name;}
if(j.value.elements[i].element_flag=='single'){html_text+=j.value.elements[i].auth+' '+'<small class="blue">- '+j.value.elements[i].s_name+'</small>';}
html_text+='</td><td><img src="'+request_0+'images/goto.gif" onclick="generate_song_page('+j.value.elements[i].element_id+', 1);" class="gotopage" alt="Перейти к странице" /></td></tr></table></li>';}
current_play_list_element_id=-1;$('#playlistparent li').remove();$('#playlistparent').append(html_text);$('#pane1pllist').jScrollPane({showArrows:true});if($('#playlist .jScrollArrowUp').length>0){$('#pane1pllist')[0].scrollTo(0);}}
$('.lg2').remove();$('#my_listes_input').show();});}};function changeFavPlaylist(){if(($('#favorite_listes').val()==current_playlist_id)&&(!current_playlist_is_your)){return false;}else{$('#favorite_listes_input').hide();$('#favorite_listes_input').after('<img src="'+request_0+'images/load2.gif" class="lg2">');$.getJSON(request_0+'jx/change_plist/',{plist_id:$('#favorite_listes').val(),plist_y:0},function(j){if(j.value.is_loaded){current_playlist_id=$('#favorite_listes').val();current_playlist_is_your=false;$('#my_listes_input').val('...');html_text='';for(i in j.value.elements){html_text+='<li id="pllistel_'+j.value.elements[i].id+'"><table class="plist_table" cellpadding="0" cellspacing="0"><tr><td></td><td>&nbsp;';html_text+='</td><td class="pllist_el" ondblclick="current_play_list_element_id='+j.value.elements[i].id+';';if(j.value.elements[i].element_flag=='radio'){html_text+='createRadioPlayerParam('+j.value.elements[i].element_id+', \''+str_replace("'","`",j.value.elements[i].radio_name)+'\', \''+str_replace("'","`",j.value.elements[i].radio_description)+'\', \''+j.value.elements[i].streamurl+'\')';}
if(j.value.elements[i].element_flag=='single'){html_text+='createSongPlayerParam('+j.value.elements[i].id+', \''+str_replace("'","`",j.value.elements[i].auth)+'\', \''+str_replace("'","`",j.value.elements[i].s_name)+'\', \''+j.value.elements[i].lissen_link+'\')';}
html_text+=';return false;">';if(j.value.elements[i].element_flag=='radio'){html_text+=j.value.elements[i].radio_name;}
if(j.value.elements[i].element_flag=='single'){html_text+=j.value.elements[i].auth+' '+'<small class="blue">- '+j.value.elements[i].s_name+'</small>';}
html_text+='</td><td><img src="'+request_0+'images/goto.gif" onclick="generate_song_page('+j.value.elements[i].id+', 1);" class="gotopage" alt="Перейти к странице" /></td></tr></table></li>';}
current_play_list_element_id=-1;$('#playlistparent li').remove();$('#playlistparent').append(html_text);$('#pane1pllist').jScrollPane({showArrows:true});if($('#playlist .jScrollArrowUp').length>0){$('#pane1pllist')[0].scrollTo(0);}}
$('.lg2').remove();$('#favorite_listes_input').show();});}};function defineHotKey(key,code)
{if(typeof(key)=='string')
{var plus=key.indexOf('+');var key0=plus>0?key.substr(0,plus).toLowerCase():undefined;if(!/^(ctrl|alt|shift)$/.test(key0))return false;var key1=key.substr(plus+1)*1;}
else key1=key;function react(e)
{var e=e||window.event;var keyCode=e.which||e.keyCode;if((eval('e.'+key0+'Key')?key0:!key0)&&keyCode==key1)
{if(e.preventDefault)e.preventDefault();e.returnValue=false;eval(code);}}
if(document.addEventListener)document.addEventListener('keydown',react,false);else if(document.attachEvent)document.attachEvent('onkeydown',react);}
function UpVolume(){if(jwplayer()){svol=jwplayer().getVolume()+4;if(svol>100)svol=100;jwplayer().setVolume(svol);setCookie('vol',svol,'Thu, 2 Aug 2223 20:47:11 UTC');mouse_volume=svol;}}
function DownVolume(){if(jwplayer()){svol=jwplayer().getVolume()-4;if(svol<0)svol=0;jwplayer().setVolume(svol);setCookie('vol',svol,'Thu, 2 Aug 2223 20:47:11 UTC');mouse_volume=svol;}}
function StepLeft(){if(jwplayer()){jwplayer().seek(jwplayer().getPosition()-5);}}
function StepRight(){if(jwplayer()){jwplayer().seek(jwplayer().getPosition()+5);}}
function addBBCode(code){insertAtCursor(document.getElementById('comment_single_area'),code);$('#close_butt').click();}
function addBBCodePopup(code){insertAtCursor(document.getElementById('comment_single_area_popup'),code);$('#close_butt').click();}
function insertAtCursor(myField,myValue){if(document.selection){myField.focus();sel=document.selection.createRange();sel.text=myValue.replace("?",sel.text);}
else if(myField.selectionStart||myField.selectionStart=='0'){var startPos=myField.selectionStart;var endPos=myField.selectionEnd;myField.value=myField.value.substring(0,startPos)+myValue.replace("?",myField.value.substring(startPos,endPos))+myField.value.substring(endPos,myField.value.length);}else{myField.value+=myValue;}}
function SendUserSongComment(song_id){if(strlen($('#comment_single_area').val())<1){show_alert('ОШИБКА','<br /><br /><br />Пустые комментарии недопустимы.');return false;}
$('#ajaxload').show();$('#user_send_comment').attr('disabled','disabled');$.getJSON(request_0+'jx/send_user_song_comment/',{song_id:song_id,comm:$('#comment_single_area').val()},function(j){if(j.value.correct==1){html_text='<div id="commpan"><table cellpadding="0" cellspacing="0" width="100%">';for(var i in j.value.response.comments){html_text+='<tr><td class="smallava" rowspan="2">';if(j.value.response.comments[i].avatar_picture.length>0){html_text+='<img height="50" src="'+request_0+'images/user_images/'+j.value.response.comments[i].user_id+'/avatar/'+j.value.response.comments[i].avatar_picture+'.jpg" alt="'+j.value.response.comments[i].user_name+'" />';}else{html_text+='<img height="50" src="'+request_0+'images/ava_';if(j.value.response.comments[i].is_man==1){html_text+='man';}else if(j.value.response.comments[i].is_man==2){html_text+='alien';}else{html_text+='woman';}
html_text+='.gif" alt="'+j.value.response.comments[i].user_name+'" />';}
html_text+='</td>';html_text+='<td class="msghead">&nbsp; ';html_text+=j.value.response.comments[i].added_at;html_text+=' &nbsp; <img src="'+request_0+'images/quote.gif" alt="Цитировать" class="finger" onclick="addBBCode(\'[quote='+j.value.response.comments[i].user_name+']'+j.value.response.comments[i].comm+'[/quote]\');" /> </td><td class="msghead right"><a href="'+request_0+'user_profile/';html_text+=j.value.response.comments[i].user_id;html_text+='/" class="user_link">&nbsp;'+j.value.response.comments[i].user_name+'&nbsp;</a></td></tr><tr><td colspan="2"><table cellpadding="0" cellspacing="0"><tr><td class="msgbody">'+j.value.response.comments[i].comment;html_text+=' </td></tr></table></td></tr>';}
html_text+='</table></div>';$('#comm_p_container').html(html_text);$('#comment_single_area').val('');if(j.value.pager){html_text='<div class="pager right paddright12">';if(j.value.pager.First){html_text+='<a accesskey="p'+j.value.pager.First+'" href="'+request_0+'singles/'+j.value.single_id+'/'+j.value.pager.First+'/" class="music_a" id="pgr_first">&laquo;</a> '}else{html_text+='<span>&laquo;</span> ';}
if(j.value.pager.Previous){html_text+='<a accesskey="p'+j.value.pager.Previous+'" href="'+request_0+'singles/'+j.value.single_id+'/'+j.value.pager.Previous+'/" class="music_a" id="pgr_first">&lsaquo;</a> ';}else{html_text+='<span>&lsaquo;</span> ';}
for(var i in j.value.pager.Numbers){if(j.value.pager.Numbers[i]!=j.value.pager.Current){html_text+='<a accesskey="p'+j.value.pager.Numbers[i]+'" href="'+request_0+'singles/'+j.value.single_id+'/'+j.value.pager.Numbers[i]+'/" class="music_a" id="pgr_first">'+j.value.pager.Numbers[i]+'</a> ';}else{html_text+='<span>'+j.value.pager.Numbers[i]+'</span> ';}}
if(j.value.pager.Next){html_text+='<a accesskey="p'+j.value.pager.Next+'" href="'+request_0+'singles/'+j.value.single_id+'/'+j.value.pager.Next+'/" class="music_a" id="pgr_first">&rsaquo;</a> ';}else{html_text+='<span>&rsaquo;</span> ';}
if(j.value.pager.Last){html_text+='<a accesskey="p'+j.value.pager.Last+'" href="'+request_0+'singles/'+j.value.single_id+'/'+j.value.pager.Last+'/" class="music_a" id="pgr_first">&raquo;</a> ';}else{html_text+='<span>&raquo;</span> ';}
html_text+='</div>';$('.a_buttons_block').html(html_text);$('.music_a').click(function(){LoadCommentsPage(this);return false;});}
$('#user_send_comment').attr('disabled',false);$('#commpan').jScrollPane({showArrows:true});$('.user_link').click(function(){return ShowUser(this);});document.location=request_0+'#singles-'+song_id+'-1';currentState=document.location.hash;}else{if(strlen(j.value.error_message)>0){show_alert('ОШИБКА','<br /><br /><br />'+j.value.error_message);}}
$('#ajaxload').hide();});return false;}
function LoadCommentsPage(el){$('#ajaxload').show();$.getJSON(request_0+'jx/get_song_comments/',{url:$(el).attr('href')},function(j){if(j.value.correct==1){html_text='<div id="commpan"><table cellpadding="0" cellspacing="0" width="100%">';sid=0;for(var i in j.value.response.comments){html_text+='<tr><td class="smallava" rowspan="2">';if(j.value.response.comments[i].avatar_picture.length>0){html_text+='<img height="50" src="'+request_0+'images/user_images/'+j.value.response.comments[i].user_id+'/avatar/'+j.value.response.comments[i].avatar_picture+'.jpg" alt="'+j.value.response.comments[i].user_name+'" />';}else{html_text+='<img height="50" src="'+request_0+'images/ava_';if(j.value.response.comments[i].is_man==1){html_text+='man';}else if(j.value.response.comments[i].is_man==2){html_text+='alien';}else{html_text+='woman';}
html_text+='.gif" alt="'+j.value.response.comments[i].user_name+'" />';}
html_text+='</td>';html_text+='<td class="msghead">&nbsp; ';html_text+=j.value.response.comments[i].added_at;html_text+=' &nbsp; <img src="'+request_0+'images/quote.gif" alt="Цитировать" class="finger" onclick="addBBCode(\'[quote='+j.value.response.comments[i].user_name+']'+j.value.response.comments[i].comm+'[/quote]\');" /> </td><td class="msghead right"><a href="'+request_0+'user_profile/';html_text+=j.value.response.comments[i].user_id;html_text+='/" class="user_link">&nbsp;'+j.value.response.comments[i].user_name+'&nbsp;</a></td></tr><tr><td colspan="2"><table cellpadding="0" cellspacing="0"><tr><td class="msgbody">'+j.value.response.comments[i].comment;html_text+=' </td></tr></table></td></tr>';}
html_text+='</table></div>';current_comment_page=j.value.current;$('#comm_p_container').html(html_text);$('#comment_single_area').val('');if(j.value.pager){html_text='<div class="pager right paddright12">';if(j.value.pager.First){html_text+='<a accesskey="p'+j.value.pager.First+'" href="'+request_0+'singles/'+j.value.single_id+'/'+j.value.pager.First+'/" class="music_a" id="pgr_first">&laquo;</a> '}else{html_text+='<span>&laquo;</span> ';}
if(j.value.pager.Previous){html_text+='<a accesskey="p'+j.value.pager.Previous+'" href="'+request_0+'singles/'+j.value.single_id+'/'+j.value.pager.Previous+'/" class="music_a" id="pgr_first">&lsaquo;</a> ';}else{html_text+='<span>&lsaquo;</span> ';}
for(var i in j.value.pager.Numbers){if(j.value.pager.Numbers[i]!=j.value.pager.Current){html_text+='<a accesskey="p'+j.value.pager.Numbers[i]+'" href="'+request_0+'singles/'+j.value.single_id+'/'+j.value.pager.Numbers[i]+'/" class="music_a" id="pgr_first">'+j.value.pager.Numbers[i]+'</a> ';}else{html_text+='<span>'+j.value.pager.Numbers[i]+'</span> ';}}
if(j.value.pager.Next){html_text+='<a accesskey="p'+j.value.pager.Next+'" href="'+request_0+'singles/'+j.value.single_id+'/'+j.value.pager.Next+'/" class="music_a" id="pgr_first">&rsaquo;</a> ';}else{html_text+='<span>&rsaquo;</span> ';}
if(j.value.pager.Last){html_text+='<a accesskey="p'+j.value.pager.Last+'" href="'+request_0+'singles/'+j.value.single_id+'/'+j.value.pager.Last+'/" class="music_a" id="pgr_first">&raquo;</a> ';}else{html_text+='<span>&raquo;</span> ';}
html_text+='</div>';$('.a_buttons_block').html(html_text);$('.music_a').click(function(){LoadCommentsPage(this);return false;});}
$('#commpan').jScrollPane({showArrows:true});$('.user_link').click(function(){return ShowUser(this);});document.location=request_0+'#singles-'+j.value.single_id+'-'+j.value.pager.Current;currentState=document.location.hash;}else{if(strlen(j.value.error_message)>0){show_alert('ОШИБКА','<br /><br /><br />'+j.value.error_message);}}
$('#ajaxload').hide();});return false;}
function AddUserScore(song_id){$('#ajaxload').show();$.ajax({async:false,timeout:3000,type:'POST',url:request_0+"jx/add_voting/",data:{element_id:song_id,element_flag:'user_musicality'},success:function(answ){if(answ=="K"){$('.add').remove();}else{if(strlen(answ)>0){show_alert("ОШИБКА","<br /><br />"+answ);}}}});$('#ajaxload').hide();return false;}
function MinuseUserScore(song_id){$('#ajaxload').show();$.ajax({async:false,timeout:3000,type:'POST',url:request_0+"jx/add_voting/",data:{element_id:song_id,element_flag:'user_musicality',min:'1'},success:function(answ){if(answ=="K"){$('.add').remove();}else{if(strlen(answ)>0){show_alert("ОШИБКА","<br /><br />"+answ);}}}});$('#ajaxload').hide();return false;}
function PlistDblClick(el_id,name,desc,link){current_play_list_element_id=el_id;createSongPlayerParam(el_id,name,desc,link);$('#playlistparent li').removeClass('nowplay');$('#pllistel_'+el_id).addClass('nowplay');return false;}
function ShowUser(el){values=split('/',$(el).attr('href'));showUserProfile(values[4]);return false;}
function LoadNewsCommentsPage(el){$('#ajaxload').show();$.getJSON(request_0+'jx/get_news_comments/',{url:$(el).attr('href')},function(j){if(j.value.correct==1){html_text='<div id="commpan" class="commpannews"><table cellpadding="0" cellspacing="0" width="100%">';sid=0;for(var i in j.value.response.comments){html_text+='<tr><td class="smallava" rowspan="2">';if(j.value.response.comments[i].avatar_picture.length>0){html_text+='<img height="50" src="'+request_0+'images/user_images/'+j.value.response.comments[i].user_id+'/avatar/'+j.value.response.comments[i].avatar_picture+'.jpg" alt="'+j.value.response.comments[i].user_name+'" />';}else{html_text+='<img height="50" src="'+request_0+'images/ava_';if(j.value.response.comments[i].is_man==1){html_text+='man';}else if(j.value.response.comments[i].is_man==2){html_text+='alien';}else{html_text+='woman';}
html_text+='.gif" alt="'+j.value.response.comments[i].user_name+'" />';}
html_text+='</td>';html_text+='<td class="msghead">&nbsp; ';html_text+=j.value.response.comments[i].added_at;html_text+=' &nbsp; <img src="'+request_0+'images/quote.gif" alt="Цитировать" class="finger" onclick="addBBCode(\'[quote='+j.value.response.comments[i].user_name+']'+j.value.response.comments[i].comm+'[/quote]\');" /> </td><td class="msghead right"><a href="'+request_0+'user_profile/';html_text+=j.value.response.comments[i].user_id;html_text+='/" class="user_link">&nbsp;'+j.value.response.comments[i].user_name+'&nbsp;</a></td></tr><tr><td colspan="2"><table cellpadding="0" cellspacing="0"><tr><td class="msgbody">'+j.value.response.comments[i].comment;html_text+=' </td></tr></table></td></tr>';if(sid<1){sid=j.value.response.comments[i].news_id;}}
html_text+='</table></div>';current_comment_page=j.value.current;$('#comm_p_container').html(html_text);$('#comment_single_area').val('');if(j.value.pager){html_text='<div class="pager right paddright12">';if(j.value.pager.First){html_text+='<a accesskey="p'+j.value.pager.First+'" href="'+request_0+'news/'+j.value.news_id+'/'+j.value.pager.First+'/" class="music_a" id="pgr_first">&laquo;</a> '}else{html_text+='<span>&laquo;</span> ';}
if(j.value.pager.Previous){html_text+='<a accesskey="p'+j.value.pager.Previous+'" href="'+request_0+'news/'+j.value.news_id+'/'+j.value.pager.Previous+'/" class="music_a" id="pgr_first">&lsaquo;</a> ';}else{html_text+='<span>&lsaquo;</span> ';}
for(var i in j.value.pager.Numbers){if(j.value.pager.Numbers[i]!=j.value.pager.Current){html_text+='<a accesskey="p'+j.value.pager.Numbers[i]+'" href="'+request_0+'news/'+j.value.news_id+'/'+j.value.pager.Numbers[i]+'/" class="music_a" id="pgr_first">'+j.value.pager.Numbers[i]+'</a> ';}else{html_text+='<span>'+j.value.pager.Numbers[i]+'</span> ';}}
if(j.value.pager.Next){html_text+='<a accesskey="p'+j.value.pager.Next+'" href="'+request_0+'news/'+j.value.news_id+'/'+j.value.pager.Next+'/" class="music_a" id="pgr_first">&rsaquo;</a> ';}else{html_text+='<span>&rsaquo;</span> ';}
if(j.value.pager.Last){html_text+='<a accesskey="p'+j.value.pager.Last+'" href="'+request_0+'news/'+j.value.news_id+'/'+j.value.pager.Last+'/" class="music_a" id="pgr_first">&raquo;</a> ';}else{html_text+='<span>&raquo;</span> ';}
html_text+='</div>';$('.a_buttons_block').html(html_text);$('.music_a').click(function(){LoadNewsCommentsPage(this);return false;});}
$('#commpan').jScrollPane({showArrows:true});$('.user_link').click(function(){return ShowUser(this);});document.location=request_0+'#news_single-'+sid+'-'+j.value.pager.Current;currentState=document.location.hash;}else{if(strlen(j.value.error_message)>0){show_alert('ОШИБКА','<br /><br /><br />'+j.value.error_message);}}
$('#ajaxload').hide();});return false;}
function SendUserNewsComment(news_id){$('#ajaxload').show();$.getJSON(request_0+'jx/send_user_news_comment/',{news_id:news_id,comm:$('#comment_single_area').val()},function(j){if(j.value.correct==1){html_text='<div id="commpan" class="commpannews"><table cellpadding="0" cellspacing="0" width="100%">';for(var i in j.value.response.comments){html_text+='<tr><td class="smallava" rowspan="2">';if(j.value.response.comments[i].avatar_picture.length>0){html_text+='<img height="50" src="'+request_0+'images/user_images/'+j.value.response.comments[i].user_id+'/avatar/'+j.value.response.comments[i].avatar_picture+'.jpg" alt="'+j.value.response.comments[i].user_name+'" />';}else{html_text+='<img height="50" src="'+request_0+'images/ava_';if(j.value.response.comments[i].is_man==1){html_text+='man';}else if(j.value.response.comments[i].is_man==2){html_text+='alien';}else{html_text+='woman';}
html_text+='.gif" alt="'+j.value.response.comments[i].user_name+'" />';}
html_text+='</td>';html_text+='<td class="msghead">&nbsp; ';html_text+=j.value.response.comments[i].added_at;html_text+=' &nbsp; <img src="'+request_0+'images/quote.gif" alt="Цитировать" class="finger" onclick="addBBCode(\'[quote='+j.value.response.comments[i].user_name+']'+j.value.response.comments[i].comm+'[/quote]\');" /> </td><td class="msghead right"><a href="'+request_0+'user_profile/';html_text+=j.value.response.comments[i].user_id;html_text+='/" class="user_link">&nbsp;'+j.value.response.comments[i].user_name+'&nbsp;</a></td></tr><tr><td colspan="2"><table cellpadding="0" cellspacing="0"><tr><td class="msgbody">'+j.value.response.comments[i].comment;html_text+=' </td></tr></table></td></tr>';}
html_text+='</table></div>';current_comment_page=j.value.current;$('#comm_p_container').html(html_text);$('#comment_single_area').val('');if(j.value.pager){html_text='<div class="pager right paddright12">';if(j.value.pager.First){html_text+='<a accesskey="p'+j.value.pager.First+'" href="'+request_0+'news/'+j.value.news_id+'/'+j.value.pager.First+'/" class="music_a" id="pgr_first">&laquo;</a> '}else{html_text+='<span>&laquo;</span> ';}
if(j.value.pager.Previous){html_text+='<a accesskey="p'+j.value.pager.Previous+'" href="'+request_0+'news/'+j.value.news_id+'/'+j.value.pager.Previous+'/" class="music_a" id="pgr_first">&lsaquo;</a> ';}else{html_text+='<span>&lsaquo;</span> ';}
for(var i in j.value.pager.Numbers){if(j.value.pager.Numbers[i]!=j.value.pager.Current){html_text+='<a accesskey="p'+j.value.pager.Numbers[i]+'" href="'+request_0+'news/'+j.value.news_id+'/'+j.value.pager.Numbers[i]+'/" class="music_a" id="pgr_first">'+j.value.pager.Numbers[i]+'</a> ';}else{html_text+='<span>'+j.value.pager.Numbers[i]+'</span> ';}}
if(j.value.pager.Next){html_text+='<a accesskey="p'+j.value.pager.Next+'" href="'+request_0+'news/'+j.value.news_id+'/'+j.value.pager.Next+'/" class="music_a" id="pgr_first">&rsaquo;</a> ';}else{html_text+='<span>&rsaquo;</span> ';}
if(j.value.pager.Last){html_text+='<a accesskey="p'+j.value.pager.Last+'" href="'+request_0+'news/'+j.value.news_id+'/'+j.value.pager.Last+'/" class="music_a" id="pgr_first">&raquo;</a> ';}else{html_text+='<span>&raquo;</span> ';}
html_text+='</div>';$('.a_buttons_block').html(html_text);$('.music_a').click(function(){LoadNewsCommentsPage(this);return false;});}
$('#commpan').jScrollPane({showArrows:true});$('.user_link').click(function(){return ShowUser(this);});document.location=request_0+'#news_single-'+news_id+'-1';currentState=document.location.hash;}else{if(strlen(j.value.error_message)>0){show_alert('ОШИБКА','<br /><br /><br />'+j.value.error_message);}}
$('#ajaxload').hide();});return false;}
function generate_history(history){html_text='<div id="pane1" class="scroll-pane"><table cellpadding="0" cellspacing="0" id="history_table"><tbody>';if(count(history)<1){html_text+='<tr id="empty_history"><td class="invise"></td></tr>';}else{for(i in history){if((history[i].s_name!=null)||(history[i].radio_name!=null)){html_text+='<tr id="pllist_'+history[i].id+'">';html_text+='<td class="width14">&nbsp;</td><td class="history_el" ondblclick="current_play_history_id='+history[i].id+';';if(history[i].element_flag=='radio'){html_text+='createRadioPlayerParam(\''+history[i].element_id+'\', \''+history[i].radio_name+'\', \''+history[i].radio_description+'\', \''+history[i].streamurl+'\')';}else{if(history[i].element_flag=='single'){html_text+='createSongPlayerParam(\''+history[i].id+'\',\''+history[i].auth+'\',\''+history[i].s_name+'\', \''+history[i].lissen_link+'\')';}}
html_text+=';">';if(history[i].element_flag=='radio'){html_text+=history[i].radio_name;}
if(history[i].element_flag=='single'){html_text+=history[i].auth+' <small class="blue">- '+history[i].s_name+'</small>';}
html_text+='</td><td class="fnormal padd2 padhor3" id="pllistime_'+history[i].id+'">'+history[i].visit_time+'</td><td>';if(history[i].element_flag=='single'){html_text+='<img class="gotopage" onclick="generate_song_page('+history[i].element_id+', 1);" src="'+request_0+'images/goto.gif" alt="Перейти к странице" />';}
html_text+='</td></tr>';}}}
html_text+='</tbody></table></div>';$('.history_table_parent').html(html_text);$('.history_el').parent().mouseover(function(){$(this).addClass('hovered');});$('.history_el').parent().mouseout(function(){$(this).removeClass('hovered');});if($('#history').css('display')!='none'){$('#pane1').jScrollPane({showArrows:true});}}
function generate_playlist(plist,plyour){html_text='<ul class="playlistparent" id="playlistparent">';for(i in plist){if(plist[i].s_name!=null){html_text+='<li class="class'+plist[i].id+'" id="pllistel_'+plist[i].id+'"><table class="plist_table" cellpadding="0" cellspacing="0"><tr><td></td><td>';if(plyour=='true'){html_text+='<img src="'+request_0+'images/trash.gif" class="trash" onclick="DeletePlaylistElement('+plist[i].playlist_id+', '+plist[i].id+', '+plist[i].element_id+');" alt="Удалить из плей листа" />';}else{html_text+='&nbsp;';}
html_text+='</td><td class="pllist_el" ondblclick="'+(plyour?'PlistDblClick':'createSongPlayerParam')+'(\''+plist[i].id+'\', \''+plist[i].auth+'\', \''+plist[i].s_name+'\', \''+plist[i].lissen_link+'\');">';html_text+=plist[i].auth+' <small class="blue">- '+plist[i].s_name+'</small>';html_text+='</td><td><img src="'+request_0+'images/goto.gif" class="gotopage" onclick="generate_song_page('+(typeof(plist[i].element_id)!='undefined'?plist[i].element_id:plist[i].id)+', 1);" alt="Перейти к странице" /></td></tr></table></li>';}}
html_text+='</ul>';$('#pane1pllist').html(html_text);}
function exit_login(){$('#ajaxload').show();$.getJSON(request_0+'jx/logout/',{},function(j){$('#ajaxload').hide();$('#menu_item_profile').html('Регистрация');$('#menu_item_profile').attr('id','menu_item_register');$('#menu_item_exit').html('Вход');$('#menu_item_exit').attr('id','menu_item_enter');$('.history_table_parent').html('<div id="pane1" class="scroll-pane"><table cellpadding="0" cellspacing="0" id="history_table"><tbody> <tr id="not_logged_history"><td>История доступна только для зарегистрированых пользователей.</td></tr></tbody></table></div>');$('#playlistparent').html('<li id="not_logged_playlist"><td>Плейлисты доступны только для зарегистрированых пользователей.</td></tr>');$('#dv_chat').html('<div class="chattable_no">Чат доступен только зарегестрированым пользователям.</div>');$('#fav_list_td').html('<select id="favorite_listes" name="favorite_listes" class="stand required""></select>');$('#us_list_td').html('<select id="my_listes" name="my_listes" class="stand required""></select>');$('#favorite_listes_input').val('');$('#my_listes_input').val('...');$('#favorite_listes').selectbox();$('#favorite_listes').change(function(){changeFavPlaylist();});$('#favorite_listes_container').css('width','100px');$('#my_listes').selectbox();$('#my_listes').change(function(){changeMyPlaylist();});$('#my_listes_container').css('width','100px');$('#user_data').addClass('invise');current_playlist_is_your=false;current_playlist_id=0;generate_index_page();});}
function chatSended(j){$('#ajaxload').hide();if(!j.value.error){if(j.value.success){if(!now_update){html_text='';for(i in j.value.response){html_text+='<tr><th><div class="trmsg"><small>';html_text+=j.value.response[i].added_date+'</small> <a href="'+request_0+'">'+j.value.response[i].user_name+'</a>&nbsp; <img src="'+request_0+'images/smlft.gif" alt="" />&nbsp; <a class="norm" href="'+request_0+'">'+j.value.response[i].to_string+'</a></div>';html_text+='</th></tr><tr><td><div class="trmsg"><img src="'+request_0+'images/chatmsg.gif" alt="" /> &nbsp; '+j.value.response[i].message+'</div></td></tr>';}
ths=$('#pane2 table th').remove();$('#pane2 table').html('<tbody>'+html_text+'</tbody>');readyChatParams();}
$('#chat_message').val('');$('#chat_to').val('');$('#chat_message').focus();}else{show_alert("ОШИБКА ДОБАВЛЕНИЯ СООБЩЕНИЯ","<br /><br />Неккоректный запрос к серверу.");}}else{var al_text='<center><table cellpadding="0" cellspacing="0">';al_text+='<tr><td><br /><br /><br /><br /><b>'+j.value.error_message+'</b></td></tr>';al_text+='</table></center>';show_alert("ОШИБКА  ДОБАВЛЕНИЯ СООБЩЕНИЯ",al_text);}
chat_sended=false;}
function UpdateProcessor(){now_update=true;arr=split('-',substr(document.location.hash,1));nm=0;if(arr.length>0){if(arr[0]=='user_messages'){if(arr.length>1){nm=arr[1];}}}
$.getJSON(request_0+'jx/update_processor/',{top_flag:current_top_flag,nm:nm},function(j){if(count(j.value.tops)>0){html_text='';for(var i in j.value.tops){html_text+='<tr><td><a class="ttlink" id="ttl'+j.value.tops[i].id+'" href="'+request_0+'singles/'+j.value.tops[i].id+'/">'+j.value.tops[i].full_name+'</a></td></tr>';}
$('#topmain').html(html_text);$('#topmain a.ttlink').click(function(){generate_song_page(substr($(this).attr('id'),3),1);return false;});}
if(count(j.value.latests)>0){html_text='';for(var i in j.value.latests){html_text+='<tr><td><a class="ttlink" id="ttl'+j.value.latests[i].id+'" href="'+request_0+'singles/'+j.value.latests[i].id+'/">'+j.value.latests[i].full_name+'</a></td></tr>';}
$('#tbl_latests_up tr').remove();$('#tbl_latests_up tbody').html(html_text);$('#tbl_latests_up').html('<tbody>'+$('#tbl_latests_up tbody').html()+'</tbody>');$('#tbl_latests_up a.ttlink').click(function(){generate_song_page(substr($(this).attr('id'),3),1);return false;});}
if(count(j.value.chat)>0){html_text='';for(i in j.value.chat){html_text+='<tr><th><div class="trmsg"><small>';html_text+=j.value.chat[i].added_date+'</small> <a href="'+request_0+'">'+j.value.chat[i].user_name+'</a>&nbsp; <img src="'+request_0+'images/smlft.gif" alt="" />&nbsp; <a class="norm" href="'+request_0+'">'+j.value.chat[i].to_string+'</a></div>';html_text+='</th></tr><tr><td><div class="trmsg"><img src="'+request_0+'images/chatmsg.gif" alt="" /> &nbsp; '+j.value.chat[i].message+'</div></td></tr>';}
$('#pane2 table th').remove();$('#pane2 table').html('<tbody>'+html_text+'</tbody>');readyChatParams();}
if(count(j.value.comments)>0){html_text='';for(i in j.value.comments){crcclass=$('#main_comments table tr:first')[0].className;if(crcclass=='cm1'){crcclass='cm2';}else{crcclass='cm1';}
html_text+='<tr class="'+crcclass+'" onclick="generate_song_page('+j.value.comments[i].single_id+', 1);"><td><img alt="" src="'+request_0+'images/msgbutton.gif"/></td><td>';html_text+=j.value.comments[i].comment+'</td></tr>';}
trs=$('#main_comments table tr').remove();$('#main_comments table').html('<tbody>'+html_text+'</tbody>');}
now_update=false;$('#user_scores').html(j.value.user.scores);$('#if_mess_single').html(j.value.user.message_single);$('#count_us').html(j.value.user.count_messages_users);$('#count_mess').html(j.value.user.count_messages);mess_img=request_0+'images/message'+(parseInt(j.value.user.count_messages)>0?'b':'')+'.gif';if($('#messimg').attr('src')!=mess_img){$('#messimg').attr('src',mess_img);}
if(j.value.user.reload_messages){if(arr.length>1){nmg=arr[1];}else{nmg=0;}
LoadUserMessages(null,'0/0/'+nmg+'/1');}});if((update_timeout==30)||(update_timeout==45)||(update_timeout==60)||(update_timeout==120)||(update_timeout==160)||(update_timeout==300)||(update_timeout==600)||(update_timeout==900)||(update_timeout==1800)||(update_timeout==2700)||(update_timeout==3600)||(update_timeout==7200)||(update_timeout==10800)||(update_timeout==86400)||(update_timeout==20)){}else{update_timeout=20;}
setTimeout('UpdateProcessor()',update_timeout*1000);}
function bodyResize(){hg=Math.floor(($(window).height()-882)/2);if(hg<0)hg=0;$('#body_resizer').css('height',hg+'px');}
function changeLinkRadio(l1,l2,is_link){$('.upf').addClass('invise');if(!is_link){$('#upload_load').removeClass('invise');}else{$('#upload_link').removeClass('invise');}
select_radio(l1,l2);}
function changeLinkRadioImg(l1,l2,l3,is_link){$('.upf').hide();if(!is_link){$('#upload_load').show();}else{$('#upload_link').show();}
set_select_radio(l1,l2,l3);}
function updateImgStatus(){$('#ajaxload').show();$.getJSON(request_0+'jx/upload_file/?upload_file=2',{},function(j){$('#ajaxload').hide();if(typeof(j.value.fname)!='undefined'){if(j.value.fname.length>0){$('#track_img').attr('src',request_0+'images/temp/'+j.value.fname);$('#track_file').val(j.value.fname);$('#del_upl').css('display','');$('#water_mark').css('display',$('#water').attr('checked')?'':'none');}}});}
var curr_upl_images=new Array();function getCurrImages(){$('#ajaxload').show();$.getJSON(request_0+'jx/upload_file/?upload_file=4',{author:$('#author').val(),sname:$('#sname').val()},function(j){$('#ajaxload').hide();if(j.value.files.length>0){curr_upl_images=j.value.files;}else{curr_upl_images=new Array();}
showImages(1);});}
function showImages(pnum){html_text='';pgs=Math.ceil(curr_upl_images.length/8);html_text+='<div class="a_buttons_block"><div class="pager">';if(pgs>1){for(i=1;i<=pgs;i++){if(i==pnum){html_text+='<span class="span">'+i+'</span>&nbsp;';}else{html_text+='<a href="'+request_0+'" onclick="return showImages('+i+')">'+i+'</a>&nbsp;';}}}
if(curr_upl_images.length<1){html_text+='<span class="normalweight fsize11">Похожих треков не найдено (поиск производиться по полям "Автор" и "Название")</span>';}
html_text+='&nbsp; &nbsp; &nbsp; <img class="v_center width15imp finger" onclick="getCurrImages();" src="'+request_0+'images/refresh.gif" alt="Обновить" /></div></div>';html_text+='<div class="spacer1"></div><div class="styleline3"></div><div class="spacer1"></div>';for(i=((pnum-1)*8);i<(((pnum-1)*8+8));i++){if(curr_upl_images.length>i){html_text+="<div class='loaddiv imgbrd' id='limdiv"+curr_upl_images[i].image+"'><img height='75' width='75' src='"+request_0+"images/artist/small/"+curr_upl_images[i].image+"' alt='' /><br /><span class='spauth'>"+curr_upl_images[i].author+"</span><span class='spnm'>"+curr_upl_images[i].singlename+"</span></div>";}}
html_text+='<div class="clear"></div>';$('#divsel').html(html_text);$('.loaddiv').click(function(){$('.loaddiv img').css('width','75px').css('height','75px').css('border','solid 1px #6C7072');$(this).find('img').css('height','73px').css('width','73px').css('border','dotted 2px #c38b1f');$('#track_file_2').val($(this).attr('id').substr(6));});return false;}
function changeWater(l1,l2){change_check(l1,l2);if($('#del_upl').css('display')!='none'){$('#water_mark').css('display',$('#water').attr('checked')?'':'none');}}
function changeWaterPict(l1,l2){change_check(l1,l2);if($('#del_upl').css('display')!='none'){$('#water_mark').css('display',$('#water').attr('checked')?'':'none');}
setUserPhotoUploader(($('#water').attr('checked')?1:0),$('#galery_selector').val(),add_file_hash,max_queue_photos);}
function SendUserWall(user_id){$('#ajaxload').show();$.getJSON(request_0+'jx/send_user_wall_comment/',{user_id:user_id,comm:$('#comment_single_area_popup').val()},function(j){if(j.value.correct==1){html_text='<div id="commpan_popup"><table cellpadding="0" cellspacing="0" width="100%">';for(var i in j.value.response.comments){html_text+='<tr><td class="msghead">';html_text+=j.value.response.comments[i].added_at;html_text+='</td><td class="msghead right"><a href="'+request_0+'user_profile/';html_text+=j.value.response.comments[i].user_id;html_text+='/" class="user_link">&nbsp;'+j.value.response.comments[i].user_name+'&nbsp;</a></td></tr><tr><td colspan="2" class="msgbody"><table cellpadding="0" cellspacing="0"><tr><td class="smallava">';if(strlen(j.value.response.comments[i].avatar_picture)>0){html_text+='<img height="50" src="'+request_0+'images/user_images/'+j.value.response.comments[i].from_user_id+'/avatar/'+j.value.response.comments[i].avatar_picture+'.jpg" alt="'+j.value.response.comments[i].login+'" />';}else{html_text+='<img height="50" src="'+request_0+'images/ava_';if(j.value.response.comments[i].is_man==1){html_text+='man';}else{if(j.value.response.comments[i].is_man==2){html_text+='alien';}else{html_text+='woman';}}
html_text+='.gif" alt="'+j.value.response.comments[i].login+'" />';}
html_text+='</td><td class="paddleft4">';html_text+=j.value.response.comments[i].comment;html_text+=' <img src="'+request_0+'images/quote.gif" alt="Цитировать" class="finger" onclick="addBBCodePopup(\'[quote='+j.value.response.comments[i].user_name+']'+j.value.response.comments[i].comm+'[/quote]\');" /></td></tr>';html_text+='</td></tr></table>';html_text+='</td></tr>';}
html_text+='</table></div>';current_comment_page=j.value.current;$('#comm_p_container_popup').html(html_text);$('#comment_single_area_popup').val('');if(j.value.pager){html_text='<div class="pager">';if(j.value.pager.First){html_text+='<a accesskey="p'+j.value.pager.First+'" href="'+request_0+'user_wall/'+j.value.user_id+'/'+j.value.pager.First+'/" class="music_a">&laquo;</a> '}else{html_text+='<span>&laquo;</span> ';}
if(j.value.pager.Previous){html_text+='<a accesskey="p'+j.value.pager.Previous+'" href="'+request_0+'user_wall/'+j.value.user_id+'/'+j.value.pager.Previous+'/" class="music_a">&lsaquo;</a> ';}else{html_text+='<span>&lsaquo;</span> ';}
for(var i in j.value.pager.Numbers){if(j.value.pager.Numbers[i]!=j.value.pager.Current){html_text+='<a accesskey="p'+j.value.pager.Numbers[i]+'" href="'+request_0+'user_wall/'+j.value.user_id+'/'+j.value.pager.Numbers[i]+'/" class="music_a">'+j.value.pager.Numbers[i]+'</a> ';}else{html_text+='<span>'+j.value.pager.Numbers[i]+'</span> ';}}
if(j.value.pager.Next){html_text+='<a accesskey="p'+j.value.pager.Next+'" href="'+request_0+'user_wall/'+j.value.user_id+'/'+j.value.pager.Next+'/" class="music_a">&rsaquo;</a> ';}else{html_text+='<span>&rsaquo;</span> ';}
if(j.value.pager.Last){html_text+='<a accesskey="p'+j.value.pager.Last+'" href="'+request_0+'user_wall/'+j.value.user_id+'/'+j.value.pager.Last+'/" class="music_a">&raquo;</a> ';}else{html_text+='<span>&raquo;</span> ';}
html_text+='</div>';$('.a_buttons_block').html(html_text);$('.music_a').click(function(){LoadUserWall(this);return false;});}
$('#commpan_popup').jScrollPane({showArrows:true});$('.user_link').click(function(){return ShowUser(this);});}else{if(strlen(j.value.error_message)>0){show_alert('ОШИБКА','<br /><br /><br />'+j.value.error_message);}}
$('#ajaxload').hide();});return false;}
function LoadUserWall(el){$('#ajaxload').show();$.getJSON(request_0+'jx/get_wall_comments/',{url:$(el).attr('href')},function(j){if(j.value.correct==1){html_text='<div id="commpan_popup"><table cellpadding="0" cellspacing="0" width="100%">';for(var i in j.value.response.comments){html_text+='<tr><td class="msghead">';html_text+=j.value.response.comments[i].added_at;html_text+='</td><td class="msghead right"><a href="'+request_0+'user_profile/';html_text+=j.value.response.comments[i].user_id;html_text+='/" class="user_link">&nbsp;'+j.value.response.comments[i].user_name+'&nbsp;</a></td></tr><tr><td colspan="2" class="msgbody"><table cellpadding="0" cellspacing="0"><tr><td class="smallava">';if(strlen(j.value.response.comments[i].avatar_picture)>0){html_text+='<img height="50" src="'+request_0+'images/user_images/'+j.value.response.comments[i].from_user_id+'/avatar/'+j.value.response.comments[i].avatar_picture+'.jpg" alt="'+j.value.response.comments[i].login+'" />';}else{html_text+='<img height="50" src="'+request_0+'images/ava_';if(j.value.response.comments[i].is_man==1){html_text+='man';}else{if(j.value.response.comments[i].is_man==2){html_text+='alien';}else{html_text+='woman';}}
html_text+='.gif" alt="'+j.value.response.comments[i].login+'" />';}
html_text+='</td><td class="paddleft4">';html_text+=j.value.response.comments[i].comment;html_text+=' <img src="'+request_0+'images/quote.gif" alt="Цитировать" class="finger" onclick="addBBCodePopup(\'[quote='+j.value.response.comments[i].user_name+']'+j.value.response.comments[i].comm+'[/quote]\');" /></td></tr>';html_text+='</td></tr></table>';html_text+='</td></tr>';}
html_text+='</table></div>';current_comment_page=j.value.current;$('#comm_p_container_popup').html(html_text);if(j.value.pager){html_text='<div class="pager">';if(j.value.pager.First){html_text+='<a accesskey="p'+j.value.pager.First+'" href="'+request_0+'user_wall/'+j.value.user_id+'/'+j.value.pager.First+'/" class="music_a">&laquo;</a> '}else{html_text+='<span>&laquo;</span> ';}
if(j.value.pager.Previous){html_text+='<a accesskey="p'+j.value.pager.Previous+'" href="'+request_0+'user_wall/'+j.value.user_id+'/'+j.value.pager.Previous+'/" class="music_a">&lsaquo;</a> ';}else{html_text+='<span>&lsaquo;</span> ';}
for(var i in j.value.pager.Numbers){if(j.value.pager.Numbers[i]!=j.value.pager.Current){html_text+='<a accesskey="p'+j.value.pager.Numbers[i]+'" href="'+request_0+'user_wall/'+j.value.user_id+'/'+j.value.pager.Numbers[i]+'/" class="music_a">'+j.value.pager.Numbers[i]+'</a> ';}else{html_text+='<span>'+j.value.pager.Numbers[i]+'</span> ';}}
if(j.value.pager.Next){html_text+='<a accesskey="p'+j.value.pager.Next+'" href="'+request_0+'user_wall/'+j.value.user_id+'/'+j.value.pager.Next+'/" class="music_a">&rsaquo;</a> ';}else{html_text+='<span>&rsaquo;</span> ';}
if(j.value.pager.Last){html_text+='<a accesskey="p'+j.value.pager.Last+'" href="'+request_0+'user_wall/'+j.value.user_id+'/'+j.value.pager.Last+'/" class="music_a">&raquo;</a> ';}else{html_text+='<span>&raquo;</span> ';}
html_text+='</div>';$('.a_buttons_block').html(html_text);$('.music_a').click(function(){LoadUserWall(this);return false;});}
$('#commpan_popup').jScrollPane({showArrows:true});$('.user_link').click(function(){return ShowUser(this);});document.location=request_0+'#user_wall-'+getIdFromHrefPrev($(el).attr('href'))+'-'+(j.value.pager?j.value.pager.Current:'1');currentState=document.location.hash;}else{if(strlen(j.value.error_message)>0){show_alert('ОШИБКА','<br /><br /><br />'+j.value.error_message);}}
$('#ajaxload').hide();});return false;}
function objectLength(obj){var i=0;for(j in obj){i++;}
return i;}
function setPhotoVote(photo_id,score,pid){$('#ajaxload').show();$.getJSON(request_0+'jx/add_voting/',{element_id:photo_id,score:score,element_flag:'photo'},function(j){if(j.value.correct==1){html_text='<tr><td';if(score>0){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(score>1){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(score>2){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(score>3){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(score>4){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(score>5){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(score>6){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(score>7){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(score>8){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(score==10){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td></tr>';$('#photo_vote_tbl').html(html_text);$('#img_rate_div').css('width',j.value.pecent+'%');$('#img_rate_percent').html(j.value.pecent);$('#img_voting_count').html(j.value.count);$('#gal_p_'+pid).data('rate',j.value.pecent);$('#gal_p_'+pid).data('count',j.value.count);$('#gal_p_'+pid).data('yvote',score);}
$('#ajaxload').hide();});}
function loadUserGallery(user_id,gal_id,curr_user_gl){$('#ajaxload').show();$.getJSON(request_0+'jx/get_user_galery/',{user_id:user_id,gal_id:gal_id},function(j){if(!j.value.error){$('#mgal_desc').html(j.value.galery.description);if(j.value.images.length<1){html_text='<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center><b>Гелерея пуста</b></center>';$('#galeries_photos').html('');$('#image_big').html(html_text);}else{html_text='<table cellpadding="0" cellspacing="0" class="votting_photo"><tr><td class="top width205">Рейтинг:<br /><br /> <div class="stp"><b class="song_single_rate"> <span id="img_rate_percent">';html_text+=j.value.images[0].rate+'</span>% (<span id="img_voting_count">'+j.value.images[0].count+'</span> голос(ов))</b><div class="rate zin2" id="img_rate_div" style="width: '+j.value.images[0].rate+'%;"><img alt="Рейтинг" src="'+request_0+'images/pbs.png"/></div></div></td><td class="width270"><center><img id="main_gal_img" height="200" src="'+request_0+'images/user_images/'+user_id+'/profile/'+j.value.images[0].image+'" alt="'+j.value.images[0].description+'" /><br /><i class="yello" id="gal_desc">'+j.value.images[0].description+'</i></center></td><td class="top">Ваш голос:<br /><br /><table cellpadding="0" cellspacing="0" class="" id="photo_vote_tbl"><tr>';if((curr_user_gl>0)&&(j.value.images[0].vot_score==null)){html_text+='<td class="crclfill" onmouseover="setcircle(1);" onclick="setPhotoVote('+j.value.images[0].id+', 1, 1);" id="r1"> &nbsp; </td>';html_text+='<td class="crclfill" onmouseover="setcircle(2);" onclick="setPhotoVote('+j.value.images[0].id+', 2, 1);" id="r2"> &nbsp; </td>';html_text+='<td class="crclfill" onmouseover="setcircle(3);" onclick="setPhotoVote('+j.value.images[0].id+', 3, 1);" id="r3"> &nbsp; </td>';html_text+='<td class="crclfill" onmouseover="setcircle(4);" onclick="setPhotoVote('+j.value.images[0].id+', 4, 1);" id="r4"> &nbsp; </td>';html_text+='<td class="crclfill" onmouseover="setcircle(5);" onclick="setPhotoVote('+j.value.images[0].id+', 5, 1);" id="r5"> &nbsp; </td>';html_text+='<td class="crclfill" onmouseover="setcircle(6);" onclick="setPhotoVote('+j.value.images[0].id+', 6, 1);" id="r6"> &nbsp; </td>';html_text+='<td class="crclfill" onmouseover="setcircle(7);" onclick="setPhotoVote('+j.value.images[0].id+', 7, 1);" id="r7"> &nbsp; </td>';html_text+='<td class="crclfill" onmouseover="setcircle(8);" onclick="setPhotoVote('+j.value.images[0].id+', 8, 1);" id="r8"> &nbsp; </td>';html_text+='<td class="crclfill" onmouseover="setcircle(9);" onclick="setPhotoVote('+j.value.images[0].id+', 9, 1);" id="r9"> &nbsp; </td>';html_text+='<td class="crclfill" onmouseover="setcircle(10);" onclick="setPhotoVote('+j.value.images[0].id+', 10, 1);" id="r10"> &nbsp; </td>';}else{html_text+='<td';if(j.value.images[0].vot_score>0){html_text+=' class="crclerd"';}
html_text+='> &nbsp; </td>';html_text+='<td';if(j.value.images[0].vot_score>1){html_text+=' class="crclerd"';}
html_text+='> &nbsp; </td>';html_text+='<td';if(j.value.images[0].vot_score>2){html_text+=' class="crclerd"';}
html_text+='> &nbsp; </td>';html_text+='<td';if(j.value.images[0].vot_score>3){html_text+=' class="crclerd"';}
html_text+='> &nbsp; </td>';html_text+='<td';if(j.value.images[0].vot_score>4){html_text+=' class="crclerd"';}
html_text+='> &nbsp; </td>';html_text+='<td';if(j.value.images[0].vot_score>5){html_text+=' class="crclerd"';}
html_text+='> &nbsp; </td>';html_text+='<td';if(j.value.images[0].vot_score>6){html_text+=' class="crclerd"';}
html_text+='> &nbsp; </td>';html_text+='<td';if(j.value.images[0].vot_score>7){html_text+=' class="crclerd"';}
html_text+='> &nbsp; </td>';html_text+='<td';if(j.value.images[0].vot_score>8){html_text+=' class="crclerd"';}
html_text+='> &nbsp; </td>';html_text+='<td';if(j.value.images[0].vot_score==10){html_text+=' class="crclerd"';}
html_text+='> &nbsp; </td>';}
html_text+=' </tr></table></td></tr></table>';$('#image_big').html(html_text);html_text='<table cellpadding="0" cellspacing="0" class="galeries" id="galeries_photos_tb"><tr>';it=1;for(i in j.value.images){html_text+='<td><a href="'+request_0+'user_photo/'+j.value.images[i].user_id+'/'+j.value.images[i].galery_id+'/'+j.value.images[i].id+'/"><img title="'+j.value.images[i].rate+'/'+j.value.images[i].count+'/'+j.value.images[i].id+'/'+j.value.images[i].vot_score+'" id="gal_p_'+it+'" height="50" src="'+request_0+'images/user_images/'+j.value.images[i].user_id+'/avatar/'+j.value.images[i].image+'" alt="'+j.value.images[i].description+'" /></a></td>';it++;}
html_text+='</tr></table>';$('#galeries_photos').html(html_text).css('margin-left','0px');}
$('#galeries_photos img').each(function(){dat=split('/',$(this).attr('title'));$(this).data('rate',dat[0]);$(this).data('count',dat[1]);$(this).data('bid',dat[2]);$(this).data('yvote',dat[3]);$(this).attr('title','');});$('#galeries_photos img').css('opacity','0.5');$('#galeries_photos img:first').css('opacity','1');$('#galeries_photos a').click(function(){return false;});$('#galeries_photos img').click(function(){if($('#galeries_photos').width()<$('#galeries_photos table').width()){tcenter=($('#galeries_photos').width()/2);ttwidth=$('#galeries_photos table').width();wd=$(this).attr('id').substr(6);wd=56*(parseInt(wd));wd=wd-tcenter-28;wd=-wd;if(wd>0){wd=0}
if((-wd)>(ttwidth-tcenter-tcenter)){wd=-(ttwidth-tcenter-tcenter);}
$("#galeries_photos table").animate({marginLeft:wd+'px'});}
if($(this).css('opacity')=='0.5'){$('#galeries_photos img').css('opacity','0.5');$(this).css('opacity','1');im=split('/',$(this).attr('src'));img=im[im.length-1];$('#main_gal_img').attr('src',request_0+'images/user_images/'+user_id_gal+'/profile/'+img);$('#gal_desc').html($(this).attr('alt'));$('#img_rate_div').css('width',($(this).data('rate')*2)+'%');$('#img_rate_percent').html($(this).data('rate'));$('#img_voting_count').html($(this).data('count'));}
if($('#main_gal_big_popup').css('display')!='none'){$('#main_gal_big_popup').hide('fast');}
$('#img_rate_div').css('width',$(this).data('rate')+'%');$('#img_rate_percent').html($(this).data('rate'));$('#img_voting_count').html($(this).data('count'));y_vote=parseInt($(this).data('yvote'));if(y_vote>0){html_text='<tr><td';if(y_vote>0){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(y_vote>1){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(y_vote>2){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(y_vote>3){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(y_vote>4){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(y_vote>5){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(y_vote>6){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(y_vote>7){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(y_vote>8){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(y_vote==10){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td></tr>';$('#photo_vote_tbl').html(html_text);}else{if(curr_user_gl>0){id=$(this).attr('id').substr(6);$('#photo_vote_tbl').html('<tr><td class="crclfill" onmouseover="setcircle(1);" onclick="setPhotoVote('+$(this).data('bid')+', 1, '+id+');" id="r1">&nbsp;</td><td class="crclempty" onmouseover="setcircle(2);" onclick="setPhotoVote('+$(this).data('bid')+', 2, '+id+');" id="r2">&nbsp;</td><td class="crclempty" onmouseover="setcircle(3);" onclick="setPhotoVote('+$(this).data('bid')+', 3, '+id+');" id="r3">&nbsp;</td><td class="crclempty" onmouseover="setcircle(4);" onclick="setPhotoVote('+$(this).data('bid')+', 4, '+id+');" id="r4">&nbsp;</td><td class="crclempty" onmouseover="setcircle(5);" onclick="setPhotoVote('+$(this).data('bid')+', 5, '+id+');" id="r5">&nbsp;</td><td class="crclempty" onmouseover="setcircle(6);" onclick="setPhotoVote('+$(this).data('bid')+', 6, '+id+');" id="r6">&nbsp;</td><td class="crclempty" onmouseover="setcircle(7);" onclick="setPhotoVote('+$(this).data('bid')+', 7, '+id+');" id="r7">&nbsp;</td><td class="crclempty" onmouseover="setcircle(8);" onclick="setPhotoVote('+$(this).data('bid')+', 8, '+id+');" id="r8">&nbsp;</td><td class="crclempty" onmouseover="setcircle(9);" onclick="setPhotoVote('+$(this).data('bid')+', 9, '+id+');" id="r9">&nbsp;</td><td class="crclempty" onmouseover="setcircle(10);" onclick="setPhotoVote('+$(this).data('bid')+', 10, '+id+');" id="r10">&nbsp;</td></tr>');}}
imat=split('/',$(this).parent().attr('href'));document.location=request_0+'#user_photo-'+imat[imat.length-4]+'-'+imat[imat.length-3]+'-'+imat[imat.length-2];currentState=document.location.hash;});$('#main_gal_big_img').click(function(){$('#main_gal_big_popup').hide('fast');});$('#main_gal_img').click(function(){im=split('/',$(this).attr('src'));img=im[im.length-1];$('#main_gal_big_popup').html('<img alt="'+$(this).attr('alt')+'" id="main_gal_big_img" src="'+request_0+'images/user_images/'+user_id_gal+'/'+img+'"/>');$('#main_gal_big_img').click(function(){$('#main_gal_big_popup').hide('fast');});$('#main_gal_big_popup').show('fast');});document.location=request_0+'#user_photo-'+user_id+'-'+j.value.galery.id+'-'+((j.value.images.length>0)?j.value.images[0].id:'0');currentState=document.location.hash;}
$('#ajaxload').hide();});}
function SendUserMessage(user_id){$('#ajaxload').show();$('#user_send_comment_popup').attr('disabled','disabled');$.getJSON(request_0+'jx/send_user_message_comment/',{user_id:user_id,comm:$('#comment_single_area_popup').val()},function(j){if(j.value.correct==1){html_text='<div id="commpan_popup"><table cellpadding="0" cellspacing="0" width="100%">';for(var i in j.value.response.comments){html_text+='<tr><td class="msghead">';html_text+=j.value.response.comments[i].added_at;html_text+='</td><td class="msghead right"><a href="'+request_0+'user_profile/';html_text+=j.value.response.comments[i].u2_id;html_text+='/" class="user_link">&nbsp;'+j.value.response.comments[i].u2_login+'&nbsp;</a></td></tr><tr><td colspan="2" class="msgbody"><table cellpadding="0" cellspacing="0"><tr><td class="smallava">';if(strlen(j.value.response.comments[i].u2_avatar_picture)>0){html_text+='<img height="50" src="'+request_0+'images/user_images/'+j.value.response.comments[i].u2_id+'/avatar/'+j.value.response.comments[i].u2_avatar_picture+'.jpg" alt="'+j.value.response.comments[i].u2_login+'" />';}else{html_text+='<img height="50" src="'+request_0+'images/ava_';if(j.value.response.comments[i].u2_is_man==1){html_text+='man';}else{if(j.value.response.comments[i].u2_is_man==2){html_text+='alien';}else{html_text+='woman';}}
html_text+='.gif" alt="'+j.value.response.comments[i].u2_login+'" />';}
html_text+='</td><td class="paddleft4">';html_text+=j.value.response.comments[i].comment;if(j.value.response.comments[i].u2_id!=4){html_text+=' <img src="'+request_0+'images/quote.gif" alt="Цитировать" class="finger" onclick="addBBCodePopup(\'[quote='+j.value.response.comments[i].u2_login+']'+j.value.response.comments[i].comm+'[/quote]\');" />';}
html_text+='</td></tr>';html_text+='</td></tr></table>';html_text+='</td></tr>';}
html_text+='</table></div>';current_comment_page=j.value.current;$('#comm_p_container_popup').html(html_text);$('#comment_single_area_popup').val('');if(j.value.pager){html_text='<div class="pager">';if(j.value.pager.First){html_text+='<a accesskey="p'+j.value.pager.First+'" href="'+request_0+'user_messages/'+j.value.user_id+'/'+j.value.pager.First+'/" class="music_a">&laquo;</a> '}else{html_text+='<span>&laquo;</span> ';}
if(j.value.pager.Previous){html_text+='<a accesskey="p'+j.value.pager.Previous+'" href="'+request_0+'user_messages/'+j.value.user_id+'/'+j.value.pager.Previous+'/" class="music_a">&lsaquo;</a> ';}else{html_text+='<span>&lsaquo;</span> ';}
for(var i in j.value.pager.Numbers){if(j.value.pager.Numbers[i]!=j.value.pager.Current){html_text+='<a accesskey="p'+j.value.pager.Numbers[i]+'" href="'+request_0+'user_messages/'+j.value.user_id+'/'+j.value.pager.Numbers[i]+'/" class="music_a">'+j.value.pager.Numbers[i]+'</a> ';}else{html_text+='<span>'+j.value.pager.Numbers[i]+'</span> ';}}
if(j.value.pager.Next){html_text+='<a accesskey="p'+j.value.pager.Next+'" href="'+request_0+'user_messages/'+j.value.user_id+'/'+j.value.pager.Next+'/" class="music_a">&rsaquo;</a> ';}else{html_text+='<span>&rsaquo;</span> ';}
if(j.value.pager.Last){html_text+='<a accesskey="p'+j.value.pager.Last+'" href="'+request_0+'user_messages/'+j.value.user_id+'/'+j.value.pager.Last+'/" class="music_a">&raquo;</a> ';}else{html_text+='<span>&raquo;</span> ';}
html_text+='</div>';$('.a_buttons_block').html(html_text);$('.music_a').click(function(){LoadUserMessages(this);return false;});}
$('#commpan_popup').jScrollPane({showArrows:true});$('.user_link').click(function(){return ShowUser(this);});}else{if(strlen(j.value.error_message)>0){show_alert('ОШИБКА','<br /><br /><br />'+j.value.error_message);}}
$('#user_send_comment_popup').attr('disabled',false);$('#ajaxload').hide();});return false;}
function LoadUserMessages(el,is_href){if(typeof(is_href)!='undefined'){rg=is_href;}else{rg=$(el).attr('href');}
$('#ajaxload').show();$.getJSON(request_0+'jx/get_messages_comments/',{url:rg},function(j){if(j.value.correct==1){html_text='<div id="commpan_popup"><table cellpadding="0" cellspacing="0" width="100%">';for(var i in j.value.response.comments){html_text+='<tr><td class="msghead">';html_text+=j.value.response.comments[i].added_at;html_text+='</td><td class="msghead right"><a href="'+request_0+'user_profile/';html_text+=j.value.response.comments[i].u2_id;html_text+='/" class="user_link">&nbsp;'+j.value.response.comments[i].u2_login+'&nbsp;</a></td></tr><tr><td colspan="2" class="msgbody"><table cellpadding="0" cellspacing="0"><tr><td class="smallava">';if(strlen(j.value.response.comments[i].u2_avatar_picture)>0){html_text+='<img height="50" src="'+request_0+'images/user_images/'+j.value.response.comments[i].u2_id+'/avatar/'+j.value.response.comments[i].u2_avatar_picture+'.jpg" alt="'+j.value.response.comments[i].u2_login+'" />';}else{html_text+='<img height="50" src="'+request_0+'images/ava_';if(j.value.response.comments[i].u2_is_man==1){html_text+='man';}else{if(j.value.response.comments[i].u2_is_man==2){html_text+='alien';}else{html_text+='woman';}}
html_text+='.gif" alt="'+j.value.response.comments[i].u2_login+'" />';}
html_text+='</td><td class="paddleft4">';html_text+=j.value.response.comments[i].comment;if(j.value.response.comments[i].u2_id!=4){html_text+=' <img src="'+request_0+'images/quote.gif" alt="Цитировать" class="finger" onclick="addBBCodePopup(\'[quote='+j.value.response.comments[i].u2_login+']'+j.value.response.comments[i].comm+'[/quote]\');" />';}
html_text+='</td></tr>';html_text+='</td></tr></table>';html_text+='</td></tr>';}
html_text+='</table></div>';current_comment_page=j.value.current;$('#comm_p_container_popup').html(html_text);if(j.value.pager){html_text='<div class="pager">';if(j.value.pager.First){html_text+='<a accesskey="p'+j.value.pager.First+'" href="'+request_0+'user_messages/'+j.value.user_id+'/'+j.value.pager.First+'/" class="music_a">&laquo;</a> '}else{html_text+='<span>&laquo;</span> ';}
if(j.value.pager.Previous){html_text+='<a accesskey="p'+j.value.pager.Previous+'" href="'+request_0+'user_messages/'+j.value.user_id+'/'+j.value.pager.Previous+'/" class="music_a">&lsaquo;</a> ';}else{html_text+='<span>&lsaquo;</span> ';}
for(var i in j.value.pager.Numbers){if(j.value.pager.Numbers[i]!=j.value.pager.Current){html_text+='<a accesskey="p'+j.value.pager.Numbers[i]+'" href="'+request_0+'user_messages/'+j.value.user_id+'/'+j.value.pager.Numbers[i]+'/" class="music_a">'+j.value.pager.Numbers[i]+'</a> ';}else{html_text+='<span>'+j.value.pager.Numbers[i]+'</span> ';}}
if(j.value.pager.Next){html_text+='<a accesskey="p'+j.value.pager.Next+'" href="'+request_0+'user_messages/'+j.value.user_id+'/'+j.value.pager.Next+'/" class="music_a">&rsaquo;</a> ';}else{html_text+='<span>&rsaquo;</span> ';}
if(j.value.pager.Last){html_text+='<a accesskey="p'+j.value.pager.Last+'" href="'+request_0+'user_messages/'+j.value.user_id+'/'+j.value.pager.Last+'/" class="music_a">&raquo;</a> ';}else{html_text+='<span>&raquo;</span> ';}
html_text+='</div>';$('.a_buttons_block').html(html_text);$('.music_a').click(function(){LoadUserMessages(this);return false;});}
$('#commpan_popup').jScrollPane({showArrows:true});$('.user_link').click(function(){return ShowUser(this);});}else{if(strlen(j.value.error_message)>0){show_alert('ОШИБКА','<br /><br /><br />'+j.value.error_message);}}
$('#ajaxload').hide();});return false;}
function AddToFriends(user_id){if(user_id<1){return false;}
$('#ajaxload').show();$.getJSON(request_0+'jx/add_friend/',{user_id:user_id},function(j){$('#ajaxload').hide();if(j.value.correct){$('.addtof').attr('src',request_0+'images/wait_to_friends.gif');$('.addtof').attr('onclick','');$('.addtof').attr('alt','Друзья');$('.addtof').attr('title','Ожидание подтверждения на дружбу');$('.addtof').removeClass('finger');$('.addtof').click(function(){return false});}});}
function sendUserPresent(user_id,present_id,comment){if(present_id.length<1){return false;}
if(comment.length>250){$('#present_comment').css('border-color','red');return false;}
$('#ajaxload').show();$.getJSON(request_0+'jx/add_present/',{user_id:user_id,present_id:present_id,comment:comment},function(j){$('#ajaxload').hide();if(j.value.correct){$('#up_'+present_id).fadeTo("fast",0.0,function(){$(this).remove();$('#user_presents_add').jScrollPane({showArrows:true});$('#present_comment').val('');setTimeout('hidePres();',0);});}});}
function hidePres(){if($('#user_presents_add div.user_present').length<1){$('#user_presents_add').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center class="bold">У вас нет подарков, которые можно подарить...</center>');}}
function userInfoTabsSet(){$('table.buttonahref_selected a').click(function(){return false;});$('table.buttonahref a').click(function(){tid=$(this).attr('id');if(tid=='user_profile_tab_1'){showUserProfile(getIdFromHref($(this).attr('href')));}
if(tid=='user_profile_tab_2'){showUserWall(getIdFromHref($(this).attr('href')),1);}
if(tid=='user_profile_tab_3'){showUserGallery(getIdFromHref($(this).attr('href')),1,1);}
if(tid=='user_profile_tab_4'){showUserMessages(getIdFromHref($(this).attr('href')));}
if(tid=='user_profile_tab_5'){showUserPresents(getIdFromHref($(this).attr('href')));}
if(tid=='user_profile_tab_6'){showUserFriends(getIdFromHref($(this).attr('href')));}
return false;});}
function userEditTabsSet(){$('table.buttonahref_selected a').click(function(){return false;});$('table.buttonahref a').click(function(){tid=$(this).attr('id');if(tid=='user_profile_tab_1'){generate_profile_page();}
if(tid=='user_profile_tab_2'){generate_edit_wall(1);}
if(tid=='user_profile_tab_3'){generate_edit_photo();}
if(tid=='user_profile_tab_4'){generate_edit_present();}
if(tid=='user_profile_tab_5'){generate_edit_friends();}
if(tid=='user_profile_tab_6'){generate_edit_playlists();}
return false;});}
function getIdFromHref(ahref){aarr=split('/',ahref);return aarr[aarr.length-2];}
function getIdFromHrefPrev(ahref){aarr=split('/',ahref);return aarr[aarr.length-3];}
function acceptAddToFriend(user_id,element){$('#ajaxload').show();$.getJSON(request_0+'jx/accept_friend/',{user_id:user_id,action:'accept'},function(j){$('#ajaxload').hide();j=j.value;if(j.correct){$(element).parent().html(j.text);$('.user_link').click(function(){return ShowUser(this);});}});return false;}
function rejectAddToFriend(user_id,element){$('#ajaxload').show();$.getJSON(request_0+'jx/accept_friend/',{user_id:user_id,action:'reject'},function(j){$('#ajaxload').hide();j=j.value;if(j.correct){$(element).parent().html(j.text);$('.user_link').click(function(){return ShowUser(this);});}});return false;}
function deleteSetupFavoriteBlock(){$('#set_single_selector').remove();$('#change_favorite_song').removeClass('invise');if(parseInt($('#favorite_song').val())>0){$('#del_favorite_song').removeClass('invise');}}
function deleteWallRecord(record_id,page_id){generate_edit_wall(page_id,record_id);}
function save_gallery(){$('#ajaxload').show();var tmgalid=$('#galery_selector').val();var tmgalnm=$('#gal_name').val();$.getJSON(request_0+'jx/save_gallery/',{galery_id:$('#galery_selector').val(),act:'change_main',name:$('#gal_name').val(),desc:$('#gal_desc').val()},function(j){$('#ajaxload').hide();j=j.value;if(j.correct){$('#o'+tmgalid).html(tmgalnm);$('#'+tmgalid).html(tmgalnm);$('#galery_selector_input').val(tmgalnm);$('#done').show('fast');setTimeout("$('#done').hide('fast')",1000);}});return false;}
function save_image_comment(img_id){$('#ajaxload').show();$.getJSON(request_0+'jx/save_gallery/',{img_id:img_id,act:'change_img_comm',desc:$('#t'+img_id).val()},function(j){$('#ajaxload').hide();j=j.value;if(j.correct){$('.edavarea textarea').css('width','98px');$('#save_img_comm').remove();$('#old_val').remove();}});return false;}
function loadUserEditGallery(gal_id){$('#ajaxload').show();$.getJSON(request_0+'jx/save_gallery/',{gal_id:gal_id,act:'load_gallery'},function(j){$('#ajaxload').hide();j=j.value;if(j.correct){html_text='<div class="upload_over"><table><tr><td valign="middle" class="width130">Осталось: <span id="leas" class="bold">'+j.least_photos+'</span></td><td class="width380"><div id="upload_button" class="paddleft15"></div></td><td><label class="finger" for="water" id="waterlbl" onclick="$(\'#focusinp\').focus();"><img src="'+request_0+'images/checked.gif" id="water_img" class="finger" onclick="$(\'#waterlbl\').click();" alt="" /><input checked="checked" type="checkbox" class="hidden" name="water" onchange="changeWaterPict(this, \'water_img\');" id="water" />&nbsp; Разрешить watermark</label> &nbsp; </td></tr></table></div><div id="commpan_popup_big_pict">';if(count(j.photos)>0){for(i in j.photos){html_text+='<div class="user_photos imgbrd" id="ufdiv'+j.photos[i].id+'"><center><div class="edavareamn"><table width="100%"><tr><td class="norm"><img alt="аватар" src="'+request_0+'images/as_avatar.gif" id="a'+j.photos[i].id+'" class="finger avt';if(j.photos[i].id==j.avid){html_text+=' invise';}
html_text+='" /></td><td class="right norm"><img alt="удалить" src="'+request_0+'images/delete.gif" onclick="deleteUserPicture('+j.photos[i].id+');" class="finger" /></td></tr></table></div><img class="img_user_pres" src="'+request_0+'images/user_images/'+j.curr_user+'/preview/'+j.photos[i].photo+'" alt="изображение" /><div class="edavarea"><textarea id="t'+j.photos[i].id+'">'+j.photos[i].description+'</textarea></div></center></div>';}
html_text+='<div class="clear"></div>';}else{html_text+='<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center class="bold">Пока нет изображений...</center>';}
html_text+='</div>';$('#comm_p_container_popup').html(html_text);var max_queue_photos=j.least_photos;$('#commpan_popup_big_pict').jScrollPane({showArrows:true});setUserPhotoUploader(($('#water').attr('checked')?1:0),$('#galery_selector').val(),add_file_hash,max_queue_photos);if($('#comm_p_container_popup .jScrollArrowUp').length>0){try{$('#commpan_popup_big_pict')[0].scrollTo(9999999);}catch(err){}}
$('.avt').click(function(){var abid=$(this).attr('id');$('#ajaxload').show();$.getJSON(request_0+'jx/save_gallery/',{image_id:substr($(this).attr('id'),1),act:'change_av'},function(j){$('#ajaxload').hide();j=j.value;if(j.correct){$('.avt').show();$('#'+abid).hide();$('#avatar_prev').attr('src',request_0+'images/user_images/'+j.image);$('#no_user_ava').hide();$('#del_user_ava').show();}});});$('.edavarea textarea').focus(function(){if($('#save_img_comm').length>0){if($('#save_img_comm').attr('sid')!=substr($(this).attr('id'),1)){$('#t'+$('#save_img_comm').attr('sid')).val($('#old_val').val());$('#save_img_comm').remove();$('#old_val').remove();}}
$('.edavarea textarea').css('width','98px');$(this).css('width','85px');if($('#save_img_comm').length==0){$(this).after('<img src="'+request_0+'images/save.gif" class="normal_img finger" onclick="save_image_comment('+substr($(this).attr('id'),1)+');" sid="'+substr($(this).attr('id'),1)+'" id="save_img_comm" alt="сохранить"><input type="hidden" id="old_val">');$('#old_val').val($(this).val());}});}});return false;}
function deleteUserPicture(pict_id){$('#ajaxload').show();pict_idt=pict_id;$.getJSON(request_0+'jx/save_gallery/',{pict_id:pict_id,act:'delete_user_pict'},function(j){$('#ajaxload').hide();j=j.value;if(j.correct){if(j.image_av!='stay'){$('#avatar_prev').attr('src',request_0+'images/'+j.image_av);$('#no_user_ava').show();$('#del_user_ava').hide();}
divsn=$('#comm_p_container_popup div.user_photos');if(divsn.length>1){$('#ufdiv'+pict_idt).remove();$('#commpan_popup_big_pict').jScrollPane({showArrows:true});ls=parseInt($('#leas').html())+1;$('#leas').html(ls);max_queue_photos=ls;setUserPhotoUploader(($('#water').attr('checked')?1:0),$('#galery_selector').val(),add_file_hash,ls);}else{$('#ufdiv'+pict_idt).remove();$('#commpan_popup_big_pict').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center class="bold">Пока нет изображений...</center>');ls=parseInt($('#leas').html())+1;$('#leas').html(ls);max_queue_photos=ls;setUserPhotoUploader(($('#water').attr('checked')?1:0),$('#galery_selector').val(),add_file_hash,ls);}}});return false;}
function ChangeUserEditGallery(gal_id,delete_gal_id){$('#ajaxload').show();$.getJSON(request_0+'jx/save_gallery/',{gal_id:gal_id,del_id:delete_gal_id,act:'change_gallery'},function(j){$('#ajaxload').hide();j=j.value;if(j.correct){$('#gal_name').val(j.name);$('#gal_desc').val(j.description);$('#howmuch').html(j.max_photo);html_text='<div class="upload_over"><table><tr><td valign="middle" class="width130">Осталось: <span id="leas" class="bold">'+j.least_photos+'</span></td><td class="width380"><div id="upload_button" class="paddleft15"></div></td><td><label class="finger" for="water" id="waterlbl" onclick="$(\'#focusinp\').focus();"><img src="'+request_0+'images/checked.gif" id="water_img" class="finger" onclick="$(\'#waterlbl\').click();" alt="" /><input checked="checked" type="checkbox" class="hidden" name="water" onchange="changeWaterPict(this, \'water_img\');" id="water" />&nbsp; Разрешить watermark</label> &nbsp; </td></tr></table></div><div id="commpan_popup_big_pict">';if(count(j.photos)>0){for(i in j.photos){html_text+='<div class="user_photos imgbrd" id="ufdiv'+j.photos[i].id+'"><center><div class="edavareamn"><table width="100%"><tr><td class="norm"><img alt="аватар" src="'+request_0+'images/as_avatar.gif" id="a'+j.photos[i].id+'" class="finger avt';if(j.photos[i].id==j.avid){html_text+=' invise';}
html_text+='" /></td><td class="right norm"><img alt="удалить" src="'+request_0+'images/delete.gif" onclick="deleteUserPicture('+j.photos[i].id+');" class="finger" /></td></tr></table></div><img class="img_user_pres" src="'+request_0+'images/user_images/'+j.curr_user+'/preview/'+j.photos[i].photo+'" alt="изображение" /><div class="edavarea"><textarea id="t'+j.photos[i].id+'">'+j.photos[i].description+'</textarea></div></center></div>';}
html_text+='<div class="clear"></div>';}else{html_text+='<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center class="bold">Пока нет изображений...</center>';}
html_text+='</div>';$('#comm_p_container_popup').html(html_text);var max_queue_photos=j.least_photos;$('#commpan_popup_big_pict').jScrollPane({showArrows:true});setUserPhotoUploader(($('#water').attr('checked')?1:0),$('#galery_selector').val(),add_file_hash,max_queue_photos);$('.avt').click(function(){var abid=$(this).attr('id');$('#ajaxload').show();$.getJSON(request_0+'jx/save_gallery/',{image_id:substr($(this).attr('id'),1),act:'change_av'},function(j){$('#ajaxload').hide();j=j.value;if(j.correct){$('.avt').show();$('#'+abid).hide();$('#avatar_prev').attr('src',request_0+'images/user_images/'+j.image);$('#no_user_ava').hide();$('#del_user_ava').show();}});});$('.edavarea textarea').focus(function(){if($('#save_img_comm').length>0){if($('#save_img_comm').attr('sid')!=substr($(this).attr('id'),1)){$('#t'+$('#save_img_comm').attr('sid')).val($('#old_val').val());$('#save_img_comm').remove();$('#old_val').remove();}}
$('.edavarea textarea').css('width','98px');$(this).css('width','85px');if($('#save_img_comm').length==0){$(this).after('<img src="'+request_0+'images/save.gif" class="normal_img finger" onclick="save_image_comment('+substr($(this).attr('id'),1)+');" sid="'+substr($(this).attr('id'),1)+'" id="save_img_comm" alt="сохранить"><input type="hidden" id="old_val">');$('#old_val').val($(this).val());}});}});return false;}
function deleteGallery(){if($('#galery_selector option').length<2){show_alert('Ошибка','<br /><br /><br /><br />У Вас должна оставаться хотя бы одна галлерея.');}else{$('#ajaxload').show();iddelgal=$('#galery_selector').val();$.getJSON(request_0+'jx/save_gallery/',{gal_id:iddelgal,act:'delete_gallery'},function(j){$('#ajaxload').hide();j=j.value;if(j.correct){if(j.image_av!='stay'){$('#avatar_prev').attr('src',request_0+'images/'+j.image_av);$('#no_user_ava').show();$('#del_user_ava').hide();}
$('#o'+iddelgal).remove();$('#'+iddelgal).remove();uls=$('#galery_selector_container li');$(uls[0]).click();}});}}
function setUserPhotoUploader(upl_mark,galid,ushash,maxph){$('#upload_button').html('');if(maxph>0){var conf={url:request_0+'jx/upload_file_photo/?upload_file=1&mark='+upl_mark+'&gal_id='+galid+'&uhash='+ushash,extensions:["Изображения (*.jpg;*.jpeg;*.gif;*.png;)|*.jpg;*.jpeg;*.gif;*.png;"],max_file_size:100*1024*1024,max_queue_count:maxph,multi_file:1,max_queue_size:0,flash_background:request_0+'images/jcu_button.png',file_icon_ready:request_0+'images/jcu_file_ready.gif',file_icon_uploading:request_0+'images/jcu_file_uploading.gif',file_icon_finished:request_0+'images/jcu_file_finished.gif',flash_file:request_0+'js/jcupload.swf',box_height:30,hide_file_after_finish:true,callback:{init:function(){},queue_upload_end:function(uo){loadUserEditGallery(galid);}}};jcu=$.jcuploadUI(conf);jcu.append_to("#upload_button");}}
function deletePresent(id){$('#ajaxload').show();var pid=id;$.getJSON(request_0+'jx/edit_user_presents/',{predent_id:id,act:'delete_present'},function(j){$('#ajaxload').hide();j=j.value;if(j.correct){$('#pres'+pid).remove();if($('#user_presents_edit div.user_present').length<1){$('#user_presents_edit').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center class="bold">Пока нет подарков...</center> ');}
$('#user_presents_edit').jScrollPane({showArrows:true});}});}
function deleteFriend(id,send_message){$('#ajaxload').show();var pid=id;$.getJSON(request_0+'jx/edit_friends/',{friend_id:id,send_message:(send_message==true?1:0),act:'delete'},function(j){$('#ajaxload').hide();j=j.value;if(j.correct){$('#friend'+pid).remove();if($('#user_presents_edit div.user_friend').length<1){$('#user_presents_edit').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><center class="bold">Пока нет друзей...</center> ');}
$('#user_presents_edit').jScrollPane({showArrows:true});}});}
function showEditPlaylist(id){$('#ajaxload').show();var pid=id;$.getJSON(request_0+'jx/edit_playlists/',{plist_id:id,act:'edit_ready',mode:'change'},function(j){$('#ajaxload').hide();j=j.value;if(j.correct){$('#editplist').remove();html_text='<div style="display:none;" class="editplist padd5 dark2 center" id="editplist">Название: <input type="text" id="pname" value="'+j.plist.name+'" class="filter ac_input" /> Описание: <input type="text" id="pdesc" value="'+(j.plist.description!=null?j.plist.description:'')+'" class="filter ac_input" /> Стили: <select class="invise" id="styles" name="styles[]" multiple="multiple" size="5" ><option value="">&nbsp;</option>';for(i in j.styles){html_text+='<option value="'+j.styles[i].id+'"';for(p in j.plist.styles){if(j.plist.styles[p].style_id==j.styles[i].id){html_text+=' selected="selected"';}}
html_text+='>'+j.styles[i].name+'</option>';}
html_text+='</select> <img alt="сохранить" onclick="savePlist('+j.plist.id+');" class="normal_img finger" src="'+request_0+'images/save.gif"></div>';$('#plsd'+j.plist.id).after(html_text);$('#styles').multiSelect({oneOrMoreSelected:'*',tableCols:2,asTable:true,tableClass:'music_styles',divClass:'multiSelectOptions1'});$('#editplist').show('fast',function(){$('#cont').jScrollPane({showArrows:true});});}});}
function setPublicPlaylist(id){$('#ajaxload').show();var pid=id;$.getJSON(request_0+'jx/edit_playlists/',{plist_id:id,act:'publish',mode:'change'},function(j){$('#ajaxload').hide();j=j.value;if(j.correct){$('.pd'+pid).remove();}else{if(strlen(j.error_text)>0){show_alert('Ошибка','<br /><br /><br />'+j.error_text);}}});}
function savePlist(id){inps=$("input[name^='styles']");styles='';for(i=0;i<inps.length;i++){if($(inps[i]).attr('checked')==true){styles+=substr($(inps[i]).attr('id'),6)+';';}}
$('#ajaxload').show();var pid=id;var pn=$('#pname').val();var pd=$('#pdesc').val();var ps=$('#mlststyles').val();$.getJSON(request_0+'jx/edit_playlists/',{plist_id:id,act:'save',name:pn,styles:styles,desc:pd,mode:'change'},function(j){$('#ajaxload').hide();j=j.value;if(j.correct){$('#plnms'+id).html(pn);$('#plnmd'+id).html(pd);if((ps=='')||(ps=='Стиль')){$('#plnmss'+id).html('- Не определено -');}else{$('#plnmss'+id).html(ps);}
$('#my_listes option').each(function(){if($(this).attr('value')==pid){$(this).html(pn);}});$('#my_listes_container li').each(function(){if($(this).attr('id')==pid){$(this).html(pn);}});if((current_playlist_id==pid)&&current_playlist_is_your){$('#my_listes_input').val(pn);}
$('#editplist').hide('fast',function(){$('#editplist').remove();$('#cont').jScrollPane({showArrows:true});});}else{if(strlen(j.error_text)>0){show_alert('Ошибка','<br /><br /><br />'+j.error_text);}}});}
function clearPlist(id){$('#ajaxload').show();var pid=id;$.getJSON(request_0+'jx/edit_playlists/',{plist_id:id,act:'clear',mode:'change'},function(j){$('#ajaxload').hide();j=j.value;if(j.correct){if((current_playlist_id==pid)&&current_playlist_is_your){current_play_list_element_id=-1;$('#playlistparent li').remove();$('#playlistparent').append('');$('#pane1pllist').jScrollPane({showArrows:true});}
show_alert('Готово','<br /><br /><br />Плейлист пуст');}else{if(strlen(j.error_text)>0){show_alert('Ошибка','<br /><br /><br />'+j.error_text);}}});}
function deletePlist(id){$('#ajaxload').show();var pid=id;$.getJSON(request_0+'jx/edit_playlists/',{plist_id:id,act:'delete',mode:'change'},function(j){$('#ajaxload').hide();j=j.value;if(j.correct){v=0;n='';$('#my_listes option').each(function(){if($(this).attr('value')==pid){$(this).remove();}else{if(v<1){v=$(this).attr('value');n=$(this).html();}}});$('#my_listes_container li').each(function(){if($(this).attr('id')==pid){$(this).remove();}});if((current_playlist_id==pid)&&current_playlist_is_your){$('#my_listes_input').val(n);$('#my_listes').val(v);$('#my_listes').change();}
$('.dpl'+id).remove();$('#cont').jScrollPane({showArrows:true});$('#fcnpl').html(parseInt($('#cnpl').html())-1);}else{if(strlen(j.error_text)>0){show_alert('Ошибка','<br /><br /><br />'+j.error_text);}}});}
function deleteFavPlist(id){$('#ajaxload').show();var pid=id;$.getJSON(request_0+'jx/edit_playlists/',{plist_id:id,act:'deletefav',mode:'change'},function(j){$('#ajaxload').hide();j=j.value;if(j.correct){v=0;n='';$('#favorite_listes option').each(function(){if($(this).attr('value')==pid){$(this).remove();}else{if(v<1){v=$(this).attr('value');n=$(this).html();}}});$('#favorite_listes_container li').each(function(){if($(this).attr('id')==pid){$(this).remove();}});if((current_playlist_id==pid)&&(!current_playlist_is_your)){$('#favorite_listes_input').val(n);$('#favorite_listes').val(v);$('#favorite_listes').change();}
$('.fdpl'+id).remove();$('#cont').jScrollPane({showArrows:true});$('#fcnpl').html(parseInt($('#fcnpl').html())-1);}else{if(strlen(j.error_text)>0){show_alert('Ошибка','<br /><br /><br />'+j.error_text);}}});}
function changePositivity(id,positive){$('#ajaxload').show();$.ajax({async:false,timeout:3000,type:'POST',url:request_0+"jx/add_voting/",data:{element_id:id,element_flag:'positivity',add:(positive==true?'1':'-1')},success:function(answ){if(answ=="K"){$('#uadp'+id).remove();}else{show_alert("ЗАПРЕЩЁННОЕ ДЕЙСТВИЕ","<br /><br />"+answ);}}});$('#ajaxload').hide();}
function removeVoting(single_id){$('#ajaxload').show();$.getJSON(request_0+'jx/add_voting/',{element_id:single_id,element_flag:'single_remove'},function(j){if(j.value.correct==1){html_text='';for(i=1;i<11;i++){html_text+='<td class="crclfill" onmouseover="setcircle('+i+');" onclick="setSingleVote('+single_id+', '+i+');" id="r'+i+'"> &nbsp; </td>';}
$('#single_vote').html('<tr>'+html_text+'</tr>');$('#sort_rate_div').css('width',j.value.pecent+'%');$('#song_rate_percent').html(j.value.pecent);$('#song_voting_count').html(j.value.count);$('#remvot').remove();}
$('#ajaxload').hide();});}
function editStyle(single_id,element){$('#ajaxload').show();$.getJSON(request_0+'jx/edit_style/',{element_id:single_id,element_flag:'get'},function(j){if(j.value.correct==1){html_text=' <span id="speds"><select class="invise" id="edstyles" name="edstyles[]" multiple="multiple" size="5" ><option value="">&nbsp;</option>';for(i in j.value.styles){html_text+='<option value="'+j.value.styles[i].id+'"';if(j.value.styles[i].selected==1){html_text+=' selected="selected"';}
html_text+='>'+j.value.styles[i].name+'</option>';}
html_text+='</select> <img src="'+request_0+'images/save.gif" class="finger" onclick="saveStyle('+single_id+')" /></span>';$('#speds').remove();$(element).after(html_text);$('#edstyles').multiSelect({oneOrMoreSelected:'*',tableCols:2,asTable:true,tableClass:'music_stl',divClass:'multiSelectOptions1'});}
$('#ajaxload').hide();});}
function saveStyle(single_id){$('#ajaxload').show();inps=$("input[name^='styles']");styles='';for(i=0;i<inps.length;i++){if($(inps[i]).attr('checked')==true){styles+=substr($(inps[i]).attr('id'),6)+';';}}
$.getJSON(request_0+'jx/edit_style/',{element_id:single_id,styles:styles,element_flag:'save'},function(j){if(j.value.correct==1){$('#speds').remove();$('#bstyle'+single_id).html(j.value.style);}
$('#ajaxload').hide();});}
function checkLocalState(){if(document.location.hash!=currentState){currentState=document.location.hash;reloadProcessor(2);}
setTimeout('checkLocalState()',500);}
function blinks_start(el){$(el).each(function(){blink_start($(this))});}
function blink_start(el){$(el).fadeOut(2000,function(){blink_end($(this))});}
function blink_end(el){$(el).fadeIn(2000,function(){blink_start($(this))});}
function showPlaylistWindow(id){$('#ajaxload').show();$.getJSON(request_0+'jx/playlist_window/',{id:id},function(j){html='<div class="pwindow">';for(i in j.value){html+='<p><a onclick="$(\'#close_butt\').click();generate_song_page('+j.value[i].element_id+', 1);return false;" href="'+request_0+'/singles/'+j.value[i].element_id+'"><b>'+j.value[i].auth+'</b> - '+j.value[i].s_name+'</a></p>'}
html+='</div>';show_alert('СОДЕРЖИМОЕ ПЛЕЙЛИСТА',html);$('.pwindow').jScrollPane({showArrows:true});$('#ajaxload').hide();});}
function showAddPlistRequest(){var cssObj={'height':'300px','width':'400px'};html_text='<div class="empty_sep7"></div><form method="post" id="login_form" action="'+request_0+'jx/add_request/"><div class="login"><table class="login_table"><tr><td colspan="2" id="login_error">';html_text+='</td></tr><tr><td><textarea value="" id="add_lpaylist_desc" name="add_lpaylist_desc" /></td><td class="left">Описание &nbsp;<img id="add_lpaylist_desc_help" title="Описание того, что вы хотите.<br /> Большая просьба как можно чётче <br /> выражать свои мысли<br /><small><i>Примеры:</i><br /></small>Правильно:<br /><small>- Лучшие треки за последние 3 месяца<br> в стилях Trance и House</small><br />Неправильно:<br /><small>- Самую лучшую музяку</small><br /><small>- Все треки где поёт девка<br>похожая на президента Абаму</small>" src="'+request_0+'images/question.gif" alt="Подсказка" /></td></tr><tr><td><input value="100" type="text" id="add_playlists_count" name="add_playlists_count" />';html_text+='</td><td class="left">Количество треков</td></tr><tr><td colspan="2"><div class="empty_sep7"></div><table cellpadding="0" cellspacing="0" class="widthauto mar_left75"><tr><td>';html_text+='</td></tr></table><div class="empty_sep7"></div></td></tr><tr><td colspan="2"><input type="submit" class="subm" id="log_submit" value="Добавить" /> &nbsp; <input type="button" id="close_butt" value="Закрыть" class="modal_close simplemodal-close"></td></tr><tr><td class="right" colspan="2">';html_text+='</td></tr></table></div></form>';$.modal('<div class="alert_top"></div><div class="alert_center"><h3>ДОБАВИТЬ ЗАПРОС НА СОЗДАНИЕ ПЛЕЙЛИСТА</h3><div class="big_modal_body">'+html_text+'<input type="button" id="close_butt" value="Закрыть" style="border:none;overflow:hidden;height:0px;width:0px;" class="modal_close simplemodal-close"></div></div><div class="alert_bottom"></div>',{containerCss:cssObj});addPlistReady();return false;}
function addPlaylist(id){$('#ajaxload').show();$.getJSON(request_0+'jx/add_plist_to_fav/',{id:id},function(j){if(j.value.correct==1){html='<select class="stand required" name="favorite_listes" id="favorite_listes">'
for(i in j.value.plist){plist=j.value.plist[i];html+='<option value="'+plist.id+'"';if((plist.id==current_playlist_id)&&(!current_playlist_is_your)){html+='selected="selected"';}
html+='>'+plist.name+'</option>';}
html+='</select>';$('#fav_list_td').html(html);$('#favorite_listes').selectbox();$('#favorite_listes').change(function(){changeFavPlaylist();});$('#favorite_listes_container').css('width','100px');if(current_playlist_is_your){$('#favorite_listes_input').val('...');}}else{if(strlen(j.value.error)>0){show_alert('ОШИБКА',j.value.error);}}
$('#ajaxload').hide();});return false;}
function substr(f_string,f_start,f_length){f_string+='';if(f_start<0){f_start+=f_string.length;}
if(f_length==undefined){f_length=f_string.length;}else if(f_length<0){f_length+=f_string.length;}else{f_length+=f_start;}
if(f_length<f_start){f_length=f_start;}
return f_string.substring(f_start,f_length);}
function intval(mixed_var,base){var tmp;var type=typeof(mixed_var);if(type=='boolean'){if(mixed_var==true){return 1;}else{return 0;}}else if(type=='string'){tmp=parseInt(mixed_var*1,10);if(isNaN(tmp)||!isFinite(tmp)){return 0;}else{return tmp.toString(base||10);}}else if(type=='number'&&isFinite(mixed_var)){return Math.floor(mixed_var);}else{return 0;}}
function str_replace(search,replace,subject){var s=subject;var ra=r instanceof Array,sa=s instanceof Array;var f=[].concat(search);var r=[].concat(replace);var i=(s=[].concat(s)).length;var j=0;while(j=0,i--){if(s[i]){while(s[i]=(s[i]+'').split(f[j]).join(ra?r[j]||"":r[0]),++j in f){};}}
return sa?s:s[0];}
function strlen(string){var str=string+'';var i=0,chr='',lgth=0;var getWholeChar=function(str,i){var code=str.charCodeAt(i);var next='',prev='';if(0xD800<=code&&code<=0xDBFF){if(str.length<=(i+1)){throw'High surrogate without following low surrogate';}
next=str.charCodeAt(i+1);if(0xDC00>next||next>0xDFFF){throw'High surrogate without following low surrogate';}
return str[i]+str[i+1];}else if(0xDC00<=code&&code<=0xDFFF){if(i===0){throw'Low surrogate without preceding high surrogate';}
prev=str.charCodeAt(i-1);if(0xD800>prev||prev>0xDBFF){throw'Low surrogate without preceding high surrogate';}
return false;}
return str[i];};for(i=0,lgth=0;i<str.length;i++){if((chr=getWholeChar(str,i))===false){continue;}
lgth++;}
return lgth;}
function split(delimiter,string){return explode(delimiter,string);}
function explode(delimiter,string,limit){var emptyArray={0:''};if(arguments.length<2||typeof arguments[0]=='undefined'||typeof arguments[1]=='undefined')
{return null;}
if(delimiter===''||delimiter===false||delimiter===null)
{return false;}
if(typeof delimiter=='function'||typeof delimiter=='object'||typeof string=='function'||typeof string=='object')
{return emptyArray;}
if(delimiter===true){delimiter='1';}
if(!limit){return string.toString().split(delimiter.toString());}else{var splitted=string.toString().split(delimiter.toString());var partA=splitted.splice(0,limit-1);var partB=splitted.join(delimiter.toString());partA.push(partB);return partA;}}
function trim(str,charlist){var whitespace,l=0,i=0;str+='';if(!charlist){whitespace=" \n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000";}else{charlist+='';whitespace=charlist.replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g,'\$1');}
l=str.length;for(i=0;i<l;i++){if(whitespace.indexOf(str.charAt(i))===-1){str=str.substring(i);break;}}
l=str.length;for(i=l-1;i>=0;i--){if(whitespace.indexOf(str.charAt(i))===-1){str=str.substring(0,i+1);break;}}
return whitespace.indexOf(str.charAt(0))===-1?str:'';}
function urldecode(str){var histogram={};var ret=str.toString();var replacer=function(search,replace,str){var tmp_arr=[];tmp_arr=str.split(search);return tmp_arr.join(replace);};histogram["'"]='%27';histogram['(']='%28';histogram[')']='%29';histogram['*']='%2A';histogram['~']='%7E';histogram['!']='%21';histogram['%20']='+';histogram['\u20AC']='%80';histogram['\u0081']='%81';histogram['\u201A']='%82';histogram['\u0192']='%83';histogram['\u201E']='%84';histogram['\u2026']='%85';histogram['\u2020']='%86';histogram['\u2021']='%87';histogram['\u02C6']='%88';histogram['\u2030']='%89';histogram['\u0160']='%8A';histogram['\u2039']='%8B';histogram['\u0152']='%8C';histogram['\u008D']='%8D';histogram['\u017D']='%8E';histogram['\u008F']='%8F';histogram['\u0090']='%90';histogram['\u2018']='%91';histogram['\u2019']='%92';histogram['\u201C']='%93';histogram['\u201D']='%94';histogram['\u2022']='%95';histogram['\u2013']='%96';histogram['\u2014']='%97';histogram['\u02DC']='%98';histogram['\u2122']='%99';histogram['\u0161']='%9A';histogram['\u203A']='%9B';histogram['\u0153']='%9C';histogram['\u009D']='%9D';histogram['\u017E']='%9E';histogram['\u0178']='%9F';for(replace in histogram){search=histogram[replace];ret=replacer(search,replace,ret)}
if($.browser.ie){ret=decodeURIComponent(escape(ret));}else{ret=decodeURIComponent(ret);}
return ret;}
function htmlspecialchars(string,quote_style){var histogram={},symbol='',tmp_str='',entity='';tmp_str=string.toString();if(false===(histogram=get_html_translation_table('HTML_SPECIALCHARS',quote_style))){return false;}
for(symbol in histogram){entity=histogram[symbol];tmp_str=tmp_str.split(symbol).join(entity);}
return tmp_str;}
function get_html_translation_table(table,quote_style){var entities={},histogram={},decimal=0,symbol='';var constMappingTable={},constMappingQuoteStyle={};var useTable={},useQuoteStyle={};useTable=(table?table.toUpperCase():'HTML_SPECIALCHARS');useQuoteStyle=(quote_style?quote_style.toUpperCase():'ENT_COMPAT');constMappingTable[0]='HTML_SPECIALCHARS';constMappingTable[1]='HTML_ENTITIES';constMappingQuoteStyle[0]='ENT_NOQUOTES';constMappingQuoteStyle[2]='ENT_COMPAT';constMappingQuoteStyle[3]='ENT_QUOTES';if(!isNaN(useTable)){useTable=constMappingTable[useTable];}
if(!isNaN(useQuoteStyle)){useQuoteStyle=constMappingQuoteStyle[useQuoteStyle];}
if(useTable=='HTML_SPECIALCHARS'){entities['38']='&amp;';if(useQuoteStyle!='ENT_NOQUOTES'){entities['34']='&quot;';}
if(useQuoteStyle=='ENT_QUOTES'){entities['39']='&#039;';}
entities['60']='&lt;';entities['62']='&gt;';}else if(useTable=='HTML_ENTITIES'){entities['38']='&amp;';if(useQuoteStyle!='ENT_NOQUOTES'){entities['34']='&quot;';}
if(useQuoteStyle=='ENT_QUOTES'){entities['39']='&#039;';}
entities['60']='&lt;';entities['62']='&gt;';entities['160']='&nbsp;';entities['161']='&iexcl;';entities['162']='&cent;';entities['163']='&pound;';entities['164']='&curren;';entities['165']='&yen;';entities['166']='&brvbar;';entities['167']='&sect;';entities['168']='&uml;';entities['169']='&copy;';entities['170']='&ordf;';entities['171']='&laquo;';entities['172']='&not;';entities['173']='&shy;';entities['174']='&reg;';entities['175']='&macr;';entities['176']='&deg;';entities['177']='&plusmn;';entities['178']='&sup2;';entities['179']='&sup3;';entities['180']='&acute;';entities['181']='&micro;';entities['182']='&para;';entities['183']='&middot;';entities['184']='&cedil;';entities['185']='&sup1;';entities['186']='&ordm;';entities['187']='&raquo;';entities['188']='&frac14;';entities['189']='&frac12;';entities['190']='&frac34;';entities['191']='&iquest;';entities['192']='&Agrave;';entities['193']='&Aacute;';entities['194']='&Acirc;';entities['195']='&Atilde;';entities['196']='&Auml;';entities['197']='&Aring;';entities['198']='&AElig;';entities['199']='&Ccedil;';entities['200']='&Egrave;';entities['201']='&Eacute;';entities['202']='&Ecirc;';entities['203']='&Euml;';entities['204']='&Igrave;';entities['205']='&Iacute;';entities['206']='&Icirc;';entities['207']='&Iuml;';entities['208']='&ETH;';entities['209']='&Ntilde;';entities['210']='&Ograve;';entities['211']='&Oacute;';entities['212']='&Ocirc;';entities['213']='&Otilde;';entities['214']='&Ouml;';entities['215']='&times;';entities['216']='&Oslash;';entities['217']='&Ugrave;';entities['218']='&Uacute;';entities['219']='&Ucirc;';entities['220']='&Uuml;';entities['221']='&Yacute;';entities['222']='&THORN;';entities['223']='&szlig;';entities['224']='&agrave;';entities['225']='&aacute;';entities['226']='&acirc;';entities['227']='&atilde;';entities['228']='&auml;';entities['229']='&aring;';entities['230']='&aelig;';entities['231']='&ccedil;';entities['232']='&egrave;';entities['233']='&eacute;';entities['234']='&ecirc;';entities['235']='&euml;';entities['236']='&igrave;';entities['237']='&iacute;';entities['238']='&icirc;';entities['239']='&iuml;';entities['240']='&eth;';entities['241']='&ntilde;';entities['242']='&ograve;';entities['243']='&oacute;';entities['244']='&ocirc;';entities['245']='&otilde;';entities['246']='&ouml;';entities['247']='&divide;';entities['248']='&oslash;';entities['249']='&ugrave;';entities['250']='&uacute;';entities['251']='&ucirc;';entities['252']='&uuml;';entities['253']='&yacute;';entities['254']='&thorn;';entities['255']='&yuml;';}else{throw Error("Table: "+useTable+' not supported');return false;}
for(decimal in entities){symbol=String.fromCharCode(decimal);histogram[symbol]=entities[decimal];}
return histogram;}
function rand(min,max){var argc=arguments.length;if(argc===0){min=0;max=2147483647;}else if(argc===1){throw new Error('Warning: rand() expects exactly 2 parameters, 1 given');}
return Math.floor(Math.random()*(max-min+1))+min;}
function count(mixed_var,mode){var key,cnt=0;if(mixed_var===null){return 0;}else if(mixed_var.constructor!==Array&&mixed_var.constructor!==Object){return 1;}
if(mode==='COUNT_RECURSIVE'){mode=1;}
if(mode!=1){mode=0;}
for(key in mixed_var){cnt++;if(mode==1&&mixed_var[key]&&(mixed_var[key].constructor===Array||mixed_var[key].constructor===Object)){cnt+=this.count(mixed_var[key],1);}}
return cnt;}
function utf8_encode(argString){var string=(argString+'');var utftext="";var start,end;var stringl=0;start=end=0;stringl=string.length;for(var n=0;n<stringl;n++){var c1=string.charCodeAt(n);var enc=null;if(c1<128){end++;}else if(c1>127&&c1<2048){enc=String.fromCharCode((c1>>6)|192)+String.fromCharCode((c1&63)|128);}else{enc=String.fromCharCode((c1>>12)|224)+String.fromCharCode(((c1>>6)&63)|128)+String.fromCharCode((c1&63)|128);}
if(enc!==null){if(end>start){utftext+=string.substring(start,end);}
utftext+=enc;start=end=n+1;}}
if(end>start){utftext+=string.substring(start,string.length);}
return utftext;}
function md5(str){var xl;var rotateLeft=function(lValue,iShiftBits){return(lValue<<iShiftBits)|(lValue>>>(32-iShiftBits));};var addUnsigned=function(lX,lY){var lX4,lY4,lX8,lY8,lResult;lX8=(lX&0x80000000);lY8=(lY&0x80000000);lX4=(lX&0x40000000);lY4=(lY&0x40000000);lResult=(lX&0x3FFFFFFF)+(lY&0x3FFFFFFF);if(lX4&lY4){return(lResult^0x80000000^lX8^lY8);}
if(lX4|lY4){if(lResult&0x40000000){return(lResult^0xC0000000^lX8^lY8);}else{return(lResult^0x40000000^lX8^lY8);}}else{return(lResult^lX8^lY8);}};var _F=function(x,y,z){return(x&y)|((~x)&z);};var _G=function(x,y,z){return(x&z)|(y&(~z));};var _H=function(x,y,z){return(x^y^z);};var _I=function(x,y,z){return(y^(x|(~z)));};var _FF=function(a,b,c,d,x,s,ac){a=addUnsigned(a,addUnsigned(addUnsigned(_F(b,c,d),x),ac));return addUnsigned(rotateLeft(a,s),b);};var _GG=function(a,b,c,d,x,s,ac){a=addUnsigned(a,addUnsigned(addUnsigned(_G(b,c,d),x),ac));return addUnsigned(rotateLeft(a,s),b);};var _HH=function(a,b,c,d,x,s,ac){a=addUnsigned(a,addUnsigned(addUnsigned(_H(b,c,d),x),ac));return addUnsigned(rotateLeft(a,s),b);};var _II=function(a,b,c,d,x,s,ac){a=addUnsigned(a,addUnsigned(addUnsigned(_I(b,c,d),x),ac));return addUnsigned(rotateLeft(a,s),b);};var convertToWordArray=function(str){var lWordCount;var lMessageLength=str.length;var lNumberOfWords_temp1=lMessageLength+8;var lNumberOfWords_temp2=(lNumberOfWords_temp1-(lNumberOfWords_temp1%64))/64;var lNumberOfWords=(lNumberOfWords_temp2+1)*16;var lWordArray=new Array(lNumberOfWords-1);var lBytePosition=0;var lByteCount=0;while(lByteCount<lMessageLength){lWordCount=(lByteCount-(lByteCount%4))/4;lBytePosition=(lByteCount%4)*8;lWordArray[lWordCount]=(lWordArray[lWordCount]|(str.charCodeAt(lByteCount)<<lBytePosition));lByteCount++;}
lWordCount=(lByteCount-(lByteCount%4))/4;lBytePosition=(lByteCount%4)*8;lWordArray[lWordCount]=lWordArray[lWordCount]|(0x80<<lBytePosition);lWordArray[lNumberOfWords-2]=lMessageLength<<3;lWordArray[lNumberOfWords-1]=lMessageLength>>>29;return lWordArray;};var wordToHex=function(lValue){var wordToHexValue="",wordToHexValue_temp="",lByte,lCount;for(lCount=0;lCount<=3;lCount++){lByte=(lValue>>>(lCount*8))&255;wordToHexValue_temp="0"+lByte.toString(16);wordToHexValue=wordToHexValue+wordToHexValue_temp.substr(wordToHexValue_temp.length-2,2);}
return wordToHexValue;};var x=[],k,AA,BB,CC,DD,a,b,c,d,S11=7,S12=12,S13=17,S14=22,S21=5,S22=9,S23=14,S24=20,S31=4,S32=11,S33=16,S34=23,S41=6,S42=10,S43=15,S44=21;str=this.utf8_encode(str);x=convertToWordArray(str);a=0x67452301;b=0xEFCDAB89;c=0x98BADCFE;d=0x10325476;xl=x.length;for(k=0;k<xl;k+=16){AA=a;BB=b;CC=c;DD=d;a=_FF(a,b,c,d,x[k+0],S11,0xD76AA478);d=_FF(d,a,b,c,x[k+1],S12,0xE8C7B756);c=_FF(c,d,a,b,x[k+2],S13,0x242070DB);b=_FF(b,c,d,a,x[k+3],S14,0xC1BDCEEE);a=_FF(a,b,c,d,x[k+4],S11,0xF57C0FAF);d=_FF(d,a,b,c,x[k+5],S12,0x4787C62A);c=_FF(c,d,a,b,x[k+6],S13,0xA8304613);b=_FF(b,c,d,a,x[k+7],S14,0xFD469501);a=_FF(a,b,c,d,x[k+8],S11,0x698098D8);d=_FF(d,a,b,c,x[k+9],S12,0x8B44F7AF);c=_FF(c,d,a,b,x[k+10],S13,0xFFFF5BB1);b=_FF(b,c,d,a,x[k+11],S14,0x895CD7BE);a=_FF(a,b,c,d,x[k+12],S11,0x6B901122);d=_FF(d,a,b,c,x[k+13],S12,0xFD987193);c=_FF(c,d,a,b,x[k+14],S13,0xA679438E);b=_FF(b,c,d,a,x[k+15],S14,0x49B40821);a=_GG(a,b,c,d,x[k+1],S21,0xF61E2562);d=_GG(d,a,b,c,x[k+6],S22,0xC040B340);c=_GG(c,d,a,b,x[k+11],S23,0x265E5A51);b=_GG(b,c,d,a,x[k+0],S24,0xE9B6C7AA);a=_GG(a,b,c,d,x[k+5],S21,0xD62F105D);d=_GG(d,a,b,c,x[k+10],S22,0x2441453);c=_GG(c,d,a,b,x[k+15],S23,0xD8A1E681);b=_GG(b,c,d,a,x[k+4],S24,0xE7D3FBC8);a=_GG(a,b,c,d,x[k+9],S21,0x21E1CDE6);d=_GG(d,a,b,c,x[k+14],S22,0xC33707D6);c=_GG(c,d,a,b,x[k+3],S23,0xF4D50D87);b=_GG(b,c,d,a,x[k+8],S24,0x455A14ED);a=_GG(a,b,c,d,x[k+13],S21,0xA9E3E905);d=_GG(d,a,b,c,x[k+2],S22,0xFCEFA3F8);c=_GG(c,d,a,b,x[k+7],S23,0x676F02D9);b=_GG(b,c,d,a,x[k+12],S24,0x8D2A4C8A);a=_HH(a,b,c,d,x[k+5],S31,0xFFFA3942);d=_HH(d,a,b,c,x[k+8],S32,0x8771F681);c=_HH(c,d,a,b,x[k+11],S33,0x6D9D6122);b=_HH(b,c,d,a,x[k+14],S34,0xFDE5380C);a=_HH(a,b,c,d,x[k+1],S31,0xA4BEEA44);d=_HH(d,a,b,c,x[k+4],S32,0x4BDECFA9);c=_HH(c,d,a,b,x[k+7],S33,0xF6BB4B60);b=_HH(b,c,d,a,x[k+10],S34,0xBEBFBC70);a=_HH(a,b,c,d,x[k+13],S31,0x289B7EC6);d=_HH(d,a,b,c,x[k+0],S32,0xEAA127FA);c=_HH(c,d,a,b,x[k+3],S33,0xD4EF3085);b=_HH(b,c,d,a,x[k+6],S34,0x4881D05);a=_HH(a,b,c,d,x[k+9],S31,0xD9D4D039);d=_HH(d,a,b,c,x[k+12],S32,0xE6DB99E5);c=_HH(c,d,a,b,x[k+15],S33,0x1FA27CF8);b=_HH(b,c,d,a,x[k+2],S34,0xC4AC5665);a=_II(a,b,c,d,x[k+0],S41,0xF4292244);d=_II(d,a,b,c,x[k+7],S42,0x432AFF97);c=_II(c,d,a,b,x[k+14],S43,0xAB9423A7);b=_II(b,c,d,a,x[k+5],S44,0xFC93A039);a=_II(a,b,c,d,x[k+12],S41,0x655B59C3);d=_II(d,a,b,c,x[k+3],S42,0x8F0CCC92);c=_II(c,d,a,b,x[k+10],S43,0xFFEFF47D);b=_II(b,c,d,a,x[k+1],S44,0x85845DD1);a=_II(a,b,c,d,x[k+8],S41,0x6FA87E4F);d=_II(d,a,b,c,x[k+15],S42,0xFE2CE6E0);c=_II(c,d,a,b,x[k+6],S43,0xA3014314);b=_II(b,c,d,a,x[k+13],S44,0x4E0811A1);a=_II(a,b,c,d,x[k+4],S41,0xF7537E82);d=_II(d,a,b,c,x[k+11],S42,0xBD3AF235);c=_II(c,d,a,b,x[k+2],S43,0x2AD7D2BB);b=_II(b,c,d,a,x[k+9],S44,0xEB86D391);a=addUnsigned(a,AA);b=addUnsigned(b,BB);c=addUnsigned(c,CC);d=addUnsigned(d,DD);}
var temp=wordToHex(a)+wordToHex(b)+wordToHex(c)+wordToHex(d);return temp.toLowerCase();}
function truncate(txt,len){var trunc=txt;if(trunc.length>len){trunc=trunc.substring(0,len);trunc=trunc.replace(/\w+$/,'');if(txt.length>trunc.length){trunc+='...';}}
return trunc;}
function setCookie(name,value,expires,path,domain,secure){document.cookie=name+"="+escape(value)+
((expires)?"; expires="+expires:"")+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"")+
((secure)?"; secure":"");}
function getCookie(name){var cookie=" "+document.cookie;var search=" "+name+"=";var setStr=null;var offset=0;var end=0;if(cookie.length>0){offset=cookie.indexOf(search);if(offset!=-1){offset+=search.length;end=cookie.indexOf(";",offset)
if(end==-1){end=cookie.length;}
setStr=unescape(cookie.substring(offset,end));}}
return(setStr);}
function get_headers(url,format){var req=this.window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(!req){throw new Error('XMLHttpRequest not supported');}
var tmp,headers,pair,i,j=0;req.open('HEAD',url,false);req.send(null);if(req.readyState<3){return false;}
tmp=req.getAllResponseHeaders();tmp=tmp.split('\n');tmp=this.array_filter(tmp,function(value){return value.substring(1)!=='';});headers=format?{}:[];for(i in tmp){if(format){pair=tmp[i].split(':');headers[pair.splice(0,1)]=pair.join(':').substring(1);}else{headers[j++]=tmp[i];}}
return headers;}
function window_open(url,width,height){window.open(url,"mywindow","location=1,status=1,scrollbars=1, width="+width+",height="+height);return false;}
function CompositionNameRadioTimeout(stream_name,isfirst){if(!is_player_stoped||isfirst){$.get(request_0+"proxies/radio.php?titlelink="+stream_name,function(data){if(data.substr(6).length>0)$('#play_desc').html(data);});}
radio_timeout=setTimeout('CompositionNameRadioTimeout("'+stream_name+'", false)',10000);}
(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&parseInt($.browser.version)<=6){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+'style="display:block;position:absolute;z-index:-1;'+
(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+'"/>';return this.each(function(){if($('> iframe.bgiframe',this).length==0)
this.insertBefore(document.createElement(html),this.firstChild);});}
return this;};if(!$.browser.version)
$.browser.version=navigator.userAgent.toLowerCase().match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)[1];})(jQuery);;(function($){var helper={},current,title,tID,IE=$.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),track=false;$.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){$.tooltip.blocked=!$.tooltip.blocked;}};$.fn.extend({tooltip:function(settings){settings=$.extend({},$.tooltip.defaults,settings);createHelper(settings);return this.each(function(){$.data(this,"tooltip",settings);this.tOpacity=helper.parent.css("opacity");this.tooltipText=this.title;$(this).removeAttr("title");this.alt="";}).mouseover(save).mouseout(hide).click(hide);},fixPNG:IE?function(){return this.each(function(){var image=$(this).css('backgroundImage');if(image.match(/^url\(["']?(.*\.png)["']?\)$/i)){image=RegExp.$1;$(this).css({'backgroundImage':'none','filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+image+"')"}).each(function(){var position=$(this).css('position');if(position!='absolute'&&position!='relative')
$(this).css('position','relative');});}});}:function(){return this;},unfixPNG:IE?function(){return this.each(function(){$(this).css({'filter':'',backgroundImage:''});});}:function(){return this;},hideWhenEmpty:function(){return this.each(function(){$(this)[$(this).html()?"show":"hide"]();});},url:function(){return this.attr('href')||this.attr('src');}});function createHelper(settings){if(helper.parent)
return;helper.parent=$('<div id="'+settings.id+'"><h3></h3><div class="body"></div><div class="url"></div></div>').appendTo(document.body).hide();if($.fn.bgiframe)
helper.parent.bgiframe();helper.title=$('h3',helper.parent);helper.body=$('div.body',helper.parent);helper.url=$('div.url',helper.parent);}
function settings(element){return $.data(element,"tooltip");}
function handle(event){if(settings(this).delay)
tID=setTimeout(show,settings(this).delay);else
show();track=!!settings(this).track;$(document.body).bind('mousemove',update);update(event);}
function save(){if($.tooltip.blocked||this==current||(!this.tooltipText&&!settings(this).bodyHandler))
return;current=this;title=this.tooltipText;if(settings(this).bodyHandler){helper.title.hide();var bodyContent=settings(this).bodyHandler.call(this);if(bodyContent.nodeType||bodyContent.jquery){helper.body.empty().append(bodyContent)}else{helper.body.html(bodyContent);}
helper.body.show();}else if(settings(this).showBody){var parts=title.split(settings(this).showBody);helper.title.html(parts.shift()).show();helper.body.empty();for(var i=0,part;(part=parts[i]);i++){if(i>0)
helper.body.append("<br/>");helper.body.append(part);}
helper.body.hideWhenEmpty();}else{helper.title.html(title).show();helper.body.hide();}
if(settings(this).showURL&&$(this).url())
helper.url.html($(this).url().replace('http://','')).show();else
helper.url.hide();helper.parent.addClass(settings(this).extraClass);if(settings(this).fixPNG)
helper.parent.fixPNG();handle.apply(this,arguments);}
function show(){tID=null;if((!IE||!$.fn.bgiframe)&&settings(current).fade){if(helper.parent.is(":animated"))
helper.parent.stop().show().fadeTo(settings(current).fade,current.tOpacity);else
helper.parent.is(':visible')?helper.parent.fadeTo(settings(current).fade,current.tOpacity):helper.parent.fadeIn(settings(current).fade);}else{helper.parent.show();}
update();}
function update(event){if($.tooltip.blocked)
return;if(event&&event.target.tagName=="OPTION"){return;}
if(!track&&helper.parent.is(":visible")){$(document.body).unbind('mousemove',update)}
if(current==null){$(document.body).unbind('mousemove',update);return;}
helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");var left=helper.parent[0].offsetLeft;var top=helper.parent[0].offsetTop;if(event){left=event.pageX+settings(current).left;top=event.pageY+settings(current).top;var right='auto';if(settings(current).positionLeft){right=$(window).width()-left;left='auto';}
helper.parent.css({left:left,right:right,top:top});}
var v=viewport(),h=helper.parent[0];if(v.x+v.cx<h.offsetLeft+h.offsetWidth){left-=h.offsetWidth+20+settings(current).left;helper.parent.css({left:left+'px'}).addClass("viewport-right");}
if(v.y+v.cy<h.offsetTop+h.offsetHeight){top-=h.offsetHeight+20+settings(current).top;helper.parent.css({top:top+'px'}).addClass("viewport-bottom");}}
function viewport(){return{x:$(window).scrollLeft(),y:$(window).scrollTop(),cx:$(window).width(),cy:$(window).height()};}
function hide(event){if($.tooltip.blocked)
return;if(tID)
clearTimeout(tID);current=null;var tsettings=settings(this);function complete(){helper.parent.removeClass(tsettings.extraClass).hide().css("opacity","");}
if((!IE||!$.fn.bgiframe)&&tsettings.fade){if(helper.parent.is(':animated'))
helper.parent.stop().fadeTo(tsettings.fade,0,complete);else
helper.parent.stop().fadeOut(tsettings.fade,complete);}else
complete();if(settings(this).fixPNG)
helper.parent.unfixPNG();}})(jQuery);;(function($){var ie6=$.browser.msie&&parseInt($.browser.version)==6&&typeof window['XMLHttpRequest']!="object",ieQuirks=null,w=[];$.modal=function(data,options){return $.modal.impl.init(data,options);};$.modal.close=function(){$.modal.impl.close();};$.fn.modal=function(options){return $.modal.impl.init(this,options);};$.modal.defaults={appendTo:'body',focus:true,opacity:30,overlayId:'simplemodal-overlay',overlayCss:{},containerId:'simplemodal-container',containerCss:{},dataId:'simplemodal-data',dataCss:{},minHeight:null,minWidth:null,maxHeight:null,maxWidth:null,autoResize:false,autoPosition:true,zIndex:1000,close:true,closeHTML:'<a class="modalCloseImg" title="Close"></a>',closeClass:'simplemodal-close',escClose:true,overlayClose:false,position:null,persist:false,transient:false,onOpen:null,onShow:null,onClose:null};$.modal.impl={o:null,d:{},init:function(data,options){var s=this;if(s.d.data){return false;}ieQuirks=$.browser.msie&&!$.support.boxModel;s.o=$.extend({},$.modal.defaults,options);s.zIndex=s.o.zIndex;s.occb=false;if(typeof data=='object'){data=data instanceof jQuery?data:$(data);s.d.placeholder=false;if(data.parent().parent().size()>0){data.before($('<span></span>').attr('id','simplemodal-placeholder').css({display:'none'}));s.d.placeholder=true;s.display=data.css('display');if(!s.o.persist){s.d.orig=data.clone(true);}}}else if(typeof data=='string'||typeof data=='number'){data=$('<div></div>').html(data);}else{alert('SimpleModal Error: Unsupported data type: '+typeof data);return s;}s.create(data);data=null;s.open();if($.isFunction(s.o.onShow)){s.o.onShow.apply(s,[s.d]);}return s;},create:function(data){var s=this;w=s.getDimensions();if(!s.o.transient&&ie6){s.d.iframe=$('<iframe src="javascript:false;"></iframe>').css($.extend(s.o.iframeCss,{display:'none',opacity:0,position:'fixed',height:w[0],width:w[1],zIndex:s.o.zIndex,top:0,left:0})).appendTo(s.o.appendTo);}s.d.overlay=$('<div></div>').attr('id',s.o.overlayId).addClass('simplemodal-overlay').css($.extend(s.o.overlayCss,{display:'none',opacity:s.o.opacity/100,height:s.o.transient?0:w[0],width:s.o.transient?0:w[1],position:'fixed',left:0,top:0,zIndex:s.o.zIndex+1})).appendTo(s.o.appendTo);s.d.container=$('<div></div>').attr('id',s.o.containerId).addClass('simplemodal-container').css($.extend(s.o.containerCss,{display:'none',position:'fixed',zIndex:s.o.zIndex+2})).append(s.o.close&&s.o.closeHTML?$(s.o.closeHTML).addClass(s.o.closeClass):'').appendTo(s.o.appendTo);s.d.wrap=$('<div></div>').attr('tabIndex',-1).addClass('simplemodal-wrap').css({height:'100%',outline:0,width:'100%'}).appendTo(s.d.container);s.d.data=data.attr('id',data.attr('id')||s.o.dataId).addClass('simplemodal-data').css($.extend(s.o.dataCss,{display:'none'})).appendTo('body');data=null;s.setContainerDimensions();s.d.data.appendTo(s.d.wrap);if(ie6||ieQuirks){s.fixIE();}},bindEvents:function(){var s=this;$('.'+s.o.closeClass).bind('click.simplemodal',function(e){e.preventDefault();s.close();});if(!s.o.transient&&s.o.close&&s.o.overlayClose){s.d.overlay.bind('click.simplemodal',function(e){e.preventDefault();s.close();});}$(document).bind('keydown.simplemodal',function(e){if(!s.o.transient&&s.o.focus&&e.keyCode==9){s.watchTab(e);}else if((s.o.close&&s.o.escClose)&&e.keyCode==27){e.preventDefault();s.close();}});$(window).bind('resize.simplemodal',function(){w=s.getDimensions();s.setContainerDimensions(true);if(ie6||ieQuirks){s.fixIE();}else if(!s.o.transient){s.d.iframe&&s.d.iframe.css({height:w[0],width:w[1]});s.d.overlay.css({height:w[0],width:w[1]});}});},unbindEvents:function(){$('.'+this.o.closeClass).unbind('click.simplemodal');$(document).unbind('keydown.simplemodal');$(window).unbind('resize.simplemodal');this.d.overlay.unbind('click.simplemodal');},fixIE:function(){var s=this,p=s.o.position;$.each([s.d.iframe||null,s.o.transient?null:s.d.overlay,s.d.container],function(i,el){if(el){var bch='document.body.clientHeight',bcw='document.body.clientWidth',bsh='document.body.scrollHeight',bsl='document.body.scrollLeft',bst='document.body.scrollTop',bsw='document.body.scrollWidth',ch='document.documentElement.clientHeight',cw='document.documentElement.clientWidth',sl='document.documentElement.scrollLeft',st='document.documentElement.scrollTop',s=el[0].style;s.position='absolute';if(i<2){s.removeExpression('height');s.removeExpression('width');s.setExpression('height',''+bsh+' > '+bch+' ? '+bsh+' : '+bch+' + "px"');s.setExpression('width',''+bsw+' > '+bcw+' ? '+bsw+' : '+bcw+' + "px"');}else{var te,le;if(p&&p.constructor==Array){var top=p[0]?typeof p[0]=='number'?p[0].toString():p[0].replace(/px/,''):el.css('top').replace(/px/,'');te=top.indexOf('%')==-1?top+' + (t = '+st+' ? '+st+' : '+bst+') + "px"':parseInt(top.replace(/%/,''))+' * (('+ch+' || '+bch+') / 100) + (t = '+st+' ? '+st+' : '+bst+') + "px"';if(p[1]){var left=typeof p[1]=='number'?p[1].toString():p[1].replace(/px/,'');le=left.indexOf('%')==-1?left+' + (t = '+sl+' ? '+sl+' : '+bsl+') + "px"':parseInt(left.replace(/%/,''))+' * (('+cw+' || '+bcw+') / 100) + (t = '+sl+' ? '+sl+' : '+bsl+') + "px"';}}else{te='('+ch+' || '+bch+') / 2 - (this.offsetHeight / 2) + (t = '+st+' ? '+st+' : '+bst+') + "px"';le='('+cw+' || '+bcw+') / 2 - (this.offsetWidth / 2) + (t = '+sl+' ? '+sl+' : '+bsl+') + "px"';}s.removeExpression('top');s.removeExpression('left');s.setExpression('top',te);s.setExpression('left',le);}}});},focus:function(pos){var s=this,p=pos||'first';var input=$(':input:enabled:visible:'+p,s.d.wrap);input.length>0?1:s.d.wrap.focus();},getDimensions:function(){var el=$(window);var h=$.browser.opera&&$.browser.version>'9.5'&&$.fn.jquery<='1.2.6'?document.documentElement['clientHeight']:$.browser.opera&&$.browser.version<'9.5'&&$.fn.jquery>'1.2.6'?window.innerHeight:el.height();return[h,el.width()];},getVal:function(v){return v=='auto'?0:v.indexOf('%')>0?v:parseInt(v.replace(/px/,''));},setContainerDimensions:function(resize){var s=this;if(!resize||(resize&&s.o.autoResize)){var ch=$.browser.opera?s.d.container.height():s.getVal(s.d.container.css('height')),cw=$.browser.opera?s.d.container.width():s.getVal(s.d.container.css('width')),dh=s.d.data.outerHeight(true),dw=s.d.data.outerWidth(true);var mh=s.o.maxHeight&&s.o.maxHeight<w[0]?s.o.maxHeight:w[0],mw=s.o.maxWidth&&s.o.maxWidth<w[1]?s.o.maxWidth:w[1];if(!ch){if(!dh){ch=s.o.minHeight;}else{if(dh>mh){ch=mh;}else if(dh<s.o.minHeight){ch=s.o.minHeight;}else{ch=dh;}}}else{ch=ch>mh?mh:ch;}if(!cw){if(!dw){cw=s.o.minWidth;}else{if(dw>mw){cw=mw;}else if(dw<s.o.minWidth){cw=s.o.minWidth;}else{cw=dw;}}}else{cw=cw>mw?mw:cw;}s.d.container.css({height:ch,width:cw});if(dh>ch||dw>cw){s.d.wrap.css({});}}if(s.o.autoPosition){s.setPosition();}},setPosition:function(){var s=this,top,left,hc=(w[0]/2)-(s.d.container.outerHeight(true)/2),vc=(w[1]/2)-(s.d.container.outerWidth(true)/2);if(s.o.position&&Object.prototype.toString.call(s.o.position)==="[object Array]"){top=s.o.position[0]||hc;left=s.o.position[1]||vc;}else{top=hc;left=vc;}s.d.container.css({left:left,top:top});},watchTab:function(e){var s=this;if($(e.target).parents('.simplemodal-container').length>0){s.inputs=$(':input:enabled:visible:first, :input:enabled:visible:last',s.d.data[0]);if((!e.shiftKey&&e.target==s.inputs[s.inputs.length-1])||(e.shiftKey&&e.target==s.inputs[0])||s.inputs.length==0){e.preventDefault();var pos=e.shiftKey?'last':'first';setTimeout(function(){s.focus(pos);},10);}}else{e.preventDefault();setTimeout(function(){s.focus();},10);}},open:function(){var s=this;s.d.iframe&&s.d.iframe.show();if($.isFunction(s.o.onOpen)){s.o.onOpen.apply(s,[s.d]);}else{s.d.overlay.show();s.d.container.show();s.d.data.show();}s.focus();s.bindEvents();},close:function(){var s=this;if(!s.d.data){return false;}s.unbindEvents();if($.isFunction(s.o.onClose)&&!s.occb){s.occb=true;s.o.onClose.apply(s,[s.d]);}else{if(s.d.placeholder){var ph=$('#simplemodal-placeholder');if(s.o.persist){ph.replaceWith(s.d.data.removeClass('simplemodal-data').css('display',s.display));}else{s.d.data.hide().remove();ph.replaceWith(s.d.orig);}}else{s.d.data.hide().remove();}s.d.container.hide().remove();s.d.overlay.hide().remove();s.d.iframe&&s.d.iframe.hide().remove();s.d={};}}};})(jQuery);﻿
(function($){$.extend($.fn,{validate:function(options){if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return;}
var validator=$.data(this[0],'validator');if(validator){return validator;}
validator=new $.validator(options,this[0]);$.data(this[0],'validator',validator);if(validator.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){validator.cancelSubmit=true;});this.submit(function(event){if(validator.settings.debug)
event.preventDefault();function handle(){if(validator.settings.submitHandler){validator.settings.submitHandler.call(validator,validator.currentForm);return false;}
return true;}
if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();}
if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;}
return handle();}else{validator.focusInvalid();return false;}});}
return validator;},valid:function(){if($(this[0]).is('form')){return this.validate().form();}else{var valid=false;var validator=$(this[0].form).validate();this.each(function(){valid|=validator.element(this);});return valid;}},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value);$element.removeAttr(value);});return result;},rules:function(command,argument){var element=this[0];if(command){var settings=$.data(element.form,'validator').settings;var staticRules=settings.rules;var existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));staticRules[element.name]=existingRules;if(argument.messages)
settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages);break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;}
var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];});return filtered;}}
var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required;data=$.extend({required:param},data);}
return data;}});$.extend($.expr[":"],{blank:function(a){return!$.trim(a.value);},filled:function(a){return!!$.trim(a.value);},unchecked:function(a){return!a.checked;}});$.format=function(source,params){if(arguments.length==1)
return function(){var args=$.makeArray(arguments);args.unshift(source);return $.format.apply(this,args);};if(arguments.length>2&&params.constructor!=Array){params=$.makeArray(arguments).slice(1);}
if(params.constructor!=Array){params=[params];}
$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n);});return source;};$.validator=function(options,form){this.settings=$.extend({},$.validator.defaults,options);this.currentForm=form;this.init();};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",errorElement:"label",focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass);this.errorsFor(element).hide();}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element){if(element.name in this.submitted||element==this.lastElement){this.element(element);}},onclick:function(element){if(element.name in this.submitted)
this.element(element);},highlight:function(element,errorClass){$(element).addClass(errorClass);},unhighlight:function(element,errorClass){$(element).removeClass(errorClass);}},setDefaults:function(settings){$.extend($.validator.defaults,settings);},messages:{required:"Поле обязательно для заполнения.",remote:"Поле заполнено неверно.",email:"Введите правильный e-mail.",url:"Введите правильный URL-адресс.",date:"Введите правильную дату.",dateISO:"Введите правильную дату (ISO).",dateDE:"Bitte geben Sie ein gültiges Datum ein.",number:"Введите правильный номер.",numberDE:"Bitte geben Sie eine Nummer ein.",digits:"Введите только цифры.",creditcard:"Please enter a valid credit card number.",equalTo:"Значения не совпадают.",accept:"Please enter a value with a valid extension.",maxlength:$.format("Введите не больше {0} символов."),minlength:$.format("Введите не меньше {0} символов."),rangelength:$.format("Введите от {0} до {1} символов."),range:$.format("Please enter a value between {0} and {1}."),max:$.format("Введите значения не боллее {0}."),min:$.format("Введите значения не менее {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={});$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key;});});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value);});function delegate(event){var validator=$.data(this[0].form,"validator");validator.settings["on"+event.type]&&validator.settings["on"+event.type].call(validator,this[0]);}
$(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",delegate).delegate("click",":radio, :checkbox",delegate);if(this.settings.invalidHandler)
$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler);},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid())
$(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i]);}
return this.valid();},element:function(element){element=this.clean(element);this.lastElement=element;this.prepareElement(element);this.currentElements=$(element);var result=this.check(element);if(result){delete this.invalid[element.name];}else{this.invalid[element.name]=true;}
if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);}
this.showErrors();return result;},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]});}
this.successList=$.grep(this.successList,function(element){return!(element.name in errors);});}
this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors();},resetForm:function(){if($.fn.resetForm)
$(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass);},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0;for(var i in obj)
count++;return count;},hideErrors:function(){this.addWrapper(this.toHide).hide();},valid:function(){return this.size()==0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus();}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name==lastActive.name;}).length==1&&lastActive;},elements:function(){var validator=this,rulesCache={};return $([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in rulesCache||!validator.objectLength($(this).rules()))
return false;rulesCache[this.name]=true;return true;});},clean:function(selector){return $(selector)[0];},errors:function(){return $(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.formSubmitted=false;this.currentElements=$([]);},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},check:function(element){element=this.clean(element);if(this.checkable(element)){element=this.findByName(element.name)[0];}
var rules=$(element).rules();var dependencyMismatch=false;for(method in rules){var rule={method:method,parameters:rules[method]};try{var result=$.validator.methods[method].call(this,element.value.replace(/\r/g,""),element,rule.parameters);if(result=="dependency-mismatch"){dependencyMismatch=true;continue;}
dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;}
if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id
+", check the '"+rule.method+"' method");throw e;}}
if(dependencyMismatch)
return;if(this.objectLength(rules))
this.successList.push(element);return true;},customMetaMessage:function(element,method){if(!$.metadata)
return;var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method];},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method]);},findDefined:function(){for(var i=0;i<arguments.length;i++){if(arguments[i]!==undefined)
return arguments[i];}
return undefined;},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),this.customMetaMessage(element,method),!this.settings.ignoreTitle&&element.title||undefined,$.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>");},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method);if(typeof message=="function")
message=message.call(this,rule.parameters,element);this.errorList.push({message:message,element:element});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper)
toToggle=toToggle.add(toToggle.parents(this.settings.wrapper));return toToggle;},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass);this.showLabel(error.element,error.message);}
if(this.errorList.length){this.toShow=this.toShow.add(this.containers);}
if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}}
if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass);}}
this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return $(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.removeClass().addClass(this.settings.errorClass);label.attr("generated")&&label.html(message);}else{label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true}).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper){label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();}
if(!this.labelContainer.append(label).length)
this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element);}
if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label);}
this.toShow=this.toShow.add(label);},errorsFor:function(element){return this.errors().filter("[for='"+this.idOrName(element)+"']");},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},checkable:function(element){return/radio|checkbox/i.test(element.type);},findByName:function(name){var form=this.currentForm;return $(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null;});},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case'select':return $("option:selected",element).length;case'input':if(this.checkable(element))
return this.findByName(element.name).filter(':checked').length;}
return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param,element){return param;},"string":function(param,element){return!!$(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){return!$.validator.methods.required.call(this,$.trim(element.value),element)&&"dependency-mismatch";},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0)
this.pendingRequest=0;delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();}else if(!valid&&this.pendingRequest==0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",previous={old:null,valid:true,message:this.defaultMessage(element,"remote")});}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className);},classRules:function(element){var rules={};var classes=$(element).attr('class');classes&&$.each(classes.split(' '),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this]);}});return rules;},attributeRules:function(element){var rules={};var $element=$(element);for(method in $.validator.methods){var value=$element.attr(method);if(value){rules[method]=value;}}
if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;}
return rules;},metadataRules:function(element){if(!$.metadata)return{};var meta=$.data(element.form,'validator').settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata();},staticRules:function(element){var rules={};var validator=$.data(element.form,'validator');if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{};}
return rules;},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;}
if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;}
if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{delete rules[prop];}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter;});$.each(['minlength','maxlength','min','max'],function(){if(rules[this]){rules[this]=Number(rules[this]);}});$.each(['rangelength','range'],function(){if(rules[this]){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}});if($.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;}
if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}}
if(rules.messages){delete rules.messages}
return rules;},normalizeRule:function(data){if(typeof data=="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;}
return data;},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message;if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element))
return"dependency-mismatch";switch(element.nodeName.toLowerCase()){case'select':var options=$("option:selected",element);return options.length>0&&(element.type=="select-multiple"||($.browser.msie&&!(options[0].attributes['value'].specified)?options[0].text:options[0].value).length>0);case'input':if(this.checkable(element))
return this.getLength(value,element)>0;default:return $.trim(value).length>0;}},remote:function(value,element,param){if(this.optional(element))
return"dependency-mismatch";var previous=this.previousValue(element);if(!this.settings.messages[element.name])
this.settings.messages[element.name]={};this.settings.messages[element.name].remote=typeof previous.message=="function"?previous.message(value):previous.message;param=typeof param=="string"&&{url:param}||param;if(previous.old!==value){previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;$.ajax($.extend(true,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){if(response){var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors();}else{var errors={};errors[element.name]=response||validator.defaultMessage(element,"remote");validator.showErrors(errors);}
previous.valid=response;validator.stopRequest(element,response);}},param));return"pending";}else if(this.pending[element.name]){return"pending";}
return previous.valid;},minlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)>=param;},maxlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)<=param;},rangelength:function(value,element,param){var length=this.getLength($.trim(value),element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},min:function(value,element,param){return this.optional(element)||value>=param;},max:function(value,element,param){return this.optional(element)||value<=param;},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value));},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);},dateDE:function(value,element){return this.optional(element)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(value);},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value);},numberDE:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},creditcard:function(value,element){if(this.optional(element))
return"dependency-mismatch";if(/[^0-9-]+/.test(value))
return false;var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9)
nDigit-=9;}
nCheck+=nDigit;bEven=!bEven;}
return(nCheck%10)==0;},accept:function(value,element,param){param=typeof param=="string"?param:"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"));},equalTo:function(value,element,param){return value==$(param).val();}}});})(jQuery);;(function($){var ajax=$.ajax;var pendingRequests={};$.ajax=function(settings){settings=$.extend(settings,$.extend({},$.ajaxSettings,settings));var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}
return(pendingRequests[port]=ajax.apply(this,arguments));}
return ajax.apply(this,arguments);};})(jQuery);;(function($){$.each({focus:'focusin',blur:'focusout'},function(original,fix){$.event.special[fix]={setup:function(){if($.browser.msie)return false;this.addEventListener(original,$.event.special[fix].handler,true);},teardown:function(){if($.browser.msie)return false;this.removeEventListener(original,$.event.special[fix].handler,true);},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.apply(this,arguments);}};});$.extend($.fn,{delegate:function(type,delegate,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments);}});},triggerEvent:function(type,target){return this.triggerHandler(type,[$.event.fix({type:type,target:target})]);}})})(jQuery);$(document).ready(function(){$('#favorite_listes').selectbox();$('.fordel').remove();$('#favorite_listes').change(function(){changeFavPlaylist();});$('#my_listes').selectbox();$('#my_listes').change(function(){changeMyPlaylist();});if(getCookie('vol')!=null){mouse_volume=parseInt(getCookie('vol'));}
if(getCookie('player_sort')!=null){if(parseInt(getCookie('player_sort'))==1){setPlayerSort();}}
if(getCookie('play_circle')!=null){if(parseInt(getCookie('play_circle'))==1){setPlayerCircle();}}
$('#player_volume').width(mouse_volume);$('#vol_perc').html(mouse_volume+'%');$('.ttlink').click(function(){generate_song_page(substr($(this).attr('id'),3),1);return false;});$('.menu a').click(function(){load_page(substr($(this).attr('id'),10));return false;});$('#close_now_play').click(function(){close_status();});$('#nowplayshow').click(function(){if($('#nowplay').css('display')=='none'){show_status();}else{close_status();}});$('#close_history').click(function(){close_history();});$('#playhistory').click(function(){if($('#history').css('display')=='none'){show_history();$('#pane1').jScrollPane({showArrows:true});}else{close_history();}});$('#close_playlist').click(function(){close_playlist();});$('#playplaylist').click(function(){if($('#playlist').css('display')=='none'){show_playlist();}else{close_playlist();}});$('#play_panel_play, #play_panel_pause').click(function(){player_play();});$('#play_panel_next').click(function(){nextThemeProcessor();});$('#play_panel_prev').click(function(){nextThemeProcessor(2);});$('#play_unmute, #play_mute').click(function(){set_mute();});$('#play_panel_stop').click(function(){player_stop();});$('#player_volume').click(function(e){mouse_volume=e.pageX-$(this).offset().left;set_volume();});$('#vol_parent').click(function(e){mouse_volume=e.pageX-$(this).offset().left;set_volume();});$('#player_time').click(function(e){mouse_play_volume=e.pageX-$(this).offset().left;set_position();});$('#player_now_time').click(function(e){mouse_play_volume=e.pageX-$(this).offset().left;set_position();});$('.history_el').parent().mouseover(function(){$(this).addClass('hovered');});$('.history_el').parent().mouseout(function(){$(this).removeClass('hovered');});$('#pane1pllist').jScrollPane({showArrows:true});$('#main_comments').jScrollPane({showArrows:true});$('#top_div_scroll').jScrollPane({showArrows:true});$('#bottom_div_scroll').jScrollPane({showArrows:true});$('#topsorttoday').click(function(){return topSortClick('topsorttoday');});$('#topsortweek').click(function(){return topSortClick('topsortweek');});$('#topsortmonth').click(function(){return topSortClick('topsortmonth');});$('#topsortall').click(function(){return topSortClick('topsortall');});d=new Date();curr_date=d.getDate();if(curr_date<10)curr_date='0'+curr_date;curr_month=d.getMonth()-1+2;if(curr_month<10)curr_month='0'+curr_month;curr_year=d.getFullYear();current_music_end_date=curr_date+"."+curr_month+"."+curr_year;$('#pane1').jScrollPane({showArrows:true});$('#play_sort').click(function(){setPlayerSort();});$('#play_circle').click(function(){setPlayerCircle();});$('#play_from').click(function(){setPlayerFrom();});$('#play_show_page').click(function(){setPlayerShowPage();});$('#history').css('display','none');$('#history').css('visibility','visible');$('#playlist').css('display','none');$('#playlist').css('visibility','visible');$('#playlistparent').sortable({axis:'y','sort':function(event,ui){if((parseInt(substr($(ui.item).css('top'),0,-2)))<(parseInt(substr($('#pane1pllist')[0].style.top,0,-2))*-1)){try{$('#pane1pllist')[0].scrollTo(parseInt(substr($(ui.item).css('top'),0,-2)));}catch(e){}}
if((parseInt(substr($(ui.item).css('top'),0,-2)))>(parseInt(substr($('#pane1pllist')[0].style.top,0,-2))*-1+220)){try{$('#pane1pllist')[0].scrollTo(parseInt(substr($(ui.item).css('top'),0,-2))-220);}catch(e){}}
$(ui.item).css('background','#090E14');},'stop':function(event,ui){$(ui.item).css('background','');ChangeSortPlist($(ui.item).attr('class').substr(5),ui.item.prevAll().length)}});$("#playlistparent").disableSelection();if(current_playlist_is_your){$('#favorite_listes_input').val('...');}else{$('#my_listes_input').val('...');}
defineHotKey('ctrl+38',"UpVolume()");defineHotKey('ctrl+40',"DownVolume()");defineHotKey('ctrl+37',"StepLeft()");defineHotKey('ctrl+39',"StepRight()");defineHotKey('ctrl+46 ',"nextThemeProcessor()");defineHotKey('ctrl+45 ',"nextThemeProcessor(2)");if(typeof(design_mode)=='undefined'){reloadProcessor();}
readyChat();setTimeout('UpdateProcessor()',update_timeout*1000);$(window).resize(function(){});$('#show_chat').click(function(){$('#show_comments').addClass('inactive');$(this).removeClass('inactive').removeClass('newcontent');$('#comhdn').hide();$('#chthdn').show();$('#pane2').jScrollPane({showArrows:true});try{$('#pane2')[0].scrollTo(9999999);}catch(e){}});$('#show_comments').click(function(){$('#show_chat').addClass('inactive');$(this).removeClass('inactive').removeClass('newcontent');$('#comhdn').show();$('#chthdn').hide();$('#main_comments').jScrollPane({showArrows:true});try{$('#main_comments')[0].scrollTo(0);}catch(e){}});$('.user_linkp').click(function(){return ShowUser(this);});$('.gotomessage').click(function(){if((parseInt($('#count_us').html())==1)&&(parseInt($('#if_mess_single').html())>0)){showUserMessages($('#if_mess_single').html());}else{LoadMessagesList(false,null,1);}
return false;});checkLocalState();});function readyMusic(){$('a.full').click(function(){generate_song_page(substr($(this).attr('id'),3),1);return false;});$('.music_search_style').click(function(){var boxes=$('body').find('INPUT:checkbox');for(i=0;i<boxes.length;i++){if((boxes[i].id.substr(0,6)=='style_')&&(boxes[i].value==$(this).attr('id').substr(3))){if(!boxes[i].checked){change_check(boxes[i],'styles_img_'+boxes[i].id.substr(6));boxes[i].click();}}else
if((boxes[i].id.substr(0,6)=='style_')&&boxes[i].checked){change_check(boxes[i],'styles_img_'+boxes[i].id.substr(6));boxes[i].click();}}
$('#filter_submit').click();return false;});$(".music_a").click(function(){current_music_page=substr($(this).attr('accesskey'),1);generate_music_page();return false;});$("#filter_style_name").multiSelect({oneOrMoreSelected:'*',tableCols:2,asTable:true,tableClass:'music_styles',divClass:'multiSelectOptions1'});HintElement($('#filter_artist'),'Исполнитель');HintElement($('#filter_name'),'Композиция');$('.play_song').click(function(){$('table.list tr').removeClass('current_song_tr');id=substr($(this).attr('id'),5);$('#song_list_tr_'+id).addClass('current_song_tr');createSongPlayer($(this));return false;});$('.add_play_list').click(function(){addSongPlayList($(this));return false;});$("#filter_artist").autocomplete(request_0+'jx/artist_list/',{maxItemsToShow:19,width:300});$("#filter_name").autocomplete(request_0+'jx/song_list/',{maxItemsToShow:19,width:300});$('.filter_clear').click(function(){return clearMusicForm();});$('#music_from').datePicker();$('#music_from').dpSetStartDate('01/01/1980');d=new Date();curr_date=d.getDate();if(curr_date<10)curr_date='0'+curr_date;curr_month=d.getMonth()-1+2;if(curr_month<10)curr_month='0'+curr_month;curr_year=d.getFullYear();$('#music_from').dpSetEndDate(curr_date+"/"+curr_month+"/"+curr_year);$('#music_from').dpSetSelected($('#music_from').val());$('#music_from').dpSetDisplayedMonth(substr($('#music_from').val(),3,2)-2+1,substr($('#music_from').val(),-4));$('#music_to').datePicker();$('#music_to').dpSetStartDate('01/01/1980');$('#music_to').dpSetEndDate(curr_date+"/"+curr_month+"/"+curr_year);$('#music_to').dpSetSelected($('#music_to').val());$('#music_to').dpSetDisplayedMonth(substr($('#music_to').val(),3,2)-2+1,substr($('#music_to').val(),-4));$('#pane_music').jScrollPane({showArrows:true});$('#music_to').click(function(){$('#music_to_a').click();});$('#music_from').click(function(){$('#music_from_a').click();});$("#music_item_albums").click(function(){if($(this).attr('class')!='selected'){current_music_position='albums';current_music_page=1;generate_music_page();}
return false;});$("#music_item_realtones").click(function(){if($(this).attr('class')!='selected'){current_music_position='realtones';current_music_page=1;generate_music_page();}
return false;});$("#music_item_mixes").click(function(){if($(this).attr('class')!='selected'){current_music_position='mixes';current_music_page=1;generate_music_page();}
return false;});$("#music_item_main").click(function(){if($(this).attr('class')!='selected'){current_music_position='main';current_music_page=1;generate_music_page();}
return false;});$('#music_sort_artist').click(function(){if((current_music_sort=='artist')&&(current_music_ord=='asc')){current_music_ord='desc';}else{current_music_ord='asc';current_music_sort='artist'}
generate_music_page();return false;});$('#music_sort_name').click(function(){if((current_music_sort=='name')&&(current_music_ord=='asc')){current_music_ord='desc';}else{current_music_ord='asc';current_music_sort='name'}
generate_music_page();return false;});$('#music_sort_rate').click(function(){if((current_music_sort=='rate')&&(current_music_ord=='desc')){current_music_ord='asc';}else{current_music_ord='desc';current_music_sort='rate'}
generate_music_page();return false;});$('#music_sort_click').click(function(){if((current_music_sort=='downloads')&&(current_music_ord=='desc')){current_music_ord='asc';}else{current_music_ord='desc';current_music_sort='downloads'}
generate_music_page();return false;});$('#music_sort_date').click(function(){if((current_music_sort=='date')&&(current_music_ord=='desc')){current_music_ord='asc';}else{current_music_ord='desc';current_music_sort='date'}
generate_music_page();return false;});$('#music_sort_comments').click(function(){if((current_music_sort=='comments')&&(current_music_ord=='desc')){current_music_ord='asc';}else{current_music_ord='desc';current_music_sort='comments'}
generate_music_page();return false;});$('#filter_form').submit(function(){return false;});$('#filter_submit').click(function(){current_music_start_date=$('#music_from').val();current_music_end_date=$('#music_to').val();current_music_author=$('#filter_artist').val();current_music_name=$('#filter_name').val();current_music_start_date=$('#music_from').val();current_music_end_date=$('#music_to').val();inps=$("input[name^='filter_style_name']");current_music_styles='';for(i=0;i<inps.length;i++){if($(inps[i]).attr('checked')==true){current_music_styles+=substr($(inps[i]).attr('id'),6)+';';}}
generate_music_page();return false;});blink_start($('.exclusive'));}
function songReady(){$('#commpan').jScrollPane({showArrows:true});$('#desc_single').jScrollPane({showArrows:true});$('.play_single_song').click(function(){createSongPlayer($(this));return false;});$('.add_play_list').click(function(){addSongPlayList($(this));return false;});$('#user_bb_code').click(function(){show_alert('Вставить BB код',$('#bbcode_par').html());$('#bbcode_div').show();});$('#user_smile').click(function(){show_alert('Вставить смайл',$('#smile_par').html());$('#smile_div').show();});$('.user_link').click(function(){return ShowUser(this);});$('.music_a').click(function(){LoadCommentsPage(this);return false;});if(def_ent!=1){defineHotKey('ctrl+13',"$('#user_send_comment').click();");def_ent=1;}
$('.social_p').click(function(){s_coords=split('|',$(this).attr('name'));return window_open($(this).attr('href'),s_coords[0],s_coords[1]);});blink_start($('.exclusive'));}
function radioReady(){$(".radio_a").click(function(){generate_radio_page(substr($(this).attr('href'),strlen(request_0)+6,-1));return false;});$('.play_radio').click(function(){createRadioPlayer($(this));return false;});$('.add_radio_voting').click(function(){add_voting(substr($(this).attr('id'),17),'radio');return false;});$('.take_away_radio_voting').click(function(){take_away_voting(substr($(this).attr('id'),23),'radio');return false;});$('#radio_sort_rate').click(function(){if((current_radio_sort=='rate')&&(current_radio_ord=='d')){current_radio_ord='a';}else{current_radio_ord='d';current_radio_sort='rate'}
generate_radio_page(current_radio_page);return false;});$('#radio_sort_date').click(function(){if((current_radio_sort=='date')&&(current_radio_ord=='d')){current_radio_ord='a';}else{current_radio_ord='d';current_radio_sort='date'}
generate_radio_page(current_radio_page);return false;});$('#radio_sort_click').click(function(){if((current_radio_sort=='click')&&(current_radio_ord=='d')){current_radio_ord='a';}else{current_radio_ord='d';current_radio_sort='click'}
generate_radio_page(current_radio_page);return false;});$('.user_link').click(function(){return ShowUser(this);});}
function register_ready(){$('.date-pick').datePicker();$("#reg_help").tooltip({showURL:false});$('.date-pick').dpSetStartDate('01.01.1960');$('.date-pick').dpSetEndDate('01.01.2000');$('#date1lbl').attr('generated','true');$('#ruleselbl').attr('generated','true');$('#emaillbl').attr('generated','true');$('#url').attr('url','true');$('#date1').attr('russianDate','true');$('#date1').mask("99.99.9999");$('#date1').attr('russianDate','true');$('#email').attr('remote',request_0+'jx/ajax_check/');$('#password').attr('minlength','3');$('#password1').attr('equalTo','#password');$.validator.addMethod("russianDate",function(value,element){return value.match(/^\d\d?\.\d\d?\.\d\d\d\d$/);},"Введите правильную дату.");$('#profile_form').validate({rules:{"login":{required:true,minlength:3,remote:request_0+'jx/ajax_check/'},"captcha":{required:true,minlength:5,remote:request_0+'jx/ajax_check/'+$('#public_key').val()+'/'},"email":{email:true,remote:request_0+'jx/ajax_check/'}},messages:{"login":{remote:"Такой логин уже есть в системе.",required:"Поле обязательно для заполнения",minlength:"Введите не меньше 3х символов."},"captcha":{remote:"Цифры не совпадают",required:"Обязательне поле",minlength:"Не меньше 5и символов."},"email":{remote:"Такой E-mail уже есть в системе.",required:"Поле обязательно для заполнения",email:"Введите правильный E-mail."}},submitHandler:function(form){$('#ajaxload').show();$(form).ajaxSubmit({dataType:'json',success:function(j){$('#ajaxload').hide();if(!j.value.errors){if(j.value.success){generate_history(j.value.data.history);html_text='<select class="stand required" name="favorite_listes" id="favorite_listes">';for(i in j.value.data.user_playlists_fav){html_text+='<option value="'+j.value.data.user_playlists_fav[i].id+'"';if((j.value.data.user_playlists_fav[i].id==j.value.data.current_playlist_id)&&(j.value.data.playlist_is_your=='false')){html_text+=' selected="selected"';}
html_text+='>'+j.value.data.user_playlists_fav[i].name+'</option>';}
html_text+='</select>';$('#fav_list_td').html(html_text);$('#favorite_listes').selectbox();$('#favorite_listes').change(function(){changeFavPlaylist();});$('#favorite_listes_container').css('width','100px');html_text='<select class="stand required" name="my_listes" id="my_listes">';for(i in j.value.data.user_playlists){html_text+='<option value="'+j.value.data.user_playlists[i].id+'"';if((j.value.data.user_playlists[i].id==j.value.data.current_playlist_id)&&(j.value.data.playlist_is_your=='true')){html_text+=' selected="selected"';}
html_text+='>'+j.value.data.user_playlists[i].name+'</option>';}
html_text+='</select>';$('#us_list_td').html(html_text);$('#my_listes').selectbox();$('#my_listes').change(function(){changeMyPlaylist();});$('#my_listes_container').css('width','100px');generate_playlist(j.value.data.PlayList,j.value.data.playlist_is_your);$('#pane1pllist').jScrollPane({showArrows:true});if(j.value.data.playlist_is_your=='true'){current_playlist_is_your=true;}else{current_playlist_is_your=false;}
current_playlist_id=j.value.data.current_playlist_id;$('#playlistparent').sortable({axis:'y','sort':function(event,ui){if((parseInt(substr($(ui.item).css('top'),0,-2)))<(parseInt(substr($('#pane1pllist')[0].style.top,0,-2))*-1)){$('#pane1pllist')[0].scrollTo(parseInt(substr($(ui.item).css('top'),0,-2)));}
if((parseInt(substr($(ui.item).css('top'),0,-2)))>(parseInt(substr($('#pane1pllist')[0].style.top,0,-2))*-1+220)){$('#pane1pllist')[0].scrollTo(parseInt(substr($(ui.item).css('top'),0,-2))-220);}
$(ui.item).css('background','#090E14');},'stop':function(event,ui){$(ui.item).css('background','');ChangeSortPlist($(ui.item).attr('class').substr(5),ui.item.prevAll().length)}});$("#playlistparent").disableSelection();if(current_playlist_is_your){$('#favorite_listes_input').val('...');}else{$('#my_listes_input').val('...');}
$('#dv_chat').html('<table cellpadding="0" cellspacing="0" class="chattable"><tr><td>Сообщение:</td><td>Кому:</td><td></td></tr><tr><td><input name="chat_message" type="text" id="chat_message" class="msg" /></td><td><input name="chat_to" type="text" id="chat_to" /></td><td><input type="submit" name="chat_subm" class="subm" id="chat_subm" value="GO" /></td></tr></table>');$('#menu_item_register').html('Профиль');$('#menu_item_register').attr('id','menu_item_profile');$('#menu_item_enter').html('Выход');$('#menu_item_enter').attr('id','menu_item_exit');$('#main_content_child_div').fadeTo("fast",0.0,function(){$('#main_content_child_div').html('<div class="margined lineh20"><div class="bordered"><h1>Поздравляем!</h1></div><br /><br /><br /><br /><br /><b>Теперь Вы полноценный пользователь нашего сайта.</b> <br /><br /> Изначально Вам добавлены ваши личные плей листы (которые сейчас пустые): <u>My List [50]</u>, <u>My List [100]</u> и <u>My List [150]</u> вместительностью на 50, 100 и 150 треков соответственно.<br />Вы можете сами заполнять, сортировать, удалять треки в них.<br /><br />Также, в качестве примеров Вам добавлены плейлисты авто генерации:<br /><span class="blue">Last 200</span> - 200 последних треков, появившихся на сайте;<br /><span class="blue">Last Progressive House</span> - 100 последних последних треков, появившихся на сайте в стиле Progressive House;<br /><span class="blue">Last Techno</span> - 100 последних последних треков, появившихся на сайте в стиле Techno;<br /><span class="blue">Last Drum</span> - 100 последних последних треков, появившихся на сайте в стиле Drum n` Bass;<br /><span class="blue">Last Trance</span> - 100 последних последних треков, появившихся на сайте в стиле Trance;<br /><span class="blue">Last Vocal trance</span> - 100 последних последних треков, появившихся на сайте в стиле Vocal trance;<br /><span class="blue">Last Electro</span> - 100 последних последних треков, появившихся на сайте в стиле Progressive House;<br /><span class="blue">Last House</span> - 100 последних последних треков, появившихся на сайте в стиле Electro;<br /><span class="blue">Last Chill out</span> - 100 последних последних треков, появившихся на сайте в стиле Chill out;<br /><span class="blue">Last Minimal</span> - 100 последних последних треков, появившихся на сайте в стиле Minimal;<br /><span class="blue">Last Electro House</span> - 100 последних последних треков, появившихся на сайте в стиле Electro House;<br /><h1>УДАЧНОГО ВРЕМЯПРОВОЖДЕНИЯ.</h1></div>');$('#main_content_child_div').fadeTo('fast',1.0);});setTimeout('readyChat()',2000);}else{show_alert("ОШИБКА РЕГИСТРАЦИИ","<br /><br />Неккоректный запрос к серверу.");}}else{var al_text='<center><table cellpadding="0" cellspacing="0">';for(var i in j.value.errors){al_text+='<tr><td class="right"><b>'+j.value.errors[i].name+': </b></td><td>'+j.value.errors[i].err+'</td></tr>';}
al_text+='</table></center>';show_alert("ОШИБКА РЕГИСТРАЦИИ",al_text);}}});return false;}});$('#refrech_captcha').click(function(){refrech_captcha('capcha_img','public_key');return false;});$('#country_id').selectbox();$('#country_id_container').css('width','200px');$("#city_id").autocomplete(request_0+'jx/city_list/'+global_country_id+'/',{maxItemsToShow:29});$("#rulpage").click(function(){show_modal_page('site_rules','Соглашения','generate_rules_page();$("#close_butt").click();');return false;});}
function readyNews(){$('a.full').click(function(){generate_single_news_page(substr($(this).attr('id'),3),1);return false;});$('a.styles_small').click(function(){var boxes=$('body').find('INPUT:checkbox');for(i=0;i<boxes.length;i++){if((boxes[i].id.substr(0,6)=='style_')&&(boxes[i].value==$(this).attr('id').substr(3))){if(!boxes[i].checked){change_check(boxes[i],'styles_img_'+boxes[i].id.substr(6));boxes[i].click();}}else
if((boxes[i].id.substr(0,6)=='style_')&&boxes[i].checked){change_check(boxes[i],'styles_img_'+boxes[i].id.substr(6));boxes[i].click();}}
$('#filter_submit').click();return false;});$("#filter_news_category").multiSelect({oneOrMoreSelected:'*',defname:'Категории'});HintElement($('#filter_news'),'Содержит');$('.filter_clear').click(function(){return clearNewsForm();});$(".music_a").click(function(){current_news_page=substr($(this).attr('accesskey'),1);generate_news_page();return false;});$('#news_from').datePicker();$('#news_from').dpSetStartDate('01/01/2010');d=new Date();curr_date=d.getDate();if(curr_date<10)curr_date='0'+curr_date;curr_month=d.getMonth()-1+2;if(curr_month<10)curr_month='0'+curr_month;curr_year=d.getFullYear();$('#news_from').dpSetEndDate(curr_date+"/"+curr_month+"/"+curr_year);$('#news_from').dpSetSelected($('#news_from').val());$('#news_from').dpSetDisplayedMonth(substr($('#news_from').val(),3,2)-2+1,substr($('#news_from').val(),-4));$('#news_to').datePicker();$('#news_to').dpSetStartDate('01/01/2010');$('#news_to').dpSetEndDate(curr_date+"/"+curr_month+"/"+curr_year);$('#news_to').dpSetSelected($('#news_to').val());$('#news_to').dpSetDisplayedMonth(substr($('#news_to').val(),3,2)-2+1,substr($('#news_to').val(),-4));$('#pane_news').jScrollPane({showArrows:true});$('#news_to').click(function(){$('#news_to_a').click();});$('#news_from').click(function(){$('#news_from_a').click();});$('#news_sort_title').click(function(){if((current_news_sort=='title')&&(current_news_ord=='asc')){current_news_ord='desc';}else{current_news_ord='asc';current_news_sort='title'}
generate_news_page();return false;});$('#news_sort_date').click(function(){if((current_news_sort=='date')&&(current_news_ord=='desc')){current_news_ord='asc';}else{current_news_ord='desc';current_news_sort='date'}
generate_news_page();return false;});$('#news_sort_comments').click(function(){if((current_news_sort=='comments')&&(current_news_ord=='desc')){current_news_ord='asc';}else{current_news_ord='desc';current_news_sort='comments'}
generate_news_page();return false;});$('#filter_form').submit(function(){return false;});$('#filter_submit').click(function(){current_news_start_date=$('#news_from').val();current_news_end_date=$('#news_to').val();current_news_title=$('#filter_news').val();inps=$("input[name^='filter_news_category']");current_news_categories='';for(i=0;i<inps.length;i++){if($(inps[i]).attr('checked')==true){current_news_categories+=substr($(inps[i]).attr('id'),6)+';';}}
generate_news_page();return false;});}
function singleNewsReady(){$('#commpan').jScrollPane({showArrows:true});$('#song_area').jScrollPane({showArrows:true});$('#user_bb_code').click(function(){show_alert('Вставить BB код',$('#bbcode_par').html());$('#bbcode_div').show();});$('#user_smile').click(function(){show_alert('Вставить смайл',$('#smile_par').html());$('#smile_div').show();});$('.user_link').click(function(){return ShowUser(this);});$('.music_a').click(function(){LoadNewsCommentsPage(this);return false;});}
function rulesReady(){$('.main_content_height_block').jScrollPane({showArrows:true});$('.main_content_height_block_popup').jScrollPane({showArrows:true});}
function loginReady(){$('#password').attr('minlength','3');$('#torem').click(function(){$('#remember_form').show('fast',function(){$('#login_form').hide('fast')});return false;});$('#tolog').click(function(){$('#login_form').show('fast',function(){$('#remember_form').hide('fast')});return false;});$("#login_help").tooltip({showURL:false});$('#login_form').validate({rules:{"login":{required:true,minlength:3},"password":{required:true,minlength:3}},messages:{"login":{required:"Поле обязательно для заполнения",minlength:"Введите не меньше 3х символов."}},submitHandler:function(form){$('#ajaxload').show();if($('#prov').attr('checked')){$('#h_password').val(md5($('#pass').val()));$('#pass').attr('name','');}
$(form).ajaxSubmit({dataType:'json',success:function(j){if(!j.value.errors){if(j.value.success){generate_history(j.value.data.history);html_text='<select class="stand required" name="favorite_listes" id="favorite_listes">';for(i in j.value.data.user_playlists_fav){html_text+='<option value="'+j.value.data.user_playlists_fav[i].id+'"';if((j.value.data.user_playlists_fav[i].id==j.value.data.current_playlist_id)&&(j.value.data.playlist_is_your=='false')){html_text+=' selected="selected"';}
html_text+='>'+j.value.data.user_playlists_fav[i].name+'</option>';}
html_text+='</select>';$('#fav_list_td').html(html_text);$('#favorite_listes').selectbox();$('#favorite_listes').change(function(){changeFavPlaylist();});$('#favorite_listes_container').css('width','100px');html_text='<select class="stand required" name="my_listes" id="my_listes">';for(i in j.value.data.user_playlists){html_text+='<option value="'+j.value.data.user_playlists[i].id+'"';if((j.value.data.user_playlists[i].id==j.value.data.current_playlist_id)&&(j.value.data.playlist_is_your=='true')){html_text+=' selected="selected"';}
html_text+='>'+j.value.data.user_playlists[i].name+'</option>';}
html_text+='</select>';$('#us_list_td').html(html_text);$('#my_listes').selectbox();$('#my_listes').change(function(){changeMyPlaylist();});$('#my_listes_container').css('width','100px');generate_playlist(j.value.data.PlayList,j.value.data.playlist_is_your);$('#pane1pllist').jScrollPane({showArrows:true});if(j.value.data.playlist_is_your=='true'){current_playlist_is_your=true;}else{current_playlist_is_your=false;}
current_playlist_id=j.value.data.current_playlist_id;$('#playlistparent').sortable({axis:'y','sort':function(event,ui){if((parseInt(substr($(ui.item).css('top'),0,-2)))<(parseInt(substr($('#pane1pllist')[0].style.top,0,-2))*-1)){$('#pane1pllist')[0].scrollTo(parseInt(substr($(ui.item).css('top'),0,-2)));}
if((parseInt(substr($(ui.item).css('top'),0,-2)))>(parseInt(substr($('#pane1pllist')[0].style.top,0,-2))*-1+220)){$('#pane1pllist')[0].scrollTo(parseInt(substr($(ui.item).css('top'),0,-2))-220);}
$(ui.item).css('background','#090E14');},'stop':function(event,ui){$(ui.item).css('background','');ChangeSortPlist($(ui.item).attr('class').substr(5),ui.item.prevAll().length)}});$("#playlistparent").disableSelection();if(current_playlist_is_your){$('#favorite_listes_input').val('...');}else{$('#my_listes_input').val('...');}
$('#dv_chat').html('<table cellpadding="0" cellspacing="0" class="chattable"><tr><td>Сообщение:</td><td>Кому:</td><td></td></tr><tr><td><input name="chat_message" type="text" id="chat_message" class="msg" /></td><td><input name="chat_to" type="text" id="chat_to" /></td><td><input type="submit" name="chat_subm" class="subm" id="chat_subm" value="GO" /></td></tr></table>');setTimeout('readyChat()',2000);$('#menu_item_register').html('Профиль');$('#menu_item_register').attr('id','menu_item_profile');$('#menu_item_enter').html('Выход');$('#menu_item_enter').attr('id','menu_item_exit');$('#close_butt').click();$('#user_data').removeClass('invise');$('#user_scores').html(j.value.user.scores);$('#if_mess_single').html(j.value.user.message_single);$('#count_us').html(j.value.user.count_messages_users);$('#count_mess').html(j.value.user.count_messages);$('#main_user_prof').html(j.value.user.login);$('#main_user_prof').attr('href',request_0+'user_profile/'+j.value.user.id+'/');mess_img=request_0+'images/message'+(parseInt(j.value.user.count_messages)>0?'b':'')+'.gif';if($('#messimg').attr('src')!=mess_img){$('#messimg').attr('src',mess_img);}
reloadProcessor();}}else{$('#login_error').html(j.value.errors);}
$('#ajaxload').hide();$('#pass').attr('name','password');}});return false;}});$('#remember_form').validate({rules:{"login":{required:true,minlength:3}},messages:{"login":{required:"Поле обязательно для заполнения",minlength:"Введите не меньше 3х символов."}},submitHandler:function(form){$('#ajaxload').show();$(form).ajaxSubmit({dataType:'json',success:function(j){if(!j.value.errors){if(j.value.success){$('#remember_success').html(j.value.success);$('#remember_error').html('');}}else{$('#remember_error').html(j.value.errors);$('#remember_success').html('');}
$('#ajaxload').hide();}});return false;}});$('#login').focus();}
function IndexReady(){$('.play_song').click(function(){$('table.list tr').removeClass('current_song_tr');id=substr($(this).attr('id'),5);$('#song_list_tr_'+id).addClass('current_song_tr');createSongPlayer($(this));return false;});$('.add_play_list').click(function(){addSongPlayList($(this));return false;});$('a.full').click(function(){generate_song_page(substr($(this).attr('id'),3),1);return false;});$('a.fulln').click(function(){generate_single_news_page(substr($(this).attr('id'),3),1);return false;});$('.news_main').jScrollPane({showArrows:true});blink_start($('.exclusive'));}
function profile_ready(){$('.date-pick').datePicker();$("#reg_help").tooltip({showURL:false});$("#reg_help1").tooltip({showURL:false});$("#reg_help2").tooltip({showURL:false});$("#reg_help3").tooltip({showURL:false});$("#reg_help4").tooltip({showURL:false});$("#reg_help5").tooltip({showURL:false});$('.date-pick').dpSetStartDate('01.01.1960');$('.date-pick').dpSetEndDate('01.01.2000');$('#date1lbl').attr('generated','true');$('#emaillbl').attr('generated','true');$('#url').attr('url','true');$('#date1').attr('russianDate','true');$('#date1').mask("99.99.9999");$('#del_favorite_song').click(function(){$('#set_single').html('<span class="bold">Не установлен</span>');$('#favorite_song').val(0);$('#change_favorite_song').html('Установить');$(this).addClass('invise');});$('#change_favorite_song').click(function(){$('#del_favorite_song').addClass('invise');$(this).after('<div id="set_single_selector">Нажатие на <img src="'+request_0+'images/add_to_playlist.gif" width="15" alt="добавить" /> для установки. <img id="del_favorite_song_set_area" src="'+request_0+'images/delete.gif" class="finger" onclick="deleteSetupFavoriteBlock();" /> </div>');$(this).addClass('invise');return false;});$('#email').attr('remote',request_0+'jx/ajax_check/');$('#password').attr('minlength','3');$('#password1').attr('equalTo','#password');$.validator.addMethod("russianDate",function(value,element){return value.match(/^\d\d?\.\d\d?\.\d\d\d\d$/);},"Введите правильную дату.");$('#profile_form').validate({rules:{"email":{email:true,remote:request_0+'jx/ajax_check_profile/'}},messages:{"email":{remote:"Такой E-mail уже есть в системе.",required:"Поле обязательно для заполнения",email:"Введите правильный E-mail."}},submitHandler:function(form){$('#ajaxload').show();$(form).ajaxSubmit({dataType:'json',success:function(j){$('#ajaxload').hide();if(!j.value.errors){if(j.value.success){$('#main_content_child_div').fadeTo("fast",0.0,function(){$('#ajaxload').hide();tmout=parseInt($('#update_time').val());if((tmout==30)||(tmout==45)||(tmout==60)||(tmout==120)||(tmout==160)||(tmout==300)||(tmout==600)||(tmout==900)||(tmout==1800)||(tmout==2700)||(tmout==3600)||(tmout==7200)||(tmout==10800)||(tmout==86400)){update_timeout=tmout;}else{update_timeout=20;}
$('#main_content_child_div').html('<br /><br /><br /><br /><br /><br /><br /><br /><br /><center><span class="bold">Профиль сохранён.</span></center><br /><br /><br /><br /><br /><br /><br /><span class="marginleft30 white">Продолжить редактирование профиля</span><div class="styleline3"></div><div class="marginleft30"><table><tr><td>         <table id="tblload_images" class="buttonahref"><tbody><tr><td class="t1"/>   <td class="t2"><a onclick="generate_profile_page();return false;" href="'+request_0+'/profile">Основное</a></td><td class="t3"/></tr></tbody></table> </td>        <td><table id="tblload_images" class="buttonahref"><tbody><tr><td class="t1"/>   <td class="t2"><a onclick="generate_edit_wall(1);return false;" href="'+request_0+'/profile">Стена</a></td><td><table id="tblload_images" class="buttonahref"><tbody><tr><td class="t1"/>   <td class="t2"><a onclick="generate_edit_photo();return false;" href="'+request_0+'/profile">Галлереи / Аватар</a></td><td><table id="tblload_images" class="buttonahref"><tbody><tr><td class="t1"/>   <td class="t2"><a onclick="generate_edit_present();return false;" href="'+request_0+'/profile">Подарки</a></td><td><table id="tblload_images" class="buttonahref"><tbody><tr><td class="t1"/>   <td class="t2"><a onclick="generate_edit_friends();return false;" href="'+request_0+'/profile">Друзья</a></td><td><table id="tblload_images" class="buttonahref"><tbody><tr><td class="t1"/>   <td class="t2"><a onclick="generate_edit_playlists();return false;" href="'+request_0+'/profile">Плей листы</a></td><td class="t3"/></tr></tbody></table></td>                                                             </tr></table>         </div>');$('#main_content_child_div').fadeTo('fast',1.0);});}else{show_alert("ОШИБКА СОХРАНЕНИЯ ПРОФИЛЯ","<br /><br />Неккоректный запрос к серверу.");}}else{var al_text='<center><table cellpadding="0" cellspacing="0">';for(var i in j.value.errors){al_text+='<tr><td class="right"><b>'+j.value.errors[i].name+': </b></td><td>'+j.value.errors[i].err+'</td></tr>';}
al_text+='</table></center>';show_alert("ОШИБКА СОХРАНЕНИЯ ПРОФИЛЯ",al_text);}}});return false;}});$('#country_id').selectbox();$('#update_time').selectbox();$('#country_id_container').css('width','200px');$("#city_id").autocomplete(request_0+'jx/city_list/'+global_country_id+'/',{maxItemsToShow:29});userEditTabsSet();}
var chat_sended=false;function readyChat(){options={success:chatSended,dataType:'json'};$('#chat_form').submit(function(){if(chat_sended){return false;}
chat_sended=true;$('#ajaxload').show();$(this).ajaxSubmit(options);return false;});readyChatParams()}
function readyChatParams(){if($('#chthdn').css('display')!='none'){$('#pane2').jScrollPane({showArrows:true});try{$('#pane2')[0].scrollTo(9999999);}catch(e){}}
$('#pane2 table th a').click(function(){if($(this).html()=='Всем'){$('#chat_to').val('');}else{$('#chat_to').val($(this).html());}
$('#chat_message').focus();return false;});}
function readyAddFile(){$('#addimages').click(function(){if(this.className=='selected'){return false;}
$('#track_file_status').val(1);$('#divupl').show();$('#addimages').addClass('selected');$('#tbladdimages').className='buttonahref_selected';$('#divsel').hide();$('#load_images').removeClass('selected');$('#tblload_images').className='buttonahref';$('#divlink').hide();$('#link_images').removeClass('selected');$('#tbllink_images').className='buttonahref';$('#tbllink_images').removeClass('buttonahref_selected');$('#tbllink_images').addClass('buttonahref');$('#tblload_images').removeClass('buttonahref_selected');$('#tblload_images').addClass('buttonahref');$('#tbladdimages').removeClass('buttonahref');$('#tbladdimages').addClass('buttonahref_selected');return false;});$('#load_images').click(function(){if(this.className=='selected'){return false;}
getCurrImages();$('#track_file_status').val(2);$('#divsel').show();$('#load_images').addClass('selected');$('#divupl').hide();$('#addimages').removeClass('selected');$('#divlink').hide();$('#link_images').removeClass('selected');$('#tbllink_images').removeClass('buttonahref_selected');$('#tbllink_images').addClass('buttonahref');$('#tbladdimages').removeClass('buttonahref_selected');$('#tbladdimages').addClass('buttonahref');$('#tblload_images').removeClass('buttonahref');$('#tblload_images').addClass('buttonahref_selected');return false;});$('#link_images').click(function(){if(this.className=='selected'){return false;}
$('#track_file_status').val(3);$('#divlink').show();$('#link_images').addClass('selected');$('#divupl').hide();$('#addimages').removeClass('selected');$('#divsel').hide();$('#load_images').removeClass('selected');$('#tbladdimages').removeClass('buttonahref_selected');$('#tbladdimages').addClass('buttonahref');$('#tblload_images').removeClass('buttonahref_selected');$('#tblload_images').addClass('buttonahref');$('#tbllink_images').removeClass('buttonahref');$('#tbllink_images').addClass('buttonahref_selected');return false;});$('#del_upl').click(function(){$('#ajaxload').show();$.getJSON(request_0+'jx/upload_file/?upload_file=3',{},function(j){$('#ajaxload').hide();if(j.value.del_sucess){$('#track_img').attr('src',request_0+'images/artist/no.gif');$('#del_upl').css('display','none');$('#track_file').val('');$('#water_mark').css('display','none');}});});var jcu;$("#filter_style_name").multiSelect({defname:'',oneOrMoreSelected:'*',tableCols:2,asTable:true,tableClass:'music_styles',divClass:'multiSelectOptions1'});var conf={url:request_0+'jx/upload_file/?upload_file=1&uhash='+add_file_hash,extensions:["Изображения (*.jpg;*.jpeg;*.gif;*.png;)|*.jpg;*.jpeg;*.gif;*.png;"],max_file_size:100*1024*1024,max_queue_count:0,multi_file:0,max_queue_size:0,flash_background:request_0+'images/jcu_button.png',file_icon_ready:request_0+'images/jcu_file_ready.gif',file_icon_uploading:request_0+'images/jcu_file_uploading.gif',file_icon_finished:request_0+'images/jcu_file_finished.gif',flash_file:request_0+'js/jcupload.swf',box_height:50,hide_file_after_finish:true,callback:{init:function(){},queue_upload_end:function(uo){updateImgStatus();}}};jcu=$.jcuploadUI(conf);jcu.append_to("#upload_button");$("#author").autocomplete(request_0+'jx/artist_list/',{maxItemsToShow:19,width:300});$("#sname").autocomplete(request_0+'jx/song_list/',{maxItemsToShow:19,width:300});$("#track_kbps").autocomplete('none',{maxItemsToShow:19,width:100},["32","64","96","128","256","320"]);$('#mlstfilter_style_name').addClass('required');$('#mlstfilter_style_name').attr('name','mlstfilter_style_name');$('#add_track_form').validate({rules:{"track_link":{required:true,minlength:3}},messages:{"track_link":{required:"",minlength:"",url:""},"author":{required:"",minlength:""},"sname":{required:"",minlength:""},"track_length":{required:"",minlength:""},"track_kbps":{required:"",minlength:""},"mlstfilter_style_name":{required:"",minlength:""}},submitHandler:function(form){$('#ajaxload').show();$(form).ajaxSubmit({dataType:'json',success:function(j){$('#ajaxload').hide();if(typeof(j.value.added)!='undefined'){if(j.value.added){$('#main_content_child_div').fadeTo("fast",0.0,function(){$('#main_content_child_div').html('<div id="add_song_form"><div><br/><br/><br/><br/><br/><br/><br/><br/><br/><center class="bold">Трек успешно добавлен</center></div><br/><br/><br/>   Трек добавлен, но помечен как модерируемый.<br/><br/><small class="fsize11">Внимание в дальнейшем времени эта функция будет работать иначе: сначала будет модерирование, а далее добавление<br/><br/><br/><br/><br/><br/><br/></small><table><tr><td><table id="tblload_images" class="buttonahref"><tbody><tr><td class="t1"/><td class="t2"><a onclick="generate_add_file_page();return false;" href="'+request_0+'add_file" class="">Добавить ещё</a></td><td class="t3"/></tr></tbody></table></td><td><table id="tblload_images" class="buttonahref"><tbody><tr><td class="t1"/><td class="t2"><a onclick="generate_song_page('+j.value.single_id+',1);return false;" href="'+request_0+'singles/'+j.value.single_id+'/1" class="">Перейти на страницу добавленого трека</a></td><td class="t3"/></tr></tbody></table></td></tr></table><div/></div>');$('#main_content_child_div').fadeTo('fast',1.0);});}else{if(typeof(j.value.error)!='undefined'){if(j.value.error.length>0){show_alert("ОШИБКА ДОБАВЛЕНИЯ","<br /><br />"+j.value.error);}}}}else{if(typeof(j.value.error)!='undefined'){if(j.value.error.length>0){show_alert("ОШИБКА ДОБАВЛЕНИЯ","<br /><br />"+j.value.error);}}}}})}});}
function UserProfileReady(){$('#user_presents').jScrollPane({showArrows:true});$('.play_song').click(function(){$('table.list tr').removeClass('current_song_tr');id=substr($(this).attr('id'),5)
$('#song_list_tr_'+id).addClass('current_song_tr');createSongPlayer($(this));return false;});$('.add_play_list').click(function(){addSongPlayList($(this));return false;});$('.user_link').click(function(){return ShowUser(this);});$(".img_user_pres").tooltip({showURL:false});$("#musc").tooltip({showURL:false});$("#psit").tooltip({showURL:false});userInfoTabsSet();}
function GalleryReady(){var elcl=null;userInfoTabsSet();$('#galeries img').css('opacity','0.5');$('#galeries_photos img').each(function(){dat=split('/',$(this).attr('title'));$(this).data('rate',dat[0]);$(this).data('count',dat[1]);$(this).data('bid',dat[2]);$(this).data('yvote',dat[3]);$(this).attr('title','');});$('#galeries img').each(function(){dat=split('_andid_',$(this).attr('title'));$(this).data('gid',dat[1]);$(this).attr('title',dat[0]);});pt=0;$('#galeries img').each(function(){if(pt==loaded_galery){$(this).css('opacity','1');}
pt++;});$('#galeries_photos img').css('opacity','0.5');ptt=0;$('#galeries_photos img').each(function(){if(ptt==loaded_pict){$(this).css('opacity','1');elcl=$(this);}
ptt++;});$('#galeries a').click(function(){return false;});$('#galeries img').click(function(){loadUserGallery(user_id_gal,$(this).data('gid'),curr_user_gl);if($('#galeries').width()<$('#galeries table').width()){center=($('#galeries').width()/2);twidth=$('#galeries table').width();wd=$(this).attr('id').substr(4);wd=106*(parseInt(wd));wd=wd-center-53;wd=-wd;if(wd>0){wd=0}
if((-wd)>(twidth-center-center)){wd=-(twidth-center-center);}
$("#galeries table").animate({marginLeft:wd+'px'});}
if($(this).css('opacity')=='0.5'){$('#galeries img').css('opacity','0.5');$(this).css('opacity','1');}
if($('#main_gal_big_popup').css('display')!='none'){$('#main_gal_big_popup').hide('fast');}});$('#galeries_photos a').click(function(){return false;});$('#galeries_photos img').click(function(){if($('#galeries_photos').width()<$('#galeries_photos table').width()){tcenter=($('#galeries_photos').width()/2);ttwidth=$('#galeries_photos table').width();wd=$(this).attr('id').substr(6);wd=56*(parseInt(wd));wd=wd-tcenter-28;wd=-wd;if(wd>0){wd=0}
if((-wd)>(ttwidth-tcenter-tcenter)){wd=-(ttwidth-tcenter-tcenter);}
$("#galeries_photos table").animate({marginLeft:wd+'px'});}
if($(this).css('opacity')=='0.5'){$('#galeries_photos img').css('opacity','0.5');$(this).css('opacity','1');im=split('/',$(this).attr('src'));img=im[im.length-1];$('#main_gal_img').attr('src',request_0+'images/user_images/'+user_id_gal+'/profile/'+img);$('#gal_desc').html($(this).attr('alt'));$('#img_rate_div').css('width',($(this).data('rate')*2)+'%');$('#img_rate_percent').html($(this).data('rate'));$('#img_voting_count').html($(this).data('count'));}
if($('#main_gal_big_popup').css('display')!='none'){$('#main_gal_big_popup').hide('fast');}
$('#img_rate_div').css('width',$(this).data('rate')+'%');$('#img_rate_percent').html($(this).data('rate'));$('#img_voting_count').html($(this).data('count'));y_vote=parseInt($(this).data('yvote'));if(y_vote>0){html_text='<tr><td';if(y_vote>0){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(y_vote>1){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(y_vote>2){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(y_vote>3){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(y_vote>4){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(y_vote>5){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(y_vote>6){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(y_vote>7){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(y_vote>8){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td><td';if(y_vote==10){html_text+=' class="crclerd"';}
html_text+='>&nbsp;</td></tr>';$('#photo_vote_tbl').html(html_text);}else{if(curr_user_gl>0){id=$(this).attr('id').substr(6);$('#photo_vote_tbl').html('<tr><td class="crclfill" onmouseover="setcircle(1);" onclick="setPhotoVote('+$(this).data('bid')+', 1, '+id+');" id="r1">&nbsp;</td><td class="crclempty" onmouseover="setcircle(2);" onclick="setPhotoVote('+$(this).data('bid')+', 2, '+id+');" id="r2">&nbsp;</td><td class="crclempty" onmouseover="setcircle(3);" onclick="setPhotoVote('+$(this).data('bid')+', 3, '+id+');" id="r3">&nbsp;</td><td class="crclempty" onmouseover="setcircle(4);" onclick="setPhotoVote('+$(this).data('bid')+', 4, '+id+');" id="r4">&nbsp;</td><td class="crclempty" onmouseover="setcircle(5);" onclick="setPhotoVote('+$(this).data('bid')+', 5, '+id+');" id="r5">&nbsp;</td><td class="crclempty" onmouseover="setcircle(6);" onclick="setPhotoVote('+$(this).data('bid')+', 6, '+id+');" id="r6">&nbsp;</td><td class="crclempty" onmouseover="setcircle(7);" onclick="setPhotoVote('+$(this).data('bid')+', 7, '+id+');" id="r7">&nbsp;</td><td class="crclempty" onmouseover="setcircle(8);" onclick="setPhotoVote('+$(this).data('bid')+', 8, '+id+');" id="r8">&nbsp;</td><td class="crclempty" onmouseover="setcircle(9);" onclick="setPhotoVote('+$(this).data('bid')+', 9, '+id+');" id="r9">&nbsp;</td><td class="crclempty" onmouseover="setcircle(10);" onclick="setPhotoVote('+$(this).data('bid')+', 10, '+id+');" id="r10">&nbsp;</td></tr>');}}
imat=split('/',$(this).parent().attr('href'));document.location=request_0+'#user_photo-'+imat[imat.length-4]+'-'+imat[imat.length-3]+'-'+imat[imat.length-2];currentState=document.location.hash;return false;});$('#main_gal_big_img').click(function(){$('#main_gal_big_popup').hide('fast');});$('#main_gal_img').click(function(){im=split('/',$(this).attr('src'));img=im[im.length-1];$('#main_gal_big_popup').html('<img alt="'+$(this).attr('alt')+'" id="main_gal_big_img" src="'+request_0+'images/user_images/'+user_id_gal+'/'+img+'"/>');$('#main_gal_big_img').click(function(){$('#main_gal_big_popup').hide('fast');});$('#main_gal_big_popup').show('fast');});if(elcl!=null){elcl.click();}}
function UserCommentsReady(){$('#commpan_popup').jScrollPane({showArrows:true});$('#user_bb_code_popup').click(function(){show_alert('Вставить BB код',$('#bbcode_par').html().replace(/addBBCode/gi,'addBBCodePopup'));});$('#user_smile_popup').click(function(){show_alert('Вставить смайл',$('#smile_par').html().replace(/addBBCode/gi,'addBBCodePopup'));});$('.music_a').click(function(){LoadUserMessages(this);return false;});$('.user_link').click(function(){return ShowUser(this);});if(def_ent!=2){defineHotKey('ctrl+13',"$('#user_send_comment_popup').click();");def_ent=2;}
userInfoTabsSet();}
function AddPresentReady(){$('#user_presents_add img').each(function(){$(this).data('pid',$(this).attr('title'));$(this).attr('title','');$(this).click(function(){$('#user_presents_add img').css('width','100px').css('border','1px solid #6C7072');$(this).css('width','98px').css('border','dotted 2px #CC9900');$('#prid').val($(this).data('pid'));});});$('#user_presents_add').jScrollPane({showArrows:true});$('.user_link').click(function(){return ShowUser(this);});userInfoTabsSet();}
function UserWallReady(){$('#commpan_popup').jScrollPane({showArrows:true});$('#user_bb_code_popup').click(function(){show_alert('Вставить BB код',$('#bbcode_par').html().replace(/addBBCode/gi,'addBBCodePopup'));});$('#user_smile_popup').click(function(){show_alert('Вставить смайл',$('#smile_par').html().replace(/addBBCode/gi,'addBBCodePopup'));});$('.music_a').click(function(){LoadUserWall(this);return false;});$('.user_link').click(function(){return ShowUser(this);});userInfoTabsSet();}
function UserWallEditReady(){$('#commpan_popup_big').jScrollPane({showArrows:true});$('.music_a').click(function(){generate_edit_wall(getIdFromHref($(this).attr('href')));return false;});$('.user_link').click(function(){return ShowUser(this);});userEditTabsSet();}
function LoadMessageListReady(){$('.maintmess').mouseover(function(){$(this).css('background-color','#212932');});$('.maintmess').mouseout(function(){$(this).css('background-color','');});$('.maintmess').click(function(){showUserMessages(substr($(this).attr('id'),3));});$('.music_a').click(function(){LoadMessagesList(true,this);return false;});$('#pane_messages').jScrollPane({showArrows:true});}
function EditUsersPhotoReady(){$('#galery_selector').selectbox();$('#commpan_popup_big_pict').jScrollPane({showArrows:true});setUserPhotoUploader(($('#water').attr('checked')?1:0),$('#galery_selector').val(),add_file_hash,max_queue_photos);$('.avt').click(function(){var abid=$(this).attr('id');$('#ajaxload').show();$.getJSON(request_0+'jx/save_gallery/',{image_id:substr($(this).attr('id'),1),act:'change_av'},function(j){$('#ajaxload').hide();j=j.value;if(j.correct){$('.avt').show();$('#'+abid).hide();$('#avatar_prev').attr('src',request_0+'images/user_images/'+j.image);$('#no_user_ava').hide();$('#del_user_ava').show();}});});$('#del_user_ava').click(function(){var abid=$(this).attr('id');$('#ajaxload').show();$.getJSON(request_0+'jx/save_gallery/',{act:'del_av'},function(j){$('#ajaxload').hide();j=j.value;if(j.correct){$('.avt').show();$('#avatar_prev').attr('src',request_0+'images/'+j.image);$('#no_user_ava').show();$('#del_user_ava').hide();}});});$('.edavarea textarea').focus(function(){if($('#save_img_comm').length>0){if($('#save_img_comm').attr('sid')!=substr($(this).attr('id'),1)){$('#t'+$('#save_img_comm').attr('sid')).val($('#old_val').val());$('#save_img_comm').remove();$('#old_val').remove();}}
$('.edavarea textarea').css('width','98px');$(this).css('width','85px');if($('#save_img_comm').length==0){$(this).after('<img src="'+request_0+'images/save.gif" class="normal_img finger" onclick="save_image_comment('+substr($(this).attr('id'),1)+');" sid="'+substr($(this).attr('id'),1)+'" id="save_img_comm" alt="сохранить"><input type="hidden" id="old_val">');$('#old_val').val($(this).val());}});userEditTabsSet();}
function UserPresentsEditReady(){$(".img_user_pres").tooltip({showURL:false});$('#user_presents_edit').jScrollPane({showArrows:true});$('.user_link').click(function(){return ShowUser(this);});userEditTabsSet();}
function UserFriendsEditReady(){$('#user_friends_edit').jScrollPane({showArrows:true});$(".reg_help").tooltip({showURL:false});$('.user_link').click(function(){return ShowUser(this);});userEditTabsSet();}
function UserPlayListsEditReady(){$(".valmid img").tooltip({showURL:false});$('#cont').jScrollPane({showArrows:true});$('.user_link').click(function(){return ShowUser(this);});userEditTabsSet();}
function readyPlaylists(){$('a.full').click(function(){showPlaylistWindow(substr($(this).attr('id'),3));return false;});$('.music_search_style').click(function(){var boxes=$('body').find('INPUT:checkbox');for(i=0;i<boxes.length;i++){if((boxes[i].id.substr(0,6)=='style_')&&(boxes[i].value==$(this).attr('id').substr(3))){if(!boxes[i].checked){change_check(boxes[i],'styles_img_'+boxes[i].id.substr(6));boxes[i].click();}}else
if((boxes[i].id.substr(0,6)=='style_')&&boxes[i].checked){change_check(boxes[i],'styles_img_'+boxes[i].id.substr(6));boxes[i].click();}}
$('#filter_submit').click();return false;});$("#filter_style_name").multiSelect({oneOrMoreSelected:'*',tableCols:2,asTable:true,tableClass:'music_styles',divClass:'multiSelectOptions1'});HintElement($('#filter_user'),'Пользователь');HintElement($('#filter_name'),'Название');HintElement($('#filter_decsription'),'Описание');$("#filter_user").autocomplete(request_0+'jx/users_list/',{maxItemsToShow:19,width:300});$("#filter_name").autocomplete(request_0+'jx/playlists_list/',{maxItemsToShow:19,width:300});$('.filter_clear').click(function(){return clearPlaylistsForm();});$('#pane_music').jScrollPane({showArrows:true});$("#music_item_is_system").click(function(){if($(this).attr('class')!='selected'){current_playlists_position='is_system';current_playlists_page=1;generate_playlist_page();}
return false;});$("#music_item_main").click(function(){if($(this).attr('class')!='selected'){current_playlists_position='main';current_playlists_page=1;generate_playlist_page();}
return false;});$('#music_sort_user').click(function(){if((current_playlists_sort=='user')&&(current_playlists_ord=='asc')){current_playlists_ord='desc';}else{current_playlists_ord='asc';current_playlists_sort='user'}
generate_playlist_page();return false;});$('#music_sort_name').click(function(){if((current_playlists_sort=='name')&&(current_playlists_ord=='asc')){current_playlists_ord='desc';}else{current_playlists_ord='asc';current_playlists_sort='name'}
generate_playlist_page();return false;});$('#music_sort_use_count').click(function(){if((current_playlists_sort=='count_users')&&(current_playlists_ord=='desc')){current_playlists_ord='asc';}else{current_playlists_ord='desc';current_playlists_sort='count_users'}
generate_playlist_page();return false;});$('#music_sort_count_singles').click(function(){if((current_playlists_sort=='count_singles')&&(current_playlists_ord=='desc')){current_playlists_ord='asc';}else{current_playlists_ord='desc';current_playlists_sort='count_singles'}
generate_playlist_page();return false;});$('#music_sort_publish_date').click(function(){if((current_playlists_sort=='publish_date')&&(current_playlists_ord=='desc')){current_playlists_ord='asc';}else{current_playlists_ord='desc';current_playlists_sort='publish_date'}
generate_playlist_page();return false;});$('#filter_form').submit(function(){return false;});$('#filter_submit').click(function(){current_playlists_user=$('#filter_user').val();current_playlists_name=$('#filter_name').val();current_playlists_decsription=$('#filter_decsription').val();inps=$("input[name^='filter_style_name']");current_playlists_styles='';for(i=0;i<inps.length;i++){if($(inps[i]).attr('checked')==true){current_playlists_styles+=substr($(inps[i]).attr('id'),6)+';';}}
generate_playlist_page();return false;});$(".music_a").click(function(){current_playlists_page=substr($(this).attr('accesskey'),1);generate_playlist_page();return false;});$('.user_link').click(function(){return ShowUser(this);});$('#add_plist').click(function(){return showAddPlistRequest();});$('.add_to_plists').click(function(){return addPlaylist(substr($(this).attr('id'),5));});}
function addPlistReady(){$('#add_playlists_count').attr('min','1').attr('max','200');$("#add_lpaylist_desc_help").tooltip({showURL:false});$('#login_form').validate({rules:{"add_lpaylist_desc":{required:true,minlength:10},"add_playlists_count":{required:true}},messages:{"login":{required:"Поле обязательно для заполнения",minlength:"Введите не меньше 10 символов."}},submitHandler:function(form){$('#ajaxload').show();if($('#prov').attr('checked')){$('#h_password').val(md5($('#pass').val()));$('#pass').attr('name','');}
$(form).ajaxSubmit({dataType:'json',success:function(j){if(!j.value.errors){if(j.value.success){$('div.login').html('Запрос добавлен. Если подобного плейлиста нет в списке, и он уместен, мы обязательно его добавим и сообщим Вам.<br /><br /><center><input type="button" class="modal_close simplemodal-close" value="Закрыть" onclick="$.modal.close();" id="close_butt"></center>');}}else{$('#login_error').html(j.value.errors);}
$('#ajaxload').hide();$('#pass').attr('name','password');}});return false;}});$('#add_lpaylist_desc').focus();}
jQuery.fn.extend({selectbox:function(options){return this.each(function(){new jQuery.SelectBox(this,options);});}});jQuery.SelectBox=function(selectobj,options){var opt=options||{};opt.inputClass=opt.inputClass||"selectbox";opt.containerClass=opt.containerClass||"selectbox-wrapper";opt.hoverClass=opt.hoverClass||"selected";opt.debug=opt.debug||false;var elm_id=selectobj.id;var active=-1;var inFocus=false;var hasfocus=0;var $select=$(selectobj);var $container=setupContainer(opt);var $input=setupInput(opt);$select.hide().before($input).before($container);init();$input.click(function(){if(!inFocus){$container.toggle();}}).focus(function(){if($container.not(':visible')){inFocus=true;$container.show();cname=$container.attr('id');$('#'+cname+' ul').addClass('scroll-pane');$('#'+cname+' ul').jScrollPane({showArrows:true});}}).keydown(function(event){switch(event.keyCode){case 38:event.preventDefault();moveSelect(-1);break;case 40:event.preventDefault();moveSelect(1);break;case 13:event.preventDefault();setCurrent();hideMe();break;}}).blur(function(){if($container.is(':visible')&&hasfocus>0){if(opt.debug)console.log('container visible and has focus')}else{hideMe();}});function hideMe(){hasfocus=0;$container.hide();}
function init(){$container.append(getSelectOptions()).hide();var width=$input.width()
$container.width(width);}
function setupContainer(options){var container=document.createElement("div");$container=$(container);$container.attr('id',elm_id+'_container');$container.addClass(options.containerClass);return $container;}
function setupInput(options){var input=document.createElement("input");var $input=$(input);$input.attr("id",elm_id+"_input");$input.attr("type","text");$input.addClass(options.inputClass);$input.attr("autocomplete","off");$input.attr("readonly","readonly");$input.attr("tabIndex",$select.attr("tabindex"));return $input;}
function moveSelect(step){var lis=$("li",$container);if(!lis)return;active+=step;if(active<0){active=0;}else if(active>=lis.size()){active=lis.size()-1;}
lis.removeClass(opt.hoverClass);$(lis[active]).addClass(opt.hoverClass);}
function setCurrent(){var li=$("li."+opt.hoverClass,$container).get(0);var el=li.id
$select.val(el);$input.val($(li).html());if(typeof window.LisinerChangeCountry=='function'){LisinerChangeCountry(el);}
return true;}
function getCurrentSelected(){return $select.val();}
function getCurrentValue(){return $input.val();}
function getSelectOptions(){var select_options=new Array();var ul=document.createElement('ul');$select.children('option').each(function(){var li=document.createElement('li');li.setAttribute('id',$(this).val());li.innerHTML=$(this).html();if($(this).is(':selected')){$input.val($(this).html());}
ul.appendChild(li);$(li).mouseover(function(event){hasfocus=1;if(opt.debug)console.log('out on : '+this.id);jQuery(event.target,$container).addClass(opt.hoverClass);}).mouseout(function(event){hasfocus=-1;if(opt.debug)console.log('out on : '+this.id);jQuery(event.target,$container).removeClass(opt.hoverClass);}).click(function(event){if(opt.debug)console.log('click on :'+this.id);$(this).addClass(opt.hoverClass);setCurrent();hideMe();$select.change();});});return ul;}};;jQuery.ui||(function($){var _remove=$.fn.remove,isFF2=$.browser.mozilla&&(parseFloat($.browser.version)<1.9);$.ui={version:"1.7.2",plugin:{add:function(module,option,set){var proto=$.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args){var set=instance.plugins[name];if(!set||!instance.element[0].parentNode){return;}
for(var i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args);}}}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b);},hasScroll:function(el,a){if($(el).css('overflow')=='hidden'){return false;}
var scroll=(a&&a=='left')?'scrollLeft':'scrollTop',has=false;if(el[scroll]>0){return true;}
el[scroll]=1;has=(el[scroll]>0);el[scroll]=0;return has;},isOverAxis:function(x,reference,size){return(x>reference)&&(x<(reference+size));},isOver:function(y,x,top,left,height,width){return $.ui.isOverAxis(y,top,height)&&$.ui.isOverAxis(x,left,width);},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(isFF2){var attr=$.attr,removeAttr=$.fn.removeAttr,ariaNS="http://www.w3.org/2005/07/aaa",ariaState=/^aria-/,ariaRole=/^wairole:/;$.attr=function(elem,name,value){var set=value!==undefined;return(name=='role'?(set?attr.call(this,elem,name,"wairole:"+value):(attr.apply(this,arguments)||"").replace(ariaRole,"")):(ariaState.test(name)?(set?elem.setAttributeNS(ariaNS,name.replace(ariaState,"aaa:"),value):attr.call(this,elem,name.replace(ariaState,"aaa:"))):attr.apply(this,arguments)));};$.fn.removeAttr=function(name){return(ariaState.test(name)?this.each(function(){this.removeAttributeNS(ariaNS,name.replace(ariaState,""));}):removeAttr.call(this,name));};}
$.fn.extend({remove:function(){$("*",this).add(this).each(function(){$(this).triggerHandler("remove");});return _remove.apply(this,arguments);},enableSelection:function(){return this.attr('unselectable','off').css('MozUserSelect','').unbind('selectstart.ui');},disableSelection:function(){return this.attr('unselectable','on').css('MozUserSelect','none').bind('selectstart.ui',function(){return false;});},scrollParent:function(){var scrollParent;if(($.browser.msie&&(/(static|relative)/).test(this.css('position')))||(/absolute/).test(this.css('position'))){scrollParent=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test($.curCSS(this,'position',1))&&(/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));}).eq(0);}else{scrollParent=this.parents().filter(function(){return(/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));}).eq(0);}
return(/fixed/).test(this.css('position'))||!scrollParent.length?$(document):scrollParent;}});$.extend($.expr[':'],{data:function(elem,i,match){return!!$.data(elem,match[3]);},focusable:function(element){var nodeName=element.nodeName.toLowerCase(),tabIndex=$.attr(element,'tabindex');return(/input|select|textarea|button|object/.test(nodeName)?!element.disabled:'a'==nodeName||'area'==nodeName?element.href||!isNaN(tabIndex):!isNaN(tabIndex))&&!$(element)['area'==nodeName?'parents':'closest'](':hidden').length;},tabbable:function(element){var tabIndex=$.attr(element,'tabindex');return(isNaN(tabIndex)||tabIndex>=0)&&$(element).is(':focusable');}});function getter(namespace,plugin,method,args){function getMethods(type){var methods=$[namespace][plugin][type]||[];return(typeof methods=='string'?methods.split(/,?\s+/):methods);}
var methods=getMethods('getter');if(args.length==1&&typeof args[0]=='string'){methods=methods.concat(getMethods('getterSetter'));}
return($.inArray(method,methods)!=-1);}
$.widget=function(name,prototype){var namespace=name.split(".")[0];name=name.split(".")[1];$.fn[name]=function(options){var isMethodCall=(typeof options=='string'),args=Array.prototype.slice.call(arguments,1);if(isMethodCall&&options.substring(0,1)=='_'){return this;}
if(isMethodCall&&getter(namespace,name,options,args)){var instance=$.data(this[0],name);return(instance?instance[options].apply(instance,args):undefined);}
return this.each(function(){var instance=$.data(this,name);(!instance&&!isMethodCall&&$.data(this,name,new $[namespace][name](this,options))._init());(instance&&isMethodCall&&$.isFunction(instance[options])&&instance[options].apply(instance,args));});};$[namespace]=$[namespace]||{};$[namespace][name]=function(element,options){var self=this;this.namespace=namespace;this.widgetName=name;this.widgetEventPrefix=$[namespace][name].eventPrefix||name;this.widgetBaseClass=namespace+'-'+name;this.options=$.extend({},$.widget.defaults,$[namespace][name].defaults,$.metadata&&$.metadata.get(element)[name],options);this.element=$(element).bind('setData.'+name,function(event,key,value){if(event.target==element){return self._setData(key,value);}}).bind('getData.'+name,function(event,key){if(event.target==element){return self._getData(key);}}).bind('remove',function(){return self.destroy();});};$[namespace][name].prototype=$.extend({},$.widget.prototype,prototype);$[namespace][name].getterSetter='option';};$.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+'-disabled'+' '+this.namespace+'-state-disabled').removeAttr('aria-disabled');},option:function(key,value){var options=key,self=this;if(typeof key=="string"){if(value===undefined){return this._getData(key);}
options={};options[key]=value;}
$.each(options,function(key,value){self._setData(key,value);});},_getData:function(key){return this.options[key];},_setData:function(key,value){this.options[key]=value;if(key=='disabled'){this.element
[value?'addClass':'removeClass'](this.widgetBaseClass+'-disabled'+' '+
this.namespace+'-state-disabled').attr("aria-disabled",value);}},enable:function(){this._setData('disabled',false);},disable:function(){this._setData('disabled',true);},_trigger:function(type,event,data){var callback=this.options[type],eventName=(type==this.widgetEventPrefix?type:this.widgetEventPrefix+type);event=$.Event(event);event.type=eventName;if(event.originalEvent){for(var i=$.event.props.length,prop;i;){prop=$.event.props[--i];event[prop]=event.originalEvent[prop];}}
this.element.trigger(event,data);return!($.isFunction(callback)&&callback.call(this.element[0],event,data)===false||event.isDefaultPrevented());}};$.widget.defaults={disabled:false};$.ui.mouse={_mouseInit:function(){var self=this;this.element.bind('mousedown.'+this.widgetName,function(event){return self._mouseDown(event);}).bind('click.'+this.widgetName,function(event){if(self._preventClickEvent){self._preventClickEvent=false;event.stopImmediatePropagation();return false;}});if($.browser.msie){this._mouseUnselectable=this.element.attr('unselectable');this.element.attr('unselectable','on');}
this.started=false;},_mouseDestroy:function(){this.element.unbind('.'+this.widgetName);($.browser.msie&&this.element.attr('unselectable',this._mouseUnselectable));},_mouseDown:function(event){event.originalEvent=event.originalEvent||{};if(event.originalEvent.mouseHandled){return;}
(this._mouseStarted&&this._mouseUp(event));this._mouseDownEvent=event;var self=this,btnIsLeft=(event.which==1),elIsCancel=(typeof this.options.cancel=="string"?$(event.target).parents().add(event.target).filter(this.options.cancel).length:false);if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){return true;}
this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){self.mouseDelayMet=true;},this.options.delay);}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(event)!==false);if(!this._mouseStarted){event.preventDefault();return true;}}
this._mouseMoveDelegate=function(event){return self._mouseMove(event);};this._mouseUpDelegate=function(event){return self._mouseUp(event);};$(document).bind('mousemove.'+this.widgetName,this._mouseMoveDelegate).bind('mouseup.'+this.widgetName,this._mouseUpDelegate);($.browser.safari||event.preventDefault());event.originalEvent.mouseHandled=true;return true;},_mouseMove:function(event){if($.browser.msie&&!event.button){return this._mouseUp(event);}
if(this._mouseStarted){this._mouseDrag(event);return event.preventDefault();}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,event)!==false);(this._mouseStarted?this._mouseDrag(event):this._mouseUp(event));}
return!this._mouseStarted;},_mouseUp:function(event){$(document).unbind('mousemove.'+this.widgetName,this._mouseMoveDelegate).unbind('mouseup.'+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(event.target==this._mouseDownEvent.target);this._mouseStop(event);}
return false;},_mouseDistanceMet:function(event){return(Math.max(Math.abs(this._mouseDownEvent.pageX-event.pageX),Math.abs(this._mouseDownEvent.pageY-event.pageY))>=this.options.distance);},_mouseDelayMet:function(event){return this.mouseDelayMet;},_mouseStart:function(event){},_mouseDrag:function(event){},_mouseStop:function(event){},_mouseCapture:function(event){return true;}};$.ui.mouse.defaults={cancel:null,distance:1,delay:0};})(jQuery);(function($){$.widget("ui.sortable",$.extend({},$.ui.mouse,{_init:function(){var o=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css('float')):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 i=this.items.length-1;i>=0;i--)
this.items[i].item.removeData("sortable-item");},_mouseCapture:function(event,overrideHandle){if(this.reverting){return false;}
if(this.options.disabled||this.options.type=='static')return false;this._refreshItems(event);var currentItem=null,self=this,nodes=$(event.target).parents().each(function(){if($.data(this,'sortable-item')==self){currentItem=$(this);return false;}});if($.data(event.target,'sortable-item')==self)currentItem=$(event.target);if(!currentItem)return false;if(this.options.handle&&!overrideHandle){var validHandle=false;$(this.options.handle,currentItem).find("*").andSelf().each(function(){if(this==event.target)validHandle=true;});if(!validHandle)return false;}
this.currentItem=currentItem;this._removeCurrentsFromItems();return true;},_mouseStart:function(event,overrideHandle,noActivation){var o=this.options,self=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(event);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");$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(event);this.originalPageX=event.pageX;this.originalPageY=event.pageY;if(o.cursorAt)
this._adjustOffsetFromHelper(o.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide();}
this._createPlaceholder();if(o.containment)
this._setContainment();if(o.cursor){if($('body').css("cursor"))this._storedCursor=$('body').css("cursor");$('body').css("cursor",o.cursor);}
if(o.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",o.opacity);}
if(o.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",o.zIndex);}
if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!='HTML')
this.overflowOffset=this.scrollParent.offset();this._trigger("start",event,this._uiHash());if(!this._preserveHelperProportions)
this._cacheHelperProportions();if(!noActivation){for(var i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger("activate",event,self._uiHash(this));}}
if($.ui.ddmanager)
$.ui.ddmanager.current=this;if($.ui.ddmanager&&!o.dropBehaviour)
$.ui.ddmanager.prepareOffsets(this,event);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(event);return true;},_mouseDrag:function(event){this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs;}
if(this.options.scroll){var o=this.options,scrolled=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!='HTML'){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-event.pageY<o.scrollSensitivity)
this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop+o.scrollSpeed;else if(event.pageY-this.overflowOffset.top<o.scrollSensitivity)
this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop-o.scrollSpeed;if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-event.pageX<o.scrollSensitivity)
this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft+o.scrollSpeed;else if(event.pageX-this.overflowOffset.left<o.scrollSensitivity)
this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft-o.scrollSpeed;}else{if(event.pageY-$(document).scrollTop()<o.scrollSensitivity)
scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);else if($(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity)
scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed);if(event.pageX-$(document).scrollLeft()<o.scrollSensitivity)
scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);else if($(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity)
scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed);}
if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour)
$.ui.ddmanager.prepareOffsets(this,event);}
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(var i=this.items.length-1;i>=0;i--){var item=this.items[i],itemElement=item.item[0],intersection=this._intersectsWithPointer(item);if(!intersection)continue;if(itemElement!=this.currentItem[0]&&this.placeholder[intersection==1?"next":"prev"]()[0]!=itemElement&&!$.ui.contains(this.placeholder[0],itemElement)&&(this.options.type=='semi-dynamic'?!$.ui.contains(this.element[0],itemElement):true)){this.direction=intersection==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(item)){this._rearrange(event,item);}else{break;}
this._trigger("change",event,this._uiHash());break;}}
this._contactContainers(event);if($.ui.ddmanager)$.ui.ddmanager.drag(this,event);this._trigger('sort',event,this._uiHash());this.lastPositionAbs=this.positionAbs;return false;},_mouseStop:function(event,noPropagation){if(!event)return;if($.ui.ddmanager&&!this.options.dropBehaviour)
$.ui.ddmanager.drop(this,event);if(this.options.revert){var self=this;var cur=self.placeholder.offset();self.reverting=true;$(this.helper).animate({left:cur.left-this.offset.parent.left-self.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:cur.top-this.offset.parent.top-self.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){self._clear(event);});}else{this._clear(event,noPropagation);}
return false;},cancel:function(){var self=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original")
this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");else
this.currentItem.show();for(var i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger("deactivate",null,self._uiHash(this));if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",null,self._uiHash(this));this.containers[i].containerCache.over=0;}}}
if(this.placeholder[0].parentNode)this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode)this.helper.remove();$.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){$(this.domPosition.prev).after(this.currentItem);}else{$(this.domPosition.parent).prepend(this.currentItem);}
return true;},serialize:function(o){var items=this._getItemsAsjQuery(o&&o.connected);var str=[];o=o||{};$(items).each(function(){var res=($(o.item||this).attr(o.attribute||'id')||'').match(o.expression||(/(.+)[-=_](.+)/));if(res)str.push((o.key||res[1]+'[]')+'='+(o.key&&o.expression?res[1]:res[2]));});return str.join('&');},toArray:function(o){var items=this._getItemsAsjQuery(o&&o.connected);var ret=[];o=o||{};items.each(function(){ret.push($(o.item||this).attr(o.attribute||'id')||'');});return ret;},_intersectsWith:function(item){var x1=this.positionAbs.left,x2=x1+this.helperProportions.width,y1=this.positionAbs.top,y2=y1+this.helperProportions.height;var l=item.left,r=l+item.width,t=item.top,b=t+item.height;var dyClick=this.offset.click.top,dxClick=this.offset.click.left;var isOverElement=(y1+dyClick)>t&&(y1+dyClick)<b&&(x1+dxClick)>l&&(x1+dxClick)<r;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!="pointer"&&this.helperProportions[this.floating?'width':'height']>item[this.floating?'width':'height'])){return isOverElement;}else{return(l<x1+(this.helperProportions.width/2)&&x2-(this.helperProportions.width/2)<r&&t<y1+(this.helperProportions.height/2)&&y2-(this.helperProportions.height/2)<b);}},_intersectsWithPointer:function(item){var isOverElementHeight=$.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,item.top,item.height),isOverElementWidth=$.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,item.left,item.width),isOverElement=isOverElementHeight&&isOverElementWidth,verticalDirection=this._getDragVerticalDirection(),horizontalDirection=this._getDragHorizontalDirection();if(!isOverElement)
return false;return this.floating?(((horizontalDirection&&horizontalDirection=="right")||verticalDirection=="down")?2:1):(verticalDirection&&(verticalDirection=="down"?2:1));},_intersectsWithSides:function(item){var isOverBottomHalf=$.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,item.top+(item.height/2),item.height),isOverRightHalf=$.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,item.left+(item.width/2),item.width),verticalDirection=this._getDragVerticalDirection(),horizontalDirection=this._getDragHorizontalDirection();if(this.floating&&horizontalDirection){return((horizontalDirection=="right"&&isOverRightHalf)||(horizontalDirection=="left"&&!isOverRightHalf));}else{return verticalDirection&&((verticalDirection=="down"&&isOverBottomHalf)||(verticalDirection=="up"&&!isOverBottomHalf));}},_getDragVerticalDirection:function(){var delta=this.positionAbs.top-this.lastPositionAbs.top;return delta!=0&&(delta>0?"down":"up");},_getDragHorizontalDirection:function(){var delta=this.positionAbs.left-this.lastPositionAbs.left;return delta!=0&&(delta>0?"right":"left");},refresh:function(event){this._refreshItems(event);this.refreshPositions();},_connectWith:function(){var options=this.options;return options.connectWith.constructor==String?[options.connectWith]:options.connectWith;},_getItemsAsjQuery:function(connected){var self=this;var items=[];var queries=[];var connectWith=this._connectWith();if(connectWith&&connected){for(var i=connectWith.length-1;i>=0;i--){var cur=$(connectWith[i]);for(var j=cur.length-1;j>=0;j--){var inst=$.data(cur[j],'sortable');if(inst&&inst!=this&&!inst.options.disabled){queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element):$(inst.options.items,inst.element).not(".ui-sortable-helper"),inst]);}};};}
queries.push([$.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):$(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var i=queries.length-1;i>=0;i--){queries[i][0].each(function(){items.push(this);});};return $(items);},_removeCurrentsFromItems:function(){var list=this.currentItem.find(":data(sortable-item)");for(var i=0;i<this.items.length;i++){for(var j=0;j<list.length;j++){if(list[j]==this.items[i].item[0])
this.items.splice(i,1);};};},_refreshItems:function(event){this.items=[];this.containers=[this];var items=this.items;var self=this;var queries=[[$.isFunction(this.options.items)?this.options.items.call(this.element[0],event,{item:this.currentItem}):$(this.options.items,this.element),this]];var connectWith=this._connectWith();if(connectWith){for(var i=connectWith.length-1;i>=0;i--){var cur=$(connectWith[i]);for(var j=cur.length-1;j>=0;j--){var inst=$.data(cur[j],'sortable');if(inst&&inst!=this&&!inst.options.disabled){queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element[0],event,{item:this.currentItem}):$(inst.options.items,inst.element),inst]);this.containers.push(inst);}};};}
for(var i=queries.length-1;i>=0;i--){var targetData=queries[i][1];var _queries=queries[i][0];for(var j=0,queriesLength=_queries.length;j<queriesLength;j++){var item=$(_queries[j]);item.data('sortable-item',targetData);items.push({item:item,instance:targetData,width:0,height:0,left:0,top:0});};};},refreshPositions:function(fast){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset();}
for(var i=this.items.length-1;i>=0;i--){var item=this.items[i];if(item.instance!=this.currentContainer&&this.currentContainer&&item.item[0]!=this.currentItem[0])
continue;var t=this.options.toleranceElement?$(this.options.toleranceElement,item.item):item.item;if(!fast){item.width=t.outerWidth();item.height=t.outerHeight();}
var p=t.offset();item.left=p.left;item.top=p.top;};if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this);}else{for(var i=this.containers.length-1;i>=0;i--){var p=this.containers[i].element.offset();this.containers[i].containerCache.left=p.left;this.containers[i].containerCache.top=p.top;this.containers[i].containerCache.width=this.containers[i].element.outerWidth();this.containers[i].containerCache.height=this.containers[i].element.outerHeight();};}},_createPlaceholder:function(that){var self=that||this,o=self.options;if(!o.placeholder||o.placeholder.constructor==String){var className=o.placeholder;o.placeholder={element:function(){var el=$(document.createElement(self.currentItem[0].nodeName)).addClass(className||self.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!className)
el.style.visibility="hidden";return el;},update:function(container,p){if(className&&!o.forcePlaceholderSize)return;if(!p.height()){p.height(self.currentItem.innerHeight()-parseInt(self.currentItem.css('paddingTop')||0,10)-parseInt(self.currentItem.css('paddingBottom')||0,10));};if(!p.width()){p.width(self.currentItem.innerWidth()-parseInt(self.currentItem.css('paddingLeft')||0,10)-parseInt(self.currentItem.css('paddingRight')||0,10));};}};}
self.placeholder=$(o.placeholder.element.call(self.element,self.currentItem));self.currentItem.after(self.placeholder);o.placeholder.update(self,self.placeholder);},_contactContainers:function(event){for(var i=this.containers.length-1;i>=0;i--){if(this._intersectsWith(this.containers[i].containerCache)){if(!this.containers[i].containerCache.over){if(this.currentContainer!=this.containers[i]){var dist=10000;var itemWithLeastDistance=null;var base=this.positionAbs[this.containers[i].floating?'left':'top'];for(var j=this.items.length-1;j>=0;j--){if(!$.ui.contains(this.containers[i].element[0],this.items[j].item[0]))continue;var cur=this.items[j][this.containers[i].floating?'left':'top'];if(Math.abs(cur-base)<dist){dist=Math.abs(cur-base);itemWithLeastDistance=this.items[j];}}
if(!itemWithLeastDistance&&!this.options.dropOnEmpty)
continue;this.currentContainer=this.containers[i];itemWithLeastDistance?this._rearrange(event,itemWithLeastDistance,null,true):this._rearrange(event,null,this.containers[i].element,true);this._trigger("change",event,this._uiHash());this.containers[i]._trigger("change",event,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);}
this.containers[i]._trigger("over",event,this._uiHash(this));this.containers[i].containerCache.over=1;}}else{if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",event,this._uiHash(this));this.containers[i].containerCache.over=0;}}};},_createHelper:function(event){var o=this.options;var helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[event,this.currentItem])):(o.helper=='clone'?this.currentItem.clone():this.currentItem);if(!helper.parents('body').length)
$(o.appendTo!='parent'?o.appendTo:this.currentItem[0].parentNode)[0].appendChild(helper[0]);if(helper[0]==this.currentItem[0])
this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};if(helper[0].style.width==''||o.forceHelperSize)helper.width(this.currentItem.width());if(helper[0].style.height==''||o.forceHelperSize)helper.height(this.currentItem.height());return helper;},_adjustOffsetFromHelper:function(obj){if(obj.left!=undefined)this.offset.click.left=obj.left+this.margins.left;if(obj.right!=undefined)this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left;if(obj.top!=undefined)this.offset.click.top=obj.top+this.margins.top;if(obj.bottom!=undefined)this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top;},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();if(this.cssPosition=='absolute'&&this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop();}
if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=='html'&&$.browser.msie))
po={top:0,left:0};return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var p=this.currentItem.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()};}else{return{top:0,left:0};}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)};},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};},_setContainment:function(){var o=this.options;if(o.containment=='parent')o.containment=this.helper[0].parentNode;if(o.containment=='document'||o.containment=='window')this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,$(o.containment=='document'?document:window).width()-this.helperProportions.width-this.margins.left,($(o.containment=='document'?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!(/^(document|window|parent)$/).test(o.containment)){var ce=$(o.containment)[0];var co=$(o.containment).offset();var over=($(ce).css("overflow")!='hidden');this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)+(parseInt($(ce).css("paddingLeft"),10)||0)-this.margins.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)+(parseInt($(ce).css("paddingTop"),10)||0)-this.margins.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-(parseInt($(ce).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-(parseInt($(ce).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top];}},_convertPositionTo:function(d,pos){if(!pos)pos=this.position;var mod=d=="absolute"?1:-1;var o=this.options,scroll=this.cssPosition=='absolute'&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);return{top:(pos.top
+this.offset.relative.top*mod
+this.offset.parent.top*mod
-($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop()))*mod)),left:(pos.left
+this.offset.relative.left*mod
+this.offset.parent.left*mod
-($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())*mod))};},_generatePosition:function(event){var o=this.options,scroll=this.cssPosition=='absolute'&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);if(this.cssPosition=='relative'&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset();}
var pageX=event.pageX;var pageY=event.pageY;if(this.originalPosition){if(this.containment){if(event.pageX-this.offset.click.left<this.containment[0])pageX=this.containment[0]+this.offset.click.left;if(event.pageY-this.offset.click.top<this.containment[1])pageY=this.containment[1]+this.offset.click.top;if(event.pageX-this.offset.click.left>this.containment[2])pageX=this.containment[2]+this.offset.click.left;if(event.pageY-this.offset.click.top>this.containment[3])pageY=this.containment[3]+this.offset.click.top;}
if(o.grid){var top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1];pageY=this.containment?(!(top-this.offset.click.top<this.containment[1]||top-this.offset.click.top>this.containment[3])?top:(!(top-this.offset.click.top<this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;var left=this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0];pageX=this.containment?(!(left-this.offset.click.left<this.containment[0]||left-this.offset.click.left>this.containment[2])?left:(!(left-this.offset.click.left<this.containment[0])?left-o.grid[0]:left+o.grid[0])):left;}}
return{top:(pageY
-this.offset.click.top
-this.offset.relative.top
-this.offset.parent.top
+($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop())))),left:(pageX
-this.offset.click.left
-this.offset.relative.left
-this.offset.parent.left
+($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())))};},_rearrange:function(event,i,a,hardRefresh){a?a[0].appendChild(this.placeholder[0]):i.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=='down'?i.item[0]:i.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var self=this,counter=this.counter;window.setTimeout(function(){if(counter==self.counter)self.refreshPositions(!hardRefresh);},0);},_clear:function(event,noPropagation){this.reverting=false;var delayedTriggers=[],self=this;if(!this._noFinalSort&&this.currentItem[0].parentNode)this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var i in this._storedCSS){if(this._storedCSS[i]=='auto'||this._storedCSS[i]=='static')this._storedCSS[i]='';}
this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");}else{this.currentItem.show();}
if(this.fromOutside&&!noPropagation)delayedTriggers.push(function(event){this._trigger("receive",event,this._uiHash(this.fromOutside));});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!noPropagation)delayedTriggers.push(function(event){this._trigger("update",event,this._uiHash());});if(!$.ui.contains(this.element[0],this.currentItem[0])){if(!noPropagation)delayedTriggers.push(function(event){this._trigger("remove",event,this._uiHash());});for(var i=this.containers.length-1;i>=0;i--){if($.ui.contains(this.containers[i].element[0],this.currentItem[0])&&!noPropagation){delayedTriggers.push((function(c){return function(event){c._trigger("receive",event,this._uiHash(this));};}).call(this,this.containers[i]));delayedTriggers.push((function(c){return function(event){c._trigger("update",event,this._uiHash(this));};}).call(this,this.containers[i]));}};};for(var i=this.containers.length-1;i>=0;i--){if(!noPropagation)delayedTriggers.push((function(c){return function(event){c._trigger("deactivate",event,this._uiHash(this));};}).call(this,this.containers[i]));if(this.containers[i].containerCache.over){delayedTriggers.push((function(c){return function(event){c._trigger("out",event,this._uiHash(this));};}).call(this,this.containers[i]));this.containers[i].containerCache.over=0;}}
if(this._storedCursor)$('body').css("cursor",this._storedCursor);if(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(!noPropagation){this._trigger("beforeStop",event,this._uiHash());for(var i=0;i<delayedTriggers.length;i++){delayedTriggers[i].call(this,event);};this._trigger("stop",event,this._uiHash());}
return false;}
if(!noPropagation)this._trigger("beforeStop",event,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0])this.helper.remove();this.helper=null;if(!noPropagation){for(var i=0;i<delayedTriggers.length;i++){delayedTriggers[i].call(this,event);};this._trigger("stop",event,this._uiHash());}
this.fromOutside=false;return true;},_trigger:function(){if($.widget.prototype._trigger.apply(this,arguments)===false){this.cancel();}},_uiHash:function(inst){var self=inst||this;return{helper:self.helper,placeholder:self.placeholder||$([]),position:self.position,absolutePosition:self.positionAbs,offset:self.positionAbs,item:self.currentItem,sender:inst?inst.element:null};}}));$.extend($.ui.sortable,{getter:"serialize toArray",version:"1.7.2",eventPrefix:"sort",defaults:{appendTo:"parent",axis:false,cancel:":input,option",connectWith:false,containment:false,cursor:'auto',cursorAt:false,delay:0,distance:1,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:'> *',opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}});})(jQuery);Date.dayNames=['Воскресенье','Понедельник','Вторник','Среда','Четверг','Пятница','Суббота'];Date.abbrDayNames=['Вс','Пн','Вт','Ср','Чт','Пт','Сб'];Date.monthNames=['Январь','Февраль','Март','Апрель','Май','Июнь','Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'];Date.abbrMonthNames=['Янв','Фев','Мар','Апр','Май','Июн','Июл','Авг','Сен','Окт','Ноя','Дек'];Date.firstDayOfWeek=1;Date.format='dd.mm.yyyy';Date.fullYearStart='20';(function(){function add(name,method){if(!Date.prototype[name]){Date.prototype[name]=method;}};add("isLeapYear",function(){var y=this.getFullYear();return(y%4==0&&y%100!=0)||y%400==0;});add("isWeekend",function(){return this.getDay()==0||this.getDay()==6;});add("isWeekDay",function(){return!this.isWeekend();});add("getDaysInMonth",function(){return[31,(this.isLeapYear()?29:28),31,30,31,30,31,31,30,31,30,31][this.getMonth()];});add("getDayName",function(abbreviated){return abbreviated?Date.abbrDayNames[this.getDay()]:Date.dayNames[this.getDay()];});add("getMonthName",function(abbreviated){return abbreviated?Date.abbrMonthNames[this.getMonth()]:Date.monthNames[this.getMonth()];});add("getDayOfYear",function(){var tmpdtm=new Date("1/1/"+this.getFullYear());return Math.floor((this.getTime()-tmpdtm.getTime())/86400000);});add("getWeekOfYear",function(){return Math.ceil(this.getDayOfYear()/7);});add("setDayOfYear",function(day){this.setMonth(0);this.setDate(day);return this;});add("addYears",function(num){this.setFullYear(this.getFullYear()+num);return this;});add("addMonths",function(num){var tmpdtm=this.getDate();this.setMonth(this.getMonth()+num);if(tmpdtm>this.getDate())
this.addDays(-this.getDate());return this;});add("addDays",function(num){this.setTime(this.getTime()+(num*86400000));return this;});add("addHours",function(num){this.setHours(this.getHours()+num);return this;});add("addMinutes",function(num){this.setMinutes(this.getMinutes()+num);return this;});add("addSeconds",function(num){this.setSeconds(this.getSeconds()+num);return this;});add("zeroTime",function(){this.setMilliseconds(0);this.setSeconds(0);this.setMinutes(0);this.setHours(0);return this;});add("asString",function(format){var r=format||Date.format;if(r.split('mm').length>1){r=r.split('mmmm').join(this.getMonthName(false)).split('mmm').join(this.getMonthName(true)).split('mm').join(_zeroPad(this.getMonth()+1))}else{r=r.split('m').join(this.getMonth()+1);}
r=r.split('yyyy').join(this.getFullYear()).split('yy').join((this.getFullYear()+'').substring(2)).split('dd').join(_zeroPad(this.getDate())).split('d').join(this.getDate());return r;});Date.fromString=function(s)
{var f=Date.format;var d=new Date('01/01/1970');if(s=='')return d;s=s.toLowerCase();var matcher='';var order=[];var r=/(dd?d?|mm?m?|yy?yy?)+([^(m|d|y)])?/g;var results;while((results=r.exec(f))!=null)
{switch(results[1]){case'd':case'dd':case'm':case'mm':case'yy':case'yyyy':matcher+='(\\d+\\d?\\d?\\d?)+';order.push(results[1].substr(0,1));break;case'mmm':matcher+='([a-z]{3})';order.push('M');break;}
if(results[2]){matcher+=results[2];}}
var dm=new RegExp(matcher);var result=s.match(dm);for(var i=0;i<order.length;i++){var res=result[i+1];switch(order[i]){case'd':d.setDate(res);break;case'm':d.setMonth(Number(res)-1);break;case'M':for(var j=0;j<Date.abbrMonthNames.length;j++){if(Date.abbrMonthNames[j].toLowerCase()==res)break;}
d.setMonth(j);break;case'y':d.setYear(res);break;}}
return d;};var _zeroPad=function(num){var s='0'+num;return s.substring(s.length-2)};})();(function($){$.fn.extend({renderCalendar:function(s){var dc=function(a){return document.createElement(a);};s=$.extend({},$.fn.datePicker.defaults,s);if(s.showHeader!=$.dpConst.SHOW_HEADER_NONE){var headRow=$(dc('tr'));for(var i=Date.firstDayOfWeek;i<Date.firstDayOfWeek+7;i++){var weekday=i%7;var day=Date.dayNames[weekday];headRow.append(jQuery(dc('th')).attr({'scope':'col','abbr':day,'title':day,'class':(weekday==0||weekday==6?'weekend':'weekday')}).html(s.showHeader==$.dpConst.SHOW_HEADER_SHORT?day.substr(0,1):day));}};var calendarTable=$(dc('table')).attr({'cellspacing':2}).addClass('jCalendar').append((s.showHeader!=$.dpConst.SHOW_HEADER_NONE?$(dc('thead')).append(headRow):dc('thead')));var tbody=$(dc('tbody'));var today=(new Date()).zeroTime();var month=s.month==undefined?today.getMonth():s.month;var year=s.year||today.getFullYear();var currentDate=new Date(year,month,1);var firstDayOffset=Date.firstDayOfWeek-currentDate.getDay()+1;if(firstDayOffset>1)firstDayOffset-=7;var weeksToDraw=Math.ceil(((-1*firstDayOffset+1)+currentDate.getDaysInMonth())/7);currentDate.addDays(firstDayOffset-1);var doHover=function(firstDayInBounds){return function(){if(s.hoverClass){var $this=$(this);if(!s.selectWeek){$this.addClass(s.hoverClass);}else if(firstDayInBounds&&!$this.is('.disabled')){$this.parent().addClass('activeWeekHover');}}}};var unHover=function(){if(s.hoverClass){var $this=$(this);$this.removeClass(s.hoverClass);$this.parent().removeClass('activeWeekHover');}};var w=0;while(w++<weeksToDraw){var r=jQuery(dc('tr'));var firstDayInBounds=s.dpController?currentDate>s.dpController.startDate:false;for(var i=0;i<7;i++){var thisMonth=currentDate.getMonth()==month;var d=$(dc('td')).text(currentDate.getDate()+'').addClass((thisMonth?'current-month ':'other-month ')+(currentDate.isWeekend()?'weekend ':'weekday ')+(thisMonth&&currentDate.getTime()==today.getTime()?'today ':'')).data('datePickerDate',currentDate.asString()).hover(doHover(firstDayInBounds),unHover);r.append(d);if(s.renderCallback){s.renderCallback(d,currentDate,month,year);}currentDate=new Date(currentDate.getFullYear(),currentDate.getMonth(),currentDate.getDate()+1);}tbody.append(r);}calendarTable.append(tbody);return this.each(function(){$(this).empty().append(calendarTable);});},datePicker:function(s){if(!$.event._dpCache)$.event._dpCache=[];s=$.extend({},$.fn.datePicker.defaults,s);return this.each(function(){var $this=$(this);var alreadyExists=true;if(!this._dpId){this._dpId=$.event.guid++;$.event._dpCache[this._dpId]=new DatePicker(this);alreadyExists=false;}if(s.inline){s.createButton=false;s.displayClose=false;s.closeOnSelect=false;$this.empty();}var controller=$.event._dpCache[this._dpId];controller.init(s);if(!alreadyExists&&s.createButton){controller.button=$('<a href="#" class="dp-choose-date" id="'+$(this).attr('id')+'_a" title="'+$.dpText.TEXT_CHOOSE_DATE+'"></a>').bind('click',function(){$this.dpDisplay(this);this.blur();return false;});$this.after(controller.button);}if(!alreadyExists&&$this.is(':text')){$this.bind('dateSelected',function(e,selectedDate,$td){this.value=selectedDate.asString();}).bind('change',function(){if(this.value==''){controller.clearSelected();}else{var d=Date.fromString(this.value);if(d){controller.setSelected(d,true,true);}}});if(s.clickInput){$this.bind('click',function(){$this.trigger('change');$this.dpDisplay();});}var d=Date.fromString(this.value);if(this.value!=''&&d){controller.setSelected(d,true,true);}}$this.addClass('dp-applied');})},dpSetDisabled:function(s){return _w.call(this,'setDisabled',s);},dpSetStartDate:function(d){return _w.call(this,'setStartDate',d);},dpSetEndDate:function(d){return _w.call(this,'setEndDate',d);},dpGetSelected:function(){var c=_getController(this[0]);if(c){return c.getSelected();}return null;},dpSetSelected:function(d,v,m,e){if(v==undefined)v=true;if(m==undefined)m=true;if(e==undefined)e=true;return _w.call(this,'setSelected',Date.fromString(d),v,m,e);},dpSetDisplayedMonth:function(m,y){return _w.call(this,'setDisplayedMonth',Number(m),Number(y),true);},dpDisplay:function(e){return _w.call(this,'display',e);},dpSetRenderCallback:function(a){return _w.call(this,'setRenderCallback',a);},dpSetPosition:function(v,h){return _w.call(this,'setPosition',v,h);},dpSetOffset:function(v,h){return _w.call(this,'setOffset',v,h);},dpClose:function(){return _w.call(this,'_closeCalendar',false,this[0]);},_dpDestroy:function(){}});var _w=function(f,a1,a2,a3,a4){return this.each(function(){var c=_getController(this);if(c){c[f](a1,a2,a3,a4);}});};function DatePicker(ele){this.ele=ele;this.displayedMonth=null;this.displayedYear=null;this.startDate=null;this.endDate=null;this.showYearNavigation=null;this.closeOnSelect=null;this.displayClose=null;this.rememberViewedMonth=null;this.selectMultiple=null;this.numSelectable=null;this.numSelected=null;this.verticalPosition=null;this.horizontalPosition=null;this.verticalOffset=null;this.horizontalOffset=null;this.button=null;this.renderCallback=[];this.selectedDates={};this.inline=null;this.context='#dp-popup';this.settings={};};$.extend(DatePicker.prototype,{init:function(s){this.setStartDate(s.startDate);this.setEndDate(s.endDate);this.setDisplayedMonth(Number(s.month),Number(s.year));this.setRenderCallback(s.renderCallback);this.showYearNavigation=s.showYearNavigation;this.closeOnSelect=s.closeOnSelect;this.displayClose=s.displayClose;this.rememberViewedMonth=s.rememberViewedMonth;this.selectMultiple=s.selectMultiple;this.numSelectable=s.selectMultiple?s.numSelectable:1;this.numSelected=0;this.verticalPosition=s.verticalPosition;this.horizontalPosition=s.horizontalPosition;this.hoverClass=s.hoverClass;this.setOffset(s.verticalOffset,s.horizontalOffset);this.inline=s.inline;this.settings=s;if(this.inline){this.context=this.ele;this.display();}},setStartDate:function(d){if(d){this.startDate=Date.fromString(d);}if(!this.startDate){this.startDate=(new Date()).zeroTime();}this.setDisplayedMonth(this.displayedMonth,this.displayedYear);},setEndDate:function(d){if(d){this.endDate=Date.fromString(d);}if(!this.endDate){this.endDate=(new Date('12/31/2999'));}if(this.endDate.getTime()<this.startDate.getTime()){this.endDate=this.startDate;}this.setDisplayedMonth(this.displayedMonth,this.displayedYear);},setPosition:function(v,h){this.verticalPosition=v;this.horizontalPosition=h;},setOffset:function(v,h){this.verticalOffset=parseInt(v)||0;this.horizontalOffset=parseInt(h)||0;},setDisabled:function(s){$e=$(this.ele);$e[s?'addClass':'removeClass']('dp-disabled');if(this.button){$but=$(this.button);$but[s?'addClass':'removeClass']('dp-disabled');$but.attr('title',s?'':$.dpText.TEXT_CHOOSE_DATE);}if($e.is(':text')){$e.attr('disabled',s?'disabled':'');}},setDisplayedMonth:function(m,y,rerender){if(this.startDate==undefined||this.endDate==undefined){return;}var s=new Date(this.startDate.getTime());s.setDate(1);var e=new Date(this.endDate.getTime());e.setDate(1);var t;if((!m&&!y)||(isNaN(m)&&isNaN(y))){t=new Date().zeroTime();t.setDate(1);}else if(isNaN(m)){t=new Date(y,this.displayedMonth,1);}else if(isNaN(y)){t=new Date(this.displayedYear,m,1);}else{t=new Date(y,m,1)}if(t.getTime()<s.getTime()){t=s;}else if(t.getTime()>e.getTime()){t=e;}var oldMonth=this.displayedMonth;var oldYear=this.displayedYear;this.displayedMonth=t.getMonth();this.displayedYear=t.getFullYear();if(rerender&&(this.displayedMonth!=oldMonth||this.displayedYear!=oldYear)){this._rerenderCalendar();$(this.ele).trigger('dpMonthChanged',[this.displayedMonth,this.displayedYear]);}},setSelected:function(d,v,moveToMonth,dispatchEvents){if(d<this.startDate||d>this.endDate){return;}var s=this.settings;if(s.selectWeek){d=d.addDays(-(d.getDay()-Date.firstDayOfWeek+7)%7);if(d<this.startDate){return;}}if(v==this.isSelected(d)){return;}if(this.selectMultiple==false){this.clearSelected();}else if(v&&this.numSelected==this.numSelectable){return;}if(moveToMonth&&(this.displayedMonth!=d.getMonth()||this.displayedYear!=d.getFullYear())){this.setDisplayedMonth(d.getMonth(),d.getFullYear(),true);}this.selectedDates[d.toString()]=v;this.numSelected+=v?1:-1;var selectorString='td.'+(d.getMonth()==this.displayedMonth?'current-month':'other-month');var $td;$(selectorString,this.context).each(function(){if($(this).data('datePickerDate')==d.asString()){$td=$(this);if(s.selectWeek){$td.parent()[v?'addClass':'removeClass']('selectedWeek');}$td[v?'addClass':'removeClass']('selected');}});$('td',this.context).not('.selected')[this.selectMultiple&&this.numSelected==this.numSelectable?'addClass':'removeClass']('unselectable');if(dispatchEvents){var s=this.isSelected(d);$e=$(this.ele);var dClone=Date.fromString(d.asString());$e.trigger('dateSelected',[dClone,$td,s]);$e.trigger('change');}},isSelected:function(d){return this.selectedDates[d.toString()];},getSelected:function(){var r=[];for(s in this.selectedDates){if(this.selectedDates[s]==true){r.push(Date.parse(s));}}return r;},clearSelected:function(){this.selectedDates={};this.numSelected=0;$('td.selected',this.context).removeClass('selected').parent().removeClass('selectedWeek');},display:function(eleAlignTo){if($(this.ele).is('.dp-disabled'))return;eleAlignTo=eleAlignTo||this.ele;var c=this;var $ele=$(eleAlignTo);var eleOffset=$ele.offset();var $createIn;var attrs;var attrsCalendarHolder;var cssRules;if(c.inline){$createIn=$(this.ele);attrs={'id':'calendar-'+this.ele._dpId,'class':'dp-popup dp-popup-inline'};$('.dp-popup',$createIn).remove();cssRules={};}else{$createIn=$('body');attrs={'id':'dp-popup','class':'dp-popup'};cssRules={'top':eleOffset.top+c.verticalOffset,'left':eleOffset.left+c.horizontalOffset};var _checkMouse=function(e){var el=e.target;var cal=$('#dp-popup')[0];while(true){if(el==cal){return true;}else if(el==document){c._closeCalendar();return false;}else{el=$(el).parent()[0];}}};this._checkMouse=_checkMouse;c._closeCalendar(true);$(document).bind('keydown.datepicker',function(event){if(event.keyCode==27){c._closeCalendar();}});}if(!c.rememberViewedMonth){var selectedDate=this.getSelected()[0];if(selectedDate){selectedDate=new Date(selectedDate);this.setDisplayedMonth(selectedDate.getMonth(),selectedDate.getFullYear(),false);}}$createIn.append($('<div></div>').attr(attrs).css(cssRules).append($('<h2></h2>'),$('<div class="dp-nav-prev"></div>').append($('<a class="dp-nav-prev-year" href="#" title="'+$.dpText.TEXT_PREV_YEAR+'">&lt;&lt;</a>').bind('click',function(){return c._displayNewMonth.call(c,this,0,-1);}),$('<a class="dp-nav-prev-month" href="#" title="'+$.dpText.TEXT_PREV_MONTH+'">&lt;</a>').bind('click',function(){return c._displayNewMonth.call(c,this,-1,0);})),$('<div class="dp-nav-next"></div>').append($('<a class="dp-nav-next-year" href="#" title="'+$.dpText.TEXT_NEXT_YEAR+'">&gt;&gt;</a>').bind('click',function(){return c._displayNewMonth.call(c,this,0,1);}),$('<a class="dp-nav-next-month" href="#" title="'+$.dpText.TEXT_NEXT_MONTH+'">&gt;</a>').bind('click',function(){return c._displayNewMonth.call(c,this,1,0);})),$('<div class="dp-calendar"></div>')).bgIframe());var $pop=this.inline?$('.dp-popup',this.context):$('#dp-popup');if(this.showYearNavigation==false){$('.dp-nav-prev-year, .dp-nav-next-year',c.context).css('display','none');}if(this.displayClose){$pop.append($('<a href="#" id="dp-close">'+$.dpText.TEXT_CLOSE+'</a>').bind('click',function(){c._closeCalendar();return false;}));}c._renderCalendar();$(this.ele).trigger('dpDisplayed',$pop);if(!c.inline){if(this.verticalPosition==$.dpConst.POS_BOTTOM){$pop.css('top',eleOffset.top+$ele.height()-$pop.height()+c.verticalOffset);}if(this.horizontalPosition==$.dpConst.POS_RIGHT){$pop.css('left',eleOffset.left+$ele.width()-$pop.width()+c.horizontalOffset);}$(document).bind('mousedown.datepicker',this._checkMouse);}},setRenderCallback:function(a){if(a==null)return;if(a&&typeof(a)=='function'){a=[a];}this.renderCallback=this.renderCallback.concat(a);},cellRender:function($td,thisDate,month,year){var c=this.dpController;var d=new Date(thisDate.getTime());$td.bind('click',function(){var $this=$(this);if(!$this.is('.disabled')){c.setSelected(d,!$this.is('.selected')||!c.selectMultiple,false,true);if(c.closeOnSelect){c._closeCalendar();}if(!$.browser.msie){$(c.ele).trigger('focus',[$.dpConst.DP_INTERNAL_FOCUS]);}}});if(c.isSelected(d)){$td.addClass('selected');if(c.settings.selectWeek){$td.parent().addClass('selectedWeek');}}else if(c.selectMultiple&&c.numSelected==c.numSelectable){$td.addClass('unselectable');}},_applyRenderCallbacks:function(){var c=this;$('td',this.context).each(function(){for(var i=0;i<c.renderCallback.length;i++){$td=$(this);c.renderCallback[i].apply(this,[$td,Date.fromString($td.data('datePickerDate')),c.displayedMonth,c.displayedYear]);}});return;},_displayNewMonth:function(ele,m,y){if(!$(ele).is('.disabled')){this.setDisplayedMonth(this.displayedMonth+m,this.displayedYear+y,true);}ele.blur();return false;},_rerenderCalendar:function(){this._clearCalendar();this._renderCalendar();},_renderCalendar:function(){$('h2',this.context).html((new Date(this.displayedYear,this.displayedMonth,1)).asString($.dpText.HEADER_FORMAT));$('.dp-calendar',this.context).renderCalendar($.extend({},this.settings,{month:this.displayedMonth,year:this.displayedYear,renderCallback:this.cellRender,dpController:this,hoverClass:this.hoverClass}));if(this.displayedYear==this.startDate.getFullYear()&&this.displayedMonth==this.startDate.getMonth()){$('.dp-nav-prev-year',this.context).addClass('disabled');$('.dp-nav-prev-month',this.context).addClass('disabled');$('.dp-calendar td.other-month',this.context).each(function(){var $this=$(this);if(Number($this.text())>20){$this.addClass('disabled');}});var d=this.startDate.getDate();$('.dp-calendar td.current-month',this.context).each(function(){var $this=$(this);if(Number($this.text())<d){$this.addClass('disabled');}});}else{$('.dp-nav-prev-year',this.context).removeClass('disabled');$('.dp-nav-prev-month',this.context).removeClass('disabled');var d=this.startDate.getDate();if(d>20){var st=this.startDate.getTime();var sd=new Date(st);sd.addMonths(1);if(this.displayedYear==sd.getFullYear()&&this.displayedMonth==sd.getMonth()){$('.dp-calendar td.other-month',this.context).each(function(){var $this=$(this);if(Date.fromString($this.data('datePickerDate')).getTime()<st){$this.addClass('disabled');}});}}}if(this.displayedYear==this.endDate.getFullYear()&&this.displayedMonth==this.endDate.getMonth()){$('.dp-nav-next-year',this.context).addClass('disabled');$('.dp-nav-next-month',this.context).addClass('disabled');$('.dp-calendar td.other-month',this.context).each(function(){var $this=$(this);if(Number($this.text())<14){$this.addClass('disabled');}});var d=this.endDate.getDate();$('.dp-calendar td.current-month',this.context).each(function(){var $this=$(this);if(Number($this.text())>d){$this.addClass('disabled');}});}else{$('.dp-nav-next-year',this.context).removeClass('disabled');$('.dp-nav-next-month',this.context).removeClass('disabled');var d=this.endDate.getDate();if(d<13){var ed=new Date(this.endDate.getTime());ed.addMonths(-1);if(this.displayedYear==ed.getFullYear()&&this.displayedMonth==ed.getMonth()){$('.dp-calendar td.other-month',this.context).each(function(){var $this=$(this);if(Number($this.text())>d){$this.addClass('disabled');}});}}}this._applyRenderCallbacks();},_closeCalendar:function(programatic,ele){if(!ele||ele==this.ele){$(document).unbind('mousedown.datepicker');$(document).unbind('keydown.datepicker');this._clearCalendar();$('#dp-popup a').unbind();$('#dp-popup').empty().remove();if(!programatic){$(this.ele).trigger('dpClosed',[this.getSelected()]);}}},_clearCalendar:function(){$('.dp-calendar td',this.context).unbind();$('.dp-calendar',this.context).empty();}});$.dpConst={SHOW_HEADER_NONE:0,SHOW_HEADER_SHORT:1,SHOW_HEADER_LONG:2,POS_TOP:0,POS_BOTTOM:1,POS_LEFT:0,POS_RIGHT:1,DP_INTERNAL_FOCUS:'dpInternalFocusTrigger'};$.dpText={TEXT_PREV_YEAR:'Предыдущий год',TEXT_PREV_MONTH:'Предыдущий месяц',TEXT_NEXT_YEAR:'Следующий год',TEXT_NEXT_MONTH:'Следующий месяц',TEXT_CLOSE:'Закрыть',TEXT_CHOOSE_DATE:'Выбрать дату',HEADER_FORMAT:'mmmm yyyy'};$.dpVersion='$Id: jquery.datePicker.js 70 2009-04-05 19:25:15Z kelvin.luck $';$.fn.datePicker.defaults={month:undefined,year:undefined,showHeader:$.dpConst.SHOW_HEADER_SHORT,startDate:undefined,endDate:undefined,inline:false,renderCallback:null,createButton:true,showYearNavigation:true,closeOnSelect:true,displayClose:false,selectMultiple:false,numSelectable:Number.MAX_VALUE,clickInput:false,rememberViewedMonth:true,selectWeek:false,verticalPosition:$.dpConst.POS_TOP,horizontalPosition:$.dpConst.POS_LEFT,verticalOffset:0,horizontalOffset:0,hoverClass:'dp-hover'};function _getController(ele){if(ele._dpId)return $.event._dpCache[ele._dpId];return false;};if($.fn.bgIframe==undefined){$.fn.bgIframe=function(){return this;};};$(window).bind('unload',function(){var els=$.event._dpCache||[];for(var i in els){$(els[i].ele)._dpDestroy();}});})(jQuery);jQuery.autocomplete=function(input,options){var me=this;var $input=$(input).attr("autocomplete","off");if(options.inputClass)$input.addClass(options.inputClass);var results=document.createElement("div");var $results=$(results);$results.hide().addClass(options.resultsClass).css("position","absolute");if(options.width>0)$results.css("width",options.width);$("body").append(results);input.autocompleter=me;var timeout=null;var prev="";var active=-1;var cache={};var keyb=false;var hasFocus=false;var lastKeyPressCode=null;function flushCache(){cache={};cache.data={};cache.length=0;};flushCache();if(options.data!=null){var sFirstChar="",stMatchSets={},row=[];if(typeof options.url!="string")options.cacheLength=1;for(var i=0;i<options.data.length;i++){row=((typeof options.data[i]=="string")?[options.data[i]]:options.data[i]);if(row[0].length>0){sFirstChar=row[0].substring(0,1).toLowerCase();if(!stMatchSets[sFirstChar])stMatchSets[sFirstChar]=[];stMatchSets[sFirstChar].push(row);}}
for(var k in stMatchSets){options.cacheLength++;addToCache(k,stMatchSets[k]);}}
$input.keydown(function(e){lastKeyPressCode=e.keyCode;switch(e.keyCode){case 38:e.preventDefault();moveSelect(-1);break;case 40:e.preventDefault();moveSelect(1);break;case 9:case 13:if(selectCurrent()){e.preventDefault();}
hideResults();break;default:active=-1;if(timeout)clearTimeout(timeout);timeout=setTimeout(function(){onChange();},options.delay);break;}}).focus(function(){hasFocus=true;}).blur(function(){hasFocus=false;hideResults();});hideResultsNow();function onChange(){if(lastKeyPressCode==46||(lastKeyPressCode>8&&lastKeyPressCode<32))return $results.hide();var v=$input.val();if(v==prev)return;prev=v;if(v.length>=options.minChars){$input.addClass(options.loadingClass);requestData(v);}else{$input.removeClass(options.loadingClass);$results.hide();}};function moveSelect(step){var lis=$("li",results);if(!lis)return;active+=step;if(active<0){active=0;}else if(active>=lis.size()){active=lis.size()-1;}
lis.removeClass("ac_over");$(lis[active]).addClass("ac_over");};function selectCurrent(){var li=$("li.ac_over",results)[0];if(!li){var $li=$("li",results);if(options.selectOnly){if($li.length==1)li=$li[0];}else if(options.selectFirst){li=$li[0];}}
if(li){selectItem(li);return true;}else{return false;}};function selectItem(li){if(!li){li=document.createElement("li");li.extra=[];li.selectValue="";}
var v=$.trim(li.selectValue?li.selectValue:li.innerHTML);input.lastSelected=v;prev=v;$results.html("");$input.val(v);hideResultsNow();if(options.onItemSelect)setTimeout(function(){options.onItemSelect(li)},1);};function createSelection(start,end){var field=$input.get(0);if(field.createTextRange){var selRange=field.createTextRange();selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();}else if(field.setSelectionRange){field.setSelectionRange(start,end);}else{if(field.selectionStart){field.selectionStart=start;field.selectionEnd=end;}}
field.focus();};function autoFill(sValue){if(lastKeyPressCode!=8){$input.val($input.val()+sValue.substring(prev.length));createSelection(prev.length,sValue.length);}};function showResults(){var pos=findPos(input);var iWidth=(options.width>0)?options.width:$input.width();$results.css({width:parseInt(iWidth)+"px",top:(pos.y+input.offsetHeight)+"px",left:pos.x+"px"}).show();};function hideResults(){if(timeout)clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200);};function hideResultsNow(){if(timeout)clearTimeout(timeout);$input.removeClass(options.loadingClass);if($results.is(":visible")){$results.hide();}
if(options.mustMatch){var v=$input.val();if(v!=input.lastSelected){selectItem(null);}}};function receiveData(q,data){if(data){$input.removeClass(options.loadingClass);results.innerHTML="";if(!hasFocus||data.length==0)return hideResultsNow();if($.browser.msie){$results.append(document.createElement('iframe'));}
results.appendChild(dataToDom(data));if(options.autoFill&&($input.val().toLowerCase()==q.toLowerCase()))autoFill(data[0][0]);showResults();}else{hideResultsNow();}};function parseData(data){if(!data)return null;var parsed=[];var rows=data.split(options.lineSeparator);for(var i=0;i<rows.length;i++){var row=$.trim(rows[i]);if(row){parsed[parsed.length]=row.split(options.cellSeparator);}}
return parsed;};function dataToDom(data){var ul=document.createElement("ul");var num=data.length;if((options.maxItemsToShow>0)&&(options.maxItemsToShow<num))num=options.maxItemsToShow;for(var i=0;i<num;i++){var row=data[i];if(!row)continue;var li=document.createElement("li");if(options.formatItem){li.innerHTML=options.formatItem(row,i,num);li.selectValue=row[0];}else{li.innerHTML=row[0];li.selectValue=row[0];}
var extra=null;if(row.length>1){extra=[];for(var j=1;j<row.length;j++){extra[extra.length]=row[j];}}
li.extra=extra;ul.appendChild(li);$(li).hover(function(){$("li",ul).removeClass("ac_over");$(this).addClass("ac_over");active=$("li",ul).indexOf($(this).get(0));},function(){$(this).removeClass("ac_over");}).click(function(e){e.preventDefault();e.stopPropagation();selectItem(this)});}
return ul;};function requestData(q){if(!options.matchCase)q=q.toLowerCase();var data=options.cacheLength?loadFromCache(q):null;if((typeof options.url=="string")&&(options.url.length>0)&&(options.url!='none')){$.get(makeUrl(q),function(data){data=parseData(data);addToCache(q,data);receiveData(q,data);});}else{if(options.url=='none'){addToCache(q,data);receiveData(q,data);}else{$input.removeClass(options.loadingClass);}}};function makeUrl(q){var url=options.url+"?q="+encodeURI(q);for(var i in options.extraParams){url+="&"+i+"="+encodeURI(options.extraParams[i]);}
return url;};function loadFromCache(q){if(!q)return null;if(cache.data[q])return cache.data[q];if(options.matchSubset){for(var i=q.length-1;i>=options.minChars;i--){var qs=q.substr(0,i);var c=cache.data[qs];if(c){var csub=[];for(var j=0;j<c.length;j++){var x=c[j];var x0=x[0];if(matchSubset(x0,q)){csub[csub.length]=x;}}
return csub;}}}
return null;};function matchSubset(s,sub){if(!options.matchCase)s=s.toLowerCase();var i=s.indexOf(sub);if(i==-1)return false;return i==0||options.matchContains;};this.flushCache=function(){flushCache();};this.setExtraParams=function(p){options.extraParams=p;};this.findValue=function(){var q=$input.val();if(!options.matchCase)q=q.toLowerCase();var data=options.cacheLength?loadFromCache(q):null;if(data){findValueCallback(q,data);}else if((typeof options.url=="string")&&(options.url.length>0)&&(options.url!='none')){$.get(makeUrl(q),function(data){data=parseData(data)
addToCache(q,data);findValueCallback(q,data);});}else{findValueCallback(q,null);}}
function findValueCallback(q,data){if(data)$input.removeClass(options.loadingClass);var num=(data)?data.length:0;var li=null;for(var i=0;i<num;i++){var row=data[i];if(row[0].toLowerCase()==q.toLowerCase()){li=document.createElement("li");if(options.formatItem){li.innerHTML=options.formatItem(row,i,num);li.selectValue=row[0];}else{li.innerHTML=row[0];li.selectValue=row[0];}
var extra=null;if(row.length>1){extra=[];for(var j=1;j<row.length;j++){extra[extra.length]=row[j];}}
li.extra=extra;}}
if(options.onFindValue)setTimeout(function(){options.onFindValue(li)},1);}
function addToCache(q,data){if(!data||!q||!options.cacheLength)return;if(!cache.length||cache.length>options.cacheLength){flushCache();cache.length++;}else if(!cache[q]){cache.length++;}
cache.data[q]=data;};function findPos(obj){var curleft=obj.offsetLeft||0;var curtop=obj.offsetTop||0;while(obj=obj.offsetParent){curleft+=obj.offsetLeft
curtop+=obj.offsetTop}
return{x:curleft,y:curtop};}}
jQuery.fn.autocomplete=function(url,options,data){options=options||{};options.url=url;options.data=((typeof data=="object")&&(data.constructor==Array))?data:null;options.inputClass=options.inputClass||"ac_input";options.resultsClass=options.resultsClass||"ac_results";options.lineSeparator=options.lineSeparator||"\n";options.cellSeparator=options.cellSeparator||"|";options.minChars=options.minChars||1;options.delay=options.delay||400;options.matchCase=options.matchCase||0;options.matchSubset=options.matchSubset||1;options.matchContains=options.matchContains||0;options.cacheLength=options.cacheLength||1;options.mustMatch=options.mustMatch||0;options.extraParams=options.extraParams||{};options.loadingClass=options.loadingClass||"ac_loading";options.selectFirst=options.selectFirst||false;options.selectOnly=options.selectOnly||false;options.maxItemsToShow=options.maxItemsToShow||-1;options.autoFill=options.autoFill||false;options.width=parseInt(options.width,10)||0;this.each(function(){var input=this;new jQuery.autocomplete(input,options);});return this;}
jQuery.fn.autocompleteArray=function(data,options){return this.autocomplete(null,options,data);}
jQuery.fn.indexOf=function(e){for(var i=0;i<this.length;i++){if(this[i]==e)return i;}
return-1;};;(function($){$.fn.ajaxSubmit=function(options){if(!this.length){log('ajaxSubmit: skipping submit process - no element selected');return this;}
if(typeof options=='function')
options={success:options};var url=$.trim(this.attr('action'));if(url){url=(url.match(/^([^#]+)/)||[])[1];}
url=url||window.location.href||''
options=$.extend({url:url,type:this.attr('method')||'GET'},options||{});var veto={};this.trigger('form-pre-serialize',[this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');return this;}
if(options.beforeSerialize&&options.beforeSerialize(this,options)===false){log('ajaxSubmit: submit aborted via beforeSerialize callback');return this;}
var a=this.formToArray(options.semantic);if(options.data){options.extraData=options.data;for(var n in options.data){if(options.data[n]instanceof Array){for(var k in options.data[n])
a.push({name:n,value:options.data[n][k]});}
else
a.push({name:n,value:options.data[n]});}}
if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false){log('ajaxSubmit: submit aborted via beforeSubmit callback');return this;}
this.trigger('form-submit-validate',[a,this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-submit-validate trigger');return this;}
var q=$.param(a);if(options.type.toUpperCase()=='GET'){options.url+=(options.url.indexOf('?')>=0?'&':'?')+q;options.data=null;}
else
options.data=q;var $form=this,callbacks=[];if(options.resetForm)callbacks.push(function(){$form.resetForm();});if(options.clearForm)callbacks.push(function(){$form.clearForm();});if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data){$(options.target).html(data).each(oldSuccess,arguments);});}
else if(options.success)
callbacks.push(options.success);options.success=function(data,status){for(var i=0,max=callbacks.length;i<max;i++)
callbacks[i].apply(options,[data,status,$form]);};var files=$('input:file',this).fieldValue();var found=false;for(var j=0;j<files.length;j++)
if(files[j])
found=true;var multipart=false;if(options.iframe||found||multipart){if(options.closeKeepAlive)
$.get(options.closeKeepAlive,fileUpload);else
fileUpload();}
else
$.ajax(options);this.trigger('form-submit-notify',[this,options]);return this;function fileUpload(){var form=$form[0];if($(':input[name=submit]',form).length){alert('Error: Form elements must not be named "submit".');return;}
var opts=$.extend({},$.ajaxSettings,options);var s=$.extend(true,{},$.extend(true,{},$.ajaxSettings),opts);var id='jqFormIO'+(new Date().getTime());var $io=$('<iframe id="'+id+'" name="'+id+'" src="about:blank" />');var io=$io[0];$io.css({position:'absolute',top:'-1000px',left:'-1000px'});var xhr={aborted:0,responseText:null,responseXML:null,status:0,statusText:'n/a',getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;$io.attr('src','about:blank');}};var g=opts.global;if(g&&!$.active++)$.event.trigger("ajaxStart");if(g)$.event.trigger("ajaxSend",[xhr,opts]);if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&$.active--;return;}
if(xhr.aborted)
return;var cbInvoked=0;var timedOut=0;var sub=form.clk;if(sub){var n=sub.name;if(n&&!sub.disabled){options.extraData=options.extraData||{};options.extraData[n]=sub.value;if(sub.type=="image"){options.extraData[name+'.x']=form.clk_x;options.extraData[name+'.y']=form.clk_y;}}}
setTimeout(function(){var t=$form.attr('target'),a=$form.attr('action');form.setAttribute('target',id);if(form.getAttribute('method')!='POST')
form.setAttribute('method','POST');if(form.getAttribute('action')!=opts.url)
form.setAttribute('action',opts.url);if(!options.skipEncodingOverride){$form.attr({encoding:'multipart/form-data',enctype:'multipart/form-data'});}
if(opts.timeout)
setTimeout(function(){timedOut=true;cb();},opts.timeout);var extraInputs=[];try{if(options.extraData)
for(var n in options.extraData)
extraInputs.push($('<input type="hidden" name="'+n+'" value="'+options.extraData[n]+'" />').appendTo(form)[0]);$io.appendTo('body');io.attachEvent?io.attachEvent('onload',cb):io.addEventListener('load',cb,false);form.submit();}
finally{form.setAttribute('action',a);t?form.setAttribute('target',t):$form.removeAttr('target');$(extraInputs).remove();}},10);var nullCheckFlag=0;function cb(){if(cbInvoked++)return;io.detachEvent?io.detachEvent('onload',cb):io.removeEventListener('load',cb,false);var ok=true;try{if(timedOut)throw'timeout';var data,doc;doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;if((doc.body==null||doc.body.innerHTML=='')&&!nullCheckFlag){nullCheckFlag=1;cbInvoked--;setTimeout(cb,100);return;}
xhr.responseText=doc.body?doc.body.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;xhr.getResponseHeader=function(header){var headers={'content-type':opts.dataType};return headers[header];};if(opts.dataType=='json'||opts.dataType=='script'){var ta=doc.getElementsByTagName('textarea')[0];xhr.responseText=ta?ta.value:xhr.responseText;}
else if(opts.dataType=='xml'&&!xhr.responseXML&&xhr.responseText!=null){xhr.responseXML=toXml(xhr.responseText);}
data=$.httpData(xhr,opts.dataType);}
catch(e){ok=false;$.handleError(opts,xhr,'error',e);}
if(ok){opts.success(data,'success');if(g)$.event.trigger("ajaxSuccess",[xhr,opts]);}
if(g)$.event.trigger("ajaxComplete",[xhr,opts]);if(g&&!--$.active)$.event.trigger("ajaxStop");if(opts.complete)opts.complete(xhr,ok?'success':'error');setTimeout(function(){$io.remove();xhr.responseXML=null;},100);};function toXml(s,doc){if(window.ActiveXObject){doc=new ActiveXObject('Microsoft.XMLDOM');doc.async='false';doc.loadXML(s);}
else
doc=(new DOMParser()).parseFromString(s,'text/xml');return(doc&&doc.documentElement&&doc.documentElement.tagName!='parsererror')?doc:null;};};};$.fn.ajaxForm=function(options){return this.ajaxFormUnbind().bind('submit.form-plugin',function(){$(this).ajaxSubmit(options);return false;}).each(function(){$(":submit,input:image",this).bind('click.form-plugin',function(e){var form=this.form;form.clk=this;if(this.type=='image'){if(e.offsetX!=undefined){form.clk_x=e.offsetX;form.clk_y=e.offsetY;}else if(typeof $.fn.offset=='function'){var offset=$(this).offset();form.clk_x=e.pageX-offset.left;form.clk_y=e.pageY-offset.top;}else{form.clk_x=e.pageX-this.offsetLeft;form.clk_y=e.pageY-this.offsetTop;}}
setTimeout(function(){form.clk=form.clk_x=form.clk_y=null;},10);});});};$.fn.ajaxFormUnbind=function(){this.unbind('submit.form-plugin');return this.each(function(){$(":submit,input:image",this).unbind('click.form-plugin');});};$.fn.formToArray=function(semantic){var a=[];if(this.length==0)return a;var form=this[0];var els=semantic?form.getElementsByTagName('*'):form.elements;if(!els)return a;for(var i=0,max=els.length;i<max;i++){var el=els[i];var n=el.name;if(!n)continue;if(semantic&&form.clk&&el.type=="image"){if(!el.disabled&&form.clk==el){a.push({name:n,value:$(el).val()});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}
continue;}
var v=$.fieldValue(el,true);if(v&&v.constructor==Array){for(var j=0,jmax=v.length;j<jmax;j++)
a.push({name:n,value:v[j]});}
else if(v!==null&&typeof v!='undefined')
a.push({name:n,value:v});}
if(!semantic&&form.clk){var $input=$(form.clk),input=$input[0],n=input.name;if(n&&!input.disabled&&input.type=='image'){a.push({name:n,value:$input.val()});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}}
return a;};$.fn.formSerialize=function(semantic){return $.param(this.formToArray(semantic));};$.fn.fieldSerialize=function(successful){var a=[];this.each(function(){var n=this.name;if(!n)return;var v=$.fieldValue(this,successful);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++)
a.push({name:n,value:v[i]});}
else if(v!==null&&typeof v!='undefined')
a.push({name:this.name,value:v});});return $.param(a);};$.fn.fieldValue=function(successful){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,successful);if(v===null||typeof v=='undefined'||(v.constructor==Array&&!v.length))
continue;v.constructor==Array?$.merge(val,v):val.push(v);}
return val;};$.fieldValue=function(el,successful){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(typeof successful=='undefined')successful=true;if(successful&&(!n||el.disabled||t=='reset'||t=='button'||(t=='checkbox'||t=='radio')&&!el.checked||(t=='submit'||t=='image')&&el.form&&el.form.clk!=el||tag=='select'&&el.selectedIndex==-1))
return null;if(tag=='select'){var index=el.selectedIndex;if(index<0)return null;var a=[],ops=el.options;var one=(t=='select-one');var max=(one?index+1:ops.length);for(var i=(one?index:0);i<max;i++){var op=ops[i];if(op.selected){var v=op.value;if(!v)
v=(op.attributes&&op.attributes['value']&&!(op.attributes['value'].specified))?op.text:op.value;if(one)return v;a.push(v);}}
return a;}
return el.value;};$.fn.clearForm=function(){return this.each(function(){$('input,select,textarea',this).clearFields();});};$.fn.clearFields=$.fn.clearInputs=function(){return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(t=='text'||t=='password'||tag=='textarea')
this.value='';else if(t=='checkbox'||t=='radio')
this.checked=false;else if(tag=='select')
this.selectedIndex=-1;});};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=='function'||(typeof this.reset=='object'&&!this.reset.nodeType))
this.reset();});};$.fn.enable=function(b){if(b==undefined)b=true;return this.each(function(){this.disabled=!b;});};$.fn.selected=function(select){if(select==undefined)select=true;return this.each(function(){var t=this.type;if(t=='checkbox'||t=='radio')
this.checked=select;else if(this.tagName.toLowerCase()=='option'){var $sel=$(this).parent('select');if(select&&$sel[0]&&$sel[0].type=='select-one'){$sel.find('option').selected(false);}
this.selected=select;}});};function log(){if($.fn.ajaxSubmit.debug&&window.console&&window.console.log)
window.console.log('[jquery.form] '+Array.prototype.join.call(arguments,''));};})(jQuery);﻿
if(jQuery)(function($){$.extend($.fn,{multiSelect:function(o,callback){if(!o)var o={};if(o.selectAll==undefined)o.selectAll=false;if(o.asTable==undefined)o.selectAll=false;if(o.tableCols==undefined)o.tableCols=1;if(o.defname==undefined)o.defname='Стиль';if(o.selectAllText==undefined)o.selectAllText="Выбрать всё";if(o.noneSelected==undefined)o.noneSelected=o.defname;if(o.oneOrMoreSelected==undefined)o.oneOrMoreSelected='% selected';if(o.tableClass==undefined)o.tableClass='';if(o.divClass==undefined)o.divClass='';$(this).each(function(){var select=$(this);o.id=$(this).attr('id');var html='<input id="mlst'+o.id+'" type="text" readonly="readonly" class="multiSelect" value="" style="cursor: default;" />';html+='<div id="dv'+o.id+'" class="multiSelectOptions + '+o.divClass+'" style="position: absolute; z-index: 99999; display: none;">';if(o.selectAll)html+='<label class="selectAll"><input type="checkbox" class="selectAll" />'+o.selectAllText+'</label>';if(o.asTable)html+='<table class="'+o.tableClass+'">';var cntr=0;$(select).find('OPTION').each(function(){if($(this).val()!=''){if(o.asTable){if(cntr==0){html+='<tr>';}
cntr++;html+='<td>';}
var slt='';if(!this.selected){slt='un';}
html+='<label id="lblst_'+$(this).val()+'" onclick="$(\'#focusinp\').focus();" for="style_'+$(this).val()+'"><img alt="" onclick="$(\'#lblst_'+$(this).val()+'\').click();" class="finger" id="styles_img_'+$(this).val()+'" src="'+request_0+'images/'+slt+'checked.gif"/> <input id="style_'+$(this).val()+'" type="checkbox" name="'+$(select).attr('name')+'" onchange="change_check(this, \'styles_img_'+$(this).val()+'\');" class="hidden" value="'+$(this).val()+'"';if($(this).attr('selected'))html+=' checked="checked"';html+=' />'+$(this).html()+'</label>';if(o.asTable){html+='</td>';if(cntr==o.tableCols){cntr=0;html+='</tr>';};}}});if(o.asTable){if(cntr!=o.tableCols){for(i=1;i<o.tableCols-cntr;i++){html+='<td></td>';}
html+='</tr>';}
html+='<table>';}
html+='</div>';$(select).after(html);$(select).next('.multiSelect').mouseover(function(){$(this).addClass('hover');}).mouseout(function(){$(this).removeClass('hover');}).click(function(){if($(this).hasClass('active')){$(this).multiSelectOptionsHide();}else{$(this).multiSelectOptionsShow();}
return false;}).focus(function(){$(this).addClass('focus');}).blur(function(){$(this).removeClass('focus');});if(o.selectAll){var sa=true;$(select).next('.multiSelect').next('.multiSelectOptions').find('INPUT:checkbox').not('.selectAll').each(function(){if(!$(this).attr('checked'))sa=false;});if(sa)$(select).next('.multiSelect').next('.multiSelectOptions').find('INPUT.selectAll').attr('checked',true).parent().addClass('checked');}
$(select).next('.multiSelect').next('.multiSelectOptions').find('INPUT.selectAll').click(function(){if($(this).attr('checked')==true)$(this).parent().parent().find('INPUT:checkbox').attr('checked',true).parent().addClass('checked');else $(this).parent().parent().find('INPUT:checkbox').attr('checked',false).parent().removeClass('checked');});$(select).next('.multiSelect').next('.multiSelectOptions').find('INPUT:checkbox').click(function(){$('#dv'+o.id).multiSelectUpdateSelected(o);$(this).parent().parent().find('LABEL').removeClass('checked').find('INPUT:checked').parent().addClass('checked');$(this).parent().parent().prev('.multiSelect').focus();if(!$(this).attr('checked'))$(this).parent().parent().find('INPUT:checkbox.selectAll').attr('checked',false).parent().removeClass('checked');if(callback)callback($(this));});$(select).next('.multiSelect').next('.multiSelectOptions').each(function(){$(this).multiSelectUpdateSelected(o);$(this).find('INPUT:checked').parent().addClass('checked');});$(select).next('.multiSelect').next('.multiSelectOptions').find('LABEL').mouseover(function(){$(this).parent().find('LABEL').removeClass('hover');$(this).addClass('hover');}).mouseout(function(){$(this).parent().find('LABEL').removeClass('hover');});$(select).next('.multiSelect').keydown(function(e){if($(this).next('.multiSelectOptions').is(':visible')){if(e.keyCode==9){$(this).addClass('focus').trigger('click');$(this).focus().next(':input').focus();return true;}
if(e.keyCode==27||e.keyCode==37||e.keyCode==39){$(this).addClass('focus').trigger('click');}
if(e.keyCode==40){if(!$(this).next('.multiSelectOptions').find('LABEL').hasClass('hover')){$(this).next('.multiSelectOptions').find('LABEL:first').addClass('hover');}else{$(this).next('.multiSelectOptions').find('LABEL.hover').removeClass('hover').next('LABEL').addClass('hover');if(!$(this).next('.multiSelectOptions').find('LABEL').hasClass('hover')){$(this).next('.multiSelectOptions').find('LABEL:first').addClass('hover');}}
$(this).multiSelectAdjustViewport($(this));return false;}
if(e.keyCode==38){if(!$(this).next('.multiSelectOptions').find('LABEL').hasClass('hover')){$(this).next('.multiSelectOptions').find('LABEL:first').addClass('hover');}else{$(this).next('.multiSelectOptions').find('LABEL.hover').removeClass('hover').prev('LABEL').addClass('hover');if(!$(this).next('.multiSelectOptions').find('LABEL').hasClass('hover')){$(this).next('.multiSelectOptions').find('LABEL:last').addClass('hover');}}
$(this).multiSelectAdjustViewport($(this));return false;}
if(e.keyCode==13||e.keyCode==32){if($(this).next('.multiSelectOptions').find('LABEL.hover INPUT:checkbox').hasClass('selectAll')){if($(this).next('.multiSelectOptions').find('LABEL.hover INPUT:checkbox').attr('checked')){$(this).next('.multiSelectOptions').find('INPUT:checkbox').attr('checked',false).parent().removeClass('checked');}else{$(this).next('.multiSelectOptions').find('INPUT:checkbox').attr('checked',true).parent().addClass('checked');}
$(this).next('.multiSelectOptions').multiSelectUpdateSelected(o);if(callback)callback($(this));return false;}
if($(this).next('.multiSelectOptions').find('LABEL.hover INPUT:checkbox').attr('checked')){$(this).next('.multiSelectOptions').find('LABEL.hover INPUT:checkbox').attr('checked',false);$(this).next('.multiSelectOptions').multiSelectUpdateSelected(o);$(this).next('.multiSelectOptions').find('LABEL').removeClass('checked').find('INPUT:checked').parent().addClass('checked');$(this).next('.multiSelectOptions').find('INPUT:checkbox.selectAll').attr('checked',false).parent().removeClass('checked');if(callback)callback($(this));}else{$(this).next('.multiSelectOptions').find('LABEL.hover INPUT:checkbox').attr('checked',true);$(this).next('.multiSelectOptions').multiSelectUpdateSelected(o);$(this).next('.multiSelectOptions').find('LABEL').removeClass('checked').find('INPUT:checked').parent().addClass('checked');if(callback)callback($(this));}}
return false;}else{if(e.keyCode==38||e.keyCode==40||e.keyCode==13||e.keyCode==32){$(this).removeClass('focus').trigger('click');$(this).next('.multiSelectOptions').find('LABEL:first').addClass('hover');return false;}
if(e.keyCode==9){$(this).focus().next(':input').focus();return true;}}
if(e.keyCode==13)return false;});$(select).remove();});},multiSelectOptionsHide:function(){$(this).removeClass('active');$('#dv'+$(this).attr('id').substr(4)).hide();},multiSelectOptionsShow:function(){$('.multiSelect').multiSelectOptionsHide();$('#dv'+$(this).attr('id').substr(4)).find('LABEL').removeClass('hover');$(this).addClass('active');$('#dv'+$(this).attr('id').substr(4)).show();var offset=$(this).position();$('#dv'+$(this).attr('id').substr(4)).css({top:offset.top+$(this).outerHeight()+'px'});$('#dv'+$(this).attr('id').substr(4)).css({left:offset.left+'px'});multiSelectCurrent=$(this);var timer='';$('#dv'+$(this).attr('id').substr(4)).hover(function(){clearTimeout(timer);},function(){timer=setTimeout('jQuery(multiSelectCurrent).multiSelectOptionsHide(); $(multiSelectCurrent).unbind("hover");',250);});},multiSelectUpdateSelected:function(o){var i=0,s='';$(this).find('INPUT:checkbox:checked').not('.selectAll').each(function(){i++;})
if(i==0){$('#mlst'+o.id).val(o.noneSelected);}else{if(o.oneOrMoreSelected=='*'){var display='';$(this).find('INPUT:checkbox:checked').each(function(){if($(this).parent().text()!=o.selectAllText)display=display+$(this).parent().text()+', ';});display=display.substr(0,display.length-2);$('#mlst'+o.id).val(display);}else{$('#mlst'+o.id).val(display).val(o.oneOrMoreSelected.replace('%',i));}}},multiSelectAdjustViewport:function(el){var i=0;var selectionTop=0,selectionHeight=0;$(el).next('.multiSelectOptions').find('LABEL').each(function(){if($(this).hasClass('hover')){selectionTop=i;selectionHeight=$(this).outerHeight();return;}
i+=$(this).outerHeight();});var divScroll=$(el).next('.multiSelectOptions').scrollTop();var divHeight=$(el).next('.multiSelectOptions').height();$(el).next('.multiSelectOptions').scrollTop(selectionTop-((divHeight/2)-(selectionHeight/2)));}});})(jQuery);(function($){$.event.special.mousewheel={setup:function(){var handler=$.event.special.mousewheel.handler;if($.browser.mozilla)
$(this).bind('mousemove.mousewheel',function(event){$.data(this,'mwcursorposdata',{pageX:event.pageX,pageY:event.pageY,clientX:event.clientX,clientY:event.clientY});});if(this.addEventListener)
this.addEventListener(($.browser.mozilla?'DOMMouseScroll':'mousewheel'),handler,false);else
this.onmousewheel=handler;},teardown:function(){var handler=$.event.special.mousewheel.handler;$(this).unbind('mousemove.mousewheel');if(this.removeEventListener)
this.removeEventListener(($.browser.mozilla?'DOMMouseScroll':'mousewheel'),handler,false);else
this.onmousewheel=function(){};$.removeData(this,'mwcursorposdata');},handler:function(event){var args=Array.prototype.slice.call(arguments,1);event=$.event.fix(event||window.event);$.extend(event,$.data(this,'mwcursorposdata')||{});var delta=0,returnValue=true;if(event.wheelDelta)delta=event.wheelDelta/120;if(event.detail)delta=-event.detail/3;event.data=event.data||{};event.type="mousewheel";args.unshift(delta);args.unshift(event);return $.event.handle.apply(this,args);}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel");},unmousewheel:function(fn){return this.unbind("mousewheel",fn);}});})(jQuery);(function($){$.jScrollPane={active:[]};$.fn.jScrollPane=function(settings)
{settings=$.extend({},$.fn.jScrollPane.defaults,settings);var rf=function(){return false;};return this.each(function()
{var $this=$(this);$this.css('overflow','hidden');var paneEle=this;if($(this).parent().is('.jScrollPaneContainer')){var currentScrollPosition=settings.maintainPosition?$this.position().top:0;var $c=$(this).parent();var paneWidth=$c.innerWidth();var paneHeight=$c.outerHeight();var trackHeight=paneHeight;$('>.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown',$c).remove();$this.css({'top':0});}else{var currentScrollPosition=0;this.originalPadding=$this.css('paddingTop')+' '+$this.css('paddingRight')+' '+$this.css('paddingBottom')+' '+$this.css('paddingLeft');this.originalSidePaddingTotal=(parseInt($this.css('paddingLeft'))||0)+(parseInt($this.css('paddingRight'))||0);var paneWidth=$this.innerWidth();var paneHeight=$this.innerHeight();var trackHeight=paneHeight;$this.wrap($('<div></div>').attr({'className':'jScrollPaneContainer'}).css({'height':paneHeight+'px','width':paneWidth+'px'}));$(document).bind('emchange',function(e,cur,prev)
{$this.jScrollPane(settings);});}
if(!settings.reinitialiseOnImageLoad){var $imagesToLoad=$.data(paneEle,'jScrollPaneImagesToLoad')||$('img',$this);var loadedImages=[];var imagesToLoad_length=$imagesToLoad.length;var imagesToLoad_cntr=0;$('#menu_item_music').val(imagesToLoad_length);if($imagesToLoad.length){$imagesToLoad.each(function(i,val){$(this).bind('load',function(){imagesToLoad_cntr++;$('#menu_item_add_single').val(imagesToLoad_cntr);if(imagesToLoad_cntr==imagesToLoad_length){$this.jScrollPane(settings);}});});};}
var p=this.originalSidePaddingTotal;var cssToApply={'height':'auto','width':paneWidth-settings.scrollbarWidth-settings.scrollbarMargin-p+'px'}
if(settings.scrollbarOnLeft){cssToApply.paddingLeft=settings.scrollbarMargin+settings.scrollbarWidth+'px';}else{cssToApply.paddingRight=settings.scrollbarMargin+'px';}
if((paneWidth-settings.scrollbarWidth-settings.scrollbarMargin-p)<1){cssToApply.width='0px';}
$this.css(cssToApply);var contentHeight=$this.outerHeight();var percentInView=paneHeight/contentHeight;if(percentInView<.99){var $container=$this.parent();$container.append($('<div></div>').attr({'className':'jScrollPaneTrack'}).css({'width':settings.scrollbarWidth+'px'}).append($('<div></div>').attr({'className':'jScrollPaneDrag'}).css({'width':settings.scrollbarWidth+'px'}).append($('<div></div>').attr({'className':'jScrollPaneDragTop'}).css({'width':settings.scrollbarWidth+'px'}),$('<div></div>').attr({'className':'jScrollPaneDragBottom'}).css({'width':settings.scrollbarWidth+'px'}))));var $track=$('>.jScrollPaneTrack',$container);var $drag=$('>.jScrollPaneTrack .jScrollPaneDrag',$container);if(settings.showArrows){var currentArrowButton;var currentArrowDirection;var currentArrowInterval;var currentArrowInc;var whileArrowButtonDown=function()
{if(currentArrowInc>4||currentArrowInc%4==0){positionDrag(dragPosition+currentArrowDirection*mouseWheelMultiplier);}
currentArrowInc++;};var onArrowMouseUp=function(event)
{$('html').unbind('mouseup',onArrowMouseUp);currentArrowButton.removeClass('jScrollActiveArrowButton');clearInterval(currentArrowInterval);};var onArrowMouseDown=function(){$('html').bind('mouseup',onArrowMouseUp);currentArrowButton.addClass('jScrollActiveArrowButton');currentArrowInc=0;whileArrowButtonDown();currentArrowInterval=setInterval(whileArrowButtonDown,100);};$container.append($('<a></a>').attr({'href':'javascript:;','className':'jScrollArrowUp'}).css({'width':settings.scrollbarWidth+'px'}).html('Scroll up').bind('mousedown',function()
{currentArrowButton=$(this);currentArrowDirection=-1;onArrowMouseDown();this.blur();return false;}).bind('click',rf),$('<a></a>').attr({'href':'javascript:;','className':'jScrollArrowDown'}).css({'width':settings.scrollbarWidth+'px'}).html('Scroll down').bind('mousedown',function()
{currentArrowButton=$(this);currentArrowDirection=1;onArrowMouseDown();this.blur();return false;}).bind('click',rf));var $upArrow=$('>.jScrollArrowUp',$container);var $downArrow=$('>.jScrollArrowDown',$container);if(settings.arrowSize){trackHeight=paneHeight-settings.arrowSize-settings.arrowSize;$track.css({'height':trackHeight+'px',top:settings.arrowSize+'px'})}else{var topArrowHeight=$upArrow.height();settings.arrowSize=topArrowHeight;trackHeight=paneHeight-topArrowHeight-$downArrow.height();$track.css({'height':trackHeight+'px',top:topArrowHeight+'px'})}}
var $pane=$(this).css({'position':'absolute','overflow':'visible'});var currentOffset;var maxY;var mouseWheelMultiplier;var dragPosition=0;var dragMiddle=percentInView*paneHeight/2;var getPos=function(event,c){var p=c=='X'?'Left':'Top';return event['page'+c]||(event['client'+c]+(document.documentElement['scroll'+p]||document.body['scroll'+p]))||0;};var ignoreNativeDrag=function(){return false;};var initDrag=function()
{ceaseAnimation();currentOffset=$drag.offset(false);currentOffset.top-=dragPosition;maxY=trackHeight-$drag[0].offsetHeight;mouseWheelMultiplier=2*settings.wheelSpeed*maxY/contentHeight;};var onStartDrag=function(event)
{initDrag();dragMiddle=getPos(event,'Y')-dragPosition-currentOffset.top;$('html').bind('mouseup',onStopDrag).bind('mousemove',updateScroll);if($.browser.msie){$('html').bind('dragstart',ignoreNativeDrag).bind('selectstart',ignoreNativeDrag);}
return false;};var onStopDrag=function()
{$('html').unbind('mouseup',onStopDrag).unbind('mousemove',updateScroll);dragMiddle=percentInView*paneHeight/2;if($.browser.msie){$('html').unbind('dragstart',ignoreNativeDrag).unbind('selectstart',ignoreNativeDrag);}};var positionDrag=function(destY)
{destY=destY<0?0:(destY>maxY?maxY:destY);dragPosition=destY;$drag.css({'top':destY+'px'});var p=destY/maxY;$pane.css({'top':((paneHeight-contentHeight)*p)+'px'});$this.trigger('scroll');if(settings.showArrows){$upArrow[destY==0?'addClass':'removeClass']('disabled');$downArrow[destY==maxY?'addClass':'removeClass']('disabled');}};var updateScroll=function(e)
{positionDrag(getPos(e,'Y')-currentOffset.top-dragMiddle);};var dragH=Math.max(Math.min(percentInView*(paneHeight-settings.arrowSize*2),settings.dragMaxHeight),settings.dragMinHeight);$drag.css({'height':dragH+'px'}).bind('mousedown',onStartDrag);var trackScrollInterval;var trackScrollInc;var trackScrollMousePos;var doTrackScroll=function()
{if(trackScrollInc>8||trackScrollInc%4==0){positionDrag((dragPosition-((dragPosition-trackScrollMousePos)/2)));}
trackScrollInc++;};var onStopTrackClick=function()
{clearInterval(trackScrollInterval);$('html').unbind('mouseup',onStopTrackClick).unbind('mousemove',onTrackMouseMove);};var onTrackMouseMove=function(event)
{trackScrollMousePos=getPos(event,'Y')-currentOffset.top-dragMiddle;};var onTrackClick=function(event)
{initDrag();onTrackMouseMove(event);trackScrollInc=0;$('html').bind('mouseup',onStopTrackClick).bind('mousemove',onTrackMouseMove);trackScrollInterval=setInterval(doTrackScroll,100);doTrackScroll();};$track.bind('mousedown',onTrackClick);$container.bind('mousewheel',function(event,delta){initDrag();ceaseAnimation();var d=dragPosition;positionDrag(dragPosition-delta*mouseWheelMultiplier);var dragOccured=d!=dragPosition;return!dragOccured;});var _animateToPosition;var _animateToInterval;function animateToPosition()
{var diff=(_animateToPosition-dragPosition)/settings.animateStep;if(diff>1||diff<-1){positionDrag(dragPosition+diff);}else{positionDrag(_animateToPosition);ceaseAnimation();}}
var ceaseAnimation=function()
{if(_animateToInterval){clearInterval(_animateToInterval);delete _animateToPosition;}};var scrollTo=function(pos,preventAni)
{if(typeof pos=="string"){$e=$(pos,$this);if(!$e.length)return;pos=$e.offset().top-$this.offset().top;}
$container.scrollTop(0);ceaseAnimation();var destDragPosition=-pos/(paneHeight-contentHeight)*maxY;if(preventAni||!settings.animateTo){positionDrag(destDragPosition);}else{_animateToPosition=destDragPosition;_animateToInterval=setInterval(animateToPosition,settings.animateInterval);}};$this[0].scrollTo=scrollTo;$this[0].scrollBy=function(delta)
{var currentPos=-parseInt($pane.css('top'))||0;scrollTo(currentPos+delta);};initDrag();scrollTo(-currentScrollPosition,true);$('*',this).bind('focus',function(event)
{var $e=$(this);var eleTop=0;while($e[0]!=$this[0]){eleTop+=$e.position().top;$e=$e.offsetParent();}
var viewportTop=-parseInt($pane.css('top'))||0;var maxVisibleEleTop=viewportTop+paneHeight;var eleInView=eleTop>viewportTop&&eleTop<maxVisibleEleTop;if(!eleInView){var destPos=eleTop-settings.scrollbarMargin;if(eleTop>viewportTop){destPos+=$(this).height()+15+settings.scrollbarMargin-paneHeight;}
scrollTo(destPos);}})
$(document).bind('click',function(e)
{$target=$(e.target);if($target.is('a')){var h=$target.attr('href');if(h.substr(0,1)=='#'){scrollTo(h);}}});$.jScrollPane.active.push($this[0]);}else{$this.css({'height':paneHeight+'px','width':paneWidth-this.originalSidePaddingTotal+'px','padding':this.originalPadding});$this.parent().unbind('mousewheel');}})};$.fn.jScrollPane.defaults={scrollbarWidth:10,scrollbarMargin:5,wheelSpeed:18,showArrows:false,arrowSize:0,animateTo:false,dragMinHeight:1,dragMaxHeight:99999,animateInterval:100,animateStep:3,maintainPosition:true,scrollbarOnLeft:false,reinitialiseOnImageLoad:false};$(window).bind('unload',function(){var els=$.jScrollPane.active;for(var i=0;i<els.length;i++){els[i].scrollTo=els[i].scrollBy=null;}});})(jQuery);var jwplayer=function(a){return jwplayer.constructor(a)};jwplayer.constructor=function(a){};var $jw=jwplayer;jwplayer.version="5.4.1530";(function(b){b.utils=function(){};b.utils.typeOf=function(d){var c=typeof d;if(c==="object"){if(d){if(d instanceof Array){c="array"}}else{c="null"}}return c};b.utils.extend=function(){var c=b.utils.extend["arguments"];if(c.length>1){for(var e=1;e<c.length;e++){for(var d in c[e]){c[0][d]=c[e][d]}}return c[0]}return null};b.utils.clone=function(f){var c;var d=b.utils.clone["arguments"];if(d.length==1){switch(b.utils.typeOf(d[0])){case"object":c={};for(var e in d[0]){c[e]=b.utils.clone(d[0][e])}break;case"array":c=[];for(var e in d[0]){c[e]=b.utils.clone(d[0][e])}break;default:return d[0];break}}return c};b.utils.extension=function(c){c=c.substring(c.lastIndexOf("/")+1,c.length);c=c.split("?")[0];if(c.lastIndexOf(".")>-1){return c.substr(c.lastIndexOf(".")+1,c.length).toLowerCase()}return""};b.utils.html=function(c,d){c.innerHTML=d};b.utils.append=function(c,d){c.appendChild(d)};b.utils.wrap=function(c,d){c.parentNode.replaceChild(d,c);d.appendChild(c)};b.utils.ajax=function(f,e,c){var d;if(window.XMLHttpRequest){d=new XMLHttpRequest()}else{d=new ActiveXObject("Microsoft.XMLHTTP")}d.onreadystatechange=function(){if(d.readyState===4){if(d.status===200){if(e){e(d)}}else{if(c){c(f)}}}};d.open("GET",f,true);d.send(null);return d};b.utils.load=function(d,e,c){d.onreadystatechange=function(){if(d.readyState===4){if(d.status===200){if(e){e()}}else{if(c){c()}}}}};b.utils.find=function(d,c){return d.getElementsByTagName(c)};b.utils.append=function(c,d){c.appendChild(d)};b.utils.isIE=function(){return(!+"\v1")};b.utils.isLegacyAndroid=function(){var c=navigator.userAgent.toLowerCase();return(c.match(/android 2.[012]/i)!==null)};b.utils.isIOS=function(){var c=navigator.userAgent.toLowerCase();return(c.match(/iP(hone|ad)/i)!==null)};b.utils.getFirstPlaylistItemFromConfig=function(c){var d={};var e;if(c.playlist&&c.playlist.length){e=c.playlist[0]}else{e=c}d.file=e.file;d.levels=e.levels;d.streamer=e.streamer;d.playlistfile=e.playlistfile;if(d.file&&d.file.toLowerCase().indexOf("youtube.com")>-1){d.provider="youtube"}if(d.streamer&&d.streamer.toLowerCase().indexOf("rtmp://")==0){d.provider="rtmp"}if(e.type){d.provider=e.type.toLowerCase()}else{if(e.provider){d.provider=e.provider.toLowerCase()}}return d};b.utils.flashSupportsConfig=function(c){if(b.utils.hasFlash()){if(c){var e=b.utils.getFirstPlaylistItemFromConfig(c);if(typeof e.file=="undefined"&&typeof e.levels=="undefined"){return true}else{if(e.file){return b.utils.flashCanPlay(e.file,e.provider)}else{if(e.levels&&e.levels.length){for(var d=0;d<e.levels.length;d++){if(e.levels[d].file&&b.utils.flashCanPlay(e.levels[d].file,e.provider)){return true}}}}}}else{return true}}return false};b.utils.flashCanPlay=function(c,e){var d=["video","http","sound","image"];if(e&&(d.toString().indexOf(e<0))){return true}var f=b.utils.extension(c);if(!f){return true}if(b.utils.extensionmap[f]!==undefined&&b.utils.extensionmap[f].flash===undefined){return false}return true};b.utils.html5SupportsConfig=function(d){var c=document.createElement("video");if(!!c.canPlayType){if(d){var f=b.utils.getFirstPlaylistItemFromConfig(d);if(typeof f.file=="undefined"&&typeof f.levels=="undefined"){return true}else{if(f.file){return b.utils.html5CanPlay(c,f.file,f.provider,f.playlistfile)}else{if(f.levels&&f.levels.length){for(var e=0;e<f.levels.length;e++){if(f.levels[e].file&&b.utils.html5CanPlay(c,f.levels[e].file,f.provider,f.playlistfile)){return true}}}}}}else{return true}}return false};b.utils.html5CanPlay=function(e,d,f,c){if(c){return false}if(f&&f=="youtube"){return true}if(f&&f!="video"&&f!="http"){return false}var g=b.utils.extension(d);if(b.utils.isLegacyAndroid()&&g.match(/m4v|mp4/)){return true}return b.utils.browserCanPlay(e,g)};b.utils.browserCanPlay=function(d,e){var c;if(!e){return true}else{if(b.utils.extensionmap[e]!==undefined&&b.utils.extensionmap[e].html5===undefined){return false}else{if(b.utils.extensionmap[e]!==undefined&&b.utils.extensionmap[e].html5!==undefined){c=b.utils.extensionmap[e].html5}else{c="video/"+e+";"}}}return d.canPlayType(c)};b.utils.downloadSupportsConfig=function(c){if(c){var e=b.utils.getFirstPlaylistItemFromConfig(c);if(typeof e.file=="undefined"&&typeof e.levels=="undefined"){return true}else{if(e.file){return b.utils.canDownload(e.file,e.provider,e.playlistfile)}else{if(e.levels&&e.levels.length){for(var d=0;d<e.levels.length;d++){if(e.levels[d].file&&b.utils.canDownload(e.levels[d].file,e.provider,e.playlistfile)){return true}}}}}}else{return true}};b.utils.canDownload=function(d,f,c){if(c){return false}var e=["image","sound","youtube","http"];if(f&&(e.toString().indexOf(f)>-1)){return true}if(!f||(f&&f=="video")){var g=b.utils.extension(d);if(g&&b.utils.extensionmap[g]){return true}}return false};b.utils.getOuterHTML=function(d){if(d.outerHTML){return d.outerHTML}else{var e=d.parentNode;var c=document.createElement(e.tagName);c.appendChild(d);var f=c.innerHTML;e.appendChild(d);return f}};b.utils.setOuterHTML=function(f,e){if(f.outerHTML){f.outerHTML=e}else{var g=document.createElement("div");g.innerHTML=e;var c=document.createRange();c.selectNodeContents(g);var d=c.extractContents();f.parentNode.insertBefore(d,f);f.parentNode.removeChild(f)}};b.utils.hasFlash=function(){return(typeof navigator.plugins!="undefined"&&typeof navigator.plugins["Shockwave Flash"]!="undefined")||(typeof window.ActiveXObject!="undefined")};b.utils.getPluginName=function(c){if(c.lastIndexOf("/")>=0){c=c.substring(c.lastIndexOf("/")+1,c.length)}if(c.lastIndexOf("-")>=0){c=c.substring(0,c.lastIndexOf("-"))}if(c.lastIndexOf(".swf")>=0){c=c.substring(0,c.lastIndexOf(".swf"))}return c};b.utils.getAbsolutePath=function(j,h){if(h===undefined){h=document.location.href}if(j===undefined){return undefined}if(a(j)){return j}var k=h.substring(0,h.indexOf("://")+3);var g=h.substring(k.length,h.indexOf("/",k.length+1));var d;if(j.indexOf("/")===0){d=j.split("/")}else{var e=h.split("?")[0];e=e.substring(k.length+g.length+1,e.lastIndexOf("/"));d=e.split("/").concat(j.split("/"))}var c=[];for(var f=0;f<d.length;f++){if(!d[f]||d[f]===undefined||d[f]=="."){continue}else{if(d[f]==".."){c.pop()}else{c.push(d[f])}}}return k+g+"/"+c.join("/")};function a(d){if(d===null){return}var e=d.indexOf("://");var c=d.indexOf("?");return(e>0&&(c<0||(c>e)))}b.utils.mapEmpty=function(c){for(var d in c){return false}return true};b.utils.mapLength=function(d){var c=0;for(var e in d){c++}return c};b.utils.log=function(d,c){if(typeof console!="undefined"&&typeof console.log!="undefined"){if(c){console.log(d,c)}else{console.log(d)}}};b.utils.css=function(d,g,c){if(d!==undefined){for(var e in g){try{if(typeof g[e]==="undefined"){continue}else{if(typeof g[e]=="number"&&!(e=="zIndex"||e=="opacity")){if(isNaN(g[e])){continue}if(e.match(/color/i)){g[e]="#"+b.utils.strings.pad(g[e].toString(16),6)}else{g[e]=Math.ceil(g[e])+"px"}}}d.style[e]=g[e]}catch(f){}}}};b.utils.isYouTube=function(c){return c.indexOf("youtube.com")>-1};b.utils.getYouTubeId=function(c){c.indexOf("youtube.com">0)};b.utils.transform=function(c,d){c.style.webkitTransform=d;c.style.MozTransform=d;c.style.OTransform=d};b.utils.stretch=function(h,m,l,f,k,g){if(typeof l=="undefined"||typeof f=="undefined"||typeof k=="undefined"||typeof g=="undefined"){return}var d=l/k;var e=f/g;var j=0;var i=0;m.style.overflow="hidden";b.utils.transform(m,"");var c={};switch(h.toLowerCase()){case b.utils.stretching.NONE:c.width=k;c.height=g;break;case b.utils.stretching.UNIFORM:if(d>e){c.width=k*e;c.height=g*e}else{c.width=k*d;c.height=g*d}break;case b.utils.stretching.FILL:if(d>e){c.width=k*d;c.height=g*d}else{c.width=k*e;c.height=g*e}break;case b.utils.stretching.EXACTFIT:b.utils.transform(m,["scale(",d,",",e,")"," translate(0px,0px)"].join(""));c.width=k;c.height=g;break;default:break}c.top=(f-c.height)/2;c.left=(l-c.width)/2;b.utils.css(m,c)};b.utils.stretching={NONE:"none",FILL:"fill",UNIFORM:"uniform",EXACTFIT:"exactfit"}})(jwplayer);(function(e){e.utils.mediaparser=function(){};var g={element:{width:"width",height:"height",id:"id","class":"className",name:"name"},media:{src:"file",preload:"preload",autoplay:"autostart",loop:"repeat",controls:"controls"},source:{src:"file",type:"type",media:"media","data-jw-width":"width","data-jw-bitrate":"bitrate"},video:{poster:"image"}};var f={};e.utils.mediaparser.parseMedia=function(i){return d(i)};function c(j,i){if(i===undefined){i=g[j]}else{e.utils.extend(i,g[j])}return i}function d(m,i){if(f[m.tagName.toLowerCase()]&&(i===undefined)){return f[m.tagName.toLowerCase()](m)}else{i=c("element",i);var n={};for(var j in i){if(j!="length"){var l=m.getAttribute(j);if(!(l===""||l===undefined||l===null)){n[i[j]]=m.getAttribute(j)}}}var k=m.style["#background-color"];if(k&&!(k=="transparent"||k=="rgba(0, 0, 0, 0)")){n.screencolor=k}return n}}function h(o,k){k=c("media",k);var m=[];if(e.utils.isIE()){var l=o.nextSibling;if(l!==undefined){while(l.tagName.toLowerCase()=="source"){m.push(a(l));l=l.nextSibling}}}else{var j=e.utils.selectors("source",o);for(var n in j){if(!isNaN(n)){m.push(a(j[n]))}}}var p=d(o,k);if(p.file!==undefined){m[0]={file:p.file}}p.levels=m;return p}function a(k,j){j=c("source",j);var i=d(k,j);i.width=i.width?i.width:0;i.bitrate=i.bitrate?i.bitrate:0;return i}function b(k,j){j=c("video",j);var i=h(k,j);return i}e.utils.mediaparser.replaceMediaElement=function(i,k){if(e.utils.isIE()){var l=false;var n=[];var m=i.nextSibling;while(m&&!l){n.push(m);if(m.nodeType==1&&m.tagName.toLowerCase()==("/")+i.tagName.toLowerCase()){l=true}m=m.nextSibling}if(l){while(n.length>0){var j=n.pop();j.parentNode.removeChild(j)}}i.outerHTML=k}};f.media=h;f.audio=h;f.source=a;f.video=b})(jwplayer);(function(a){a.utils.selectors=function(b,d){if(d===undefined){d=document}b=a.utils.strings.trim(b);var c=b.charAt(0);if(c=="#"){return d.getElementById(b.substr(1))}else{if(c=="."){if(d.getElementsByClassName){return d.getElementsByClassName(b.substr(1))}else{return a.utils.selectors.getElementsByTagAndClass("*",b.substr(1))}}else{if(b.indexOf(".")>0){selectors=b.split(".");return a.utils.selectors.getElementsByTagAndClass(selectors[0],selectors[1])}else{return d.getElementsByTagName(b)}}}return null};a.utils.selectors.getElementsByTagAndClass=function(e,h,g){elements=[];if(g===undefined){g=document}var f=g.getElementsByTagName(e);for(var d=0;d<f.length;d++){if(f[d].className!==undefined){var c=f[d].className.split(" ");for(var b=0;b<c.length;b++){if(c[b]==h){elements.push(f[d])}}}}return elements}})(jwplayer);(function(a){a.utils.strings=function(){};a.utils.strings.trim=function(b){return b.replace(/^\s*/,"").replace(/\s*$/,"")};a.utils.strings.pad=function(c,d,b){if(!b){b="0"}while(c.length<d){c=b+c}return c}})(jwplayer);(function(c){var d=new RegExp(/^(#|0x)[0-9a-fA-F]{3,6}/);c.utils.typechecker=function(g,f){f=f===null?b(g):f;return e(g,f)};function b(f){var g=["true","false","t","f"];if(g.toString().indexOf(f.toLowerCase().replace(" ",""))>=0){return"boolean"}else{if(d.test(f)){return"color"}else{if(!isNaN(parseInt(f,10))&&parseInt(f,10).toString().length==f.length){return"integer"}else{if(!isNaN(parseFloat(f))&&parseFloat(f).toString().length==f.length){return"float"}}}}return"string"}function e(g,f){if(f===null){return g}switch(f){case"color":if(g.length>0){return a(g)}return null;case"integer":return parseInt(g,10);case"float":return parseFloat(g);case"boolean":if(g.toLowerCase()=="true"){return true}else{if(g=="1"){return true}}return false}return g}function a(f){switch(f.toLowerCase()){case"blue":return parseInt("0000FF",16);case"green":return parseInt("00FF00",16);case"red":return parseInt("FF0000",16);case"cyan":return parseInt("00FFFF",16);case"magenta":return parseInt("FF00FF",16);case"yellow":return parseInt("FFFF00",16);case"black":return parseInt("000000",16);case"white":return parseInt("FFFFFF",16);default:f=f.replace(/(#|0x)?([0-9A-F]{3,6})$/gi,"$2");if(f.length==3){f=f.charAt(0)+f.charAt(0)+f.charAt(1)+f.charAt(1)+f.charAt(2)+f.charAt(2)}return parseInt(f,16)}return parseInt("000000",16)}})(jwplayer);(function(a){var b={};a.utils.animations=function(){};a.utils.animations.transform=function(c,d){c.style.webkitTransform=d;c.style.MozTransform=d;c.style.OTransform=d};a.utils.animations.transformOrigin=function(c,d){c.style.webkitTransformOrigin=d;c.style.MozTransformOrigin=d;c.style.OTransformOrigin=d};a.utils.animations.rotate=function(c,d){a.utils.animations.transform(c,["rotate(",d,"deg)"].join(""))};a.utils.cancelAnimation=function(c){delete b[c.id]};a.utils.fadeTo=function(l,f,e,i,h,d){if(b[l.id]!=d&&d!==undefined){return}var c=new Date().getTime();if(d>c){setTimeout(function(){a.utils.fadeTo(l,f,e,i,0,d)},d-c)}l.style.display="block";if(i===undefined){i=l.style.opacity===""?1:l.style.opacity}if(l.style.opacity==f&&l.style.opacity!==""&&d!==undefined){if(f===0){l.style.display="none"}return}if(d===undefined){d=c;b[l.id]=d}if(h===undefined){h=0}var j=(c-d)/(e*1000);j=j>1?1:j;var k=f-i;var g=i+(j*k);if(g>1){g=1}else{if(g<0){g=0}}l.style.opacity=g;if(h>0){b[l.id]=d+h*1000;a.utils.fadeTo(l,f,e,i,0,b[l.id]);return}setTimeout(function(){a.utils.fadeTo(l,f,e,i,0,d)},10)}})(jwplayer);(function(a){a.utils.extensionmap={"3gp":{html5:"video/3gpp",flash:"video"},"3gpp":{html5:"video/3gpp"},"3g2":{html5:"video/3gpp2",flash:"video"},"3gpp2":{html5:"video/3gpp2"},flv:{flash:"video"},f4a:{html5:"audio/mp4"},f4b:{html5:"audio/mp4",flash:"video"},f4p:{html5:"video/mp4",flash:"video"},f4v:{html5:"video/mp4",flash:"video"},mov:{html5:"video/quicktime",flash:"video"},m4a:{html5:"audio/mp4",flash:"video"},m4b:{html5:"audio/mp4"},m4p:{html5:"audio/mp4"},m4v:{html5:"video/mp4",flash:"video"},mkv:{html5:"video/x-matroska"},mp4:{html5:"video/mp4",flash:"video"},rbs:{flash:"sound"},sdp:{html5:"application/sdp",flash:"video"},vp6:{html5:"video/x-vp6"},aac:{html5:"audio/aac",flash:"video"},mp3:{flash:"sound"},ogg:{html5:"audio/ogg"},ogv:{html5:"video/ogg"},webm:{html5:"video/webm"},m3u8:{html5:"audio/x-mpegurl"},gif:{flash:"image"},jpeg:{flash:"image"},jpg:{flash:"image"},swf:{flash:"image"},png:{flash:"image"}}})(jwplayer);(function(b){var a=[];b.constructor=function(c){return b.api.selectPlayer(c)};b.api=function(){};b.api.events={API_READY:"jwplayerAPIReady",JWPLAYER_READY:"jwplayerReady",JWPLAYER_FULLSCREEN:"jwplayerFullscreen",JWPLAYER_RESIZE:"jwplayerResize",JWPLAYER_ERROR:"jwplayerError",JWPLAYER_MEDIA_BUFFER:"jwplayerMediaBuffer",JWPLAYER_MEDIA_BUFFER_FULL:"jwplayerMediaBufferFull",JWPLAYER_MEDIA_ERROR:"jwplayerMediaError",JWPLAYER_MEDIA_LOADED:"jwplayerMediaLoaded",JWPLAYER_MEDIA_COMPLETE:"jwplayerMediaComplete",JWPLAYER_MEDIA_TIME:"jwplayerMediaTime",JWPLAYER_MEDIA_VOLUME:"jwplayerMediaVolume",JWPLAYER_MEDIA_META:"jwplayerMediaMeta",JWPLAYER_MEDIA_MUTE:"jwplayerMediaMute",JWPLAYER_PLAYER_STATE:"jwplayerPlayerState",JWPLAYER_PLAYLIST_LOADED:"jwplayerPlaylistLoaded",JWPLAYER_PLAYLIST_ITEM:"jwplayerPlaylistItem"};b.api.events.state={BUFFERING:"BUFFERING",IDLE:"IDLE",PAUSED:"PAUSED",PLAYING:"PLAYING"};b.api.PlayerAPI=function(d){this.container=d;this.id=d.id;var j={};var o={};var c=[];var g=undefined;var i=false;var h=[];var m=b.utils.getOuterHTML(d);var n={};var k=0;this.setPlayer=function(p){g=p};this.stateListener=function(p,q){if(!o[p]){o[p]=[];this.eventListener(b.api.events.JWPLAYER_PLAYER_STATE,f(p))}o[p].push(q);return this};function f(p){return function(r){var q=r.newstate,t=r.oldstate;if(q==p){var s=o[q];if(s){for(var u=0;u<s.length;u++){if(typeof s[u]=="function"){s[u].call(this,{oldstate:t,newstate:q})}}}}}}this.addInternalListener=function(p,q){p.jwAddEventListener(q,'function(dat) { jwplayer("'+this.id+'").dispatchEvent("'+q+'", dat); }')};this.eventListener=function(p,q){if(!j[p]){j[p]=[];if(g&&i){this.addInternalListener(g,p)}}j[p].push(q);return this};this.dispatchEvent=function(r){if(j[r]){var q=e(r,arguments[1]);for(var p=0;p<j[r].length;p++){if(typeof j[r][p]=="function"){j[r][p].call(this,q)}}}};function e(r,p){var t=b.utils.extend({},p);if(r==b.api.events.JWPLAYER_FULLSCREEN&&!t.fullscreen){t.fullscreen=t.message=="true"?true:false;delete t.message}else{if(typeof t.data=="object"){t=b.utils.extend(t,t.data);delete t.data}}var q=["position","duration","offset"];for(var s in q){if(t[q[s]]){t[q[s]]=Math.round(t[q[s]]*1000)/1000}}return t}this.callInternal=function(q,p){if(i){if(typeof g!="undefined"&&typeof g[q]=="function"){if(p!==undefined){return(g[q])(p)}else{return(g[q])()}}return null}else{h.push({method:q,parameters:p})}};this.playerReady=function(r){i=true;if(!g){this.setPlayer(document.getElementById(r.id))}this.container=document.getElementById(this.id);for(var p in j){this.addInternalListener(g,p)}this.eventListener(b.api.events.JWPLAYER_PLAYLIST_ITEM,function(s){if(s.index!==undefined){k=s.index}n={}});this.eventListener(b.api.events.JWPLAYER_MEDIA_META,function(s){b.utils.extend(n,s.metadata)});this.dispatchEvent(b.api.events.API_READY);while(h.length>0){var q=h.shift();this.callInternal(q.method,q.parameters)}};this.getItemMeta=function(){return n};this.getCurrentItem=function(){return k};this.destroy=function(){j={};h=[];if(b.utils.getOuterHTML(this.container)!=m){b.api.destroyPlayer(this.id,m)}};function l(r,t,s){var p=[];if(!t){t=0}if(!s){s=r.length-1}for(var q=t;q<=s;q++){p.push(r[q])}return p}};b.api.PlayerAPI.prototype={container:undefined,options:undefined,id:undefined,getBuffer:function(){return this.callInternal("jwGetBuffer")},getDuration:function(){return this.callInternal("jwGetDuration")},getFullscreen:function(){return this.callInternal("jwGetFullscreen")},getHeight:function(){return this.callInternal("jwGetHeight")},getLockState:function(){return this.callInternal("jwGetLockState")},getMeta:function(){return this.getItemMeta()},getMute:function(){return this.callInternal("jwGetMute")},getPlaylist:function(){var d=this.callInternal("jwGetPlaylist");for(var c=0;c<d.length;c++){if(d[c].index===undefined){d[c].index=c}}return d},getPlaylistItem:function(c){if(c===undefined){c=this.getCurrentItem()}return this.getPlaylist()[c]},getPosition:function(){return this.callInternal("jwGetPosition")},getState:function(){return this.callInternal("jwGetState")},getVolume:function(){return this.callInternal("jwGetVolume")},getWidth:function(){return this.callInternal("jwGetWidth")},setFullscreen:function(c){if(c===undefined){this.callInternal("jwSetFullscreen",!this.callInternal("jwGetFullscreen"))}else{this.callInternal("jwSetFullscreen",c)}return this},setMute:function(c){if(c===undefined){this.callInternal("jwSetMute",!this.callInternal("jwGetMute"))}else{this.callInternal("jwSetMute",c)}return this},lock:function(){return this},unlock:function(){return this},load:function(c){this.callInternal("jwLoad",c);return this},playlistItem:function(c){this.callInternal("jwPlaylistItem",c);return this},playlistPrev:function(){this.callInternal("jwPlaylistPrev");return this},playlistNext:function(){this.callInternal("jwPlaylistNext");return this},resize:function(d,c){this.container.width=d;this.container.height=c;return this},play:function(c){if(typeof c=="undefined"){c=this.getState();if(c==b.api.events.state.PLAYING||c==b.api.events.state.BUFFERING){this.callInternal("jwPause")}else{this.callInternal("jwPlay")}}else{this.callInternal("jwPlay",c)}return this},pause:function(c){if(typeof c=="undefined"){c=this.getState();if(c==b.api.events.state.PLAYING||c==b.api.events.state.BUFFERING){this.callInternal("jwPause")}else{this.callInternal("jwPlay")}}else{this.callInternal("jwPause",c)}return this},stop:function(){this.callInternal("jwStop");return this},seek:function(c){this.callInternal("jwSeek",c);return this},setVolume:function(c){this.callInternal("jwSetVolume",c);return this},onBufferChange:function(c){return this.eventListener(b.api.events.JWPLAYER_MEDIA_BUFFER,c)},onBufferFull:function(c){return this.eventListener(b.api.events.JWPLAYER_MEDIA_BUFFER_FULL,c)},onError:function(c){return this.eventListener(b.api.events.JWPLAYER_ERROR,c)},onFullscreen:function(c){return this.eventListener(b.api.events.JWPLAYER_FULLSCREEN,c)},onMeta:function(c){return this.eventListener(b.api.events.JWPLAYER_MEDIA_META,c)},onMute:function(c){return this.eventListener(b.api.events.JWPLAYER_MEDIA_MUTE,c)},onPlaylist:function(c){return this.eventListener(b.api.events.JWPLAYER_PLAYLIST_LOADED,c)},onPlaylistItem:function(c){return this.eventListener(b.api.events.JWPLAYER_PLAYLIST_ITEM,c)},onReady:function(c){return this.eventListener(b.api.events.API_READY,c)},onResize:function(c){return this.eventListener(b.api.events.JWPLAYER_RESIZE,c)},onComplete:function(c){return this.eventListener(b.api.events.JWPLAYER_MEDIA_COMPLETE,c)},onTime:function(c){return this.eventListener(b.api.events.JWPLAYER_MEDIA_TIME,c)},onVolume:function(c){return this.eventListener(b.api.events.JWPLAYER_MEDIA_VOLUME,c)},onBuffer:function(c){return this.stateListener(b.api.events.state.BUFFERING,c)},onPause:function(c){return this.stateListener(b.api.events.state.PAUSED,c)},onPlay:function(c){return this.stateListener(b.api.events.state.PLAYING,c)},onIdle:function(c){return this.stateListener(b.api.events.state.IDLE,c)},setup:function(c){return this},remove:function(){this.destroy()},initializePlugin:function(c,d){return this}};b.api.selectPlayer=function(d){var c;if(d===undefined){d=0}if(d.nodeType){c=d}else{if(typeof d=="string"){c=document.getElementById(d)}}if(c){var e=b.api.playerById(c.id);if(e){return e}else{return b.api.addPlayer(new b.api.PlayerAPI(c))}}else{if(typeof d=="number"){return b.getPlayers()[d]}}return null};b.api.playerById=function(d){for(var c=0;c<a.length;c++){if(a[c].id==d){return a[c]}}return null};b.api.addPlayer=function(c){for(var d=0;d<a.length;d++){if(a[d]==c){return c}}a.push(c);return c};b.api.destroyPlayer=function(f,d){var e=-1;for(var h=0;h<a.length;h++){if(a[h].id==f){e=h;continue}}if(e>=0){var c=document.getElementById(a[e].id);if(c){if(d){b.utils.setOuterHTML(c,d)}else{var g=document.createElement("div");g.setAttribute("id",c.id);c.parentNode.replaceChild(g,c)}}a.splice(e,1)}return null};b.getPlayers=function(){return a.slice(0)}})(jwplayer);var _userPlayerReady=(typeof playerReady=="function")?playerReady:undefined;playerReady=function(b){var a=jwplayer.api.playerById(b.id);if(a){a.playerReady(b)}if(_userPlayerReady){_userPlayerReady.call(this,b)}};(function(a){a.embed=function(){};a.embed.Embedder=function(d){this.constructor(d)};function c(){return[{type:"flash",src:"player.swf"},{type:"html5"},{type:"download"}]}a.embed.defaults={width:400,height:300,players:c(),components:{controlbar:{position:"over"}}};a.embed.Embedder.prototype={config:undefined,api:undefined,events:{},players:undefined,constructor:function(e){this.api=e;var d=a.utils.mediaparser.parseMedia(this.api.container);this.config=this.parseConfig(a.utils.extend({},a.embed.defaults,d,this.api.config))},embedPlayer:function(){var e=this.players[0];if(e&&e.type){switch(e.type){case"flash":if(a.utils.flashSupportsConfig(this.config)){if(this.config.file&&!this.config.provider){switch(a.utils.extension(this.config.file).toLowerCase()){case"webm":case"ogv":case"ogg":this.config.provider="video";break}}if(this.config.levels||this.config.playlist){this.api.onReady(this.loadAfterReady(this.config))}this.config.id=this.api.id;var j=a.embed.embedFlash(document.getElementById(this.api.id),e,this.config);this.api.container=j;this.api.setPlayer(j)}else{this.players.splice(0,1);return this.embedPlayer()}break;case"html5":if(a.utils.html5SupportsConfig(this.config)){var g=a.embed.embedHTML5(document.getElementById(this.api.id),e,this.config);this.api.container=document.getElementById(this.api.id);this.api.setPlayer(g)}else{this.players.splice(0,1);return this.embedPlayer()}break;case"download":if(a.utils.downloadSupportsConfig(this.config)){var f=a.utils.getFirstPlaylistItemFromConfig(this.config);var d=a.embed.embedDownloadLink(document.getElementById(this.api.id),e,this.config);this.api.container=document.getElementById(this.api.id);this.api.setPlayer(d)}else{this.players.splice(0,1);return this.embedPlayer()}break}}else{var i=document.createElement("div");this.api.container.appendChild(i);i.style.position="relative";var h=document.createElement("p");i.appendChild(h);h.innerHTML="No suitable players found";a.embed.embedLogo(a.utils.extend({position:"bottom-right",margin:0},this.config.components.logo),"none",i,this.api.id)}this.setupEvents();return this.api},setupEvents:function(){for(var d in this.events){if(typeof this.api[d]=="function"){(this.api[d]).call(this.api,this.events[d])}}},loadAfterReady:function(d){return function(f){if(d.playlist){this.load(d.playlist)}else{if(d.levels){var e=this.getPlaylistItem(0);if(!e){e=d}if(!e.image){e.image=d.image}if(!e.levels){e.levels=d.levels}this.load(e)}}}},parseConfig:function(d){var h=a.utils.extend({},d);for(var e in h){if(e.indexOf(".")>-1){var g=e.split(".");for(var f in g){if(f==g.length-1){d[g[f]]=h[e]}else{if(d[g[f]]===undefined){d[g[f]]={}}d=d[g[f]]}}}}if(typeof h.playlist=="string"){if(!h.components.playlist){h.components.playlist={}}h.components.playlist.position=h.playlist;delete h.playlist}if(typeof h.controlbar=="string"){if(!h.components.controlbar){h.components.controlbar={}}h.components.controlbar.position=h.controlbar;delete h.controlbar}if(h.events){this.events=h.events;delete h.events}if(h.players){this.players=h.players;delete h.players}if(h.plugins){if(typeof h.plugins=="object"){h=a.utils.extend(h,a.embed.parsePlugins(h.plugins))}}if(h.components){if(typeof h.plugins=="object"){h=a.utils.extend(h,a.embed.parseComponents(h.components))}}return h}};a.embed.embedFlash=function(f,h,k){var g=a.utils.extend({},k);var d=g.width;delete g.width;var l=g.height;delete g.height;delete g.levels;delete g.playlist;var e="opaque";if(g.wmode){e=g.wmode}a.embed.parseConfigBlock(g,"components");a.embed.parseConfigBlock(g,"providers");if(a.utils.isIE()){var j='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+d+'" height="'+l+'" id="'+f.id+'" name="'+f.id+'">';j+='<param name="movie" value="'+h.src+'">';j+='<param name="allowfullscreen" value="true">';j+='<param name="allowscriptaccess" value="always">';j+='<param name="wmode" value="'+e+'">';j+='<param name="flashvars" value="'+a.embed.jsonToFlashvars(g)+'">';j+="</object>";if(f.tagName.toLowerCase()=="video"){a.utils.mediaparser.replaceMediaElement(f,j)}else{f.outerHTML=j}return document.getElementById(f.id)}else{var i=document.createElement("object");i.setAttribute("type","application/x-shockwave-flash");i.setAttribute("data",h.src);i.setAttribute("width",d);i.setAttribute("height",l);i.setAttribute("id",f.id);i.setAttribute("name",f.id);a.embed.appendAttribute(i,"allowfullscreen","true");a.embed.appendAttribute(i,"allowscriptaccess","always");a.embed.appendAttribute(i,"wmode",e);a.embed.appendAttribute(i,"flashvars",a.embed.jsonToFlashvars(g));f.parentNode.replaceChild(i,f);return i}};a.embed.embedHTML5=function(e,g,f){if(a.html5){e.innerHTML="";var d=a.utils.extend({screencolor:"0x000000"},f);a.embed.parseConfigBlock(d,"components");if(d.levels&&!d.sources){d.sources=f.levels}if(d.skin&&d.skin.toLowerCase().indexOf(".zip")>0){d.skin=d.skin.replace(/\.zip/i,".xml")}return new(a.html5(e)).setup(d)}else{return null}};a.embed.embedLogo=function(o,n,e,g){var l={prefix:"http://l.longtailvideo.com/"+n+"/",file:"logo.png",link:"http://www.longtailvideo.com/players/jw-flv-player/",margin:8,out:0.5,over:1,timeout:3,hide:false,position:"bottom-left"};_css=a.utils.css;var d;var k;m();function m(){q();f();i()}function q(){if(l.prefix){var s=a.version.split(/\W/).splice(0,2).join("/");if(l.prefix.indexOf(s)<0){l.prefix+=s+"/"}}k=a.utils.extend({},l)}function r(){var u={border:"none",textDecoration:"none",position:"absolute",cursor:"pointer",zIndex:10};u.display=k.hide?"none":"block";var t=k.position.toLowerCase().split("-");for(var s in t){u[t[s]]=k.margin}return u}function f(){d=document.createElement("img");d.id=g+"_jwplayer_logo";d.style.display="none";d.onload=function(s){_css(d,r());h()};if(!k.file){return}if(k.file.indexOf("http://")===0){d.src=k.file}else{d.src=k.prefix+k.file}}if(!k.file){return}function i(){if(k.link){d.onmouseover=j;d.onmouseout=h;d.onclick=p}else{this.mouseEnabled=false}}function p(s){if(typeof s!="undefined"){s.preventDefault();s.stopPropagation()}if(k.link){window.open(k.link,"_blank")}return}function h(s){if(k.link){d.style.opacity=k.out}return}function j(s){if(k.hide){d.style.opacity=k.over}return}e.appendChild(d)};a.embed.embedDownloadLink=function(e,h,o){var g=a.utils.extend({},o);var n={};var f=o.width?o.width:480;if(typeof f!="number"){f=parseInt(f,10)}var k=o.height?o.height:320;if(typeof k!="number"){k=parseInt(k,10)}var q,l,j;var p={};if(o.playlist&&o.playlist.length){p.file=o.playlist[0].file;l=o.playlist[0].image;p.levels=o.playlist[0].levels}else{p.file=o.file;l=o.image;p.levels=o.levels}if(p.file){q=p.file}else{if(p.levels&&p.levels.length){q=p.levels[0].file}}j=q?"pointer":"auto";var i={display:{style:{cursor:j,width:f,height:k,backgroundColor:"#000",position:"relative",textDecoration:"none",border:"none",display:"block"}},display_icon:{style:{cursor:j,position:"absolute",display:q?"block":"none",top:0,left:0,border:0,margin:0,padding:0,zIndex:3,width:50,height:50,backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALdJREFUeNrs18ENgjAYhmFouDOCcQJGcARHgE10BDcgTOIosAGwQOuPwaQeuFRi2p/3Sb6EC5L3QCxZBgAAAOCorLW1zMn65TrlkH4NcV7QNcUQt7Gn7KIhxA+qNIR81spOGkL8oFJDyLJRdosqKDDkK+iX5+d7huzwM40xptMQMkjIOeRGo+VkEVvIPfTGIpKASfYIfT9iCHkHrBEzf4gcUQ56aEzuGK/mw0rHpy4AAACAf3kJMACBxjAQNRckhwAAAABJRU5ErkJggg==)"}},display_iconBackground:{style:{cursor:j,position:"absolute",display:q?"block":"none",top:((k-50)/2),left:((f-50)/2),border:0,width:50,height:50,margin:0,padding:0,zIndex:2,backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEpJREFUeNrszwENADAIA7DhX8ENoBMZ5KR10EryckCJiIiIiIiIiIiIiIiIiIiIiIh8GmkRERERERERERERERERERERERGRHSPAAPlXH1phYpYaAAAAAElFTkSuQmCC)"}},display_image:{style:{width:f,height:k,display:l?"block":"none",position:"absolute",cursor:j,left:0,top:0,margin:0,padding:0,textDecoration:"none",zIndex:1,border:"none"}}};var d=function(r,t,u){var s=document.createElement(r);if(u){s.id=u}else{s.id=e.id+"_jwplayer_"+t}a.utils.css(s,i[t].style);return s};n.display=d("a","display",e.id);if(q){n.display.setAttribute("href",a.utils.getAbsolutePath(q))}n.display_image=d("img","display_image");n.display_image.setAttribute("alt","Click to download...");if(l){n.display_image.setAttribute("src",a.utils.getAbsolutePath(l))}if(true){n.display_icon=d("div","display_icon");n.display_iconBackground=d("div","display_iconBackground");n.display.appendChild(n.display_image);n.display_iconBackground.appendChild(n.display_icon);n.display.appendChild(n.display_iconBackground)}e.parentNode.replaceChild(n.display,e);var m=(o.plugins&&o.plugins.logo)?o.plugins.logo:{};a.embed.embedLogo(o.components.logo,"download",n.display,e.id);return n.display};a.embed.appendAttribute=function(e,d,f){var g=document.createElement("param");g.setAttribute("name",d);g.setAttribute("value",f);e.appendChild(g)};a.embed.jsonToFlashvars=function(f){var d=f.netstreambasepath?"":"netstreambasepath="+escape(window.location.href)+"&";for(var e in f){d+=e+"="+escape(f[e])+"&"}return d.substring(0,d.length-1)};a.embed.parsePlugins=function(g){if(!g){return{}}var j={},i=[];for(var d in g){var f=a.utils.getPluginName(d);var e=g[d];i.push(d);for(var h in e){j[f+"."+h]=e[h]}}j.plugins=i.join(",");return j};a.embed.parseComponents=function(f){if(!f){return{}}var h={};for(var e in f){var d=f[e];for(var g in d){h[e+"."+g]=d[g]}}return h};a.embed.parseConfigBlock=function(g,f){if(g[f]){var i=g[f];for(var e in i){var d=i[e];if(typeof d=="string"){if(!g[e]){g[e]=d}}else{for(var h in d){if(!g[e+"."+h]){g[e+"."+h]=d[h]}}}}delete g[f]}};a.api.PlayerAPI.prototype.setup=function(e,f){if(e&&e.flashplayer&&!e.players){e.players=c();e.players[0].src=e.flashplayer;delete e.flashplayer}if(f&&!e.players){if(typeof f=="string"){e.players=c();e.players[0].src=f}else{if(f instanceof Array){e.players=f}else{if(typeof f=="object"&&f.type){e.players=[f]}}}}var d=this.id;this.remove();var g=a(d);g.config=e;return(new a.embed.Embedder(g)).embedPlayer()};function b(){if(!document.body){return setTimeout(b,15)}var d=a.utils.selectors.getElementsByTagAndClass("video","jwplayer");for(var e=0;e<d.length;e++){var f=d[e];a(f.id).setup({players:[{type:"flash",src:"/jwplayer/player.swf"},{type:"html5"}]})}}b()})(jwplayer);(function(a){a.html5=function(b){var c=b;this.setup=function(d){a.utils.extend(this,new a.html5.api(c,d));return this};return this}})(jwplayer);(function(b){var c=b.utils.css;b.html5.view=function(q,o,e){var t=q;var l=o;var w=e;var v;var f;var A;var r;var B;var n;function y(){v=document.createElement("div");v.id=l.id;v.className=l.className;l.id=v.id+"_video";c(v,{position:"relative",height:w.height,width:w.width,padding:0,backgroundColor:C(),zIndex:0});function C(){if(t.skin.getComponentSettings("display")&&t.skin.getComponentSettings("display").backgroundcolor){return t.skin.getComponentSettings("display").backgroundcolor}return parseInt("000000",16)}c(l,{position:"absolute",width:w.width,height:w.height,top:0,left:0,zIndex:1,margin:"auto",display:"block"});b.utils.wrap(l,v);r=document.createElement("div");r.id=v.id+"_displayarea";v.appendChild(r)}function j(){for(var C=0;C<w.plugins.order.length;C++){var D=w.plugins.order[C];if(w.plugins.object[D].getDisplayElement!==undefined){w.plugins.object[D].height=h(w.plugins.object[D].getDisplayElement().style.height);w.plugins.object[D].width=h(w.plugins.object[D].getDisplayElement().style.width);w.plugins.config[D].currentPosition=w.plugins.config[D].position}}u()}function u(D){if(w.getMedia()!==undefined){for(var C=0;C<w.plugins.order.length;C++){var E=w.plugins.order[C];if(w.plugins.object[E].getDisplayElement!==undefined){if(w.getMedia().hasChrome()){w.plugins.config[E].currentPosition=b.html5.view.positions.NONE}else{w.plugins.config[E].currentPosition=w.plugins.config[E].position}}}}i(w.width,w.height)}function h(C){if(typeof C=="string"){if(C===""){return 0}else{if(C.lastIndexOf("%")>-1){return C}else{return parseInt(C.replace("px",""),10)}}}return C}function p(){n=setInterval(function(){if((typeof w.width=="string"&&w.width.lastIndexOf("%")>-1)||(typeof w.height=="string"&&w.height.lastIndexOf("%")>-1)){return}if(v.width&&v.height&&(w.width!==h(v.width)||w.height!==h(v.height))){i(h(v.width),h(v.height))}else{var C=v.getBoundingClientRect();if(w.width!==C.width||w.height!==C.height){i(C.width,C.height)}delete C}},100)}this.setup=function(C){l=C;y();j();t.jwAddEventListener(b.api.events.JWPLAYER_MEDIA_LOADED,u);t.jwAddEventListener(b.api.events.JWPLAYER_MEDIA_META,function(){x()});p();var D;if(window.onresize!==null){D=window.onresize}window.onresize=function(E){if(D!==undefined){try{D(E)}catch(G){}}if(t.jwGetFullscreen()){var F=document.body.getBoundingClientRect();w.width=Math.abs(F.left)+Math.abs(F.right);w.height=window.innerHeight}i(w.width,w.height)}};function g(C){switch(C.keyCode){case 27:if(t.jwGetFullscreen()){t.jwSetFullscreen(false)}break;case 32:if(t.jwGetState()!=b.api.events.state.IDLE&&t.jwGetState()!=b.api.events.state.PAUSED){t.jwPause()}else{t.jwPlay()}break}}function i(F,C){if(v.style.display=="none"){return}var E=[].concat(w.plugins.order);E.reverse();B=E.length+2;if(!w.fullscreen){w.width=F;w.height=C;f=F;A=C;c(r,{top:0,bottom:0,left:0,right:0,width:F,height:C});c(v,{height:A,width:f});var D=m(s,E);if(D.length>0){B+=D.length;m(k,D,true)}}else{m(z,E,true)}x()}function m(H,E,F){var D=[];for(var C=0;C<E.length;C++){var I=E[C];if(w.plugins.object[I].getDisplayElement!==undefined){if(w.plugins.config[I].currentPosition.toUpperCase()!==b.html5.view.positions.NONE){var G=H(I,B--);if(!G){D.push(I)}else{w.plugins.object[I].resize(G.width,G.height);if(F){delete G.width;delete G.height}c(w.plugins.object[I].getDisplayElement(),G)}}else{c(w.plugins.object[I].getDisplayElement(),{display:"none"})}}}return D}function s(D,E){if(w.plugins.object[D].getDisplayElement!==undefined){if(a(w.plugins.config[D].position)){if(w.plugins.object[D].getDisplayElement().parentNode===null){v.appendChild(w.plugins.object[D].getDisplayElement())}var C=d(D);C.zIndex=E;return C}}return false}function k(E,F){if(w.plugins.object[E].getDisplayElement().parentNode===null){r.appendChild(w.plugins.object[E].getDisplayElement())}var C=w.width,D=w.height;if(typeof w.width=="string"&&w.width.lastIndexOf("%")>-1){percentage=parseFloat(w.width.substring(0,w.width.lastIndexOf("%")))/100;C=Math.round(window.innerWidth*percentage)}if(typeof w.height=="string"&&w.height.lastIndexOf("%")>-1){percentage=parseFloat(w.height.substring(0,w.height.lastIndexOf("%")))/100;D=Math.round(window.innerHeight*percentage)}return{position:"absolute",width:(C-h(r.style.left)-h(r.style.right)),height:(D-h(r.style.top)-h(r.style.bottom)),zIndex:F}}function z(C,D){return{position:"fixed",width:w.width,height:w.height,zIndex:D}}function x(){r.style.position="absolute";w.getMedia().getDisplayElement().style.position="absolute";if(w.getMedia().getDisplayElement().videoWidth==0||w.getMedia().getDisplayElement().videoHeight==0){return}var C,E;if(r.style.width.toString().lastIndexOf("%")>-1||r.style.width.toString().lastIndexOf("%")>-1){var D=r.getBoundingClientRect();C=Math.abs(D.left)+Math.abs(D.right);E=Math.abs(D.top)+Math.abs(D.bottom)}else{C=h(r.style.width);E=h(r.style.height)}b.utils.stretch(t.jwGetStretching(),w.getMedia().getDisplayElement(),C,E,w.getMedia().getDisplayElement().videoWidth,w.getMedia().getDisplayElement().videoHeight)}function d(D){var E={position:"absolute",margin:0,padding:0,top:null};var C=w.plugins.config[D].currentPosition.toLowerCase();switch(C.toUpperCase()){case b.html5.view.positions.TOP:E.top=h(r.style.top);E.left=h(r.style.left);E.width=f-h(r.style.left)-h(r.style.right);E.height=w.plugins.object[D].height;r.style[C]=h(r.style[C])+w.plugins.object[D].height+"px";r.style.height=h(r.style.height)-E.height+"px";break;case b.html5.view.positions.RIGHT:E.top=h(r.style.top);E.right=h(r.style.right);E.width=E.width=w.plugins.object[D].width;E.height=A-h(r.style.top)-h(r.style.bottom);r.style[C]=h(r.style[C])+w.plugins.object[D].width+"px";r.style.width=h(r.style.width)-E.width+"px";break;case b.html5.view.positions.BOTTOM:E.bottom=h(r.style.bottom);E.left=h(r.style.left);E.width=f-h(r.style.left)-h(r.style.right);E.height=w.plugins.object[D].height;r.style[C]=h(r.style[C])+w.plugins.object[D].height+"px";r.style.height=h(r.style.height)-E.height+"px";break;case b.html5.view.positions.LEFT:E.top=h(r.style.top);E.left=h(r.style.left);E.width=w.plugins.object[D].width;E.height=A-h(r.style.top)-h(r.style.bottom);r.style[C]=h(r.style[C])+w.plugins.object[D].width+"px";r.style.width=h(r.style.width)-E.width+"px";break;default:break}return E}this.resize=i;this.fullscreen=function(E){if(navigator.vendor.indexOf("Apple")===0){if(w.getMedia().getDisplayElement().webkitSupportsFullscreen){if(E){w.fullscreen=false;w.getMedia().getDisplayElement().webkitEnterFullscreen()}else{w.getMedia().getDisplayElement().webkitExitFullscreen()}}else{w.fullscreen=false}}else{if(E){document.onkeydown=g;clearInterval(n);var D=document.body.getBoundingClientRect();w.width=Math.abs(D.left)+Math.abs(D.right);w.height=window.innerHeight;var C={position:"fixed",width:"100%",height:"100%",top:0,left:0,zIndex:2147483000};c(v,C);C.zIndex=1;c(w.getMedia().getDisplayElement(),C);C.zIndex=2;c(r,C)}else{document.onkeydown="";p();w.width=f;w.height=A;c(v,{position:"relative",height:w.height,width:w.width,zIndex:0})}i(w.width,w.height)}}};function a(d){return([b.html5.view.positions.TOP,b.html5.view.positions.RIGHT,b.html5.view.positions.BOTTOM,b.html5.view.positions.LEFT].toString().indexOf(d.toUpperCase())>-1)}b.html5.view.positions={TOP:"TOP",RIGHT:"RIGHT",BOTTOM:"BOTTOM",LEFT:"LEFT",OVER:"OVER",NONE:"NONE"}})(jwplayer);(function(a){var b={backgroundcolor:"",margin:10,font:"Arial,sans-serif",fontsize:10,fontcolor:parseInt("000000",16),fontstyle:"normal",fontweight:"bold",buttoncolor:parseInt("ffffff",16),position:a.html5.view.positions.BOTTOM,idlehide:false,layout:{left:{position:"left",elements:[{name:"play",type:"button"},{name:"divider",type:"divider"},{name:"prev",type:"button"},{name:"divider",type:"divider"},{name:"next",type:"button"},{name:"divider",type:"divider"},{name:"elapsed",type:"text"}]},center:{position:"center",elements:[{name:"time",type:"slider"}]},right:{position:"right",elements:[{name:"duration",type:"text"},{name:"blank",type:"button"},{name:"divider",type:"divider"},{name:"mute",type:"button"},{name:"volume",type:"slider"},{name:"divider",type:"divider"},{name:"fullscreen",type:"button"}]}}};_css=a.utils.css;_hide=function(c){_css(c,{display:"none"})};_show=function(c){_css(c,{display:"block"})};a.html5.controlbar=function(j,L){var i=j;var A=a.utils.extend({},b,i.skin.getComponentSettings("controlbar"),L);if(a.utils.mapLength(i.skin.getComponentLayout("controlbar"))>0){A.layout=i.skin.getComponentLayout("controlbar")}var P;var I;var O;var B;var t="none";var f;var h;var Q;var e;var d;var w;var s;var J={};var n=false;var c={};function H(){O=0;B=0;I=0;if(!n){var V={height:i.skin.getSkinElement("controlbar","background").height,backgroundColor:A.backgroundcolor};P=document.createElement("div");P.id=i.id+"_jwplayer_controlbar";_css(P,V)}v("capLeft","left",false,P);var W={position:"absolute",height:i.skin.getSkinElement("controlbar","background").height,background:" url("+i.skin.getSkinElement("controlbar","background").src+") repeat-x center left",left:i.skin.getSkinElement("controlbar","capLeft").width};N("elements",P,W);v("capRight","right",false,P)}this.getDisplayElement=function(){return P};this.resize=function(X,V){a.utils.cancelAnimation(P);document.getElementById(i.id).onmousemove=x;d=X;w=V;x();var W=u();D({id:i.id,duration:Q,position:h});r({id:i.id,bufferPercent:e});return W};function o(){var W=["timeSlider","volumeSlider","timeSliderRail","volumeSliderRail"];for(var X in W){var V=W[X];if(typeof J[V]!="undefined"){c[V]=J[V].getBoundingClientRect()}}}function x(){a.utils.cancelAnimation(P);if(g()){a.utils.fadeTo(P,1,0,1,0)}else{a.utils.fadeTo(P,0,0.1,1,2)}}function g(){if(i.jwGetState()==a.api.events.state.IDLE||i.jwGetState()==a.api.events.state.PAUSED){if(A.idlehide){return false}return true}if(i.jwGetFullscreen()){return false}if(A.position.toUpperCase()==a.html5.view.positions.OVER){return false}return true}function N(Y,X,W){var V;if(!n){V=document.createElement("div");J[Y]=V;V.id=P.id+"_"+Y;X.appendChild(V)}else{V=document.getElementById(P.id+"_"+Y)}if(W!==undefined){_css(V,W)}return V}function G(){U(A.layout.left);U(A.layout.right,-1);U(A.layout.center)}function U(Y,V){var Z=Y.position=="right"?"right":"left";var X=a.utils.extend([],Y.elements);if(V!==undefined){X.reverse()}for(var W=0;W<X.length;W++){z(X[W],Z)}}function E(){return I++}function z(Z,ab){var Y,W,X,V,ad;switch(Z.name){case"play":v("playButton",ab,false);v("pauseButton",ab,true);K("playButton","jwPlay");K("pauseButton","jwPause");break;case"divider":v("divider"+E(),ab,true);break;case"prev":v("prevButton",ab,true);K("prevButton","jwPlaylistPrev");break;case"next":v("nextButton",ab,true);K("nextButton","jwPlaylistNext");break;case"elapsed":v("elapsedText",ab,true);break;case"time":W=i.skin.getSkinElement("controlbar","timeSliderCapLeft")===undefined?0:i.skin.getSkinElement("controlbar","timeSliderCapLeft").width;X=i.skin.getSkinElement("controlbar","timeSliderCapRight")===undefined?0:i.skin.getSkinElement("controlbar","timeSliderCapRight").width;Y=ab=="left"?W:X;V=i.skin.getSkinElement("controlbar","timeSliderRail").width+W+X;ad={height:i.skin.getSkinElement("controlbar","background").height,position:"absolute",top:0,width:V};ad[ab]=ab=="left"?O:B;var aa=N("timeSlider",J.elements,ad);v("timeSliderCapLeft",ab,true,aa,ab=="left"?0:Y);v("timeSliderRail",ab,false,aa,Y);v("timeSliderBuffer",ab,false,aa,Y);v("timeSliderProgress",ab,false,aa,Y);v("timeSliderThumb",ab,false,aa,Y);v("timeSliderCapRight",ab,true,aa,ab=="right"?0:Y);M("time");break;case"fullscreen":v("fullscreenButton",ab,false);v("normalscreenButton",ab,true);K("fullscreenButton","jwSetFullscreen",true);K("normalscreenButton","jwSetFullscreen",false);break;case"volume":W=i.skin.getSkinElement("controlbar","volumeSliderCapLeft")===undefined?0:i.skin.getSkinElement("controlbar","volumeSliderCapLeft").width;X=i.skin.getSkinElement("controlbar","volumeSliderCapRight")===undefined?0:i.skin.getSkinElement("controlbar","volumeSliderCapRight").width;Y=ab=="left"?W:X;V=i.skin.getSkinElement("controlbar","volumeSliderRail").width+W+X;ad={height:i.skin.getSkinElement("controlbar","background").height,position:"absolute",top:0,width:V};ad[ab]=ab=="left"?O:B;var ac=N("volumeSlider",J.elements,ad);v("volumeSliderCapLeft",ab,true,ac,ab=="left"?0:Y);v("volumeSliderRail",ab,true,ac,Y);v("volumeSliderProgress",ab,false,ac,Y);v("volumeSliderCapRight",ab,true,ac,ab=="right"?0:Y);M("volume");break;case"mute":v("muteButton",ab,false);v("unmuteButton",ab,true);K("muteButton","jwSetMute",true);K("unmuteButton","jwSetMute",false);break;case"duration":v("durationText",ab,true);break}}function v(Y,ac,ab,Z,V){if((i.skin.getSkinElement("controlbar",Y)!==undefined||Y.indexOf("Text")>0||Y.indexOf("divider")===0)&&!(Y.indexOf("divider")===0&&s.indexOf("divider")===0)){s=Y;var X={height:i.skin.getSkinElement("controlbar","background").height,position:"absolute",display:"block",top:0};if((Y.indexOf("next")===0||Y.indexOf("prev")===0)&&i.jwGetPlaylist().length<2){ab=false;X.display="none"}var aa;if(Y.indexOf("Text")>0){Y.innerhtml="00:00";X.font=A.fontsize+"px/"+(i.skin.getSkinElement("controlbar","background").height+1)+"px "+A.font;X.color=A.fontcolor;X.textAlign="center";X.fontWeight=A.fontweight;X.fontStyle=A.fontstyle;X.cursor="default";aa=14+3*A.fontsize}else{if(Y.indexOf("divider")===0){X.background="url("+i.skin.getSkinElement("controlbar","divider").src+") repeat-x center left";aa=i.skin.getSkinElement("controlbar","divider").width}else{X.background="url("+i.skin.getSkinElement("controlbar",Y).src+") repeat-x center left";aa=i.skin.getSkinElement("controlbar",Y).width}}if(ac=="left"){X.left=V===undefined?O:V;if(ab){O+=aa}}else{if(ac=="right"){X.right=V===undefined?B:V;if(ab){B+=aa}}}if(Z===undefined){Z=J.elements}X.width=aa;if(n){_css(J[Y],X)}else{var W=N(Y,Z,X);if(i.skin.getSkinElement("controlbar",Y+"Over")!==undefined){W.onmouseover=function(ad){W.style.backgroundImage=["url(",i.skin.getSkinElement("controlbar",Y+"Over").src,")"].join("")};W.onmouseout=function(ad){W.style.backgroundImage=["url(",i.skin.getSkinElement("controlbar",Y).src,")"].join("")}}}}}function C(){i.jwAddEventListener(a.api.events.JWPLAYER_PLAYLIST_LOADED,y);i.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_BUFFER,r);i.jwAddEventListener(a.api.events.JWPLAYER_PLAYER_STATE,p);i.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_TIME,D);i.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_MUTE,T);i.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_VOLUME,k);i.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_COMPLETE,F)}function y(){H();G();u();R()}function R(){D({id:i.id,duration:i.jwGetDuration(),position:0});r({id:i.id,bufferProgress:0});T({id:i.id,mute:i.jwGetMute()});p({id:i.id,newstate:a.api.events.state.IDLE});k({id:i.id,volume:i.jwGetVolume()})}function K(X,Y,W){if(n){return}if(i.skin.getSkinElement("controlbar",X)!==undefined){var V=J[X];if(V!==null){_css(V,{cursor:"pointer"});if(Y=="fullscreen"){V.onmouseup=function(Z){Z.stopPropagation();i.jwSetFullscreen(!i.jwGetFullscreen())}}else{V.onmouseup=function(Z){Z.stopPropagation();if(W!==null){i[Y](W)}else{i[Y]()}}}}}}function M(V){if(n){return}var W=J[V+"Slider"];_css(J.elements,{cursor:"pointer"});_css(W,{cursor:"pointer"});W.onmousedown=function(X){t=V};W.onmouseup=function(X){X.stopPropagation();S(X.pageX)};W.onmousemove=function(X){if(t=="time"){f=true;var Y=X.pageX-c[V+"Slider"].left-window.pageXOffset;_css(J.timeSliderThumb,{left:Y})}}}function S(W){f=false;var V;if(t=="time"){V=W-c.timeSliderRail.left+window.pageXOffset;var Y=V/c.timeSliderRail.width*Q;if(Y<0){Y=0}else{if(Y>Q){Y=Q-3}}i.jwSeek(Y);if(i.jwGetState()!=a.api.events.state.PLAYING){i.jwPlay()}}else{if(t=="volume"){V=W-c.volumeSliderRail.left-window.pageXOffset;var X=Math.round(V/c.volumeSliderRail.width*100);if(X<0){X=0}else{if(X>100){X=100}}if(i.jwGetMute()){i.jwSetMute(false)}i.jwSetVolume(X)}}t="none"}function r(W){if(W.bufferPercent!==null){e=W.bufferPercent}var X=c.timeSliderRail.width;var V=isNaN(Math.round(X*e/100))?0:Math.round(X*e/100);_css(J.timeSliderBuffer,{width:V})}function T(V){if(V.mute){_hide(J.muteButton);_show(J.unmuteButton);_hide(J.volumeSliderProgress)}else{_show(J.muteButton);_hide(J.unmuteButton);_show(J.volumeSliderProgress)}}function p(V){if(V.newstate==a.api.events.state.BUFFERING||V.newstate==a.api.events.state.PLAYING){_show(J.pauseButton);_hide(J.playButton)}else{_hide(J.pauseButton);_show(J.playButton)}x();if(V.newstate==a.api.events.state.IDLE){_hide(J.timeSliderBuffer);_hide(J.timeSliderProgress);_hide(J.timeSliderThumb);D({id:i.id,duration:i.jwGetDuration(),position:0})}else{_show(J.timeSliderBuffer);if(V.newstate!=a.api.events.state.BUFFERING){_show(J.timeSliderProgress);_show(J.timeSliderThumb)}}}function F(V){r({bufferPercent:0});D(a.utils.extend(V,{position:0,duration:Q}))}function D(Y){if(Y.position!==null){h=Y.position}if(Y.duration!==null){Q=Y.duration}var W=(h===Q===0)?0:h/Q;var V=isNaN(Math.round(c.timeSliderRail.width*W))?0:Math.round(c.timeSliderRail.width*W);var X=V;J.timeSliderProgress.style.width=V+"px";if(!f){if(J.timeSliderThumb){J.timeSliderThumb.style.left=X+"px"}}if(J.durationText){J.durationText.innerHTML=m(Q)}if(J.elapsedText){J.elapsedText.innerHTML=m(h)}}function m(V){str="00:00";if(V>0){str=Math.floor(V/60)<10?"0"+Math.floor(V/60)+":":Math.floor(V/60)+":";str+=Math.floor(V%60)<10?"0"+Math.floor(V%60):Math.floor(V%60)}return str}function l(){var Y,W;var X=document.getElementById(P.id+"_elements").childNodes;for(var V in document.getElementById(P.id+"_elements").childNodes){if(isNaN(parseInt(V,10))){continue}if(X[V].id.indexOf(P.id+"_divider")===0&&W.id.indexOf(P.id+"_divider")===0){X[V].style.display="none"}else{if(X[V].id.indexOf(P.id+"_divider")===0&&Y.style.display!="none"){X[V].style.display="block"}}if(X[V].style.display!="none"){W=X[V]}Y=X[V]}}function u(){l();if(i.jwGetFullscreen()){_show(J.normalscreenButton);_hide(J.fullscreenButton)}else{_hide(J.normalscreenButton);_show(J.fullscreenButton)}var W={width:d};var V={};if(A.position.toUpperCase()==a.html5.view.positions.OVER||i.jwGetFullscreen()){W.left=A.margin;W.width-=2*A.margin;W.top=w-i.skin.getSkinElement("controlbar","background").height-A.margin;W.height=i.skin.getSkinElement("controlbar","background").height}else{W.left=0}V.left=i.skin.getSkinElement("controlbar","capLeft").width;V.width=W.width-i.skin.getSkinElement("controlbar","capLeft").width-i.skin.getSkinElement("controlbar","capRight").width;var X=i.skin.getSkinElement("controlbar","timeSliderCapLeft")===undefined?0:i.skin.getSkinElement("controlbar","timeSliderCapLeft").width;_css(J.timeSliderRail,{width:(V.width-O-B),left:X});if(J.timeSliderCapRight!==undefined){_css(J.timeSliderCapRight,{left:X+(V.width-O-B)})}_css(P,W);_css(J.elements,V);o();return W}function k(Z){if(J.volumeSliderRail!==undefined){var X=isNaN(Z.volume/100)?1:Z.volume/100;var Y=parseInt(J.volumeSliderRail.style.width.replace("px",""),10);var V=isNaN(Math.round(Y*X))?0:Math.round(Y*X);var aa=parseInt(J.volumeSliderRail.style.right.replace("px",""),10);var W=i.skin.getSkinElement("controlbar","volumeSliderCapLeft")===undefined?0:i.skin.getSkinElement("controlbar","volumeSliderCapLeft").width;_css(J.volumeSliderProgress,{width:V,left:W});if(J.volumeSliderCapLeft!==undefined){_css(J.volumeSliderCapLeft,{left:0})}}}function q(){H();G();o();n=true;C();R();P.style.opacity=A.idlehide?0:1}q();return this}})(jwplayer);(function(b){var a=["width","height","state","playlist","item","position","buffer","duration","volume","mute","fullscreen"];b.html5.controller=function(t,r,e,q){var w=t;var y=e;var d=q;var k=r;var A=true;var c=-1;var u=(y.config.debug!==undefined)&&(y.config.debug.toString().toLowerCase()=="console");var i=new b.html5.eventdispatcher(k.id,u);b.utils.extend(this,i);function m(D){i.sendEvent(D.type,D)}y.addGlobalListener(m);function p(){try{if(y.playlist[y.item].levels[0].file.length>0){if(A||y.state==b.api.events.state.IDLE){y.addEventListener(b.api.events.JWPLAYER_MEDIA_BUFFER_FULL,function(){y.getMedia().play()});y.addEventListener(b.api.events.JWPLAYER_MEDIA_TIME,function(E){if(E.position>=y.playlist[y.item].start&&c>=0){y.playlist[y.item].start=c;c=-1}});if(y.config.repeat){y.addEventListener(b.api.events.JWPLAYER_MEDIA_COMPLETE,function(E){setTimeout(n,25)})}y.getMedia().load(y.playlist[y.item]);A=false}else{if(y.state==b.api.events.state.PAUSED){y.getMedia().play()}}}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function B(){try{if(y.playlist[y.item].levels[0].file.length>0){switch(y.state){case b.api.events.state.PLAYING:case b.api.events.state.BUFFERING:y.getMedia().pause();break}}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function x(D){try{if(y.playlist[y.item].levels[0].file.length>0){if(typeof D!="number"){D=parseFloat(D)}switch(y.state){case b.api.events.state.IDLE:if(c<0){c=y.playlist[y.item].start;y.playlist[y.item].start=D}p();break;case b.api.events.state.PLAYING:case b.api.events.state.PAUSED:case b.api.events.state.BUFFERING:y.getMedia().seek(D);break}}return true}catch(E){i.sendEvent(b.api.events.JWPLAYER_ERROR,E)}return false}function j(){try{if(y.playlist[y.item].levels[0].file.length>0&&y.state!=b.api.events.state.IDLE){y.getMedia().stop()}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function g(){try{if(y.playlist[y.item].levels[0].file.length>0){if(y.config.shuffle){o(s())}else{if(y.item+1==y.playlist.length){o(0)}else{o(y.item+1)}}}if(y.state!=b.api.events.state.PLAYING&&y.state!=b.api.events.state.BUFFERING){p()}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function f(){try{if(y.playlist[y.item].levels[0].file.length>0){if(y.config.shuffle){o(s())}else{if(y.item===0){o(y.playlist.length-1)}else{o(y.item-1)}}}if(y.state!=b.api.events.state.PLAYING&&y.state!=b.api.events.state.BUFFERING){p()}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function s(){var D=null;if(y.playlist.length>1){while(D===null){D=Math.floor(Math.random()*y.playlist.length);if(D==y.item){D=null}}}else{D=0}return D}function o(E){y.resetEventListeners();y.addGlobalListener(m);try{if(y.playlist[E].levels[0].file.length>0){var F=y.state;if(F!==b.api.events.state.IDLE){j()}y.item=E;A=true;y.setActiveMediaProvider(y.playlist[y.item]);i.sendEvent(b.api.events.JWPLAYER_PLAYLIST_ITEM,{index:E});if(F==b.api.events.state.PLAYING||F==b.api.events.state.BUFFERING||y.config.chromeless){p()}}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function z(E){try{switch(typeof(E)){case"number":y.getMedia().volume(E);break;case"string":y.getMedia().volume(parseInt(E,10));break}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function l(E){try{if(typeof E=="undefined"){y.getMedia().mute(!y.mute)}else{if(E.toString().toLowerCase()=="true"){y.getMedia().mute(true)}else{y.getMedia().mute(false)}}return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function h(E,D){try{y.width=E;y.height=D;d.resize(E,D);i.sendEvent(b.api.events.JWPLAYER_RESIZE,{width:y.width,height:y.height});return true}catch(F){i.sendEvent(b.api.events.JWPLAYER_ERROR,F)}return false}function v(E){try{if(typeof E=="undefined"){y.fullscreen=!y.fullscreen;d.fullscreen(!y.fullscreen)}else{if(E.toString().toLowerCase()=="true"){y.fullscreen=true;d.fullscreen(true)}else{y.fullscreen=false;d.fullscreen(false)}}i.sendEvent(b.api.events.JWPLAYER_RESIZE,{width:y.width,height:y.height});i.sendEvent(b.api.events.JWPLAYER_FULLSCREEN,{fullscreen:E});return true}catch(D){i.sendEvent(b.api.events.JWPLAYER_ERROR,D)}return false}function C(D){try{j();y.loadPlaylist(D);o(y.item);return true}catch(E){i.sendEvent(b.api.events.JWPLAYER_ERROR,E)}return false}b.html5.controller.repeatoptions={LIST:"LIST",ALWAYS:"ALWAYS",SINGLE:"SINGLE",NONE:"NONE"};function n(){y.resetEventListeners();y.addGlobalListener(m);switch(y.config.repeat.toUpperCase()){case b.html5.controller.repeatoptions.SINGLE:p();break;case b.html5.controller.repeatoptions.ALWAYS:if(y.item==y.playlist.length-1&&!y.config.shuffle){o(0);p()}else{g()}break;case b.html5.controller.repeatoptions.LIST:if(y.item==y.playlist.length-1&&!y.config.shuffle){o(0)}else{g()}break}}this.play=p;this.pause=B;this.seek=x;this.stop=j;this.next=g;this.prev=f;this.item=o;this.setVolume=z;this.setMute=l;this.resize=h;this.setFullscreen=v;this.load=C}})(jwplayer);(function(a){a.html5.defaultSkin=function(){this.text='<?xml version="1.0" ?><skin author="LongTail Video" name="Five" version="1.0"><settings><setting name="backcolor" value="0xFFFFFF"/><setting name="frontcolor" value="0x000000"/><setting name="lightcolor" value="0x000000"/><setting name="screencolor" value="0x000000"/></settings><components><component name="controlbar"><settings><setting name="margin" value="20"/><setting name="fontsize" value="11"/></settings><elements><element name="background" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAIAAABvFaqvAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFJJREFUeNrslLENwAAIwxLU/09j5AiOgD5hVQzNAVY8JK4qEfHMIKBnd2+BQlBINaiRtL/aV2rdzYBsM6CIONbI1NZENTr3RwdB2PlnJgJ6BRgA4hwu5Qg5iswAAAAASUVORK5CYII="/><element name="capLeft" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAIAAAC0rgCNAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAD5JREFUeNosi8ENACAMAgnuv14H0Z8asI19XEjhOiKCMmibVgJTUt7V6fe9KXOtSQCfctJHu2q3/ot79hNgANc2OTz9uTCCAAAAAElFTkSuQmCC"/><element name="capRight" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAIAAAC0rgCNAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAD5JREFUeNosi8ENACAMAgnuv14H0Z8asI19XEjhOiKCMmibVgJTUt7V6fe9KXOtSQCfctJHu2q3/ot79hNgANc2OTz9uTCCAAAAAElFTkSuQmCC"/><element name="divider" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAIAAAC0rgCNAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAD5JREFUeNosi8ENACAMAgnuv14H0Z8asI19XEjhOiKCMmibVgJTUt7V6fe9KXOtSQCfctJHu2q3/ot79hNgANc2OTz9uTCCAAAAAElFTkSuQmCC"/><element name="playButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEhJREFUeNpiYqABYBo1dNRQ+hr6H4jvA3E8NS39j4SpZvh/LJig4YxEGEqy3kET+w+AOGFQRhTJhrEQkGcczfujhg4CQwECDADpTRWU/B3wHQAAAABJRU5ErkJggg=="/><element name="pauseButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAChJREFUeNpiYBgFo2DwA0YC8v/R1P4nRu+ooaOGUtnQUTAKhgIACDAAFCwQCfAJ4gwAAAAASUVORK5CYII="/><element name="prevButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEtJREFUeNpiYBgFo2Dog/9QDAPyQHweTYwiQ/2B+D0Wi8g2tB+JTdBQRiIMJVkvEy0iglhDF9Aq9uOpHVEwoE+NJDUKRsFgAAABBgDe2hqZcNNL0AAAAABJRU5ErkJggg=="/><element name="nextButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAElJREFUeNpiYBgFo2Dog/9AfB6I5dHE/lNqKAi/B2J/ahsKw/3EGMpIhKEk66WJoaR6fz61IyqemhEFSlL61ExSo2AUDAYAEGAAiG4hj+5t7M8AAAAASUVORK5CYII="/><element name="timeSliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADxJREFUeNpiYBgFo2AU0Bwwzluw+D8tLWARFhKiqQ9YuLg4aWsBGxs7bS1gZ6e5BWyjSX0UjIKhDgACDABlYQOGh5pYywAAAABJRU5ErkJggg=="/><element name="timeSliderBuffer" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAD1JREFUeNpiYBgFo2AU0Bww1jc0/aelBSz8/Pw09QELOzs7bS1gY2OjrQWsrKy09gHraFIfBaNgqAOAAAMAvy0DChXHsZMAAAAASUVORK5CYII="/><element name="timeSliderProgress" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAClJREFUeNpiYBgFo2AU0BwwAvF/WlrARGsfjFow8BaMglEwCugAAAIMAOHfAQunR+XzAAAAAElFTkSuQmCC"/><element name="timeSliderThumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAICAYAAAA870V8AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABZJREFUeNpiZICA/yCCiQEJUJcDEGAAY0gBD1/m7Q0AAAAASUVORK5CYII="/><element name="muteButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADFJREFUeNpiYBgFIw3MB+L/5Gj8j6yRiRTFyICJXHfTXyMLAXlGati4YDRFDj8AEGAABk8GSqqS4CoAAAAASUVORK5CYII="/><element name="unmuteButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAD1JREFUeNpiYBgFgxz8p7bm+cQa+h8LHy7GhEcjIz4bmAjYykiun/8j0fakGPIfTfPgiSr6aB4FVAcAAQYAWdwR1G1Wd2gAAAAASUVORK5CYII="/><element name="volumeSliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAYCAYAAADkgu3FAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGpJREFUeNpi/P//PwM9ABMDncCoRYPfIqqDZcuW1UPp/6AUDcNM1DQYKtRAlaAj1mCSLSLXYIIWUctgDItoZfDA5aOoqKhGEANIM9LVR7SymGDQUctikuOIXkFNdhHEOFrDjlpEd4sAAgwAriRMub95fu8AAAAASUVORK5CYII="/><element name="volumeSliderProgress" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAYCAYAAADkgu3FAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFtJREFUeNpi/P//PwM9ABMDncCoRYPfIlqAeij9H5SiYZiqBqPTlFqE02BKLSLaYFItIttgQhZRzWB8FjENiuRJ7aAbsMQwYMl7wDIsWUUQ42gNO2oR3S0CCDAAKhKq6MLLn8oAAAAASUVORK5CYII="/><element name="fullscreenButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAE5JREFUeNpiYBgFo2DQA0YC8v/xqP1PjDlMRDrEgUgxkgHIlfZoriVGjmzLsLFHAW2D6D8eA/9Tw7L/BAwgJE90PvhPpNgoGAVDEQAEGAAMdhTyXcPKcAAAAABJRU5ErkJggg=="/><element name="normalscreenButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEZJREFUeNpiYBgFo2DIg/9UUkOUAf8JiFFsyX88fJyAkcQgYMQjNkzBoAgiezyRbE+tFGSPxQJ7auYBmma0UTAKBhgABBgAJAEY6zON61sAAAAASUVORK5CYII="/></elements></component><component name="display"><elements><element name="background" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEpJREFUeNrszwENADAIA7DhX8ENoBMZ5KR10EryckCJiIiIiIiIiIiIiIiIiIiIiIh8GmkRERERERERERERERERERERERGRHSPAAPlXH1phYpYaAAAAAElFTkSuQmCC"/><element name="playIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALdJREFUeNrs18ENgjAYhmFouDOCcQJGcARHgE10BDcgTOIosAGwQOuPwaQeuFRi2p/3Sb6EC5L3QCxZBgAAAOCorLW1zMn65TrlkH4NcV7QNcUQt7Gn7KIhxA+qNIR81spOGkL8oFJDyLJRdosqKDDkK+iX5+d7huzwM40xptMQMkjIOeRGo+VkEVvIPfTGIpKASfYIfT9iCHkHrBEzf4gcUQ56aEzuGK/mw0rHpy4AAACAf3kJMACBxjAQNRckhwAAAABJRU5ErkJggg=="/><element name="muteIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNrs1jEOgCAMBVAg7t5/8qaoIy4uoobyXsLCxA+0NCUAAADGUWvdQoQ41x4ixNBB2hBvBskdD3w5ZCkl3+33VqI0kjBBlh9rp+uTcyOP33TnolfsU85XX3yIRpQph8ZQY3wTZtU5AACASA4BBgDHoVuY1/fvOQAAAABJRU5ErkJggg=="/><element name="errorIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWlJREFUeNrsl+1twjAQhsHq/7BBYQLYIBmBDcoGMAIjtBPQTcII2SDtBDBBwrU6pGsUO7YbO470PtKJkz9iH++d4ywWAAAAAABgljRNsyWr2bZzDuJG1rLdZhcMbTjrBCGDyUKsqQLFciJb9bSvuG/WagRVRUVUI6gqy5HVeKWfSgRyJruKIU//TrZTSn2nmlaXThrloi/v9F2STC1W4+Aw5cBzkquRc09bofFNc6YLxEON0VUZS5FPTftO49vMjRsIF3RhOGr7/D/pJw+FKU+q0vDyq8W42jCunDqI3LC5XxNj2wHLU1XjaRnb0Lhykhqhhd8MtSF5J9tbjCv4mXGvKJz/65FF/qJryyaaIvzP2QRxZTX2nTuXjvV/VPFSwyLnW7mpH99yTh1FEVro6JBSd40/pMrRdV8vPtcKl28T2pT8TnFZ4yNosct3Q0io6JfBiz1FlGdqVQH3VHnepAEAAAAAADDzEGAAcTwB10jWgxcAAAAASUVORK5CYII="/><element name="bufferIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAuhJREFUeNrsWr9rU1EUznuNGqvFQh1ULOhiBx0KDtIuioO4pJuik3FxFfUPaAV1FTdx0Q5d2g4FFxehTnEpZHFoBy20tCIWtGq0TZP4HfkeHB5N8m6Sl/sa74XDybvv3vvOd8/Pe4lXrVZT3dD8VJc0B8QBcUAcEAfESktHGeR5XtMfqFQq/f92zPe/NbtGlKTdCY30kuxrpMGO94BlQCXs+rbh3ONgA6BlzP1p20d80gEI5hmA2A92Qua1Q2PtAFISM+bvjMG8U+Q7oA3rQGASwrYCU6WpNdLGYbA+Pq5jjXIiwi8EEa2UDbQSaKOIuV+SlkcCrfjY8XTI9EpKGwP0C2kru2hLtHqa4zoXtZRWyvi4CLwv9Opr6Hkn6A9HKgEANsQ1iqC3Ub/vRUk2JgmRkatK36kVrnt0qObunwUdUUMXMWYpakJsO5Am8tAw2GBIgwWA+G2S2dMpiw0gDioQRQJoKhRb1QiDwlHZUABYbaXWsm5ae6loTE4ZDxN4CZar8foVzOJ2iyZ2kWF3t7YIevffaMT5yJ70kQb2fQ1sE5SHr2wazs2wgMxgbsEKEAgxAvZUJbQLBGTSBMgNrncJbA6AljtS/eKDJ0Ez+DmrQEzXS2h1Ck25kAg0IZcUOaydCy4sYnN2fOA+2AP16gNoHALlQ+fwH7XO4CxLenUpgj4xr6ugY2roPMbMx+Xs18m/E8CVEIhxsNeg83XWOAN6grG3lGbk8uE5fr4B/WH3cJw+co/l9nTYsSGYCJ/lY5/qv0thn6nrIWmjeJcPSnWOeY++AkF8tpJHIMAUs/MaBBpj3znZfQo5psY+ZrG4gv5HickjEOymKjEeRpgyST6IuZcTcWbnjcgdPi5ghxciRKsl1lDSsgwA1i8fssonJgzmTSqfGUkCENndNdAL7PS6QQ7ZYISTo+1qq0LEWjTWcvY4isa4z+yfQB+7ooyHVg5RI7/i1Ijn/vnggDggDogD4oC00P4KMACd/juEHOrS4AAAAABJRU5ErkJggg=="/></elements></component><component name="dock"><elements><element name="button" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFBJREFUeNrs0cEJACAQA8Eofu0fu/W6EM5ZSAFDRpKTBs00CQQEBAQEBAQEBAQEBAQEBATkK8iqbY+AgICAgICAgICAgICAgICAgIC86QowAG5PAQzEJ0lKAAAAAElFTkSuQmCC"/></elements></component><component name="playlist"><elements><element name="item" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAIAAAC1nk4lAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHhJREFUeNrs2NEJwCAMBcBYuv/CFuIE9VN47WWCR7iocXR3pdWdGPqqwIoMjYfQeAiNh9B4JHc6MHQVHnjggQceeOCBBx77TifyeOY0iHi8DqIdEY8dD5cL094eePzINB5CO/LwcOTptNB4CP25L4TIbZzpU7UEGAA5wz1uF5rF9AAAAABJRU5ErkJggg=="/><element name="sliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAA8CAIAAADpFA0BAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADhJREFUeNrsy6ENACAMAMHClp2wYxZLAg5Fcu9e3OjuOKqqfTMzbs14CIZhGIZhGIZhGP4VLwEGAK/BBnVFpB0oAAAAAElFTkSuQmCC"/><element name="sliderThumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAA8CAIAAADpFA0BAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADRJREFUeNrsy7ENACAMBLE8++8caFFKKiRffU53112SGs3ttOohGIZhGIZhGIZh+Fe8BRgAiaUGde6NOSEAAAAASUVORK5CYII="/></elements></component></components></skin>';this.xml=null;if(window.DOMParser){parser=new DOMParser();this.xml=parser.parseFromString(this.text,"text/xml")}else{this.xml=new ActiveXObject("Microsoft.XMLDOM");this.xml.async="false";this.xml.loadXML(this.text)}return this}})(jwplayer);(function(a){_css=a.utils.css;_hide=function(b){_css(b,{display:"none"})};_show=function(b){_css(b,{display:"block"})};a.html5.display=function(o,y){var v=o;var e={};var g;var z;var k;var w;var x;var p;var j;var n=v.skin.getComponentSettings("display").bufferrotation===undefined?15:parseInt(v.skin.getComponentSettings("display").bufferrotation,10);var f=v.skin.getComponentSettings("display").bufferinterval===undefined?100:parseInt(v.skin.getComponentSettings("display").bufferinterval,10);var d={display:{style:{cursor:"pointer",top:0,left:0,overflow:"hidden"},click:t},display_icon:{style:{cursor:"pointer",position:"absolute",top:((v.skin.getSkinElement("display","background").height-v.skin.getSkinElement("display","playIcon").height)/2),left:((v.skin.getSkinElement("display","background").width-v.skin.getSkinElement("display","playIcon").width)/2),border:0,margin:0,padding:0,zIndex:3}},display_iconBackground:{style:{cursor:"pointer",position:"absolute",top:((z-v.skin.getSkinElement("display","background").height)/2),left:((g-v.skin.getSkinElement("display","background").width)/2),border:0,backgroundImage:(["url(",v.skin.getSkinElement("display","background").src,")"]).join(""),width:v.skin.getSkinElement("display","background").width,height:v.skin.getSkinElement("display","background").height,margin:0,padding:0,zIndex:2}},display_image:{style:{display:"none",width:g,height:z,position:"absolute",cursor:"pointer",left:0,top:0,margin:0,padding:0,textDecoration:"none",zIndex:1}},display_text:{style:{zIndex:4,position:"relative",opacity:0.8,backgroundColor:parseInt("000000",16),color:parseInt("ffffff",16),textAlign:"center",fontFamily:"Arial,sans-serif",padding:"0 5px",fontSize:14}}};v.jwAddEventListener(a.api.events.JWPLAYER_PLAYER_STATE,l);v.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_MUTE,l);v.jwAddEventListener(a.api.events.JWPLAYER_PLAYLIST_ITEM,l);v.jwAddEventListener(a.api.events.JWPLAYER_ERROR,s);A();function A(){e.display=r("div","display");e.display_text=r("div","display_text");e.display.appendChild(e.display_text);e.display_image=r("img","display_image");e.display_image.onerror=function(B){_hide(e.display_image)};e.display_image.onload=m;e.display_icon=r("div","display_icon");e.display_iconBackground=r("div","display_iconBackground");e.display.appendChild(e.display_image);e.display_iconBackground.appendChild(e.display_icon);e.display.appendChild(e.display_iconBackground);b()}this.getDisplayElement=function(){return e.display};this.resize=function(C,B){g=C;z=B;_css(e.display,{width:C,height:B});_css(e.display_text,{width:(C-10),top:((z-e.display_text.getBoundingClientRect().height)/2)});_css(e.display_iconBackground,{top:((z-v.skin.getSkinElement("display","background").height)/2),left:((g-v.skin.getSkinElement("display","background").width)/2)});i();l({})};function m(B){k=e.display_image.naturalWidth;w=e.display_image.naturalHeight;i()}function i(){a.utils.stretch(v.jwGetStretching(),e.display_image,g,z,k,w)}function r(B,D){var C=document.createElement(B);C.id=v.id+"_jwplayer_"+D;_css(C,d[D].style);return C}function b(){for(var B in e){if(d[B].click!==undefined){e[B].onclick=d[B].click}}}function t(B){if(typeof B.preventDefault!="undefined"){B.preventDefault()}else{B.returnValue=false}if(v.jwGetState()!=a.api.events.state.PLAYING){v.jwPlay()}else{v.jwPause()}}function h(B){if(j){return}_show(e.display_iconBackground);e.display_icon.style.backgroundImage=(["url(",v.skin.getSkinElement("display",B).src,")"]).join("");_css(e.display_icon,{display:"block",width:v.skin.getSkinElement("display",B).width,height:v.skin.getSkinElement("display",B).height,top:(v.skin.getSkinElement("display","background").height-v.skin.getSkinElement("display",B).height)/2,left:(v.skin.getSkinElement("display","background").width-v.skin.getSkinElement("display",B).width)/2});if(v.skin.getSkinElement("display",B+"Over")!==undefined){e.display_icon.onmouseover=function(C){e.display_icon.style.backgroundImage=["url(",v.skin.getSkinElement("display",B+"Over").src,")"].join("")};e.display_icon.onmouseout=function(C){e.display_icon.style.backgroundImage=["url(",v.skin.getSkinElement("display",B).src,")"].join("")}}else{e.display_icon.onmouseover=null;e.display_icon.onmouseout=null}}function q(){_hide(e.display_icon);_hide(e.display_iconBackground)}function s(B){j=true;q();e.display_text.innerHTML=B.error;_show(e.display_text);e.display_text.style.top=((z-e.display_text.getBoundingClientRect().height)/2)+"px"}function c(){_css(e.display_image,{display:"none"});delete e.display_image.src}function u(){var B=e.display_image;e.display_image=r("img","display_image");e.display_image.onerror=function(C){_hide(e.display_image)};e.display_image.onload=m;e.display.replaceChild(e.display_image,B)}function l(B){if((B.type==a.api.events.JWPLAYER_PLAYER_STATE||B.type==a.api.events.JWPLAYER_PLAYLIST_ITEM)&&j){j=false;_hide(e.display_text)}if(p!==undefined){clearInterval(p);p=null;a.utils.animations.rotate(e.display_icon,0)}switch(v.jwGetState()){case a.api.events.state.BUFFERING:h("bufferIcon");x=0;p=setInterval(function(){x+=n;a.utils.animations.rotate(e.display_icon,x%360)},f);h("bufferIcon");break;case a.api.events.state.PAUSED:_css(e.display_image,{background:"transparent no-repeat center center"});h("playIcon");break;case a.api.events.state.IDLE:if(v.jwGetPlaylist()[v.jwGetItem()].image){_css(e.display_image,{display:"block"});e.display_image.src=a.utils.getAbsolutePath(v.jwGetPlaylist()[v.jwGetItem()].image)}else{u()}h("playIcon");break;default:if(v.jwGetMute()){u();h("muteIcon")}else{u();_hide(e.display_iconBackground);_hide(e.display_icon)}break}}return this}})(jwplayer);(function(jwplayer){jwplayer.html5.eventdispatcher=function(id,debug){var _id=id;var _debug=debug;var _listeners;var _globallisteners;this.resetEventListeners=function(){_listeners={};_globallisteners=[]};this.resetEventListeners();this.addEventListener=function(type,listener,count){try{if(_listeners[type]===undefined){_listeners[type]=[]}if(typeof(listener)=="string"){eval("listener = "+listener)}_listeners[type].push({listener:listener,count:count})}catch(err){jwplayer.utils.log("error",err)}return false};this.removeEventListener=function(type,listener){try{for(var listenerIndex=0;listenerIndex<_listeners[type].length;listenerIndex++){if(_listeners[type][lisenterIndex].toString()==listener.toString()){_listeners[type].slice(lisenterIndex,lisenterIndex+1);break}}}catch(err){jwplayer.utils.log("error",err)}return false};this.addGlobalListener=function(listener,count){try{if(typeof(listener)=="string"){eval("listener = "+listener)}_globallisteners.push({listener:listener,count:count})}catch(err){jwplayer.utils.log("error",err)}return false};this.removeGlobalListener=function(listener){try{for(var globalListenerIndex=0;globalListenerIndex<_globallisteners.length;globalListenerIndex++){if(_globallisteners[globalListenerIndex].toString()==listener.toString()){_globallisteners.slice(globalListenerIndex,globalListenerIndex+1);break}}}catch(err){jwplayer.utils.log("error",err)}return false};this.sendEvent=function(type,data){if(data===undefined){data={}}jwplayer.utils.extend(data,{id:_id,version:jwplayer.version,type:type});if(_debug){jwplayer.utils.log(type,data)}if(typeof _listeners[type]!="undefined"){for(var listenerIndex=0;listenerIndex<_listeners[type].length;listenerIndex++){try{_listeners[type][listenerIndex].listener(data)}catch(err){jwplayer.utils.log("There was an error while handling a listener",_listeners[type][listenerIndex].listener,err)}if(_listeners[type][listenerIndex].count===1){delete _listeners[type][listenerIndex]}else{if(_listeners[type][listenerIndex].count>0){_listeners[type][listenerIndex].count=_listeners[type][listenerIndex].count-1}}}}for(var globalListenerIndex=0;globalListenerIndex<_globallisteners.length;globalListenerIndex++){try{_globallisteners[globalListenerIndex].listener(data)}catch(err){jwplayer.utils.log("There was an error while handling a listener",_globallisteners[globalListenerIndex].listener,err)}if(_globallisteners[globalListenerIndex].count===1){delete _globallisteners[globalListenerIndex]}else{if(_globallisteners[globalListenerIndex].count>0){_globallisteners[globalListenerIndex].count=_globallisteners[globalListenerIndex].count-1}}}}}})(jwplayer);(function(a){var b={prefix:"http://l.longtailvideo.com/html5/",file:"logo.png",link:"http://www.longtailvideo.com/players/jw-flv-player/",margin:8,out:0.5,over:1,timeout:3,hide:true,position:"bottom-left"};_css=a.utils.css;a.html5.logo=function(l,m){var r=l;var n;var i;var c;j();function j(){p();d();f()}function p(){if(b.prefix){var t=l.version.split(/\W/).splice(0,2).join("/");if(b.prefix.indexOf(t)<0){b.prefix+=t+"/"}}if(m.position==a.html5.view.positions.OVER){m.position=b.position}i=a.utils.extend({},b)}function d(){c=document.createElement("img");c.id=r.id+"_jwplayer_logo";c.style.display="none";c.onload=function(t){_css(c,q());r.jwAddEventListener(a.api.events.JWPLAYER_PLAYER_STATE,s);e()};if(!i.file){return}if(i.file.indexOf("http://")===0){c.src=i.file}else{c.src=i.prefix+i.file}}if(!i.file){return}this.resize=function(u,t){};this.getDisplayElement=function(){return c};function f(){if(i.link){c.onmouseover=h;c.onmouseout=e;c.onclick=o}else{this.mouseEnabled=false}}function o(t){if(typeof t!="undefined"){t.stopPropagation()}r.jwPause();r.jwSetFullscreen(false);if(i.link){window.open(i.link,"_blank")}return}function e(t){if(i.link){c.style.opacity=i.out}return}function h(t){if(i.hide){c.style.opacity=i.over}return}function q(){var v={textDecoration:"none",position:"absolute",cursor:"pointer"};v.display=i.hide?"none":"block";var u=i.position.toLowerCase().split("-");for(var t in u){v[u[t]]=i.margin}return v}function k(){if(i.hide){c.style.display="block";c.style.opacity=0;a.utils.fadeTo(c,i.out,0.1,parseFloat(c.style.opacity));n=setTimeout(function(){g()},i.timeout*1000)}}function g(){if(i.hide){a.utils.fadeTo(c,0,0.1,parseFloat(c.style.opacity))}}function s(t){if(t.newstate==a.api.events.state.BUFFERING){clearTimeout(n);k()}}return this}})(jwplayer);(function(a){var c={ended:a.api.events.state.IDLE,playing:a.api.events.state.PLAYING,pause:a.api.events.state.PAUSED,buffering:a.api.events.state.BUFFERING};var b=a.utils.css;a.html5.mediavideo=function(f,D){var H={abort:t,canplay:m,canplaythrough:m,durationchange:q,emptied:t,ended:m,error:l,loadeddata:q,loadedmetadata:q,loadstart:m,pause:m,play:K,playing:m,progress:A,ratechange:t,seeked:m,seeking:m,stalled:m,suspend:m,timeupdate:K,volumechange:t,waiting:m,canshowcurrentframe:t,dataunavailable:t,empty:t,load:e,loadedfirstframe:t};var I=new a.html5.eventdispatcher();a.utils.extend(this,I);var h=f;var x=D;var E;var G;var d=a.api.events.state.IDLE;var B=null;var n;var g=0;var z=false;var r=false;var M;var L;var i=[];var N;var C=false;function v(){return d}function e(O){}function t(O){}function m(O){if(c[O.type]){s(c[O.type])}}function s(O){if(C){return}if(n){O=a.api.events.state.IDLE}if(O==a.api.events.state.PAUSED&&d==a.api.events.state.IDLE){return}if(O==a.api.events.state.PLAYING&&d==a.api.events.state.IDLE){s(a.api.events.state.BUFFERING);I.sendEvent(a.api.events.JWPLAYER_MEDIA_BUFFER,{bufferPercent:h.buffer});y();return}if(d!=O){var P=d;h.state=O;d=O;var Q=false;if(O==a.api.events.state.IDLE){p();if(h.position>=h.duration&&(h.position||h.duration)){Q=true}if(x.style.display!="none"&&!h.config.chromeless){x.style.display="none"}}I.sendEvent(a.api.events.JWPLAYER_PLAYER_STATE,{oldstate:P,newstate:O});if(Q){I.sendEvent(a.api.events.JWPLAYER_MEDIA_COMPLETE)}}n=false}function q(O){var P={height:O.target.videoHeight,width:O.target.videoWidth,duration:Math.round(O.target.duration*10)/10};if(h.duration===0||isNaN(h.duration)){h.duration=Math.round(O.target.duration*10)/10}h.playlist[h.item]=a.utils.extend(h.playlist[h.item],P);I.sendEvent(a.api.events.JWPLAYER_MEDIA_META,{metadata:P})}function K(P){if(n){return}if(P!==undefined&&P.target!==undefined){if(h.duration===0||isNaN(h.duration)){h.duration=Math.round(P.target.duration*10)/10}if(!z&&x.readyState>0){s(a.api.events.state.PLAYING)}if(d==a.api.events.state.PLAYING){if(!z&&x.readyState>0){z=true;try{x.currentTime=h.playlist[h.item].start}catch(O){}x.volume=h.volume/100;x.muted=h.mute}h.position=Math.round(P.target.currentTime*10)/10;I.sendEvent(a.api.events.JWPLAYER_MEDIA_TIME,{position:P.target.currentTime,duration:P.target.duration})}}A(P)}function y(){if(E===false&&d==a.api.events.state.BUFFERING){I.sendEvent(a.api.events.JWPLAYER_MEDIA_BUFFER_FULL);E=true}}function F(){var O=(i[i.length-1]-i[0])/i.length;N=setTimeout(function(){if(!G){A({lengthComputable:true,loaded:1,total:1})}},O*10)}function A(Q){var P,O;if(Q!==undefined&&Q.lengthComputable&&Q.total){o();P=Q.loaded/Q.total*100;O=P/100*(h.duration-x.currentTime);if(50<P&&!G){clearTimeout(N);F()}}else{if((x.buffered!==undefined)&&(x.buffered.length>0)){maxBufferIndex=0;if(maxBufferIndex>=0){P=x.buffered.end(maxBufferIndex)/x.duration*100;O=x.buffered.end(maxBufferIndex)-x.currentTime}}}y();if(!G){if(P==100&&G===false){G=true}if(P!==null&&(P>h.buffer)){h.buffer=Math.round(P);I.sendEvent(a.api.events.JWPLAYER_MEDIA_BUFFER,{bufferPercent:Math.round(P)})}}}function w(){if(B===null){B=setInterval(function(){K()},100)}}function p(){clearInterval(B);B=null}function l(Q){var P="There was an error: ";if((Q.target.error&&Q.target.tagName.toLowerCase()=="video")||Q.target.parentNode.error&&Q.target.parentNode.tagName.toLowerCase()=="video"){var O=Q.target.error===undefined?Q.target.parentNode.error:Q.target.error;switch(O.code){case O.MEDIA_ERR_ABORTED:P="You aborted the video playback: ";break;case O.MEDIA_ERR_NETWORK:P="A network error caused the video download to fail part-way: ";break;case O.MEDIA_ERR_DECODE:P="The video playback was aborted due to a corruption problem or because the video used features your browser did not support: ";break;case O.MEDIA_ERR_SRC_NOT_SUPPORTED:P="The video could not be loaded, either because the server or network failed or because the format is not supported: ";break;default:P="An unknown error occurred: ";break}}else{if(Q.target.tagName.toLowerCase()=="source"){L--;if(L>0){return}P="The video could not be loaded, either because the server or network failed or because the format is not supported: "}else{a.utils.log("Erroneous error received. Continuing...");return}}u();P+=j();C=true;I.sendEvent(a.api.events.JWPLAYER_ERROR,{error:P});return}function j(){var Q="";for(var P in M.levels){var O=M.levels[P];var R=x.ownerDocument.createElement("source");Q+=a.utils.getAbsolutePath(O.file);if(P<(M.levels.length-1)){Q+=", "}}return Q}this.getDisplayElement=function(){return x};this.play=function(){if(d!=a.api.events.state.PLAYING){if(x.style.display!="block"){x.style.display="block"}x.play();w();if(E){s(a.api.events.state.PLAYING)}}};this.pause=function(){x.pause();s(a.api.events.state.PAUSED)};this.seek=function(O){if(!(h.duration===0||isNaN(h.duration))&&!(h.position===0||isNaN(h.position))){x.currentTime=O;x.play()}};function u(){x.pause();p();h.position=0;n=true;s(a.api.events.state.IDLE)}this.stop=u;this.volume=function(O){x.volume=O/100;h.volume=O;I.sendEvent(a.api.events.JWPLAYER_MEDIA_VOLUME,{volume:Math.round(O)})};this.mute=function(O){x.muted=O;h.mute=O;I.sendEvent(a.api.events.JWPLAYER_MEDIA_MUTE,{mute:O})};this.resize=function(P,O){if(false){b(x,{width:P,height:O})}I.sendEvent(a.api.events.JWPLAYER_MEDIA_RESIZE,{fullscreen:h.fullscreen,width:P,hieght:O})};this.fullscreen=function(O){if(O===true){this.resize("100%","100%")}else{this.resize(h.config.width,h.config.height)}};this.load=function(O){J(O);I.sendEvent(a.api.events.JWPLAYER_MEDIA_LOADED);E=false;G=false;z=false;if(!h.config.chromeless){i=[];o();s(a.api.events.state.BUFFERING);setTimeout(function(){K()},25)}};function o(){var O=new Date().getTime();i.push(O)}this.hasChrome=function(){return r};function J(V){h.duration=V.duration;r=false;M=V;var Q=document.createElement("video");Q.preload="none";C=false;L=0;for(var P=0;P<V.levels.length;P++){var O=V.levels[P];if(a.utils.isYouTube(O.file)){delete Q;k(O.file);return}var R;if(O.type===undefined){var U=a.utils.extension(O.file);if(a.utils.extensionmap[U]!==undefined&&a.utils.extensionmap[U].html5!==undefined){R=a.utils.extensionmap[U].html5}else{R="video/"+U+";"}}else{R=O.type}if(a.utils.html5CanPlay(Q,O.file)){var T=x.ownerDocument.createElement("source");T.src=a.utils.getAbsolutePath(O.file);if(!a.utils.isLegacyAndroid()){T.type=R}L++;Q.appendChild(T)}}if(L===0){C=true;I.sendEvent(a.api.events.JWPLAYER_ERROR,{error:"The video could not be loaded because the format is not supported by your browser: "+j()})}if(h.config.chromeless){Q.poster=a.utils.getAbsolutePath(V.image);Q.controls="controls"}Q.style.position=x.style.position;Q.style.top=x.style.top;Q.style.left=x.style.left;Q.style.width=x.style.width;Q.style.height=x.style.height;Q.style.zIndex=x.style.zIndex;Q.onload=e;Q.volume=0;x.parentNode.replaceChild(Q,x);Q.id=x.id;x=Q;for(var S in H){x.addEventListener(S,function(W){if(W.target.parentNode!==null){H[W.type](W)}},true)}}function k(S){var P=document.createElement("object");S=["http://www.youtube.com/v/",S.replace(/^[^v]+v.(.{11}).*/,"$1"),"&amp;hl=en_US&amp;fs=1&autoplay=1"].join("");var V={movie:S,allowFullScreen:"true",allowscriptaccess:"always"};for(var O in V){var T=document.createElement("param");T.name=O;T.value=V[O];P.appendChild(T)}var U=document.createElement("embed");var Q={src:S,type:"application/x-shockwave-flash",allowscriptaccess:"always",allowfullscreen:"true",width:document.getElementById(f.id).style.width,height:document.getElementById(f.id).style.height};for(var R in Q){U[R]=Q[R]}P.appendChild(U);P.style.position=x.style.position;P.style.top=x.style.top;P.style.left=x.style.left;P.style.width=document.getElementById(f.id).style.width;P.style.height=document.getElementById(f.id).style.height;P.style.zIndex=2147483000;x.parentNode.replaceChild(P,x);P.id=x.id;x=P;r=true}this.embed=J;return this}})(jwplayer);(function(jwplayer){var _configurableStateVariables=["width","height","start","duration","volume","mute","fullscreen","item","plugins","stretching"];jwplayer.html5.model=function(api,container,options){var _api=api;var _container=container;var _model={id:_container.id,playlist:[],state:jwplayer.api.events.state.IDLE,position:0,buffer:0,config:{width:480,height:320,item:-1,skin:undefined,file:undefined,image:undefined,start:0,duration:0,bufferlength:5,volume:90,mute:false,fullscreen:false,repeat:"none",stretching:jwplayer.utils.stretching.UNIFORM,autostart:false,debug:undefined,screencolor:undefined}};var _media;var _eventDispatcher=new jwplayer.html5.eventdispatcher();var _components=["display","logo","controlbar"];jwplayer.utils.extend(_model,_eventDispatcher);for(var option in options){if(typeof options[option]=="string"){var type=/color$/.test(option)?"color":null;options[option]=jwplayer.utils.typechecker(options[option],type)}var config=_model.config;var path=option.split(".");for(var edge in path){if(edge==path.length-1){config[path[edge]]=options[option]}else{if(config[path[edge]]===undefined){config[path[edge]]={}}config=config[path[edge]]}}}for(var index in _configurableStateVariables){var configurableStateVariable=_configurableStateVariables[index];_model[configurableStateVariable]=_model.config[configurableStateVariable]}var pluginorder=_components.concat([]);if(_model.plugins!==undefined){if(typeof _model.plugins=="string"){var userplugins=_model.plugins.split(",");for(var userplugin in userplugins){if(typeof userplugins[userplugin]=="string"){pluginorder.push(userplugins[userplugin].replace(/^\s+|\s+$/g,""))}}}}if(jwplayer.utils.isIOS()){_model.config.chromeless=true}if(_model.config.chromeless){pluginorder=["logo"]}_model.plugins={order:pluginorder,config:{controlbar:{position:jwplayer.html5.view.positions.BOTTOM}},object:{}};if(typeof _model.config.components!="undefined"){for(var component in _model.config.components){_model.plugins.config[component]=_model.config.components[component]}}for(var pluginIndex in _model.plugins.order){var pluginName=_model.plugins.order[pluginIndex];var pluginConfig=_model.config[pluginName]===undefined?{}:_model.config[pluginName];_model.plugins.config[pluginName]=_model.plugins.config[pluginName]===undefined?pluginConfig:jwplayer.utils.extend(_model.plugins.config[pluginName],pluginConfig);if(_model.plugins.config[pluginName].position===undefined){_model.plugins.config[pluginName].position=jwplayer.html5.view.positions.OVER}}_model.loadPlaylist=function(arg,ready){var input;if(typeof arg=="string"){try{input=eval(arg)}catch(err){input=arg}}else{input=arg}var config;switch(jwplayer.utils.typeOf(input)){case"object":config=input;break;case"array":config={playlist:input};break;default:config={file:input};break}_model.playlist=new jwplayer.html5.playlist(config);if(_model.config.shuffle){_model.item=_getShuffleItem()}else{if(_model.config.item>=_model.playlist.length){_model.config.item=_model.playlist.length-1}else{if(_model.config.item<0){_model.config.item=0}}_model.item=_model.config.item}if(!ready){_eventDispatcher.sendEvent(jwplayer.api.events.JWPLAYER_PLAYLIST_LOADED,{playlist:_model.playlist})}_model.setActiveMediaProvider(_model.playlist[_model.item])};function _getShuffleItem(){var result=null;if(_model.playlist.length>1){while(result===null){result=Math.floor(Math.random()*_model.playlist.length);if(result==_model.item){result=null}}}else{result=0}return result}function forward(evt){if(evt.type==jwplayer.api.events.JWPLAYER_MEDIA_LOADED){_container=_media.getDisplayElement()}_eventDispatcher.sendEvent(evt.type,evt)}_model.setActiveMediaProvider=function(playlistItem){if(_media!==undefined){_media.resetEventListeners()}_media=new jwplayer.html5.mediavideo(_model,_container);_media.addGlobalListener(forward);if(_model.config.chromeless){_media.load(playlistItem)}return true};_model.getMedia=function(){return _media};_model.setupPlugins=function(){for(var plugin in _model.plugins.order){try{if(jwplayer.html5[_model.plugins.order[plugin]]!==undefined){_model.plugins.object[_model.plugins.order[plugin]]=new jwplayer.html5[_model.plugins.order[plugin]](_api,_model.plugins.config[_model.plugins.order[plugin]])}else{if(window[_model.plugins.order[plugin]]!==undefined){_model.plugins.object[_model.plugins.order[plugin]]=new window[_model.plugins.order[plugin]](_api,_model.plugins.config[_model.plugins.order[plugin]])}else{_model.plugins.order.splice(plugin,plugin+1)}}}catch(err){jwplayer.utils.log("Could not setup "+_model.plugins.order[plugin])}}};return _model}})(jwplayer);(function(a){a.html5.playlist=function(b){var d=[];if(b.playlist&&b.playlist instanceof Array&&b.playlist.length>0){for(var c in b.playlist){if(!isNaN(parseInt(c))){d.push(new a.html5.playlistitem(b.playlist[c]))}}}else{d.push(new a.html5.playlistitem(b))}return d}})(jwplayer);(function(a){a.html5.playlistitem=function(c){var b={author:"",date:"",description:"",image:"",link:"",mediaid:"",tags:"",title:"",provider:"",file:"",streamer:"",duration:-1,start:0,currentLevel:-1,levels:[]};for(var d in b){if(c[d]!==undefined){b[d]=c[d]}}if(b.levels.length===0){b.levels[0]=new a.html5.playlistitemlevel(b)}return b}})(jwplayer);(function(a){a.html5.playlistitemlevel=function(b){var d={file:"",streamer:"",bitrate:0,width:0};for(var c in d){if(b[c]!==undefined){d[c]=b[c]}}return d}})(jwplayer);(function(a){a.html5.skin=function(){var b={};var c=false;this.load=function(d,e){new a.html5.skinloader(d,function(f){c=true;b=f;e()},function(){new a.html5.skinloader("",function(f){c=true;b=f;e()})})};this.getSkinElement=function(d,e){if(c){try{return b[d].elements[e]}catch(f){a.utils.log("No such skin component / element: ",[d,e])}}return null};this.getComponentSettings=function(d){if(c){return b[d].settings}return null};this.getComponentLayout=function(d){if(c){return b[d].layout}return null}}})(jwplayer);(function(a){a.html5.skinloader=function(f,n,i){var m={};var c=n;var j=i;var e=true;var h;var l=f;var q=false;function k(){if(l===undefined||l===""){d(a.html5.defaultSkin().xml)}else{a.utils.ajax(a.utils.getAbsolutePath(l),function(r){try{if(r.responseXML!==null){d(r.responseXML);return}}catch(s){}d(a.html5.defaultSkin().xml)},function(r){d(a.html5.defaultSkin().xml)})}}function d(w){var C=w.getElementsByTagName("component");if(C.length===0){return}for(var F=0;F<C.length;F++){var A=C[F].getAttribute("name");var z={settings:{},elements:{},layout:{}};m[A]=z;var E=C[F].getElementsByTagName("elements")[0].getElementsByTagName("element");for(var D=0;D<E.length;D++){b(E[D],A)}var x=C[F].getElementsByTagName("settings")[0];if(x!==undefined&&x.childNodes.length>0){var I=x.getElementsByTagName("setting");for(var N=0;N<I.length;N++){var O=I[N].getAttribute("name");var G=I[N].getAttribute("value");var v=/color$/.test(O)?"color":null;m[A].settings[O]=a.utils.typechecker(G,v)}}var J=C[F].getElementsByTagName("layout")[0];if(J!==undefined&&J.childNodes.length>0){var K=J.getElementsByTagName("group");for(var u=0;u<K.length;u++){var y=K[u];m[A].layout[y.getAttribute("position")]={elements:[]};for(var M=0;M<y.attributes.length;M++){var B=y.attributes[M];m[A].layout[y.getAttribute("position")][B.name]=B.value}var L=y.getElementsByTagName("*");for(var t=0;t<L.length;t++){var r=L[t];m[A].layout[y.getAttribute("position")].elements.push({type:r.tagName});for(var s=0;s<r.attributes.length;s++){var H=r.attributes[s];m[A].layout[y.getAttribute("position")].elements[t][H.name]=H.value}if(m[A].layout[y.getAttribute("position")].elements[t].name===undefined){m[A].layout[y.getAttribute("position")].elements[t].name=r.tagName}}}}e=false;p()}}function p(){clearInterval(h);if(!q){h=setInterval(function(){o()},100)}}function b(w,v){var u=new Image();var r=w.getAttribute("name");var t=w.getAttribute("src");var y;if(t.indexOf("data:image/png;base64,")===0){y=t}else{var s=a.utils.getAbsolutePath(l);var x=s.substr(0,s.lastIndexOf("/"));y=[x,v,t].join("/")}m[v].elements[r]={height:0,width:0,src:"",ready:false};u.onload=function(z){g(u,r,v)};u.onerror=function(z){q=true;p();j()};u.src=y}function o(){for(var r in m){if(r!="properties"){for(var s in m[r].elements){if(!m[r].elements[s].ready){return}}}}if(e===false){clearInterval(h);c(m)}}function g(r,t,s){m[s].elements[t].height=r.height;m[s].elements[t].width=r.width;m[s].elements[t].src=r.src;m[s].elements[t].ready=true;p()}k()}})(jwplayer);(function(a){a.html5.api=function(b,k){var j={};if(!a.utils.html5SupportsConfig()){return j}var e=document.createElement("div");b.parentNode.replaceChild(e,b);e.id=b.id;j.version=a.version;j.id=e.id;var i=new a.html5.model(j,e,k);var g=new a.html5.view(j,e,i);var h=new a.html5.controller(j,e,i,g);j.skin=new a.html5.skin();j.jwPlay=function(l){if(typeof l=="undefined"){d()}else{if(l.toString().toLowerCase()=="true"){h.play()}else{h.pause()}}};j.jwPause=function(l){if(typeof l=="undefined"){d()}else{if(l.toString().toLowerCase()=="true"){h.pause()}else{h.play()}}};function d(){if(i.state==a.api.events.state.PLAYING||i.state==a.api.events.state.BUFFERING){h.pause()}else{h.play()}}j.jwStop=h.stop;j.jwSeek=h.seek;j.jwPlaylistItem=h.item;j.jwPlaylistNext=h.next;j.jwPlaylistPrev=h.prev;j.jwResize=h.resize;j.jwLoad=h.load;function f(l){return function(){return i[l]}}j.jwGetItem=f("item");j.jwGetPosition=f("position");j.jwGetDuration=f("duration");j.jwGetBuffer=f("buffer");j.jwGetWidth=f("width");j.jwGetHeight=f("height");j.jwGetFullscreen=f("fullscreen");j.jwSetFullscreen=h.setFullscreen;j.jwGetVolume=f("volume");j.jwSetVolume=h.setVolume;j.jwGetMute=f("mute");j.jwSetMute=h.setMute;j.jwGetStretching=f("stretching");j.jwGetState=f("state");j.jwGetVersion=function(){return j.version};j.jwGetPlaylist=function(){return i.playlist};j.jwAddEventListener=h.addEventListener;j.jwRemoveEventListener=h.removeEventListener;j.jwSendEvent=h.sendEvent;j.jwGetLevel=function(){};j.jwGetBandwidth=function(){};j.jwGetLockState=function(){};j.jwLock=function(){};j.jwUnlock=function(){};function c(n,m,l){return function(){n.loadPlaylist(n.config,true);n.setupPlugins();m.setup(n.getMedia().getDisplayElement());var o={id:j.id,version:j.version};l.sendEvent(a.api.events.JWPLAYER_READY,o);if(playerReady!==undefined){playerReady(o)}if(window[n.config.playerReady]!==undefined){window[n.config.playerReady](o)}n.sendEvent(a.api.events.JWPLAYER_PLAYLIST_LOADED,{playlist:n.playlist});l.item(n.item);if(n.config.autostart===true&&!n.config.chromeless){l.play()}}}if(i.config.chromeless){setTimeout(c(i,g,h),25)}else{j.skin.load(i.config.skin,c(i,g,h))}return j}})(jwplayer);(function(jwplayer){jwplayer.livestream=function(container,options,start,end){var _options={autostart:true,duration:0,height:405,id:'livestreamPlayer',title:'Live event',width:720};var _container;var _player;var _overlay;var _title;var _subtitle;var _image;var _currentDate;var _startDate;var _endDate;var _interval;jwplayer.utils.extend(_options,options);_setDates();_setElements();if(_currentDate<_startDate){_countDown();}else if(_currentDate>_endDate){_endScreen();}else{_embedPlayer();}
function _countDown(){jwplayer.utils.css(_overlay,{display:'block'});_currentDate=new Date().getTime()/1000;if(_currentDate>_startDate){_embedPlayer();}else{var hours=Math.floor((_startDate-_currentDate)/3600);var minutes=Math.floor(((_startDate-_currentDate)%3600)/60);var seconds=Math.floor((_startDate-_currentDate)%60);_subtitle.innerHTML="Event starts in "+hours+" hours, "+minutes+" minutes, "+seconds+" seconds.";setTimeout(_countDown,1000);}};function _embedPlayer(){jwplayer.utils.css(_overlay,{display:'none'});var agent=navigator.userAgent.toLowerCase();if(agent.match(/i(hone|ad)/i)!==null&&_options.manifest){_options.provider=undefined;_options.streamer=undefined;_options.file=_options.manifest;}
_options.image=undefined;jwplayer(_options.id).setup(_options);jwplayer(_options.id).onError(_reConnect);jwplayer(_options.id).onComplete(_endScreen);};function _endScreen(){_currentDate=new Date().getTime()/1000;if(_currentDate<_endDate){_reConnect();}else{_subtitle.innerHTML="Event has ended. Replays will be available soon.";jwplayer.utils.css(_overlay,{display:'block'});jwplayer(_options.id).remove();}};function _reConnect(){_subtitle.innerHTML="Connection lost. Attempting to reconnect.";jwplayer.utils.css(_overlay,{display:'block'});jwplayer(_options.id).remove();_interval=setInterval(_reConnectDot,500);setTimeout(_reConnectEnd,10000);};function _reConnectDot(){_subtitle.innerHTML+='.';};function _reConnectEnd(){clearInterval(_interval);_embedPlayer();};function _setDates(){_currentDate=new Date().getTime()/1000;_startDate=new Date(start).getTime()/1000;_endDate=new Date(end).getTime()/1000;};function _setElements(){_container=document.getElementById(container);jwplayer.utils.css(_container,{position:'relative',backgroundImage:'url('+_options.image+')',backgroundRepeat:'no-repeat',backgroundPosition:'center center',height:_options.height,width:_options.width});_player=document.createElement("div");_player.setAttribute('id',_options.id);_container.appendChild(_player);_overlay=document.createElement("div");_container.appendChild(_overlay);jwplayer.utils.css(_overlay,{display:'none',left:0,top:Math.round(_options.height/2)-78,position:'absolute',height:140,width:_options.width,backgroundImage:'url(../assets/back.png)'});_image=document.createElement("div");_overlay.appendChild(_image);jwplayer.utils.css(_image,{backgroundImage:'url(../assets/timer.png)',backgroundRepeat:'no-repeat',backgroundPosition:'right center',cssFloat:'left',width:'35%',height:'100%'});_title=document.createElement("div");_title.innerHTML=_options.title;_overlay.appendChild(_title);jwplayer.utils.css(_title,{color:'#FFF',fontSize:24,lineHeight:24,fontWeight:'bold',fontFace:'Arial',cssFloat:'left',width:'60%',height:48,paddingLeft:22,paddingTop:32,margin:0});_subtitle=document.createElement("div");_subtitle.innerHTML='Waiting for event start...';_overlay.appendChild(_subtitle);jwplayer.utils.css(_subtitle,{color:'#FFF',fontSize:14,fontFace:'Arial',cssFloat:'left',width:'60%',paddingLeft:22,paddingTop:12,margin:0});};return this;};})(jwplayer);function generate_radio_page(pnum){$('#ajaxload').show();$.getJSON(request_0+'jx/radio/'+pnum+'/',{sort:current_radio_sort,ord:current_radio_ord},function(j){var html_text='<div class="empty_sep7"></div><div class="mainpadd"><table cellpadding="0" cellspacing="0" class="pager_head"><tr><td><table cellpadding="0" cellspacing="0"><tr>';if(current_radio_sort=='rate'){html_text+='<td class="nopadd paddtop6"><img src="'+request_0+'images/sort';if(current_radio_ord=='a'){html_text+='_a';}
html_text+='.gif" alt="Сортировка по рейтингу"/></td>';}
html_text+='<td><a href="'+request_0+'radio/" id="radio_sort_rate">Рейтинг</a></td>';if(current_radio_sort=='click'){html_text+='<td class="nopadd paddtop6"><img src="'+request_0+'images/sort';if(current_radio_ord=='a'){html_text+='_a';}
html_text+='.gif" alt="Сортировка по скачиваниям"/></td>';}
html_text+='<td><a href="'+request_0+'radio/" id="radio_sort_click">Скачки</a></td>';if(current_radio_sort=='date'){html_text+='<td class="nopadd paddtop6"><img src="'+request_0+'images/sort';if(current_radio_ord=='a'){html_text+='_a';}
html_text+='.gif" alt="Сортировка по дате добавления"/></td>';}
html_text+='<td><a href="'+request_0+'radio/" id="radio_sort_date">Дата</a></td></tr></table></td><td class="right">';if(j.value.pager){html_text+='<div class="a_buttons_block"><div class="pager">';if(j.value.pager.First){html_text+='<a href="'+request_0+'radio/'+j.value.pager.First+'/" class="radio_a" id="pgr_first">&laquo;</a> ';}else{html_text+='<span>&laquo;</span> ';}
if(j.value.pager.Previous){html_text+='<a href="'+request_0+'radio/'+j.value.pager.Previous+'/" class="radio_a">&lsaquo;</a> ';}else{html_text+='<span>&lsaquo;</span> ';}
for(var i=0;i<j.value.pager.Numbers.length;i++){if(j.value.pager.Numbers[i]!=j.value.pager.Current){html_text+='<a href="'+request_0+'radio/'+j.value.pager.Numbers[i]+'/" class="radio_a">'+j.value.pager.Numbers[i]+'</a> ';}else{html_text+='<span>'+j.value.pager.Numbers[i]+'</span> ';}}
if(j.value.pager.Next){html_text+='<a href="'+request_0+'radio/'+j.value.pager.Next+'/" class="radio_a">&rsaquo;</a> ';}else{html_text+='<span>&rsaquo;</span> ';}
if(j.value.pager.Last){html_text+='<a href="'+request_0+'radio/'+j.value.pager.Last+'/" class="radio_a">&raquo;</a>';}else{html_text+='<span>&raquo;</span>';}
html_text+='</div></div>';}else{html_text+='&nbsp;';}
html_text+='</td></tr></table><div class="styleline1"></div>';tmp_crcl=true;for(var i in j.value.list){html_text+='<span class="invise_imp"><![CDATA[<noindex>]]><a href="'+request_0+'"  class="invise_imp" rel="nofollow" id="strurl'+str_replace('"','~',j.value.list[i].id)+'">'+j.value.list[i].streamurl+'</a><![CDATA[</noindex>]]></span><div class="bordered"><table cellpadding="0" cellspacing="0" class="allwidth radiomn ';if(tmp_crcl){html_text+='radedd';}else{html_text+='radeven';}
html_text+='"><tr><td class="width80 imgbrd"><img src="'+request_0+'images/radio/'+j.value.list[i].image+'" height="80" width="80" alt="'+j.value.list[i].name+'" /></td><td><table cellspacing="0" cellpadding="0" class="allwidth"><tr><td class="left radioname light"><h2>'+j.value.list[i].name+'</h2></td><td class="right light">';if(j.value.list[i].star==5){html_text+='<img src="'+request_0+'images/activestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/activestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/activestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/activestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/activestar.png" alt="'+j.value.list[i].rate+'"/>';}
if(j.value.list[i].star==4){html_text+='<img src="'+request_0+'images/activestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/activestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/activestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/activestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/unactivestar.png" alt="'+j.value.list[i].rate+'"/>';}
if(j.value.list[i].star==3){html_text+='<img src="'+request_0+'images/activestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/activestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/activestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/unactivestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/unactivestar.png" alt="'+j.value.list[i].rate+'"/>';}
if(j.value.list[i].star==2){html_text+='<img src="'+request_0+'images/activestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/activestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/unactivestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/unactivestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/unactivestar.png" alt="'+j.value.list[i].rate+'"/>';}
if(j.value.list[i].star==1){html_text+='<img src="'+request_0+'images/activestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/unactivestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/unactivestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/unactivestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/unactivestar.png" alt="'+j.value.list[i].rate+'"/>';}
if(j.value.list[i].star==0){html_text+='<img src="'+request_0+'images/unactivestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/unactivestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/unactivestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/unactivestar.png" alt="'+j.value.list[i].rate+'"/><img src="'+request_0+'images/unactivestar.png" alt="'+j.value.list[i].rate+'"/>';}
html_text+='</td></tr><tr><td class="light">Добавил: <a class="user_link" href="'+request_0+'user_profile/'+j.value.list[i].user_id+'/">&nbsp;'+j.value.list[i].user_name+'&nbsp;</a></td><td class="right light">Рейтинг: <span class="whitebold" id="radio_voting_'+j.value.list[i].id+'">'+j.value.list[i].rate+'</span></td></tr><tr><td class="light">Дата добавления: <span class="whitebold">'+j.value.list[i].add_date+'</span></td><td class="right light">Битрейт: <span class="whitebold">'+j.value.list[i].kbt+'</span></td></tr><tr><td class="light" id="rvtd_'+j.value.list[i].id+'">';if(!j.value.list[i].voting){html_text+='<a href="'+request_0+'" id="add_radio_voting_'+j.value.list[i].id+'" class="add_radio_voting"><img src="'+request_0+'images/plus.gif" alt="Добавить рейтинг" /></a> <span class="blue add">/</span> <a href="'+request_0+'" id="take_away_radio_voting_'+j.value.list[i].id+'" class="take_away_radio_voting"><img src="'+request_0+'images/minus.gif" alt="Отнять рейтинг" /></a>';}else{html_text+='&nbsp;';}
html_text+='</td><td class="right light">Скачиваний: <span id="radio_click_'+j.value.list[i].id+'" class="whitebold">'+j.value.list[i].clicks+'</span></td></tr><tr><td><div class="fonted" id="radiodesc'+j.value.list[i].id+'">'+j.value.list[i].description+'</div></td><td class="right"><table cellpadding="0" cellspacing="0" class="linkedradio lisslink"><tr><td><img src="'+request_0+'images/playsmall.gif" alt="Слушать" /></td><td><a href="'+request_0+'radio/" class="play_radio" title="'+str_replace('"','~',j.value.list[i].name)+'" id="radio'+j.value.list[i].id+'">Слушать</a></td><td><img src="'+request_0+'images/save.gif" alt="Скачать" /></td><td><a href="'+request_0+'radio_files/'+j.value.list[i].filename+'" title="'+str_replace('"','~',j.value.list[i].name)+'" onclick="add_download('+j.value.list[i].id+', \'radio\')" target="_blank">Скачать</a></td></tr></table></td></tr></table></td></tr></table></div>';}
html_text+='</div>';document.getElementById('main_content').className='main_content_back';$('#app_title').html('Радионстанции, вещающие Online');current_radio_page=pnum;$('#main_content_child_div').fadeTo("fast",0.0,function(){$('#ajaxload').hide();$('#main_content_child_div').html(html_text);radioReady();$('#main_content_child_div').fadeTo('fast',1.0);});document.location=request_0+'#radio-'+j.value.pager.Current+'-'+j.value.sort+'-'+j.value.ord;currentState=document.location.hash;});}
function generate_registration_page(){$('#ajaxload').show();$.getJSON(request_0+'jx/registration_page/',{},function(j){var html_text='<form method="post" id="profile_form" action="'+request_0+'jx/register/"><div class="mainpaddprof"><div class="empty_sep7"></div><div class="empty_sep7"></div><div class="empty_sep7"></div><div class="empty_sep7"></div><div class="empty_sep7"></div><div class="empty_sep7"></div><div class="mainpadd"><div class="bordered"><table cellspacing="0" cellpadding="0" class="allwidth"><tr><td class="right">Логин <sup>•</sup> : &nbsp; </td><td><input class="stand" maxlength="32" name="login" id="login" /></td><td class="right">Дата рождения <sup>•</sup> : &nbsp; </td><td><input tabindex="2" value="" class="date-pick dp-applied stand required" id="date1" onclick="$(\'a.dp-choose-date\').click();" name="date_birn"/><label for="date1" class="error" id="date1lbl"></label></td></tr><tr><td class="right">Имя <sup>•</sup> : &nbsp; </td><td><input tabindex="1" class="stand required" value="" maxlength="32" name="f_name" /></td><td class="right">E-mail: &nbsp; </td><td><input tabindex="4" value="" id="email" class="stand" name="email" maxlength="52" /><img id="reg_help" title="<span class=\'red\'>Рекомендуемо ввести существующий адресс</span><br />Если Вы забудете пароль, то восстановить<br /> его будет возможно только имея <u>существующий</u> E-mail." src="'+request_0+'images/question.gif" alt="Подсказка" /><br /><label id="emaillbl" for="email" class="error" style="display: none;">Такой E-mail уже есть в системе.</label></td></tr><tr><td class="right">Фамилия: &nbsp; </td><td><input tabindex="3" class="stand" value="" maxlength="250" name="l_name" /></td><td class="right">Пол: &nbsp; </td><td><table cellpadding="0" cellspacing="0" class="check"><tr><td><img src="'+request_0+'images/selected.gif" id="is_man_img_m" class="is_man_images finger" onclick="set_select_radio(\'s1\' , \'is_man_img_m\', \'is_man_images\');" alt="" />&nbsp; <input class="hidden" type="radio" name="is_man" value="1" id="s1" checked="checked" onchange="select_radio(\'is_man_img_m\', \'is_man_images\');" /></td><td><label class="check" for="s1" onclick="set_select_radio(\'s1\' , \'is_man_img_m\', \'is_man_images\');"> &nbsp; <img src="'+request_0+'images/man.gif" alt="мужской" /> &nbsp; </label>&nbsp; </td><td><img src="'+request_0+'images/unselected.gif" id="is_man_img_w" class="is_man_images finger" onclick="set_select_radio(\'s2\' , \'is_man_img_w\', \'is_man_images\');" alt="" />&nbsp; <input class="hidden" type="radio" name="is_man" value="0" id="s2" onchange="select_radio(\'is_man_img_w\', \'is_man_images\');" /></td><td><label class="check" for="s2" onclick="set_select_radio(\'s2\' , \'is_man_img_w\', \'is_man_images\');"> &nbsp; <img src="'+request_0+'images/woman.gif" alt="женский" /> &nbsp; </label></td><td><img src="'+request_0+'images/unselected.gif" id="is_man_img_a" class="is_man_images finger" onclick="set_select_radio(\'s3\' , \'is_man_img_a\', \'is_man_images\');" alt="" />&nbsp; <input class="hidden" type="radio" name="is_man" value="2" id="s3" onchange="select_radio(\'is_man_img_a\', \'is_man_images\');" /></td><td><label class="check" for="s3" onclick="set_select_radio(\'s3\' , \'is_man_img_a\', \'is_man_images\');"> &nbsp; <img src="'+request_0+'images/alien.gif" alt="чужой" /> &nbsp; </label></td></tr></table></td></tr><tr><td class="right">Страна: &nbsp; </td><td><select tabindex="6" class="stand required selectbox" name="country_id" id="country_id">';for(var i in j.value.countries){html_text+='<option value="'+j.value.countries[i].id+'"';if(j.value.countries[i].id==3159){html_text+=' selected="selected"';}
html_text+='>'+j.value.countries[i].name+'</option>';}
html_text+='</select></td><td class="right">Город: &nbsp; </td><td><input tabindex="7" value="" class="stand" maxlength="128" name="city_id" id="city_id" /></td></tr><tr><td class="right">Пароль: &nbsp; </td><td><input tabindex="8" class="stand required" value="" type="password" maxlength="32" name="password" id="password" /></td><td class="right">Подтверждение пароля: &nbsp; </td><td><input tabindex="9" class="stand" value="" name="password1" maxlength="32" type="password" id="password1" /></td></tr><tr><td colspan="4"><h1>Дополнительно</h1><div class="empty_sep7"></div><div class="empty_sep7"></div></td></tr><tr><td class="right">Подпись: &nbsp; </td><td><input tabindex="10" value="" class="stand" name="signature" maxlength="255" /></td><td rowspan="4" class="right">Я хочу: &nbsp; </td><td rowspan="4" class="right paddright20"><textarea tabindex="14" class="stand" rows="0" id="description" name="description" cols="0"></textarea></td></tr><tr><td class="right">ICQ номер: &nbsp; </td><td><input tabindex="11" value="" class="stand number" name="icq_number" maxlength="20" /></td></tr><tr><td class="right">Skype: &nbsp; </td><td><input tabindex="12" value="" class="stand" name="skype_number" maxlength="40" /></td></tr><tr><td class="right">www: &nbsp; </td><td><input tabindex="13" value="" class="stand" name="site_url" id="url" maxlength="255" /></td></tr><tr><td class="right" colspan="2">Введите код, изобажённый на картинке.  <sup>•</sup> : &nbsp; </td><td><input name="captcha" maxlength="5" id="captcha" class="stand" /></td><td class="right"><input type="hidden" value="'+j.value.captcha.key+'" name="public_key" id="public_key" /> <img src="'+j.value.captcha.image+'" alt="Captcha" id="capcha_img" class="img_bord" /></td></tr><tr><td colspan="4" class="right"><div class="empty_sep7"></div>Если Вы плохо видете код, вы можете <a href="'+request_0+'registration/" id="refrech_captcha">обновить</a> каринку, или же вам необходимо обратиться к <a href="http://nedug.ru" target="_blank" rel="index">врачу</a>.</td></tr><tr><td colspan="4"><div class="empty_sep7"></div><div class="styleline2"></div><div class="empty_sep7"></div><label for="rules" id="ruleselbl" class="error"></label><label class="finger" for="rules" id="ruleslbl" onclick="$(\'#focusinp\').focus();"><img src="'+request_0+'images/unchecked.gif" id="rules_img" class="finger" onclick="$(\'#ruleslbl\').click();" alt="" /><input type="checkbox" class="hidden required" name="rules" onchange="change_check(this, \'rules_img\');" id="rules" />&nbsp; Я обещаю этому сайту быть всегда в позитивном настроении, улыбаться солнцу, крутить дули воробьям, не обижать маленьких, забыть про то, что делиться не разучились лишь примитивные, махать обоими руками жизни, а также с поднятой вверх головой, с чистой совестью, и правдивыми глазами, я смело заявляю: Я ПРОЧИТАЛ(А) </label> <a href="'+request_0+'rules/" id="rulpage">ПРАВИЛА</a>&nbsp;</td></tr></table></div><div class="spacer1"></div><div class="bordered"></div></div></div><input tabindex="15" type="submit" class="submit_add marginleft30" value="Сохранить"/></form>';$('#app_title').html('Регистрация');global_country_id=3159;document.getElementById('main_content').className='main_content_back';$('#main_content_child_div').fadeTo("fast",0.0,function(){$('#ajaxload').hide();$('#main_content_child_div').html(html_text);register_ready();$('#main_content_child_div').fadeTo('fast',1.0);});redurl=request_0+'#register';document.location=redurl;currentState=document.location.hash;});}
function generate_music_page(){$('#ajaxload').show();$.getJSON(request_0+'jx/music/'+current_music_position+'/'+current_music_page+'/'+current_music_sort+'/'+current_music_ord+'/',{auth:current_music_author,name:current_music_name,start:current_music_start_date,end:current_music_end_date,styles:current_music_styles},function(j){var html_text='<form action="" method="post" id="filter_form"><div class="styleline1"></div><div class="a_buttons_block"><table cellpadding="0" cellspacing="0" class="allwidth"><tr><td class="left"><a';if((j.value.request[2]!='none')&&(j.value.request[2]!='mixes')&&(j.value.request[2]!='mixesnone')&&(j.value.request[2]!='realtones')&&(j.value.request[2]!='albums')){html_text+=' class="selected"';}
html_text+=' href="'+request_0+'music/main/" title="Треки" id="music_item_main">Треки</a> <a';if(j.value.request[2]=='mixes'){html_text+=' class="selected"';}
html_text+=' href="'+request_0+'music/mixes/" title="Миксы" id="music_item_mixes">Миксы</a> <a';if(j.value.request[2]=='realtones'){html_text+=' class="selected"';}
html_text+=' href="'+request_0+'music/realtones/" title="Короткие треки (Рилтоны)" id="music_item_realtones">Рилтоны</a> <a';if(j.value.request[2]=='albums'){html_text+=' class="selected"';}
html_text+=' href="'+request_0+'music/albums/" title="Треки (архивы) собраные в блоки" id="music_item_albums">Альбомы</a></td><td class="right paddright20">';if(j.value.pager){html_text+='<div class="pager">';if(j.value.pager.First){html_text+='<a accesskey="p'+j.value.pager.First+'" href="'+request_0+'music/'+j.value.pager.First+'/" class="music_a" id="pgr_first">&laquo;</a> ';}else{html_text+='<span>&laquo;</span> ';}
if(j.value.pager.Previous){html_text+='<a accesskey="p'+j.value.pager.Previous+'" href="'+request_0+'music/'+j.value.pager.Previous+'/" class="music_a">&lsaquo;</a> ';}else{html_text+='<span>&lsaquo;</span> ';}
for(var i=0;i<j.value.pager.Numbers.length;i++){if(j.value.pager.Numbers[i]!=j.value.pager.Current){html_text+='<a accesskey="p'+j.value.pager.Numbers[i]+'" href="'+request_0+'music/'+j.value.pager.Numbers[i]+'/" class="music_a">'+j.value.pager.Numbers[i]+'</a> ';}else{html_text+='<span>'+j.value.pager.Numbers[i]+'</span> ';}}
if(j.value.pager.Next){html_text+='<a accesskey="p'+j.value.pager.Next+'" href="'+request_0+'music/'+j.value.pager.Next+'/" class="music_a">&rsaquo;</a> ';}else{html_text+='<span>&rsaquo;</span> ';}
if(j.value.pager.Last){html_text+='<a accesskey="p'+j.value.pager.Last+'" href="'+request_0+'music/'+j.value.pager.Last+'/" class="music_a">&raquo;</a> ';}else{html_text+='<span>&raquo;</span> ';}
html_text+='</div>'}
html_text+='</td></tr></table></div><table cellpadding="0" cellspacing="0" class="pager_head"><tr><td class="right"><div class="styleline2"></div><div class="bordered v_center paddright12"><input class="datefilter" type="text" maxlength="10" id="music_from" value="'+j.value.filter_start_date+'" /> - <input class="datefilter" type="text" maxlength="10" id="music_to" value="'+j.value.filter_end_date+'" /> &nbsp; <input class="filter" type="text" value="';if(strlen(j.value.filter_artist)>0){html_text+=j.value.filter_artist;}else{html_text+='Исполнитель';}
html_text+='" name="filter_artist" id="filter_artist" /> &nbsp; <input class="filter" type="text" value="';if(strlen(j.value.filter_name)>0){html_text+=j.value.filter_name;}else{html_text+='Композиция';}
html_text+='" name="filter_name" id="filter_name" /> &nbsp; <select class="invise" id="filter_style_name" name="filter_style_name[]" multiple="multiple" size="5" ><option value="">&nbsp;</option>';for(var i in j.value.styles){html_text+='<option value="'+j.value.styles[i].id+'"';if(j.value.styles[i].selected==true){html_text+=' selected="selected"';}
html_text+='>'+j.value.styles[i].name+'</option>';}
html_text+='</select>    &nbsp; &nbsp; <input type="button" class="filter_clear" value="" name="filter_clear" /> <input type="submit" class="filter_submit" id="filter_submit" name="filter_submit" value="" /></div> ';if(j.value.List.length>0){html_text+='<div class="styleline2"></div><table cellpadding="0" cellspacing="0"><tr>';if(j.value.Sort=='artist'){html_text+='<td class="nopadd paddtop6"><img src="'+request_0+'images/sort';if(j.value.Ord=='asc'){html_text+='_a';}
html_text+='.gif" alt="Сортировка по исполнителю"/></td>';}
html_text+='<td><a href="'+request_0+'music/'+j.value.mode+'/'+j.value.page+'/artist/';if(j.value.Ord=='desc'){html_text+='asc';}else{html_text+='desc;'}
html_text+='/" id="music_sort_artist">Исполнитель</a></td>';if(j.value.Sort=='name'){html_text+='<td class="nopadd paddtop6"><img src="'+request_0+'images/sort';if(j.value.Ord=='asc'){html_text+='_a';}
html_text+='.gif" alt="Сортировка по названию композиции"/></td>';}
html_text+='<td><a href="'+request_0+'music/'+j.value.mode+'/'+j.value.page+'/name/';if(j.value.Ord=='desc'){html_text+='asc';}else{html_text+='desc;'}
html_text+='/" id="music_sort_name">Название композиции</a></td>';if(j.value.Sort=='rate'){html_text+='<td class="nopadd paddtop6"><img src="'+request_0+'images/sort';if(j.value.Ord=='asc'){html_text+='_a';}
html_text+='.gif" alt="Сортировка по рейтингу"/></td>';}
html_text+='<td><a href="'+request_0+'music/'+j.value.mode+'/'+j.value.page+'/rate/';if(j.value.Ord=='desc'){html_text+='asc';}else{html_text+='desc;'}
html_text+='/" id="music_sort_rate">Рейтинг</a></td>';if(j.value.Sort=='downloads'){html_text+='<td class="nopadd paddtop6"><img src="'+request_0+'images/sort';if(j.value.Ord=='asc'){html_text+='_a';}
html_text+='.gif" alt="Сортировка по скачиваниям"/></td>';}
html_text+='<td><a href="'+request_0+'music/'+j.value.mode+'/'+j.value.page+'/downloads/';if(j.value.Ord=='desc'){html_text+='asc';}else{html_text+='desc;'}
html_text+='/" id="music_sort_click">Скачки</a></td>';if(j.value.Sort=='added_date'){html_text+='<td class="nopadd paddtop6"><img src="'+request_0+'images/sort';if(j.value.Ord=='asc'){html_text+='_a';}
html_text+='.gif" alt="Сортировка по дате добавления"/></td>';}
html_text+='<td><a href="'+request_0+'music/'+j.value.mode+'/'+j.value.page+'/added_date/';if(j.value.Ord=='desc'){html_text+='asc';}else{html_text+='desc;'}
html_text+='/" id="music_sort_date">Дата</a></td>';if(j.value.Sort=='comments'){html_text+='<td class="nopadd paddtop6"><img src="'+request_0+'images/sort';if(j.value.Ord=='asc'){html_text+='_a';}
html_text+='.gif" alt="Сортировка по количеству комментариев"/></td>';}
html_text+='<td><a href="'+request_0+'music/'+j.value.mode+'/'+j.value.page+'/comments/';if(j.value.Ord=='desc'){html_text+='asc';}else{html_text+='desc;'}
html_text+='/" id="music_sort_comments">Комментарии</a></td>';html_text+='</tr></table>'}
html_text+='</td></tr></table><div class="styleline2"></div><div class="bordered margintop"><div id="pane_music">';if(j.value.List.length>0){html_text+='<table cellspacing="0" cellpadding="0" class="list" width="100%">';for(var i in j.value.List){html_text+='<tr id="song_list_tr_'+j.value.List[i].id+'"><td class="width75 imgbrd padd1">';if(j.value.List[i].is_exlusive>0){html_text+='<img src="'+request_0+'images/exclusive_small.png" class="exclusive">';}
if(j.value.List[i].image.length>0){html_text+=' <img src="'+request_0+'images/artist/small/'+j.value.List[i].image+'" height="75" width="75" alt="'+j.value.List[i].author+' - '+j.value.List[i].singlename+'" />';}else{html_text+='<img src="'+request_0+'images/artist/small/no'+rand(0,15)+'.gif" height="75" width="75" alt="'+j.value.List[i].author+' - '+j.value.singlename+'" />';}
html_text+='</td><td><div><a href="'+request_0+'singles/'+j.value.List[i].id+'/" id="mps'+j.value.List[i].id+'" class="full"><table class="allwidth"><tr><td class="left bold">&nbsp; '+j.value.List[i].author+' <small>['+j.value.List[i].singlename+']</small></td><td class="right">';if(j.value.List[i].rate_star==5){html_text+='<img src="'+request_0+'images/activestar.png" alt="'+j.value.List[i].rate+' %"/><img src="'+request_0+'images/activestar.png" alt="'+j.value.List[i].rate+' %"/><img src="'+request_0+'images/activestar.png" alt="'+j.value.List[i].rate+' %"/><img src="'+request_0+'images/activestar.png" alt="'+j.value.List[i].rate+' %"/><img src="'+request_0+'images/activestar.png" alt="'+j.value.List[i].rate+' %"/>';}
if(j.value.List[i].rate_star==4){html_text+='<img src="'+request_0+'images/activestar.png" alt="'+j.value.List[i].rate+' %"/><img src="'+request_0+'images/activestar.png" alt="'+j.value.List[i].rate+' %"/><img src="'+request_0+'images/activestar.png" alt="'+j.value.List[i].rate+' %"/><img src="'+request_0+'images/activestar.png" alt="'+j.value.List[i].rate+' %"/><img src="'+request_0+'images/unactivestar.png" alt="'+j.value.List[i].rate+' %"/>';}
if(j.value.List[i].rate_star==3){html_text+='<img src="'+request_0+'images/activestar.png" alt="'+j.value.List[i].rate+' %"/><img src="'+request_0+'images/activestar.png" alt="'+j.value.List[i].rate+' %"/><img src="'+request_0+'images/activestar.png" alt="'+j.value.List[i].rate+' %"/><img src="'+request_0+'images/unactivestar.png" alt="'+j.value.List[i].rate+' %"/><img src="'+request_0+'images/unactivestar.png" alt="'+j.value.List[i].rate+' %"/>';}
if(j.value.List[i].rate_star==2){html_text+='<img src="'+request_0+'images/activestar.png" alt="'+j.value.List[i].rate+' %"/><img src="'+request_0+'images/act
