<!--
var timeout         = 5;
var closetimer		= 5;
var ddmenuitem      = 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 

$(document).ready(function(){ 
	
	// Add the value of "Search..." to the input field
	$("#footer #search").val("Pesquisar");
	
	// When you click on #search
	$(" #footer #search").focus(function(){
		
		// If the value is equal to "Search..."
		if($(this).val() == "Pesquisar") {
			// remove all the text
			$(this).val("");	
		}
		
	});
	
	// When the focus on #search is lost
	$("#footer #search").blur(function(){
		
		// If the input field is empty
		if($(this).val() == "") {
			// Add the text "Search..."
			$(this).val("Pesquisar");	
		}
		
	});
	
	
	
	// Add the value of "Search..." to the input field
	$("#footer_en #search").val("Search");
	
	// When you click on #search
	$("#footer_en #search").focus(function(){
			
		$("#search").addClass('escProcura');
		
		// If the value is equal to "Search..."
		if($(this).val() == "Search") {
			// remove all the text
			$(this).val("");	
		}
		
	});
	
	// When the focus on #search is lost
	$("#footer_en #search").blur(function(){
		
		// If the input field is empty
		if($(this).val() == "") {
			// Add the text "Search..."
			$(this).val("Search");	
		}
		
	});
	
	
	$("#search-submit").hover(function(){
		$(this).addClass("hover");
	});
	
	 $('#nav li').hover(
        function () {
            //show its submenu
            $('ul', this).slideDown(700);
 
        }, 
        function () {
            //hide its submenu
            $('ul', this).slideUp(700);         
        }
    );

	$("#slideshow-tabs").hide();
	
	// remove tabs for missing slideshow images
	$(".banner_slide img").error(function() {
		var anchor = $(this).parent();
		$('#' + anchor.attr('rel')).remove();
		anchor.remove();
	});

	// once all images are loaded, initialize tabs and slideshow
	$(window).load(function() {
		$("#slideshow-tabs").show();
		$("#slideshow-tabs").tabs(".images > div", {effect: "fade", fadeOutSpeed: "slow", rotate: true}).slideshow({autoplay: true, interval: 5000});
	});
	
	//Examples of how to assign the ColorBox event to elements
				$("a[rel='example1']").colorbox({current: "imagem {current} de {total}"});
				$("a[rel='example2']").colorbox({transition:"fade"});
				$("a[rel='example3']").colorbox({transition:"none", width:"75%", height:"75%"});
				$("a[rel='example4']").colorbox({slideshow:true});
				$(".example5").colorbox();
				$(".example6").colorbox({iframe:true, innerWidth:425, innerHeight:344});
				$(".example7").colorbox({width:"80%", height:"80%", iframe:true});
				$(".example8").colorbox({width:"50%", inline:true, href:"#inline_example1"});
				$(".example9").colorbox({
					onOpen:function(){ alert('onOpen: colorbox is about to open'); },
					onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
					onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
					onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
					onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
				});

				//Example of preserving a JavaScript event for inline calls.
				$("#click").click(function(){ 
					$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
					return false;
				});

});


// -->

