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-9q-wyzA-Z]|1\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(4(g,i,j){3 h=\'s\',l=z;4 m(a,b){3 c=(a[0]||0)-(b[0]||0);6 c>0||(!c&&a.length>0&&m(a.A(1),b.A(1)))}4 n(a){5(7 a!=h){6 a}3 b=[],c=\'\';B(3 d C a){5(7 a[d]==h){c=n(a[d])}L{c=[d,(l)?encodeURI(a[d]):a[d]].8(\'=\')}b.D(c)}6 b.8(\'&\')}4 o(a){3 b=[];B(3 c C a){5(a[c]){b.D([c,\'="\',a[c],\'"\'].8(\'\'))}}6 b.8(\' \')}4 p(a){3 b=[];B(3 c C a){b.D([\'<param M="\',c,\'" value="\',n(a[c]),\'" />\'].8(\'\'))}6 b.8(\'\')}try{3 k=j.description||(4(){6(new j(\'N.N\')).GetVariable(\'$O\')}())}catch(e){k=\'Unavailable\'}3 f=k.match(/\\d+/g)||[0];g[i]={P:f[0]>0,Q:j&&!j.M,O:{original:k,array:f,E:f.8(\'.\'),R:F(f[0],10)||0,S:F(f[1],10)||0,release:F(f[2],10)||0},t:4(a){3 b=(/E|number/.G(7 a))?a.toString().split(\'.\'):(/s/.G(7 a))?[a.R,a.S]:a||[0,0];6 m(f,b)},T:z,u:\'u.q\',H:I,U:4(a){3 b=r;5(!a.q||b.H||(!b.P&&!a.v)){6 I}5(!b.t(a.t||1)){b.H=z;5(7 a.v==\'4\'){5(!a.v.apply(a)){6 I}}a={q:a.u||b.u,w:137,y:214,flashvars:{MMredirectURL:location.href,MMplayerType:(b.Q)?\'ActiveX\':\'PlugIn\',MMdoctitle:V.title.A(0,47)+\' - W Player Installation\'}}}X={data:a.q,type:\'application/x-shockwave-Y\',J:a.J||\'flash_\'+Z.floor(Z.random()*999999999),y:a.y||320,w:a.w||180,11:a.11||\'\'};l=7 a.K!==\'undefined\'?a.K:b.T;a.movie=a.q;a.12=a.12||\'opaque\';9 a.13;9 a.t;9 a.v;9 a.w;9 a.J;9 a.q;9 a.K;9 a.y;3 c=V.createElement(\'div\');c.innerHTML=[\'<s \',o(X),\'>\',p(a),\'</s>\'].8(\'\');6 c.firstChild}};g.fn[i]=4(c){3 d=r.find(h).andSelf().filter(h);5(/E|s/.G(7 c)){r.14(4(){3 a=g(r),b;c=(7 c==h)?c:{q:c};c.13=r;b=g[i].U(c);5(b){a.children().remove();a.html(b)}})}5(7 c==\'4\'){d.14(4(){3 a=r,b=\'jsInteractionTimeoutMs\';a[b]=a[b]||0;5(a[b]<660){5(a.clientWidth||a.clientHeight){c.call(a)}L{setTimeout(4(){g(a)[i](c)},a[b]+66)}}})}6 d}}(jQuery,\'Y\',navigator.plugins[\'Shockwave W\']||window.ActiveXObject));',[],67,'|||var|function|if|return|typeof|join|delete|||||||||||||||||swf|this|object|hasVersion|expressInstall|hasVersionFail|height||width|true|slice|for|in|push|string|parseInt|test|expressInstallIsActive|false|id|useEncode|else|name|ShockwaveFlash|version|available|activeX|major|minor|encodeParams|create|document|Flash|attrs|flash|Math||style|wmode|fallback|each'.split('|'),0,{}))

try{Typekit.load();}catch(e){}

jQuery.extend(jQuery.easing, {
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	}
});

$(document).ready(function() {

    var IE7 = ($.browser.msie && parseInt($.browser.version, 10) < 8);

    // emulate placeholder if browser doesn't support it
    var placeholderSupported = 'placeholder' in document.createElement('input') && 'placeholder' in document.createElement('textarea');
    if (!placeholderSupported) {
        $('[placeholder]').each(function() {
            var $this = $(this);
            var value = $this.attr('placeholder');
            $this.val(value).focus(function() {
                if ($this.val() == value) {
                    $this.val('');
                }
            }).blur(function() {
                if ($this.val() == '') {
                    $this.val(value);
                }
            }).blur();
            $this.parents('form').addClass('hasplaceholders');
        });
        // prevent against submit placeholder values
        $('form.hasplaceholders').submit(function() {
            $(this).find('[placeholder]').each(function() {
                var $this = $(this);
                if ($this.val() == $this.attr('placeholder')) {
                    $this.val('');
                }
            })
        });
    }

    // dropdown menu for IE7
    if (IE7) {
        $('#header > ul > li').hover(function() {
            $(this).children('ul').show();
        }, function() {
            $(this).children('ul').hide();
        });
    }

    // webkit fixes
    if ($.browser.webkit) {
        $('#header input, #bottom input').css({top: '4px'});
    }


    // auto width for drop down menus
    $('#header > ul ul').each(function() {
        var $this = $(this);
        var minWidth = $this.parents('li').children('a').outerWidth();
        var newWidth = $this.innerWidth();
        newWidth = newWidth > minWidth ? newWidth : minWidth;
        var marginLeft = (newWidth - $this.prev('a').innerWidth()) / 2;
        newWidth -= 30;
        $this.css('margin-left', -marginLeft).find('a').attr('style', 'width:' + newWidth + 'px !important');
    });

    // make the height of the sidebar smaller when the content is empty
    if ($('#content #text').length) {
        var $text = $('#content #text');
        var $sidebar = $('#content #sidebar');
        if ($text.outerHeight() < $sidebar.outerHeight()) {
            $sidebar.css('min-height', $text.outerHeight());
        }
    }

});

$(window).load(function() {

    // slider
    var $slides = $('#about-slider img');
    var $slider = $('#about-slider');
    if ($slides.length < 1) {
        var $slides = $('#slider img');
        var $slider = $('#slider');
    }
    if ($slides.length > 1) {
        var slidesCount = $slides.length;
        var i = 0, speed = 1000, delay = 3000, current = 0, slides = [], slidesHref = [], timeOut;
        $slides.each(function() {
            slides.push($(this).attr('src'));
            slidesHref.push($(this).parent('a').attr('href'));
        });
        $slides.not(':first').remove();
        $slides.parent().find('a').remove();

        var nav = '';
        for (var i = 0; i < slidesCount; ++i) {
            nav += '<li><a href="#" id="slide-trigg-' + i + '"' + (i == 0 ? ' class="active"' : '') + '>' + i + '</a>';
        }
        $slider.append('<ul id="slider-nav">' + nav + '</ul>');

        timeOut = setTimeout((slideFnc = function() {
            if (++current >= slidesCount) {
                current = 0;
            }
            clearTimeout(timeOut);
            $('#slider-nav').find('.active').removeClass('active');
            $('#slide-trigg-' + current).addClass('active');
            if (typeof slidesHref[current] !== 'undefined') {
                $('<img src="' + slides[current] + '">').css({
                    opacity: 0,
                    visibility: 'visible',
                    cursor: 'pointer'
                }).click(function() {
                    window.location = slidesHref[current];
                }).insertBefore('#slider-nav');
            }
            else {
                $('<img src="' + slides[current] + '">').css({
                    opacity: 0,
                    visibility: 'visible'
                }).insertBefore('#slider-nav');
            }
            $('#slider-nav').prev('img').animate({
                opacity: 1
            }, speed, function() {
                $slider.find('img').not(':last').remove();
                if (timeOut !== false) {
                    timeOut = setTimeout(slideFnc, delay);
                }
            });
        }), delay);
        $('#slider-nav a').click(function(e) {
            e.preventDefault();
            clearTimeout(timeOut);
            $('#slider-nav').find('.active').removeClass('active');
            current = $(this).addClass('active').html();
            $('<img src="' + slides[current] + '">').css({
                opacity: 0,
                visibility: 'visible'
            }).insertBefore('#slider-nav').animate({
                opacity: 1
            }, speed, function() {
                $slider.find('img').not(':last').remove();
                if (timeOut !== false) {
                    timeOut = setTimeout(slideFnc, delay);
                }
            });
        });

        $slider.hover(function() {
            clearTimeout(timeOut);
            timeOut = false;
        }, function() {
            timeOut = setTimeout(slideFnc, delay);
        });
    }

});

