function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		home_over = newImage("imagens/home.gif");
		acordos_over = newImage("imagens/acordos.gif");
		faleconosco_over = newImage("imagens/faleconosco.gif");
		links_over = newImage("imagens/links.gif");
		sindicalize_over = newImage("imagens/sindicalize.gif");
		preloadFlag = true;
	}
}

function vinteanos(theURL,winName,features) {
window.open(theURL,winName,features);}

function festa2005(theURL,winName,features) {
window.open(theURL,winName,features);}

function festa2006(theURL,winName,features) {
window.open(theURL,winName,features);}

function campanha2006(theURL,winName,features) {
window.open(theURL,winName,features);}

function festa2007(theURL,winName,features) {
window.open(theURL,winName,features);}

function festa2008(theURL,winName,features) {
window.open(theURL,winName,features);}

function festa2009(theURL,winName,features) {
window.open(theURL,winName,features);}

var menuSelected = "";
var carouselItemList = "";

	$( document ).ready(
		function()
		{
			$( "#slide-image" ).jcarousel(
				{
					wrap: "circular",
					scroll: 1,
					visible: 4,
					size: carouselItemList.length,
					itemVisibleInCallback: {onBeforeAnimation: carouselVisibleIn},
        			itemVisibleOutCallback: {onAfterAnimation: carouselVisibleOut}
				}
			);
			$( "#menu" ).Accordion(
				{
					event: "mouseover",
					active: false,
				    header: ".head",
					showSpeed: "slow",
					hideSpeed: "slow",
					autoheight: true
				}
			).change(
				function( event, newHeader, oldHeader, newContent, oldContent )
				{
					if( $( oldHeader ).is( ".menuAbertoSelected" ) )
					{
						$( oldHeader ).removeClass( "menuAbertoSelected" );
						$( oldHeader ).addClass( "menuFechadoSelected" );
					}
					if( $( newHeader ).is( ".menuFechadoSelected" ) )
					{
						$( newHeader ).removeClass( "menuFechadoSelected" );
						$( newHeader ).addClass( "menuAbertoSelected" );
					}
				}
			);
			
		}
	);