// Auto Expanding Text Area (1.2.2) - Copyright (c) 2008 Chrys Bader
(function(B){var A=null;B.fn.autogrow=function(C){return this.each(function(){new B.autogrow(this,C)})};B.autogrow=function(C,D){this.options=D||{};this.dummy=null;this.interval=null;this.line_height=this.options.lineHeight||parseInt(B(C).css("line-height"));this.min_height=this.options.minHeight||parseInt(B(C).css("min-height"));this.max_height=this.options.maxHeight||parseInt(B(C).css("max-height"));this.textarea=B(C);if(this.line_height==NaN){this.line_height=0}this.init()};B.autogrow.fn=B.autogrow.prototype={autogrow:"1.2.2"};B.autogrow.fn.extend=B.autogrow.extend=B.extend;B.autogrow.fn.extend({init:function(){var C=this;this.textarea.css({overflow:"hidden",display:"block"});this.textarea.bind("focus",function(){C.startExpand()}).bind("blur",function(){C.stopExpand()});this.checkExpand()},startExpand:function(){var C=this;this.interval=window.setInterval(function(){C.checkExpand()},400)},stopExpand:function(){clearInterval(this.interval)},checkExpand:function(){if(this.dummy==null){this.dummy=B("<div></div>");this.dummy.css({"font-size":this.textarea.css("font-size"),"font-family":this.textarea.css("font-family"),width:this.textarea.css("width"),padding:this.textarea.css("padding"),"line-height":this.line_height+"px","overflow-x":"hidden",position:"absolute",top:0,left:-9999}).appendTo("body")}var C=this.textarea.val().replace(/(<|>)/g,"");if($.browser.msie){C=C.replace(/\n/g,"<BR>new")}else{C=C.replace(/\n/g,"<br>new")}if(this.dummy.html()!=C){this.dummy.html(C);if(this.max_height>0&&(this.dummy.height()+this.line_height>this.max_height)){this.textarea.css("overflow-y","auto")}else{this.textarea.css("overflow-y","hidden");if(this.textarea.height()<this.dummy.height()+this.line_height||(this.dummy.height()<this.textarea.height())){this.textarea.animate({height:(this.dummy.height()+this.line_height)+"px"},100)}}}}})})(jQuery);

// Cookie - Copyright (c) 2006 Klaus Hartl
jQuery.cookie=function(B,I,L){if(typeof I!="undefined"){L=L||{};if(I===null){I="";L.expires=-1}var E="";if(L.expires&&(typeof L.expires=="number"||L.expires.toUTCString)){var F;if(typeof L.expires=="number"){F=new Date();F.setTime(F.getTime()+(L.expires*24*60*60*1000))}else{F=L.expires}E="; expires="+F.toUTCString()}var K=L.path?"; path="+(L.path):"";var G=L.domain?"; domain="+(L.domain):"";var A=L.secure?"; secure":"";document.cookie=[B,"=",encodeURIComponent(I),E,K,G,A].join("")}else{var D=null;if(document.cookie&&document.cookie!=""){var J=document.cookie.split(";");for(var H=0;H<J.length;H++){var C=jQuery.trim(J[H]);if(C.substring(0,B.length+1)==(B+"=")){D=decodeURIComponent(C.substring(B.length+1));break}}}return D}};

// jQuery Form Example Plugin 1.4.2 - used for search box
(function(a){a.fn.example=function(e,c){var d=a.isFunction(e);var b=a.extend({},c,{example:e});return this.each(function(){var f=a(this);if(a.metadata){var g=a.extend({},a.fn.example.defaults,f.metadata(),b)}else{var g=a.extend({},a.fn.example.defaults,b)}if(!a.fn.example.boundClassNames[g.className]){a(window).unload(function(){a("."+g.className).val("")});a("form").submit(function(){a(this).find("."+g.className).val("")});a.fn.example.boundClassNames[g.className]=true}if(a.browser.msie&&!f.attr("defaultValue")&&(d||f.val()==g.example)){f.val("")}if(f.val()==""&&this!=document.activeElement){f.addClass(g.className);f.val(d?g.example.call(this):g.example)}f.focus(function(){if(a(this).is("."+g.className)){a(this).val("");a(this).removeClass(g.className)}});f.change(function(){if(a(this).is("."+g.className)){a(this).removeClass(g.className)}});f.blur(function(){if(a(this).val()==""){a(this).addClass(g.className);a(this).val(d?g.example.call(this):g.example)}})})};a.fn.example.defaults={className:"example"};a.fn.example.boundClassNames=[]})(jQuery);

