
/*************** AUMENTA / DIMINUIR TEXTO **************/

var tgs = new Array( 'p','div','li','a','h3' );

//Specify spectrum of different font sizes:
/*var szs = new Array( 'xx-small','x-small','small','medium','large','x-large','xx-large' );*/
var szs = new Array( '9px','10px','11px','16px','18px','20px' );
var startSz = 2;

function ts( trgt,inc ) {
if (!document.getElementById) return
var d = document,cEl = null,sz = startSz,i,j,cTags;
sz += inc;
if ( sz < 0 ) sz = 0;
if ( sz > 6 ) sz = 6;
startSz = sz;
if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

cEl.style.fontSize = szs[ sz ];

for ( i = 0; i < tgs.length; i++ ) {
cTags = cEl.getElementsByTagName( tgs[ i ] );
for ( j = 0; j < cTags.length; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
}
}
/**********************************/
function mostraFlash(arquivo, width, height) {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + width + '" height="' + height + '">');
	document.write('<param name="movie" value="' + arquivo + '">');
	document.write('<param name="quality" value="high">');
	document.write('<embed src="' + arquivo + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>');
	document.write('</object>');
}

function mostraFlashTransparente(arquivo, width, height) {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + width + '" height="' + height + '">');
	document.write('<param name="movie" value="' + arquivo + '">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<embed src="' + arquivo + '" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>');
	document.write('</object>');
}

/*jQuery.noConflict();
(function($) { 
  $(function() {
    // more code using $ as alias to jQuery
  });
})(jQuery);
// other code using $ as an alias to the other library*/

$(document).ready(function(){
	var menu = $("#menu-lateral");
	var options = menu.find("h2 a").filter(function(index){
		return ($(this).attr("class") != "link-aberto")
	});
	
	var list = $(".menu-eventos li a");
	
	list.click(function(){
	    if($(this).hasClass("aberto"))
	        return false;
	
	    $.each($(".menu-eventos li a"), function(index, item){
	        $(item).removeClass("aberto");
	    });   
	    
	    $(this).addClass("aberto");
	    
	    var findContentClass = $(this).attr("class").split(" ")[0];
	    
	    if( findContentClass ) {
	        $("div.box-eventos").hide();
	        $("div." + findContentClass).show();
	    }
	    
	    return false;
	});
	
	
		
	options.click(function(){
		var parent = $(this).parent();
		var list = parent.next();
		
		    $.each(parent.parent().find("h2"), function(index, item){
		        var css = $(this).attr("class");		        
		        $(this).attr("class",css.replace("-on","-off"));
		    });		
		    		
		    parent.attr("class",parent.attr("class").replace("-off", "-on"));
			menu.find("ul").filter(function(index){
				return ($(this).attr("class") != "opt-aberto")
			}).slideUp(700);			
			
		if ((list[0].tagName.toLowerCase()) == "ul") {			
			list.slideDown(800);			
		}
		
		return false;
	});
});

function popUp(url,x,y,hasScroll) {
  window.open(url,'popUp','status=yes,resizable=no,width='+x+',height='+y+',scrollbars='+hasScroll);
}

