Fx.Slide=new Class({Extends:Fx,options:{mode:"vertical"},initialize:function(f,e){this.addEvent("complete",function(){this.open=(this.wrapper["offset"+this.layout.capitalize()]!=0);if(this.open&&Browser.Engine.webkit419){this.element.dispose().inject(this.wrapper)}},true);this.element=this.subject=$(f);this.parent(e);var d=this.element.retrieve("wrapper");this.wrapper=d||new Element("div",{styles:$extend(this.element.getStyles("margin","position"),{overflow:"hidden"})}).wraps(this.element);this.element.store("wrapper",this.wrapper).setStyle("margin",0);this.now=[];this.open=true},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight},horizontal:function(){this.margin="margin-left";this.layout="width";this.offset=this.element.offsetWidth},set:function(b){this.element.setStyle(this.margin,b[0]);this.wrapper.setStyle(this.layout,b[1]);return this},compute:function(f,j,i){var h=[];var g=2;g.times(function(a){h[a]=Fx.compute(f[a],j[a],i)});return h},start:function(j,m){if(!this.check(arguments.callee,j,m)){return this}this[m||this.options.mode]();var l=this.element.getStyle(this.margin).toInt();var k=this.wrapper.getStyle(this.layout).toInt();var i=[[l,k],[0,this.offset]];var h=[[l,k],[-this.offset,0]];var n;switch(j){case"in":n=i;break;case"out":n=h;break;case"toggle":n=(this.wrapper["offset"+this.layout.capitalize()]==0)?i:h}return this.parent(n[0],n[1])},slideIn:function(b){return this.start("in",b)},slideOut:function(b){return this.start("out",b)},hide:function(b){this[b||this.options.mode]();this.open=false;return this.set([-this.offset,0])},show:function(b){this[b||this.options.mode]();this.open=true;return this.set([0,this.offset])},toggle:function(b){return this.start("toggle",b)}});Element.Properties.slide={set:function(c){var d=this.retrieve("slide");if(d){d.cancel()}return this.eliminate("slide").store("slide:options",$extend({link:"cancel"},c))},get:function(b){if(b||!this.retrieve("slide")){if(b||!this.retrieve("slide:options")){this.set("slide",b)}this.store("slide",new Fx.Slide(this,this.retrieve("slide:options")))}return this.retrieve("slide")}};Element.implement({slide:function(j,f){j=j||"toggle";var h=this.get("slide"),g;switch(j){case"hide":h.hide(f);break;case"show":h.show(f);break;case"toggle":var i=this.retrieve("slide:flag",h.open);h[(i)?"slideOut":"slideIn"](f);this.store("slide:flag",!i);g=true;break;default:h.start(j,f)}if(!g){this.eliminate("slide:flag")}return this}});Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(g,f){this.element=this.subject=$(g);this.parent(f);var e=this.cancel.bind(this,false);if($type(this.element)!="element"){this.element=$(this.element.getDocument().body)}var h=this.element;if(this.options.wheelStops){this.addEvent("start",function(){h.addEvent("mousewheel",e)},true);this.addEvent("complete",function(){h.removeEvent("mousewheel",e)},true)}},set:function(){var b=Array.flatten(arguments);this.element.scrollTo(b[0],b[1])},compute:function(f,j,i){var h=[];var g=2;g.times(function(a){h.push(Fx.compute(f[a],j[a],i))});return h},start:function(l,i){if(!this.check(arguments.callee,l,i)){return this}var n=this.element.getSize(),o=this.element.getScrollSize();var k=this.element.getScroll(),m={x:l,y:i};for(var p in m){var j=o[p]-n[p];if($chk(m[p])){m[p]=($type(m[p])=="number")?m[p].limit(0,j):j}else{m[p]=k[p]}m[p]+=this.options.offset[p]}return this.parent([k.x,k.y],[m.x,m.y])},toTop:function(){return this.start(false,0)},toLeft:function(){return this.start(0,false)},toRight:function(){return this.start("right",false)},toBottom:function(){return this.start(false,"bottom")},toElement:function(c){var d=$(c).getPosition(this.element);return this.start(d.x,d.y)}});var Asset=new Hash({javascript:function(n,l){l=$extend({onload:$empty,document:document,check:$lambda(true)},l);var j=new Element("script",{src:n,type:"text/javascript"});var m=l.onload.bind(j),i=l.check,h=l.document;delete l.onload;delete l.check;delete l.document;j.addEvents({load:m,readystatechange:function(){if(["loaded","complete"].contains(this.readyState)){m()}}}).setProperties(l);if(Browser.Engine.webkit419){var k=(function(){if(!$try(i)){return}$clear(k);m()}).periodical(50)}return j.inject(h.head)},css:function(c,d){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:c},d)).inject(document.head)},image:function(h,g){g=$merge({onload:$empty,onabort:$empty,onerror:$empty},g);var e=new Image();var f=$(e)||new Element("img");["load","abort","error"].each(function(a){var b="on"+a;var c=g[b];delete g[b];e[b]=function(){if(!e){return}if(!f.parentNode){f.width=e.width;f.height=e.height}e=e.onload=e.onabort=e.onerror=null;c.delay(1,f,f);f.fireEvent(a,f,1)}});e.src=f.src=h;if(e&&e.complete){e.onload.delay(1)}return f.setProperties(g)},images:function(e,h){h=$merge({onComplete:$empty,onProgress:$empty},h);if(!e.push){e=[e]}var f=[];var g=0;e.each(function(b){var a=new Asset.image(b,{onload:function(){h.onProgress.call(this,g,e.indexOf(b));g++;if(g==e.length){h.onComplete()}}});f.push(a)});return new Elements(f)}});var fusion={start:function(){if(Browser.Engine.webkit){$(document.body).addClass("safari")}fusion.effects();fusion.minitabs();fusion.tabmenudropdowns();fusion.winScroll=new Fx.Scroll(window);fusion.milkbox();$("expandCommentField").addEvent("click",fusion.expandCommentField);$("largenCommentField").addEvent("click",fusion.largenCommentField)},winScroll:null,milkbox:function(){var e=$(document.body).getElements("a"),d=false,f="";e.each(function(a){if(a.rel.test(/^(milk|light)box/i)){d=true;return false}});if(d){$(document).getElements("script").each(function(a){if(a.src.test(/^(.*)fusion-yc\.js/i)){f=a.src.substr(0,a.src.length-16)+"/milkbox/";new Asset.javascript(f+"milkbox-yc.js");new Asset.css(f+"milkbox.css");return false}})}},effects:function(){$$("#sidebar div ul li ul.nav li").each(function(a){a.getChildren().each(function(b){if(!b.hasClass("tip")){b.set("tween",{duration:"short"});a.addEvents({mouseenter:function(){b.tween("margin-left","4px")},mouseleave:function(){b.tween("margin-left","0px")}})}else{b.set("morph",{duration:"short"});a.addEvents({mouseover:function(){b.morph({top:"5px",opacity:1,display:"block"})},mouseleave:function(){b.morph({top:"-5px",opacity:0})}})}})});$("toplink").addEvent("click",function(a){a.preventDefault();fusion.winScroll.toTop()})},minitabs:function(){if($("secondary-tabs")){var e=$("2nd-tab-link-1"),d=$("2nd-tab-link-2"),c=new Fx.Morph("tab-1",{duration:150}),f=new Fx.Morph("tab-2",{duration:150});e.addClass("current");e.addEvent("click",function(a){a.preventDefault();if(!e.hasClass("current")){d.removeClass("current");e.addClass("current");f.start({opacity:0,"margin-left":-10,"margin-right":10}).chain(function(){this.start({display:"none"})},function(){c.start({visibility:"hidden",display:"block"}).chain(function(){this.start({opacity:1,"margin-left":0,"margin-right":0})})});e.blur()}});d.addEvent("click",function(a){a.preventDefault();if(!d.hasClass("current")){e.removeClass("current");d.addClass("current");c.start({opacity:0,"margin-left":-10,"margin-right":10}).chain(function(){this.start({display:"none"})},function(){f.start({visibility:"hidden",display:"block"}).chain(function(){this.start({opacity:1,"margin-left":0,"margin-right":0})})});d.blur()}})}},layoutControl:function(){$$("#layoutcontrol a").each(function(a,b){if(a.hasClass("setFont")){a.addEvent("click",function(c){c.preventDefault();fusion.setFontSize()})}if(a.hasClass("setLiquid")){a.addEvent("click",function(c){c.preventDefault();fusion.setPageWidth()})}})},setFontSize:function(d){var e=(!d)?$(document.body).getStyle("font-size"):d,c="";if(!d){if(e=="0.8em"){c="0.95em"}else{if(e=="0.95em"){c="0.7em"}else{if(e=="0.7em"){c="0.8em"}else{c="0.95em"}}}}else{c=d}$(document.body).setStyle("font-size",c);Cookie.write("fontSize",c,{duration:365,path:"/"})},setPageWidth:function(d){var e=(!d)?$("page").getStyle("width"):d,c="",f=$("page");f.set("tween",{duration:250});if(d=="fixed"||e=="95%"||e==$(document.body).getSize().x*0.95){if(!d){f.tween("width",$(document.body).getSize().x*0.95,"960px")}else{f.setStyle("width","960px")}c="fixed"}if(d=="fluid"||e=="960px"){if(!d){f.tween("width",$(document.body).getSize().x*0.95);(function(){f.setStyle("width","95%")}).delay(265)}else{f.setStyle("width","95%")}c="fluid"}Cookie.write("pageWidth",c,{duration:365,path:"/"})},expandCommentField:function(){var a=$("comment");a.set("tween",{duration:250});a.tween("width",a.getParent().getSize().x*0.98);(function(){a.setStyle("width","95%")}).delay(265)},largenCommentField:function(){var a=$("comment");a.set("tween",{duration:250});a.tween("height",a.getSize().y*1.25)},tabmenudropdowns:function(){$$("#tabs ul li").each(function(a){a.getChildren("ul").each(function(b){a.addEvents({mouseenter:function(){b.fade("in")},mouseleave:function(){b.fade("out")}})})})}};window.addEvent("domready",function(){fusion.start()});(function(){function d(a){return document.getElementById(a)}function c(a,b){d(a).style.display=b}window.MGJS={};window.MGJS["$$$"]=d;window.MGJS.setStyleDisplay=c})();(function(){function d(b,l,j,m){var k=MGJS.$$$(b).innerHTML;var a=MGJS.$$$(j).innerHTML;var n='<blockquote cite="#'+j+'">\n<strong><a href="#'+l+'">'+k.replace(/\t|\n|\r\n/g,"")+"</a> :</strong>"+a.replace(/\t/g,"")+"</blockquote>\n";c(n,m)}function c(j,b){if(MGJS.$$$(b)&&MGJS.$$$(b).type=="textarea"){field=MGJS.$$$(b)}else{alert("The comment box does not exist!");return false}if(document.selection){field.focus();sel=document.selection.createRange();sel.text=j;field.focus()}else{if(field.selectionStart||field.selectionStart=="0"){var h=field.selectionStart;var i=field.selectionEnd;var a=h;field.value=field.value.substring(0,h)+j+field.value.substring(i,field.value.length);a+=j.length;field.focus();field.selectionStart=a;field.selectionEnd=a}else{field.value+=j;field.focus()}}}window.MGJS_CMT={};window.MGJS_CMT.quote=d})();