/*
 * Adcontrol
 */
function getAvtRubric(){var avt_rubric=avt_zone;return avt_rubric;}
function getPageWidth(){var swidth=window.innerWidth?window.innerWidth:document.all.tags("body")[0].offsetWidth;return swidth}
function getAd(kindOfAd,tiny){var screenwidth=getPageWidth();if(typeof kindOfAd=='undefined')return;ord=(typeof(ord)!='undefined')?ord:Math.random()*10000000000000000;wp=(typeof(wp)!='undefined')?wp:(((tiny=="add"&&screenwidth>=1270)||screenwidth>=1350)?"wp":"");if(kindOfAd=='skyscraper'){if((tiny=="add"&&screenwidth>=1270)||screenwidth>=1350){document.write('<scr'+'ipt language="JavaScript" src="http://ad.de.doubleclick.net/adj/P4444.ani.animemanga.de_de/'+getAvtRubric()+';kw='+wp+';'+n_pbt+';sz=120x600,160x600,200x600;tile=2;ord='+ord+'?" type="text/javascript"></scr'+'ipt>')}else{}}else if(kindOfAd=='banner'){if(document.getElementById('target_'+kindOfAd)){document.write('<scr'+'ipt language="JavaScript" src="http://ad.de.doubleclick.net/adj/P4444.ani.animemanga.de_de/'+getAvtRubric()+';kw='+wp+';'+n_pbt+';sz=468x60,728x90,728x180;tile=1;dcopt=ist;ord='+ord+'?" type="text/javascript"></scr'+'ipt>')}}else if(kindOfAd=='contentad'){if(document.getElementById('target_'+kindOfAd)){document.write('<scr'+'ipt language="JavaScript" src="http://ad.de.doubleclick.net/adj/P4444.ani.animemanga.de_de/'+getAvtRubric()+';kw='+wp+';'+n_pbt+';sz=300x250,336x280,300x600;tile=3;ord='+ord+'?" type="text/javascript"></scr'+'ipt>')}}else if(kindOfAd=='tunnelad'){if(document.getElementById('target_'+kindOfAd)){document.write('<scr'+'ipt language="JavaScript" src="http://ad.de.doubleclick.net/adj/P4444.ani.animemanga.de_de/'+getAvtRubric()+';kw='+wp+';'+n_pbt+';sz=760x300;tile=4;ord='+ord+'?" type="text/javascript"></scr'+'ipt>')}}}
isdefined=function(variable){return this[variable]===undefined?false:true;};
function moveAd(kindOfAd,tiny){var screenwidth=getPageWidth();var source_element=document.getElementById('source_'+kindOfAd);var target_element=document.getElementById('target_'+kindOfAd);var base_wrapper=document.getElementById('base-wrapper');var base_div=document.getElementById('base-div');var base_advertising_top=document.getElementById('base-advertising-top');var base_advertising_right=document.getElementById('base-advertising-right');var base_advertising_inner=document.getElementById('base-advertising-inner');if(!source_element||!target_element)return;var target_parent=target_element.parentNode;target_parent.replaceChild(source_element,target_element);source_element.style.display=source_element.tagName.toLowerCase()=='div'?'block':'inline';if(target_element){target_element.style.display='block'}if(isdefined("adtype")&&((tiny=="add"&&screenwidth>=1270)||screenwidth>=1350)){if(adtype=="wallpaper"){if(kindOfAd=="banner"){base_advertising_top.style.textAlign='right';base_advertising_top.style.marginLeft='10px'}if(kindOfAd=="skyscraper"){base_advertising_right.style.top='0px'}}else if(adtype=="expwallpaper"){if(kindOfAd=="banner"){base_advertising_top.style.textAlign='right';base_advertising_top.style.marginLeft='170px'}if(kindOfAd=="skyscraper"){base_advertising_right.style.top='90px'}}else if(adtype=="tzone"){if(kindOfAd=="contentad"){source_element.className='tunnelad'}}else if(adtype=="tunnelad1"){if(kindOfAd=="tunnelad"){source_element.className='tunnelad'}}else if(adtype=="tunnelad"){if(kindOfAd=="tunnelad"){base_advertising_inner.style.display='block'}}}else{if(kindOfAd=="banner"){base_advertising_top.style.textAlign='center'}}if(isdefined("bgcolor")&&bgcolor!==null){document.body.style.backgroundColor=bgcolor;document.body.style.cssText='background:'+bgcolor}}

/*
 * jQuery Widgets
 *
 * Copyright (c) 2009 Martin Bündgens
 */

(function($,undefined){$.suggest=function(name,prototype){$.fn[name]=function(options){return this.each(function(){var instance=$.data(this,name);if(instance){instance._destroy()}$.data(this,name,new $.suggest[name](this,options))._init()})};$.suggest[name]=function(input,options){var self=this,o=this.options=$.extend(true,{},$.suggest.defaults,$.suggest[name].defaults,options),p=o.css_prefix=o.css_prefix||"",css=o.css;this.name=name;$.each(css,function(k,v){css[k]=p+css[k]});o.ac_param={};$.each(["type","type_strict","category"],function(i,n){var v=o[n];if(v===null||v===""){return}o.ac_param[n]=v});this._status={START:"",LOADING:"",SELECT:""};if(o.status&&o.status instanceof Array&&o.status.length==3){this._status.START=o.status[0]||"";this._status.LOADING=o.status[1]||"";this._status.SELECT=o.status[2]||""}var s=this.status=$('<div style="display:none;">').addClass(css.status),l=this.list=$("<ul>").addClass(css.list),p=this.pane=$('<div style="display:none;" class="fbs-reset">').addClass(css.pane);p.append(s).append(l);if(o.parent){$(o.parent).append(p)}else{p.css("position","absolute");$(document.body).append(p)}p.bind("mousedown",function(e){self.input.data("dont_hide",true);e.stopPropagation()}).bind("mouseup",function(e){if(self.input.data("dont_hide")){self.input.focus()}self.input.removeData("dont_hide");e.stopPropagation()}).bind("click",function(e){e.stopPropagation();var s=self.get_selected();if(s){self.onselect(s,true);self.hide_all()}});var hoverover=function(e){self.hoverover_list(e)};var hoverout=function(e){self.hoverout_list(e)};l.hover(hoverover,hoverout);this.input=$(input).attr("autocomplete","off").unbind(".suggest").bind("keydown.suggest",function(e){self.keydown(e)}).bind("keypress.suggest",function(e){self.keypress(e)}).bind("keyup.suggest",function(e){self.keyup(e)}).bind("blur.suggest",function(e){self.blur(e)}).bind("textchange.suggest",function(e){self.textchange()}).bind("focus.suggest",function(e){self.focus(e)}).bind($.browser.msie?"paste.suggest":"input.suggest",function(e){clearTimeout(self.paste_timeout);self.paste_timeout=setTimeout(function(){self.textchange()},0)});this.onresize=function(e){self.invalidate_position();if(p.is(":visible")){self.position()}};$(window).bind("resize.suggest",this.onresize).bind("scroll.suggest",this.onresize)};$.suggest[name].prototype=$.extend({},$.suggest.prototype,prototype)};$.suggest.prototype={_init:function(){},_destroy:function(){this.pane.remove();this.list.remove();this.input.unbind(".suggest");$(window).unbind("resize.suggest",this.onresize).unbind("scroll.suggest",this.onresize);this.input.removeData("data.suggest")},invalidate_position:function(){self._position=null},status_start:function(){this.hide_all();this.status.siblings().hide();if(this._status.START){this.status.text(this._status.START).show();if(!this.pane.is(":visible")){this.position();this.pane_show()}}if(this._status.LOADING){this.status.removeClass("loading")}},status_loading:function(){this.status.siblings().show();if(this._status.LOADING){this.status.addClass("loading").text(this._status.LOADING).show();if(!this.pane.is(":visible")){this.position();this.pane_show()}}else{this.status.hide()}},status_select:function(){this.status.siblings().show();if(this._status.SELECT){this.status.text(this._status.SELECT).show()}else{this.status.hide()}if(this._status.LOADING){this.status.removeClass("loading")}},focus:function(e){var o=this.options;if($.trim(this.input.val())===""){this.status_start()}else{this.focus_hook(e)}},focus_hook:function(e){if(!this.input.data("data.suggest")&&!this.pane.is(":visible")&&$("."+this.options.css.item,this.list).length){this.position();this.pane_show()}},keydown:function(e){var key=e.keyCode;if(key===9){this.tab(e)}else if(key===38||key===40){if(!e.shiftKey){e.preventDefault()}}},keypress:function(e){var key=e.keyCode;if(key===38||key===40){if(!e.shiftKey){e.preventDefault()}}else if(key===13){this.enter(e)}},keyup:function(e){var key=e.keyCode;if(key===38){e.preventDefault();this.up(e)}else if(key===40){e.preventDefault();this.down(e)}else if(e.ctrlKey&&key===77){$(".fbs-more-link",this.pane).click()}else if($.suggest.is_char(e)){clearTimeout(this.keypress.timeout);var self=this;this.keypress.timeout=setTimeout(function(){self.textchange()},0)}else if(key===27){this.escape(e)}return true},blur:function(e){if(this.input.data("dont_hide")){return}var data=this.input.data("data.suggest");if(!data){this.check_required(e)}this.hide_all()},tab:function(e){if(e.shiftKey||e.metaKey||e.ctrlKey){return}var o=this.options,visible=this.pane.is(":visible")&&$("."+o.css.item,this.list).length,s=this.get_selected();if(visible&&s){this.onselect(s);this.hide_all()}},enter:function(e){var o=this.options,visible=this.pane.is(":visible");if(visible){if(e.shiftKey){this.shift_enter(e);e.preventDefault()}else if($("."+o.css.item,this.list).length){var s=this.get_selected();if(s){this.onselect(s);this.hide_all();e.preventDefault()}else{var data=this.input.data("data.suggest");if(o.soft){if(!data){this.check_required(e)}}else{if($("."+this.options.css.item+":visible",this.list).length){this.updown(false);e.preventDefault()}else if(!data){this.check_required(e)}}}}}},shift_enter:function(e){},escape:function(e){this.hide_all()},up:function(e){this.updown(true,e.ctrlKey||e.shiftKey)},down:function(e){this.updown(false,null,e.ctrlKey||e.shiftKey)},updown:function(goup,gofirst,golast){var o=this.options,css=o.css,p=this.pane,l=this.list;if(!p.is(":visible")){if(!goup){this.textchange()}return}var li=$("."+css.item+":visible",l);if(!li.length){return}var first=$(li[0]),last=$(li[li.length-1]),cur=this.get_selected()||[];clearTimeout(this.ignore_mouseover.timeout);this._ignore_mouseover=false;if(goup){if(gofirst){this._goto(first)}else if(!cur.length){this._goto(last)}else if(cur[0]==first[0]){first.removeClass(css.selected);this.input.val(this.input.data("original.suggest"));this.hoverout_list()}else{var prev=cur.prevAll("."+css.item+":visible:first");this._goto(prev)}}else{if(golast){this._goto(last)}else if(!cur.length){this._goto(first)}else if(cur[0]==last[0]){last.removeClass(css.selected);this.input.val(this.input.data("original.suggest"));this.hoverout_list()}else{var next=cur.nextAll("."+css.item+":visible:first");this._goto(next)}}},_goto:function(li){li.trigger("mouseover.suggest");var d=li.data("data.suggest");this.input.val(d?d.name:this.input.data("original.suggest"));this.scroll_to(li)},scroll_to:function(item){var l=this.list,scrollTop=l.scrollTop(),scrollBottom=scrollTop+l.innerHeight(),item_height=item.outerHeight(),offsetTop=item.prevAll().length*item_height,offsetBottom=offsetTop+item_height;if(offsetTop<scrollTop){this.ignore_mouseover();l.scrollTop(offsetTop)}else if(offsetBottom>scrollBottom){this.ignore_mouseover();l.scrollTop(scrollTop+offsetBottom-scrollBottom)}},textchange:function(){this.input.removeData("data.suggest");this.input.trigger("fb-textchange",this);var val=$.trim(this.input.val());if(val===""){this.status_start();return}else{this.status_loading()}this.request(val)},request:function(){},response:function(data){if("cost"in data){this.trackEvent(this.name,"response","cost",data.cost)}if(!this.check_response(data)){return}var result=[];if($.isArray(data)){result=data}else if("result"in data){result=data.result}var args=$.map(arguments,function(a){return a});this.response_hook.apply(this,args);var first=null,self=this,o=this.options;$.each(result,function(i,n){var li=self.create_item(n,data).bind("mouseover.suggest",function(e){self.mouseover_item(e)}).data("data.suggest",n);self.list.append(li);if(i===0){first=li}});this.input.data("original.suggest",this.input.val());if($("."+o.css.item,this.list).length===0){var $nomatch=$('<li class="nomatch">').html(o.nomatch).bind("click.suggest",function(e){e.stopPropagation()});this.list.append($nomatch)}args.push(first);this.show_hook.apply(this,args);this.position();this.pane_show()},pane_show:function(){if(!this.pane.is(":visible")){if(this.options.animate){this.pane.slideDown("fast")}else{this.pane.show()}}this.input.trigger("fb-pane-show",this)},create_item:function(data,response_data){var css=this.options.css;li=$("<li>").addClass(css.item);var label=$("<label>").text(data.name);data.name=label.text();li.append($("<div>").addClass(css.item_name).append(label));return li},mouseover_item:function(e){if(this._ignore_mouseover){return}var target=e.target;if(target.nodeName.toLowerCase()!=="li"){target=$(target).parents("li:first")}var li=$(target),css=this.options.css,l=this.list;$("."+css.item,l).each(function(){if(this!==li[0]){$(this).removeClass(css.selected)}});if(!li.hasClass(css.selected)){li.addClass(css.selected);this.mouseover_item_hook(li)}},mouseover_item_hook:function($li){},hoverover_list:function(e){},hoverout_list:function(e){},check_response:function(response_data){return true},response_hook:function(response_data){this.list.empty()},show_hook:function(response_data){this.status_select()},position:function(){var p=this.pane,o=this.options;if(o.parent){return}if(!self._position){var inp=this.input,pos=inp.offset(),input_width=inp.outerWidth(true),input_height=inp.outerHeight(true);pos.top+=input_height;var pane_width=p.outerWidth(),pane_height=p.outerHeight(),pane_right=pos.left+pane_width,pane_bottom=pos.top+pane_height,pane_half=pos.top+pane_height/2,scroll_left=$(window).scrollLeft(),scroll_top=$(window).scrollTop(),window_width=$(window).width(),window_height=$(window).height(),window_right=window_width+scroll_left,window_bottom=window_height+scroll_top;var left=true;if('left'==o.align){left=true}else if('right'==o.align){left=false}else if(pos.left>(scroll_left+window_width/2)){left=false}if(!left){left=pos.left-(pane_width-input_width);}if(pane_half>window_bottom){var top=pos.top-input_height-pane_height;if(top>scroll_top){pos.top=top}}this._position=pos}p.css({top:this._position.top,left:this._position.left})},ignore_mouseover:function(e){this._ignore_mouseover=true;var self=this;this.ignore_mouseover.timeout=setTimeout(function(){self.ignore_mouseover_reset()},1000)},ignore_mouseover_reset:function(){this._ignore_mouseover=false},get_selected:function(){var selected=null,select_class=this.options.css.selected;$("li",this.list).each(function(){var $this=$(this);if($this.hasClass(select_class)&&$this.is(":visible")){selected=$this;return false}});return selected},onselect:function($selected,focus){var data=$selected.data("data.suggest");if(data){this.input.val(data.name).data("data.suggest",data).trigger("fb-select",data);this.trackEvent(this.name,"fb-select","index",$selected.prevAll().length)}},trackEvent:function(category,action,label,value){this.input.trigger("fb-track-event",{category:category,action:action,label:label,value:value})},check_required:function(e){var required=this.options.required;if(required===true){if(!$.trim(this.input.val())){this.input.trigger("fb-required",{domEvent:e});return false}}else if(required==="always"){this.input.trigger("fb-required",{domEvent:e});return false}return true},hide_all:function(e){this.pane.hide();this.input.trigger("fb-pane-hide",this)}};$.extend($.suggest,{defaults:{status:['Start typing to get suggestions...','Searching...','Select an item from the list:'],required:false,soft:false,nomatch:"no matches",css:{pane:"fbs-pane",list:"fbs-list",item:"fbs-item",item_name:"fbs-item-name",selected:"fbs-selected",status:"fbs-status"},css_prefix:null,parent:null,animate:true},$$:function(cls,ctx){return $("."+cls,ctx)},strongify:function(str,substr){var strong=str;var index=str.toLowerCase().indexOf(substr.toLowerCase());if(index>=0){var substr_len=substr.length;strong=$("<div>").text(str.substring(0,index)).append($("<strong>").text(str.substring(index,index+substr_len))).append(document.createTextNode(str.substring(index+substr_len))).html()}return strong},keyCode:{CAPS_LOCK:20,CONTROL:17,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ENTER:108,PAGE_DOWN:34,PAGE_UP:33,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,OPTION:18,APPLE:224},is_char:function(e){if(e.type==="keypress"){if((e.metaKey||e.ctrlKey)&&e.charCode===118){return true}else if("isChar"in e){return e.isChar}}else{var not_char=$.suggest.keyCode.not_char;if(!not_char){not_char={};$.each($.suggest.keyCode,function(k,v){not_char[''+v]=1});$.suggest.keyCode.not_char=not_char}return!((''+e.keyCode)in not_char)}}});var base={_destroy:$.suggest.prototype._destroy,show_hook:$.suggest.prototype.show_hook};$.suggest("suggest",{_init:function(){var self=this,o=this.options;this.jsonp=false;if(!$.suggest.cache){$.suggest.cache={}}},_destroy:function(){base._destroy.call(this);this.input.removeData("request.count.suggest")},shift_enter:function(e){if(this.options.suggest_new){this.suggest_new();this.hide_all()}else{this.check_required(e)}},hide_all:function(e){this.pane.hide();this.input.trigger("fb-pane-hide",this)},request:function(val,start){var self=this,o=this.options;if(this.ac_xhr){this.ac_xhr.abort();this.ac_xhr=null}var data={prefix:val};if(start){data.start=start}$.extend(data,o.ac_param);var url=o.service_path+"?"+$.param(data),cached=$.suggest.cache[url];if(cached){this.response(cached,start?start:-1,true);return}clearTimeout(this.request.timeout);this.request.timeout=setTimeout(function(){self.ac_xhr=$.ajax({url:o.service_path,data:data,beforeSend:function(){var calls=self.input.data("request.count.suggest")||0;if(!calls){self.trackEvent(self.name,"start_session")}calls+=1;self.trackEvent(self.name,"request","count",calls);self.input.data("request.count.suggest",calls)},success:function(data){$.suggest.cache[url]=data;self.response(data,start?start:-1)},error:function(xhr){self.trackEvent(self.name,"request","error",{url:this.url,response:xhr?xhr.responseText:''})},complete:function(xhr){if(xhr){self.trackEvent(self.name,"request","tid",xhr.getResponseHeader("X-Metaweb-TID"))}},dataType:self.jsonp?"jsonp":"json",cache:true})},200)},create_item:function(data,response_data){var css=this.options.css;var li=$("<li>").addClass(css.item);var name=$("<div>").addClass(css.item_name).append($("<label>").append($.suggest.strongify(data.name||data.guid,response_data.prefix))),types=data.type;data.name=name.text();li.append(name);if(types){var notable=data['notable:type'],notable_name,notable_name2;$.each(types,function(i,t){if(t.id===notable){notable_name=t.name}if(!notable_name2){notable_name2=t.name}});if(notable_name||notable_name2){name.prepend($("<div>").addClass(css.item_type).text(notable_name||notable_name2||"Topic"))}}return li},check_response:function(response_data){return response_data.prefix===$.trim(this.input.val())},response_hook:function(response_data,start){if(start>0){$(".fbs-more",this.pane).remove()}else{this.list.empty()}},show_hook:function(response_data,start,first){base.show_hook.apply(this,[response_data]);var o=this.options,self=this,p=this.pane,l=this.list,result=response_data.result;var more=$(".fbs-more",p),suggestnew=$(".fbs-suggestnew",p);if(result&&result.length&&"start"in response_data){if(!more.length){var more_link=$('<a class="fbs-more-link" href="#" title="(Ctrl+m)">view more</a>');more=$('<div class="fbs-more">').append(more_link);more_link.bind("click.suggest",function(e){e.preventDefault();e.stopPropagation();var m=$(this).parent(".fbs-more");self.more(m.data("start.suggest"))});l.after(more)}more.data("start.suggest",response_data.start);more.show()}else{more.remove()}if(o.suggest_new){if(!suggestnew.length){var button=$('<button class="fbs-suggestnew-button">');button.text(o.suggest_new);suggestnew=$('<div class="fbs-suggestnew">').append('<div class="fbs-suggestnew-description">Your item not in the list?</div>').append(button).append('<span class="fbs-suggestnew-shortcut">(Shift+Enter)</span>').bind("click.suggest",function(e){e.stopPropagation();self.suggest_new(e)});p.append(suggestnew)}suggestnew.show()}else{suggestnew.remove()}if(first&&first.length&&start>0){var top=first.prevAll().length*first.outerHeight();var scrollTop=l.scrollTop();l.animate({scrollTop:top},"slow",function(){first.trigger("mouseover.suggest")})}},suggest_new:function(e){var val=$.trim(this.input.val());if(!val){return}this.input.data("data.suggest",val).trigger("fb-select-new",val);this.trackEvent(this.name,"fb-select-new","index","new");this.hide_all()},more:function(start){if(start){var orig=this.input.data("original.suggest");if(orig!==null){this.input.val(orig)}this.request($.trim(this.input.val()),start);this.trackEvent(this.name,"more","start",start)}return false}});$.extend($.suggest.suggest,{defaults:{type:null,service_path:"/ajax/search.php",align:null,suggest_new:null,nomatch:'<em class="fbs-nomatch-text">No suggested matches.</em><h3>Tips on getting better suggestions:</h3><ul class="fbs-search-tips"><li>Enter more or fewer characters</li><li>Add words related to your original search</li><li>Try alternate spellings</li><li>Check your spelling</li></ul>',css:{item_type:"fbs-item-type"}}})})(jQuery);
(function($){$.fn.boxinfo=function(options){var opts=$.extend({},$.fn.boxinfo.defaults,options);if($(opts.ttC).length==0)$('<div id="'+opts.ttC.slice(1)+'"></div>').appendTo("body");var closeBox=function(){$(opts.ttC).hide().empty()};$(".box-close").bind("click",closeBox);var getData=function(obj,e){if(opts.source=="ajax"||opts.source=="info"){getPosition(e);$(opts.ttC).html('<div><img src="'+opts.loadingImg+'"/> '+opts.loadingText+'</div>').show();var input_id=(opts.source=="info"&&$(obj).attr('id'))?'id='+$(obj).attr('id'):null;$.ajax({type:opts.type,url:opts.url,data:input_id,success:function(msg){$(opts.ttC).html(msg);$(".box-close").unbind("click",closeBox);$(".box-close").bind("click",closeBox)}})}else if(opts.source=="container"){$(opts.ttC).show().empty()}};var getPosition=function(e){var top=e.pageY+opts.topOff;var left=e.pageX+opts.leftOff;$(opts.ttC).css({top:top,left:left,opacity:opts.opacity}).show()};if(opts.trigger=="hover"){$(this).bind("mouseover",function(e){e.preventDefault();getData(this,e);return false});$(this).bind("mousemove",function(e){getPosition(e);return false});$(this).bind("mouseout",function(e){$(opts.ttC).hide().empty();return false})}if(opts.trigger=="click"){$(this).bind("click",function(e){var input_id=$(this).attr('id');getData(this,e);getPosition(e);$(document).bind("click",function(e){if(opts.autoClose){$(opts.ttC).hide().empty()}});return false})}};$.fn.boxinfo.defaults={trigger:"click",topOff:3,leftOff:10,source:"container",attrName:'',ttC:"#boxinfo-container",opacity:1.0,loadingImg:"http://static.animemanga.com/loading.gif",loadingText:"Loading...",type:"GET",autoClose:true}})(jQuery);
(function($){$.fn.amSlider=function(){var cids=["slider_c0","slider_c1","slider_c2","slider_c3"];var ids=["slider_t0","slider_t1","slider_t2","slider_t3"];var bids={slider_t0:0,slider_t1:1,slider_t2:2,slider_t3:3};var active=-1;var rotate=null;var after_first=false;var button_next="next_cid";var button_prev="prev_cid";var button_stop="stop";$.each(bids,function(i,val){$("#"+i).click(function(){slider_makeActive(val)})});$("#"+button_prev).click(function(){slider_prev()});$("#"+button_stop).click(function(){slider_pause(this)});$("#"+button_next).click(function(){slider_next()});var slider_mkActive=function(newActive){if(newActive<0||newActive>=ids.length){return}$("#"+ids[newActive]).siblings().addClass('slider_bg_inactive');$("#"+ids[newActive]).siblings().removeClass('slider_bg_active');$("#"+ids[newActive]).removeClass('slider_bg_inactive');$("#"+ids[newActive]).addClass('slider_bg_active');active=newActive;$("#"+cids[active]).css({"display":"block"});$("#"+cids[active]).siblings().css({"display":"none"})};var slider_slide=function(){var i=active+1;if(i>=ids.length){i=0}slider_mkActive(i)};var slider_redo=function(){if(rotate){window.clearInterval(rotate);rotate=window.setInterval(slider_slide,3000)}};var slider_makeActive=function(newActive){slider_mkActive(newActive);slider_redo()};var slider_prev=function(){var i=active-1;if(i<0){i=ids.length-1}slider_mkActive(i);slider_redo()};var slider_prev=function(){var i=active-1;if(i<0){i=ids.length-1}slider_mkActive(i);slider_redo()};var slider_next=function(){slider_slide();slider_redo()};var slider_pause=function(node){if(rotate){window.clearInterval(rotate);rotate=null;node.src='/img/arrows/stop-active.gif'}else if(after_first){rotate=window.setInterval(slider_slide,3000);node.src='/img/arrows/stop-inactive.gif'}};var slider_startSlide=function(){if(rotate){slider_slide();slider_redo()}};var slider_first=function(){slider_makeActive(0);rotate=window.setTimeout(slider_startSlide,5000);after_first=true};slider_first()}})(jQuery);
(function($){$.fn.amNotice=function(){var path=window.location.pathname;var screenwidth=getPageWidth();var notice_start=function(){$.ajax({type:"GET",url:"/ajax/note.php",success:function(html){$("#header").after(html)}})};if((path=="/"||path=="/index.php")&&screenwidth<1000){notice_start()}}})(jQuery);

(function($){$.fn.amLivePage=function()
	{
		var livepage=function()
		{
			$.get("/ajax/live.php", { u: animemanga_user_id, h: animemanga_hash, t: animemanga_timestamp },
			function(html)
			{
				if(html)
				{
					if ($("#warning").length != 0) {
						$("#warning").remove();
					}
					$("#header").after(html);
				}
				else
				{
					if ($("#warning").length != 0) {
						$("#warning").remove();
					}
				}
				window.setTimeout(livepage, 120000)
			});
		}
		livepage();
}})(jQuery);

(function($){$.fn.codaSlider=function(settings){var j=0;settings=jQuery.extend({},settings);return this.each(function(){var container=jQuery(this);container.find("p.loading").remove();container.removeClass("csw").addClass("stripViewer");var panelWidth=container.find("div.panel").width();var panelCount=container.find("div.panel").size();var stripViewerWidth=panelWidth*panelCount;container.find("div.panelContainer").css("width",stripViewerWidth);var navWidth=panelCount*2;if(location.hash&&parseInt(location.hash.slice(1))<=panelCount){var cPanel=parseInt(location.hash.slice(1));var cnt=-(panelWidth*(cPanel-1));jQuery(this).find("div.panelContainer").css({left:cnt})}else{var cPanel=1};container.each(function(i){jQuery(this).before("<div class='stripNavL' id='stripNavL"+j+"'><a href='#'>Left</a><\/div>");jQuery(this).after("<div class='stripNavR' id='stripNavR"+j+"'><a href='#'>Right</a><\/div>");jQuery("div#stripNavL"+j+" a").click(function(){if(cPanel==1){var cnt=-(panelWidth*(panelCount-1));cPanel=panelCount;jQuery(this).parent().parent().find("div.stripNav a.current").removeClass("current").parent().parent().find("li:last a").addClass("current")}else{cPanel-=1;var cnt=-(panelWidth*(cPanel-1));jQuery(this).parent().parent().find("div.stripNav a.current").removeClass("current").parent().prev().find("a").addClass("current")};jQuery(this).parent().parent().find("div.panelContainer").animate({left:cnt},settings.easeTime,settings.easeFunc);location.hash=cPanel;return false});jQuery("div#stripNavR"+j+" a").click(function(){if(cPanel==panelCount){var cnt=0;cPanel=1;jQuery(this).parent().parent().find("div.stripNav a.current").removeClass("current").parent().parent().find("a:eq(0)").addClass("current")}else{var cnt=-(panelWidth*cPanel);cPanel+=1;jQuery(this).parent().parent().find("div.stripNav a.current").removeClass("current").parent().next().find("a").addClass("current")};jQuery(this).parent().parent().find("div.panelContainer").animate({left:cnt},settings.easeTime,settings.easeFunc);location.hash=cPanel;return false})});j++})}})(jQuery);
(function($){var abs=Math.abs,max=Math.max,min=Math.min,round=Math.round;function div(){return $('<div/>')}$.imgAreaSelect=function(img,options){var $img=$(img),imgLoaded,$box=div(),$area=div(),$border=div().add(div()).add(div()).add(div()),$outer=div().add(div()).add(div()).add(div()),$handles=$([]),$areaOpera,left,top,imgOfs,imgWidth,imgHeight,$parent,parOfs,zIndex=0,position='absolute',startX,startY,scaleX,scaleY,resizeMargin=10,resize,aspectRatio,shown,x1,y1,x2,y2,selection={x1:0,y1:0,x2:0,y2:0,width:0,height:0},$p,d,i,o,w,h,adjusted;function viewX(x){return x+imgOfs.left-parOfs.left}function viewY(y){return y+imgOfs.top-parOfs.top}function selX(x){return x-imgOfs.left+parOfs.left}function selY(y){return y-imgOfs.top+parOfs.top}function evX(event){return event.pageX-parOfs.left}function evY(event){return event.pageY-parOfs.top}function getSelection(noScale){var sx=noScale||scaleX,sy=noScale||scaleY;return{x1:round(selection.x1*sx),y1:round(selection.y1*sy),x2:round(selection.x2*sx),y2:round(selection.y2*sy),width:round(selection.x2*sx)-round(selection.x1*sx),height:round(selection.y2*sy)-round(selection.y1*sy)}}function setSelection(x1,y1,x2,y2,noScale){var sx=noScale||scaleX,sy=noScale||scaleY;selection={x1:round(x1/sx),y1:round(y1/sy),x2:round(x2/sx),y2:round(y2/sy)};selection.width=(x2=viewX(selection.x2))-(x1=viewX(selection.x1));selection.height=(y2=viewX(selection.y2))-(y1=viewX(selection.y1))}function adjust(){if(!$img.width())return;imgOfs={left:round($img.offset().left),top:round($img.offset().top)};imgWidth=$img.width();imgHeight=$img.height();if($().jquery=='1.3.2'&&$.browser.safari&&position=='fixed'){imgOfs.top+=max(document.documentElement.scrollTop,$('body').scrollTop());imgOfs.left+=max(document.documentElement.scrollLeft,$('body').scrollLeft())}parOfs=$.inArray($parent.css('position'),['absolute','relative'])+1?{left:round($parent.offset().left)-$parent.scrollLeft(),top:round($parent.offset().top)-$parent.scrollTop()}:position=='fixed'?{left:$(document).scrollLeft(),top:$(document).scrollTop()}:{left:0,top:0};left=viewX(0);top=viewY(0)}function update(resetKeyPress){if(!shown)return;$box.css({left:viewX(selection.x1),top:viewY(selection.y1)}).add($area).width(w=selection.width).height(h=selection.height);$area.add($border).add($handles).css({left:0,top:0});$border.width(max(w-$border.outerWidth()+$border.innerWidth(),0)).height(max(h-$border.outerHeight()+$border.innerHeight(),0));$($outer[0]).css({left:left,top:top,width:selection.x1,height:imgHeight});$($outer[1]).css({left:left+selection.x1,top:top,width:w,height:selection.y1});$($outer[2]).css({left:left+selection.x2,top:top,width:imgWidth-selection.x2,height:imgHeight});$($outer[3]).css({left:left+selection.x1,top:top+selection.y2,width:w,height:imgHeight-selection.y2});w-=$handles.outerWidth();h-=$handles.outerHeight();switch($handles.length){case 8:$($handles[4]).css({left:w/2});$($handles[5]).css({left:w,top:h/2});$($handles[6]).css({left:w/2,top:h});$($handles[7]).css({top:h/2});case 4:$handles.slice(1,3).css({left:w});$handles.slice(2,4).css({top:h})}if(resetKeyPress!==false){if($.imgAreaSelect.keyPress!=docKeyPress)$(document).unbind($.imgAreaSelect.keyPress,$.imgAreaSelect.onKeyPress);if(options.keys)$(document)[$.imgAreaSelect.keyPress]($.imgAreaSelect.onKeyPress=docKeyPress)}if($.browser.msie&&$border.outerWidth()-$border.innerWidth()==2){$border.css('margin',0);setTimeout(function(){$border.css('margin','auto')},0)}}function doUpdate(resetKeyPress){adjust();update(resetKeyPress);x1=viewX(selection.x1);y1=viewY(selection.y1);x2=viewX(selection.x2);y2=viewY(selection.y2)}function hide($elem,fn){options.fadeSpeed?$elem.fadeOut(options.fadeSpeed,fn):$elem.hide()}function areaMouseMove(event){var x=selX(evX(event))-selection.x1,y=selY(evY(event))-selection.y1;if(!adjusted){adjust();adjusted=true;$box.one('mouseout',function(){adjusted=false})}resize='';if(options.resizable){if(y<=resizeMargin)resize='n';else if(y>=selection.height-resizeMargin)resize='s';if(x<=resizeMargin)resize+='w';else if(x>=selection.width-resizeMargin)resize+='e'}$box.css('cursor',resize?resize+'-resize':options.movable?'move':'');if($areaOpera)$areaOpera.toggle()}function docMouseUp(event){$('body').css('cursor','');if(options.autoHide||selection.width*selection.height==0)hide($box.add($outer),function(){$(this).hide()});options.onSelectEnd(img,getSelection());$(document).unbind('mousemove',selectingMouseMove);$box.mousemove(areaMouseMove)}function areaMouseDown(event){if(event.which!=1)return false;adjust();if(resize){$('body').css('cursor',resize+'-resize');x1=viewX(selection[/w/.test(resize)?'x2':'x1']);y1=viewY(selection[/n/.test(resize)?'y2':'y1']);$(document).mousemove(selectingMouseMove).one('mouseup',docMouseUp);$box.unbind('mousemove',areaMouseMove)}else if(options.movable){startX=left+selection.x1-evX(event);startY=top+selection.y1-evY(event);$box.unbind('mousemove',areaMouseMove);$(document).mousemove(movingMouseMove).one('mouseup',function(){options.onSelectEnd(img,getSelection());$(document).unbind('mousemove',movingMouseMove);$box.mousemove(areaMouseMove)})}else $img.mousedown(event);return false}function aspectRatioXY(){x2=max(left,min(left+imgWidth,x1+abs(y2-y1)*aspectRatio*(x2>x1||-1)));y2=round(max(top,min(top+imgHeight,y1+abs(x2-x1)/aspectRatio*(y2>y1||-1))));x2=round(x2)}function aspectRatioYX(){y2=max(top,min(top+imgHeight,y1+abs(x2-x1)/aspectRatio*(y2>y1||-1)));x2=round(max(left,min(left+imgWidth,x1+abs(y2-y1)*aspectRatio*(x2>x1||-1))));y2=round(y2)}function doResize(){if(abs(x2-x1)<options.minWidth){x2=x1-options.minWidth*(x2<x1||-1);if(x2<left)x1=left+options.minWidth;else if(x2>left+imgWidth)x1=left+imgWidth-options.minWidth}if(abs(y2-y1)<options.minHeight){y2=y1-options.minHeight*(y2<y1||-1);if(y2<top)y1=top+options.minHeight;else if(y2>top+imgHeight)y1=top+imgHeight-options.minHeight}x2=max(left,min(x2,left+imgWidth));y2=max(top,min(y2,top+imgHeight));if(aspectRatio)if(abs(x2-x1)/aspectRatio>abs(y2-y1))aspectRatioYX();else aspectRatioXY();if(abs(x2-x1)>options.maxWidth){x2=x1-options.maxWidth*(x2<x1||-1);if(aspectRatio)aspectRatioYX()}if(abs(y2-y1)>options.maxHeight){y2=y1-options.maxHeight*(y2<y1||-1);if(aspectRatio)aspectRatioXY()}selection={x1:selX(min(x1,x2)),x2:selX(max(x1,x2)),y1:selY(min(y1,y2)),y2:selY(max(y1,y2)),width:abs(x2-x1),height:abs(y2-y1)};update();options.onSelectChange(img,getSelection())}function selectingMouseMove(event){x2=resize==''||/w|e/.test(resize)||aspectRatio?evX(event):viewX(selection.x2);y2=resize==''||/n|s/.test(resize)||aspectRatio?evY(event):viewY(selection.y2);doResize();return false}function doMove(newX1,newY1){x2=(x1=newX1)+selection.width;y2=(y1=newY1)+selection.height;selection=$.extend(selection,{x1:selX(x1),y1:selY(y1),x2:selX(x2),y2:selY(y2)});update();options.onSelectChange(img,getSelection())}function movingMouseMove(event){x1=max(left,min(startX+evX(event),left+imgWidth-selection.width));y1=max(top,min(startY+evY(event),top+imgHeight-selection.height));doMove(x1,y1);event.preventDefault();return false}function startSelection(){adjust();x2=x1;y2=y1;doResize();resize='';if($outer.is(':not(:visible)'))$box.add($outer).hide().fadeIn(options.fadeSpeed||0);shown=true;$(document).unbind('mouseup',cancelSelection).mousemove(selectingMouseMove).one('mouseup',docMouseUp);$box.unbind('mousemove',areaMouseMove);options.onSelectStart(img,getSelection())}function cancelSelection(){$(document).unbind('mousemove',startSelection);hide($box.add($outer));selection={x1:selX(x1),y1:selY(y1),x2:selX(x1),y2:selY(y1),width:0,height:0};options.onSelectChange(img,getSelection());options.onSelectEnd(img,getSelection())}function imgMouseDown(event){if(event.which!=1||$outer.is(':animated'))return false;adjust();startX=x1=evX(event);startY=y1=evY(event);$(document).one('mousemove',startSelection).one('mouseup',cancelSelection);return false}function parentScroll(){doUpdate(false)}function imgLoad(){imgLoaded=true;setOptions(options=$.extend({classPrefix:'imgareaselect',movable:true,resizable:true,parent:'body',onInit:function(){},onSelectStart:function(){},onSelectChange:function(){},onSelectEnd:function(){}},options));$box.add($outer).css({visibility:''});if(options.show){shown=true;adjust();update();$box.add($outer).hide().fadeIn(options.fadeSpeed||0)}setTimeout(function(){options.onInit(img,getSelection())},0)}var docKeyPress=function(event){var k=options.keys,d,t,key=event.keyCode||event.which;d=!isNaN(k.alt)&&(event.altKey||event.originalEvent.altKey)?k.alt:!isNaN(k.ctrl)&&event.ctrlKey?k.ctrl:!isNaN(k.shift)&&event.shiftKey?k.shift:!isNaN(k.arrows)?k.arrows:10;if(k.arrows=='resize'||(k.shift=='resize'&&event.shiftKey)||(k.ctrl=='resize'&&event.ctrlKey)||(k.alt=='resize'&&(event.altKey||event.originalEvent.altKey))){switch(key){case 37:d=-d;case 39:t=max(x1,x2);x1=min(x1,x2);x2=max(t+d,x1);if(aspectRatio)aspectRatioYX();break;case 38:d=-d;case 40:t=max(y1,y2);y1=min(y1,y2);y2=max(t+d,y1);if(aspectRatio)aspectRatioXY();break;default:return}doResize()}else{x1=min(x1,x2);y1=min(y1,y2);switch(key){case 37:doMove(max(x1-d,left),y1);break;case 38:doMove(x1,max(y1-d,top));break;case 39:doMove(x1+min(d,imgWidth-selX(x2)),y1);break;case 40:doMove(x1,y1+min(d,imgHeight-selY(y2)));break;default:return}}return false};function styleOptions($elem,props){for(option in props)if(options[option]!==undefined)$elem.css(props[option],options[option])}function setOptions(newOptions){if(newOptions.parent)($parent=$(newOptions.parent)).append($box.add($outer));options=$.extend(options,newOptions);adjust();if(newOptions.handles!=null){$handles.remove();$handles=$([]);i=newOptions.handles?newOptions.handles=='corners'?4:8:0;while(i--)$handles=$handles.add(div());$handles.addClass(options.classPrefix+'-handle').css({position:'absolute',fontSize:0,zIndex:zIndex+1||1});if(!parseInt($handles.css('width')))$handles.width(5).height(5);if(o=options.borderWidth)$handles.css({borderWidth:o,borderStyle:'solid'});styleOptions($handles,{borderColor1:'border-color',borderColor2:'background-color',borderOpacity:'opacity'})}scaleX=options.imageWidth/imgWidth||1;scaleY=options.imageHeight/imgHeight||1;if(newOptions.x1!=null){setSelection(newOptions.x1,newOptions.y1,newOptions.x2,newOptions.y2);newOptions.show=!newOptions.hide}if(newOptions.keys)options.keys=$.extend({shift:1,ctrl:'resize'},newOptions.keys);$outer.addClass(options.classPrefix+'-outer');$area.addClass(options.classPrefix+'-selection');for(i=0;i++<4;)$($border[i-1]).addClass(options.classPrefix+'-border'+i);styleOptions($area,{selectionColor:'background-color',selectionOpacity:'opacity'});styleOptions($border,{borderOpacity:'opacity',borderWidth:'border-width'});styleOptions($outer,{outerColor:'background-color',outerOpacity:'opacity'});if(o=options.borderColor1)$($border[0]).css({borderStyle:'solid',borderColor:o});if(o=options.borderColor2)$($border[1]).css({borderStyle:'dashed',borderColor:o});$box.append($area.add($border).add($handles).add($areaOpera));if($.browser.msie){if(o=$outer.css('filter').match(/opacity=([0-9]+)/))$outer.css('opacity',o[1]/100);if(o=$border.css('filter').match(/opacity=([0-9]+)/))$border.css('opacity',o[1]/100)}if(newOptions.hide)hide($box.add($outer));else if(newOptions.show&&imgLoaded){shown=true;$box.add($outer).fadeIn(options.fadeSpeed||0);doUpdate()}aspectRatio=(d=(options.aspectRatio||'').split(/:/))[0]/d[1];if(options.disable||options.enable===false){$box.unbind('mousemove',areaMouseMove).unbind('mousedown',areaMouseDown);$img.add($outer).unbind('mousedown',imgMouseDown);$(window).unbind('resize',parentScroll);$img.add($img.parents()).unbind('scroll',parentScroll)}else if(options.enable||options.disable===false){if(options.resizable||options.movable)$box.mousemove(areaMouseMove).mousedown(areaMouseDown);if(!options.persistent)$img.add($outer).mousedown(imgMouseDown);$(window).resize(parentScroll);$img.add($img.parents()).scroll(parentScroll)}options.enable=options.disable=undefined}this.getOptions=function(){return options};this.setOptions=setOptions;this.getSelection=getSelection;this.setSelection=setSelection;this.update=doUpdate;$p=$img;while($p.length&&!$p.is('body')){if(!isNaN($p.css('z-index'))&&$p.css('z-index')>zIndex)zIndex=$p.css('z-index');if($p.css('position')=='fixed')position='fixed';$p=$p.parent()}if(!isNaN(options.zIndex))zIndex=options.zIndex;if($.browser.msie)$img.attr('unselectable','on');$.imgAreaSelect.keyPress=$.browser.msie||$.browser.safari?'keydown':'keypress';if($.browser.opera)$areaOpera=div().css({width:'100%',height:'100%',position:'absolute',zIndex:zIndex+2||2});$box.add($outer).css({visibility:'hidden',position:position,overflow:'hidden',zIndex:zIndex||'0'});$box.css({zIndex:zIndex+2||2});$area.add($border).css({position:'absolute'});img.complete||img.readyState=='complete'||!$img.is('img')?imgLoad():$img.one('load',imgLoad)};$.fn.imgAreaSelect=function(options){options=options||{};this.each(function(){if($(this).data('imgAreaSelect'))$(this).data('imgAreaSelect').setOptions(options);else{if(options.enable===undefined&&options.disable===undefined)options.enable=true;$(this).data('imgAreaSelect',new $.imgAreaSelect(this,options))}});if(options.instance)return $(this).data('imgAreaSelect');return this}})(jQuery);
(function($){$.fn.lightBox=function(settings){settings=jQuery.extend({overlayBgColor:'#000',overlayOpacity:0.8,fixedNavigation:false,imageLoading:'images/lightbox-ico-loading.gif',imageBtnPrev:'images/lightbox-btn-prev.gif',imageBtnNext:'images/lightbox-btn-next.gif',imageBtnClose:'images/lightbox-btn-close.gif',imageBlank:'images/lightbox-blank.gif',containerBorderSize:10,containerResizeSpeed:400,txtImage:'Image',txtOf:'of',keyToClose:'c',keyToPrev:'p',keyToNext:'n',imageArray:[],activeImage:0},settings);var jQueryMatchedObj=this;function _initialize(){_start(this,jQueryMatchedObj);return false}function _start(objClicked,jQueryMatchedObj){$('embed, object, select').css({'visibility':'hidden'});_set_interface();settings.imageArray.length=0;settings.activeImage=0;if(jQueryMatchedObj.length==1){settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')))}else{for(var i=0;i<jQueryMatchedObj.length;i++){settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title')))}}while(settings.imageArray[settings.activeImage][0]!=objClicked.getAttribute('href')){settings.activeImage++}_set_image_to_view()}function _set_interface(){$('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="'+settings.imageLoading+'"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="'+settings.imageBtnClose+'"></a></div></div></div></div>');var arrPageSizes=___getPageSize();$('#jquery-overlay').css({backgroundColor:settings.overlayBgColor,opacity:settings.overlayOpacity,width:arrPageSizes[0],height:arrPageSizes[1]}).fadeIn();var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]}).show();$('#jquery-overlay,#jquery-lightbox').click(function(){_finish()});$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function(){_finish();return false});$(window).resize(function(){var arrPageSizes=___getPageSize();$('#jquery-overlay').css({width:arrPageSizes[0],height:arrPageSizes[1]});var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]})})}function _set_image_to_view(){$('#lightbox-loading').show();if(settings.fixedNavigation){$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide()}else{$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide()}var objImagePreloader=new Image();objImagePreloader.onload=function(){$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);objImagePreloader.onload=function(){}};objImagePreloader.src=settings.imageArray[settings.activeImage][0]};function _resize_container_image_box(intImageWidth,intImageHeight){var intCurrentWidth=$('#lightbox-container-image-box').width();var intCurrentHeight=$('#lightbox-container-image-box').height();var intWidth=(intImageWidth+(settings.containerBorderSize*2));var intHeight=(intImageHeight+(settings.containerBorderSize*2));var intDiffW=intCurrentWidth-intWidth;var intDiffH=intCurrentHeight-intHeight;$('#lightbox-container-image-box').animate({width:intWidth,height:intHeight},settings.containerResizeSpeed,function(){_show_image()});if((intDiffW==0)&&(intDiffH==0)){if($.browser.msie){___pause(250)}else{___pause(100)}}$('#lightbox-container-image-data-box').css({width:intImageWidth});$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({height:intImageHeight+(settings.containerBorderSize*2)})};function _show_image(){$('#lightbox-loading').hide();$('#lightbox-image').fadeIn(function(){_show_image_data();_set_navigation()});_preload_neighbor_images()};function _show_image_data(){$('#lightbox-container-image-data-box').slideDown('fast');$('#lightbox-image-details-caption').hide();if(settings.imageArray[settings.activeImage][1]){$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show()}if(settings.imageArray.length>1){$('#lightbox-image-details-currentNumber').html(settings.txtImage+' '+(settings.activeImage+1)+' '+settings.txtOf+' '+settings.imageArray.length).show()}}function _set_navigation(){$('#lightbox-nav').show();$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({'background':'transparent url('+settings.imageBlank+') no-repeat'});if(settings.activeImage!=0){if(settings.fixedNavigation){$('#lightbox-nav-btnPrev').css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false})}else{$('#lightbox-nav-btnPrev').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'})},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'})}).show().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false})}}if(settings.activeImage!=(settings.imageArray.length-1)){if(settings.fixedNavigation){$('#lightbox-nav-btnNext').css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false})}else{$('#lightbox-nav-btnNext').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'})},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'})}).show().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false})}}_enable_keyboard_navigation()}function _enable_keyboard_navigation(){$(document).keydown(function(objEvent){_keyboard_action(objEvent)})}function _disable_keyboard_navigation(){$(document).unbind()}function _keyboard_action(objEvent){if(objEvent==null){keycode=event.keyCode;escapeKey=27}else{keycode=objEvent.keyCode;escapeKey=objEvent.DOM_VK_ESCAPE}key=String.fromCharCode(keycode).toLowerCase();if((key==settings.keyToClose)||(key=='x')||(keycode==escapeKey)){_finish()}if((key==settings.keyToPrev)||(keycode==37)){if(settings.activeImage!=0){settings.activeImage=settings.activeImage-1;_set_image_to_view();_disable_keyboard_navigation()}}if((key==settings.keyToNext)||(keycode==39)){if(settings.activeImage!=(settings.imageArray.length-1)){settings.activeImage=settings.activeImage+1;_set_image_to_view();_disable_keyboard_navigation()}}}function _preload_neighbor_images(){if((settings.imageArray.length-1)>settings.activeImage){objNext=new Image();objNext.src=settings.imageArray[settings.activeImage+1][0]}if(settings.activeImage>0){objPrev=new Image();objPrev.src=settings.imageArray[settings.activeImage-1][0]}}function _finish(){$('#jquery-lightbox').remove();$('#jquery-overlay').fadeOut(function(){$('#jquery-overlay').remove()});$('embed, object, select').css({'visibility':'visible'})}function ___getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight}var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth}else{windowWidth=self.innerWidth}windowHeight=self.innerHeight}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight}if(yScroll<windowHeight){pageHeight=windowHeight}else{pageHeight=yScroll}if(xScroll<windowWidth){pageWidth=xScroll}else{pageWidth=windowWidth}arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);return arrayPageSize};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}arrayPageScroll=new Array(xScroll,yScroll);return arrayPageScroll};function ___pause(ms){var date=new Date();curDate=null;do{var curDate=new Date()}while(curDate-date<ms)};return this.unbind('click').click(_initialize)}})(jQuery);
(function($){$.fn.markItUp=function(settings,extraSettings){var options,ctrlKey,shiftKey,altKey;ctrlKey=shiftKey=altKey=false;options={id:'',nameSpace:'',root:'',previewInWindow:'',previewAutoRefresh:true,previewPosition:'after',previewTemplatePath:'~/templates/preview.html',previewParserPath:'',previewParserVar:'data',resizeHandle:true,beforeInsert:'',afterInsert:'',onEnter:{},onShiftEnter:{},onCtrlEnter:{},onTab:{},markupSet:[{}]};$.extend(options,settings,extraSettings);if(!options.root){$('script').each(function(a,tag){miuScript=$(tag).get(0).src.match(/(.*)jquery\.markitup(\.pack)?\.js$/);if(miuScript!==null){options.root=miuScript[1]}})}return this.each(function(){var $$,textarea,levels,scrollPosition,caretPosition,caretOffset,clicked,hash,header,footer,previewWindow,template,iFrame,abort;$$=$(this);textarea=this;levels=[];abort=false;scrollPosition=caretPosition=0;caretOffset=-1;options.previewParserPath=localize(options.previewParserPath);options.previewTemplatePath=localize(options.previewTemplatePath);function localize(data,inText){if(inText){return data.replace(/("|')~\//g,"$1"+options.root)}return data.replace(/^~\//,options.root)}function init(){id='';nameSpace='';if(options.id){id='id="'+options.id+'"'}else if($$.attr("id")){id='id="markItUp'+($$.attr("id").substr(0,1).toUpperCase())+($$.attr("id").substr(1))+'"'}if(options.nameSpace){nameSpace='class="'+options.nameSpace+'"'}$$.wrap('<div '+nameSpace+'"></div>');$$.wrap('<div '+id+' class="markItUp"></div>');$$.wrap('<div class="markItUpContainer"></div>');$$.addClass("markItUpEditor");header=$('<div class="markItUpHeader"></div>').insertBefore($$);$(dropMenus(options.markupSet)).appendTo(header);footer=$('<div class="markItUpFooter"></div>').insertAfter($$);if(options.resizeHandle===true&&$.browser.safari!==true){resizeHandle=$('<div class="markItUpResizeHandle"></div>').insertAfter($$).bind("mousedown",function(e){var h=$$.height(),y=e.clientY,mouseMove,mouseUp;mouseMove=function(e){$$.css("height",Math.max(20,e.clientY+h-y)+"px");return false};mouseUp=function(e){$("html").unbind("mousemove",mouseMove).unbind("mouseup",mouseUp);return false};$("html").bind("mousemove",mouseMove).bind("mouseup",mouseUp)});footer.append(resizeHandle)}$$.keydown(keyPressed).keyup(keyPressed);$$.bind("insertion",function(e,settings){if(settings.target!==false){get()}if(textarea===$.markItUp.focused){markup(settings)}});$$.focus(function(){$.markItUp.focused=this})}function dropMenus(markupSet){var ul=$('<ul></ul>'),i=0;$('li:hover > ul',ul).css('display','block');$(markupSet).each(function(){var button=this,t='',title,li,j;title=(button.key)?(button.name||'')+' [Ctrl+'+button.key+']':(button.name||'');key=(button.key)?'accesskey="'+button.key+'"':'';if(button.separator){li=$('<li class="markItUpSeparator">'+(button.separator||'')+'</li>').appendTo(ul)}else{i++;for(j=levels.length-1;j>=0;j--){t+=levels[j]+"-"}li=$('<li class="markItUpButton markItUpButton'+t+(i)+' '+(button.className||'')+'"><a href="" '+key+' title="'+title+'">'+(button.name||'')+'</a></li>').bind("contextmenu",function(){return false}).click(function(){return false}).mouseup(function(){if(button.call){eval(button.call)()}markup(button);return false}).hover(function(){$('> ul',this).show();$(document).one('click',function(){$('ul ul',header).hide()})},function(){$('> ul',this).hide()}).appendTo(ul);if(button.dropMenu){levels.push(i);$(li).addClass('markItUpDropMenu').append(dropMenus(button.dropMenu))}}});levels.pop();return ul}function magicMarkups(string){if(string){string=string.toString();string=string.replace(/\(\!\(([\s\S]*?)\)\!\)/g,function(x,a){var b=a.split('|!|');if(altKey===true){return(b[1]!==undefined)?b[1]:b[0]}else{return(b[1]===undefined)?"":b[0]}});string=string.replace(/\[\!\[([\s\S]*?)\]\!\]/g,function(x,a){var b=a.split(':!:');if(abort===true){return false}value=prompt(b[0],(b[1])?b[1]:'');if(value===null){abort=true}return value});return string}return""}function prepare(action){if($.isFunction(action)){action=action(hash)}return magicMarkups(action)}function build(string){openWith=prepare(clicked.openWith);placeHolder=prepare(clicked.placeHolder);replaceWith=prepare(clicked.replaceWith);closeWith=prepare(clicked.closeWith);if(replaceWith!==""){block=openWith+replaceWith+closeWith}else if(selection===''&&placeHolder!==''){block=openWith+placeHolder+closeWith}else{block=openWith+(string||selection)+closeWith}return{block:block,openWith:openWith,replaceWith:replaceWith,placeHolder:placeHolder,closeWith:closeWith}}function markup(button){var len,j,n,i;hash=clicked=button;get();$.extend(hash,{line:"",root:options.root,textarea:textarea,selection:(selection||''),caretPosition:caretPosition,ctrlKey:ctrlKey,shiftKey:shiftKey,altKey:altKey});prepare(options.beforeInsert);prepare(clicked.beforeInsert);if(ctrlKey===true&&shiftKey===true){prepare(clicked.beforeMultiInsert)}$.extend(hash,{line:1});if(ctrlKey===true&&shiftKey===true){lines=selection.split(/\r?\n/);for(j=0,n=lines.length,i=0;i<n;i++){if($.trim(lines[i])!==''){$.extend(hash,{line:++j,selection:lines[i]});lines[i]=build(lines[i]).block}else{lines[i]=""}}string={block:lines.join('\n')};start=caretPosition;len=string.block.length+(($.browser.opera)?n:0)}else if(ctrlKey===true){string=build(selection);start=caretPosition+string.openWith.length;len=string.block.length-string.openWith.length-string.closeWith.length;len-=fixIeBug(string.block)}else if(shiftKey===true){string=build(selection);start=caretPosition;len=string.block.length;len-=fixIeBug(string.block)}else{string=build(selection);start=caretPosition+string.block.length;len=0;start-=fixIeBug(string.block)}if((selection===''&&string.replaceWith==='')){caretOffset+=fixOperaBug(string.block);start=caretPosition+string.openWith.length;len=string.block.length-string.openWith.length-string.closeWith.length;caretOffset=$$.val().substring(caretPosition,$$.val().length).length;caretOffset-=fixOperaBug($$.val().substring(0,caretPosition))}$.extend(hash,{caretPosition:caretPosition,scrollPosition:scrollPosition});if(string.block!==selection&&abort===false){insert(string.block);set(start,len)}else{caretOffset=-1}get();$.extend(hash,{line:'',selection:selection});if(ctrlKey===true&&shiftKey===true){prepare(clicked.afterMultiInsert)}prepare(clicked.afterInsert);prepare(options.afterInsert);if(previewWindow&&options.previewAutoRefresh){refreshPreview()}shiftKey=altKey=ctrlKey=abort=false}function fixOperaBug(string){if($.browser.opera){return string.length-string.replace(/\n*/g,'').length}return 0}function fixIeBug(string){if($.browser.msie){return string.length-string.replace(/\r*/g,'').length}return 0}function insert(block){if(document.selection){var newSelection=document.selection.createRange();newSelection.text=block}else{$$.val($$.val().substring(0,caretPosition)+block+$$.val().substring(caretPosition+selection.length,$$.val().length))}}function set(start,len){if(textarea.createTextRange){range=textarea.createTextRange();range.collapse(true);range.moveStart('character',start);range.moveEnd('character',len);range.select()}else if(textarea.setSelectionRange){textarea.setSelectionRange(start,start+len)}textarea.scrollTop=scrollPosition;textarea.focus()}function get(){textarea.focus();scrollPosition=textarea.scrollTop;if(document.selection){selection=document.selection.createRange().text;if($.browser.msie){var range=document.selection.createRange(),rangeCopy=range.duplicate();rangeCopy.moveToElementText(textarea);caretPosition=-1;while(rangeCopy.inRange(range)){rangeCopy.moveStart('character');caretPosition++}}else{caretPosition=textarea.selectionStart}}else{caretPosition=textarea.selectionStart;selection=$$.val().substring(caretPosition,textarea.selectionEnd)}return selection}function preview(){if(!previewWindow||previewWindow.closed){if(options.previewInWindow){previewWindow=window.open('','preview',options.previewInWindow)}else{iFrame=$('<iframe class="markItUpPreviewFrame"></iframe>');if(options.previewPosition=='after'){iFrame.insertAfter(footer)}else{iFrame.insertBefore(header)}previewWindow=iFrame[iFrame.length-1].contentWindow||frame[iFrame.length-1]}}else if(altKey===true){if(iFrame){iFrame.remove()}previewWindow.close();previewWindow=iFrame=false}if(!options.previewAutoRefresh){refreshPreview()}}function refreshPreview(){if(previewWindow.document){try{sp=previewWindow.document.documentElement.scrollTop}catch(e){sp=0}previewWindow.document.open();previewWindow.document.write(renderPreview());previewWindow.document.close();previewWindow.document.documentElement.scrollTop=sp}if(options.previewInWindow){previewWindow.focus()}}function renderPreview(){if(options.previewParserPath!==''){$.ajax({type:'POST',async:false,url:options.previewParserPath,data:options.previewParserVar+'='+encodeURIComponent($$.val()),success:function(data){html=localize(data,1)}})}else{if(!template){$.ajax({async:false,url:options.previewTemplatePath,success:function(data){template=localize(data,1)}})}html=template.replace(/<!-- content -->/g,$$.val())}return html}function keyPressed(e){shiftKey=e.shiftKey;altKey=e.altKey;ctrlKey=(!(e.altKey&&e.ctrlKey))?e.ctrlKey:false;if(e.type==='keydown'){if(ctrlKey===true){li=$("a[accesskey="+String.fromCharCode(e.keyCode)+"]",header).parent('li');if(li.length!==0){ctrlKey=false;li.triggerHandler('mouseup');return false}}if(e.keyCode===13||e.keyCode===10){if(ctrlKey===true){ctrlKey=false;markup(options.onCtrlEnter);return options.onCtrlEnter.keepDefault}else if(shiftKey===true){shiftKey=false;markup(options.onShiftEnter);return options.onShiftEnter.keepDefault}else{markup(options.onEnter);return options.onEnter.keepDefault}}if(e.keyCode===9){if(caretOffset!==-1){get();caretOffset=$$.val().length-caretOffset;set(caretOffset,0);caretOffset=-1;return false}else{markup(options.onTab);return options.onTab.keepDefault}}}}init()})};$.fn.markItUpRemove=function(){return this.each(function(){$$=$(this).unbind().removeClass('markItUpEditor');$$.parent('div').parent('div.markItUp').parent('div').replaceWith($$)})};$.markItUp=function(settings){var options={target:false};$.extend(options,settings);if(options.target){return $(options.target).each(function(){$(this).focus();$(this).trigger('insertion',[options])})}else{$('textarea').trigger('insertion',[options])}}})(jQuery);
(function($){$.rating={cancel:'Cancel Rating',cancelValue:'',split:0,starWidth:16,groups:{},event:{fill:function(n,el,settings,state){this.drain(n);$(el).prevAll('.star_group_'+n).andSelf().addClass('star_'+(state||'hover'));var lnk=$(el).children('a');val=lnk.text();if(settings.focus)settings.focus.apply($.rating.groups[n].valueElem[0],[val,lnk[0]])},drain:function(n,el,settings){$.rating.groups[n].valueElem.siblings('.star_group_'+n).removeClass('star_on').removeClass('star_hover')},reset:function(n,el,settings){if(!$($.rating.groups[n].current).is('.cancel'))$($.rating.groups[n].current).prevAll('.star_group_'+n).andSelf().addClass('star_on');var lnk=$(el).children('a');val=lnk.text();if(settings.blur)settings.blur.apply($.rating.groups[n].valueElem[0],[val,lnk[0]])},click:function(n,el,settings){$.rating.groups[n].current=el;var lnk=$(el).children('a');val=lnk.text();$.rating.groups[n].valueElem.val(val);$.rating.event.drain(n,el,settings);$.rating.event.reset(n,el,settings);if(settings.callback)settings.callback.apply($.rating.groups[n].valueElem[0],[val,lnk[0]])}}};$.fn.rating=function(instanceSettings){if(this.length==0)return this;instanceSettings=$.extend({},$.rating,instanceSettings||{});this.each(function(i){var settings=$.extend({},instanceSettings||{},($.metadata?$(this).metadata():($.meta?$(this).data():null))||{});var n=(this.name||'unnamed-rating').replace(/\[|\]/,"_");if(!$.rating.groups[n])$.rating.groups[n]={count:0};i=$.rating.groups[n].count;$.rating.groups[n].count++;$.rating.groups[n].readOnly=$.rating.groups[n].readOnly||settings.readOnly||$(this).attr('disabled');if(i==0){$.rating.groups[n].valueElem=$('<input type="hidden" name="'+n+'" value=""'+(settings.readOnly?' disabled="disabled"':'')+'/>');$(this).before($.rating.groups[n].valueElem);if($.rating.groups[n].readOnly||settings.required){}else{$(this).before($('<div class="cancel"><a title="'+settings.cancel+'">'+settings.cancelValue+'</a></div>').mouseover(function(){$.rating.event.drain(n,this,settings);$(this).addClass('star_on')}).mouseout(function(){$.rating.event.reset(n,this,settings);$(this).removeClass('star_on')}).click(function(){$.rating.event.click(n,this,settings)}))}};eStar=$('<div class="star"><a title="'+(this.title||this.value)+'">'+this.value+'</a></div>');$(this).after(eStar);if(settings.half)settings.split=2;if(typeof settings.split=='number'&&settings.split>0){var stw=($.fn.width?$(eStar).width():0)||settings.starWidth;var spi=(i%settings.split),spw=Math.floor(stw/settings.split);$(eStar).width(spw).find('a').css({'margin-left':'-'+(spi*spw)+'px'})};$(eStar).addClass('star_group_'+n);if($.rating.groups[n].readOnly)$(eStar).addClass('star_readonly');else $(eStar).addClass('star_live').mouseover(function(){$.rating.event.drain(n,this,settings);$.rating.event.fill(n,this,settings,'hover')}).mouseout(function(){$.rating.event.drain(n,this,settings);$.rating.event.reset(n,this,settings)}).click(function(){$.rating.event.click(n,this,settings)});if(this.checked)$.rating.groups[n].current=eStar;$(this).remove();if(i+1==this.length)$.rating.event.reset(n,this,settings)});for(n in $.rating.groups)(function(c,v,n){if(!c)return;$.rating.event.fill(n,c,instanceSettings||{},'on');$(v).val($(c).children('a').text())})($.rating.groups[n].current,$.rating.groups[n].valueElem,n);return this};$(function(){$('input[@type=radio].star').rating()})})(jQuery);

/*
 * Init
 */
$(document).ready(function() {
	jQuery('ul#menu-primary li').hover(function(e) {
		jQuery(this).addClass('act-current').children('ul').css({cursor: 'pointer'}).show();
		jQuery(this).children('ul').css({cursor: 'pointer'}).show();
	}, function() {
		jQuery(this).stop().removeClass('act-current').children('ul').hide();
	});
	jQuery("#page-box").hide();
	jQuery("#panel-box").hide();
	jQuery("#friend-box").hide();
	jQuery("a#friend-button").click(function() {
		jQuery('#friend-box').toggle();
		return false;
	});
	jQuery("a#friend-button-hide").click(function() {
		jQuery('#friend-box').hide();
		return false;
	});
	jQuery("a#page-button").click(function() {
		jQuery("#page-box").toggle();
		return false;
	});
	jQuery("a#page-button-hide").click(function() {
		jQuery("#page-box").hide();
		return false;
	});
	jQuery("a#panel-button").click(function() {
		jQuery("#panel-box").toggle();
		return false;
	});
	jQuery("a#panel-button-hide").click(function() {
		jQuery("#panel-box").hide();
		return false;
	});
	jQuery('#quicksearchbox').suggest({}).bind("fb-select", function(e, data) {
		if (data.guid === 1) {
			top.location.href = "/series/index.php?id=" + data.id;
		}
		else if (data.guid === 2) {
			top.location.href = "/community/profile.php?id=" + data.id;
		}
	});
	jQuery(".userinfo").boxinfo({
		trigger: "click",
		source: "info",
		type: "GET",
		url: '/ajax/userinfo.php'
	});
	jQuery(".noteinfo").boxinfo({
		trigger: "hover",
		source: "info",
		type: "GET",
		url: '/ajax/noteinfo.php'
	});
	jQuery("#test").amNotice();
});