

/* INÍCIO DO GOOGLE ANALYTICS */

var $ = jQuery.noConflict();
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-24502589-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

/* FIM DO GOOGLE ANALYTICS */

/* INÍCIO DO CARROSSEL 3D */

<!-- Load the CloudCarousel JavaScript file -->

//////////////////////////////////////////////////////////////////////////////////
// CloudCarousel V1.0.5
// (c) 2011 by R Cecco. <http://www.professorcloud.com>
// MIT License
//
// Reflection code based on plugin by Christophe Beyls <http://www.digitalia.be>
//
// Please retain this copyright header in all versions of the software
//////////////////////////////////////////////////////////////////////////////////
var $ = jQuery.noConflict();

(function($) {

	// START Reflection object.
	// Creates a reflection for underneath an image.
	// IE uses an image with IE specific filter properties, other browsers use the Canvas tag.	
	// The position and size of the reflection gets updated by updateAll() in Controller.
	function Reflection(img, reflHeight, opacity) {				
		
		var	reflection, cntx, imageWidth = img.width, imageHeight = img.width, gradient, parent;
	
		parent = $(img.parentNode);
		this.element = reflection = parent.append("<canvas class='reflection' style='position:absolute'/>").find(':last')[0];
        if ( !reflection.getContext &&  $.browser.msie) {
			this.element = reflection = parent.append("<img class='reflection' style='position:absolute'/>").find(':last')[0];					
			reflection.src = img.src;			
			reflection.style.filter = "flipv progid:DXImageTransform.Microsoft.Alpha(opacity=" + (opacity * 100) + ", style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy=" + (reflHeight / imageHeight * 100) + ")";	
			
        } else {							
			cntx = reflection.getContext("2d");
			try {
				
				
				$(reflection).attr({width: imageWidth, height: reflHeight});
				cntx.save();
				cntx.translate(0, imageHeight-1);
				cntx.scale(1, -1);				
				cntx.drawImage(img, 0, 0, imageWidth, imageHeight);				
				cntx.restore();
				cntx.globalCompositeOperation = "destination-out";
				gradient = cntx.createLinearGradient(0, 0, 0, reflHeight);
				gradient.addColorStop(0, "rgba(255, 255, 255, " + (1 - opacity) + ")");
				gradient.addColorStop(1, "rgba(255, 255, 255, 1.0)");
				cntx.fillStyle = gradient;
				cntx.fillRect(0, 0, imageWidth, reflHeight);				
			} catch(e) {			
				return;
			}		
		}
		// Store a copy of the alt and title attrs into the reflection
		$(reflection).attr({ 'alt': $(img).attr('alt'), title: $(img).attr('title')} );	
				
	}	//END Reflection object

	// START Item object.
	// A wrapper object for items within the carousel.
	var	Item = function(imgIn, options)
	{								
		this.orgWidth = imgIn.width;			
		this.orgHeight = imgIn.height;		
		this.image = imgIn;
		this.reflection = null;					
		this.alt = imgIn.alt;
		this.title = imgIn.title;
		this.imageOK = false;		
		this.options = options;				
						
		this.imageOK = true;	
		
		if (this.options.reflHeight > 0)
		{													
			this.reflection = new Reflection(this.image, this.options.reflHeight, this.options.reflOpacity);					
		}
		$(this.image).css('position','absolute');	// Bizarre. This seems to reset image width to 0 on webkit!					
	};// END Item object
	
	
	// Controller object.
	// This handles moving all the items, dealing with mouse clicks etc.	
	var Controller = function(container, images, options)
	{						
		var	items = [], funcSin = Math.sin, funcCos = Math.cos, ctx=this;
		this.controlTimer = 0;
		this.stopped = false;
		//this.imagesLoaded = 0;
		this.container = container;
		this.xRadius = options.xRadius;
		this.yRadius = options.yRadius;
		this.showFrontTextTimer = 0;
		this.autoRotateTimer = 0;
		if (options.xRadius === 0)
		{
			this.xRadius = ($(container).width()/2.3);
		}
		if (options.yRadius === 0)
		{
			this.yRadius = ($(container).height()/6);
		}

		this.xCentre = options.xPos;
		this.yCentre = options.yPos;
		this.frontIndex = 0;	// Index of the item at the front
		
		// Start with the first item at the front.
		this.rotation = this.destRotation = Math.PI/2;
		this.timeDelay = 1000/options.FPS;
								
		// Turn on the infoBox
		if(options.altBox !== null)
		{
			$(options.altBox).css('display','block');	
			$(options.titleBox).css('display','block');	
		}
		// Turn on relative position for container to allow absolutely positioned elements
		// within it to work.
		$(container).css({ position:'relative', overflow:'hidden'} );
	
		$(options.buttonLeft).css('display','inline');
		$(options.buttonRight).css('display','inline');
		
		// Setup the buttons.
		$(options.buttonLeft).bind('mouseup',this,function(event){
			event.data.rotate(-1);	
			return false;
		});
		$(options.buttonRight).bind('mouseup',this,function(event){															
			event.data.rotate(1);	
			return false;
		});
		
		// You will need this plugin for the mousewheel to work: http://plugins.jquery.com/project/mousewheel
		if (options.mouseWheel)
		{
			$(container).bind('mousewheel',this,function(event, delta) {					 
					 event.data.rotate(delta);
					 return false;
				 });
		}
		$(container).bind('mouseover click',this,function(event){
			
			clearInterval(event.data.autoRotateTimer);		// Stop auto rotation if mouse over.
			var	text = $(event.target).attr('alt');		
			// If we have moved over a carousel item, then show the alt and title text.
		
			if ( text !== undefined && text !== null )
			{
					
				clearTimeout(event.data.showFrontTextTimer);			
				$(options.altBox).html( ($(event.target).attr('alt') ));
				$(options.titleBox).html( ($(event.target).attr('title') ));							
				if ( options.bringToFront && event.type == 'click' )				
				{
				
					var	idx = $(event.target).data('itemIndex');	
					var	frontIndex = event.data.frontIndex;
					//var	diff = idx - frontIndex;                    
                    var        diff = (idx - frontIndex) % images.length;
                    if (Math.abs(diff) > images.length / 2) {
                        diff += (diff > 0 ? -images.length : images.length);
                    }
                    
					event.data.rotate(-diff);
				}
			}
		});
		// If we have moved out of a carousel item (or the container itself),
		// restore the text of the front item in 1 second.
		$(container).bind('mouseout',this,function(event){
				var	context = event.data;				
				clearTimeout(context.showFrontTextTimer);				
				context.showFrontTextTimer = setTimeout( function(){context.showFrontText();},1000);
				context.autoRotate();	// Start auto rotation.
		});

		// Prevent items from being selected as mouse is moved and clicked in the container.
		$(container).bind('mousedown',this,function(event){	
			
			event.data.container.focus();
			return false;
		});
		container.onselectstart = function () { return false; };		// For IE.

		this.innerWrapper = $(container).wrapInner('<div style="position:absolute;width:100%;height:100%;"/>').children()[0];
	
		// Shows the text from the front most item.
		this.showFrontText = function()
		{	
			if ( items[this.frontIndex] === undefined ) { return; }	// Images might not have loaded yet.
			$(options.titleBox).html( $(items[this.frontIndex].image).attr('title'));
			$(options.altBox).html( $(items[this.frontIndex].image).attr('alt'));				
		};
						
		this.go = function()
		{				
			if(this.controlTimer !== 0) { return; }
			var	context = this;
			this.controlTimer = setTimeout( function(){context.updateAll();},this.timeDelay);					
		};
		
		this.stop = function()
		{
			clearTimeout(this.controlTimer);
			this.controlTimer = 0;				
		};
		
		
		// Starts the rotation of the carousel. Direction is the number (+-) of carousel items to rotate by.
		this.rotate = function(direction)
		{	
			this.frontIndex -= direction;
			this.frontIndex %= items.length;					 			
			this.destRotation += ( Math.PI / items.length ) * ( 2*direction );
			this.showFrontText();
			this.go();			
		};
		
		
		this.autoRotate = function()
		{			
			if ( options.autoRotate !== 'no' )
			{
				var	dir = (options.autoRotate === 'right')? 1 : -1;
				this.autoRotateTimer = setInterval( function(){ctx.rotate(dir); }, options.autoRotateDelay );
			}
		};
		
		// This is the main loop function that moves everything.
		this.updateAll = function()
		{											
			var	minScale = options.minScale;	// This is the smallest scale applied to the furthest item.
			var smallRange = (1-minScale) * 0.5;
			var	w,h,x,y,scale,item,sinVal;
			
			var	change = (this.destRotation - this.rotation);				
			var	absChange = Math.abs(change);
	
			this.rotation += change * options.speed;
			if ( absChange < 0.001 ) { this.rotation = this.destRotation; }			
			var	itemsLen = items.length;
			var	spacing = (Math.PI / itemsLen) * 2; 
			//var	wrapStyle = null;
			var	radians = this.rotation;
			var	isMSIE = $.browser.msie;
		
			// Turn off display. This can reduce repaints/reflows when making style and position changes in the loop.
			// See http://dev.opera.com/articles/view/efficient-javascript/?page=3			
			this.innerWrapper.style.display = 'none';		
			
			var	style;
			var	px = 'px', reflHeight;	
			var context = this;
			for (var i = 0; i<itemsLen ;i++)
			{
				item = items[i];
								
				sinVal = funcSin(radians);
				
				scale = ((sinVal+1) * smallRange) + minScale;
				
				x = this.xCentre + (( (funcCos(radians) * this.xRadius) - (item.orgWidth*0.5)) * scale);
				y = this.yCentre + (( (sinVal * this.yRadius)  ) * scale);		
		
				if (item.imageOK)
				{
					var	img = item.image;
					w = img.width = item.orgWidth * scale;					
					h = img.height = item.orgHeight * scale;
					img.style.left = x + px ;
					img.style.top = y + px;
					img.style.zIndex = "" + (scale * 100)>>0;	// >>0 = Math.foor(). Firefox doesn't like fractional decimals in z-index.
					if (item.reflection !== null)
					{																										
						reflHeight = options.reflHeight * scale;						
						style = item.reflection.element.style;
						style.left = x + px;
						style.top = y + h + options.reflGap * scale + px;
						style.width = w + px;								
						if (isMSIE)
						{											
							style.filter.finishy = (reflHeight / h * 100);				
						}else
						{								
							style.height = reflHeight + px;															
						}																													
					}					
				}
				radians += spacing;
			}
			// Turn display back on.					
			this.innerWrapper.style.display = 'block';

			// If we have a preceptable change in rotation then loop again next frame.
			if ( absChange >= 0.001 )
			{				
				this.controlTimer = setTimeout( function(){context.updateAll();},this.timeDelay);		
			}else
			{
				// Otherwise just stop completely.				
				this.stop();
			}
		}; // END updateAll		
		
		// Create an Item object for each image	
//		func = function(){return;ctx.updateAll();} ;

		// Check if images have loaded. We need valid widths and heights for the reflections.
		this.checkImagesLoaded = function()
		{
			var	i;
			for(i=0;i<images.length;i++) {
				if ( (images[i].width === undefined) || ( (images[i].complete !== undefined) && (!images[i].complete)  ))
				{
					return;					
				}				
			}
			for(i=0;i<images.length;i++) {				
				 items.push( new Item( images[i], options ) );	
				 $(images[i]).data('itemIndex',i);
			}
			// If all images have valid widths and heights, we can stop checking.			
			clearInterval(this.tt);
			this.showFrontText();
			this.autoRotate();	
			this.updateAll();
			
		};

		this.tt = setInterval( function(){ctx.checkImagesLoaded();},50);	
	}; // END Controller object
	
	// The jQuery plugin part. Iterates through items specified in selector and inits a Controller class for each one.
	$.fn.CloudCarousel = function(options) {
			
		this.each( function() {			
			
			options = $.extend({}, {
							   reflHeight:0,
							   reflOpacity:0.5,
							   reflGap:0,
							   minScale:0.5,
							   xPos:0,
							   yPos:0,
							   xRadius:0,
							   yRadius:0,
							   altBox:null,
							   titleBox:null,
							   FPS: 30,
							   autoRotate: 'no',
							   autoRotateDelay: 1500,
							   speed:0.2,
							   mouseWheel: false,
								 bringToFront: false
			},options );									
			// Create a Controller for each carousel.		
			$(this).data('cloudcarousel', new Controller( this, $('.cloudcarousel',$(this)), options) );
		});				
		return this;
	};

})(jQuery);



/* Mouse wheel scroll para o carrossel 3D */

/*! 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+
 */
var $ = jQuery.noConflict();

(function($) {

var types = ['DOMMouseScroll', 'mousewheel'];

$.event.special.mousewheel = {
	setup: function() {
		if ( this.addEventListener )
			for ( var i=types.length; i; )
				this.addEventListener( types[--i], handler, false );
		else
			this.onmousewheel = handler;
	},
	
	teardown: function() {
		if ( this.removeEventListener )
			for ( var i=types.length; i; )
				this.removeEventListener( types[--i], handler, false );
		else
			this.onmousewheel = null;
	}
};

$.fn.extend({
	mousewheel: function(fn) {
		return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
	},
	
	unmousewheel: function(fn) {
		return this.unbind("mousewheel", fn);
	}
});


function handler(event) {
	var args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true;
	
	event = $.event.fix(event || window.event);
	event.type = "mousewheel";
	
	if ( event.wheelDelta ) delta = event.wheelDelta/120;
	if ( event.detail     ) delta = -event.detail/3;
	
	// Add events and delta to the front of the arguments
	args.unshift(event, delta);

	return $.event.handle.apply(this, args);
}

})(jQuery);



/* Start do carrossel */

var $ = jQuery.noConflict();

$(document).ready(function(){
						   
	// This initialises carousels on the container elements specified, in this case, carousel1.
	$("#carousel1").CloudCarousel(		
		{			
			xPos: 355,
			yPos: 10,
			buttonLeft: $("#left-but"),
			buttonRight: $("#right-but"),
			altBox: $("#alt-text"),
			titleBox: $("#title-text"),
			mouseWheel: true,
			speed: 0.2,
			reflOpacity: 0.1,
			reflGap: 5,
			minScale: 0.1,
			xRadius: 400,
			yRadius: 50,
			reflHeight: 0
			
		}
	);
});
 

/* FIM DO CARROSSEL 3D */

/* INÍCIO FUNÇÃO JORNAL CARREGAR EDIÇÃO ATUAL */

function jornal_exibir_edicao_atual() {
$('.view-display-id-bloco_exibir_edicao_atual a').click(function(){ 
document.location.assign($(".view-display-id-bloco_exibir_edicao_atual a").attr("href"));  
});
$('.view-display-id-bloco_exibir_edicao_atual a').trigger("click");
}

/* FIM FUNÇÃO JORNAL CARREGAR EDIÇÃO ATUAL */


/* INÍCIO FUNÇÃO ESCONDER TITULO */

function esconde_titulo() {
$("#main .title").css("display", "none");
}

/* FIM FUNÇÃO ESCONDER TITULO */

/* INÍCIO DO MENU JORNAL */
var $ = jQuery.noConflict();

function jornal_capa() {
$(".jornal_menu_botao").removeClass("jornal_menu_active");
$(".jornal_menu_botao#jornal_capa").removeClass("jornal_menu_deactive");
$(".jornal_menu_botao#jornal_capa").addClass("jornal_menu_active");
$(".field-name-field-jornal-edicao-capa").fadeIn(1000);

$(".field-name-field-jornal-edicao-capa").css("display", "block");
$(".field-name-field-jornal-edicao-editorial").css("display", "none");
$(".field-name-field-jornal-edicao-papa").css("display", "none");
$(".field-name-field-jornal-edicao-vocepergunta").css("display", "none");
$(".field-name-field-jornal-edicao-encontro").css("display", "none");
}
function jornal_editorial() {
$(".jornal_menu_botao").removeClass("jornal_menu_active");
$(".jornal_menu_botao#jornal_editorial").removeClass("jornal_menu_deactive");
$(".jornal_menu_botao#jornal_editorial").addClass("jornal_menu_active");
$(".field-name-field-jornal-edicao-editorial").fadeIn(1000);

$(".field-name-field-jornal-edicao-capa").css("display", "none");
$(".field-name-field-jornal-edicao-editorial").css("display", "block");
$(".field-name-field-jornal-edicao-papa").css("display", "none");
$(".field-name-field-jornal-edicao-vocepergunta").css("display", "none");
$(".field-name-field-jornal-edicao-encontro").css("display", "none");
}
function jornal_palavra_do_papa() {
$(".jornal_menu_botao").removeClass("jornal_menu_active");
$(".jornal_menu_botao#jornal_palavra_do_papa").removeClass("jornal_menu_deactive");
$(".jornal_menu_botao#jornal_palavra_do_papa").addClass("jornal_menu_active");
$(".field-name-field-jornal-edicao-papa").fadeIn(1000);

$(".field-name-field-jornal-edicao-capa").css("display", "none");
$(".field-name-field-jornal-edicao-editorial").css("display", "none");
$(".field-name-field-jornal-edicao-papa").css("display", "block");
$(".field-name-field-jornal-edicao-vocepergunta").css("display", "none");
$(".field-name-field-jornal-edicao-encontro").css("display", "none");
}
function jornal_voce_pergunta() {
$(".jornal_menu_botao").removeClass("jornal_menu_active");
$(".jornal_menu_botao#jornal_voce_pergunta").removeClass("jornal_menu_deactive");
$(".jornal_menu_botao#jornal_voce_pergunta").addClass("jornal_menu_active");
$(".field-name-field-jornal-edicao-vocepergunta").fadeIn(1000);

$(".field-name-field-jornal-edicao-capa").css("display", "none");
$(".field-name-field-jornal-edicao-editorial").css("display", "none");
$(".field-name-field-jornal-edicao-papa").css("display", "none");
$(".field-name-field-jornal-edicao-vocepergunta").css("display", "block");
$(".field-name-field-jornal-edicao-encontro").css("display", "none");
}
function jornal_encontro() {
$(".jornal_menu_botao").removeClass("jornal_menu_active");
$(".jornal_menu_botao#jornal_encontro").removeClass("jornal_menu_deactive");
$(".jornal_menu_botao#jornal_encontro").addClass("jornal_menu_active");
$(".field-name-field-jornal-edicao-encontro").fadeIn(1000);

$(".field-name-field-jornal-edicao-capa").css("display", "none");
$(".field-name-field-jornal-edicao-editorial").css("display", "none");
$(".field-name-field-jornal-edicao-papa").css("display", "none");
$(".field-name-field-jornal-edicao-vocepergunta").css("display", "none");
$(".field-name-field-jornal-edicao-encontro").css("display", "block");
}

/* FIM DO MENU JORNAL */

/* INÍCIO DAS TABS JQUERY */

var $ = jQuery.noConflict();

(function($) {

    $.organicTabs = function(el, options) {
    
        var base = this;
        base.$el = $(el);
        base.$nav = base.$el.find(".accordion_nav");
                
        base.init = function() {
        
            base.options = $.extend({},$.organicTabs.defaultOptions, options);
            
            // Accessible hiding fix
            $(".hide").css({
                "position": "relative",
                "top": 0,
                "left": 0,
                "display": "none"
            }); 
            
            base.$nav.delegate("div > a", "click", function() {
            
                // Figure out current list via CSS class
                var curList = base.$el.find("a.current").attr("href").substring(1),
                
                // List moving to
                    $newList = $(this),
                    
                // Figure out ID of new list
                    listID = $newList.attr("href").substring(1),
                
                // Set outer wrapper height to (static) height of current inner list
                    $allListWrap = base.$el.find(".list-wrap"),
                    curListHeight = $allListWrap.height();
                $allListWrap.height(curListHeight);
                                        
                if ((listID != curList) && ( base.$el.find(":animated").length == 0)) {
                                            
                    // Fade out current list
                    base.$el.find("#"+curList).fadeOut(base.options.speed, function() {
                        
                        // Fade in new list on callback
                        base.$el.find("#"+listID).fadeIn(base.options.speed);
                        
                        // Adjust outer wrapper to fit new list snuggly
                        var newHeight = base.$el.find("#"+listID).height();
                        $allListWrap.animate({
                            height: newHeight
                        });
                        
                        // Remove highlighting - Add to just-clicked tab
                        base.$el.find(".accordion_nav div a").removeClass("current");
                        $newList.addClass("current");
                            
                    });
                    
                }   
                
                // Don't behave like a regular link
                // Stop propegation and bubbling
                return false;
            });
            
        };
        base.init();
    };
    
    $.organicTabs.defaultOptions = {
        "speed": 300
    };
    
    $.fn.organicTabs = function(options) {
        return this.each(function() {
            (new $.organicTabs(this, options));
        });
    };
    
})(jQuery);



$(function() {
    
            $("#accordion_tabs").organicTabs({
                "speed": 200
            });
    
});

/* FIM DAS TABS JQUERY */



/* INICIO FONT RESIZER */

var $ = jQuery.noConflict();

$(document).ready(function(){
  var section = new Array('','.region-content'); 
  section = section.join(',');

  // Reset Font Size
  var originalFontSize = $(section).css('font-size');
  $(".resetFont").click(function(){
    $(section).css('font-size', originalFontSize); 
  });

  // Increase Font Size
  $(".increaseFont").click(function(){
    var currentFontSize = $(section).css('font-size');
    var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = currentFontSizeNum*1.2;
    $(section).css('font-size', newFontSize);
    return false;
  });

  // Decrease Font Size
  $(".decreaseFont").click(function(){
    var currentFontSize = $(section).css('font-size');
    var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = currentFontSizeNum*0.8;
    $(section).css('font-size', newFontSize);
    return false;
  });
});

/* FIM FONT RESIZER */


/* INICIO JQUERY ACCORDION */

var $ = jQuery.noConflict();

function initMenuAccordion() {

	$('div[id^="accordion_tab"] .views-field').hide();
	$('.accordion_botao').click(
		function() {
			var checkElement = $(this).next();
			if((checkElement.is('div[id^="accordion_tab"] .views-field')) && (checkElement.is(':visible'))) {
				checkElement.slideUp('fast');
				return false;
			}
			if((checkElement.is('div[id^="accordion_tab"] .views-field')) && (!checkElement.is(':visible'))) {
				$('div[id^="accordion_tab"] .views-field:visible').slideUp('fast');
				checkElement.slideDown('fast');
				return false;
			}
		}
	);
}
$(document).ready(function() {initMenuAccordion();});

 
/* FIM JQUERY ACCORDION */


/* INÍCIO JQUERY SIDEBAR */

/*!
 * Side Bar v1.0.1
 * http://sideroad.secret.jp/
 *
 * Copyright (c) 2009 sideroad
 *
 * Dual licensed under the MIT licenses.
 * Date: 2009-09-01
 */
//Side Bar Plugin

var $ = jQuery.noConflict();

(function($) {
		
	$.fn.sidebar = function(options){
		return this.each(function(){
			options = options || {};
			
			//default setting
			options = $.extend({
				position: "left",
				width: 100,
				height: 200,
				injectWidth: 50,
				liMouseOver: {
					marginLeft: "5px"
				},
				liMouseOut: {
					marginLeft: "0px"
				},
				open : "mouseenter",
				close : "mouseleave"
			}, options);
			var m;
			var icss;
            var ccss = {
                height: options.height,
                width: options.width
            };
			if(options.position == "left" || options.position == "right") {
                m = options.width - options.injectWidth;
				icss = {
					height: options.height,
					width: options.injectWidth
				};
				ccss.top = ($(window).height()/2) - (options.height/2) + "px";
				
			} else {
				m = options.height - options.injectWidth;
                icss = {
                    height: options.injectWidth,
                    width: options.width
                };
                ccss.left = ($(window).width()/2) - (options.width/2) + "px";
			}
			var bcss = {
				height: options.height,
				width: options.width
			};
			var e = {};
			var l = {};
			
			ccss[options.position] = "-" + m + "px";
			icss[options.position] = m + "px";
			e[options.position] = 0;
			l[options.position] = "-" + m;
			
			//container
			var c = $("<div><div/>").attr("id", "jquerySideBar" + new Date().getTime()).addClass("sidebar-container-" + options.position).css(ccss);
			
			//inject
			var i = $("<div><div/>").addClass("sidebar-inject-" + options.position).css(icss);
			
			//body
			var b = $("<div><div/>").addClass("sidebar-body").css(bcss).hide();
			
			//menu events
            var isEnter;
			$(this).addClass("sidebar-menu").find("li,li *").mouseenter(function(){
                if (!isEnter) return;
				$(this).animate(options.liMouseOver, 250);
			}).mouseleave(function(){
				$(this).animate(options.liMouseOut, 250);
			});
			
			//container events
			var isProcessing;
			c.bind(options.open,function(){
				if (isEnter) return;
				if (isProcessing) return;
				isEnter = true;
                isProcessing = true;
				c.animate(e, {
					duration: 200,
					complete: function(){
						i.fadeOut(200, function(){
							b.show("clip", 200,function(){
                                isProcessing = false;
							});
						});
					}
				});
			}).bind(options.close,function(){
				if(!isEnter) return;
				if(isProcessing) return;
				isProcessing = true;
				c.animate(l, {
					duration: 200,
					complete: function(){
						b.hide("clip", 200, function(){
							i.fadeIn(200, function(){
                                isEnter = false;
								isProcessing = false;
							});
						});
					}
				});
			});
			
			//append to body
			b.append(this);
			c.append(b);
			c.append(i);
			$(document.body).append(c);
			$(window).resize(function(){
	            if(options.position == "left" || options.position == "right") {
					c.css({top:($(this).height()/2) - (options.height/2) + "px"});
	            } else {
	                c.css({left:($(this).width()/2) - (options.width/2) + "px"});
	            }
			});
		});
	}
})(jQuery);

/* FIM JQUERY SIDEBAR */



;

