/* jQuery wordStats plugin: tries to determine what a page is about
 * by computing the density of its keywords
 * Copyright (C) 2007 Jean-Francois Hovinne - http://www.hovinne.com/
 * Dual licensed under the MIT (MIT-license.txt)
 * and GPL (GPL-license.txt) licenses.
 */
 
jQuery.wordStats = {

    unsortedWords: null,
    sortedWords: null,
    topWords: null,
    topWeights: null,
    _computed: false,


    //add words from provided string to unsortedWords array
    addWords: function(str, weight) {
        if(str && str.length > 1) {
            var w = this.splitWords(str.toLowerCase());
            for(var x = 0, y = w.length; x < y; x++) {
                word = w[x];
                if(word.length > 1 ) {
                    word = '_' + word;
                    if(this.unsortedWords[word])
                        this.unsortedWords[word] += weight;
                    else this.unsortedWords[word] = weight;
                }
            }
        } 
    },

    //add words from text nodes only
    addWordsFromTextNodes: function(node, weight) {
        var nodes = node.childNodes;
        for(var i = 0, j = nodes.length; i < j; i++) {
            if(nodes[i].nodeType == 3) this.addWords(nodes[i].nodeValue, weight);
        }
    },
    
    //accept Latin-1 basic + Latin-1 extended characters
    testChar: function(c) {
        return((c >= 97 && c <= 122)
            || (c >= 128 && c <= 151)
            || (c >= 160 && c <= 164)
            || (c >= 48 && c <= 57)
            || (c >= 224 && c <= 246)
            || (c >= 249 && c <= 255)
			|| (c = "'" || " " || "&"));
    },

    //split words
    splitWords: function(words) {
        var w = new Array(), str = '';
        for(var i = 0, j = words.length; i < j; i++) {
            c = words.charCodeAt(i);
            if(this.testChar(c)) str += words.substring(i, i + 1);
            else {
                w.push(str);
                str = '';
            }
        }
        
        if(str.length > 0) w.push(str);
        return(w);
    },

    //main function: compute words from web page / element
    computeWords: function(elem) {
        
        if(!elem) elem = window.document;
        
        this.unsortedWords = new Array();
        
        this.addWords(jQuery('title', elem).text(), 20);
        
        wordstats = this;
       
        jQuery('h1', elem).each(function() {
            wordstats.addWordsFromTextNodes(jQuery(this).get(0), 15);
        });

        jQuery('h2', elem).each(function() {
            wordstats.addWordsFromTextNodes(jQuery(this).get(0), 10);
        });

        jQuery('h3, h4, h5, h6', elem).each(function() {
            wordstats.addWordsFromTextNodes(jQuery(this).get(0), 5);
        });

        jQuery('strong, b, em, i', elem).each(function() {
        	wordstats.addWordsFromTextNodes(jQuery(this).get(0), 3);
        });

        jQuery('p, div, th, td, li, a, span', elem).each(function() {
        	wordstats.addWordsFromTextNodes(jQuery(this).get(0), 2);
        });

        jQuery('img', elem).each(function() {
            wordstats.addWords(jQuery(this).attr('alt'), 1);
            wordstats.addWords(jQuery(this).attr('title'), 1);
        });
        
        this._computed = true;
    },
    
    //compute 'top' words: words which occur the most frequently
    computeTopWords: function(count, elem) {
    
        if(!this._computed) this.computeWords(elem);
    
        this.topWords = new Array();
        this.topWeights = new Array();
        
        this.topWeights.push(0);
        for(word in this.unsortedWords) {
            for(var i = 0; i < count; i++) {
                if(this.unsortedWords[word] > this.topWeights[i]) {
                    this.topWeights.splice(i, 0, this.unsortedWords[word]);
                    this.topWords.splice(i, 0, word);
                    break;
                }
            }
        }
    },
    
    //sort the unsortedWords array, based on words 'weights' descending
    sortWords: function() {
        this.sortedWords = new Array();
        //sort the associative array desc
        i = 0;
        for(word in this.unsortedWords) { this.sortedWords[i] = word; i++; }
        this.sortedWords.sort(function(a, b) {
                return wordstats.unsortedWords[b] - wordstats.unsortedWords[a];
            }
        );
    },
    
    //release memory
    clear: function() {
        this.unsortedWords
        = this.sortedWords
        = this.topWords
        = this.topWeights
        = null;
        this._computed = false;
    }
};

/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 2/19/2008
 * @author Ariel Flesler
 * @version 1.3.3
 *
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
;(function($){var o=$.scrollTo=function(a,b,c){o.window().scrollTo(a,b,c)};o.defaults={axis:'y',duration:1};o.window=function(){return $($.browser.safari?'body':'html')};$.fn.scrollTo=function(l,m,n){if(typeof m=='object'){n=m;m=0}n=$.extend({},o.defaults,n);m=m||n.speed||n.duration;n.queue=n.queue&&n.axis.length>1;if(n.queue)m/=2;n.offset=j(n.offset);n.over=j(n.over);return this.each(function(){var a=this,b=$(a),t=l,c,d={},w=b.is('html,body');switch(typeof t){case'number':case'string':if(/^([+-]=)?\d+(px)?$/.test(t)){t=j(t);break}t=$(t,this);case'object':if(t.is||t.style)c=(t=$(t)).offset()}$.each(n.axis.split(''),function(i,f){var P=f=='x'?'Left':'Top',p=P.toLowerCase(),k='scroll'+P,e=a[k],D=f=='x'?'Width':'Height';if(c){d[k]=c[p]+(w?0:e-b.offset()[p]);if(n.margin){d[k]-=parseInt(t.css('margin'+P))||0;d[k]-=parseInt(t.css('border'+P+'Width'))||0}d[k]+=n.offset[p]||0;if(n.over[p])d[k]+=t[D.toLowerCase()]()*n.over[p]}else d[k]=t[p];if(/^\d+$/.test(d[k]))d[k]=d[k]<=0?0:Math.min(d[k],h(D));if(!i&&n.queue){if(e!=d[k])g(n.onAfterFirst);delete d[k]}});g(n.onAfter);function g(a){b.animate(d,m,n.easing,a&&function(){a.call(this,l)})};function h(D){var b=w?$.browser.opera?document.body:document.documentElement:a;return b['scroll'+D]-b['client'+D]}})};function j(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);

/*
 * nyroModal - jQuery Plugin
 * http://nyromodal.nyrodev.com
 *
 * Copyright (c) 2008 Cedric Nirousset (nyrodev.com)
 * Licensed under the MIT license
 *
 * $Date: 2009-02-19 (Thu, 19 Feb 2009) $
 * $version: 1.4.2
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([3-68]|[1-5]\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('jQuery(8(e){6 u=navigator.userAgent.2A();6 N=(u.46(/.+(?:rv|it|ra|ie)[\\/: ]([\\d.]+)/)||[0,\'0\'])[1];6 x=(/3n/.1V(u)&&!/opera/.1V(u)&&47(N)<7);6 v=e(\'23\');6 a;6 E=13;6 C=13;6 y;6 F;6 b={2O:13,1P:13,1D:13,1q:13,2j:13,1Q:13,1E:13,2P:13,1R:13,1A:19,24:19,1J:19,bg:19,1g:19,1a:19,11:19,1e:19,16:19,2Q:1W 2B(),2R:1W 2B()};6 p={4:13,5:13};e.fn.1B=8(d){3(!1f)15 13;15 1f.2S(8(){3(1f.2C.2A()==\'1X\'){e(1f).48(8(c){3(e(1f).26(\'3o\'))15 12;3(1f.49==\'4a/1X-26\'){z(e.1j(d,{1m:1f}));15 12}c.1Y();z(e.1j(d,{1m:1f}));15 13})}14{e(1f).28(8(c){c.1Y();z(e.1j(d,{1m:1f}));15 13})}})};e.fn.2k=8(c){3(!1f.1L)z(c);15 1f.2S(8(){z(e.1j(c,{1m:1f}))})};e.2k=8(c){z(c)};e.2l=8(c,d,f){l(c,d,f);3(!d&&b.2O){3(b.bg&&c.2D)a.4b(b,a,8(){});3(b.16&&c.1y)O();3(((c.4&&c.4==a.4)||(c.5&&c.5==a.5))){3(b.16)P(12);3(b.16&&b.16.is(\':visible\')&&!b.2j){3(C)b.11.10({1o:\'\'});a.4c(b,a,8(){3(C)b.11.10({1o:\'3p\'});3(e.1Z(a.3q))a.3q(b,a)})}}}};e.nyroModalRemove=8(){A()};e.2E=8(){6 c=G(1);3(c)15 c.2k(H());15 13};e.2F=8(){6 c=G(-1);3(c)15 c.2k(H());15 13};e.fn.1B.29={2T:13,1A:13,2m:13,1b:\'\',1m:\'\',hash:\'\',3r:19,2G:\'nyroModalSel\',2U:\'1B\',11:19,2D:\'#000000\',20:{},21:{wmode:\'transparent\'},4:19,5:19,3s:2n,3t:4d,2V:12,3u:12,1C:25,4e:\'[^\\.]\\.(jpg|jpeg|png|tiff|gif|bmp)\\s*$\',3v:\'3w\',4f:12,4g:12,2o:19,4h:\'<a 1z="#" 1u="2F">Prev</a><a 1z="#"  1u="2E">Next</a>\',10:{bg:{1o:\'2H\',1F:\'1S\',1v:0,1w:0,5:\'1G%\',4:\'1G%\'},1e:{1o:\'2H\',1v:\'50%\',1w:\'50%\'},2I:{},11:{1F:\'1M\'},1g:{1o:\'2H\',1v:\'50%\',1w:\'50%\',1k:\'-2W\',1l:\'-2W\'}},4i:{17:\'<17 1u="1e"></17>\',20:\'<17 1u="1e"></17>\',1X:\'<17 1u="1e"></17>\',3x:\'<17 1u="1e"></17>\',2p:\'<17 1u="wrapperImg"></17>\',21:\'<17 1u="wrapperSwf"></17>\',1c:\'<17 1u="4j"></17>\',2X:\'<17 1u="4j"></17>\',4k:\'<17 1u="1e"></17>\'},4l:\'<a 1z="#" 1u="2Y" id="closeBut" 1y="close">4m</a>\',1y:19,3y:12,3z:\'.1B\',2Z:\'.2Y\',4n:\'<a 1z="#" 1u="2Y">Cancel</a>\',4o:\'1R\',4p:\'The requested 11 cannot be loaded.<br />Please try again later.<br /><a 1z="#" 1u="2Y">4m</a>\',3C:19,4q:bb,30:bc,3D:19,4t:bd,31:19,3E:19,3F:be,4v:bf,4x:bg,4y:bh,3G:bi,4c:bj,3q:19,4b:bk,32:19};8 z(f){3(b.1Q||b.1E||b.1q)15;j(\'processModal\');b.2O=12;bl(f);3(!b.1J)b.24=b.1A=19;b.1R=13;b.2P=13;b.1D=13;b.2Q=1W 2B();b.2R=1W 2B();a.1b=bm();3(e.1Z(a.3r))a.3r(a);1m=a.1m;1h=a.1h;3(a.1b==\'21\'){a.2V=13;l({1F:\'1S\'},\'10\',\'11\');a.11=\'<4F classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 4="\'+a.4+\'" 5="\'+a.5+\'"><33 1N="movie" 2q="\'+1h+\'"></33>\';6 h=\'\';e.2S(a.21,8(c,d){a.11+=\'<33 1N="\'+c+\'" 2q="\'+d+\'"></33>\';h+=\' \'+c+\'="\'+d+\'"\'});a.11+=\'<4G 1T="\'+1h+\'" 1b="application/x-shockwave-flash" 4="\'+a.4+\'" 5="\'+a.5+\'"\'+h+\'></4G></4F>\'}3(1m){6 g=e(1m);3(a.1b==\'1X\'){6 i=e(1m).serializeArray();i.2J({1N:a.2U,2q:1});3(a.1p)i.2J({1N:a.2G,2q:a.1p.2a(1)});e.20(e.1j({},a.20,{1h:1h,26:i,1b:1m.method,4H:Q,1R:r}));j(\'3H 4I 2r: \'+g.1d(\'2s\'));s()}14 3(a.1b==\'3x\'){w();g.1d(\'2t\',\'2b\');g.1d(\'2s\',1h);g.2K(\'<3I 1b="1S" 1N="\'+a.2U+\'" 2q="1" />\');3(a.1p)g.2K(\'<3I 1b="1S" 1N="\'+a.2G+\'" 2q="\'+a.1p.2a(1)+\'" />\');b.1a.1i(\'<1c 3J="0" 3K="0" 1N="2b"></1c>\');e(\'1c\',b.1a).10({4:a.4,5:a.5}).1R(r).2c(bn);j(\'3H Data 2r: \'+g.1d(\'2s\'));s();t()}14 3(a.1b==\'2p\'){6 k=g.1d(\'1y\')||a.3v;w();b.1a.1i(\'<2u id="4K" />\').22(\'2u\').1d(\'3L\',k);j(\'3w 2r: \'+1h);b.1a.10({4L:0});e(\'2u\',b.1a).1R(r).2c(8(){j(\'3w Loaded: \'+1f.1T);e(1f).3M(\'2c\');6 c=b.1a.4();6 d=b.1a.5();b.1a.10({4L:\'\'});p.4=c;p.5=d;l({4:c,5:d,34:c,35:d});l({1F:\'1S\'},\'10\',\'11\');b.1D=12;3(b.1Q||b.1E)t()}).1d(\'1T\',1h);s()}14 3(a.1b==\'2X\'){w();b.1a.1i(\'<1c 3J="0" 3K="0" 1T="" 1N="2b" id="2b"></1c>\');j(\'4M 3H 2r: \'+1h);e(\'1c\',b.1a).eq(0).10({4:\'1G%\',5:e.4N.4O?\'99%\':\'1G%\'}).2c(8(c){3(a.3y&&1h.36(1U.2d.2v)>-1)e.2l({1y:e(\'1c\',b.1J).1H().22(\'1y\').3O()})});b.1D=12;s()}14 3(a.1b==\'1c\'){w();b.1a.1i(\'<1c 3J="0" 3K="0" 1T="\'+1h+\'" 1N="2b" id="2b"></1c>\');j(\'4M 2r: \'+1h);e(\'1c\',b.1a).eq(0).10({4:\'1G%\',5:e.4N.4O?\'99%\':\'1G%\'}).2c(8(c){3(a.3y&&1h.36(1U.2d.2v)>-1)e.2l({1y:e(\'1c\',b.1J).1H().22(\'1y\').3O()})});b.1D=12;s()}14 3(a.1b){j(\'4Q: \'+a.1b);w();b.1a.1i(a.11);6 n=b.1a.4();6 q=b.1a.5();6 o=e(a.1b);3(o.1L){l({1b:\'17\'});n=o.4();q=o.5();3(y)F=y;y=o;b.1a.1O(o.1H())}l({4:n,5:q});3(b.1a.1i())b.1D=12;14 r();3(!b.1P)s();14 I()}14{j(\'4I 2r: \'+1h);l({1b:\'20\'});6 i=a.20.26||{};3(a.1p){3(3P i=="3Q"){i+=\'&\'+a.2G+\'=\'+a.1p.2a(1)}14{i[a.2G]=a.1p.2a(1)}}e.20(e.1j(12,a.20,{1h:1h,4H:Q,1R:r,26:i}));s()}}14 3(a.11){j(\'4Q: \'+a.1b);l({1b:\'4k\'});w();b.1a.1i(e(\'<17/>\').1i(a.11).1H());3(b.1a.1i())b.1D=12;14 r();s()}14{}}8 bl(c){j(\'setDefaultCurrentSettings\');a=e.1j(12,{},e.fn.1B.29,c);a.1p=\'\';a.3a=0;a.3b=0;a.2V=12;J()}8 l(c,d,f){3(b.2O){3(d&&f){e.1j(12,a[d][f],c)}14 3(d){e.1j(12,a[d],c)}14{3(b.2j){3(c.4){c.3R=c.4;3c c[\'4\'];E=12}3(c.5){c.3S=c.5;3c c[\'5\'];E=12}}e.1j(12,a,c)}}14{3(d&&f){e.1j(12,e.fn.1B.29[d][f],c)}14 3(d){e.1j(12,e.fn.1B.29[d],c)}14{e.1j(12,e.fn.1B.29,c)}}}8 R(){3(x&&!b.1A){3(2e.3T){a.2f=2e.3T.4R;a.2g=2e.3T.3d}14{a.2f=2e.23.4R;a.2g=2e.23.3d}}14{a.2f=0;a.2g=0}}8 J(){R();a.1l=-(a.4+a.3a)/2;a.1k=-(a.5+a.3b)/2;3(!b.1A){a.1l+=a.2f;a.1k+=a.2g}}8 K(){R();6 c=D(b.1g);a.2L=-(b.1g.5()+c.h.1r+c.h.1C)/2;a.3e=-(b.1g.4()+c.w.1r+c.w.1C)/2;3(!b.1A){a.marginLefttLoading+=a.2f;a.2L+=a.2g}}8 O(){6 c=e(\'h1#4S\',b.16);3(c.1L)c.3O(a.1y);14 b.16.2K(\'<h1 id="4S">\'+a.1y+\'</h1>\')}8 w(){j(\'initModal\');3(!b.1J){3(a.2T)l({color:\'white\'},\'10\',\'bg\');6 h={2M:1G,1o:\'3p\',1v:0,1w:0,4:\'1G%\',5:\'1G%\'};6 g=v;6 i=\'\';3(a.1A){b.1A=g=e(a.1A);6 k=b.1A.offset();6 n=b.1A.3f();6 q=b.1A.3g();3(x){l({5:\'1G%\',4:\'1G%\',1v:0,1w:0},\'10\',\'bg\')}b.24={1v:k.1v,1w:k.1w,4:n,5:q};6 o=(/3n/.1V(u)?0:m(v.3h(0),\'4T\'));6 B=(/3n/.1V(u)?0:m(v.3h(0),\'4U\'));h={1o:\'2H\',1v:k.1v+o,1w:k.1w+B,4:n,5:q}}14 3(x){v.10({5:v.5()+\'px\',4:v.4()+\'px\',1o:\'static\',1F:\'1S\'});e(\'1i\').10({1F:\'1S\'});l({10:{bg:{1o:\'2H\',2M:101,5:\'4V%\',4:\'4V%\',1v:a.2g+\'px\',1w:a.2f+\'px\'},1e:{2M:102},1g:{2M:103}}});i=e(\'<1c id="nyroModalIframeHideIe"></1c>\').10(e.1j({},a.10.bg,{1I:0,2M:50,1r:\'3V\'}))}g.1O(e(\'<17 id="4W"><17 id="4X"></17><17 id="4Y"><17 id="4Z"></17></17><17 id="51"></17><17 id="52"></17></17>\').1s());b.1J=e(\'#4W\').10(h).2h();b.bg=e(\'#4X\').10(e.1j({3i:a.2D},a.10.bg)).3W(i);3(!a.2m)b.bg.28(A);b.1g=e(\'#52\').10(a.10.1g).1s();b.16=e(\'#4Y\').10(a.10.1e).1s();b.11=e(\'#4Z\');b.1a=e(\'#51\').1s();3(e.1Z(e.fn.53)){b.11.53(8(c,d){6 f=b.11.3h(0);3((d>0&&f.3d==0)||(d<0&&f.scrollHeight-f.3d==f.clientHeight)){c.1Y();c.stopPropagation()}})}e(2e).54(S);b.11.10({4:\'1M\',5:\'1M\'});b.16.10({4:\'1M\',5:\'1M\'})}}8 s(){j(\'showModal\');3(!b.1P){w();b.1q=12;a.4q(b,a,bo)}14{b.1q=12;b.1E=12;a.4v(b,a,8(){I();b.1q=13;t()})}}8 S(c){3(c.2N==27){3(!a.2m)A()}14 3(a.2o&&b.1P&&b.1D&&!b.1q&&!b.1E){3(c.2N==39||c.2N==40){c.1Y();e.2E();15 13}14 3(c.2N==37||c.2N==38){c.1Y();e.2F();15 13}}}8 bm(){3(a.3X){6 c=a.3X;3(!a.11)a.1m=12;a.3X=19;15 c}6 d=a.1m;6 f;3(d&&d.2C){6 h=e(d);a.1h=f=d.2C.2A()==\'1X\'?h.1d(\'2s\'):d.1z;3(h.1d(\'56\')==\'2m\')a.2m=12;a.1y=h.1d(\'1y\');3(d&&d.3j)a.2o=d.3j;6 g=T(f,d);3(g)15 g;6 i=13;3(d.2t&&d.2t.2A()==\'57\'||(d.2v&&d.2v.3Y(/:\\d*$/,\'\')!=1U.2d.2v.3Y(/:\\d*$/,\'\'))){i=12}3(d.2C.2A()==\'1X\'){3(i)15\'2X\';l(U(f));3(h.1d(\'49\')==\'4a/1X-26\')15\'3x\';15\'1X\'}3(i)15\'1c\'}14{f=a.1h;3(!a.11)a.1m=12;3(!f)15 19;6 k=1W 3Z("^http://","g");3(f.46(k))15\'1c\'}6 g=T(f,d);3(g)15 g;6 n=1W 3Z(\'[^\\.]\\.(21)\\s*$\',\'i\');3(n.1V(f))15\'21\';6 c=U(f);l(c);3(!c.1h)15 c.1p}8 T(c,d){6 f=1W 3Z(a.4e,\'i\');3(f.1V(c)){15\'2p\'}}8 U(c){6 d={1h:19,1p:19};3(c){6 f=V(c);6 h=V(1U.2d.1z);6 g=1U.2d.1z.2a(0,1U.2d.1z.1L-h.1L);6 i=c.2a(0,c.1L-f.1L);3(i==g){d.1p=f}14{d.1h=i;d.1p=f}}15 d}8 r(){j(\'loadingError\');b.1R=12;3(!b.1P)15;3(e.1Z(a.3C))a.3C(b,a);b.1g.addClass(a.4o).1i(a.4p);e(a.2Z,b.1g).28(A);K();b.1g.10({1k:a.2L+\'px\',1l:a.3e+\'px\'})}8 W(){j(\'fillContent\');3(!b.1a.1i())15;b.11.1i(b.1a.1H());b.1a.41();bp();3(a.1b==\'2X\'){e(a.1m).1d(\'2t\',\'2b\').26(\'3o\',1).48().1d(\'2t\',\'57\').removeData(\'3o\')}3(e.1Z(a.3D))a.3D(b,a);b.11.1O(b.2Q);e(a.2Z,b.16).28(A);e(a.3z,b.16).1B(H())}8 H(){6 c=e.1j(12,{},a);3(p.4)c.4=19;3(p.5)c.5=19;c.10.11.1F=\'1M\';15 c}8 bp(){j(\'wrapContent\');6 d=e(a.4i[a.1b]);b.11.1O(d.3k().2w());b.16.wrapInner(d);3(a.2o){b.11.1O(a.4h);6 f=H();6 h=G(-1);3(h){6 g=e(\'.2F\',b.16).1d(\'1z\',h.1d(\'1z\')).28(8(c){c.1Y();h.2k(f);15 13});3(x&&a.1b==\'21\'){g.3W(e(\'<1c id="nyroModalIframeHideIeGalleryPrev"></1c>\').10({1o:g.10(\'1o\'),1v:g.10(\'1v\'),1w:g.10(\'1w\'),4:g.4(),5:g.5(),1I:0,1r:\'3V\'}))}}14{e(\'.2F\',b.16).2w()}6 i=G(1);3(i){6 k=e(\'.2E\',b.16).1d(\'1z\',i.1d(\'1z\')).28(8(c){c.1Y();i.2k(f);15 13});3(x&&a.1b==\'21\'){k.3W(e(\'<1c id="nyroModalIframeHideIeGalleryNext"></1c>\').10(e.1j({},{1o:k.10(\'1o\'),1v:k.10(\'1v\'),1w:k.10(\'1w\'),4:k.4(),5:k.5(),1I:0,1r:\'3V\'})))}}14{e(\'.2E\',b.16).2w()}}P()}8 G(c){3(a.2o){3(!a.4g)c*=-1;6 d=e(\'[3j="\'+a.2o+\'"]\');6 f=d.index(a.1m);6 h=f+c;3(h>=0&&h<d.1L)15 d.eq(h)}15 13}8 P(c){j(\'calculateSize\');3(!b.1e)b.1e=b.16.3k(\':first\');p.4=13;p.5=13;3(a.3u&&(!a.4||!a.5)){b.16.10({1I:0,4:\'1M\',5:\'1M\'}).2h();6 d={4:\'1M\',5:\'1M\'};3(a.4){d.4=a.4}14 3(a.1b==\'1c\'){d.4=a.3s}3(a.5){d.5=a.5}14 3(a.1b==\'1c\'){d.5=a.3t}b.11.10(d);3(!a.4){a.4=b.11.3f(12);p.4=12}3(!a.5){a.5=b.11.3g(12);p.5=12}b.16.1s().10({1I:1})}a.4=2i.59(a.4,a.3s);a.5=2i.59(a.5,a.3t);6 f=D(b.16);6 h=D(b.1e);6 g=D(b.11);6 d={11:{4:a.4,5:a.5},2I:{4:a.4+g.w.1t,5:a.5+g.h.1t},1e:{4:a.4+g.w.1t+h.w.1t,5:a.5+g.h.1t+h.h.1t}};3(a.2V){6 i=b.24?b.24.5:e(1U).5()-f.h.1r-(d.1e.5-a.5);6 k=b.24?b.24.4:e(1U).4()-f.w.1r-(d.1e.4-a.4);i-=a.1C*2;k-=a.1C*2;3(d.11.5>i||d.11.4>k){3(a.1b==\'2p\'){6 n=d.11.4-a.34;6 q=d.11.5-a.35;3(q<0)q=0;3(n<0)n=0;6 o=i-q;6 B=k-n;6 X=2i.42(o/a.35,B/a.34);o=2i.5a(a.35*X);B=2i.5a(a.34*X);e(\'2u#4K\',b.11).10({5:o+\'px\',4:B+\'px\'});d.11.5=o+q;d.11.4=B+n}14{d.11.5=2i.42(d.11.5,i);d.11.4=2i.42(d.11.4,k)}d.2I={4:d.11.4+g.w.1t,5:d.11.5+g.h.1t};d.1e={4:d.11.4+g.w.1t+h.w.1t,5:d.11.5+g.h.1t+h.h.1t}}}b.11.10(e.1j({},d.11,a.10.11));b.1e.10(e.1j({},d.2I,a.10.2I));3(!c){b.16.10(e.1j({},d.1e,a.10.1e));3(a.1b==\'2p\'){6 Y=e(\'2u\',b.11).1d(\'3L\');e(\'2u\',b.11).removeAttr(\'3L\');3(Y!=a.3v){6 L=e(\'<17>\'+Y+\'</17>\');b.11.1O(L);3(a.4f){6 bq=D(L);L.10({4:(d.11.4+g.w.1C-bq.w.1t)+\'px\'})}}}3(!a.2m)b.16.2K(a.4l)}3(a.1y)O();d.1e.3a=f.w.1r;d.1e.3b=f.h.1r;l(d.1e);J()}8 A(c){j(\'removeModal\');3(c)c.1Y();3(b.1J&&b.1P){b.1P=13;b.1q=12;b.2P=12;3(b.1Q||b.1E){a.3G(b,a,8(){b.1g.1s();b.1Q=13;b.1E=13;a.30(b,a,M)})}14{3(C)b.11.10({1o:\'\'});b.1e.10({1F:\'1S\'});b.11.10({1F:\'1S\'});3(e.1Z(a.3E)){a.3E(b,a,8(){a.3F(b,a,8(){I();a.30(b,a,M)})})}14{a.3F(b,a,8(){I();a.30(b,a,M)})}}}3(c)15 13}8 t(){j(\'showContentOrLoading\');3(b.1P&&!b.1q){3(b.1D){3(b.1a.1i()){b.1q=12;3(b.1E){W();b.2j=12;a.4x(b,a,8(){b.1g.1s();b.1E=13;b.1Q=13;Z()})}14{a.3G(b,a,8(){b.1g.1s();b.1Q=13;W();K();J();b.2j=12;a.4t(b,a,Z)})}}}14 3(!b.1Q&&!b.1E){b.1q=12;b.1Q=12;3(b.1R)r();14 b.1g.1i(a.4n);e(a.2Z,b.1g).28(A);K();a.4y(b,a,8(){b.1q=13;t()})}}}8 Q(c){j(\'AjaxLoaded: \'+1f.1h);b.1a.1i(a.1p?ba(e(\'<17>\'+c+\'</17>\').22(a.1p).1H()):ba(c));3(b.1a.1i()){b.1D=12;t()}14 r()}8 bn(){j(\'formDataLoaded\');6 c=e(a.1m);c.1d(\'2s\',c.1d(\'2s\')+a.1p);c.1d(\'2t\',\'\');e(\'3I[1N=\'+a.2U+\']\',a.1m).2w();6 d=b.1a.3k(\'1c\');6 f=d.3M(\'2c\').1H().22(a.1p||\'23\').not(\'5c[1T]\');d.1d(\'1T\',\'about:blank\');b.1a.1i(f.1i());3(b.1a.1i()){b.1D=12;t()}14 r()}8 I(){j(\'endHideContent\');b.1q=13;3(F){F.1O(b.11.1H());F=19}14 3(y){y.1O(b.11.1H());y=19}b.11.41();b.16.1s().3k().2w().41().1d(\'style\',\'\').1s();3(b.2P||b.1E)b.16.1s();b.16.10(a.10.1e).1O(b.11);t()}8 M(){j(\'32\');e(2e).3M(\'54\',S);b.1q=13;b.1J.2w();b.1J=19;3(x){v.10({5:\'\',4:\'\',1o:\'\',1F:\'\'});e(\'1i\').10({1F:\'\'})}3(e.1Z(a.32))a.32(b,a)}8 bo(){j(\'endBackground\');b.1P=12;b.1q=13;t()}8 Z(){j(\'31\');b.1q=13;b.2j=13;b.16.10({1I:\'\'});C=/mozilla/.1V(u)&&!/(compatible|webkit)/.1V(u)&&parseFloat(N)<1.9&&a.1b!=\'2p\';3(C)b.11.10({1o:\'3p\'});b.11.1O(b.2R);3(a.3u&&a.1b==\'1c\'){6 h=b.11.22(\'1c\');3(h.1L&&h.1d(\'1T\').36(1U.2d.2v)!==-1){6 g=h.1H().22(\'23\');3(g.5()>0){6 i=g.3g(12)+1;6 k=g.3f(12)+1;e.2l({5:i,4:k})}14{h.bind(\'2c\',8(){6 c=h.1H().22(\'23\');3(c.1L&&c.5()>0){6 d=c.3g(12)+1;6 f=c.3f(12)+1;e.2l({5:d,4:f})}})}}}3(e.1Z(a.31))a.31(b,a);3(E){E=13;e.2l({4:a.3R,5:a.3S});3c a[\'3R\'];3c a[\'3S\']}3(p.4)l({4:19});3(p.5)l({5:19})}8 V(c){3(3P c==\'3Q\'){6 d=c.36(\'#\');3(d>-1)15 c.2a(d)}15\'\'}8 ba(c){3(3P c==\'3Q\')c=c.3Y(/<\\/?(1i|head|23)([^>]*)>/gi,\'\');6 d=1W 2B();e.2S(e.clean({0:c},1f.ownerDocument),8(){3(e.2C(1f,"5c")){3(!1f.1T||e(1f).1d(\'3j\')==\'forceLoad\'){3(e(1f).1d(\'56\')==\'shown\')b.2R.2J(1f);14 b.2Q.2J(1f)}}14 d.2J(1f)});15 d}8 D(c){c=c.3h(0);6 d={h:{3l:m(c,\'1k\')+m(c,\'marginBottom\'),1r:m(c,\'4T\')+m(c,\'borderBottomWidth\'),1C:m(c,\'paddingTop\')+m(c,\'paddingBottom\')},w:{3l:m(c,\'1l\')+m(c,\'marginRight\'),1r:m(c,\'4U\')+m(c,\'borderRightWidth\'),1C:m(c,\'paddingLeft\')+m(c,\'paddingRight\')}};d.h.3m=d.h.3l+d.h.1r;d.w.3m=d.w.3l+d.w.1r;d.h.5d=d.h.1C+d.h.1r;d.w.5d=d.w.1C+d.w.1r;d.h.1t=d.h.3m+d.h.1C;d.w.1t=d.w.3m+d.w.1C;15 d}8 m(c,d){6 f=47(e.curCSS(c,d,12));3(isNaN(f))f=0;15 f}8 j(c){3(e.fn.1B.29.2T||a&&a.2T)5e(c,b,a||{})}8 bb(c,d,f){c.bg.10({1I:0}).5f(500,0.75,f)}8 bc(c,d,f){c.bg.44(4d,f)}8 bh(c,d,f){c.1g.10({1k:d.2L+\'px\',1l:d.3e+\'px\',1I:0}).2h().2x({1I:1},{2y:f,2z:2n})}8 bi(c,d,f){f()}8 bd(c,d,f){c.1g.10({1k:d.2L+\'px\',1l:d.3e+\'px\'}).2h().2x({4:d.4+\'px\',5:d.5+\'px\',1k:d.1k+\'px\',1l:d.1l+\'px\'},{2z:45,2y:8(){c.16.10({4:d.4+\'px\',5:d.5+\'px\',1k:d.1k+\'px\',1l:d.1l+\'px\'}).2h();c.1g.44(200,f)}})}8 be(c,d,f){c.16.2x({5:\'2W\',4:\'2W\',1k:(-(25+d.3b)/2+d.2g)+\'px\',1l:(-(25+d.3a)/2+d.2f)+\'px\'},{2z:45,2y:8(){c.16.1s();f()}})}8 bf(c,d,f){c.1g.10({1k:c.16.10(\'1k\'),1l:c.16.10(\'1l\'),5:c.16.10(\'5\'),4:c.16.10(\'4\'),1I:0}).2h().5f(2n,1,8(){c.16.1s();f()})}8 bg(c,d,f){c.16.1s().10({4:d.4+\'px\',5:d.5+\'px\',1l:d.1l+\'px\',1k:d.1k+\'px\',1I:1});c.1g.2x({4:d.4+\'px\',5:d.5+\'px\',1l:d.1l+\'px\',1k:d.1k+\'px\'},{2y:8(){c.16.2h();c.1g.44(2n,8(){c.1g.1s();f()})},2z:45})}8 bj(c,d,f){c.16.2x({4:d.4+\'px\',5:d.5+\'px\',1l:d.1l+\'px\',1k:d.1k+\'px\'},{2y:f,2z:2n})}8 bk(c,d,f){3(!e.fx.step.3i){c.bg.10({3i:d.2D});f()}14 c.bg.2x({3i:d.2D},{2y:f,2z:2n})}e(e.fn.1B.29.3z).1B()});8 5e(c,d,f){3(d.1J)d.bg.2K(c+\'<br />\')}',[],326,'|||if|width|height|var||function||||||||||||||||||||||||||||||||||||||||||||||||||||||css|content|true|false|else|return|contentWrapper|div||null|tmp|type|iframe|attr|wrapper|this|loading|url|html|extend|marginTop|marginLeft|from||position|selector|anim|border|hide|total|class|top|left||title|href|blocker|nyroModal|padding|dataReady|transition|overflow|100|contents|opacity|full||length|auto|name|append|ready|loadingShown|error|hidden|src|window|test|new|form|preventDefault|isFunction|ajax|swf|find|body|blockerVars||data||click|settings|substring|nyroModalIframe|load|location|document|marginScrollLeft|marginScrollTop|show|Math|animContent|nyroModalManual|nyroModalSettings|modal|400|gallery|image|value|Load|action|target|img|hostname|remove|animate|complete|duration|toLowerCase|Array|nodeName|bgColor|nyroModalNext|nyroModalPrev|selIndicator|absolute|wrapper2|push|prepend|marginTopLoading|zIndex|keyCode|started|closing|scripts|scriptsShown|each|debug|formIndicator|resizable|50px|iframeForm|nyroModalClose|closeSelector|hideBackground|endShowContent|endRemove|param|imgWidth|imgHeight|indexOf||||borderW|borderH|delete|scrollTop|marginLeftLoading|outerWidth|outerHeight|get|backgroundColor|rel|children|margin|outer|msie|processing|fixed|endResize|processHandler|minWidth|minHeight|autoSizable|defaultImgAlt|Image|formData|titleFromIframe|openSelector|||handleError|endFillContent|beforeHideContent|hideContent|hideLoading|Form|input|frameborder|hspace|alt|unbind||text|typeof|string|setWidth|setHeight|documentElement||none|before|forceType|replace|RegExp||empty|min||fadeOut|350|match|parseInt|submit|enctype|multipart|updateBgColor|resize|300|regexImg|setWidthImgTitle|ltr|galleryLinks|wrap|wrapperIframe|manual|closeButton|Close|contentLoading|errorClass|contentError|showBackground|||showContent||showTransition||hideTransition|showLoading|||||||object|embed|success|Ajax||nyroModalImg|lineHeight|Iframe|support|boxModel||Content|scrollLeft|nyroModalTitle|borderTopWidth|borderLeftWidth|110|nyroModalFull|nyroModalBg|nyroModalWrapper|nyroModalContent||nyrModalTmp|nyroModalLoading|mousewheel|keydown||rev|_blank||max|floor||script|inner|nyroModalDebug|fadeTo'.split('|'),0,{}))

/* Copyright (c) 2006 Kelvin Luck (kelvin AT kelvinluck DOT com || http://www.kelvinluck.com)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 * 
 * See http://kelvinluck.com/assets/jquery/jScrollPane/
 * $Id: jScrollPane.js 4765 2008-02-17 21:14:59Z kelvinluck $
 */

/**
 * Replace the vertical scroll bars on any matched elements with a fancy
 * styleable (via CSS) version. With JS disabled the elements will
 * gracefully degrade to the browsers own implementation of overflow:auto.
 * If the mousewheel plugin has been included on the page then the scrollable areas will also
 * respond to the mouse wheel.
 *
 * @example jQuery(".scroll-pane").jScrollPane();
 *
 * @name jScrollPane
 * @type jQuery
 * @param Object	settings	hash with options, described below.
 *								scrollbarWidth	-	The width of the generated scrollbar in pixels
 *								scrollbarMargin	-	The amount of space to leave on the side of the scrollbar in pixels
 *								wheelSpeed		-	The speed the pane will scroll in response to the mouse wheel in pixels
 *								showArrows		-	Whether to display arrows for the user to scroll with
 *								arrowSize		-	The height of the arrow buttons if showArrows=true
 *								animateTo		-	Whether to animate when calling scrollTo and scrollBy
 *								dragMinHeight	-	The minimum height to allow the drag bar to be
 *								dragMaxHeight	-	The maximum height to allow the drag bar to be
 *								animateInterval	-	The interval in milliseconds to update an animating scrollPane (default 100)
 *								animateStep		-	The amount to divide the remaining scroll distance by when animating (default 3)
 *								maintainPosition-	Whether you want the contents of the scroll pane to maintain it's position when you re-initialise it - so it doesn't scroll as you add more content (default true)
 *								scrollbarOnLeft	-	Display the scrollbar on the left side?  (needs stylesheet changes, see examples.html)
 * @return jQuery
 * @cat Plugins/jScrollPane
 * @author Kelvin Luck (kelvin AT kelvinluck DOT com || http://www.kelvinluck.com)
 */
jQuery.jScrollPane = {
	active : []
};
jQuery.fn.jScrollPane = function(settings)
{
	settings = jQuery.extend(
		{
			scrollbarWidth : 10,
			scrollbarMargin : 5,
			wheelSpeed : 18,
			showArrows : false,
			arrowSize : 0,
			animateTo : false,
			dragMinHeight : 1,
			dragMaxHeight : 99999,
			animateInterval : 100,
			animateStep: 3,
			maintainPosition: true,
			scrollbarOnLeft: false
		}, settings
	);
	return this.each(
		function()
		{
			var $this = jQuery(this);
			
			if (jQuery(this).parent().is('.jScrollPaneContainer')) {
				var currentScrollPosition = settings.maintainPosition ? $this.offset({relativeTo:jQuery(this).parent()[0]}).top : 0;
				var $c = jQuery(this).parent();
				var paneWidth = $c.innerWidth();
				var paneHeight = $c.outerHeight();
				var trackHeight = paneHeight;
				if ($c.unmousewheel) {
					$c.unmousewheel();
				}
				jQuery('>.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown', $c).remove();
				$this.css({'top':0});
			} else {
				var currentScrollPosition = 0;
				this.originalPadding = $this.css('paddingTop') + ' ' + $this.css('paddingRight') + ' ' + $this.css('paddingBottom') + ' ' + $this.css('paddingLeft');
				this.originalSidePaddingTotal = (parseInt($this.css('paddingLeft')) || 0) + (parseInt($this.css('paddingRight')) || 0);
				var paneWidth = $this.innerWidth();
				var paneHeight = $this.innerHeight();
				var trackHeight = paneHeight;
				$this.wrap(
					jQuery('<div></div>').attr(
						{'className':'jScrollPaneContainer'}
					).css(
						{
							'height':paneHeight+'px', 
							'width':paneWidth+'px'
						}
					)
				);
				// deal with text size changes (if the jquery.em plugin is included)
				// and re-initialise the scrollPane so the track maintains the
				// correct size
				jQuery(document).bind(
					'emchange', 
					function(e, cur, prev)
					{
						$this.jScrollPane(settings);
					}
				);
			}
			var p = this.originalSidePaddingTotal;
			
			var cssToApply = {
				'height':'auto',
				'width':paneWidth - settings.scrollbarWidth - settings.scrollbarMargin - p + 'px'
			}

			if(settings.scrollbarOnLeft) {
				cssToApply.paddingLeft = settings.scrollbarMargin + settings.scrollbarWidth + 'px';
			} else {
				cssToApply.paddingRight = settings.scrollbarMargin + 'px';
			}

			$this.css(cssToApply);

			var contentHeight = $this.outerHeight();
			var percentInView = paneHeight / contentHeight;

			if (percentInView < .99) {
				var $container = $this.parent();
				$container.append(
					jQuery('<div></div>').attr({'className':'jScrollPaneTrack'}).css({'width':settings.scrollbarWidth+'px'}).append(
						jQuery('<div></div>').attr({'className':'jScrollPaneDrag'}).css({'width':settings.scrollbarWidth+'px'}).append(
							jQuery('<div></div>').attr({'className':'jScrollPaneDragTop'}).css({'width':settings.scrollbarWidth+'px'}),
							jQuery('<div></div>').attr({'className':'jScrollPaneDragBottom'}).css({'width':settings.scrollbarWidth+'px'})
						)
					)
				);
				
				var $track = jQuery('>.jScrollPaneTrack', $container);
				var $drag = jQuery('>.jScrollPaneTrack .jScrollPaneDrag', $container);
				
				if (settings.showArrows) {
					
					var currentArrowButton;
					var currentArrowDirection;
					var currentArrowInterval;
					var currentArrowInc;
					var whileArrowButtonDown = function()
					{
						if (currentArrowInc > 4 || currentArrowInc%4==0) {
							positionDrag(dragPosition + currentArrowDirection * mouseWheelMultiplier);
						}
						currentArrowInc ++;
					};
					var onArrowMouseUp = function(event)
					{
						jQuery('html').unbind('mouseup', onArrowMouseUp);
						currentArrowButton.removeClass('jScrollActiveArrowButton');
						clearInterval(currentArrowInterval);
						//console.log($(event.target));
						//currentArrowButton.parent().removeClass('jScrollArrowUpClicked jScrollArrowDownClicked');
					};
					var onArrowMouseDown = function() {
						//console.log(direction);
						//currentArrowButton = $(this);
						jQuery('html').bind('mouseup', onArrowMouseUp);
						currentArrowButton.addClass('jScrollActiveArrowButton');
						currentArrowInc = 0;
						whileArrowButtonDown();
						currentArrowInterval = setInterval(whileArrowButtonDown, 100);
					};
					$container
						.append(
							jQuery('<a></a>')
								.attr({'href':'javascript:;', 'className':'jScrollArrowUp'})
								.css({'width':settings.scrollbarWidth+'px'})
								.html('Scroll up')
								.bind('mousedown', function()
								{
									currentArrowButton = jQuery(this);
									currentArrowDirection = -1;
									onArrowMouseDown();
									this.blur();
									return false;
								}),
							jQuery('<a></a>')
								.attr({'href':'javascript:;', 'className':'jScrollArrowDown'})
								.css({'width':settings.scrollbarWidth+'px'})
								.html('Scroll down')
								.bind('mousedown', function()
								{
									currentArrowButton = jQuery(this);
									currentArrowDirection = 1;
									onArrowMouseDown();
									this.blur();
									return false;
								})
						);
					var $upArrow = jQuery('>.jScrollArrowUp', $container);
					var $downArrow = jQuery('>.jScrollArrowDown', $container);
					if (settings.arrowSize) {
						trackHeight = paneHeight - settings.arrowSize - settings.arrowSize;
						$track
							.css({'height': trackHeight+'px', top:settings.arrowSize+'px'})
					} else {
						var topArrowHeight = $upArrow.height();
						settings.arrowSize = topArrowHeight;
						trackHeight = paneHeight - topArrowHeight - $downArrow.height();
						$track
							.css({'height': trackHeight+'px', top:topArrowHeight+'px'})
					}
				}
				
				var $pane = jQuery(this).css({'position':'absolute', 'overflow':'visible'});
				
				var currentOffset;
				var maxY;
				var mouseWheelMultiplier;
				// store this in a seperate variable so we can keep track more accurately than just updating the css property..
				var dragPosition = 0;
				var dragMiddle = percentInView*paneHeight/2;
				
				// pos function borrowed from tooltip plugin and adapted...
				var getPos = function (event, c) {
					var p = c == 'X' ? 'Left' : 'Top';
					return event['page' + c] || (event['client' + c] + (document.documentElement['scroll' + p] || document.body['scroll' + p])) || 0;
				};
				
				var ignoreNativeDrag = function() {	return false; };
				
				var initDrag = function()
				{
					ceaseAnimation();
					currentOffset = $drag.offset(false);
					currentOffset.top -= dragPosition;
					maxY = trackHeight - $drag[0].offsetHeight;
					mouseWheelMultiplier = 2 * settings.wheelSpeed * maxY / contentHeight;
				};
				
				var onStartDrag = function(event)
				{
					initDrag();
					dragMiddle = getPos(event, 'Y') - dragPosition - currentOffset.top;
					jQuery('html').bind('mouseup', onStopDrag).bind('mousemove', updateScroll);
					if (jQuery.browser.msie) {
						jQuery('html').bind('dragstart', ignoreNativeDrag).bind('selectstart', ignoreNativeDrag);
					}
					return false;
				};
				var onStopDrag = function()
				{
					jQuery('html').unbind('mouseup', onStopDrag).unbind('mousemove', updateScroll);
					dragMiddle = percentInView*paneHeight/2;
					if (jQuery.browser.msie) {
						jQuery('html').unbind('dragstart', ignoreNativeDrag).unbind('selectstart', ignoreNativeDrag);
					}
				};
				var positionDrag = function(destY)
				{
					destY = destY < 0 ? 0 : (destY > maxY ? maxY : destY);
					dragPosition = destY;
					$drag.css({'top':destY+'px'});
					var p = destY / maxY;
					$pane.css({'top':((paneHeight-contentHeight)*p) + 'px'});
					$this.trigger('scroll');
					if (settings.showArrows) {
						$upArrow[destY == 0 ? 'addClass' : 'removeClass']('disabled');
						$downArrow[destY == maxY ? 'addClass' : 'removeClass']('disabled');
					}
				};
				var updateScroll = function(e)
				{
					positionDrag(getPos(e, 'Y') - currentOffset.top - dragMiddle);
				};
				
				var dragH = Math.max(Math.min(percentInView*(paneHeight-settings.arrowSize*2), settings.dragMaxHeight), settings.dragMinHeight);
				
				$drag.css(
					{'height':dragH+'px'}
				).bind('mousedown', onStartDrag);
				
				var trackScrollInterval;
				var trackScrollInc;
				var trackScrollMousePos;
				var doTrackScroll = function()
				{
					if (trackScrollInc > 8 || trackScrollInc%4==0) {
						positionDrag((dragPosition - ((dragPosition - trackScrollMousePos) / 2)));
					}
					trackScrollInc ++;
				};
				var onStopTrackClick = function()
				{
					clearInterval(trackScrollInterval);
					jQuery('html').unbind('mouseup', onStopTrackClick).unbind('mousemove', onTrackMouseMove);
				};
				var onTrackMouseMove = function(event)
				{
					trackScrollMousePos = getPos(event, 'Y') - currentOffset.top - dragMiddle;
				};
				var onTrackClick = function(event)
				{
					initDrag();
					onTrackMouseMove(event);
					trackScrollInc = 0;
					jQuery('html').bind('mouseup', onStopTrackClick).bind('mousemove', onTrackMouseMove);
					trackScrollInterval = setInterval(doTrackScroll, 100);
					doTrackScroll();
				};
				
				$track.bind('mousedown', onTrackClick);
				
				// if the mousewheel plugin has been included then also react to the mousewheel
				if ($container.mousewheel) {
					$container.mousewheel(
						function (event, delta) {
							initDrag();
							ceaseAnimation();
							var d = dragPosition;
							positionDrag(dragPosition - delta * mouseWheelMultiplier);
							var dragOccured = d != dragPosition;
							return !dragOccured;
						},
						false
					);					
				}
				var _animateToPosition;
				var _animateToInterval;
				function animateToPosition()
				{
					var diff = (_animateToPosition - dragPosition) / settings.animateStep;
					if (diff > 1 || diff < -1) {
						positionDrag(dragPosition + diff);
					} else {
						positionDrag(_animateToPosition);
						ceaseAnimation();
					}
				}
				var ceaseAnimation = function()
				{
					if (_animateToInterval) {
						clearInterval(_animateToInterval);
						delete _animateToPosition;
					}
				};
				var scrollTo = function(pos, preventAni)
				{
					if (typeof pos == "string") {
						$e = jQuery(pos, this);
						if (!$e.length) return;
						pos = $e.offset().top - $this.offset().top;
					}
					ceaseAnimation();
					var destDragPosition = -pos/(paneHeight-contentHeight) * maxY;
					if (preventAni || !settings.animateTo) {
						positionDrag(destDragPosition);
					} else {
						_animateToPosition = destDragPosition;
						_animateToInterval = setInterval(animateToPosition, settings.animateInterval);
					}
				};
				$this[0].scrollTo = scrollTo;
				
				$this[0].scrollBy = function(delta)
				{
					var currentPos = -parseInt($pane.css('top')) || 0;
					scrollTo(currentPos + delta);
				};
				
				initDrag();
				
				scrollTo(-currentScrollPosition, true);
				
				jQuery.jScrollPane.active.push($this[0]);

			} else {
				$this.css(
					{
						'height':paneHeight+'px',
						'width':paneWidth-this.originalSidePaddingTotal+'px',
						'padding':this.originalPadding
					}
				);
				// remove from active list?
			}
			
		}
	)
};

// clean up the scrollTo expandos
jQuery(window)
	.bind('unload', function() {
		var els = jQuery.jScrollPane.active; 
		for (var i=0; i<els.length; i++) {
			els[i].scrollTo = els[i].scrollBy = null;
		}
	}
);

/**
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne <brian@cherne.net>
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);

/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-12-20 08:43:48 -0600 (Thu, 20 Dec 2007) $
 * $Rev: 4257 $
 *
 * Version: 1.2
 *
 * Requires: jQuery 1.2+
 */
(function($){$.dimensions={version:'1.2'};$.each(['Height','Width'],function(i,name){$.fn['inner'+name]=function(){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';return this.is(':visible')?this[0]['client'+name]:num(this,name.toLowerCase())+num(this,'padding'+torl)+num(this,'padding'+borr);};$.fn['outer'+name]=function(options){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';options=$.extend({margin:false},options||{});var val=this.is(':visible')?this[0]['offset'+name]:num(this,name.toLowerCase())+num(this,'border'+torl+'Width')+num(this,'border'+borr+'Width')+num(this,'padding'+torl)+num(this,'padding'+borr);return val+(options.margin?(num(this,'margin'+torl)+num(this,'margin'+borr)):0);};});$.each(['Left','Top'],function(i,name){$.fn['scroll'+name]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(name=='Left'?val:$(window)['scrollLeft'](),name=='Top'?val:$(window)['scrollTop']()):this['scroll'+name]=val;}):this[0]==window||this[0]==document?self[(name=='Left'?'pageXOffset':'pageYOffset')]||$.boxModel&&document.documentElement['scroll'+name]||document.body['scroll'+name]:this[0]['scroll'+name];};});$.fn.extend({position:function(){var left=0,top=0,elem=this[0],offset,parentOffset,offsetParent,results;if(elem){offsetParent=this.offsetParent();offset=this.offset();parentOffset=offsetParent.offset();offset.top-=num(elem,'marginTop');offset.left-=num(elem,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&$.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return $(offsetParent);}});function num(el,prop){return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;};})(jQuery);

/**
 *
 * Date picker
 * Author: Stefan Petre www.eyecon.ro
 * 
 * Dual licensed under the MIT and GPL licenses
 * 
 */
(function ($) {
	var DatePicker = function () {
		var	ids = {},
			views = {
				years: 'datepickerViewYears',
				moths: 'datepickerViewMonths',
				days: 'datepickerViewDays'
			},
			tpl = {
				wrapper: '<div class="datepicker"><div class="datepickerBorderT" /><div class="datepickerBorderB" /><div class="datepickerBorderL" /><div class="datepickerBorderR" /><div class="datepickerBorderTL" /><div class="datepickerBorderTR" /><div class="datepickerBorderBL" /><div class="datepickerBorderBR" /><div class="datepickerContainer"><table cellspacing="0" cellpadding="0"><tbody><tr></tr></tbody></table></div></div>',
				head: [
					'<td>',
					'<table cellspacing="0" cellpadding="0">',
						'<thead>',
							'<tr>',
								'<th class="datepickerGoPrev"><a href="#"><span><%=prev%></span></a></th>',
								'<th colspan="6" class="datepickerMonth"><a href="#"><span></span></a></th>',
								'<th class="datepickerGoNext"><a href="#"><span><%=next%></span></a></th>',
							'</tr>',
							'<tr class="datepickerDoW">',
								'<th><span><%=week%></span></th>',
								'<th><span><%=day1%></span></th>',
								'<th><span><%=day2%></span></th>',
								'<th><span><%=day3%></span></th>',
								'<th><span><%=day4%></span></th>',
								'<th><span><%=day5%></span></th>',
								'<th><span><%=day6%></span></th>',
								'<th><span><%=day7%></span></th>',
							'</tr>',
						'</thead>',
					'</table></td>'
				],
				space : '<td class="datepickerSpace"><div></div></td>',
				days: [
					'<tbody class="datepickerDays">',
						'<tr>',
							'<th class="datepickerWeek"><a href="#"><span><%=weeks[0].week%></span></a></th>',
							'<td class="<%=weeks[0].days[0].classname%>"><a href="#"><span><%=weeks[0].days[0].text%></span></a></td>',
							'<td class="<%=weeks[0].days[1].classname%>"><a href="#"><span><%=weeks[0].days[1].text%></span></a></td>',
							'<td class="<%=weeks[0].days[2].classname%>"><a href="#"><span><%=weeks[0].days[2].text%></span></a></td>',
							'<td class="<%=weeks[0].days[3].classname%>"><a href="#"><span><%=weeks[0].days[3].text%></span></a></td>',
							'<td class="<%=weeks[0].days[4].classname%>"><a href="#"><span><%=weeks[0].days[4].text%></span></a></td>',
							'<td class="<%=weeks[0].days[5].classname%>"><a href="#"><span><%=weeks[0].days[5].text%></span></a></td>',
							'<td class="<%=weeks[0].days[6].classname%>"><a href="#"><span><%=weeks[0].days[6].text%></span></a></td>',
						'</tr>',
						'<tr>',
							'<th class="datepickerWeek"><a href="#"><span><%=weeks[1].week%></span></a></th>',
							'<td class="<%=weeks[1].days[0].classname%>"><a href="#"><span><%=weeks[1].days[0].text%></span></a></td>',
							'<td class="<%=weeks[1].days[1].classname%>"><a href="#"><span><%=weeks[1].days[1].text%></span></a></td>',
							'<td class="<%=weeks[1].days[2].classname%>"><a href="#"><span><%=weeks[1].days[2].text%></span></a></td>',
							'<td class="<%=weeks[1].days[3].classname%>"><a href="#"><span><%=weeks[1].days[3].text%></span></a></td>',
							'<td class="<%=weeks[1].days[4].classname%>"><a href="#"><span><%=weeks[1].days[4].text%></span></a></td>',
							'<td class="<%=weeks[1].days[5].classname%>"><a href="#"><span><%=weeks[1].days[5].text%></span></a></td>',
							'<td class="<%=weeks[1].days[6].classname%>"><a href="#"><span><%=weeks[1].days[6].text%></span></a></td>',
						'</tr>',
						'<tr>',
							'<th class="datepickerWeek"><a href="#"><span><%=weeks[2].week%></span></a></th>',
							'<td class="<%=weeks[2].days[0].classname%>"><a href="#"><span><%=weeks[2].days[0].text%></span></a></td>',
							'<td class="<%=weeks[2].days[1].classname%>"><a href="#"><span><%=weeks[2].days[1].text%></span></a></td>',
							'<td class="<%=weeks[2].days[2].classname%>"><a href="#"><span><%=weeks[2].days[2].text%></span></a></td>',
							'<td class="<%=weeks[2].days[3].classname%>"><a href="#"><span><%=weeks[2].days[3].text%></span></a></td>',
							'<td class="<%=weeks[2].days[4].classname%>"><a href="#"><span><%=weeks[2].days[4].text%></span></a></td>',
							'<td class="<%=weeks[2].days[5].classname%>"><a href="#"><span><%=weeks[2].days[5].text%></span></a></td>',
							'<td class="<%=weeks[2].days[6].classname%>"><a href="#"><span><%=weeks[2].days[6].text%></span></a></td>',
						'</tr>',
						'<tr>',
							'<th class="datepickerWeek"><a href="#"><span><%=weeks[3].week%></span></a></th>',
							'<td class="<%=weeks[3].days[0].classname%>"><a href="#"><span><%=weeks[3].days[0].text%></span></a></td>',
							'<td class="<%=weeks[3].days[1].classname%>"><a href="#"><span><%=weeks[3].days[1].text%></span></a></td>',
							'<td class="<%=weeks[3].days[2].classname%>"><a href="#"><span><%=weeks[3].days[2].text%></span></a></td>',
							'<td class="<%=weeks[3].days[3].classname%>"><a href="#"><span><%=weeks[3].days[3].text%></span></a></td>',
							'<td class="<%=weeks[3].days[4].classname%>"><a href="#"><span><%=weeks[3].days[4].text%></span></a></td>',
							'<td class="<%=weeks[3].days[5].classname%>"><a href="#"><span><%=weeks[3].days[5].text%></span></a></td>',
							'<td class="<%=weeks[3].days[6].classname%>"><a href="#"><span><%=weeks[3].days[6].text%></span></a></td>',
						'</tr>',
						'<tr>',
							'<th class="datepickerWeek"><a href="#"><span><%=weeks[4].week%></span></a></th>',
							'<td class="<%=weeks[4].days[0].classname%>"><a href="#"><span><%=weeks[4].days[0].text%></span></a></td>',
							'<td class="<%=weeks[4].days[1].classname%>"><a href="#"><span><%=weeks[4].days[1].text%></span></a></td>',
							'<td class="<%=weeks[4].days[2].classname%>"><a href="#"><span><%=weeks[4].days[2].text%></span></a></td>',
							'<td class="<%=weeks[4].days[3].classname%>"><a href="#"><span><%=weeks[4].days[3].text%></span></a></td>',
							'<td class="<%=weeks[4].days[4].classname%>"><a href="#"><span><%=weeks[4].days[4].text%></span></a></td>',
							'<td class="<%=weeks[4].days[5].classname%>"><a href="#"><span><%=weeks[4].days[5].text%></span></a></td>',
							'<td class="<%=weeks[4].days[6].classname%>"><a href="#"><span><%=weeks[4].days[6].text%></span></a></td>',
						'</tr>',
						'<tr>',
							'<th class="datepickerWeek"><a href="#"><span><%=weeks[5].week%></span></a></th>',
							'<td class="<%=weeks[5].days[0].classname%>"><a href="#"><span><%=weeks[5].days[0].text%></span></a></td>',
							'<td class="<%=weeks[5].days[1].classname%>"><a href="#"><span><%=weeks[5].days[1].text%></span></a></td>',
							'<td class="<%=weeks[5].days[2].classname%>"><a href="#"><span><%=weeks[5].days[2].text%></span></a></td>',
							'<td class="<%=weeks[5].days[3].classname%>"><a href="#"><span><%=weeks[5].days[3].text%></span></a></td>',
							'<td class="<%=weeks[5].days[4].classname%>"><a href="#"><span><%=weeks[5].days[4].text%></span></a></td>',
							'<td class="<%=weeks[5].days[5].classname%>"><a href="#"><span><%=weeks[5].days[5].text%></span></a></td>',
							'<td class="<%=weeks[5].days[6].classname%>"><a href="#"><span><%=weeks[5].days[6].text%></span></a></td>',
						'</tr>',
					'</tbody>'
				],
				months: [
					'<tbody class="<%=className%>">',
						'<tr>',
							'<td colspan="2"><a href="#"><span><%=data[0]%></span></a></td>',
							'<td colspan="2"><a href="#"><span><%=data[1]%></span></a></td>',
							'<td colspan="2"><a href="#"><span><%=data[2]%></span></a></td>',
							'<td colspan="2"><a href="#"><span><%=data[3]%></span></a></td>',
						'</tr>',
						'<tr>',
							'<td colspan="2"><a href="#"><span><%=data[4]%></span></a></td>',
							'<td colspan="2"><a href="#"><span><%=data[5]%></span></a></td>',
							'<td colspan="2"><a href="#"><span><%=data[6]%></span></a></td>',
							'<td colspan="2"><a href="#"><span><%=data[7]%></span></a></td>',
						'</tr>',
						'<tr>',
							'<td colspan="2"><a href="#"><span><%=data[8]%></span></a></td>',
							'<td colspan="2"><a href="#"><span><%=data[9]%></span></a></td>',
							'<td colspan="2"><a href="#"><span><%=data[10]%></span></a></td>',
							'<td colspan="2"><a href="#"><span><%=data[11]%></span></a></td>',
						'</tr>',
					'</tbody>'
				]
			},
			defaults = {
				flat: false,
				starts: 1,
				prev: '&#9664;',
				next: '&#9654;',
				lastSel: false,
				mode: 'single',
				view: 'days',
				calendars: 1,
				format: 'Y-m-d',
				position: 'bottom',
				eventName: 'click',
				onRender: function(){return {};},
				onChange: function(){return true;},
				onShow: function(){return true;},
				onBeforeShow: function(){return true;},
				onHide: function(){return true;},
				locale: {
					days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
					daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
					daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
					months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
					monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
					weekMin: 'wk'
				}
			},
			fill = function(el) {
				var options = $(el).data('datepicker');
				var cal = $(el);
				var currentCal = Math.floor(options.calendars/2), date, data, dow, month, cnt = 0, week, days, indic, indic2, html, tblCal;
				cal.find('td>table tbody').remove();
				for (var i = 0; i < options.calendars; i++) {
					date = new Date(options.current);
					date.addMonths(-currentCal + i);
					tblCal = cal.find('table').eq(i+1);
					switch (tblCal[0].className) {
						case 'datepickerViewDays':
							dow = formatDate(date, 'B, Y');
							break;
						case 'datepickerViewMonths':
							dow = date.getFullYear();
							break;
						case 'datepickerViewYears':
							dow = (date.getFullYear()-6) + ' - ' + (date.getFullYear()+5);
							break;
					} 
					tblCal.find('thead tr:first th:eq(1) span').text(dow);
					dow = date.getFullYear()-6;
					data = {
						data: [],
						className: 'datepickerYears'
					}
					for ( var j = 0; j < 12; j++) {
						data.data.push(dow + j);
					}
					html = tmpl(tpl.months.join(''), data);
					date.setDate(1);
					data = {weeks:[], test: 10};
					month = date.getMonth();
					var dow = (date.getDay() - options.starts) % 7;
					date.addDays(-(dow + (dow < 0 ? 7 : 0)));
					week = -1;
					cnt = 0;
					while (cnt < 42) {
						indic = parseInt(cnt/7,10);
						indic2 = cnt%7;
						if (!data.weeks[indic]) {
							week = date.getWeekNumber();
							data.weeks[indic] = {
								week: week,
								days: []
							};
						}
						data.weeks[indic].days[indic2] = {
							text: date.getDate(),
							classname: []
						};
						if (month != date.getMonth()) {
							data.weeks[indic].days[indic2].classname.push('datepickerNotInMonth');
						}
						if (date.getDay() == 0) {
							data.weeks[indic].days[indic2].classname.push('datepickerSunday');
						}
						if (date.getDay() == 6) {
							data.weeks[indic].days[indic2].classname.push('datepickerSaturday');
						}
						var fromUser = options.onRender(date);
						var val = date.valueOf();
						if (fromUser.selected || options.date == val || $.inArray(val, options.date) > -1 || (options.mode == 'range' && val >= options.date[0] && val <= options.date[1])) {
							data.weeks[indic].days[indic2].classname.push('datepickerSelected');
						}
						if (fromUser.disabled) {
							data.weeks[indic].days[indic2].classname.push('datepickerDisabled');
						}
						if (fromUser.className) {
							data.weeks[indic].days[indic2].classname.push(fromUser.className);
						}
						data.weeks[indic].days[indic2].classname = data.weeks[indic].days[indic2].classname.join(' ');
						cnt++;
						date.addDays(1);
					}
					html = tmpl(tpl.days.join(''), data) + html;
					data = {
						data: options.locale.monthsShort,
						className: 'datepickerMonths'
					};
					html = tmpl(tpl.months.join(''), data) + html;
					tblCal.append(html);
				}
			},
			parseDate = function (date, format) {
				if (date.constructor == Date) {
					return new Date(date);
				}
				var parts = date.split(/\W+/);
				var against = format.split(/\W+/), d, m, y, h, min, now = new Date();
				for (var i = 0; i < parts.length; i++) {
					switch (against[i]) {
						case 'd':
						case 'e':
							d = parseInt(parts[i],10);
							break;
						case 'm':
							m = parseInt(parts[i], 10)-1;
							break;
						case 'Y':
						case 'y':
							y = parseInt(parts[i], 10);
							y += y > 100 ? 0 : (y < 29 ? 2000 : 1900);
							break;
						case 'H':
						case 'I':
						case 'k':
						case 'l':
							h = parseInt(parts[i], 10);
							break;
						case 'P':
						case 'p':
							if (/pm/i.test(parts[i]) && h < 12) {
								h += 12;
							} else if (/am/i.test(parts[i]) && h >= 12) {
								h -= 12;
							}
							break;
						case 'M':
							min = parseInt(parts[i], 10);
							break;
					}
				}
				return new Date(
					y === undefined ? now.getFullYear() : y,
					m === undefined ? now.getMonth() : m,
					d === undefined ? now.getDate() : d,
					h === undefined ? now.getHours() : h,
					min === undefined ? now.getMinutes() : min,
					0
				);
			},
			formatDate = function(date, format) {
				var m = date.getMonth();
				var d = date.getDate();
				var y = date.getFullYear();
				var wn = date.getWeekNumber();
				var w = date.getDay();
				var s = {};
				var hr = date.getHours();
				var pm = (hr >= 12);
				var ir = (pm) ? (hr - 12) : hr;
				var dy = date.getDayOfYear();
				if (ir == 0) {
					ir = 12;
				}
				var min = date.getMinutes();
				var sec = date.getSeconds();
				var parts = format.split(''), part;
				for ( var i = 0; i < parts.length; i++ ) {
					part = parts[i];
					switch (parts[i]) {
						case 'a':
							part = date.getDayName();
							break;
						case 'A':
							part = date.getDayName(true);
							break;
						case 'b':
							part = date.getMonthName();
							break;
						case 'B':
							part = date.getMonthName(true);
							break;
						case 'C':
							part = 1 + Math.floor(y / 100);
							break;
						case 'd':
							part = (d < 10) ? ("0" + d) : d;
							break;
						case 'e':
							part = d;
							break;
						case 'H':
							part = (hr < 10) ? ("0" + hr) : hr;
							break;
						case 'I':
							part = (ir < 10) ? ("0" + ir) : ir;
							break;
						case 'j':
							part = (dy < 100) ? ((dy < 10) ? ("00" + dy) : ("0" + dy)) : dy;
							break;
						case 'k':
							part = hr;
							break;
						case 'l':
							part = ir;
							break;
						case 'm':
							part = (m < 9) ? ("0" + (1+m)) : (1+m);
							break;
						case 'M':
							part = (min < 10) ? ("0" + min) : min;
							break;
						case 'p':
						case 'P':
							part = pm ? "PM" : "AM";
							break;
						case 's':
							part = Math.floor(date.getTime() / 1000);
							break;
						case 'S':
							part = (sec < 10) ? ("0" + sec) : sec;
							break;
						case 'u':
							part = w + 1;
							break;
						case 'w':
							part = w;
							break;
						case 'y':
							part = ('' + y).substr(2, 2);
							break;
						case 'Y':
							part = y;
							break;
					}
					parts[i] = part;
				}
				return parts.join('');
			},
			extendDate = function(options) {
				if (Date.prototype.tempDate) {
					return;
				}
				Date.prototype.tempDate = null;
				Date.prototype.months = options.months;
				Date.prototype.monthsShort = options.monthsShort;
				Date.prototype.days = options.days;
				Date.prototype.daysShort = options.daysShort;
				Date.prototype.getMonthName = function(fullName) {
					return this[fullName ? 'months' : 'monthsShort'][this.getMonth()];
				};
				Date.prototype.getDayName = function(fullName) {
					return this[fullName ? 'days' : 'daysShort'][this.getDay()];
				};
				Date.prototype.addDays = function (n) {
					this.setDate(this.getDate() + n);
					this.tempDate = this.getDate();
				};
				Date.prototype.addMonths = function (n) {
					if (this.tempDate == null) {
						this.tempDate = this.getDate();
					}
					this.setDate(1);
					this.setMonth(this.getMonth() + n);
					this.setDate(Math.min(this.tempDate, this.getMaxDays()));
				};
				Date.prototype.addYears = function (n) {
					if (this.tempDate == null) {
						this.tempDate = this.getDate();
					}
					this.setDate(1);
					this.setFullYear(this.getFullYear() + n);
					this.setDate(Math.min(this.tempDate, this.getMaxDays()));
				};
				Date.prototype.getMaxDays = function() {
					var tmpDate = new Date(Date.parse(this)),
						d = 28, m;
					m = tmpDate.getMonth();
					d = 28;
					while (tmpDate.getMonth() == m) {
						d ++;
						tmpDate.setDate(d);
					}
					return d - 1;
				};
				Date.prototype.getFirstDay = function() {
					var tmpDate = new Date(Date.parse(this));
					tmpDate.setDate(1);
					return tmpDate.getDay();
				};
				Date.prototype.getWeekNumber = function() {
					var tempDate = new Date(this);
					tempDate.setDate(tempDate.getDate() - (tempDate.getDay() + 6) % 7 + 3);
					var dms = tempDate.valueOf();
					tempDate.setMonth(0);
					tempDate.setDate(4);
					return Math.round((dms - tempDate.valueOf()) / (604800000)) + 1;
				};
				Date.prototype.getDayOfYear = function() {
					var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
					var then = new Date(this.getFullYear(), 0, 0, 0, 0, 0);
					var time = now - then;
					return Math.floor(time / 24*60*60*1000);
				};
			},
			layout = function (el) {
				var options = $(el).data('datepicker');
				var cal = $('#' + options.id);
				if (!options.extraHeight) {
					var divs = $(el).find('div');
					options.extraHeight = divs.get(0).offsetHeight + divs.get(1).offsetHeight;
					options.extraWidth = divs.get(2).offsetWidth + divs.get(3).offsetWidth;
				}
				var tbl = cal.find('table:first').get(0);
				var width = tbl.offsetWidth;
				var height = tbl.offsetHeight;
				cal.css({
					width: width + options.extraWidth + 'px',
					height: height + options.extraHeight + 'px'
				}).find('div.datepickerContainer').css({
					width: width + 'px',
					height: height + 'px'
				});
			},
			click = function(ev) {
				if ($(ev.target).is('span')) {
					ev.target = ev.target.parentNode;
				}
				var el = $(ev.target);
				if (el.is('a')) {
					ev.target.blur();
					if (el.hasClass('datepickerDisabled')) {
						return false;
					}
					var options = $(this).data('datepicker');
					var parentEl = el.parent();
					var tblEl = parentEl.parent().parent().parent();
					var tblIndex = $('table', this).index(tblEl.get(0)) - 1;
					var tmp = new Date(options.current);
					var changed = false;
					var fillIt = false;
					if (parentEl.is('th')) {
						if (parentEl.hasClass('datepickerWeek') && options.mode == 'range' && !parentEl.next().hasClass('datepickerDisabled')) {
							var val = parseInt(parentEl.next().text(), 10);
							tmp.addMonths(tblIndex - Math.floor(options.calendars/2));
							if (parentEl.next().hasClass('datepickerNotInMonth')) {
								tmp.addMonths(val > 15 ? -1 : 1);
							}
							tmp.setDate(val);
							options.date[0] = (tmp.setHours(0,0,0,0)).valueOf();
							tmp.setHours(23,59,59,0);
							tmp.addDays(6);
							options.date[1] = tmp.valueOf();
							fillIt = true;
							changed = true;
							options.lastSel = false;
						} else if (parentEl.hasClass('datepickerMonth')) {
							tmp.addMonths(tblIndex - Math.floor(options.calendars/2));
							switch (tblEl.get(0).className) {
								case 'datepickerViewDays':
									tblEl.get(0).className = 'datepickerViewMonths';
									el.find('span').text(tmp.getFullYear());
									break;
								case 'datepickerViewMonths':
									tblEl.get(0).className = 'datepickerViewYears';
									el.find('span').text((tmp.getFullYear()-6) + ' - ' + (tmp.getFullYear()+5));
									break;
								case 'datepickerViewYears':
									tblEl.get(0).className = 'datepickerViewDays';
									el.find('span').text(formatDate(tmp, 'B, Y'));
									break;
							}
						} else if (parentEl.parent().parent().is('thead')) {
							switch (tblEl.get(0).className) {
								case 'datepickerViewDays':
									options.current.addMonths(parentEl.hasClass('datepickerGoPrev') ? -1 : 1);
									break;
								case 'datepickerViewMonths':
									options.current.addYears(parentEl.hasClass('datepickerGoPrev') ? -1 : 1);
									break;
								case 'datepickerViewYears':
									options.current.addYears(parentEl.hasClass('datepickerGoPrev') ? -12 : 12);
									break;
							}
							fillIt = true;
						}
					} else if (parentEl.is('td') && !parentEl.hasClass('datepickerDisabled')) {
						switch (tblEl.get(0).className) {
							case 'datepickerViewMonths':
								options.current.setMonth(tblEl.find('tbody.datepickerMonths td').index(parentEl));
								options.current.setFullYear(parseInt(tblEl.find('thead th.datepickerMonth span').text(), 10));
								options.current.addMonths(Math.floor(options.calendars/2) - tblIndex);
								tblEl.get(0).className = 'datepickerViewDays';
								break;
							case 'datepickerViewYears':
								options.current.setFullYear(parseInt(el.text(), 10));
								tblEl.get(0).className = 'datepickerViewMonths';
								break;
							default:
								var val = parseInt(el.text(), 10);
								tmp.addMonths(tblIndex - Math.floor(options.calendars/2));
								if (parentEl.hasClass('datepickerNotInMonth')) {
									tmp.addMonths(val > 15 ? -1 : 1);
								}
								tmp.setDate(val);
								switch (options.mode) {
									case 'multiple':
										val = (tmp.setHours(0,0,0,0)).valueOf();
										if ($.inArray(val, options.date) > -1) {
											$.each(options.date, function(nr, dat){
												if (dat == val) {
													options.date.splice(nr,1);
													return false;
												}
											});
										} else {
											options.date.push(val);
										}
										break;
									case 'range':
										if (!options.lastSel) {
											options.date[0] = (tmp.setHours(0,0,0,0)).valueOf();
										}
										val = (tmp.setHours(23,59,59,0)).valueOf();
										if (val < options.date[0]) {
											options.date[1] = options.date[0] + 86399000;
											options.date[0] = val - 86399000;
										} else {
											options.date[1] = val;
										}
										options.lastSel = !options.lastSel;
										break;
									default:
										options.date = tmp.valueOf();
										break;
								}
								break;
						}
						fillIt = true;
						changed = true;
					}
					if (fillIt) {
						fill(this);
					}
					if (changed) {
						options.onChange.apply(this, prepareDate(options));
					}
				}
				return false;
			},
			prepareDate = function (options) {
				var tmp;
				if (options.mode == 'single') {
					tmp = new Date(options.date);
					return [formatDate(tmp, options.format), tmp, options.el];
				} else {
					tmp = [[],[], options.el];
					$.each(options.date, function(nr, val){
						var date = new Date(val);
						tmp[0].push(formatDate(date, options.format));
						tmp[1].push(date);
					});
					return tmp;
				}
			},
			getViewport = function () {
				var m = document.compatMode == 'CSS1Compat';
				return {
					l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
					t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
					w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
					h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
				};
			},
			isChildOf = function(parentEl, el, container) {
				if (parentEl == el) {
					return true;
				}
				if (parentEl.contains) {
					return parentEl.contains(el);
				}
				if ( parentEl.compareDocumentPosition ) {
					return !!(parentEl.compareDocumentPosition(el) & 16);
				}
				var prEl = el.parentNode;
				while(prEl && prEl != container) {
					if (prEl == parentEl)
						return true;
					prEl = prEl.parentNode;
				}
				return false;
			},
			show = function (ev) {
				var cal = $('#' + $(this).data('datepickerId'));
				if (!cal.is(':visible')) {
					var calEl = cal.get(0);
					fill(calEl);
					var options = cal.data('datepicker');
					options.onBeforeShow.apply(this, [cal.get(0)]);
					var pos = $(this).offset();
					var viewPort = getViewport();
					var top = pos.top;
					var left = pos.left;
					var oldDisplay = $.curCSS(calEl, 'display');
					cal.css({
						visibility: 'hidden',
						display: 'block'
					});
					layout(calEl);
					switch (options.position){
						case 'top':
							top -= calEl.offsetHeight;
							break;
						case 'left':
							left -= calEl.offsetWidth;
							break;
						case 'right':
							left += this.offsetWidth;
							break;
						case 'bottom':
							top += this.offsetHeight;
							break;
					}
					if (top + calEl.offsetHeight > viewPort.t + viewPort.h) {
						top = pos.top  - calEl.offsetHeight;
					}
					if (top < viewPort.t) {
						top = pos.top + this.offsetHeight + calEl.offsetHeight;
					}
					if (left + calEl.offsetWidth > viewPort.l + viewPort.w) {
						left = pos.left - calEl.offsetWidth;
					}
					if (left < viewPort.l) {
						left = pos.left + this.offsetWidth
					}
					cal.css({
						visibility: 'visible',
						display: 'block',
						top: top + 'px',
						left: left + 'px'
					});
					if (options.onShow.apply(this, [cal.get(0)]) != false) {
						cal.show();
					}
					$(document).bind('mousedown', {cal: cal, trigger: this}, hide);
				}
				return false;
			},
			hide = function (ev) {
				if (ev.target != ev.data.trigger && !isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
					if (ev.data.cal.data('datepicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
						ev.data.cal.hide();
					}
					$(document).unbind('mousedown', hide);
				}
			};
		return {
			init: function(options){
				options = $.extend({}, defaults, options||{});
				extendDate(options.locale);
				options.calendars = Math.max(1, parseInt(options.calendars,10)||1);
				options.mode = /single|multiple|range/.test(options.mode) ? options.mode : 'single';
				return this.each(function(){
					if (!$(this).data('datepicker')) {
						options.el = this;
						if (options.date.constructor == String) {
							options.date = parseDate(options.date, options.format);
							options.date.setHours(0,0,0,0);
						}
						if (options.mode != 'single') {
							if (options.date.constructor != Array) {
								options.date = [options.date.valueOf()];
								if (options.mode == 'range') {
									options.date.push(((new Date(options.date[0])).setHours(23,59,59,0)).valueOf());
								}
							} else {
								for (var i = 0; i < options.date.length; i++) {
									options.date[i] = (parseDate(options.date[i], options.format).setHours(0,0,0,0)).valueOf();
								}
								if (options.mode == 'range') {
									options.date[1] = ((new Date(options.date[1])).setHours(23,59,59,0)).valueOf();
								}
							}
						} else {
							options.date = options.date.valueOf();
						}
						if (!options.current) {
							options.current = new Date();
						} else {
							options.current = parseDate(options.current, options.format);
						} 
						options.current.setDate(1);
						options.current.setHours(0,0,0,0);
						var id = 'datepicker_' + parseInt(Math.random() * 1000), cnt;
						options.id = id;
						$(this).data('datepickerId', options.id);
						var cal = $(tpl.wrapper).attr('id', id).bind('click', click).data('datepicker', options);
						if (options.className) {
							cal.addClass(options.className);
						}
						var html = '';
						for (var i = 0; i < options.calendars; i++) {
							cnt = options.starts;
							if (i > 0) {
								html += tpl.space;
							}
							html += tmpl(tpl.head.join(''), {
									week: options.locale.weekMin,
									prev: options.prev,
									next: options.next,
									day1: options.locale.daysMin[(cnt++)%7],
									day2: options.locale.daysMin[(cnt++)%7],
									day3: options.locale.daysMin[(cnt++)%7],
									day4: options.locale.daysMin[(cnt++)%7],
									day5: options.locale.daysMin[(cnt++)%7],
									day6: options.locale.daysMin[(cnt++)%7],
									day7: options.locale.daysMin[(cnt++)%7]
								});
						}
						cal
							.find('tr:first').append(html)
								.find('table').addClass(views[options.view]);
						fill(cal.get(0));
						if (options.flat) {
							cal.appendTo(this).show().css('position', 'relative');
							layout(cal.get(0));
						} else {
							cal.appendTo(document.body);
							$(this).bind(options.eventName, show);
						}
					}
				});
			},
			showPicker: function() {
				return this.each( function () {
					if ($(this).data('datepickerId')) {
						show.apply(this);
					}
				});
			},
			hidePicker: function() {
				return this.each( function () {
					if ($(this).data('datepickerId')) {
						$('#' + $(this).data('datepickerId')).hide();
					}
				});
			},
			setDate: function(date, shiftTo){
				return this.each(function(){
					if ($(this).data('datepickerId')) {
						var cal = $('#' + $(this).data('datepickerId'));
						var options = cal.data('datepicker');
						options.date = date;
						if (options.date.constructor == String) {
							options.date = parseDate(options.date, options.format);
							options.date.setHours(0,0,0,0);
						}
						if (options.mode != 'single') {
							if (options.date.constructor != Array) {
								options.date = [options.date.valueOf()];
								if (options.mode == 'range') {
									options.date.push(((new Date(options.date[0])).setHours(23,59,59,0)).valueOf());
								}
							} else {
								for (var i = 0; i < options.date.length; i++) {
									options.date[i] = (parseDate(options.date[i], options.format).setHours(0,0,0,0)).valueOf();
								}
								if (options.mode == 'range') {
									options.date[1] = ((new Date(options.date[1])).setHours(23,59,59,0)).valueOf();
								}
							}
						} else {
							options.date = options.date.valueOf();
						}
						if (shiftTo) {
							options.current = new Date (options.mode != 'single' ? options.date[0] : options.date);
						}
						fill(cal.get(0));
					}
				});
			},
			getDate: function(formated) {
				if (this.size() > 0) {
					return prepareDate($('#' + $(this).data('datepickerId')).data('datepicker'))[formated ? 0 : 1];
				}
			},
			clear: function(){
				return this.each(function(){
					if ($(this).data('datepickerId')) {
						var cal = $('#' + $(this).data('datepickerId'));
						var options = cal.data('datepicker');
						if (options.mode != 'single') {
							options.date = [];
							fill(cal.get(0));
						}
					}
				});
			},
			fixLayout: function(){
				return this.each(function(){
					if ($(this).data('datepickerId')) {
						var cal = $('#' + $(this).data('datepickerId'));
						var options = cal.data('datepicker');
						if (options.flat) {
							layout(cal.get(0));
						}
					}
				});
			}
		};
	}();
	$.fn.extend({
		DatePicker: DatePicker.init,
		DatePickerHide: DatePicker.hidePicker,
		DatePickerShow: DatePicker.showPicker,
		DatePickerSetDate: DatePicker.setDate,
		DatePickerGetDate: DatePicker.getDate,
		DatePickerClear: DatePicker.clear,
		DatePickerLayout: DatePicker.fixLayout
	});
})(jQuery);

(function(){
  var cache = {};
 
  this.tmpl = function tmpl(str, data){
    // Figure out if we're getting a template, or if we need to
    // load the template - and be sure to cache the result.
    var fn = !/\W/.test(str) ?
      cache[str] = cache[str] ||
        tmpl(document.getElementById(str).innerHTML) :
     
      // Generate a reusable function that will serve as a template
      // generator (and which will be cached).
      new Function("obj",
        "var p=[],print=function(){p.push.apply(p,arguments);};" +
       
        // Introduce the data as local variables using with(){}
        "with(obj){p.push('" +
       
        // Convert the template into pure JavaScript
        str
          .replace(/[\r\t\n]/g, " ")
          .split("<%").join("\t")
          .replace(/((^|%>)[^\t]*)'/g, "$1\r")
          .replace(/\t=(.*?)%>/g, "',$1,'")
          .split("\t").join("');")
          .split("%>").join("p.push('")
          .split("\r").join("\\'")
      + "');}return p.join('');");
   
    // Provide some basic currying to the user
    return data ? fn( data ) : fn;
  };
})();
/*
 * Date prototype extensions. Doesn't depend on any
 * other code. Doens't overwrite existing methods.
 *
 * Adds dayNames, abbrDayNames, monthNames and abbrMonthNames static properties and isLeapYear,
 * isWeekend, isWeekDay, getDaysInMonth, getDayName, getMonthName, getDayOfYear, getWeekOfYear,
 * setDayOfYear, addYears, addMonths, addDays, addHours, addMinutes, addSeconds methods
 *
 * Copyright (c) 2006 Jörn Zaefferer and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 *
 * Additional methods and properties added by Kelvin Luck: firstDayOfWeek, dateFormat, zeroTime, asString, fromString -
 * I've added my name to these methods so you know who to blame if they are broken!
 * 
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 */

/**
 * An Array of day names starting with Sunday.
 * 
 * @example dayNames[0]
 * @result 'Sunday'
 *
 * @name dayNames
 * @type Array
 * @cat Plugins/Methods/Date
 */
Date.dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];

/**
 * An Array of abbreviated day names starting with Sun.
 * 
 * @example abbrDayNames[0]
 * @result 'Sun'
 *
 * @name abbrDayNames
 * @type Array
 * @cat Plugins/Methods/Date
 */
Date.abbrDayNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];

/**
 * An Array of month names starting with Janurary.
 * 
 * @example monthNames[0]
 * @result 'January'
 *
 * @name monthNames
 * @type Array
 * @cat Plugins/Methods/Date
 */
Date.monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];

/**
 * An Array of abbreviated month names starting with Jan.
 * 
 * @example abbrMonthNames[0]
 * @result 'Jan'
 *
 * @name monthNames
 * @type Array
 * @cat Plugins/Methods/Date
 */
Date.abbrMonthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];

/**
 * The first day of the week for this locale.
 *
 * @name firstDayOfWeek
 * @type Number
 * @cat Plugins/Methods/Date
 * @author Kelvin Luck
 */
Date.firstDayOfWeek = 1;

/**
 * The format that string dates should be represented as (e.g. 'dd/mm/yyyy' for UK, 'mm/dd/yyyy' for US, 'yyyy-mm-dd' for Unicode etc).
 *
 * @name format
 * @type String
 * @cat Plugins/Methods/Date
 * @author Kelvin Luck
 */
Date.format = 'dd/mm/yyyy';
//Date.format = 'mm/dd/yyyy';
//Date.format = 'yyyy-mm-dd';
//Date.format = 'dd mmm yy';

/**
 * The first two numbers in the century to be used when decoding a two digit year. Since a two digit year is ambiguous (and date.setYear
 * only works with numbers < 99 and so doesn't allow you to set years after 2000) we need to use this to disambiguate the two digit year codes.
 *
 * @name format
 * @type String
 * @cat Plugins/Methods/Date
 * @author Kelvin Luck
 */
Date.fullYearStart = '20';

(function() {

	/**
	 * Adds a given method under the given name 
	 * to the Date prototype if it doesn't
	 * currently exist.
	 *
	 * @private
	 */
	function add(name, method) {
		if( !Date.prototype[name] ) {
			Date.prototype[name] = method;
		}
	};
	
	/**
	 * Checks if the year is a leap year.
	 *
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.isLeapYear();
	 * @result true
	 *
	 * @name isLeapYear
	 * @type Boolean
	 * @cat Plugins/Methods/Date
	 */
	add("isLeapYear", function() {
		var y = this.getFullYear();
		return (y%4==0 && y%100!=0) || y%400==0;
	});
	
	/**
	 * Checks if the day is a weekend day (Sat or Sun).
	 *
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.isWeekend();
	 * @result false
	 *
	 * @name isWeekend
	 * @type Boolean
	 * @cat Plugins/Methods/Date
	 */
	add("isWeekend", function() {
		return this.getDay()==0 || this.getDay()==6;
	});
	
	/**
	 * Check if the day is a day of the week (Mon-Fri)
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.isWeekDay();
	 * @result false
	 * 
	 * @name isWeekDay
	 * @type Boolean
	 * @cat Plugins/Methods/Date
	 */
	add("isWeekDay", function() {
		return !this.isWeekend();
	});
	
	/**
	 * Gets the number of days in the month.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.getDaysInMonth();
	 * @result 31
	 * 
	 * @name getDaysInMonth
	 * @type Number
	 * @cat Plugins/Methods/Date
	 */
	add("getDaysInMonth", function() {
		return [31,(this.isLeapYear() ? 29:28),31,30,31,30,31,31,30,31,30,31][this.getMonth()];
	});
	
	/**
	 * Gets the name of the day.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.getDayName();
	 * @result 'Saturday'
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.getDayName(true);
	 * @result 'Sat'
	 * 
	 * @param abbreviated Boolean When set to true the name will be abbreviated.
	 * @name getDayName
	 * @type String
	 * @cat Plugins/Methods/Date
	 */
	add("getDayName", function(abbreviated) {
		return abbreviated ? Date.abbrDayNames[this.getDay()] : Date.dayNames[this.getDay()];
	});

	/**
	 * Gets the name of the month.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.getMonthName();
	 * @result 'Janurary'
	 *
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.getMonthName(true);
	 * @result 'Jan'
	 * 
	 * @param abbreviated Boolean When set to true the name will be abbreviated.
	 * @name getDayName
	 * @type String
	 * @cat Plugins/Methods/Date
	 */
	add("getMonthName", function(abbreviated) {
		return abbreviated ? Date.abbrMonthNames[this.getMonth()] : Date.monthNames[this.getMonth()];
	});

	/**
	 * Get the number of the day of the year.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.getDayOfYear();
	 * @result 11
	 * 
	 * @name getDayOfYear
	 * @type Number
	 * @cat Plugins/Methods/Date
	 */
	add("getDayOfYear", function() {
		var tmpdtm = new Date("1/1/" + this.getFullYear());
		return Math.floor((this.getTime() - tmpdtm.getTime()) / 86400000);
	});
	
	/**
	 * Get the number of the week of the year.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.getWeekOfYear();
	 * @result 2
	 * 
	 * @name getWeekOfYear
	 * @type Number
	 * @cat Plugins/Methods/Date
	 */
	add("getWeekOfYear", function() {
		return Math.ceil(this.getDayOfYear() / 7);
	});

	/**
	 * Set the day of the year.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.setDayOfYear(1);
	 * dtm.toString();
	 * @result 'Tue Jan 01 2008 00:00:00'
	 * 
	 * @name setDayOfYear
	 * @type Date
	 * @cat Plugins/Methods/Date
	 */
	add("setDayOfYear", function(day) {
		this.setMonth(0);
		this.setDate(day);
		return this;
	});
	
	/**
	 * Add a number of years to the date object.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.addYears(1);
	 * dtm.toString();
	 * @result 'Mon Jan 12 2009 00:00:00'
	 * 
	 * @name addYears
	 * @type Date
	 * @cat Plugins/Methods/Date
	 */
	add("addYears", function(num) {
		this.setFullYear(this.getFullYear() + num);
		return this;
	});
	
	/**
	 * Add a number of months to the date object.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.addMonths(1);
	 * dtm.toString();
	 * @result 'Tue Feb 12 2008 00:00:00'
	 * 
	 * @name addMonths
	 * @type Date
	 * @cat Plugins/Methods/Date
	 */
	add("addMonths", function(num) {
		var tmpdtm = this.getDate();
		
		this.setMonth(this.getMonth() + num);
		
		if (tmpdtm > this.getDate())
			this.addDays(-this.getDate());
		
		return this;
	});
	
	/**
	 * Add a number of days to the date object.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.addDays(1);
	 * dtm.toString();
	 * @result 'Sun Jan 13 2008 00:00:00'
	 * 
	 * @name addDays
	 * @type Date
	 * @cat Plugins/Methods/Date
	 */
	add("addDays", function(num) {
		this.setDate(this.getDate() + num);
		return this;
	});
	
	/**
	 * Add a number of hours to the date object.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.addHours(24);
	 * dtm.toString();
	 * @result 'Sun Jan 13 2008 00:00:00'
	 * 
	 * @name addHours
	 * @type Date
	 * @cat Plugins/Methods/Date
	 */
	add("addHours", function(num) {
		this.setHours(this.getHours() + num);
		return this;
	});

	/**
	 * Add a number of minutes to the date object.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.addMinutes(60);
	 * dtm.toString();
	 * @result 'Sat Jan 12 2008 01:00:00'
	 * 
	 * @name addMinutes
	 * @type Date
	 * @cat Plugins/Methods/Date
	 */
	add("addMinutes", function(num) {
		this.setMinutes(this.getMinutes() + num);
		return this;
	});
	
	/**
	 * Add a number of seconds to the date object.
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.addSeconds(60);
	 * dtm.toString();
	 * @result 'Sat Jan 12 2008 00:01:00'
	 * 
	 * @name addSeconds
	 * @type Date
	 * @cat Plugins/Methods/Date
	 */
	add("addSeconds", function(num) {
		this.setSeconds(this.getSeconds() + num);
		return this;
	});
	
	/**
	 * Sets the time component of this Date to zero for cleaner, easier comparison of dates where time is not relevant.
	 * 
	 * @example var dtm = new Date();
	 * dtm.zeroTime();
	 * dtm.toString();
	 * @result 'Sat Jan 12 2008 00:01:00'
	 * 
	 * @name zeroTime
	 * @type Date
	 * @cat Plugins/Methods/Date
	 * @author Kelvin Luck
	 */
	add("zeroTime", function() {
		this.setMilliseconds(0);
		this.setSeconds(0);
		this.setMinutes(0);
		this.setHours(0);
		return this;
	});
	
	/**
	 * Returns a string representation of the date object according to Date.format.
	 * (Date.toString may be used in other places so I purposefully didn't overwrite it)
	 * 
	 * @example var dtm = new Date("01/12/2008");
	 * dtm.asString();
	 * @result '12/01/2008' // (where Date.format == 'dd/mm/yyyy'
	 * 
	 * @name asString
	 * @type Date
	 * @cat Plugins/Methods/Date
	 * @author Kelvin Luck
	 */
	add("asString", function(format) {
		var r = format || Date.format;
		return r
			.split('yyyy').join(this.getFullYear())
			.split('yy').join((this.getFullYear() + '').substring(2))
			.split('mmmm').join(this.getMonthName(false))
			.split('mmm').join(this.getMonthName(true))
			.split('mm').join(_zeroPad(this.getMonth()+1))
			.split('dd').join(_zeroPad(this.getDate()));
	});
	
	/**
	 * Returns a new date object created from the passed String according to Date.format or false if the attempt to do this results in an invalid date object
	 * (We can't simple use Date.parse as it's not aware of locale and I chose not to overwrite it incase it's functionality is being relied on elsewhere)
	 *
	 * @example var dtm = Date.fromString("12/01/2008");
	 * dtm.toString();
	 * @result 'Sat Jan 12 2008 00:00:00' // (where Date.format == 'dd/mm/yyyy'
	 * 
	 * @name fromString
	 * @type Date
	 * @cat Plugins/Methods/Date
	 * @author Kelvin Luck
	 */
	Date.fromString = function(s)
	{
		var f = Date.format;
		var d = new Date('01/01/1977');
		
		var mLength = 0;

		var iM = f.indexOf('mmmm');
		if (iM > -1) {
			for (var i=0; i<Date.monthNames.length; i++) {
				var mStr = s.substr(iM, Date.monthNames[i].length);
				if (Date.monthNames[i] == mStr) {
					mLength = Date.monthNames[i].length - 4;
					break;
				}
			}
			d.setMonth(i);
		} else {
			iM = f.indexOf('mmm');
			if (iM > -1) {
				var mStr = s.substr(iM, 3);
				for (var i=0; i<Date.abbrMonthNames.length; i++) {
					if (Date.abbrMonthNames[i] == mStr) break;
				}
				d.setMonth(i);
			} else {
				d.setMonth(Number(s.substr(f.indexOf('mm'), 2)) - 1);
			}
		}
		
		var iY = f.indexOf('yyyy');

		if (iY > -1) {
			if (iM < iY)
			{
				iY += mLength;
			}
			d.setFullYear(Number(s.substr(iY, 4)));
		} else {
			if (iM < iY)
			{
				iY += mLength;
			}
			// TODO - this doesn't work very well - are there any rules for what is meant by a two digit year?
			d.setFullYear(Number(Date.fullYearStart + s.substr(f.indexOf('yy'), 2)));
		}
		var iD = f.indexOf('dd');
		if (iM < iD)
		{
			iD += mLength;
		}
		d.setDate(Number(s.substr(iD, 2)));
		if (isNaN(d.getTime())) {
			return false;
		}
		return d;
	};
	
	// utility method
	var _zeroPad = function(num) {
		var s = '0'+num;
		return s.substring(s.length-2)
		//return ('0'+num).substring(-2); // doesn't work on IE :(
	};
	
})();

/*
 * jQuery Cycle Plugin (with Transition Definitions)
 * Examples and documentation at: http://malsup.com/jquery/cycle/
 * Copyright (c) 2007-2008 M. Alsup
 * Version: 2.28
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */
;eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(4($){8 q=\'2.28\';8 r=$.2p.24&&/3G 6.0/.1A(4n.4m);4 1r(){7(2v.27&&2v.27.1r)2v.27.1r(\'[B] \'+3w.3v.3F.3E(2X,\'\'))};$.E.B=4(m){8 n=2X[1];O x.1t(4(){7(m===3t||m===P)m={};7(m.25==2C){3s(m){2a\'3r\':7(x.S)1v(x.S);x.S=0;$(x).1I(\'B.1R\',\'\');O;2a\'2h\':x.1g=1;O;2a\'2L\':x.1g=0;7(n===2l){m=$(x).1I(\'B.1R\');7(!m){1r(\'2O 1n 2S, 2T 1n 2L\');O}7(x.S){1v(x.S);x.S=0}1l(m.1X,m,1,1)}O;3W:m={1o:m}}}Q 7(m.25==47){8 c=m;m=$(x).1I(\'B.1R\');7(!m){1r(\'2O 1n 2S, 2T 1n 22 2Z\');O}7(c<0||c>=m.1X.L){1r(\'4l 2Z 1L: \'+c);O}m.N=c;7(x.S){1v(x.S);x.S=0}1l(m.1X,m,1,c>=m.1f);O}7(x.S)1v(x.S);x.S=0;x.1g=0;8 d=$(x);8 e=m.2r?$(m.2r,x):d.3i();8 f=e.3h();7(f.L<2){1r(\'3g; 3o 3k 3n: \'+f.L);O}8 g=$.3p({},$.E.B.2E,m||{},$.2F?d.2F():$.3q?d.1I():{});7(g.2e)g.2d=g.2f||f.L;d.1I(\'B.1R\',g);g.1w=x;g.1X=f;g.I=g.I?[g.I]:[];g.1j=g.1j?[g.1j]:[];g.1j.2J(4(){g.2i=0});7(g.1z)g.1j.J(4(){1l(f,g,0,!g.1x)});7(r&&g.21&&!g.2N)2m(e);8 h=x.3D;g.D=T((h.1F(/w:(\\d+)/)||[])[1])||g.D;g.C=T((h.1F(/h:(\\d+)/)||[])[1])||g.C;g.V=T((h.1F(/t:(\\d+)/)||[])[1])||g.V;7(d.u(\'1Z\')==\'3V\')d.u(\'1Z\',\'3R\');7(g.D)d.D(g.D);7(g.C&&g.C!=\'20\')d.C(g.C);7(g.1a)g.1a=T(g.1a);7(g.1k){g.1q=[];1J(8 i=0;i<f.L;i++)g.1q.J(i);g.1q.42(4(a,b){O 46.1k()-0.5});g.14=0;g.1a=g.1q[0]}Q 7(g.1a>=f.L)g.1a=0;8 j=g.1a||0;e.u({1Z:\'32\',A:0,9:0}).W().1t(4(i){8 z=j?i>=j?f.L-(i-j):j-i:f.L-i;$(x).u(\'z-1L\',z)});$(f[j]).u(\'1h\',1).U();7($.2p.24)f[j].35.2A(\'2t\');7(g.1m&&g.D)e.D(g.D);7(g.1m&&g.C&&g.C!=\'20\')e.C(g.C);7(g.2h)d.2z(4(){x.1g=1},4(){x.1g=0});8 k=$.E.B.M[g.1o];7($.2B(k))k(d,e,g);Q 7(g.1o!=\'2w\')1r(\'3f 3e: \'+g.1o);e.1t(4(){8 a=$(x);x.Y=(g.1m&&g.C)?g.C:a.C();x.12=(g.1m&&g.D)?g.D:a.D()});g.y=g.y||{};g.H=g.H||{};g.G=g.G||{};e.1n(\':26(\'+j+\')\').u(g.y);7(g.1e)$(e[j]).u(g.1e);7(g.V){g.V=T(g.V);7(g.19.25==2C)g.19=$.1o.3j[g.19]||T(g.19);7(!g.1N)g.19=g.19/2;3m((g.V-g.19)<3l)g.V+=g.19}7(g.2b)g.1O=g.1P=g.2b;7(!g.1u)g.1u=g.19;7(!g.1G)g.1G=g.19;g.2D=f.L;g.1f=j;7(g.1k){g.N=g.1f;7(++g.14==f.L)g.14=0;g.N=g.1q[g.14]}Q g.N=g.1a>=(f.L-1)?0:g.1a+1;8 l=e[j];7(g.I.L)g.I[0].1Q(l,[l,l,g,2l]);7(g.1j.L>1)g.1j[1].1Q(l,[l,l,g,2l]);7(g.1H&&!g.18)g.18=g.1H;7(g.18)$(g.18).2c(\'1H\',4(){O 22(f,g,g.1x?-1:1)});7(g.29)$(g.29).2c(\'1H\',4(){O 22(f,g,g.1x?1:-1)});7(g.1p)2H(f,g);g.3u=4(a){8 b=$(a),s=b[0];7(!g.2f)g.2d++;f.J(s);7(g.1c)g.1c.J(s);g.2D=f.L;b.u(\'1Z\',\'32\').2G(d);7(r&&g.21&&!g.2N)2m(b);7(g.1m&&g.D)b.D(g.D);7(g.1m&&g.C&&g.C!=\'20\')e.C(g.C);s.Y=(g.1m&&g.C)?g.C:b.C();s.12=(g.1m&&g.D)?g.D:b.D();b.u(g.y);7(g.1p)$.E.B.2g(f.L-1,s,$(g.1p),f,g);7(1V g.11==\'4\')g.11(b)};7(g.V||g.1z)x.S=1S(4(){1l(f,g,0,!g.1x)},g.1z?10:g.V+(g.2I||0))})};4 1l(a,b,c,d){7(b.2i)O;8 p=b.1w,1y=a[b.1f],18=a[b.N];7(p.S===0&&!c)O;7(!c&&!p.1g&&((b.2e&&(--b.2d<=0))||(b.1T&&!b.1k&&b.N<b.1f))){7(b.2j)b.2j(b);O}7(c||!p.1g){7(b.I.L)$.1t(b.I,4(i,o){o.1Q(18,[1y,18,b,d])});8 e=4(){7($.2p.24&&b.21)x.35.2A(\'2t\');$.1t(b.1j,4(i,o){o.1Q(18,[1y,18,b,d])})};7(b.N!=b.1f){b.2i=1;7(b.1U)b.1U(1y,18,b,e,d);Q 7($.2B($.E.B[b.1o]))$.E.B[b.1o](1y,18,b,e);Q $.E.B.2w(1y,18,b,e,c&&b.2K)}7(b.1k){b.1f=b.N;7(++b.14==a.L)b.14=0;b.N=b.1q[b.14]}Q{8 f=(b.N+1)==a.L;b.N=f?0:b.N+1;b.1f=f?a.L-1:b.N-1}7(b.1p)$.E.B.2k(b.1p,b.1f)}7(b.V&&!b.1z)p.S=1S(4(){1l(a,b,0,!b.1x)},b.V);Q 7(b.1z&&p.1g)p.S=1S(4(){1l(a,b,0,!b.1x)},10)};$.E.B.2k=4(a,b){$(a).3y(\'a\').3x(\'2M\').2t(\'a:26(\'+b+\')\').3z(\'2M\')};4 22(a,b,c){8 p=b.1w,V=p.S;7(V){1v(V);p.S=0}7(b.1k&&c<0){b.14--;7(--b.14==-2)b.14=a.L-2;Q 7(b.14==-1)b.14=a.L-1;b.N=b.1q[b.14]}Q 7(b.1k){7(++b.14==a.L)b.14=0;b.N=b.1q[b.14]}Q{b.N=b.1f+c;7(b.N<0){7(b.1T)O 23;b.N=a.L-1}Q 7(b.N>=a.L){7(b.1T)O 23;b.N=0}}7(b.1W&&1V b.1W==\'4\')b.1W(c>0,b.N,a[b.N]);1l(a,b,1,c>=0);O 23};4 2H(a,b){8 c=$(b.1p);$.1t(a,4(i,o){$.E.B.2g(i,o,c,a,b)});$.E.B.2k(b.1p,b.1a)};$.E.B.2g=4(i,a,b,c,d){8 e=(1V d.2n==\'4\')?$(d.2n(i,a)):$(\'<a 3A="#">\'+(i+1)+\'</a>\');7(e.3C(\'3B\').L==0)e.2G(b);e.2c(d.2Q,4(){d.N=i;8 p=d.1w,V=p.S;7(V){1v(V);p.S=0}7(1V d.2o==\'4\')d.2o(d.N,c[d.N]);1l(c,d,1,d.1f<i);O 23});7(d.2P)e.2z(4(){d.1w.1g=1},4(){d.1w.1g=0})};4 2m(b){4 1M(s){8 s=T(s).3N(16);O s.L<2?\'0\'+s:s};4 2R(e){1J(;e&&e.3H.3M()!=\'3J\';e=e.3I){8 v=$.u(e,\'2V-2U\');7(v.3L(\'3K\')>=0){8 a=v.1F(/\\d+/g);O\'#\'+1M(a[0])+1M(a[1])+1M(a[2])}7(v&&v!=\'3P\')O v}O\'#3O\'};b.1t(4(){$(x).u(\'2V-2U\',2R(x))})};$.E.B.2w=4(a,b,c,d,e){8 f=$(a),$n=$(b);$n.u(c.y);8 g=e?1:c.1u;8 h=e?1:c.1G;8 i=e?P:c.1O;8 j=e?P:c.1P;8 k=4(){$n.1Y(c.H,g,i,d)};f.1Y(c.G,h,j,4(){7(c.K)f.u(c.K);7(!c.1N)k()});7(c.1N)k()};$.E.B.M={2W:4(a,b,c){b.1n(\':26(\'+c.1a+\')\').u(\'1h\',0);c.I.J(4(){$(x).U()});c.H={1h:1};c.G={1h:0};c.y={1h:0};c.K={R:\'X\'}}};$.E.B.3Q=4(){O q};$.E.B.2E={1o:\'2W\',V:3U,1z:0,19:3S,1u:P,1G:P,18:P,29:P,1W:P,1p:P,2o:P,2Q:\'1H\',2n:P,I:P,1j:P,2j:P,2b:P,1O:P,1P:P,1K:P,H:P,G:P,y:P,K:P,1U:P,C:\'20\',1a:0,1N:1,1k:0,1m:0,2h:0,2P:0,2e:0,2f:0,2I:0,2r:P,21:0,1T:0,2K:0}})(2Y);(4($){$.E.B.M.3T=4(d,e,f){d.u(\'17\',\'1b\');f.I.J(4(a,b,c){$(x).U();c.y.A=b.1B;c.G.A=0-a.1B});f.1e={A:0};f.H={A:0};f.K={R:\'X\'}};$.E.B.M.3Z=4(d,e,f){d.u(\'17\',\'1b\');f.I.J(4(a,b,c){$(x).U();c.y.A=0-b.1B;c.G.A=a.1B});f.1e={A:0};f.H={A:0};f.K={R:\'X\'}};$.E.B.M.3X=4(d,e,f){d.u(\'17\',\'1b\');f.I.J(4(a,b,c){$(x).U();c.y.9=b.1C;c.G.9=0-a.1C});f.1e={9:0};f.H={9:0}};$.E.B.M.3Y=4(d,e,f){d.u(\'17\',\'1b\');f.I.J(4(a,b,c){$(x).U();c.y.9=0-b.1C;c.G.9=a.1C});f.1e={9:0};f.H={9:0}};$.E.B.M.41=4(f,g,h){f.u(\'17\',\'1b\').D();h.I.J(4(a,b,c,d){$(x).U();8 e=a.1C,2q=b.1C;c.y=d?{9:2q}:{9:-2q};c.H.9=0;c.G.9=d?-e:e;g.1n(a).u(c.y)});h.1e={9:0};h.K={R:\'X\'}};$.E.B.M.40=4(f,g,h){f.u(\'17\',\'1b\');h.I.J(4(a,b,c,d){$(x).U();8 e=a.1B,2s=b.1B;c.y=d?{A:-2s}:{A:2s};c.H.A=0;c.G.A=d?e:-e;g.1n(a).u(c.y)});h.1e={A:0};h.K={R:\'X\'}};$.E.B.M.43=4(d,e,f){f.I.J(4(a,b,c){$(a).u(\'F\',1)});f.11=4(a){a.W()};f.y={F:2};f.H={D:\'U\'};f.G={D:\'W\'}};$.E.B.M.44=4(d,e,f){f.I.J(4(a,b,c){$(a).u(\'F\',1)});f.11=4(a){a.W()};f.y={F:2};f.H={C:\'U\'};f.G={C:\'W\'}};$.E.B.M.1K=4(g,h,j){8 w=g.u(\'17\',\'30\').D();h.u({9:0,A:0});j.I.J(4(){$(x).U()});j.19=j.19/2;j.1k=0;j.1K=j.1K||{9:-w,A:15};j.1c=[];1J(8 i=0;i<h.L;i++)j.1c.J(h[i]);1J(8 i=0;i<j.1a;i++)j.1c.J(j.1c.31());j.1U=4(a,b,c,d,e){8 f=e?$(a):$(b);f.1Y(c.1K,c.1u,c.1O,4(){e?c.1c.J(c.1c.31()):c.1c.2J(c.1c.45());7(e)1J(8 i=0,2u=c.1c.L;i<2u;i++)$(c.1c[i]).u(\'z-1L\',2u-i);Q{8 z=$(a).u(\'z-1L\');f.u(\'z-1L\',T(z)+1)}f.1Y({9:0,A:0},c.1G,c.1P,4(){$(e?x:a).W();7(d)d()})})};j.11=4(a){a.W()}};$.E.B.M.4e=4(d,e,f){f.I.J(4(a,b,c){$(x).U();c.y.A=b.Y;c.H.C=b.Y});f.11=4(a){a.W()};f.1e={A:0};f.y={C:0};f.H={A:0};f.G={C:0};f.K={R:\'X\'}};$.E.B.M.4a=4(d,e,f){f.I.J(4(a,b,c){$(x).U();c.H.C=b.Y;c.G.A=a.Y});f.11=4(a){a.W()};f.1e={A:0};f.y={A:0,C:0};f.G={C:0};f.K={R:\'X\'}};$.E.B.M.49=4(d,e,f){f.I.J(4(a,b,c){$(x).U();c.y.9=b.12;c.H.D=b.12});f.11=4(a){a.W()};f.y={D:0};f.H={9:0};f.G={D:0};f.K={R:\'X\'}};$.E.B.M.48=4(d,e,f){f.I.J(4(a,b,c){$(x).U();c.H.D=b.12;c.G.9=a.12});f.11=4(a){a.W()};f.y={9:0,D:0};f.H={9:0};f.G={D:0};f.K={R:\'X\'}};$.E.B.M.33=4(d,e,f){f.1e={A:0,9:0};f.K={R:\'X\'};f.I.J(4(a,b,c){$(x).U();c.y={D:0,C:0,A:b.Y/2,9:b.12/2};c.K={R:\'X\'};c.H={A:0,9:0,D:b.12,C:b.Y};c.G={D:0,C:0,A:a.Y/2,9:a.12/2};$(a).u(\'F\',2);$(b).u(\'F\',1)});f.11=4(a){a.W()}};$.E.B.M.4d=4(d,e,f){f.I.J(4(a,b,c){c.y={D:0,C:0,1h:1,9:b.12/2,A:b.Y/2,F:1};c.H={A:0,9:0,D:b.12,C:b.Y}});f.G={1h:0};f.K={F:0}};$.E.B.M.4c=4(d,e,f){8 w=d.u(\'17\',\'1b\').D();e.U();f.I.J(4(a,b,c){$(a).u(\'F\',1)});f.y={9:w,F:2};f.K={F:1};f.H={9:0};f.G={9:w}};$.E.B.M.4b=4(d,e,f){8 h=d.u(\'17\',\'1b\').C();e.U();f.I.J(4(a,b,c){$(a).u(\'F\',1)});f.y={A:h,F:2};f.K={F:1};f.H={A:0};f.G={A:h}};$.E.B.M.4k=4(d,e,f){8 h=d.u(\'17\',\'1b\').C();8 w=d.D();e.U();f.I.J(4(a,b,c){$(a).u(\'F\',1)});f.y={A:h,9:w,F:2};f.K={F:1};f.H={A:0,9:0};f.G={A:h,9:w}};$.E.B.M.4h=4(d,e,f){f.I.J(4(a,b,c){c.y={9:x.12/2,D:0,F:2};c.H={9:0,D:x.12};c.G={9:0};$(a).u(\'F\',1)});f.11=4(a){a.W().u(\'F\',1)}};$.E.B.M.4g=4(d,e,f){f.I.J(4(a,b,c){c.y={A:x.Y/2,C:0,F:2};c.H={A:0,C:x.Y};c.G={A:0};$(a).u(\'F\',1)});f.11=4(a){a.W().u(\'F\',1)}};$.E.B.M.4f=4(d,e,f){f.I.J(4(a,b,c){c.y={9:b.12/2,D:0,F:1,R:\'1D\'};c.H={9:0,D:x.12};c.G={9:a.12/2,D:0};$(a).u(\'F\',2)});f.11=4(a){a.W()};f.K={F:1,R:\'X\'}};$.E.B.M.4j=4(d,e,f){f.I.J(4(a,b,c){c.y={A:b.Y/2,C:0,F:1,R:\'1D\'};c.H={A:0,C:x.Y};c.G={A:a.Y/2,C:0};$(a).u(\'F\',2)});f.11=4(a){a.W()};f.K={F:1,R:\'X\'}};$.E.B.M.4i=4(e,f,g){8 d=g.36||\'9\';8 w=e.u(\'17\',\'1b\').D();8 h=e.C();g.I.J(4(a,b,c){c.y=c.y||{};c.y.F=2;c.y.R=\'1D\';7(d==\'2y\')c.y.9=-w;Q 7(d==\'2x\')c.y.A=h;Q 7(d==\'34\')c.y.A=-h;Q c.y.9=w;$(a).u(\'F\',1)});7(!g.H)g.H={9:0,A:0};7(!g.G)g.G={9:0,A:0};g.K=g.K||{};g.K.F=2;g.K.R=\'X\'};$.E.B.M.3d=4(e,f,g){8 d=g.36||\'9\';8 w=e.u(\'17\',\'1b\').D();8 h=e.C();g.I.J(4(a,b,c){c.y.R=\'1D\';7(d==\'2y\')c.G.9=w;Q 7(d==\'2x\')c.G.A=-h;Q 7(d==\'34\')c.G.A=h;Q c.G.9=-w;$(a).u(\'F\',2);$(b).u(\'F\',1)});g.11=4(a){a.W()};7(!g.H)g.H={9:0,A:0};g.y=g.y||{};g.y.A=0;g.y.9=0;g.K=g.K||{};g.K.F=1;g.K.R=\'X\'};$.E.B.M.39=4(d,e,f){8 w=d.u(\'17\',\'30\').D();8 h=d.C();f.I.J(4(a,b,c){$(a).u(\'F\',2);c.y.R=\'1D\';7(!c.G.9&&!c.G.A)c.G={9:w*2,A:-h/2,1h:0};Q c.G.1h=0});f.11=4(a){a.W()};f.y={9:0,A:0,F:1,1h:1};f.H={9:0};f.K={F:2,R:\'X\'}};$.E.B.M.38=4(o,p,q){8 w=o.u(\'17\',\'1b\').D();8 h=o.C();q.y=q.y||{};8 s;7(q.1i){7(/37/.1A(q.1i))s=\'1s(1d 1d \'+h+\'Z 1d)\';Q 7(/3c/.1A(q.1i))s=\'1s(1d \'+w+\'Z \'+h+\'Z \'+w+\'Z)\';Q 7(/3b/.1A(q.1i))s=\'1s(1d \'+w+\'Z 1d 1d)\';Q 7(/3a/.1A(q.1i))s=\'1s(\'+h+\'Z \'+w+\'Z \'+h+\'Z 1d)\';Q 7(/33/.1A(q.1i)){8 t=T(h/2);8 l=T(w/2);s=\'1s(\'+t+\'Z \'+l+\'Z \'+t+\'Z \'+l+\'Z)\'}}q.y.1i=q.y.1i||s||\'1s(1d 1d 1d 1d)\';8 d=q.y.1i.1F(/(\\d+)/g);8 t=T(d[0]),r=T(d[1]),b=T(d[2]),l=T(d[3]);q.I.J(4(g,i,j){7(g==i)O;8 k=$(g).u(\'F\',2);8 m=$(i).u({F:3,R:\'1D\'});8 n=1,1E=T((j.1u/13))-1;4 f(){8 a=t?t-T(n*(t/1E)):0;8 c=l?l-T(n*(l/1E)):0;8 d=b<h?b+T(n*((h-b)/1E||1)):h;8 e=r<w?r+T(n*((w-r)/1E||1)):w;m.u({1i:\'1s(\'+a+\'Z \'+e+\'Z \'+d+\'Z \'+c+\'Z)\'});(n++<=1E)?1S(f,13):k.u(\'R\',\'X\')}f()});q.K={};q.H={9:0};q.G={9:0}}})(2Y);',62,272,'||||function|||if|var|left|||||||||||||||||||||css|||this|cssBefore||top|cycle|height|width|fn|zIndex|animOut|animIn|before|push|cssAfter|length|transitions|nextSlide|return|null|else|display|cycleTimeout|parseInt|show|timeout|hide|none|cycleH|px||onAddSlide|cycleW||randomIndex|||overflow|next|speed|startingSlide|hidden|els|0px|cssFirst|currSlide|cyclePause|opacity|clip|after|random|go|fit|not|fx|pager|randomMap|log|rect|each|speedIn|clearTimeout|container|rev|curr|continuous|test|offsetHeight|offsetWidth|block|count|match|speedOut|click|data|for|shuffle|index|hex|sync|easeIn|easeOut|apply|opts|setTimeout|nowrap|fxFn|typeof|prevNextClick|elements|animate|position|auto|cleartype|advance|false|msie|constructor|eq|console||prev|case|easing|bind|countdown|autostop|autostopCount|createPagerAnchor|pause|busy|end|updateActivePagerLink|true|clearTypeFix|pagerAnchorBuilder|pagerClick|browser|nextW|slideExpr|nextH|filter|len|window|custom|up|right|hover|removeAttribute|isFunction|String|slideCount|defaults|metadata|appendTo|buildPager|delay|unshift|fastOnEvent|resume|activeSlide|cleartypeNoBg|options|pauseOnPagerHover|pagerEvent|getBg|found|can|color|background|fade|arguments|jQuery|slide|visible|shift|absolute|zoom|down|style|direction|l2r|wipe|toss|b2t|t2b|r2l|uncover|transition|unknown|terminating|get|children|speeds|few|250|while|slides|too|extend|meta|stop|switch|undefined|addSlide|prototype|Array|removeClass|find|addClass|href|body|parents|className|call|join|MSIE|nodeName|parentNode|html|rgb|indexOf|toLowerCase|toString|ffffff|transparent|ver|relative|1000|scrollUp|4000|static|default|scrollLeft|scrollRight|scrollDown|scrollVert|scrollHorz|sort|slideX|slideY|pop|Math|Number|turnRight|turnLeft|turnDown|blindY|blindX|fadeZoom|turnUp|curtainX|growY|growX|cover|curtainY|blindZ|invalid|userAgent|navigator'.split('|'),0,{}));

/**
 * 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
 *
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('r.5=w(k,d,a){4(m d!=\'H\'){a=a||{};4(d===p){d=\'\';a.3=-1}2 g=\'\';4(a.3&&(m a.3==\'n\'||a.3.u)){2 f;4(m a.3==\'n\'){f=G E();f.C(f.B()+(a.3*z*s*s*v))}o{f=a.3}g=\'; 3=\'+f.u()}2 b=a.7?\'; 7=\'+(a.7):\'\';2 e=a.9?\'; 9=\'+(a.9):\'\';2 l=a.t?\'; t\':\'\';6.5=[k,\'=\',K(d),g,b,e,l].I(\'\')}o{2 h=p;4(6.5&&6.5!=\'\'){2 c=6.5.F(\';\');D(2 i=0;i<c.8;i++){2 j=r.A(c[i]);4(j.q(0,k.8+1)==(k+\'=\')){h=y(j.q(k.8+1));x}}}J h}};',47,47,'||var|expires|if|cookie|document|path|length|domain|||||||||||||typeof|number|else|null|substring|jQuery|60|secure|toUTCString|1000|function|break|decodeURIComponent|24|trim|getTime|setTime|for|Date|split|new|undefined|join|return|encodeURIComponent'.split('|'),0,{}))

/*

DynaCloud v5

A dynamic JavaScript tag/keyword cloud with jQuery.

<http://johannburkard.de/blog/programming/javascript/dynacloud-a-dynamic-javascript-tag-keyword-cloud-with-jquery.html>

MIT license.

Johann Burkard
<http://johannburkard.de>
<mailto:jb@eaio.com>

*/

jQuery.fn.highlight = function(pat) {
 function innerHighlight(node, pat) {
  var skip = 0;
  if (node.nodeType == 3) {
   var pos = node.data.toUpperCase().indexOf(pat);
   if (pos >= 0) {
    var spannode = document.createElement('span');
    spannode.className = 'highlight';
    var middlebit = node.splitText(pos);
    var endbit = middlebit.splitText(pat.length);
    var middleclone = middlebit.cloneNode(true);
    spannode.appendChild(middleclone);
    middlebit.parentNode.replaceChild(spannode, middlebit);
    skip = 1;
   }
  }
  else if (node.nodeType == 1 && node.childNodes && !/(script|style)/i.test(node.tagName)) {
   for (var i = 0; i < node.childNodes.length; ++i) {
    i += innerHighlight(node.childNodes[i], pat);
   }
  }
  return skip;
 }
 return this.each(function() {
  innerHighlight(this, pat.toUpperCase());
 });
};

jQuery.fn.removeHighlight = function() {
 return this.find("span.highlight").each(function() {
  this.parentNode.firstChild.nodeName;
  with (this.parentNode) {
   replaceChild(this.firstChild, this);
   normalize();
  }
 }).end();
};

jQuery.dynaCloud = {

 max: 60,
 sort: true,
 auto: true,
 single: true,
 wordStats: true,
 scale: 4,

// Adapted from <http://www.perseus.tufts.edu/Texts/engstop.html>

 stopwords: [  ]

};

jQuery(function() {
 jQuery.dynaCloud.stopwords = new RegExp("\\s((" + jQuery.dynaCloud.stopwords.join("|") + ")\\s)+", "gi");
 if (jQuery.dynaCloud.auto) {
  jQuery('.dynacloud').dynaCloud();
 }
});

jQuery.fn.dynaCloud = function(outElement) {
 var cloud = {};
 return this.each(function() {

  var cl = [];
  var max = 0;

  if (jQuery.wordStats && jQuery.dynaCloud.wordStats) {
   jQuery.wordStats.computeTopWords(jQuery.dynaCloud.max, this);
   for (var i = 0, j = jQuery.wordStats.topWords.length; i < j && i <= jQuery.dynaCloud.max; ++i) {
    var t = jQuery.wordStats.topWords[i].substring(1);
    if (typeof cloud[t] == 'undefined') {
     cloud[t] = { count: jQuery.wordStats.topWeights[i], el: t };
    }
    else {
     cloud[t].count += jQuery.wordStats.topWeights[i];
    }
    max = Math.max(cloud[t].count, max);
   }
   jQuery.wordStats.clear();
  }
  else {
   var elems = jQuery(this).text().replace(/[^A-Z\xC4\xD6\xDCa-z\xE4\xF6\xFC\xDF0-9_]/g, ' ').replace(jQuery.dynaCloud.stopwords, ' ').split(' ');
   var word = /^[a-z\xE4\xF6\xFC]*[A-Z\xC4\xD6\xDC]([A-Z\xC4\xD6\xDC\xDF]+|[a-z\xE4\xF6\xFC\xDF]{3,})/;

   jQuery.each(elems, function(i, n) {
    if (word.test(n)) {
     var t = n.toLowerCase();
     if (typeof cloud[t] == 'undefined') {
      cloud[t] = { count: 1, el: n };
     }
     else {
      cloud[t].count += 1;
     }
     max = Math.max(cloud[t].count, max);
    }
   });
  }

  jQuery.each(cloud, function(i, n) {
   cl[cl.length] = n;
  });

  if (jQuery.dynaCloud.sort) {
   cl.sort(function(a, b) {
     return a.el < b.el ? -1 : (a.el == b.el ? 0 : 1);
   });
  }

  var out;
  if ((out = jQuery(outElement ? outElement : '#dynacloud')).length == 0) {
   jQuery(document.body).append('<p id="dynacloud"><\/p>');
   out = jQuery('#dynacloud');
  }

  out.empty();

  var l = jQuery.dynaCloud.max == -1 ? cl.length : Math.min(jQuery.dynaCloud.max, cl.length);
out.append("<a class='thisTag' id='All Genres'>All Genres<\/a> &nbsp;");
  for (var i = 0; i < l; ++i) {
   out.append('<a class="thisTag" id="' + cl[i].el + '" style="font-size: ' + Math.ceil((cl[i].count / max) * jQuery.dynaCloud.scale)*12 + 'px">' + cl[i].el + '</a> &nbsp; ');
  }
  
  var target = this;

  jQuery('a', out).each(function() {
   jQuery(this).click(function() {

    if (jQuery.dynaCloud.single) {
     jQuery(document.body).removeHighlight();
    }

    var text = jQuery(this).text().toUpperCase();
    jQuery(target).each(function() {
     jQuery(this).highlight(text);
    });
    return false;
   });
  });

 });
};

/*! Copyright (c) 2008 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Version: 1.0.3
 * Requires jQuery 1.1.3+
 * Docs: http://docs.jquery.com/Plugins/livequery
 */

(function($) {
	
$.extend($.fn, {
	livequery: function(type, fn, fn2) {
		var self = this, q;
		
		// Handle different call patterns
		if ($.isFunction(type))
			fn2 = fn, fn = type, type = undefined;
			
		// See if Live Query already exists
		$.each( $.livequery.queries, function(i, query) {
			if ( self.selector == query.selector && self.context == query.context &&
				type == query.type && (!fn || fn.$lqguid == query.fn.$lqguid) && (!fn2 || fn2.$lqguid == query.fn2.$lqguid) )
					// Found the query, exit the each loop
					return (q = query) && false;
		});
		
		// Create new Live Query if it wasn't found
		q = q || new $.livequery(this.selector, this.context, type, fn, fn2);
		
		// Make sure it is running
		q.stopped = false;
		
		// Run it immediately for the first time
		q.run();
		
		// Contnue the chain
		return this;
	},
	
	expire: function(type, fn, fn2) {
		var self = this;
		
		// Handle different call patterns
		if ($.isFunction(type))
			fn2 = fn, fn = type, type = undefined;
			
		// Find the Live Query based on arguments and stop it
		$.each( $.livequery.queries, function(i, query) {
			if ( self.selector == query.selector && self.context == query.context && 
				(!type || type == query.type) && (!fn || fn.$lqguid == query.fn.$lqguid) && (!fn2 || fn2.$lqguid == query.fn2.$lqguid) && !this.stopped )
					$.livequery.stop(query.id);
		});
		
		// Continue the chain
		return this;
	}
});

$.livequery = function(selector, context, type, fn, fn2) {
	this.selector = selector;
	this.context  = context || document;
	this.type     = type;
	this.fn       = fn;
	this.fn2      = fn2;
	this.elements = [];
	this.stopped  = false;
	
	// The id is the index of the Live Query in $.livequery.queries
	this.id = $.livequery.queries.push(this)-1;
	
	// Mark the functions for matching later on
	fn.$lqguid = fn.$lqguid || $.livequery.guid++;
	if (fn2) fn2.$lqguid = fn2.$lqguid || $.livequery.guid++;
	
	// Return the Live Query
	return this;
};

$.livequery.prototype = {
	stop: function() {
		var query = this;
		
		if ( this.type )
			// Unbind all bound events
			this.elements.unbind(this.type, this.fn);
		else if (this.fn2)
			// Call the second function for all matched elements
			this.elements.each(function(i, el) {
				query.fn2.apply(el);
			});
			
		// Clear out matched elements
		this.elements = [];
		
		// Stop the Live Query from running until restarted
		this.stopped = true;
	},
	
	run: function() {
		// Short-circuit if stopped
		if ( this.stopped ) return;
		var query = this;
		
		var oEls = this.elements,
			els  = $(this.selector, this.context),
			nEls = els.not(oEls);
		
		// Set elements to the latest set of matched elements
		this.elements = els;
		
		if (this.type) {
			// Bind events to newly matched elements
			nEls.bind(this.type, this.fn);
			
			// Unbind events to elements no longer matched
			if (oEls.length > 0)
				$.each(oEls, function(i, el) {
					if ( $.inArray(el, els) < 0 )
						$.event.remove(el, query.type, query.fn);
				});
		}
		else {
			// Call the first function for newly matched elements
			nEls.each(function() {
				query.fn.apply(this);
			});
			
			// Call the second function for elements no longer matched
			if ( this.fn2 && oEls.length > 0 )
				$.each(oEls, function(i, el) {
					if ( $.inArray(el, els) < 0 )
						query.fn2.apply(el);
				});
		}
	}
};

$.extend($.livequery, {
	guid: 0,
	queries: [],
	queue: [],
	running: false,
	timeout: null,
	
	checkQueue: function() {
		if ( $.livequery.running && $.livequery.queue.length ) {
			var length = $.livequery.queue.length;
			// Run each Live Query currently in the queue
			while ( length-- )
				$.livequery.queries[ $.livequery.queue.shift() ].run();
		}
	},
	
	pause: function() {
		// Don't run anymore Live Queries until restarted
		$.livequery.running = false;
	},
	
	play: function() {
		// Restart Live Queries
		$.livequery.running = true;
		// Request a run of the Live Queries
		$.livequery.run();
	},
	
	registerPlugin: function() {
		$.each( arguments, function(i,n) {
			// Short-circuit if the method doesn't exist
			if (!$.fn[n]) return;
			
			// Save a reference to the original method
			var old = $.fn[n];
			
			// Create a new method
			$.fn[n] = function() {
				// Call the original method
				var r = old.apply(this, arguments);
				
				// Request a run of the Live Queries
				$.livequery.run();
				
				// Return the original methods result
				return r;
			}
		});
	},
	
	run: function(id) {
		if (id != undefined) {
			// Put the particular Live Query in the queue if it doesn't already exist
			if ( $.inArray(id, $.livequery.queue) < 0 )
				$.livequery.queue.push( id );
		}
		else
			// Put each Live Query in the queue if it doesn't already exist
			$.each( $.livequery.queries, function(id) {
				if ( $.inArray(id, $.livequery.queue) < 0 )
					$.livequery.queue.push( id );
			});
		
		// Clear timeout if it already exists
		if ($.livequery.timeout) clearTimeout($.livequery.timeout);
		// Create a timeout to check the queue and actually run the Live Queries
		$.livequery.timeout = setTimeout($.livequery.checkQueue, 20);
	},
	
	stop: function(id) {
		if (id != undefined)
			// Stop are particular Live Query
			$.livequery.queries[ id ].stop();
		else
			// Stop all Live Queries
			$.each( $.livequery.queries, function(id) {
				$.livequery.queries[ id ].stop();
			});
	}
});

// Register core DOM manipulation methods
$.livequery.registerPlugin('append', 'prepend', 'after', 'before', 'wrap', 'attr', 'removeAttr', 'addClass', 'removeClass', 'toggleClass', 'empty', 'remove');

// Run Live Queries when the Document is ready
$(function() { $.livequery.play(); });


// Save a reference to the original init method
var init = $.prototype.init;

// Create a new init method that exposes two new properties: selector and context
$.prototype.init = function(a,c) {
	// Call the original init and save the result
	var r = init.apply(this, arguments);
	
	// Copy over properties if they exist already
	if (a && a.selector)
		r.context = a.context, r.selector = a.selector;
		
	// Set properties
	if ( typeof a == 'string' )
		r.context = c || document, r.selector = a;
	
	// Return the result
	return r;
};

// Give the init function the jQuery prototype for later instantiation (needed after Rev 4091)
$.prototype.init.prototype = $.prototype;
	
})(jQuery);


// lazy load
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(5($){$.J.L=5(r){8 1={d:0,A:0,b:"h",v:"N",3:4};6(r){$.D(1,r)}8 m=9;6("h"==1.b){$(1.3).p("h",5(b){8 C=0;m.t(5(){6(!$.k(9,1)&&!$.l(9,1)){$(9).z("o")}j{6(C++>1.A){g B}}});8 w=$.M(m,5(f){g!f.e});m=$(w)})}g 9.t(5(){8 2=9;$(2).c("s",$(2).c("i"));6("h"!=1.b||$.k(2,1)||$.l(2,1)){6(1.u){$(2).c("i",1.u)}j{$(2).K("i")}2.e=B}j{2.e=x}$(2).T("o",5(){6(!9.e){$("<V />").p("X",5(){$(2).Y().c("i",$(2).c("s"))[1.v](1.Z);2.e=x}).c("i",$(2).c("s"))}});6("h"!=1.b){$(2).p(1.b,5(b){6(!2.e){$(2).z("o")}})}})};$.k=5(f,1){6(1.3===E||1.3===4){8 7=$(4).F()+$(4).O()}j{8 7=$(1.3).n().G+$(1.3).F()}g 7<=$(f).n().G-1.d};$.l=5(f,1){6(1.3===E||1.3===4){8 7=$(4).I()+$(4).U()}j{8 7=$(1.3).n().q+$(1.3).I()}g 7<=$(f).n().q-1.d};$.D($.P[\':\'],{"Q-H-7":"$.k(a, {d : 0, 3: 4})","R-H-7":"!$.k(a, {d : 0, 3: 4})","S-y-7":"$.l(a, {d : 0, 3: 4})","q-y-7":"!$.l(a, {d : 0, 3: 4})"})})(W);',62,62,'|settings|self|container|window|function|if|fold|var|this||event|attr|threshold|loaded|element|return|scroll|src|else|belowthefold|rightoffold|elements|offset|appear|bind|left|options|original|each|placeholder|effect|temp|true|of|trigger|failurelimit|false|counter|extend|undefined|height|top|the|width|fn|removeAttr|lazyload|grep|show|scrollTop|expr|below|above|right|one|scrollLeft|img|jQuery|load|hide|effectspeed'.split('|'),0,{}))

