//var ident = null;

// FIX PNG
var blank = new Image();
blank.src = '/imgs/pix.gif';
function fixPng(png) {
	// get src
	var src = png.src;
	// set width and height
	if (!png.style.width) { png.style.width = $(png).width(); }
	if (!png.style.height) { png.style.height = $(png).height(); }
	// replace by blank image
	png.onload = function() { };
	png.src = blank.src;
	// set filter (display original image)
	png.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
}

$(document).ready(function() {
	/* PNGs */
	var badBrowser = (/MSIE ((5\.5)|6)/.test(navigator.userAgent) && navigator.platform == "Win32");
	if (badBrowser) $('img[src$=.png]').each(function() {
		if (!this.complete) this.onload = function() { fixPng(this) };
		else fixPng(this);
	});
});


$(function() {
	/* Inicar o Menu */
	var ident = 0;
	$('#menuHorz a, .subMenuTop').mouseenter(function() {
		clearTimeout(ident);
		if ($(this).parent().is('#menuHorz div')) {
			$('.subMenuTop:not(#menuHorz'+($('#menuHorz a').index(this)+1)+')').slideUp('fast');
			$('#menuHorz'+($('#menuHorz a').index(this)+1)).stop(true,true).slideDown('fast');
		}
	}).mouseleave(function() {
		ident = setTimeout(function() { $('.subMenuTop').slideUp('fast'); },500);
	});
	
	/* Acao click do Menu */	
	$('.menu').click(function() {
			$(this).next().slideToggle('normal');			
	});	
});