/*var menu = {	
	itens: {},
	intervalos: {},
	
	init: function(){
		$('a.bt_area').bind('click', menu.abre);//.bind('mouseout', menu.fecha);
		//$('.estrutura').bind('click', menu.fecha);
		$('form.form_corretor').bind('mouseenter', menu.abre);//.bind('mouseleave', menu.fecha);
		$('body').bind('click', menu.fecha);
		return false;
	},
	
	abre: function(e) {
		if (e.target.tagName != 'BODY' && e.target.tagName != 'body') {
			e.preventDefault();
			e.stopPropagation();
		}
		var name = $(this).attr('name');
		$('a.bt_area').addClass('ativo');
		clearInterval(menu.intervalos[name]);
		$('.form_corretor').show();
	},
	
	fecha: function(){
		var name = $(this).attr('name');	
		menu.intervalos[name] = setInterval(function(){
			$('.form_corretor').hide();
			$('a.bt_area').removeClass('ativo');	
		},100);
		return false;
	}	
};*/
var MenuCorretor = {
	
	init: function () {
		$('a.bt_area').click(MenuCorretor.abre);
		$('body').click(MenuCorretor.fecha);
		$('form.form_corretor').click(MenuCorretor.prevent);
		$('form.form_corretor').submit(MenuCorretor.teste);
		//$('form.form_corretor input[type=submit]').click(MenuCorretor.submit);
		//$('form.form_corretor input[type=text]').keydown(MenuCorretor.validateSubmit);
	},
	
	abre: function (e) {
		e.preventDefault();
		e.stopPropagation();
		$(this).addClass('ativo');
		$('form.form_corretor').fadeIn(300);
	},
	
	fecha: function () {
		$('a.bt_area').removeClass('ativo');
		$('form.form_corretor').fadeOut(300);
	},
	
	prevent: function (e) {
		//e.preventDefault();
		e.stopPropagation();
	}
	
};
$(function(){
	$('#corretor').focus(function(){ if ($(this).val() == 'E-mail') $(this).val(''); });
	$('#corretor').blur(function(){ if ($(this).val() == '') $(this).val('E-mail'); });
	$('#senha').focus(function(){ if ($(this).val() == 'Senha') $(this).val(''); });
	$('#senha').blur(function(){ if ($(this).val() == '') $(this).val('Senha'); });
	MenuCorretor.init();
});
