


/*FANCYBOX*/



/*
 * FancyBox - jQuery Plugin
 * Simple and fancy lightbox alternative
 *
 * Examples and documentation at: http://fancybox.net
 * 
 * Copyright (c) 2008 - 2010 Janis Skarnelis
 * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
 * 
 * Version: 1.3.4 (11/11/2010)
 * Requires: jQuery v1.3+
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */

;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+
'"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+
";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==
i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==
37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j);
f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type==
"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}};
b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);



/*CAROUSEL*/




/* * *
	FEATURE CAROUSEL / 1.2.1 / http://www.bkosolutions.com
* * */
(function($) {

    $.fn.featureCarousel = function (options) {

        // override the default options with user defined options
        options = $.extend({}, $.fn.featureCarousel.defaults, options || {});

        return $(this).each(function () {

            /* These are univeral values that are used throughout the plugin. Do not modify them
             * unless you know what you're doing. Most of them feed off the options
             * so most customization can be achieved by modifying the options values */
            var pluginData = {
                currentCenterNum:       options.startingFeature,
                containerWidth:         0,
                containerHeight:        0,
                largeFeatureWidth:      0,
                largeFeatureHeight:     0,
                smallFeatureWidth:      0,
                smallFeatureHeight:     0,
                totalFeatureCount:      $(this).children("div").length,
                currentlyMoving:        false,
                featuresContainer:      $(this),
                featuresArray:          [],
                containerIDTag:         "#"+$(this).attr("id"),
                timeoutVar:             null,
                rotationsRemaining:     0,
                itemsToAnimate:         0,
                borderWidth:			0
            };

            preload(function () {
            	setupFeatureDimensions();
                setupCarousel();
                setupFeaturePositions();
                initiateMove(true,1);
            });

            //alert("Total = "+pluginData.totalFeatureCount);
            
            /**
             * Function to preload the images in the carousel if desired.
             * This is not recommended if there are a lot of images in the carousel because
             * it may take a while. Functionality does not depend on preloading the images
             */
            function preload(callback) {
                // user may not want to preload images
                if (options.preload == true) {
                    var $imageElements = pluginData.featuresContainer.find("img");
                    var loadedImages = 0;
                    var totalImages = $imageElements.length;

                    $imageElements.each(function () {
                        // Attempt to load the images
                        $(this).load(function () {
                            // Add to number of images loaded and see if they are all done yet
                            loadedImages++;
                            if (loadedImages == totalImages) {
                                // All done, perform callback
                                callback();
                            }
                        });
                        // The images may already be cached in the browser, in which case they
                        // would have a 'true' complete value and the load callback would never be
                        // fired. This will fire it manually.
                        if (this.complete) {
                            $(this).trigger('load');
                        }
                    });
                } else {
                    // if user doesn't want preloader, then just go right to callback
                    callback();
                }
            }

            // Gets the feature container based on the number
            function getContainer(featureNum) {
                return pluginData.featuresArray[featureNum-1];
            }

            // get a feature given it's set position (the position that doesn't change)
            function getBySetPos(position) {
                $.each(pluginData.featuresArray, function () {
                    if ($(this).data().setPosition == position)
                        return $(this);
                });
            }

            // get previous feature number
            function getPreviousNum(num) {
                if ((num - 1) == 0) {
                    return pluginData.totalFeatureCount;
                } else {
                    return num - 1;
                }
            }

            // get next feature number
            function getNextNum(num) {
                if ((num + 1) > pluginData.totalFeatureCount) {
                    return 1;
                } else {
                    return num + 1;
                }
            }

            /**
             * Because there are several options the user can set for the width and height
             * of the feature images, this function is used to determine which options were set
             * and to set the appropriate dimensions used for a small and large feature
             */
            function setupFeatureDimensions() {
                // Set the height and width of the entire carousel container
                pluginData.containerWidth = pluginData.featuresContainer.width();
                pluginData.containerHeight = pluginData.featuresContainer.height();

                // Grab the first image for reference
                var $firstFeatureImage = $(pluginData.containerIDTag).find("div img:first");

                // Large Feature Width
                if (options.largeFeatureWidth > 1)
                    pluginData.largeFeatureWidth = options.largeFeatureWidth;
                else if (options.largeFeatureWidth > 0 && options.largeFeatureWidth < 1)
                    pluginData.largeFeatureWidth = $firstFeatureImage.width() * options.largeFeatureWidth;
                else
                    pluginData.largeFeatureWidth = $firstFeatureImage.outerWidth();
                // Large Feature Height
                if (options.largeFeatureHeight > 1)
                    pluginData.largeFeatureHeight = options.largeFeatureHeight;
                else if (options.largeFeatureHeight > 0 && options.largeFeatureHeight < 1)
                    pluginData.largeFeatureHeight = $firstFeatureImage.height() * options.largeFeatureHeight;
                else
                    pluginData.largeFeatureHeight = $firstFeatureImage.outerHeight();
                // Small Feature Width
                if (options.smallFeatureWidth > 1)
                    pluginData.smallFeatureWidth = options.smallFeatureWidth;
                else if (options.smallFeatureWidth > 0 && options.smallFeatureWidth < 1)
                    pluginData.smallFeatureWidth = $firstFeatureImage.width() * options.smallFeatureWidth;
                else
                    pluginData.smallFeatureWidth = $firstFeatureImage.outerWidth() / 2;
                // Small Feature Height
                if (options.smallFeatureHeight > 1)
                    pluginData.smallFeatureHeight = options.smallFeatureHeight;
                else if (options.smallFeatureHeight > 0 && options.smallFeatureHeight < 1)
                    pluginData.smallFeatureHeight = $firstFeatureImage.height() * options.smallFeatureHeight;
                else
                    pluginData.smallFeatureHeight = $firstFeatureImage.outerHeight() / 2;
            }

            /**
             * Function to take care of setting up various aspects of the carousel,
             * most importantly the default positions for the features
             */
            function setupCarousel() {
                // Set the total feature count to the amount the user wanted to cutoff
                if (options.displayCutoff > 0 && options.displayCutoff < pluginData.totalFeatureCount) {
                    pluginData.totalFeatureCount = options.displayCutoff;
                }

                // fill in the features array
                pluginData.featuresContainer.children("div").each(function (index) {
                    if (index < pluginData.totalFeatureCount) {
                        pluginData.featuresArray[index] = $(this);
                    }
                });

                // Determine the total border width around the feature if there is one
                if (pluginData.featuresContainer.children("div").first().css("borderLeftWidth") != "medium") {
                    pluginData.borderWidth = parseInt(pluginData.featuresContainer.children("div").first().css("borderLeftWidth"))*2;
                }

                // Place all the features in a center hidden position to start off
                pluginData.featuresContainer
                    // Have to make the container relative positioning
                    .children("div").each(function () {
                        // Center all the features in the middle and hide them
                        $(this).css({
                            'left': (pluginData.containerWidth / 2) - (pluginData.smallFeatureWidth / 2) - (pluginData.borderWidth / 2),
                            'width': pluginData.smallFeatureWidth,
                            'height': pluginData.smallFeatureHeight,
                            'top': options.smallFeatureOffset + options.topPadding,
                            'opacity': 0
                        });
                    })
                    // Set all the images to small feature size
                    .find("img:first").css({
                        'width': pluginData.smallFeatureWidth
                    });

                // figure out number of items that will rotate each time
                if (pluginData.totalFeatureCount < 4) {
                    pluginData.itemsToAnimate = pluginData.totalFeatureCount;
                } else {
                    pluginData.itemsToAnimate = 4;
                }

                // Hide story info and set the proper positioning
                pluginData.featuresContainer.find("div > div")
                    .hide();
            }

            /**
             * Here all the position data is set for the features.
             * This is an important part of the carousel to keep track of where
             * each feature within the carousel is
             */
            function setupFeaturePositions() {
                // give all features a set number that won't change so they remember their
                // original order
                $.each(pluginData.featuresArray, function (i) {
                    $(this).data('setPosition',i+1);
                });

                // Go back one - This is done because we call the move function right away, which
                // shifts everything to the right. So we set the current center back one, so that
                // it displays in the center when that happens
                var oneBeforeStarting = getPreviousNum(options.startingFeature);
                pluginData.currentCenterNum = oneBeforeStarting;

                // Center feature will be position 1
                var $centerFeature = getContainer(oneBeforeStarting);
                $centerFeature.data('position',1);

                // Everything before that center feature...
                var $prevFeatures = $centerFeature.prevAll();
                $prevFeatures.each(function (i) {
                    $(this).data('position',(pluginData.totalFeatureCount - i));
                });

                // And everything after that center feature...
                var $nextFeatures = $centerFeature.nextAll();
                $nextFeatures.each(function (i) {
                    if ($(this).data('setPosition') != undefined) {
                        $(this).data('position',(i + 2));
                    }
                });

                // if the counter style is for including number tags in description...
                if (options.counterStyle == 3) {
                    $.each(pluginData.featuresArray, function () {
                        var pos = getPreviousNum($(this).data('position'));
                        var $numberTag = $("<span></span>");
                        $numberTag.addClass("numberTag");
                        $numberTag.html("("+ pos + " of " + pluginData.totalFeatureCount + ") ");
                        $(this).find('div p').prepend($numberTag);
                    });
                }
            }

            // This is a helper function for the animateFeature function that
            // will update the positions of all the features based on the direction
            function rotatePositions(direction) {
                $.each(pluginData.featuresArray, function () {
                    var newPos;
                    if (direction == false) {
                        newPos = getNextNum($(this).data().position);
                    } else {
                        newPos = getPreviousNum($(this).data().position);
                    }
                    $(this).data('position',newPos);
                });
            }

            /**
             * This function is used to animate the given feature to the given
             * location. Valid locations are "left", "right", "center", "hidden"
             */
            function animateFeature($feature, direction)
            {
                var new_width, new_height, new_top, new_left, new_zindex, new_padding, new_fade;

                // Determine the old and new positions of the feature
                var oldPosition = $feature.data('position');
                var newPosition;
                if (direction == true)
                    newPosition = getPreviousNum(oldPosition);
                else
                    newPosition = getNextNum(oldPosition);

                // Caculate new new css values depending on where the feature will be located
                if (newPosition == 1) {
                    new_width = pluginData.largeFeatureWidth;
                    new_height = pluginData.largeFeatureHeight;
                    new_top = options.topPadding;
                    new_zindex = $feature.css("z-index");
                    new_left = (pluginData.containerWidth / 2) - (pluginData.largeFeatureWidth / 2) - (pluginData.borderWidth / 2);
                    new_fade = 1.0;
                } else {
                    new_width = pluginData.smallFeatureWidth;
                    new_height = pluginData.smallFeatureHeight;
                    new_top = options.smallFeatureOffset + options.topPadding;
                    new_zindex = 1;
                    new_fade = 0.4;
                    // some info is different for the left, right, and hidden positions
                    // left
                    if (newPosition == pluginData.totalFeatureCount) {
                        new_left = options.sidePadding;
                    // right
                    } else if (newPosition == 2) {
                        new_left = pluginData.containerWidth - pluginData.smallFeatureWidth - options.sidePadding - pluginData.borderWidth;
                    // hidden
                    } else {
                        new_left = (pluginData.containerWidth / 2) - (pluginData.smallFeatureWidth / 2) - (pluginData.borderWidth / 2);
                        new_fade = 0;
                    }
                }
                // This code block takes care of hiding the feature information if the feature is
                // NO LONGER going to be in the center
                if (newPosition != 1) {
                    // Slide up the story information
                    $feature.find("div")
                        .hide();
                }

                // Animate the feature div to its new location
                $feature
                    .animate(
                        {
                            width: new_width + 16,
                            height: new_height + 16,
                            top: new_top,
                            left: new_left - 8,
                            opacity: new_fade
                        },
                        options.carouselSpeed,
                        options.animationEasing,
                        function () {
                            // Take feature info out of hiding if new position is center
                            if (newPosition == 1) {
                                // fade in the feature information
                                $feature.find("div")
                                    .fadeTo("fast",0.85);
                            }
                            // decrement the animation queue
                            pluginData.rotationsRemaining = pluginData.rotationsRemaining - 1;
                            // have to change the z-index after the animation is done
                            $feature.css("z-index", new_zindex);
                            // change blips if using them
                            if (options.counterStyle == 1 || options.counterStyle == 2) {
                                if (newPosition == 1) {
                                    // figure out what item was just in the center, and what item is now in the center
                                    var newCenterItemNum = pluginData.featuresContainer.children("div").index($feature) + 1;
                                    var oldCenterItemNum;
                                    if (direction == false)
                                        oldCenterItemNum = getNextNum(newCenterItemNum);
                                    else
                                        oldCenterItemNum = getPreviousNum(newCenterItemNum);
                                }
                            }

                            // did all the the animations finish yet?
                            var divide = pluginData.rotationsRemaining / pluginData.itemsToAnimate;
                            if (divide % 1 == 0) {
                                // if so, set moving to false...
                                pluginData.currentlyMoving = false;
                                // change positions for all items...
                                rotatePositions(direction);

                                // and move carousel again if queue is not empty
                                if (pluginData.rotationsRemaining > 0)
                                    move(direction);
                            }
                        }
                    )
                    // select the image within the feature
                    .find("img:first")
                        // animate its size down
												.stop()
                        .animate({
                            width: new_width,
                            height: new_height
                        },
                        options.carouselSpeed,
                        options.animationEasing)
                    .end();
 
            }

            /**
             * move the carousel to the left or to the right. The features that
             * will move into the four positions are calculated and then animated
             * rotate to the RIGHT when direction is TRUE and
             * rotate to the LEFT when direction is FALSE
             */
            function move(direction)
            {
                // Set the carousel to currently moving
                pluginData.currentlyMoving = true;

                // Obtain the new feature positions based on the direction that the carousel is moving
                var $newCenter, $newLeft, $newRight, $newHidden;
                if (direction == true) {
                    // Shift features to the left
                    $newCenter = getContainer(getNextNum(pluginData.currentCenterNum));
                    $newLeft = getContainer(pluginData.currentCenterNum);
                    $newRight = getContainer(getNextNum(getNextNum(pluginData.currentCenterNum)));
                    $newHidden = getContainer(getPreviousNum(pluginData.currentCenterNum));
                    pluginData.currentCenterNum = getNextNum(pluginData.currentCenterNum);
                } else {
                    $newCenter = getContainer(getPreviousNum(pluginData.currentCenterNum));
                    $newLeft = getContainer(getPreviousNum(getPreviousNum(pluginData.currentCenterNum)));
                    $newRight = getContainer(pluginData.currentCenterNum);
                    $newHidden = getContainer(getNextNum(pluginData.currentCenterNum));
                    pluginData.currentCenterNum = getPreviousNum(pluginData.currentCenterNum);
                }

                // The z-index must be set before animations take place for certain movements
                // this makes the animations look nicer
                if (direction) {
                    $newLeft.css("z-index", 3);
                } else {
                    $newRight.css("z-index", 3);
                }
                $newCenter.css("z-index", 4);
								
								if($newLeft == $newCenter && $newRight == $newCenter){
									pluginData.featuresContainer.parent().find('.prev, .next').hide();
									
									$newCenter.addClass('center');
									animateFeature($newCenter, direction);
									return;
								}					
								
								
                // Animate the features into their new positions
                animateFeature($newLeft, direction);
                animateFeature($newCenter, direction);
                animateFeature($newRight, direction);
                // Only want to animate the "hidden" feature if there are more than three
                if (pluginData.totalFeatureCount > 3) {
                    animateFeature($newHidden, direction);
                }
								
								$newCenter.addClass('center');
								// JEAN //
								if($newLeft != $newCenter)
									$newLeft.queue(function(){
										$(this).dequeue().removeClass('center');											
									})
									
								if($newRight != $newCenter)
									$newRight.queue(function(){
										$(this).dequeue().removeClass('center');											
									})
            }

            // This is used to relegate carousel movement throughout the plugin
            // It will only initiate a move if the carousel isn't currently moving
            // It will set the animation queue to the number of rotations given
            function initiateMove(direction, rotations) {
                if (pluginData.currentlyMoving == false) {
                    var queue = rotations * pluginData.itemsToAnimate;
                    pluginData.rotationsRemaining = queue;
                    move(direction);
                }
            }
            
            /**
             * This will find the shortest distance to travel the carousel from
             * one position to another position. It will return the shortest distance
             * in number form, and will be positive to go to the right and negative for left
             */
            function findShortestDistance(from, to) {
                var goingToLeft = 1, goingToRight = 1, tracker;
                tracker = from;
                // see how long it takes to go to the left
                while ((tracker = getPreviousNum(tracker)) != to) {
                    goingToLeft++;
                }

                tracker = from;
                // see how long it takes to to to the right
                while ((tracker = getNextNum(tracker)) != to) {
                    goingToRight++;
                }

                // whichever is shorter
                return (goingToLeft < goingToRight) ? goingToLeft*-1 : goingToRight;
            }
            
             $(this).parent().find('.prev').click(function () {
                initiateMove(false,1);
                return false;
            });
            
            $(this).parent().find('.next').click(function () {
                initiateMove(true,1);
                return false;
            });

            // These are the click and hover events for the features
            pluginData.featuresContainer.children("div")
                .click(function () {
                    var position = $(this).data('position');
                    if (position == 2) {
                        initiateMove(true,1);
                    } else if (position == pluginData.totalFeatureCount) {
                        initiateMove(false,1);
                    }
                })
                .mouseover(function () {
                    if (pluginData.currentlyMoving == false) {
                        var position = $(this).data('position');
                        if (position == 2 || (pluginData.totalFeatureCount > 1 && position == pluginData.totalFeatureCount)) {
                            $(this).css("opacity",0.8);
                        }
                    }
                })
                .mouseout(function () {
                    if (pluginData.currentlyMoving == false) {
                        var position = $(this).data('position');
                        if (position == 2 || (pluginData.totalFeatureCount > 1 && position == pluginData.totalFeatureCount)) {
                            $(this).css("opacity",0.4);
                        }
                    }
                });

            // Add event listener to all clicks within the features container
            // This is done to disable any links that aren't within the center feature
            $("a", pluginData.containerIDTag).live("click", function (event) {
                // travel up to the container
                var $parents = $(this).parentsUntil(pluginData.containerIDTag);
                // now check each of the feature divs within it
                $parents.each(function () {
                    var position = $(this).data('position');
                    // if there are more than just feature divs within the container, they will
                    // not have a position and it may come back as undefined. Throw these out
                    if (position != undefined) {
                        // if any of the links on a feature OTHER THAN the center feature were clicked,
                        // initiate a carousel move but then throw the link action away
                        // if the position WAS the center (i.e. 1), then do nothing and let the link pass
                        if (position != 1) {
                            if (position == pluginData.totalFeatureCount) {
                                initiateMove(false,1);
                            } else if (position == 2) {
                                initiateMove(true,1);
                            }
                            event.preventDefault();
                            return false;
                        }
                    }
                });
            });

            
            function resetControls(_id){
                _ref = $(pluginData.containerIDTag);
                _ref.children("div").each(function(index) {
                   _a = index + 1;
                   if(_id == _a){
                        _ref.parent().find('a#'+_a).parent().addClass('active');
                    }else{
                        _ref.parent().find('a#'+_a).parent().removeClass('active');
                    }                    
                });              
            }
        });
    };

    $.fn.featureCarousel.defaults = {
        // If zero, take original width and height of image
        // If between 0 and 1, multiply by original width and height (to get smaller size)
        // If greater than one, use in place of original pixel dimensions
        largeFeatureWidth :     280,
        largeFeatureHeight:		208,
        smallFeatureWidth:      .7,
        smallFeatureHeight:		.7,
        // how much to pad the top of the carousel
        topPadding:             0,
        // spacing between the sides of the container (pixels)
        sidePadding:            38,
        // the additional offset to pad the side features from the top of the carousel
        smallFeatureOffset:		32,
        // indicates which feature to start the carousel at
        startingFeature:        1,
        // speed in milliseconds it takes to rotate the carousel
        carouselSpeed:          350,
        // time in milliseconds to set interval to autorotate the carousel
        // set to true to enable the creation of blips to indicate how many
        // features there are
        counterStyle:           0,
        // true to preload all images in the carousel before displaying anything
        preload:                true,
        // Will only display this many features in the carousel
        // set to zero to disable
        displayCutoff:          0,
        // an easing can be specified for the animation of the carousel
        animationEasing:        'linear'
    };

})(jQuery);



/*MAIN*/



/* * *
	UTILS
* * */
var utils = {
	href: document.location.href.toLowerCase().replace(/\/?#\/?/, '/').replace(/\/$/, '') + '/index/',
	blank: 'images/blank.gif',
	background_first:true,
	
	/* BACKGROUND */
	background: function(name, color){
		if(utils.background_first && name.replace(/-.*$/, '*') == 'service*'){
			var location = '' + window.location;
			window.location = location.replace(/\/([^\/]+)\/?$/, '#$1');
		}
		$('<style type="text/css">' +
			'body{ '+
				'background-color:' + color + ';' +
				'background-image:url("http://www.ferrarisolutions.com.br/images/bck/' + name + '.jpg");' +
			'}'+
		'</style>').appendTo('head');
		utils.background_first = false;
	},
	
	/* WINDOW */
	window: function(){
		var bck = $('#bck_imgs');
		var moves = function(){
			var top = parseInt($(window).scrollTop());
			utils.imgs[1].e.css('top', Math.max(utils.imgs[1].top_min, utils.imgs[1].top + top*.3));
			utils.imgs[2].e.css('top', Math.max(utils.imgs[2].top_min, utils.imgs[2].top + top*.35));
		};
		
		var width = 0,
				height = 0;
		$(window).resize(function(event){
			bck.hide();
			var size = getPageSize();
			if(!event.originalEvent || width != size[0] || height != size[1]){
				width = size[0];
				height = size[1];
				
				if($('#service').length){
					$('#content').css('top', parseInt((height - $('body').height())/2) + 'px');						
					utils.imgs[1].top_min = height - utils.imgs[1].e.height();
					utils.imgs[2].top_min = height - utils.imgs[2].e.height();
				}
				var left = parseInt((width - 960) / 2);
				bck.css({
					'width':width-left,
					'height': height,
					'left': left,
					'top': 0
				});
			}
			bck.show();
			moves();
		}).scroll(moves).resize();
		
		$(window).load(function(){
			$(window).resize();										
		});
	},
	
	/* IMGS */
	imgs_load: function(){
		var i01 = $('#bck_img01'), 
				i02 = $('#bck_img02');
		
		utils.imgs = ['',
			{e:i01, top:parseInt(i01.css('top')), top_min:-1000},
			{e:i02, top:parseInt(i02.css('top')), top_min:-1000}
		];
		
		i01.add(i02).each(function(i){
			$(this).load(function(){
				if(!$(this).parent().data('off'))							
					$(this).parent().delay(600 + i*200).queue(function(){
						$(this).dequeue().show().animate({left:0}, 200);																											
					});
			}).attr('src', $(this).attr('title')).parent().hide().css('left', 50);												 
		});
	},
	
	/* SERVICE */
	service: function(){
		var content = $('#content');
		// MORE
		$('#content a.more').click(function(){
			utils.service_content_off(function(){
				content.hide();
				$('#util-inner').css('left', 30).show().animate({left:0}, 200);
				utils.carousel();
				$(window).resize();
			});
			
			$('#bck_imgs div').data('off', true).delay(200).animate({left:1000}, 200, function(){
				$(this).hide();
			});
			return false;																
		});
		// BACK
		$('#content-inner a.back').click(function(){
			$('#util-inner').animate({left:-30}, 100, function(){
				$(this).hide();
				utils.service_content_on(function(){
					$('#bck_imgs div').data('off', false).each(function(i){
						$(this).show().animate({left:0}, 250 + 100*i);
					});
				});
			});
			return false;
		});
	},
	
	/* SERVICE AJAX */
	service_ajax: function(){
		var current;
		$.address.change(function(event){
			if(event.value == '/'){
				window.location = utils.base;
				return false;
			}
			
			utils.service_content_off();
			$('#util-inner').animate({left:-30}, 100, function(){
				$('#util').children('[class!="clear"]').remove();															 
			});
			
			$('#bck_imgs div').data('off', true).animate({left:1000}, 200, function(){
				$(this).remove();
			});
			
			$.getJSON(window.location.pathname.replace(/\/$/, '') + event.value + '/ajax', function(data){
				if(current != event.value) return;
				var background_src = 'images/bck/' + data.name + '.jpg';

				document.title = document.title.replace(/-.*$/, ' - ' + data.subtitle);

				$('<img />').load(function(){
					if(current != event.value) return;
					$('<div id="body" />').hide().appendTo('body').css({
						'height': getPageSize()[1],
						'background-image': 'url(' + background_src + ')',
						'background-color': data.color
					}).fadeTo(300, 1, function(){
						$(this).remove();
						if(current != event.value) return;
						utils.background(data.name, data.color);
						
						$('#bck_imgs').html(data.imgs);
						utils.imgs_load();
						
						$('#util').prepend(data.util);
						utils.service_content_on();
						
						utils.fancybox(utils.icon('#util'));
						utils.service();
					});
				}).attr('src', background_src);
			});
			current = event.value;
		});
	},
	
	/* SERVICE CONTENT */
	service_content_on: function(fn){
		var content = $('#content').show();
		$(window).resize();
		content.wrap('<div id="content-wrap">').parent()
		 .height(content.css('left', -1000).height() + content.position().top);
		
		content.animate({left:0}, 300, function(){
			content.unwrap();
			if(fn) fn();
		});
	},
	service_content_off: function(fn){
		var content = $('#content');
		if(!content.length || !content.is(':visible')) return;
		content.wrap('<div id="content-wrap">').parent()
			.height(content.height() + content.position().top);
		content.animate({left:-1000}, 300, function(){
			content.unwrap();
			if(fn) fn();
		});
	},
	
	/* INITIALIZE */
	initialize: function(){
		// TOP PANEL
		$('#top_panel a').click(function(){
			$(this).toggleClass('open').parent().prev().stop().slideToggle(200);
			return false;
		});
		
		// TOP
		$('#top h1').css({'opacity':0, 'top':10}).delay(100).animate({'opacity':1, 'top':0}, 200)
			.add('#top .certify').hover(function(){
				$(this).fadeTo(100, .7);
			}, function(){
				$(this).fadeTo(200, 1);
			});
			
		// INPUT
		$('#top_panel input').focus(function(){
			$(this).parents('p').children('label').fadeOut(100);
		}).blur(function(){
			if($(this).val().empty())
				$(this).parents('p').children('label').fadeIn(100);
		});
				
		// MENU
		setTimeout(function(){
			var current;
			var check = function(add){
				var left = menu.position().left + (add || 0);
				if(left) 						prev.fadeTo(150, .8); else prev.fadeOut(150);
				if(-left != width)	next.fadeTo(150, .8); else next.fadeOut(150);
			};	
			var move = function(event){
				if(!ani){
					ani = true;
					check(event.data.pos == '+' ? link_width : -link_width);
					menu.animate({left:event.data.pos + '=' + link_width}, 200, function(){
						ani = false;															
					});
				}
				return false;
			};
			var ani = false;
			var prev = $('#menu a.prev').bind('click', {pos:'+'}, move);
			var next = $('#menu a.next').bind('click', {pos:'-'}, move);
			var menu = $('#menu ul');
			var left = 0;
			var link_width = menu.children().each(function(i){
				var t = $(this).children();
				var select = utils.href.match(new RegExp('^' + utils.base + t.attr('href')));
				if(select){
					current = t.parent().addClass('select');
					left = -$(this).width() * Math.max(i-1, 0);
				}
				t.append('<div>' + t.html() + '</div>').hover(function(){
					t.children().stop().css({display:'block', opacity:0}).fadeTo(100, 1);
				}, function(){
					t.children().stop().fadeTo(150, 0);
				}).click(function(){
					var href = $(this).attr('href').replace(/\/$/, '').split('/');
					var page = href.pop();
					if(current) current.removeClass('select');
					if($.address)
						$.address.value(page);
					else
						window.location = utils.base + href.join('/') + '#' + page;
					current = $(this).parent().addClass('select');
					return false;
				});				
			}).width();
			var width = menu.width() - link_width*4;
			menu.animate({top:0}, 300)
				.animate({left:Math.max(-width, left)}, 300, check);
		}, 300);
		
		// FOOTER
		$('#footer a').each(function(){
			var t = $(this);
			t.parent().toggleClass('select', utils.href.match(new RegExp('^' + utils.base + t.attr('href'))) || false);
			t.append('<div>' + t.html() + '</div>').hoverIntent(function(){
				t.children().stop().css({display:'block', opacity:0}).fadeTo(100, 1);
			}, function(){
				t.children().stop().fadeTo(150, 0);
			});
		});
		
		// PHOTO
		$('#util a.photo').hover(function(){
			$(this).children('img, em').stop().animate({opacity:.5}, 400);																	
		}, function(){
			$(this).children('img, em').stop().animate({opacity:1}, 200);
		});
		
		// CAROUSEL
		utils.carousel();
		
		// SERVICE
		if($('#service').length){
			if($.address)
				utils.service_ajax();
			else
				utils.service();
		}
	},
	
	/* FANCYBOX */
	fancybox: function(target){
		target = $(target);
		// PHOTO
		target.find('a[rel=lightbox]').fancybox({
			'titlePosition':'over',
			'padding':8,
			'cyclic':true
		});
		
		// VIDEO
		target.find('a[rel=lightbox-video]').each(function(){
			var t = $(this);
			t.fancybox({
				width:854,
				height:510,
				type:'swf',
				href:'http://www.youtube.com/v/' + t.attr('href').match(/^http:\/\/youtu.be\/(.*)$/)[1] + '&amp;hl=pt-br&amp;fs=1&amp;rel=0&amp;color1=0xFFFFFF&amp;color2=0xFFFFFF'
			});
		});
		
		return target;
	},
	
	/* CAROUSEL */
	carousel: function(){
		if($('#carousel-inner').width())
			$('#carousel-inner').featureCarousel().find('a.photo').unbind('hover');
	},
	
	/* ICON */
	icon: function(target){
		target = $(target);
		// ICON
		target.find('a.icon').each(function(){
			$(this).append('<div>' + $(this).html() + '</div>').hover(function(){
				$(this).children('div').stop().css({display:'block', opacity:0}).fadeTo(100, 1);
			}, function(){
				$(this).children('div').stop().fadeTo(150, 0);
			});
		});
		
		// MORE
		target.find('a.more').hover(function(){
			$(this).children('span').stop().animate({'left':3}, 200);										 
		}, function(){
			$(this).children('span').stop().animate({'left':0}, 100);
		});
		
		// BACK
		target.find('a.back').hover(function(){
			$(this).children('span').stop().animate({'left':-3}, 200);										 
		}, function(){
			$(this).children('span').stop().animate({'left':0}, 100);
		});
		return target;
	}
};


/*-----------------------------------------------------------------------------------------------*/

$(function(){
	utils.imgs_load();
	utils.window();
	utils.initialize();
	
	utils.icon('body');
	utils.fancybox('body');	
});
