/* Copyright (c) 2009 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.
 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
 *
 * Version: 3.0.2
 *
 * Requires: 1.2.2+
 */
(function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jQuery);

jQuery.easing.jswing=jQuery.easing.swing;
jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,a,c,b,d){return jQuery.easing[jQuery.easing.def](e,a,c,b,d)},easeInQuad:function(e,a,c,b,d){return b*(a/=d)*a+c},easeOutQuad:function(e,a,c,b,d){return-b*(a/=d)*(a-2)+c},easeInOutQuad:function(e,a,c,b,d){if((a/=d/2)<1)return b/2*a*a+c;return-b/2*(--a*(a-2)-1)+c},easeInCubic:function(e,a,c,b,d){return b*(a/=d)*a*a+c},easeOutCubic:function(e,a,c,b,d){return b*((a=a/d-1)*a*a+1)+c},easeInOutCubic:function(e,a,c,b,d){if((a/=d/2)<1)return b/
2*a*a*a+c;return b/2*((a-=2)*a*a+2)+c},easeInQuart:function(e,a,c,b,d){return b*(a/=d)*a*a*a+c},easeOutQuart:function(e,a,c,b,d){return-b*((a=a/d-1)*a*a*a-1)+c},easeInOutQuart:function(e,a,c,b,d){if((a/=d/2)<1)return b/2*a*a*a*a+c;return-b/2*((a-=2)*a*a*a-2)+c},easeInQuint:function(e,a,c,b,d){return b*(a/=d)*a*a*a*a+c},easeOutQuint:function(e,a,c,b,d){return b*((a=a/d-1)*a*a*a*a+1)+c},easeInOutQuint:function(e,a,c,b,d){if((a/=d/2)<1)return b/2*a*a*a*a*a+c;return b/2*((a-=2)*a*a*a*a+2)+c},easeInSine:function(e,
a,c,b,d){return-b*Math.cos(a/d*(Math.PI/2))+b+c},easeOutSine:function(e,a,c,b,d){return b*Math.sin(a/d*(Math.PI/2))+c},easeInOutSine:function(e,a,c,b,d){return-b/2*(Math.cos(Math.PI*a/d)-1)+c},easeInExpo:function(e,a,c,b,d){return a==0?c:b*Math.pow(2,10*(a/d-1))+c},easeOutExpo:function(e,a,c,b,d){return a==d?c+b:b*(-Math.pow(2,-10*a/d)+1)+c},easeInOutExpo:function(e,a,c,b,d){if(a==0)return c;if(a==d)return c+b;if((a/=d/2)<1)return b/2*Math.pow(2,10*(a-1))+c;return b/2*(-Math.pow(2,-10*--a)+2)+c},
easeInCirc:function(e,a,c,b,d){return-b*(Math.sqrt(1-(a/=d)*a)-1)+c},easeOutCirc:function(e,a,c,b,d){return b*Math.sqrt(1-(a=a/d-1)*a)+c},easeInOutCirc:function(e,a,c,b,d){if((a/=d/2)<1)return-b/2*(Math.sqrt(1-a*a)-1)+c;return b/2*(Math.sqrt(1-(a-=2)*a)+1)+c},easeInElastic:function(e,a,c,b,d){e=1.70158;var f=0,g=b;if(a==0)return c;if((a/=d)==1)return c+b;f||(f=d*0.3);if(g<Math.abs(b)){g=b;e=f/4}else e=f/(2*Math.PI)*Math.asin(b/g);return-(g*Math.pow(2,10*(a-=1))*Math.sin((a*d-e)*2*Math.PI/f))+c},easeOutElastic:function(e,
a,c,b,d){e=1.70158;var f=0,g=b;if(a==0)return c;if((a/=d)==1)return c+b;f||(f=d*0.3);if(g<Math.abs(b)){g=b;e=f/4}else e=f/(2*Math.PI)*Math.asin(b/g);return g*Math.pow(2,-10*a)*Math.sin((a*d-e)*2*Math.PI/f)+b+c},easeInOutElastic:function(e,a,c,b,d){e=1.70158;var f=0,g=b;if(a==0)return c;if((a/=d/2)==2)return c+b;f||(f=d*0.3*1.5);if(g<Math.abs(b)){g=b;e=f/4}else e=f/(2*Math.PI)*Math.asin(b/g);if(a<1)return-0.5*g*Math.pow(2,10*(a-=1))*Math.sin((a*d-e)*2*Math.PI/f)+c;return g*Math.pow(2,-10*(a-=1))*Math.sin((a*
d-e)*2*Math.PI/f)*0.5+b+c},easeInBack:function(e,a,c,b,d,f){if(f==undefined)f=1.70158;return b*(a/=d)*a*((f+1)*a-f)+c},easeOutBack:function(e,a,c,b,d,f){if(f==undefined)f=1.70158;return b*((a=a/d-1)*a*((f+1)*a+f)+1)+c},easeInOutBack:function(e,a,c,b,d,f){if(f==undefined)f=1.70158;if((a/=d/2)<1)return b/2*a*a*(((f*=1.525)+1)*a-f)+c;return b/2*((a-=2)*a*(((f*=1.525)+1)*a+f)+2)+c},easeInBounce:function(e,a,c,b,d){return b-jQuery.easing.easeOutBounce(e,d-a,0,b,d)+c},easeOutBounce:function(e,a,c,b,d){return(a/=
d)<1/2.75?b*7.5625*a*a+c:a<2/2.75?b*(7.5625*(a-=1.5/2.75)*a+0.75)+c:a<2.5/2.75?b*(7.5625*(a-=2.25/2.75)*a+0.9375)+c:b*(7.5625*(a-=2.625/2.75)*a+0.984375)+c},easeInOutBounce:function(e,a,c,b,d){if(a<d/2)return jQuery.easing.easeInBounce(e,a*2,0,b,d)*0.5+c;return jQuery.easing.easeOutBounce(e,a*2-d,0,b,d)*0.5+b*0.5+c}});

 /*
 * Fullsize
 * Copyright 2009 Drew Wilson
 * www.drewwilson.com
 * www.addfullsize.com
 *
 * Version 1.1.1   -   Updated: Jul. 2, 2009
 *
 * Fullsize is an attempt to standardize the way in page 'image popups' work.
 * It seems there are hundreds of javascripts light boxes, modal boxes, image zooms, image popups, etc.
 * But none of them provide a way to signal the user that what they just clicked on, is an
 * in page pop-up of a larger version (or 'fullsize' version) of the image they just clicked.
 * Fullsize is an attempt to do just that, provide a 'standard' way for users to recognize an in page pop-up.
 *
 * My intention is to get a 'fullsize' attribute added to the <IMG> element in the next version of HTML.
 * This would allow browsers to do an in page pop-up of the 'fullsize' image natively.
 *
 * In page pop ups are here to stay... so lets standardize them.
 *
 * Check out www.addfullsize.com for more info and to show your support for Fullsize.
 *
 * This jQuery plug-in is my atempt to bring the idea of 'fullsize' into a reality.
 * Though my intention is to push this functionality to the browser itself and not rely on JavaScript libraries,
 * for now, this will have to do :)
 *
 * This Fullsize jQuery plug-in is dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
//(function($){$.fn.fullsize=function(options){var defaults={shadow:true,zoomInSpeed:200,zoomOutSpeed:200,fadeInSpeed:250,fadeOutSpeed:250,leftOffset:0,topOffset:0,iconOffset:8,forceTitleBar:false,extraTrigger:false,parentSteps:0,destroy:false,start:function(){},end:function(){}};var opts=$.extend(defaults,options);if(opts.destroy==true){$("div.fullsize-icon").remove()}$(document).keydown(function(event){if(event.keyCode==27){$("div.fullsize-wrapper, div.fullsize-sh-wrap").fadeOut(opts.fadeOutSpeed,function(){$(this).remove()});opts.end.call(this)}});return this.each(function(){if(opts.destroy==true){$(this).unbind()}else{if($(this).attr("longdesc")){var org_image=$(this);var img_title=org_image.attr("title");var img_src=org_image.attr("longdesc");var icon=$("<div></div>").addClass("fullsize-icon").css({"display":"none"});var addTrigger;if(opts.extraTrigger){var theParent=org_image;for(var i=0;i<=opts.parentSteps;i++){theParent=theParent.parent()}addTrigger=theParent.find(opts.extraTrigger)}org_image.add(addTrigger).hover(function(){var margin_top=org_image.css("marginTop").slice(0,-2);var margin_bottom=org_image.css("marginLeft").slice(0,-2);var margin_left=org_image.css("marginLeft").slice(0,-2);var margin_right=org_image.css("marginLeft").slice(0,-2);if(margin_top<0||margin_bottom<0||margin_left<0||margin_right<0){var parent_ele=$(org_image);var parentEls=$(org_image).parents();$(parentEls).each(function(){if(this.tagName=="BODY"){return false}else if($(this).css("overflow")=="hidden"){parent_ele=$(this);return false}});var offset=parent_ele.offset();var parent_border_top=parseInt(parent_ele.css("border-top-width"));var parent_border_left=parseInt(parent_ele.css("border-left-width"))}else{var offset=org_image.offset();var parent_border_top=parseInt(org_image.css("border-top-width"));var parent_border_left=parseInt(org_image.css("border-left-width"))}if(!parent_border_top){parent_border_top=0}if(!parent_border_left){parent_border_left=0}var displayFlag=false;$("div.fullsize-icon").each(function(){if(parseInt($(this).css("top"))==(offset.top+opts.iconOffset+parent_border_top)&&parseInt($(this).css("left"))==(offset.left+opts.iconOffset+parent_border_left)){displayFlag=true;curIcon=$(this)}});if(displayFlag==false){$(icon).css({"top":offset.top+opts.iconOffset+parent_border_top,"left":offset.left+opts.iconOffset+parent_border_left});$("body").prepend(icon)}$(icon).show()},function(){$(icon).hide()});$(icon).hover(function(){$(this).show()},function(){$(this).hide()});$(icon).click(function(){opts.start.call(this);$("div.fullsize-wrapper, div.fullsize-sh-wrap").remove();var win_w=$(window).width();var win_h=$(window).height();var scrolltop=$(window).scrollTop();var scrollleft=$(window).scrollLeft();if(!$.support.opacity&&parseInt($.browser.version.substr(0,1))<"8"){var loading_left=(((win_w-opts.leftOffset)/2)+scrollleft)-25;var loading_top=(((win_h-opts.topOffset)/2)+scrolltop)-25}else{var loading_left=(((win_w+opts.leftOffset)/2)+scrollleft)-25;var loading_top=(((win_h+opts.topOffset)/2)+scrolltop)-25}var full_loading=$("<div></div>").addClass('fullsize-loading').css({"margin-left":loading_left,"margin-top":loading_top});var full_loading_inner=$("<div></div>").addClass('fullsize-loading-inner');$(full_loading).prepend(full_loading_inner);$("body").prepend(full_loading);var full_img=new Image();$(full_img).load(function(){$(this).hide();var new_offset=org_image.offset();img_w=this.width;img_h=this.height;aspect=img_w/img_h;if(((img_w+opts.leftOffset)+32)>win_w){img_w=(win_w-opts.leftOffset)-32;img_h=img_w/aspect}if(((img_h+opts.topOffset)+36)>win_h){img_h=(win_h-opts.topOffset)-36;img_w=img_h*aspect}if(!$.support.opacity&&parseInt($.browser.version.substr(0,1))<"8"){var img_left=Math.round((((win_w-opts.leftOffset)-img_w)/2)+scrollleft);var img_top=Math.round((((win_h-opts.topOffset)-img_h)/2)+scrolltop)}else{var img_left=Math.round((((win_w+opts.leftOffset)-img_w)/2)+scrollleft);var img_top=Math.round((((win_h+opts.topOffset)-img_h)/2)+scrolltop)}if(img_left<0){img_left=0}if(img_top<0){img_top=0}$(this).css({"height":org_image.height()+"px","width":org_image.width()+"px"});$("div.fullsize-loading").remove();var full_wrap=$("<div></div>").addClass("fullsize-wrapper").css({"display":"none","margin-top":new_offset.top,"margin-left":new_offset.left});$(full_wrap).prepend(this);if(img_title!=""||opts.forceTitleBar==true){var full_close=$("<a></a>").addClass("fullsize-close");var full_title=$("<div></div>").addClass("fullsize-title").css({"max-width":img_w});var full_title_text=$("<div></div>").addClass("fullsize-title-text").text(img_title);$(full_title).prepend(full_close);$(full_title).prepend(full_title_text);$(full_wrap).prepend(full_title);$("body").prepend(full_wrap);if(img_top!=0){img_top=img_top-12}}else{$(this).addClass("fullsize-close");$("body").prepend(full_wrap)}if(opts.shadow==true){if($.browser.safari||($.browser.mozilla&&$.browser.version.substr(0,5)>="1.9.1")){$(full_wrap).css({"-webkit-box-shadow":"0 2px 16px #000","-moz-box-shadow":"0 2px 16px #000","box-shadow":"0 2px 16px #000"})}else{var full_sh_wrap=$("<div></div>").addClass("fullsize-sh-wrap").css({"display":"none","width":org_image.width(),"margin-top":new_offset.top,"margin-left":new_offset.left});var full_sh_top=$("<div></div>").addClass("fullsize-sh-top");var full_sh_top_left=$("<div></div>").addClass("fullsize-sh-top-l");var full_sh_top_middle=$("<div></div>").addClass("fullsize-sh-top-m");var full_sh_top_right=$("<div></div>").addClass("fullsize-sh-top-r");$(full_sh_top).append(full_sh_top_left).append(full_sh_top_right).append(full_sh_top_middle);$(full_sh_wrap).prepend(full_sh_top);var full_sh_body=$("<div></div>").addClass("fullsize-sh-body");var full_sh_body_r=$("<div></div>").addClass("fullsize-sh-body-r");$(full_sh_body).append(full_sh_body_r);$(full_sh_wrap).append(full_sh_body);var full_sh_bottom=$("<div></div>").addClass("fullsize-sh-bottom");var full_sh_bottom_left=$("<div></div>").addClass("fullsize-sh-bottom-l");var full_sh_bottom_middle=$("<div></div>").addClass("fullsize-sh-bottom-m");var full_sh_bottom_right=$("<div></div>").addClass("fullsize-sh-bottom-r");$(full_sh_bottom).append(full_sh_bottom_left).append(full_sh_bottom_right).append(full_sh_bottom_middle);$(full_sh_wrap).append(full_sh_bottom);$("body").prepend(full_sh_wrap);$(full_sh_body).animate({height:parseInt(full_wrap.height())+img_h-22},{queue:false,duration:opts.zoomInSpeed});$(full_sh_wrap).fadeIn(opts.fadeInSpeed).animate({height:parseInt(full_wrap.height())+img_h+22,width:img_w+22,marginTop:img_top-9,marginLeft:img_left-11},{queue:false,duration:opts.zoomInSpeed})}}$(this).fadeIn(opts.fadeInSpeed).animate({height:img_h,width:img_w},{queue:false,duration:opts.zoomInSpeed});$(full_wrap).fadeIn(opts.fadeInSpeed).animate({width:img_w,marginTop:img_top,marginLeft:img_left},{queue:false,duration:opts.zoomInSpeed});$(".fullsize-close").click(function(){closeFullsize(full_img,full_wrap,org_image,$(this))})}).attr("src",img_src).addClass("fullsize-image")});function closeFullsize(full_img,full_wrap,org_image,ele){var offsets=org_image.offset();$(full_img).fadeOut(opts.fadeOutSpeed).animate({height:org_image.height(),width:org_image.width()},{queue:false,duration:opts.zoomOutSpeed});if(opts.shadow==true){$("div.fullsize-sh-wrap").remove()}$(full_wrap).fadeOut(opts.fadeOutSpeed).animate({width:org_image.width(),marginTop:offsets.top,marginLeft:offsets.left},{queue:false,duration:opts.zoomOutSpeed,complete:function(){ele.remove()}});opts.end.call(this)}}}})}})(jQuery);

/**
 * jQuery When Content Ready plugin
 * http://bright-side.ru/
 *
 * Copyright 2011 Andrew Abramov
 */
(function($) {
    $.fn.whenContentReady = function(o) {
        o = $.extend({
            images: true,
            backgrounds: true
        }, o || {});

        var current = $(this);
        var images, backgroundImages;
        if (o.images && !$.browser.opera) {
            images = current.find('img').add(current.filter('img'));
            images = clear($.unique(images.each(function(index) {
                images[index] = images[index].src;
            })));
        }
        if (o.backgrounds) {
            backgroundImages = current.find('[style]').add(current.filter('[style]'));
            backgroundImages = clear(backgroundImages.each(function(index) {
                backgroundImages[index] = $(backgroundImages[index]).css('background-image')
                .replace('url(', '').replace(')', '').replace('none', '')
                .replace('"', '').replace('"', '');
            }));
        }

        return $.when(isImagesLoad(images), isImagesLoad(backgroundImages));

        function clear(arr) {
            return $.grep(arr, function(element) {
                return '' == element || 'initial' == element ? false : true;
            });
        }

        function isImagesLoad(arraySrc) {
            if(arraySrc) {
                return isAbstractLoad(arraySrc, imageProcessing);
            }
            return $.Deferred().resolve();
        }

        function imageProcessing(value, key, logical, deferred) {
            img = new Image();
            img.onload = function() {
                doneOne(key, logical, deferred);
            }
            img.src = value;
        }

        function isAbstractLoad(arr, callback) {
            var d = $.Deferred();
            if (0 === arr.length) {
                d.resolve();
            } else {
                var logical = new Array(arr.length);

                for (key in arr) {
                    logical[key] = false;
                }

                for (key in arr) {
                    callback(arr[key], key, logical, d);
                }
            }
            return d;
        }

        function doneOne(key, logical, deferred) {
            logical[key] = true;
            if (isComplete(logical)) {
                deferred.resolve();
            }
        }

        function isComplete(logical) {
            for (key in logical) {
                if (true != logical[key]) {
                    return false;
                }
            }
            return true;
        }
    }
})(jQuery);

/**
 * jCarouselLite - jQuery plugin to navigate images/any content in a carousel style widget.
 * @requires jQuery v1.2 or above
 *
 * http://gmarwaha.com/jquery/jcarousellite/
 *
 * Copyright (c) 2007 Ganeshji Marwaha (gmarwaha.com)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Version: 1.0.1
 * Note: Requires jquery 1.2 or above from version 1.0.1
 */

/**
 * Creates a carousel-style navigation widget for images/any-content from a simple HTML markup.
 *
 * The HTML markup that is used to build the carousel can be as simple as...
 *
 *  <div class="carousel">
 *      <ul>
 *          <li><img src="image/1.jpg" alt="1"></li>
 *          <li><img src="image/2.jpg" alt="2"></li>
 *          <li><img src="image/3.jpg" alt="3"></li>
 *      </ul>
 *  </div>
 *
 * As you can see, this snippet is nothing but a simple div containing an unordered list of images.
 * You don't need any special "class" attribute, or a special "css" file for this plugin.
 * I am using a class attribute just for the sake of explanation here.
 *
 * To navigate the elements of the carousel, you need some kind of navigation buttons.
 * For example, you will need a "previous" button to go backward, and a "next" button to go forward.
 * This need not be part of the carousel "div" itself. It can be any element in your page.
 * Lets assume that the following elements in your document can be used as next, and prev buttons...
 *
 * <button class="prev">&lt;&lt;</button>
 * <button class="next">&gt;&gt;</button>
 *
 * Now, all you need to do is call the carousel component on the div element that represents it, and pass in the
 * navigation buttons as options.
 *
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev"
 * });
 *
 * That's it, you would have now converted your raw div, into a magnificient carousel.
 *
 * There are quite a few other options that you can use to customize it though.
 * Each will be explained with an example below.
 *
 * @param an options object - You can specify all the options shown below as an options object param.
 *
 * @option btnPrev, btnNext : string - no defaults
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev"
 * });
 * @desc Creates a basic carousel. Clicking "btnPrev" navigates backwards and "btnNext" navigates forward.
 *
 * @option btnGo - array - no defaults
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      btnGo: [".0", ".1", ".2"]
 * });
 * @desc If you don't want next and previous buttons for navigation, instead you prefer custom navigation based on
 * the item number within the carousel, you can use this option. Just supply an array of selectors for each element
 * in the carousel. The index of the array represents the index of the element. What i mean is, if the
 * first element in the array is ".0", it means that when the element represented by ".0" is clicked, the carousel
 * will slide to the first element and so on and so forth. This feature is very powerful. For example, i made a tabbed
 * interface out of it by making my navigation elements styled like tabs in css. As the carousel is capable of holding
 * any content, not just images, you can have a very simple tabbed navigation in minutes without using any other plugin.
 * The best part is that, the tab will "slide" based on the provided effect. :-)
 *
 * @option mouseWheel : boolean - default is false
 * @example
 * $(".carousel").jCarouselLite({
 *      mouseWheel: true
 * });
 * @desc The carousel can also be navigated using the mouse wheel interface of a scroll mouse instead of using buttons.
 * To get this feature working, you have to do 2 things. First, you have to include the mouse-wheel plugin from brandon.
 * Second, you will have to set the option "mouseWheel" to true. That's it, now you will be able to navigate your carousel
 * using the mouse wheel. Using buttons and mouseWheel or not mutually exclusive. You can still have buttons for navigation
 * as well. They complement each other. To use both together, just supply the options required for both as shown below.
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      mouseWheel: true
 * });
 *
 * @option auto : number - default is null, meaning autoscroll is disabled by default
 * @example
 * $(".carousel").jCarouselLite({
 *      auto: 800,
 *      speed: 500
 * });
 * @desc You can make your carousel auto-navigate itself by specfying a millisecond value in this option.
 * The value you specify is the amount of time between 2 slides. The default is null, and that disables auto scrolling.
 * Specify this value and magically your carousel will start auto scrolling.
 *
 * @option speed : number - 200 is default
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      speed: 800
 * });
 * @desc Specifying a speed will slow-down or speed-up the sliding speed of your carousel. Try it out with
 * different speeds like 800, 600, 1500 etc. Providing 0, will remove the slide effect.
 *
 * @option easing : string - no easing effects by default.
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      easing: "bounceout"
 * });
 * @desc You can specify any easing effect. Note: You need easing plugin for that. Once specified,
 * the carousel will slide based on the provided easing effect.
 *
 * @option vertical : boolean - default is false
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      vertical: true
 * });
 * @desc Determines the direction of the carousel. true, means the carousel will display vertically. The next and
 * prev buttons will slide the items vertically as well. The default is false, which means that the carousel will
 * display horizontally. The next and prev items will slide the items from left-right in this case.
 *
 * @option circular : boolean - default is true
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      circular: false
 * });
 * @desc Setting it to true enables circular navigation. This means, if you click "next" after you reach the last
 * element, you will automatically slide to the first element and vice versa. If you set circular to false, then
 * if you click on the "next" button after you reach the last element, you will stay in the last element itself
 * and similarly for "previous" button and first element.
 *
 * @option visible : number - default is 3
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      visible: 4
 * });
 * @desc This specifies the number of items visible at all times within the carousel. The default is 3.
 * You are even free to experiment with real numbers. Eg: "3.5" will have 3 items fully visible and the
 * last item half visible. This gives you the effect of showing the user that there are more images to the right.
 *
 * @option start : number - default is 0
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      start: 2
 * });
 * @desc You can specify from which item the carousel should start. Remember, the first item in the carousel
 * has a start of 0, and so on.
 *
 * @option scrool : number - default is 1
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      scroll: 2
 * });
 * @desc The number of items that should scroll/slide when you click the next/prev navigation buttons. By
 * default, only one item is scrolled, but you may set it to any number. Eg: setting it to "2" will scroll
 * 2 items when you click the next or previous buttons.
 *
 * @option beforeStart, afterEnd : function - callbacks
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      beforeStart: function(a) {
 *          alert("Before animation starts:" + a);
 *      },
 *      afterEnd: function(a) {
 *          alert("After animation ends:" + a);
 *      }
 * });
 * @desc If you wanted to do some logic in your page before the slide starts and after the slide ends, you can
 * register these 2 callbacks. The functions will be passed an argument that represents an array of elements that
 * are visible at the time of callback.
 *
 *
 * @cat Plugins/Image Gallery
 * @author Ganeshji Marwaha/ganeshread@gmail.com
 */

(function($) {                                          // Compliant with jquery.noConflict()
$.fn.jCarouselLite = function(o) {
    o = $.extend({
        btnPrev: null,
        btnNext: null,
        btnGo: null,
        mouseWheel: false,
        auto: null,

        speed: 200,
        easing: null,

        vertical: false,
        circular: true,
        visible: 3,
        start: 0,
        scroll: 1,

        beforeStart: null,
        afterEnd: null
    }, o || {});

    return this.each(function() {                           // Returns the element collection. Chainable.
        var current = $(this);
        current.whenContentReady().done(function() {
            var running = false, animCss=o.vertical?"top":"left", sizeCss=o.vertical?"height":"width";
            var div = current, ul = $("ul", div), tLi = $("li", ul), tl = tLi.size(), v = o.visible;

            if(o.circular) {
                ul.prepend(tLi.slice(tl-v-1+1).clone())
                  .append(tLi.slice(0,v).clone());
                o.start += v;
            }

            var li = $("li", ul), itemLength = li.size(), curr = o.start;
            div.css("visibility", "visible");

            li.css({overflow: "hidden", float: o.vertical ? "none" : "left"});
            ul.css({margin: "0", padding: "0", position: "relative", "list-style-type": "none", "z-index": "1"});
            div.css({overflow: "hidden", position: "relative", "z-index": "2", left: "0px"});

            var liSize = o.vertical ? height(li) : width(li);   // Full li size(incl margin)-Used for animation
            var ulSize = liSize * itemLength;                   // size of full ul(total length, not just for the visible items)
            var divSize = liSize * v;                           // size of entire div(total length for just the visible items)

            li.css({width: o.vertical ? li.width() : liSize - css(li, 'margin-left') - css(li, 'margin-right'),
                height: o.vertical ? liSize - css(li, 'margin-top') - css(li, 'margin-bottom') : li.height()});

            ul.css(sizeCss, ulSize+"px").css(animCss, -(curr*liSize));

            div.css(sizeCss, divSize+"px");                     // Width of the DIV. length of visible images

            if(o.btnPrev)
                $(o.btnPrev).click(function() {
                    return go(curr-o.scroll);
                });

            if(o.btnNext)
                $(o.btnNext).click(function() {
                    return go(curr+o.scroll);
                });

            if(o.btnGo)
                $.each(o.btnGo, function(i, val) {
                    $(val).click(function() {
                        return go(o.circular ? o.visible+i : i);
                    });
                });

            if(o.mouseWheel && div.mousewheel)
                div.mousewheel(function(e, d) {
                    return d>0 ? go(curr-o.scroll) : go(curr+o.scroll);
                });

            if(o.auto)
                setInterval(function() {
                    go(curr+o.scroll);
                }, o.auto+o.speed);

            function vis() {
                return li.slice(curr).slice(0,v);
            };

            function go(to) {
                if(!running) {

                    if(o.beforeStart)
                        o.beforeStart.call(this, vis());

                    if(o.circular) {            // If circular we are in first or last, then goto the other end
                        if(to<=o.start-v-1) {           // If first, then goto last
                            ul.css(animCss, -((itemLength-(v*2))*liSize)+"px");
                            // If "scroll" > 1, then the "to" might not be equal to the condition; it can be lesser depending on the number of elements.
                            curr = to==o.start-v-1 ? itemLength-(v*2)-1 : itemLength-(v*2)-o.scroll;
                        } else if(to>=itemLength-v+1) { // If last, then goto first
                            ul.css(animCss, -( (v) * liSize ) + "px" );
                            // If "scroll" > 1, then the "to" might not be equal to the condition; it can be greater depending on the number of elements.
                            curr = to==itemLength-v+1 ? v+1 : v+o.scroll;
                        } else curr = to;
                    } else {                    // If non-circular and to points to first or last, we just return.
                        if(to<0 || to>itemLength-v) return;
                        else curr = to;
                    }                           // If neither overrides it, the curr will still be "to" and we can proceed.

                    running = true;

                    ul.animate(
                        animCss == "left" ? { left: -(curr*liSize) } : { top: -(curr*liSize) } , o.speed, o.easing,
                        function() {
                            if(o.afterEnd)
                                o.afterEnd.call(this, vis());
                            running = false;
                        }
                    );
                    // Disable buttons when the carousel reaches the last/first, and enable when not
                    if(!o.circular) {
                        $(o.btnPrev + "," + o.btnNext).removeClass("disabled");
                        $( (curr-o.scroll<0 && o.btnPrev)
                            ||
                           (curr+o.scroll > itemLength-v && o.btnNext)
                            ||
                           []
                         ).addClass("disabled");
                    }

                }
                return false;
            };
        });
    });
};

function css(el, prop) {
    return parseInt($.css(el[0], prop)) || 0;
};
function width(el) {
    var max = 0;
    el.each(function() {
        var current = $(this);
        var width = current.width() + css(current, 'marginLeft') + css(current, 'marginRight');
        if(width > max) {
            max = width;
        }
    });
    return max;
    //return  el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight');
};
function height(el) {
    var max = 0;
    el.each(function() {
        var current = $(this);
        var height = current.height() + css(current, 'marginTop') + css(current, 'marginBottom');
        if(height > max) {
            max = height;
        }
    });
    return max;
    //return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom');
};

})(jQuery);

/**
 * http://bright-side.ru/
 *
 * Copyright 2011 Andrew Abramov (http://forgiving.ru/)
 */
(function($) {
    $.fn.tabs = function(o) {
        o = $.extend({
            selectedClass: 'selected',
            pages: '.pages',
            select: function(tab) {},
            unselect: function(tab) {}
        }, o || {});

        return this.each(function() {

            var handle = $(this);
            var tabs = $('li', handle);
            var pages = $('div.page', o.pages);

            if (pages.filter('.current').size() > 0) {
                    pages.not('.current').hide();
            } else {
                pages.not(':first').hide();
            }
            tabs.eq(pages.filter('.current').index()).addClass(o.selectedClass);

            tabs.click(function() {
                var current = $(this);
                if(current.hasClass(o.selectedClass)) {
                    return false;
                }
                tabUnselect(tabs.filter('.' + o.selectedClass));
                tabSelect(current);
                pages.filter('.current').fadeOut('fast', function() {
                    $(this).removeClass('current');
                });
                pages.eq(current.index()).addClass('current').fadeIn('fast');
                return false;
            });

        });

        function tabSelect(tab) {
            o.select(tab.addClass(o.selectedClass));
        }

        function tabUnselect(tab) {
            o.unselect(tab.removeClass(o.selectedClass));
        }
    }
})(jQuery);

/**
 * http://bright-side.ru/
 *
 * Copyright 2011 Andrew Abramov
 */
/**
 * jQuery Image Rollover plugin
 * http://bright-side.ru/
 *
 * Copyright 2011 Andrew Abramov (http://forgiving.ru/)
 *
 * Date: Tue June 28 15:55 2011 +0400
 */
/**
 * jQuery Image Rollover plugin
 * http://bright-side.ru/
 *
 * Copyright 2011 Andrew Abramov (http://forgiving.ru/)
 *
 * Date: Tue June 28 15:55 2011 +0400
 */
(function($) {
    $.fn.radio = function(o) {
        o = $.extend({
            checkedClass: 'checked',
            check: function(label, radio){},
            uncheck: function(label, radio){}
        }, o || {});

        return this.each(function() {

            var handle = $(this);
            var inputs = $('input[type=radio]', handle).hide();
            var labels = $('label', handle);

            inputs.filter('[' + o.checkedClass + ']').each(function() {
                labels.filter('[for=' + $(this).attr('id') + ']').addClass(o.checkedClass);
            });

            labels.click(function() {
                var current = $(this);
                if(current.hasClass(o.checkedClass)) {
                    return false;
                }
                radioUncheck(labels.filter('.' + o.checkedClass), null);
                radioCheck($(this), $('#' + $(this).attr('for')));
            });

        });

        function radioCheck(label, radio) {
            o.check(label, radio);
            label.addClass(o.checkedClass)
        }

        function radioUncheck(label, radio) {
            o.uncheck(label.removeClass(o.checkedClass), radio);
        }
    }
})(jQuery);

/**
* jQuery.ScrollTo - Easy element scrolling using jQuery.
* Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
* Dual licensed under MIT and GPL.
* Date: 5/25/2009
* @author Ariel Flesler
* @version 1.4.2
*
* http://flesler.blogspot.com/2007/10/jqueryscrollto.html
*/
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);

/**
* jQuery.LocalScroll - Animated scrolling navigation, using anchors.
* Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
* Dual licensed under MIT and GPL.
* Date: 3/11/2009
* @author Ariel Flesler
* @version 1.2.7
**/
;(function($){var l=location.href.replace(/#.*/,'');var g=$.localScroll=function(a){$('body').localScroll(a)};g.defaults={duration:1e3,axis:'y',event:'click',stop:true,target:window,reset:true};g.hash=function(a){if(location.hash){a=$.extend({},g.defaults,a);a.hash=false;if(a.reset){var e=a.duration;delete a.duration;$(a.target).scrollTo(0,a);a.duration=e}i(0,location,a)}};$.fn.localScroll=function(b){b=$.extend({},g.defaults,b);return b.lazy?this.bind(b.event,function(a){var e=$([a.target,a.target.parentNode]).filter(d)[0];if(e)i(a,e,b)}):this.find('a,area').filter(d).bind(b.event,function(a){i(a,this,b)}).end().end();function d(){return!!this.href&&!!this.hash&&this.href.replace(this.hash,'')==l&&(!b.filter||$(this).is(b.filter))}};function i(a,e,b){var d=e.hash.slice(1),f=document.getElementById(d)||document.getElementsByName(d)[0];if(!f)return;if(a)a.preventDefault();var h=$(b.target);if(b.lock&&h.is(':animated')||b.onBefore&&b.onBefore.call(b,a,f,h)===false)return;if(b.stop)h.stop(true);if(b.hash){var j=f.id==d?'id':'name',k=$('<a> </a>').attr(j,d).css({position:'absolute',top:$(window).scrollTop(),left:$(window).scrollLeft()});f[j]='';$('body').prepend(k);location=e.hash;k.remove();f[j]=d}h.scrollTo(f,b).trigger('notify.serialScroll',[f])}})(jQuery);

/**
 * Default PCO-13 site script
 * http://bright-side.ru/
 *
 * Copyright 2011 Andrew Abramov
 */

$(document).ready(function() {
    $('html').addClass('js');
    if($.browser.webkit) {
        $('a#feedback').append('<i></i>');
    }

    $('img[longdesc]').each(function() {
        $(this).parent().parent().html($(this).parent().html());
    });

    if($.browser.msie) {
        $('html').addClass('ie');
    }

    $('#feedback').click(function() {
        $('#feedback-form').stop(true, true).fadeIn();
        return false;
    });

    $('#feedback-form span.close').click(function() {
        $('#feedback-form').stop(true, true).fadeOut();
        return false;
    });

    $('#feedback-form').click(function (e) {
        if ($(e.target).is('#feedback-form')) {
            $('#feedback-form').stop(true, true).fadeOut();
        }
    });

    $('#feedback-form form').submit(function(event) {
        event.preventDefault();

        $.get( '/ajax.php?'+$('#feedback-form form').serialize(), function( data ) {
            $('#feedback-form p').text(data['body']).removeClass().addClass(data['status']);
            if('error' !== data['status']) {
                $('#feedback-form').stop(true, true).delay(1000).fadeOut();
                $('input, textarea', '#feedback-form').not('[type=submit]').val('');
            }
        }, 'json');
    });

   // $('img[longdesc]').fullsize({iconOffset: 0});
});
