jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}
var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
expires='; expires='+date.toUTCString();}
var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}
return cookieValue;}};(function($){var i=function(e){if(!e)var e=window.event;e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation()};$.fn.checkbox=function(f){try{document.execCommand('BackgroundImageCache',false,true)}catch(e){}var g={cls:'jquery-checkbox'};g=$.extend(g,f||{});var h=function(a){var b=a.checked;var c=a.disabled;var d=$(a);if(a.stateInterval)clearInterval(a.stateInterval);a.stateInterval=setInterval(function(){if(a.disabled!=c)d.trigger((c=!!a.disabled)?'disable':'enable');if(a.checked!=b)d.trigger((b=!!a.checked)?'check':'uncheck')},10);return d};return this.each(function(){var a=this;var b=h(a);if(a.wrapper)a.wrapper.remove();a.wrapper=$('<span class="'+g.cls+'"><span class="mark"><button></button></span></span>');a.wrapperInner=a.wrapper.children('span:eq(0)');a.wrapper.hover(function(e){a.wrapperInner.addClass(g.cls+'-hover');i(e)},function(e){a.wrapperInner.removeClass(g.cls+'-hover');i(e)});b.css({position:'absolute',zIndex:-1,visibility:'hidden'}).after(a.wrapper);var c=false;if(b.attr('id')){c=$('label[for='+b.attr('id')+']');if(!c.length)c=false}if(!c){c=b.closest?b.closest('label'):b.parents('label:eq(0)');if(!c.length)c=false}if(c){c.hover(function(e){a.wrapper.trigger('mouseover',[e])},function(e){a.wrapper.trigger('mouseout',[e])});c.click(function(e){b.trigger('click',[e]);i(e);return false})}a.wrapper.click(function(e){b.trigger('click',[e]);i(e);return false});b.click(function(e){i(e)});b.bind('disable',function(){a.wrapperInner.addClass(g.cls+'-disabled')}).bind('enable',function(){a.wrapperInner.removeClass(g.cls+'-disabled')});b.bind('check',function(){a.wrapper.addClass(g.cls+'-checked')}).bind('uncheck',function(){a.wrapper.removeClass(g.cls+'-checked')});$('img',a.wrapper).bind('dragstart',function(){return false}).bind('mousedown',function(){return false});if(window.getSelection)a.wrapper.css('MozUserSelect','none');if(a.checked)a.wrapper.addClass(g.cls+'-checked');if(a.disabled)a.wrapperInner.addClass(g.cls+'-disabled')})}})(jQuery);function PlayList(){}
PlayList.add=function(midi_id){var items=this.getAll();try{items.push(midi_id);}catch(e){}
this.setAll(items);}
PlayList.del=function(midi_id,callback){var items=this.getAll();var items_new=new Array();for(i=0;i<items.length;i++){if(midi_id!=items[i]){items_new.push(items[i]);}}
this.setAll(items_new);if(callback!=undefined&&callback!=""){try{callback();}catch(e){}}}
PlayList.clear=function(callback){var items_new=new Array();this.setAll(items_new);if(callback!=undefined&&callback!=""){try{callback();}catch(e){}}}
PlayList.check=function(midi_id){var items=this.getAll();for(i=0;i<items.length;i++){if(midi_id==items[i]){return true;}}
return false;}
PlayList.getAll=function(){try{var items=JSON.parse($.cookie("play_list"));if(items instanceof Array){return items;}else{throw"false";}}catch(e){return new Array();}}
PlayList.setAll=function(items){try{$.cookie('play_list',JSON.stringify(items),{expires:365,path:'/',domain:'midishow.com'});}catch(e){}}
PlayList.clickEvent=function(midi_id,callback){if(!this.check(midi_id)){this.add(midi_id);}else{this.del(midi_id);}
this.updateMenu();}
PlayList.delRow=function(midi_id,clickObj){this.del(midi_id);this.updateMenu();$(clickObj).parent('li').remove();}
PlayList.init=function(){try{var inPlayList=false;var items=this.getAll();$("input[name='pl']").each(function(){var check_box=$(this);var inPlayList=false;var midi_id=check_box.val();for(var i=0;i<items.length;i++){if(midi_id==items[i]){inPlayList=true;break;}}
if(inPlayList){check_box.attr({title:'从点播单移除',checked:true});}else{check_box.attr({title:'添加到点播单',checked:false});}});this.updateMenu(true);}catch(e){}}
PlayList.updateMenu=function(noFlash){var count=this.getAll().length;$(".playlist_count").text(count);var pl_menu=$("#playlist_menu");if(count==0){pl_menu.css({display:'none'});}else{pl_menu.css({display:'inline'});}
if(!noFlash){var pl_a=pl_menu.find('a span');var i=0;var flashInterval=setInterval(function(){if(i%2){pl_a.css({textDecoration:'none'});}
else{pl_a.css({textDecoration:'underline'});}
if(i++>=10){pl_a.css({textDecoration:'none'});clearInterval(flashInterval);flashInterval=null;}},400);}}
jQuery.animateGoTo=function(anchor){var destination=$(anchor).offset().top;$("html:not(:animated),body:not(:animated)").animate({scrollTop:destination},1100,function(){window.location.hash=anchor});return false;};(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',iframeSrc:/^https/i.test(window.location.href||'')?'javascript:false':'about:blank'},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((files.length&&options.iframe!==false)||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="'+opts.iframeSrc+'" />');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',opts.iframeSrc);}};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 domCheckCount=50;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;var isXml=opts.dataType=='xml'||doc.XMLDocument||$.isXMLDoc(doc);log('isXml='+isXml);if(!isXml&&(doc.body==null||doc.body.innerHTML=='')){if(--domCheckCount){cbInvoked=0;setTimeout(cb,100);return;}
log('Could not access iframe DOM after 50 tries.');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];if(ta)
xhr.responseText=ta.value;else{var pre=doc.getElementsByTagName('pre')[0];if(pre)
xhr.responseText=pre.innerHTML;}}
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;}).bind('click.form-plugin',function(e){var target=e.target;var $el=$(target);if(!($el.is(":submit,input:image"))){var t=$el.closest(':submit');if(t.length==0)
return;target=t[0];}
var form=this;form.clk=target;if(target.type=='image'){if(e.offsetX!=undefined){form.clk_x=e.offsetX;form.clk_y=e.offsetY;}else if(typeof $.fn.offset=='function'){var offset=$el.offset();form.clk_x=e.pageX-offset.left;form.clk_y=e.pageY-offset.top;}else{form.clk_x=e.pageX-target.offsetLeft;form.clk_y=e.pageY-target.offsetTop;}}
setTimeout(function(){form.clk=form.clk_x=form.clk_y=null;},100);});};$.fn.ajaxFormUnbind=function(){return this.unbind('submit.form-plugin 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);(function(c){var d=[];c.tools=c.tools||{};c.tools.tooltip={version:"1.1.2",conf:{effect:"toggle",fadeOutSpeed:"fast",tip:null,predelay:0,delay:30,opacity:1,lazy:undefined,position:["top","center"],offset:[0,0],cancelDefault:true,relative:false,oneInstance:true,events:{def:"mouseover,mouseout",input:"focus,blur",widget:"focus mouseover,blur mouseout",tooltip:"mouseover,mouseout"},api:false},addEffect:function(e,g,f){b[e]=[g,f]}};var b={toggle:[function(e){var f=this.getConf(),g=this.getTip(),h=f.opacity;if(h<1){g.css({opacity:h})}g.show();e.call()},function(e){this.getTip().hide();e.call()}],fade:[function(e){this.getTip().fadeIn(this.getConf().fadeInSpeed,e)},function(e){this.getTip().fadeOut(this.getConf().fadeOutSpeed,e)}]};function a(f,g){var p=this,k=c(this);f.data("tooltip",p);var l=f.next();if(g.tip){l=c(g.tip);if(l.length>1){l=f.nextAll(g.tip).eq(0);if(!l.length){l=f.parent().nextAll(g.tip).eq(0)}}}function o(u){var t=g.relative?f.position().top:f.offset().top,s=g.relative?f.position().left:f.offset().left,v=g.position[0];t-=l.outerHeight()-g.offset[0];s+=f.outerWidth()+g.offset[1];var q=l.outerHeight()+f.outerHeight();if(v=="center"){t+=q/2}if(v=="bottom"){t+=q}v=g.position[1];var r=l.outerWidth()+f.outerWidth();if(v=="center"){s-=r/2}if(v=="left"){s-=r}return{top:t,left:s}}var i=f.is(":input"),e=i&&f.is(":checkbox, :radio, select, :button"),h=f.attr("type"),n=g.events[h]||g.events[i?(e?"widget":"input"):"def"];n=n.split(/,\s*/);if(n.length!=2){throw"Tooltip: bad events configuration for "+h}f.bind(n[0],function(r){if(g.oneInstance){c.each(d,function(){this.hide()})}var q=l.data("trigger");if(q&&q[0]!=this){l.hide().stop(true,true)}r.target=this;p.show(r);n=g.events.tooltip.split(/,\s*/);l.bind(n[0],function(){p.show(r)});if(n[1]){l.bind(n[1],function(){p.hide(r)})}});f.bind(n[1],function(q){p.hide(q)});if(!c.browser.msie&&!i&&!g.predelay){f.mousemove(function(){if(!p.isShown()){f.triggerHandler("mouseover")}})}if(g.opacity<1){l.css("opacity",g.opacity)}var m=0,j=f.attr("title");if(j&&g.cancelDefault){f.removeAttr("title");f.data("title",j)}c.extend(p,{show:function(r){if(r){f=c(r.target)}clearTimeout(l.data("timer"));if(l.is(":animated")||l.is(":visible")){return p}function q(){l.data("trigger",f);var t=o(r);if(g.tip&&j){l.html(f.data("title"))}r=r||c.Event();r.type="onBeforeShow";k.trigger(r,[t]);if(r.isDefaultPrevented()){return p}t=o(r);l.css({position:"absolute",top:t.top,left:t.left});var s=b[g.effect];if(!s){throw'Nonexistent effect "'+g.effect+'"'}s[0].call(p,function(){r.type="onShow";k.trigger(r)})}if(g.predelay){clearTimeout(m);m=setTimeout(q,g.predelay)}else{q()}return p},hide:function(r){clearTimeout(l.data("timer"));clearTimeout(m);if(!l.is(":visible")){return}function q(){r=r||c.Event();r.type="onBeforeHide";k.trigger(r);if(r.isDefaultPrevented()){return}b[g.effect][1].call(p,function(){r.type="onHide";k.trigger(r)})}if(g.delay&&r){l.data("timer",setTimeout(q,g.delay))}else{q()}return p},isShown:function(){return l.is(":visible, :animated")},getConf:function(){return g},getTip:function(){return l},getTrigger:function(){return f},bind:function(q,r){k.bind(q,r);return p},onHide:function(q){return this.bind("onHide",q)},onBeforeShow:function(q){return this.bind("onBeforeShow",q)},onShow:function(q){return this.bind("onShow",q)},onBeforeHide:function(q){return this.bind("onBeforeHide",q)},unbind:function(q){k.unbind(q);return p}});c.each(g,function(q,r){if(c.isFunction(r)){p.bind(q,r)}})}c.prototype.tooltip=function(e){var f=this.eq(typeof e=="number"?e:0).data("tooltip");if(f){return f}var g=c.extend(true,{},c.tools.tooltip.conf);if(c.isFunction(e)){e={onBeforeShow:e}}else{if(typeof e=="string"){e={tip:e}}}e=c.extend(true,g,e);if(typeof e.position=="string"){e.position=e.position.split(/,?\s/)}if(e.lazy!==false&&(e.lazy===true||this.length>20)){this.one("mouseover",function(h){f=new a(c(this),e);f.show(h);d.push(f)})}else{this.each(function(){f=new a(c(this),e);d.push(f)})}return e.api?f:this}})(jQuery);(function(d){d.tools=d.tools||{};d.tools.tabs={version:"1.0.4",conf:{tabs:"a",current:"current",onBeforeClick:null,onClick:null,effect:"default",initialIndex:0,event:"click",api:false,rotate:false},addEffect:function(e,f){c[e]=f}};var c={"default":function(f,e){this.getPanes().hide().eq(f).show();e.call()},fade:function(g,e){var f=this.getConf(),j=f.fadeOutSpeed,h=this.getPanes();if(j){h.fadeOut(j)}else{h.hide()}h.eq(g).fadeIn(f.fadeInSpeed,e)},slide:function(f,e){this.getPanes().slideUp(200);this.getPanes().eq(f).slideDown(400,e)},ajax:function(f,e){this.getPanes().eq(0).load(this.getTabs().eq(f).attr("href"),e)}};var b;d.tools.tabs.addEffect("horizontal",function(f,e){if(!b){b=this.getPanes().eq(0).width()}this.getCurrentPane().animate({width:0},function(){d(this).hide()});this.getPanes().eq(f).animate({width:b},function(){d(this).show();e.call()})});function a(g,h,f){var e=this,j=d(this),i;d.each(f,function(k,l){if(d.isFunction(l)){j.bind(k,l)}});d.extend(this,{click:function(k,n){var o=e.getCurrentPane();var l=g.eq(k);if(typeof k=="string"&&k.replace("#","")){l=g.filter("[href*="+k.replace("#","")+"]");k=Math.max(g.index(l),0)}if(f.rotate){var m=g.length-1;if(k<0){return e.click(m,n)}if(k>m){return e.click(0,n)}}if(!l.length){if(i>=0){return e}k=f.initialIndex;l=g.eq(k)}n=n||d.Event();n.type="onBeforeClick";j.trigger(n,[k]);if(n.isDefaultPrevented()){return}c[f.effect].call(e,k,function(){n.type="onClick";j.trigger(n,[k])});n.type="onStart";j.trigger(n,[k]);if(n.isDefaultPrevented()){return}i=k;g.removeClass(f.current);l.addClass(f.current);return e},getConf:function(){return f},getTabs:function(){return g},getPanes:function(){return h},getCurrentPane:function(){return h.eq(i)},getCurrentTab:function(){return g.eq(i)},getIndex:function(){return i},next:function(){return e.click(i+1)},prev:function(){return e.click(i-1)},bind:function(k,l){j.bind(k,l);return e},onBeforeClick:function(k){return this.bind("onBeforeClick",k)},onClick:function(k){return this.bind("onClick",k)},unbind:function(k){j.unbind(k);return e}});g.each(function(k){d(this).bind(f.event,function(l){e.click(k,l);return false})});if(location.hash){e.click(location.hash)}else{if(f.initialIndex===0||f.initialIndex>0){e.click(f.initialIndex)}}h.find("a[href^=#]").click(function(k){e.click(d(this).attr("href"),k)})}d.fn.tabs=function(i,f){var g=this.eq(typeof f=="number"?f:0).data("tabs");if(g){return g}if(d.isFunction(f)){f={onBeforeClick:f}}var h=d.extend({},d.tools.tabs.conf),e=this.length;f=d.extend(h,f);this.each(function(l){var j=d(this);var k=j.find(f.tabs);if(!k.length){k=j.children()}var m=i.jquery?i:j.children(i);if(!m.length){m=e==1?d(i):j.parent().find(i)}g=new a(k,m,f);j.data("tabs",g)});return f.api?g:this}})(jQuery);(function(b){var a=b.tools.tabs;a.plugins=a.plugins||{};a.plugins.slideshow={version:"1.0.2",conf:{next:".forward",prev:".backward",disabledClass:"disabled",autoplay:false,autopause:true,interval:3000,clickable:true,api:false}};b.prototype.slideshow=function(e){var f=b.extend({},a.plugins.slideshow.conf),c=this.length,d;e=b.extend(f,e);this.each(function(){var p=b(this),m=p.tabs(),i=b(m),o=m;b.each(e,function(t,u){if(b.isFunction(u)){m.bind(t,u)}});function n(t){return c==1?b(t):p.parent().find(t)}var s=n(e.next).click(function(){m.next()});var q=n(e.prev).click(function(){m.prev()});var h,j,l,g=false;b.extend(m,{play:function(){if(h){return}var t=b.Event("onBeforePlay");i.trigger(t);if(t.isDefaultPrevented()){return m}g=false;h=setInterval(m.next,e.interval);i.trigger("onPlay");m.next()},pause:function(){if(!h){return m}var t=b.Event("onBeforePause");i.trigger(t);if(t.isDefaultPrevented()){return m}h=clearInterval(h);l=clearInterval(l);i.trigger("onPause")},stop:function(){m.pause();g=true},onBeforePlay:function(t){return m.bind("onBeforePlay",t)},onPlay:function(t){return m.bind("onPlay",t)},onBeforePause:function(t){return m.bind("onBeforePause",t)},onPause:function(t){return m.bind("onPause",t)}});if(e.autopause){var k=m.getTabs().add(s).add(q).add(m.getPanes());k.hover(function(){m.pause();j=clearInterval(j)},function(){if(!g){j=setTimeout(m.play,e.interval)}})}if(e.autoplay){l=setTimeout(m.play,e.interval)}else{m.stop()}if(e.clickable){m.getPanes().click(function(){m.next()})}if(!m.getConf().rotate){var r=e.disabledClass;if(!m.getIndex()){q.addClass(r)}m.onBeforeClick(function(u,t){if(!t){q.addClass(r)}else{q.removeClass(r);if(t==m.getTabs().length-1){s.addClass(r)}else{s.removeClass(r)}}})}});return e.api?d:this}})(jQuery);$.tools.tabs.addEffect("cp_tabs",function(tabIndex,done){var target=this.getTabs().eq(tabIndex).attr("target");if(!target||target=='#panel'){this.getPanes().hide().eq(tabIndex).show();this.getTabs().removeClass("current").eq(tabIndex).addClass("current");done.call();}else if(target=='#ajax'){this.getPanes().hide().eq(tabIndex).text('loading...').show().load(this.getTabs().eq(tabIndex).attr("href")+'/ajax',done);this.getTabs().removeClass("current").eq(tabIndex).addClass("current");}else{window.open(this.getTabs().eq(tabIndex).attr("href"),target);done.call();this.click(this.getConf().initialIndex);}});(function(b){b.tools=b.tools||{};b.tools.scrollable={version:"1.1.2",conf:{size:5,vertical:false,speed:400,keyboard:true,keyboardSteps:null,disabledClass:"disabled",hoverClass:null,clickable:true,activeClass:"active",easing:"swing",loop:false,items:".items",item:null,prev:".prev",next:".next",prevPage:".prevPage",nextPage:".nextPage",api:false}};var c;function a(o,m){var r=this,p=b(this),d=!m.vertical,e=o.children(),k=0,i;if(!c){c=r}b.each(m,function(s,t){if(b.isFunction(t)){p.bind(s,t)}});if(e.length>1){e=b(m.items,o)}function l(t){var s=b(t);return m.globalNav?s:o.parent().find(t)}o.data("finder",l);var f=l(m.prev),h=l(m.next),g=l(m.prevPage),n=l(m.nextPage);b.extend(r,{getIndex:function(){return k},getClickIndex:function(){var s=r.getItems();return s.index(s.filter("."+m.activeClass))},getConf:function(){return m},getSize:function(){return r.getItems().size()},getPageAmount:function(){return Math.ceil(this.getSize()/m.size)},getPageIndex:function(){return Math.ceil(k/m.size)},getNaviButtons:function(){return f.add(h).add(g).add(n)},getRoot:function(){return o},getItemWrap:function(){return e},getItems:function(){return e.children(m.item)},getVisibleItems:function(){return r.getItems().slice(k,k+m.size)},seekTo:function(s,w,t){if(s<0){s=0}if(k===s){return r}if(b.isFunction(w)){t=w}if(s>r.getSize()-m.size){return m.loop?r.begin():this.end()}var u=r.getItems().eq(s);if(!u.length){return r}var v=b.Event("onBeforeSeek");p.trigger(v,[s]);if(v.isDefaultPrevented()){return r}if(w===undefined||b.isFunction(w)){w=m.speed}function x(){if(t){t.call(r,s)}p.trigger("onSeek",[s])}if(d){e.animate({left:-u.position().left},w,m.easing,x)}else{e.animate({top:-u.position().top},w,m.easing,x)}c=r;k=s;v=b.Event("onStart");p.trigger(v,[s]);if(v.isDefaultPrevented()){return r}f.add(g).toggleClass(m.disabledClass,s===0);h.add(n).toggleClass(m.disabledClass,s>=r.getSize()-m.size);return r},move:function(u,t,s){i=u>0;return this.seekTo(k+u,t,s)},next:function(t,s){return this.move(1,t,s)},prev:function(t,s){return this.move(-1,t,s)},movePage:function(w,v,u){i=w>0;var s=m.size*w;var t=k%m.size;if(t>0){s+=(w>0?-t:m.size-t)}return this.move(s,v,u)},prevPage:function(t,s){return this.movePage(-1,t,s)},nextPage:function(t,s){return this.movePage(1,t,s)},setPage:function(t,u,s){return this.seekTo(t*m.size,u,s)},begin:function(t,s){i=false;return this.seekTo(0,t,s)},end:function(t,s){i=true;var u=this.getSize()-m.size;return u>0?this.seekTo(u,t,s):r},reload:function(){p.trigger("onReload");return r},focus:function(){c=r;return r},click:function(u){var v=r.getItems().eq(u),s=m.activeClass,t=m.size;if(u<0||u>=r.getSize()){return r}if(t==1){if(m.loop){return r.next()}if(u===0||u==r.getSize()-1){i=(i===undefined)?true:!i}return i===false?r.prev():r.next()}if(t==2){if(u==k){u--}r.getItems().removeClass(s);v.addClass(s);return r.seekTo(u,time,fn)}if(!v.hasClass(s)){r.getItems().removeClass(s);v.addClass(s);var x=Math.floor(t/2);var w=u-x;if(w>r.getSize()-t){w=r.getSize()-t}if(w!==u){return r.seekTo(w)}}return r},bind:function(s,t){p.bind(s,t);return r},unbind:function(s){p.unbind(s);return r}});b.each("onBeforeSeek,onStart,onSeek,onReload".split(","),function(s,t){r[t]=function(u){return r.bind(t,u)}});f.addClass(m.disabledClass).click(function(){r.prev()});h.click(function(){r.next()});n.click(function(){r.nextPage()});if(r.getSize()<m.size){h.add(n).addClass(m.disabledClass)}g.addClass(m.disabledClass).click(function(){r.prevPage()});var j=m.hoverClass,q="keydown."+Math.random().toString().substring(10);r.onReload(function(){if(j){r.getItems().hover(function(){b(this).addClass(j)},function(){b(this).removeClass(j)})}if(m.clickable){r.getItems().each(function(s){b(this).unbind("click.scrollable").bind("click.scrollable",function(t){if(b(t.target).is("a")){return}return r.click(s)})})}if(m.keyboard){b(document).unbind(q).bind(q,function(t){if(t.altKey||t.ctrlKey){return}if(m.keyboard!="static"&&c!=r){return}var u=m.keyboardSteps;if(d&&(t.keyCode==37||t.keyCode==39)){r.move(t.keyCode==37?-u:u);return t.preventDefault()}if(!d&&(t.keyCode==38||t.keyCode==40)){r.move(t.keyCode==38?-u:u);return t.preventDefault()}return true})}else{b(document).unbind(q)}});r.reload()}b.fn.scrollable=function(d){var e=this.eq(typeof d=="number"?d:0).data("scrollable");if(e){return e}var f=b.extend({},b.tools.scrollable.conf);d=b.extend(f,d);d.keyboardSteps=d.keyboardSteps||d.size;this.each(function(){e=new a(b(this),d);b(this).data("scrollable",e)});return d.api?e:this}})(jQuery);(function(b){b.fn.wheel=function(e){return this[e?"bind":"trigger"]("wheel",e)};b.event.special.wheel={setup:function(){b.event.add(this,d,c,{})},teardown:function(){b.event.remove(this,d,c)}};var d=!b.browser.mozilla?"mousewheel":"DOMMouseScroll"+(b.browser.version<"1.9"?" mousemove":"");function c(e){switch(e.type){case"mousemove":return b.extend(e.data,{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY});case"DOMMouseScroll":b.extend(e,e.data);e.delta=-e.detail/3;break;case"mousewheel":e.delta=e.wheelDelta/120;break}e.type="wheel";return b.event.handle.call(this,e,e.delta)}var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.mousewheel={version:"1.0.1",conf:{api:false,speed:50}};b.fn.mousewheel=function(f){var g=b.extend({},a.plugins.mousewheel.conf),e;if(typeof f=="number"){f={speed:f}}f=b.extend(g,f);this.each(function(){var h=b(this).scrollable();if(h){e=h}h.getRoot().wheel(function(i,j){h.move(j<0?1:-1,f.speed||50);return false})});return f.api?e:this}})(jQuery);(function($){$.facebox=function(data,klass){$.facebox.loading();if(data.ajax)fillFaceboxFromAjax(data.ajax);else if(data.div)fillFaceboxFromHref(data.div);else if($.isFunction(data))data.call($);else $.facebox.reveal(data,klass);}
$.extend($.facebox,{settings:{opacity:0,loadingImage:'/images/loading.gif',appendUrl:'',faceboxHtml:'<div id="overlay" style="display:none;"><a class="ol_close">X</a><div class="ol_alpha">&nbsp;</div><div class="ol_body"><div class="ol_content"></div></div></div>'},loading:function(){init();if($('#overlay .ol_loading').length==1)return true;$('#overlay .ol_content').empty();$('#overlay .ol_body').children().hide().end().append('<div class="ol_loading"><img src="'+$.facebox.settings.loadingImage+'"/></div>');$('#overlay').show();$(document).bind('keydown.facebox',function(e){if(e.keyCode==27)$.facebox.close();return true})
$(document).trigger('loading.facebox');},reveal:function(data,klass){$(document).trigger('beforeReveal.facebox');if(klass)$('#overlay .ol_content').addClass(klass);$('#overlay .ol_content').append(data);$('#overlay .ol_loading').remove();$('#overlay .ol_body').children().show();$('#overlay').css({left:$(window).width()/2-($('#overlay').width()/2),marginLeft:0});$('#overlay .close').click($.facebox.close);$(document).trigger('reveal.facebox').trigger('afterReveal.facebox');},close:function(){$(document).trigger('close.facebox');return false}})
$.fn.facebox=function(settings){init(settings);function clickHandler(){$.facebox.loading(true);var klass=this.rel.match(/facebox\[?\.(\w+)\]?/);if(klass)klass=klass[1];fillFaceboxFromHref(this.href,klass);return false;}
return this.click(clickHandler);}
function init(settings){if($.facebox.settings.inited)return true;else $.facebox.settings.inited=true;$(document).trigger('init.facebox');makeCompatible();if(settings)$.extend($.facebox.settings,settings);$('body').append($.facebox.settings.faceboxHtml);$('#overlay .ol_close').click($.facebox.close);}
function getPageScroll(){var xScroll,yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;xScroll=self.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft;}else if(document.body){yScroll=document.body.scrollTop;xScroll=document.body.scrollLeft;}
return new Array(xScroll,yScroll);}
function getPageHeight(){var windowHeight;if(self.innerHeight){windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowHeight=document.documentElement.clientHeight;}else if(document.body){windowHeight=document.body.clientHeight;}
return windowHeight}
function makeCompatible(){var $s=$.facebox.settings
$s.loadingImage=$s.loading_image||$s.loadingImage
$s.faceboxHtml=$s.facebox_html||$s.faceboxHtml}
function fillFaceboxFromHref(href,klass){if(href.match(/#/)){var url=window.location.href.split('#')[0];var target=href.replace(url,'');$.facebox.reveal($(target).clone().show(),klass);}else{fillFaceboxFromAjax(href+$.facebox.settings.appendUrl,klass);}}
function fillFaceboxFromAjax(href,klass){$.get(href,function(data){$.facebox.reveal(data,klass)});}
$(document).bind('close.facebox',function(){$(document).unbind('keydown.facebox');$('#overlay .ol_content').removeClass().addClass('ol_content');$('#overlay .ol_loading').remove();$('#overlay').hide();})})(jQuery);(function($){$.fn.fplayer=function(options){var defaults={initLCD:'音乐加载中..',txtPlay:'播放',txtPause:'暂停',txtStop:'停止',txtPrev:'前一首',txtNext:'后一首',txtLoop:'单曲循环',txtNoLoop:'取消循环',movieName:this.text(),objId:'FP_QT',embId:'FP_QT_EMB'};var settings=$.extend(defaults,options);var playerHTML='<div id="FPlayer">'+'<h2 id="FP_LCD">'+settings.initLCD+'</h2>'+'<div id="FP_Progress"><div id="FP_Load_PG">&nbsp;</div><div id="FP_Play_PG">&nbsp;</div></div>'+'<ul class="controller">'+' <li><a id="FP_Play" href="javascript:;" title="'+settings.txtPlay+'" class="status_normal"><span>&nbsp;</span>Play</a></li>'+' <li><a id="FP_Stop" href="javascript:;" title="'+settings.txtStop+'">Stop</a></li>'+' <li><a id="FP_Prev" href="javascript:;" title="'+settings.txtPrev+'">Prev</a></li>'+' <li><a id="FP_Next" href="javascript:;" title="'+settings.txtNext+'">Next</a></li>'+' <li><a id="FP_Loop" href="javascript:;" title="'+settings.txtLoop+'" class="status_off"><span>&nbsp;</span>Loop</a></li>'+'</ul>'+'<div id="FP_Timer"><span id="FP_Current">00:00</span>/<span id="FP_Duration">00:00</span></div>'+'<div id="FP_Volumn"><div id="FP_Regulator" class="">&nbsp;</div></div>'+'</div>';this.replaceWith(playerHTML);var player=null;var timer=null;var timeScale=null;var duration=null;$("#"+settings.objId).bind('qt_begin',function(event){var target=event.target?event.target:event.srcElement;player=document.getElementById(target.id);if(!player){alert('no player found.');return false;}
initListeners();initGUIListeners();});function initListeners(){$(player).bind('qt_loadedmetadata',function(){timeScale=player.GetTimeScale();duration=player.GetDuration();setLCD(settings.movieName);setVolumnBar();setLoop();$("#FP_Duration").html(getHumanTime(player.GetDuration()));});$(player).bind('qt_canplaythrough',function(){if(player.GetMaxTimeLoaded()==player.GetDuration()){setLoadProgress(100);}});$(player).bind('qt_progress',function(){var percentLoaded=0;percentLoaded=parseInt((player.GetMaxTimeLoaded()/player.GetDuration())*100);setLoadProgress(percentLoaded);});$(player).bind('qt_load',function(){});$(player).bind('qt_play ',function(){autoRefreshPlayProgress();$("#FP_Play").attr("class","status_play");$("#FP_Play").attr("title",settings.txtPause);});$(player).bind('qt_pause ',function(){if(timer){clearInterval(timer);}
$("#FP_Play").attr("class","status_pause");$("#FP_Play").attr("title",settings.txtPlay);});$(player).bind('qt_ended ',function(){$("#FP_Play").attr("class","status_normal");if(typeof(next_url)!="undefined"&&next_url!=null){window.location.href=next_url;}});$(player).bind('qt_error ',function(){setLCD("发生错误，请刷新页面重试");});$(player).bind('qt_timechanged',function(){if(player.GetTime()==0){$("#FP_Play").attr("class","status_normal");}
setPlayProgress();});$(player).bind('qt_volumechange',function(){if(player.GetMute()==0){$("#FP_Regulator").attr("class","mute");}else{}
setVolumnBar();});};function initGUIListeners(){$("#FP_Play").click(function(){if($("#FP_Play").attr("class")=="status_play"){player.Stop();}else{player.Play();}});$("#FP_Stop").click(function(){player.Stop();player.Rewind();});$("#FP_Prev").click(function(){if(typeof(prev_url)!="undefined"&&prev_url!=null){window.location.href=prev_url;}});$("#FP_Next").click(function(){if(typeof(next_url)!="undefined"&&next_url!=null){window.location.href=next_url;}});$("#FP_Loop").click(function(){player.SetIsLooping(!player.GetIsLooping())
$.cookie('FPlayerLoop',(player.GetIsLooping()?'yes':'no'),{expires:365});setLoop();});$("#FP_Progress").click(function(e){var posX=e.pageX-$(this).offset().left||0;if(posX<0){posX=0;}
newTime=posX*duration/$(this).width();player.SetTime(newTime);});$("#FP_Volumn").click(function(e){var posY=e.pageY-$(this).offset().top-4||0;if(posY<0){posY=0;}
if(posY>40){if(player.GetMute()){player.SetMute(false);}else{player.SetMute(true);}}else{player.SetMute(false);var newVol=Math.ceil(256-(posY*256/38));player.SetVolume(newVol);}});}
function setLCD(str){$("#FP_LCD").html(str);}
function setLoadProgress(preg){$("#FP_Load_PG").css("width",preg+"%");}
function setPlayProgress(){try{preg=Math.ceil((player.GetTime()/duration)*100);$("#FP_Play_PG").css("width",preg+"%");$("#FP_Current").html(getHumanTime(player.GetTime()));}catch(e){}}
function autoRefreshPlayProgress(){if(timer){clearInterval(timer);}
timer=setInterval(setPlayProgress,duration/1000);}
function getHumanTime(mediaTime){if(!timeScale){return'';}
var seconds=parseInt(mediaTime/timeScale);var min=Math.floor(seconds/60);var sec=seconds%60;return(min>9?min:'0'+min)+':'+(sec>9?sec:'0'+sec);}
function setVolumnBar(){var vol=Math.ceil((player.GetVolume()/256)*78);vol+=17;$("#FP_Regulator").css("height",vol+"%");if(player.GetMute()){$("#FP_Regulator").attr('class','mute');}else{$("#FP_Regulator").removeAttr('class');}}
function setLoop(){$("#FP_Loop").attr("class",(player.GetIsLooping()?"status_on":"status_off"));$("#FP_Loop").attr("title",(player.GetIsLooping()?settings.txtNoLoop:settings.txtLoop));}};})(jQuery);function auto_close(){if($.facebox){setTimeout(function(){$.facebox.close();},3000);}}
function pop_alert(str){$.facebox('<p class="pop_alert">'+str+'<div class="alert_btn"><input type="button" class="close" value=" OK " /></div></p>');}
function event_info(str){if(str){document.write('<table id="event_info" class="rc_5px"><tr><td>'+str+'</td></tr></table>');alert('a');setTimeout(function(){$('#event_info').hide()},5000);}}
function initDropdowns(){$("body").click(function(evt){var target=evt.target;if(target.id=='ts_type_btn'){if($('#ts_type_btn').hasClass('pushed')){$('#ts_type_btn').removeClass('pushed');$('#ts_type_list').hide();}else{$('#ts_type_btn').addClass('pushed');$('#ts_type_list').show();}}else{$('#ts_type_btn').removeClass('pushed');$('#ts_type_list').hide();}
if(target.id=='lang_a'){$('#langs').toggle()}else{$('#langs').hide();}});}
function initSearch(){$('#ts_type_list a').click(function(){if($('#ts_search').val()!=''){$('#ts_type').val($(this).attr('rel'));$('#ts_form').submit();return false;}});}
function initStarRating(type,item_id,c_marks,c_counts){$('#sr_submit').hide();var c_tip=$('#mark').html();var freeze_focus=false;var settings={starWidth:30,blur:function(value,link){if(freeze_focus)return true;set_marks(c_marks,c_counts);},callback:function(value,link){$('#sr_form .rating').rating('readOnly',true);freeze_focus=true;var post_data={'type':type,'item_id':item_id,'marks':value};$.post('/ratings/do_mark',post_data,function(data,textStatus){if(textStatus=='success'){if(data.result){set_marks(data.newMarks.marks,data.newMarks.mark_counts);}else{set_marks(c_marks,c_counts);}
pop_alert(data.message);}},"json");},focus:function(value,link){if(freeze_focus)return true;set_marks(c_marks+parseInt(value),1+c_counts);},required:true};var set_marks=function(marks,counts){$('#mark').html(counts>0?marks+'/'+counts+'=<i>'+(marks/counts).toFixed(1)+'</i>':c_tip);};$('#sr_form .rating').rating(settings);}
function initLang(){$('#language a:first').click(function(){$('#langs').toggle();});}
function initTitleClick(){$('.tclick').each(function(i){$(this).click(function(){if($(this).val()==$(this).attr('title')){$(this).val('').css('color','#000');}}).blur(function(){if(!$(this).val()){$(this).val($(this).attr('title')).css('color','#CCC');}});if(!$(this).val()){$(this).val($(this).attr('title')).css('color','#CCC');}});}
function initHoverRow(){$('.hover_bg').hover(function(){$(this).css("background-color","#F2FAFF");},function(){$(this).css("background-color","transparent");});$('.hover_line').hover(function(){$(this).css("border-bottom","1px solid #F0F0F0");},function(){$(this).css("border-bottom","none");});}
function ql_del(midi_id,clickObj){$(clickObj).parents('li').fadeOut('normal',function(){PlayList.del(midi_id,function(){PlayList.updateMenu();if(PlayList.getAll().length==0){window.location.reload();}});});}
function cmt_page(url){if(url.charAt(url.length-1)=='/')url+='0';$('#cmt_list').load(url+"/ajax/"+(new Date()).getTime(),'','');$.animateGoTo('#comments');return false;}
function load_comments(type,item_id,offset){$('#cmt_list').load("/comments/show/"+type+"/"+item_id+"/"+offset+"/ajax/"+(new Date()).getTime(),'','');}
function rp(eventObj,quote_id){$(eventObj).parents('li').append($('#cmt_reply_html').html()).find('input[name=quote_id]').val(quote_id);}
function cancel_rp(eventObj){$(eventObj).parents('div.inline_form').remove();}
function add_comment(formObj){$(formObj).find('input[name=mode]').val('ajax');$(formObj).ajaxSubmit({target:'#write_cmt',beforeSubmit:function(){$(formObj).find('input[type=submit]').attr('disabled',true);},success:function(responseText,statusText){if(responseText.result){$(formObj).resetForm();$(formObj).find('.error').html('');load_comments($(formObj).find('input[name=type]').val(),$(formObj).find('input[name=item_id]').val(),0);$.animateGoTo('#comments');}else{$(formObj).find('.error').html(responseText.message);}
$(formObj).find('input[type=submit]').attr('disabled',false);},dataType:'json'});return false;}
function event_info(str){$('#event_info td').html(str);$('#event_info').show();setTimeout(function(){$('#event_info').hide()},10000);}
function ucp_ajax_submit(formObj,resetForm){$(formObj).find('input[name=mode]').val('ajax');$(formObj).ajaxSubmit({beforeSubmit:function(){$(formObj).find('input[type=submit]').attr('disabled',true);$(formObj).find('.error').html('');},success:function(responseText,statusText){if(responseText.result){event_info(responseText.message.replace(/&gt;/g,'>').replace(/&lt;/g,'<'));if(resetForm){$(formObj).resetForm();}
$(formObj).find('.error').html('');}else{for(var item in responseText.message){$('#error_'+item).text(responseText.message[item]);}}
$(formObj).find('input[type=submit]').attr('disabled',false);},dataType:'json'});return false;}
$(function(){$.ajaxSetup({cache:false});$("#loading").ajaxStart(function(){$(this).show();}).ajaxStop(function(){$(this).hide();});$('a.l').attr('href','/users/login');$('a.a').facebox({loading_image:'loading.gif',appendUrl:'/ajax'});$('#pr').fplayer();initDropdowns();initTitleClick();initHoverRow();});