/* mt.mini.js + accordion.mini.js */

var mtCookieName="mt_blog_user";var mtCookieDomain=".blog.worldending.jp";var mtCookiePath="/";var mtCookieTimeout=14400;function mtHide(id){var el=(typeof id=="string")?document.getElementById(id):id;if(el)el.style.display='none';}function mtShow(id){var el=(typeof id=="string")?document.getElementById(id):id;if(el)el.style.display='block';}function mtAttachEvent(eventName,func){var onEventName='on'+eventName;var old=window[onEventName];if(typeof old!='function')
window[onEventName]=func;else{window[onEventName]=function(evt){old(evt);return func(evt);};}}function mtFireEvent(eventName,param){var fn=window['on'+eventName];if(typeof fn=='function')return fn(param);return;}function mtRelativeDate(ts,fds){var now=new Date();var ref=ts;var delta=Math.floor((now.getTime()-ref.getTime())/1000);var str;if(delta<60){str='直前';}else if(delta<=86400){var hours=Math.floor(delta/3600);var min=Math.floor((delta%3600)/60);if(hours==1)
str='1 時間前';else if(hours>1)
str='2 時間前'.replace(/2/,hours);else if(min==1)
str='1 分前';else
str='2 分前'.replace(/2/,min);}else if(delta<=604800){var days=Math.floor(delta/86400);var hours=Math.floor((delta%86400)/3600);if(days==1)
str='1 日前';else if(days>1)
str='2 日前'.replace(/2/,days);else if(hours==1)
str='1 時間前';else
str='2 時間前'.replace(/2/,hours);}return str?str:fds;}function mtEditLink(entry_id,author_id){var u=mtGetUser();if(!u)return;if(!entry_id)return;if(!author_id)return;if(u.id!=author_id)return;var link='<a href="mt.cgi?__mode=view&amp;_type=entry&amp;id='+entry_id+'">編集</a>';document.write(link);}function mtCommentFormOnFocus(){mtShowCaptcha();}var mtCaptchaVisible=false;function mtShowCaptcha(){var u=mtGetUser();if(u&&u.is_authenticated)return;if(mtCaptchaVisible)return;var div=document.getElementById('comments-open-captcha');if(div){div.innerHTML='';mtCaptchaVisible=true;}}var is_preview;var user;function mtSetUser(u){if(u){user=u;mtSaveUser();mtFireEvent('usersignin');}}function mtEscapeJS(s){s=s.replace(/'/g,"&apos;");return s;}function mtUnescapeJS(s){s=s.replace(/&apos;/g,"'");return s;}function mtBakeUserCookie(u){var str="";if(u.name)str+="name:'"+mtEscapeJS(u.name)+"';";if(u.url)str+="url:'"+mtEscapeJS(u.url)+"';";if(u.email)str+="email:'"+mtEscapeJS(u.email)+"';";if(u.is_authenticated)str+="is_authenticated:'1';";if(u.profile)str+="profile:'"+mtEscapeJS(u.profile)+"';";if(u.userpic)str+="userpic:'"+mtEscapeJS(u.userpic)+"';";if(u.sid)str+="sid:'"+mtEscapeJS(u.sid)+"';";str+="is_trusted:'"+(u.is_trusted?"1":"0")+"';";str+="is_author:'"+(u.is_author?"1":"0")+"';";str+="is_banned:'"+(u.is_banned?"1":"0")+"';";str+="can_post:'"+(u.can_post?"1":"0")+"';";str+="can_comment:'"+(u.can_comment?"1":"0")+"';";str=str.replace(/;$/,'');return str;}function mtUnbakeUserCookie(s){if(!s)return;var u={};var m;while(m=s.match(/^((name|url|email|is_authenticated|profile|userpic|sid|is_trusted|is_author|is_banned|can_post|can_comment):'([^']+?)';?)/)){s=s.substring(m[1].length);if(m[2].match(/^(is|can)_/))
u[m[2]]=m[3]=='1'?true:false;else
u[m[2]]=mtUnescapeJS(m[3]);}if(u.is_authenticated){u.is_anonymous=false;}else{u.is_anonymous=true;u.can_post=false;u.is_author=false;u.is_banned=false;u.is_trusted=false;}return u;}function mtGetUser(){if(!user){var cookie=mtGetCookie(mtCookieName);if(!cookie)return;user=mtUnbakeUserCookie(cookie);if(!user){user={};user.is_anonymous=true;user.can_post=false;user.is_author=false;user.is_banned=false;user.is_trusted=false;}}return user;}var mtFetchedUser=false;function mtFetchUser(cb){if(!cb)cb='mtSetUser';if((cb=='mtSetUser')&&mtGetUser()){var url=document.URL;url=url.replace(/#.+$/,'');url+='#comments-open';location.href=url;}else{mtFetchedUser=true;var script=document.createElement('script');var ts=new Date().getTime();script.src='http://blog.worldending.jp/mt/mt-world-ending-comments.cgi?__mode=session_js&blog_id=1&jsonp='+cb+'&ts='+ts;(document.getElementsByTagName('head'))[0].appendChild(script);}}function mtRememberMeOnClick(b){if(!b.checked)
mtClearUser(b.form);return true;}var mtRequestSubmitted=false;function mtCommentOnSubmit(f){if(!mtRequestSubmitted){mtRequestSubmitted=true;if(f.armor)
f.armor.value='ec69b235ac9e34fa11328da2030e0a6571601431';if(f.bakecookie&&f.bakecookie.checked)
mtSaveUser(f);if(f.preview_button)f.preview_button.disabled=true;if(f.post)f.post.disabled=true;var u=mtGetUser();if(!is_preview&&(u&&u.is_authenticated)){mtFetchedUser=false;mtFetchUser('mtCommentSessionVerify');return false;}return true;}return false;}function mtCommentSessionVerify(app_user){var u=mtGetUser();var f=document['comments_form'];if(u&&app_user&&app_user.sid&&(u.sid==app_user.sid)){f.submit();}else{alert('セッションの有効期限が切れています。再度サインインしてください。');mtClearUser();mtFireEvent('usersignin');}}function mtUserOnLoad(){var u=mtGetUser();if(document.getElementById('comments-form')){if(u&&u.is_authenticated){mtShow('comments-form');mtHide('comments-open-data');if(mtCaptchaVisible)
mtHide('comments-open-captcha');}else{}if(u&&u.is_banned)
mtHide('comments-form');if(is_preview)
mtShowCaptcha();else
mtShowGreeting();var cf=document['comments_form'];if(cf){if(u&&u.is_anonymous){if(u.email)cf.email.value=u.email;if(u.name)cf.author.value=u.name;if(u.url)cf.url.value=u.url;if(cf.bakecookie)
cf.bakecookie.checked=u.name||u.email;}else{if(u&&u.sid&&cf.sid)
cf.sid.value=u.sid;}if(cf.post.disabled)
cf.post.disabled=false;if(cf.preview_button.disabled)
cf.preview_button.disabled=false;mtRequestSubmitted=false;}}}function mtEntryOnLoad(){mtHide('trackbacks-info');mtFireEvent('usersignin');}function mtEntryOnUnload(){if(mtRequestSubmitted){var cf=document['comments_form'];if(cf){if(cf.post&&cf.post.disabled)
cf.post.disabled=false;if(cf.preview_button&&cf.preview_button.disabled)
cf.preview_button.disabled=false;}mtRequestSubmitted=false;}return true;}mtAttachEvent('usersignin',mtUserOnLoad);function mtSignIn(){var doc_url=document.URL;doc_url=doc_url.replace(/#.+/,'');var url='http://blog.worldending.jp/mt/mt-cp.cgi?__mode=login&blog_id=1';if(is_preview){if(document['comments_form']){var entry_id=document['comments_form'].entry_id.value;url+='&entry_id='+entry_id;}else{url+='&return_url=http%3A%2F%2Fblog.worldending.jp%2F';}}else{url+='&return_url='+encodeURIComponent(doc_url);}mtClearUser();location.href=url;}function mtSignInOnClick(sign_in_element){var el;if(sign_in_element){el=document.getElementById(sign_in_element);if(!el)
el=document.getElementById('comment-form-external-auth');}if(el)
el.innerHTML='サインインします...<span class="status-indicator">&nbsp;</span>';mtClearUser();mtFetchUser('mtSetUserOrLogin');return false;}function mtSetUserOrLogin(u){if(u&&u.is_authenticated){mtSetUser(u);}else{mtSignIn();}}function mtSignOut(entry_id){mtClearUser();var doc_url=document.URL;doc_url=doc_url.replace(/#.+/,'');var url='http://blog.worldending.jp/mt/mt-cp.cgi?__mode=logout&static=0';if(is_preview){if(document['comments_form']){var entry_id=document['comments_form'].entry_id.value;url+='&entry_id='+entry_id;}else{url+='&return_url=http%3A%2F%2Fblog.worldending.jp%2F';}}else{url+='&return_url='+encodeURIComponent(doc_url);}location.href=url;}function mtSignOutOnClick(){mtSignOut();return false;}function mtShowGreeting(){var reg_reqd=false;var cf=document['comments_form'];if(!cf)return;var el=document.getElementById('comment-greeting');if(!el)
el=document.getElementById('comment-form-external-auth');if(!el)return;var eid=cf.entry_id;var entry_id;if(eid)entry_id=eid.value;var phrase;var u=mtGetUser();if(u&&u.is_authenticated){if(u.is_banned){phrase='このブログにコメントする権限を持っていません。(\<a href=\"javas\cript:void(0);\" onclick=\"return mtSignOutOnClick();\"\>サインアウトする\<\/a\>)';}else{var user_link;if(u.is_author){user_link='<a href="http://blog.worldending.jp/mt/mt-world-ending-comments.cgi?__mode=edit_profile&return_url='+encodeURIComponent(location.href);user_link+='">'+u.name+'</a>';}else{if(u.url)
user_link='<a href="'+u.url+'">'+u.name+'</a>';else
user_link=u.name;}phrase='__NAME__としてサインインしています。(\<a href=\"javas\cript:void(0)\" onclick=\"return mtSignOutOnClick();\"\>サインアウト\<\/a\>)';phrase=phrase.replace(/__NAME__/,user_link);}}else{if(reg_reqd){phrase='コメントするにはまず\<a href=\"javas\cript:void(0)\" onclick=\"return mtSignInOnClick(\'comment-greeting\')\"\>サインイン\<\/a\>してください。';}else{phrase='コメントする前に\<a href=\"javas\cript:void(0)\" onclick=\"return mtSignInOnClick(\'comment-greeting\')\"\>サインイン\<\/a\>することもできます。';}}el.innerHTML=phrase;}function mtReplyCommentOnClick(parent_id,author){mtShow('comment-form-reply');var checkbox=document.getElementById('comment-reply');var label=document.getElementById('comment-reply-label');var text=document.getElementById('comment-text');var reply_text='\<a href=\"#comment-__PARENT__\" onclick=\"location.href=this.href;return false\"\>__AUTHOR__からのコメント\<\/a\>に返信';reply_text=reply_text.replace(/__PARENT__/,parent_id);reply_text=reply_text.replace(/__AUTHOR__/,author);label.innerHTML=reply_text;checkbox.value=parent_id;checkbox.checked=true;try{text.focus();}catch(e){}mtSetCommentParentID();}function mtSetCommentParentID(){var checkbox=document.getElementById('comment-reply');var parent_id_field=document.getElementById('comment-parent-id');if(!checkbox||!parent_id_field)return;var pid=0;if(checkbox.checked==true)
pid=checkbox.value;parent_id_field.value=pid;}function mtSaveUser(f){if(is_preview)return;var u=mtGetUser();if(f&&(!u||u.is_anonymous)){if(!u){u={};u.is_authenticated=false;u.can_comment=true;u.is_author=false;u.is_banned=false;u.is_anonymous=true;u.is_trusted=false;}if(f.author!=undefined)u.name=f.author.value;if(f.email!=undefined)u.email=f.email.value;if(f.url!=undefined)u.url=f.url.value;}if(!u)return;var cache_period=mtCookieTimeout*1000;if(u.is_anonymous&&f&&f.bakecookie&&f.bakecookie.checked)
cache_period=365*24*60*60*1000;var now=new Date();mtFixDate(now);now.setTime(now.getTime()+cache_period);var cmtcookie=mtBakeUserCookie(u);mtSetCookie(mtCookieName,cmtcookie,now,mtCookiePath,mtCookieDomain,location.protocol=='https:');}function mtClearUser(){user=null;mtDeleteCookie(mtCookieName,mtCookiePath,mtCookieDomain,location.protocol=='https:');}function mtSetCookie(name,value,expires,path,domain,secure){if(domain&&domain.match(/^\.?localhost$/))
domain=null;var curCookie=name+"="+escape(value)+(expires?";expires="+expires.toGMTString():"")+(path?";path="+path:"")+(domain?";domain="+domain:"")+(secure?";secure":"");document.cookie=curCookie;}function mtGetCookie(name){var prefix=name+'=';var c=document.cookie;var cookieStartIndex=c.indexOf(prefix);if(cookieStartIndex==-1)
return'';var cookieEndIndex=c.indexOf(";",cookieStartIndex+prefix.length);if(cookieEndIndex==-1)
cookieEndIndex=c.length;return unescape(c.substring(cookieStartIndex+prefix.length,cookieEndIndex));}function mtDeleteCookie(name,path,domain,secure){if(mtGetCookie(name)){if(domain&&domain.match(/^\.?localhost$/))
domain=null;document.cookie=name+"="+(path?";path="+path:"")+(domain?";domain="+domain:"")+(secure?";secure":"")+";expires=Thu,01-Jan-70 00:00:01 GMT";}}function mtFixDate(date){var skew=(new Date(0)).getTime();if(skew>0)
date.setTime(date.getTime()-skew);}function mtGetXmlHttp(){if(!window.XMLHttpRequest){window.XMLHttpRequest=function(){var types=["Microsoft.XMLHTTP","MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"];for(var i=0;i<types.length;i++){try{return new ActiveXObject(types[i]);}catch(e){}}return undefined;};}if(window.XMLHttpRequest)
return new XMLHttpRequest();}function mtInit(){if(arguments.callee.done)return;arguments.callee.done=true;if(window._timer)clearInterval(window._timer);if(window.onload&&(window.onload!==window.mtInit)){window.onload();window.onload=function(){};}}if(document.addEventListener){document.addEventListener("DOMContentLoaded",mtInit,false);}if(/WebKit/i.test(navigator.userAgent)){_timer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){mtInit();}},10);}window.onload=mtInit;var clearCookie=(window.location.hash&&window.location.hash.match(/^#_log(in|out)/))?true:false;if(clearCookie){mtClearUser();if(RegExp.$1=='in')
mtFetchUser();}else{if(is_preview&&!user)
mtFetchUser();}
jQuery.extend(jQuery.easing,{easein:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeinout:function(x,t,b,c,d){if(t<d/2)return 2*c*t*t/(d*d)+b;var ts=t-d/2;return-2*c*ts*ts/(d*d)+2*c*ts/d+c/2+b;},easeout:function(x,t,b,c,d){return-c*t*t/(d*d)+2*c*t/d+b;},expoin:function(x,t,b,c,d){var flip=1;if(c<0){flip*=-1;c*=-1;}
return flip*(Math.exp(Math.log(c)/d*t))+b;},expoout:function(x,t,b,c,d){var flip=1;if(c<0){flip*=-1;c*=-1;}
return flip*(-Math.exp(-Math.log(c)/d*(t-d))+c+1)+b;},expoinout:function(x,t,b,c,d){var flip=1;if(c<0){flip*=-1;c*=-1;}
if(t<d/2)return flip*(Math.exp(Math.log(c/2)/(d/2)*t))+b;return flip*(-Math.exp(-2*Math.log(c/2)/d*(t-d))+c+1)+b;},bouncein:function(x,t,b,c,d){return c-jQuery.easing['bounceout'](x,d-t,0,c,d)+b;},bounceout:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},bounceinout:function(x,t,b,c,d){if(t<d/2)return jQuery.easing['bouncein'](x,t*2,0,c,d)*.5+b;return jQuery.easing['bounceout'](x,t*2-d,0,c,d)*.5+c*.5+b;},elasin:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},elasout:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},elasinout:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},backin:function(x,t,b,c,d){var s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},backout:function(x,t,b,c,d){var s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},backinout:function(x,t,b,c,d){var s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;}});(function($){$.dimensions={version:'@VERSION'};$.each(['Height','Width'],function(i,name){$.fn['inner'+name]=function(){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';return num(this,name.toLowerCase())+num(this,'padding'+torl)+num(this,'padding'+borr);};$.fn['outer'+name]=function(options){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';options=$.extend({margin:false},options||{});return num(this,name.toLowerCase())
+num(this,'border'+torl+'Width')+num(this,'border'+borr+'Width')
+num(this,'padding'+torl)+num(this,'padding'+borr)
+(options.margin?(num(this,'margin'+torl)+num(this,'margin'+borr)):0);};});$.each(['Left','Top'],function(i,name){$.fn['scroll'+name]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(name=='Left'?val:$(window)['scrollLeft'](),name=='Top'?val:$(window)['scrollTop']()):this['scroll'+name]=val;}):this[0]==window||this[0]==document?self[(name=='Left'?'pageXOffset':'pageYOffset')]||$.boxModel&&document.documentElement['scroll'+name]||document.body['scroll'+name]:this[0]['scroll'+name];};});$.fn.extend({position:function(){var left=0,top=0,elem=this[0],offset,parentOffset,offsetParent,results;if(elem){offsetParent=this.offsetParent();offset=this.offset();parentOffset=offsetParent.offset();offset.top-=num(elem,'marginTop');offset.left-=num(elem,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}
return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&$.css(offsetParent,'position')=='static'))
offsetParent=offsetParent.offsetParent;return $(offsetParent);}});function num(el,prop){return parseInt($.css(el.jquery?el[0]:el,prop))||0;};})(jQuery);;(function($){$.ui=$.ui||{};$.fn.extend({accordion:function(options,data){var args=Array.prototype.slice.call(arguments,1);return this.each(function(){if(typeof options=="string"){var accordion=$.data(this,"ui-accordion");accordion[options].apply(accordion,args);}else if(!$(this).is(".ui-accordion"))
$.data(this,"ui-accordion",new $.ui.accordion(this,options));});},activate:function(index){return this.accordion("activate",index);}});$.ui.accordion=function(container,options){this.options=options=$.extend({},$.ui.accordion.defaults,options);this.element=container;$(container).addClass("ui-accordion");if(options.navigation){var current=$(container).find("a").filter(options.navigationFilter);if(current.length){if(current.filter(options.header).length){options.active=current;}else{options.active=current.parent().parent().prev();current.addClass("current");}}}
options.headers=$(container).find(options.header);options.active=findActive(options.headers,options.active);if(options.fillSpace){var maxHeight=$(container).parent().height();options.headers.each(function(){maxHeight-=$(this).outerHeight();});var maxPadding=0;options.headers.next().each(function(){maxPadding=Math.max(maxPadding,$(this).innerHeight()-$(this).height());}).height(maxHeight-maxPadding);}else if(options.autoheight){var maxHeight=0;options.headers.next().each(function(){maxHeight=Math.max(maxHeight,$(this).outerHeight());}).height(maxHeight);}
options.headers.not(options.active||"").next().hide();options.active.parent().andSelf().addClass(options.selectedClass);if(options.event)
$(container).bind((options.event)+".ui-accordion",clickHandler);};$.ui.accordion.prototype={activate:function(index){clickHandler.call(this.element,{target:findActive(this.options.headers,index)[0]});},enable:function(){this.options.disabled=false;},disable:function(){this.options.disabled=true;},destroy:function(){this.options.headers.next().css("display","");if(this.options.fillSpace||this.options.autoheight){this.options.headers.next().css("height","");}
$.removeData(this.element,"ui-accordion");$(this.element).removeClass("ui-accordion").unbind(".ui-accordion");}}
function scopeCallback(callback,scope){return function(){return callback.apply(scope,arguments);};}
function completed(cancel){if(!$.data(this,"ui-accordion"))
return;var instance=$.data(this,"ui-accordion");var options=instance.options;options.running=cancel?0:--options.running;if(options.running)
return;if(options.clearStyle){options.toShow.add(options.toHide).css({height:"",overflow:""});}
$(this).triggerHandler("change.ui-accordion",[options.data],options.change);}
function toggle(toShow,toHide,data,clickedActive,down){var options=$.data(this,"ui-accordion").options;options.toShow=toShow;options.toHide=toHide;options.data=data;var complete=scopeCallback(completed,this);options.running=toHide.size()==0?toShow.size():toHide.size();if(options.animated){if(!options.alwaysOpen&&clickedActive){$.ui.accordion.animations[options.animated]({toShow:jQuery([]),toHide:toHide,complete:complete,down:down,autoheight:options.autoheight});}else{$.ui.accordion.animations[options.animated]({toShow:toShow,toHide:toHide,complete:complete,down:down,autoheight:options.autoheight});}}else{if(!options.alwaysOpen&&clickedActive){toShow.toggle();}else{toHide.hide();toShow.show();}
complete(true);}}
function clickHandler(event){var options=$.data(this,"ui-accordion").options;if(options.disabled)
return false;if(!event.target&&!options.alwaysOpen){options.active.parent().andSelf().toggleClass(options.selectedClass);var toHide=options.active.next(),data={instance:this,options:options,newHeader:jQuery([]),oldHeader:options.active,newContent:jQuery([]),oldContent:toHide},toShow=options.active=$([]);toggle.call(this,toShow,toHide,data);return false;}
var clicked=$(event.target);if(clicked.parents(options.header).length)
while(!clicked.is(options.header))
clicked=clicked.parent();var clickedActive=clicked[0]==options.active[0];if(options.running||(options.alwaysOpen&&clickedActive))
return false;if(!clicked.is(options.header))
return;options.active.parent().andSelf().toggleClass(options.selectedClass);if(!clickedActive){clicked.parent().andSelf().addClass(options.selectedClass);}
var toShow=clicked.next(),toHide=options.active.next(),data={instance:this,options:options,newHeader:clicked,oldHeader:options.active,newContent:toShow,oldContent:toHide},down=options.headers.index(options.active[0])>options.headers.index(clicked[0]);options.active=clickedActive?$([]):clicked;toggle.call(this,toShow,toHide,data,clickedActive,down);return false;};function findActive(headers,selector){return selector!=undefined?typeof selector=="number"?headers.filter(":eq("+selector+")"):headers.not(headers.not(selector)):selector===false?$([]):headers.filter(":eq(0)");}
$.extend($.ui.accordion,{defaults:{selectedClass:"selected",alwaysOpen:true,animated:'slide',event:"click",header:"a",autoheight:true,running:0,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase();}},animations:{slide:function(options,additions){options=$.extend({easing:"swing",duration:300},options,additions);if(!options.toHide.size()){options.toShow.animate({height:"show"},options);return;}
var hideHeight=options.toHide.height(),showHeight=options.toShow.height(),difference=showHeight/hideHeight;options.toShow.css({height:0,overflow:'hidden'}).show();options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate({height:"hide"},{step:function(now){var current=(hideHeight-now)*difference;if($.browser.msie||$.browser.opera){current=Math.ceil(current);}
options.toShow.height(current);},duration:options.duration,easing:options.easing,complete:function(){if(!options.autoheight){options.toShow.css("height","auto");}
options.complete();}});},bounceslide:function(options){this.slide(options,{easing:options.down?"bounceout":"swing",duration:options.down?1000:200});},easeslide:function(options){this.slide(options,{easing:"easeinout",duration:700})}}});})(jQuery);