
/* Spy by Remy Sharp - http://jqueryfordesigners.com/ */
$(function(){$("ul.spy").simpleSpy()});(function(a){a.fn.simpleSpy=function(b,c){b=b||5;c=c||5000;return this.each(function(){var f=a(this),e=[],g=b,i=0,d=f.find("> li:first").height();f.find("> li").each(function(){e.push("<li>"+a(this).html()+"</li>")});i=e.length;f.wrap('<div class="spyWrapper" />').parent().css({height:d*b});f.find("> li").filter(":gt("+(b-1)+")").remove();function h(){var j=a(e[g]).css({height:0,opacity:0,display:"none"}).prependTo(f);f.find("> li:last").animate({opacity:0},1000,function(){j.animate({height:d},1000).animate({opacity:1},1000);a(this).remove()});g++;if(g>=i){g=0}setTimeout(h,c)}h()})}})(jQuery);
/* hoverIntent by Brian Cherne */
(function(a){a.fn.hoverIntent=function(k,j){var l={sensitivity:7,interval:100,timeout:0};l=a.extend(l,j?{over:k,out:j}:k);var n,m,h,d;var e=function(f){n=f.pageX;m=f.pageY};var c=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);if((Math.abs(h-n)+Math.abs(d-m))<l.sensitivity){a(f).unbind("mousemove",e);f.hoverIntent_s=1;return l.over.apply(f,[g])}else{h=n;d=m;f.hoverIntent_t=setTimeout(function(){c(g,f)},l.interval)}};var i=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);f.hoverIntent_s=0;return l.out.apply(f,[g])};var b=function(q){var o=(q.type=="mouseover"?q.fromElement:q.toElement)||q.relatedTarget;while(o&&o!=this){try{o=o.parentNode}catch(q){o=this}}if(o==this){return false}var g=jQuery.extend({},q);var f=this;if(f.hoverIntent_t){f.hoverIntent_t=clearTimeout(f.hoverIntent_t)}if(q.type=="mouseover"){h=g.pageX;d=g.pageY;a(f).bind("mousemove",e);if(f.hoverIntent_s!=1){f.hoverIntent_t=setTimeout(function(){c(g,f)},l.interval)}}else{a(f).unbind("mousemove",e);if(f.hoverIntent_s==1){f.hoverIntent_t=setTimeout(function(){i(g,f)},l.timeout)}}};return this.mouseover(b).mouseout(b)}})(jQuery);
/*
 * Superfish v1.4.8 - jQuery menu widget
 * Copyright (c) 2008 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 *
 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
 */
(function(b){b.fn.superfish=function(k){var g=b.fn.superfish,j=g.c,f=b(['<span class="',j.arrowClass,'"> &#187;</span>'].join("")),i=function(){var c=b(this),l=d(c);clearTimeout(l.sfTimer);c.showSuperfishUl().siblings().hideSuperfishUl()},e=function(){var c=b(this),m=d(c),l=g.op;clearTimeout(m.sfTimer);m.sfTimer=setTimeout(function(){l.retainPath=(b.inArray(c[0],l.$path)>-1);c.hideSuperfishUl();if(l.$path.length&&c.parents(["li.",l.hoverClass].join("")).length<1){i.call(l.$path)}},l.delay)},d=function(c){var l=c.parents(["ul.",j.menuClass,":first"].join(""))[0];g.op=g.o[l.serial];return l},h=function(c){c.addClass(j.anchorClass).append(f.clone())};return this.each(function(){var c=this.serial=g.o.length;var m=b.extend({},g.defaults,k);m.$path=b("li."+m.pathClass,this).slice(0,m.pathLevels).each(function(){b(this).addClass([m.hoverClass,j.bcClass].join(" ")).filter("li:has(ul)").removeClass(m.pathClass)});g.o[c]=g.op=m;b("li:has(ul)",this)[(b.fn.hoverIntent&&!m.disableHI)?"hoverIntent":"hover"](i,e).each(function(){if(m.autoArrows){h(b(">a:first-child",this))}}).not("."+j.bcClass).hideSuperfishUl();var l=b("a",this);l.each(function(n){var o=l.eq(n).parents("li");l.eq(n).focus(function(){i.call(o)}).blur(function(){e.call(o)})});m.onInit.call(this)}).each(function(){var c=[j.menuClass];if(g.op.dropShadows&&!(b.browser.msie&&b.browser.version<7)){c.push(j.shadowClass)}b(this).addClass(c.join(" "))})};var a=b.fn.superfish;a.o=[];a.op={};a.IE7fix=function(){var c=a.op;if(b.browser.msie&&b.browser.version>6&&c.dropShadows&&c.animation.opacity!=undefined){this.toggleClass(a.c.shadowClass+"-off")}};a.c={bcClass:"sf-breadcrumb",menuClass:"sf-js-enabled",anchorClass:"sf-with-ul",arrowClass:"sf-sub-indicator",shadowClass:"sf-shadow"};a.defaults={hoverClass:"sfHover",pathClass:"overideThisToUse",pathLevels:1,delay:800,animation:{opacity:"show"},speed:"normal",autoArrows:true,dropShadows:true,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){}};b.fn.extend({hideSuperfishUl:function(){var e=a.op,d=(e.retainPath===true)?e.$path:"";e.retainPath=false;var c=b(["li.",e.hoverClass].join(""),this).add(this).not(d).removeClass(e.hoverClass).find(">ul").hide().css("visibility","hidden");e.onHide.call(c);return this},showSuperfishUl:function(){var e=a.op,d=a.c.shadowClass+"-off",c=this.addClass(e.hoverClass).find(">ul:hidden").css("visibility","visible");a.IE7fix.call(c);e.onBeforeShow.call(c);c.animate(e.animation,e.speed,function(){a.IE7fix.call(c);e.onShow.call(c)});return this}})})(jQuery);
/* 
 * Auto-growing textareas - technique ripped from Facebook
 *
 * Hint - by Remy Sharp
 * http://remysharp.com/2007/01/25/jquery-tutorial-text-box-hints/
 *
 */
(function(a){a.fn.autogrow=function(b){this.filter("textarea").each(function(){var g=a(this),e=g.height(),c=g.css("lineHeight"),f=parseInt(a(this).css("paddingLeft")),d=a(this).innerWidth()-f*2-10;var i=a("<div></div>").css({position:"absolute",top:-10000,left:-10000,width:d,padding:parseInt(a(this).css("paddingLeft")),fontSize:g.css("fontSize"),fontFamily:g.css("fontFamily"),lineHeight:g.css("lineHeight"),resize:"none"}).appendTo(document.body);var h=function(){var j=this.value.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/&/g,"&amp;").replace(/\n/g,"<br/>");i.html(j);a(this).css("height",Math.max(i.height()+0,e))};a(this).change(h).keyup(h).keydown(h).blur(h);h.apply(this)});return this};a.fn.hint=function(b){if(!b){b="italic"}return this.each(function(){var g=a(this),e=g.attr("title"),d=a(this.form),f=a(window);function c(){if(g.val()===e&&g.hasClass(b)){g.val("").removeClass(b)}}if(e){g.blur(function(){if(this.value===""){g.val(e).addClass(b)}}).focus(c).blur();d.submit(c);f.unload(c)}})}})(jQuery);
/* Other js */
$(document).ready(function(){$(".hover").removeClass("hover");$("#navbar li.top").hoverIntent(function(){$(this).addClass("jshover").find(".sub").addClass("hovering").stop(true,true).slideDown();$(".sub").not(".hovering").stop(true,true).hide().parent().removeClass("jshover")},function(){toplink=$(this);toplink.find(".sub").delay(1000).slideUp("slow",function(){toplink.removeClass("jshover")}).removeClass("hovering")});$("#fb_message").hint().autogrow();$('input[name="publish"]').click(function(){var a=window.confirm($("#confirm_message").text());if(a){return true}else{return false}})});
