(function(B){B.fn.example=function(A,F){var G=B.extend({},B.fn.example.defaults,F);var H=B.data(document.body,"example")||[];if(B.inArray(G.class_name,H)==-1){B(window).unload(function(){B("."+G.class_name).val("")});B(this).parents("form:first").submit(function(){B("."+G.class_name).val("")});H.push(G.class_name);B.data(document.body,"example",H)}return this.each(function(){var C=B(this);if(C.val()==""){C.addClass(G.class_name);C.val(A)}if(G.hide_label){B("label[@for="+C.attr("id")+"]").next("br").andSelf().hide()}C.focus(function(){if(B(this).hasClass(G.class_name)){B(this).val("");B(this).removeClass(G.class_name)}});C.blur(function(){if(B(this).val()==""){B(this).addClass(G.class_name);B(this).val(A)}})})};B.fn.example.defaults={class_name:"example",hide_label:false}})(jQuery);/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

/**
 * Create a cookie with the given name and value and other optional parameters.
 *
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Set the value of a cookie.
 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
 * @desc Create a cookie with all available options.
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Create a session cookie.
 * @example $.cookie('the_cookie', null);
 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
 *       used when the cookie was set.
 *
 * @param String name The name of the cookie.
 * @param String value The value of the cookie.
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
 *                             when the the browser exits.
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
 *                        require a secure protocol (like HTTPS).
 * @type undefined
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Get the value of a cookie with the given name.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String name The name of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};(function(B){B.fn.description=function(C){var A="modified";return this.each(function(){var D=B(this);if(D.contents().length==0||(D.contents().length==1&&jQuery.trim(D.text())=="")){D.addClass(A);D.text(C)}D.focus(function(){if(B(this).hasClass(A)){B(this).text("");B(this).removeClass(A)}});D.blur(function(){if(B(this).text()==""){B(this).addClass(A);B(this).val(C)}})})}})(jQuery);if(typeof $daemach=="undefined"){$daemach={};$daemach.debug=false;$daemach.log=function(){if(!top.window.console||!top.window.console.log||!$daemach.debug){return }else{top.window.console.log([].join.call(arguments,""))}}}if(typeof $daemach.frameReady=="undefined"){$daemach.frameReady={}}jQuery.frameReady=function(f,t,r,j){var jQueryPath="/static/javascript/jquery-1.4.2.js";var u="undefined";var $fr=$daemach.frameReady;var fn=t.split(".").join("_");if(typeof $fr[fn]==u){$fr[fn]={};$fr[fn]["settings"]={remote:true,jquery:true,load:[{type:"script",id:"_jq",src:jQueryPath,test:"jQuery"}],bLoaded:false,loadInit:[],callback:false};$fr[fn]["target"]=t}var fr=$fr[fn];var frs=fr.settings;if(fr.done){$daemach.log(fr.target+" is ready.  Running functions now.");return(frs.remote)?eval(fr.target).eval("("+f.toString()+")()"):f()}for(var a=2;a<arguments.length;a++){var arg=arguments[a];if(jQuery.isFunction(arg)){frs.callback=arg}else{if(typeof arg=="object"){if(typeof arg.remote!==u){frs.remote=arg.remote}if(typeof arg.jquery!==u){frs.jquery=arg.jquery}if(!frs.remote||!frs.jquery){frs.load.pop()}if(typeof arg.load!==u){var bl=true;if(arg.load.constructor==Array&&arg.load.length){for(var i=0;i<arg.load.length;i++){bl=true;for(var h=0;h<frs.load.length;h++){if(frs.load[h].src==arg.load[i].src){bl=false}}if(bl){frs.load.push(arg.load[i])}}}else{if(typeof arg.load=="object"){for(var h=0;h<frs.load.length;h++){if(frs.load[h].src==arg.load.src){bl=false}}if(bl){frs.load.push(arg.load)}}}}}}}if(fr.timer){fr.ready.push(f)}else{fr.ready=[f];if(typeof addEvent!=="undefined"){addEvent(window,"load",function(){jQuery.isFrameReady(fn)})}fr.timer=setInterval(function(){jQuery.isFrameReady(fn)},13)}};jQuery.isFrameReady=function(fn){var u="undefined";var $d=$daemach;var fr=$d.frameReady[fn];var frs=fr.settings;if(fr.done){return false}var fx=eval(fr.target);$d.log(fn,": New Pass. Checking target");if(typeof fx!=="undefined"){$d.log(fn,": Found target.  Checking DOM");var fd=fx.document;if(fd&&fd.getElementsByTagName&&fd.getElementById&&fd.body&&fd.body.innerHTML.length){$d.log(fn,": Found DOM");if(frs.load.length&&!frs.bLoaded){for(var i=0;i<frs.load.length;i++){var s=frs.load[i];var _test;try{_test=eval("typeof fx."+s.test+' !== "undefined"')}catch(ex){_test=false}finally{$d.log(fn,": Running test for script ",i,". ",(_test||!s.test)?"Passed.":"Failed.")}if((_test||!s.test)&&frs.loadInit[i]){frs.bLoaded=(typeof s.test==u)?true:_test;continue}else{frs.bLoaded=false;if(typeof frs.loadInit[i]==u){var id=s.id||"frs_"+i;switch(s.type){case"script":$d.log(fn,": Loading script "+i+" ("+s.src+")");var ele=fd.createElement("script");ele.setAttribute("id",id);ele.setAttribute("src",s.src);fd.getElementsByTagName("body")[0].appendChild(ele);void (ele);frs.loadInit[i]=true;break;case"stylesheet":$d.log(fn,": Loading stylesheet "+i+" ("+s.src+")");var ele=fd.createElement("link");ele.setAttribute("id",id);ele.setAttribute("href",s.src);ele.setAttribute("rel","stylesheet");ele.setAttribute("type","text/css");fd.getElementsByTagName("body")[0].appendChild(ele);void (ele);frs.loadInit[i]=true;break;default:$d.log(fn,": Script "+i+" has a bad or missing type attribute...")}}break}}}else{clearInterval(fr.timer);fr.timer=null;fr.ready.push(function(){window.frameReadyUnload=function(root,fn){jQuery(window).bind("unload",function(){root.jQuery.frameReady.unload(fn)})}});$d.log(fn,": Processing function stack:");for(var i=0;i<fr.ready.length;i++){(frs.remote)?fx.eval("("+fr.ready[i].toString()+")()"):fr.ready[i]()}fx.frameReadyUnload(window,fn);$d.log(fn,": Function stack processing complete.");fr.ready=null;fr.done=true;if(frs.callback){$d.log(fn,": Found a callback.  Executing...");frs.callback()}}}}$d.log(fn,":")};jQuery.frameReady.unload=function(A){$daemach.log("Frame "+A+" is unloading.  Resetting state.");$daemach.frameReady[A].done=false;$daemach.frameReady[A]["settings"].bLoaded=false;$daemach.frameReady[A]["settings"].loadInit=[]};(function(F){var C;var A={};var G={};var L=2.399963;F.tagcloud={id:"TagCloud",version:"0.5.0",defaults:{height:null,type:"cloud",sizemax:20,sizemin:10,colormax:"00F",colormin:"B4D2FF",seed:null,power:0.5}};F.fn.extend({tagcloud:function(M){C=F.extend({},F.tagcloud.defaults,M);if(C.seed===null){C.seed=Math.ceil(Math.random()*45309714203)}switch(C.type){case"sphere":case"cloud":A={position:"relative"};G={position:"absolute",display:"block"};break;case"list":A={height:"auto"};G={position:"static",display:"inline"};break}B.setSeed(C.seed+123456);return this.each(function(f,a){var q=F(a);var R=q.find(">li");var S=R.length;var Z=q.width();var l=C.height===null?(0.004*Z*S):C.height;q.css({width:Z,height:l,listStyle:"none",margin:0,padding:0});q.css(A);var e=-2147483647;var r=2147483648;var T=-1;for(var d=0;d<S;d++){var p=F(R[d]);var n=p.attr("value")==-1?T++:p.attr("value");if(n>e){e=n}if(n<r){r=n}T=n}var b=e-r;var X=new Array();for(var d=0;d<S;d++){X[d]=d}for(var d,V,c=X.length;c;d=parseInt(B.rand(0,1000)/1000*c),V=X[--c],X[c]=X[d],X[d]=V){}T=-1;for(var d=0;d<S;d++){var p=F(R[d]);var n=p.attr("value")==-1?T++:p.attr("value");T=n;var g=((S-d-1)/(S-1));var g=(n-r)/b;var m=C.sizemin+g*(C.sizemax-C.sizemin);var N=D(C.colormin,C.colormax,g);p.css({fontSize:m,position:"absolute",color:"#"+N,margin:0,padding:0}).children().css({color:"#"+N});var Y=p.width();var h=p.height();var Q={};if(C.type!="list"){if(C.type=="cloud"){var s=B.rand(0,Z-Y);var W=X[d]*(l/S)-h/2}else{var P=Math.pow(d/S,C.power);var U=(d+Math.PI/2)*L;var s=Z/2-Y/2+0.5*Z*P*Math.sin(U);var W=l/2-h/2+0.5*l*P*Math.cos(U)}Q.left=s;Q.top=W}for(var O in G){Q[O]=G[O]}p.css(Q)}})}});var B=new function(){this.seed=23145678901;this.A=48271;this.M=2147483647;this.Q=this.M/this.A;this.R=this.M%this.A;this.oneOverM=1/this.M};B.setSeed=function(M){this.seed=M};B.next=function(){var M=this.seed/this.Q;var N=this.seed%this.Q;var O=this.A*N-this.R*M;this.seed=O+(O>0?0:this.M);return(this.seed*this.oneOverM)};B.rand=function(N,M){return Math.floor((M-N+1)*this.next()+N)};function I(M){return M.toString(16)}function K(M){return parseInt(M,16)}function H(Q){var M=Q.length==3;var O=[];for(var N=0;N<3;N++){var P=Q.substring(N*(M?1:2),(N+1)*(M?1:2));O.push(K(M?P+P:P))}return O}function J(M){var O="";for(var N=0;N<3;N++){var P=I(M[N]);if(P.length==1){P="0"+P}O+=P}return O}function D(R,S,P){var Q=H(R);var M=H(S);var O=[];for(var N=0;N<3;N++){O.push(Q[N]+Math.floor(P*(M[N]-Q[N])))}return J(O)}function E(M){if(window.console&&window.console.log){if(typeof (M)=="string"){window.console.log(M)}else{for(var N in M){window.console.log(N+": "+M[N])}}}}F.fn.TagCloud=F.fn.Tagcloud=F.fn.tagcloud})(jQuery);(function(B){B.extend({tabs:{remoteCount:0}});B.fn.tabs=function(D,E){if(typeof D=="object"){E=D}E=B.extend({initial:(D&&typeof D=="number"&&D>0)?--D:0,disabled:null,bookmarkable:B.ajaxHistory?true:false,remote:false,spinner:"Loading&#8230;",hashPrefix:"remote-tab-",fxFade:null,fxSlide:null,fxShow:null,fxHide:null,fxSpeed:"normal",fxShowSpeed:null,fxHideSpeed:null,fxAutoHeight:false,onClick:null,onHide:null,onShow:null,onRemoteLoad:null,navClass:"tabs-nav",selectedClass:"tabs-selected",disabledClass:"tabs-disabled",containerClass:"tabs-container",hideClass:"tabs-hide",loadingClass:"tabs-loading",tabStruct:"div"},E||{});B.browser.msie6=B.browser.msie&&(B.browser.version&&B.browser.version<7||/6.0/.test(navigator.userAgent));function F(){scrollTo(0,0)}return this.each(function(){var P=this;var N=B("ul."+E.navClass,P);N=N.size()&&N||B(">ul:eq(0)",P);var Y=B("a",N);if(E.remote){Y.each(function(){if(!/#/.test(this.href)){this.remote="remote";var b=E.hashPrefix+(++B.tabs.remoteCount),a="#"+b,Z=this.href;this.href=a;B('<div id="'+b+'" class="'+E.containerClass+'"></div>').appendTo(P);B(this).bind("loadRemoteTab",function(g,h){if(!B(a).html()){var c=B(this).addClass(E.loadingClass),d=B("span",this)[0],f=d.innerHTML;if(E.spinner){d.innerHTML="<em>"+E.spinner+"</em>"}setTimeout(function(){B(a).load(Z,function(){if(E.spinner){d.innerHTML=f}c.removeClass(E.loadingClass);jQuery.isFunction(h)&&h();jQuery.isFunction(E.onRemoteLoad)&&E.onRemoteLoad.call(this)})},0)}else{jQuery.isFunction(h)&&h()}})}})}var R=B("> div."+E.containerClass,P);R=R.size()&&R||B(">"+E.tabStruct,P);N.is("."+E.navClass)||N.addClass(E.navClass);R.each(function(){var Z=B(this);Z.is("."+E.containerClass)||Z.addClass(E.containerClass)});var L=B("li",N).index(B("li."+E.selectedClass,N)[0]);if(L>=0){E.initial=L}if(location.hash){Y.each(function(a){if(this.hash==location.hash){E.initial=a;if((B.browser.msie||B.browser.opera)&&!this.remote){var Z=B(location.hash);var b=Z.attr("id");Z.attr("id","");setTimeout(function(){Z.attr("id",b)},500)}F();return false}})}if(B.browser.msie){F()}R.filter(":eq("+E.initial+")").show().end().not(":eq("+E.initial+")").addClass(E.hideClass);B("li",N).removeClass(E.selectedClass).slice(E.initial,E.initial+1).addClass(E.selectedClass);Y.slice(E.initial,E.initial+1).trigger("loadRemoteTab").end();if(E.fxAutoHeight){var X=function(Z){var a=B.map(R.get(),function(c){var b,d=B(c);if(Z){if(B.browser.msie6){c.style.removeExpression("behaviour");c.style.height="";c.minHeight=null}b=d.css({"min-height":""}).height()}else{b=d.height()}return b}).sort(function(d,c){return c-d});if(B.browser.msie6){R.each(function(){this.minHeight=a[0]+"px";this.style.setExpression("behaviour",'this.style.height = this.minHeight ? this.minHeight : "1px"')})}else{R.css({"min-height":a[0]+"px"})}};X();var O=P.offsetWidth;var W=P.offsetHeight;var I=B("#tabs-watch-font-size").get(0)||B('<span id="tabs-watch-font-size">M</span>').css({display:"block",position:"absolute",visibility:"hidden"}).appendTo(document.body).get(0);var Q=I.offsetHeight;setInterval(function(){var a=P.offsetWidth;var b=P.offsetHeight;var Z=I.offsetHeight;if(b>W||a!=O||Z!=Q){X((a>O||Z<Q));O=a;W=b;Q=Z}},50)}var J={},S={},H=E.fxShowSpeed||E.fxSpeed,M=E.fxHideSpeed||E.fxSpeed;if(E.fxSlide||E.fxFade){if(E.fxSlide){J.height="show";S.height="hide"}if(E.fxFade){J.opacity="show";S.opacity="hide"}}else{if(E.fxShow){J=E.fxShow}else{J["min-width"]=0;H=1}if(E.fxHide){S=E.fxHide}else{S["min-width"]=0;M=1}}var K=E.onClick,G=E.onHide,T=E.onShow;Y.bind("triggerTab",function(){var Z=B(this).parents("li:eq(0)");if(P.locked||Z.is("."+E.selectedClass)||Z.is("."+E.disabledClass)){return false}var b=this.hash;if(B.browser.msie){B(this).trigger("click");if(E.bookmarkable){B.ajaxHistory.update(b);location.hash=b.replace("#","")}}else{if(B.browser.safari){var a=B('<form action="'+b+'"><div><input type="submit" value="h" /></div></form>').get(0);a.submit();B(this).trigger("click");if(E.bookmarkable){B.ajaxHistory.update(b)}}else{if(E.bookmarkable){location.hash=b.replace("#","")}else{B(this).trigger("click")}}}});Y.bind("disableTab",function(){var Z=B(this).parents("li:eq(0)");if(B.browser.safari){Z.animate({opacity:0},1,function(){Z.css({opacity:""})})}Z.addClass(E.disabledClass)});if(E.disabled&&E.disabled.length){for(var V=0,U=E.disabled.length;V<U;V++){Y.slice(--E.disabled[V],E.disabled[V]+1).trigger("disableTab").end()}}Y.bind("enableTab",function(){var Z=B(this).parents("li:eq(0)");Z.removeClass(E.disabledClass);if(B.browser.safari){Z.animate({opacity:1},1,function(){Z.css({opacity:""})})}});Y.bind("click",function(d){var j=d.clientX;var f=this,k=B(this).parents("li:eq(0)"),a=R.filter(this.hash),g=R.filter(":visible");if(P.locked||k.is("."+E.selectedClass)||k.is("."+E.disabledClass)||typeof K=="function"&&K.call(this,a[0],g[0])===false){this.blur();return false}P.locked=true;if(a.size()){if(B.browser.msie&&E.bookmarkable){var Z=this.hash.replace("#","");a.attr("id","");setTimeout(function(){a.attr("id",Z)},0)}var c={display:"",overflow:"",height:""};if(!B.browser.msie){c.opacity=""}function b(){if(E.bookmarkable&&j){B.ajaxHistory.update(f.hash)}g.animate(S,M,function(){B(f).parents("li:eq(0)").addClass(E.selectedClass).siblings().removeClass(E.selectedClass);g.addClass(E.hideClass).css(c);if(typeof G=="function"){G.call(f,a[0],g[0])}if(!(E.fxSlide||E.fxFade||E.fxShow)){a.css("display","block")}a.animate(J,H,function(){a.removeClass(E.hideClass).css(c);if(B.browser.msie){g[0].style.filter="";a[0].style.filter=""}if(typeof T=="function"){T.call(f,a[0],g[0])}P.locked=null})})}if(!f.remote){b()}else{B(f).trigger("loadRemoteTab",[b])}}else{alert("There is no such container.")}var i=window.pageXOffset||document.documentElement&&document.documentElement.scrollLeft||document.body.scrollLeft||0;var h=window.pageYOffset||document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop||0;setTimeout(function(){window.scrollTo(i,h)},0);this.blur();return E.bookmarkable&&!!j});if(E.bookmarkable){B.ajaxHistory.initialize(function(){Y.slice(E.initial,E.initial+1).trigger("click").end()})}})};var C=["triggerTab","disableTab","enableTab"];for(var A=0;A<C.length;A++){B.fn[C[A]]=(function(D){return function(E){return this.each(function(){var H=B("ul.tabs-nav",this);H=H.size()&&H||B(">ul:eq(0)",this);var F;if(!E||typeof E=="number"){var G=(E&&E>0&&E-1||0);F=B("li a",H).slice(G,G+1)}else{if(typeof E=="string"){F=B('li a[@href$="#'+E+'"]',H)}}F.trigger(D)})}})(C[A])}B.fn.activeTab=function(){var D=[];this.each(function(){var F=B("ul.tabs-nav",this);F=F.size()&&F||B(">ul:eq(0)",this);var E=B("li",F);D.push(E.index(E.filter(".tabs-selected")[0])+1)});return D[0]}})(jQuery);
