/* Atico Estudio 2008 */

var idOpen="#Inicio";
var numMsg=0;
var idMsg=1;

/* jQuery fadeToggle */
jQuery.fn.fadeToggle = function(speed, easing, callback) {
	return this.animate({opacity: 'toggle'}, speed, easing, callback);
}

ver = function(el) {
	if("#"+el!=idOpen) {
		$(idOpen).hide();
		idOpen="#"+el;
		$(idOpen).fadeToggle("normal");
	}
}

/* main */
$(function() {
	$("DIV.mainMenuItem").hover(function() {
	  $(this).animate({"left": "+=10px"}, "fast");
	}, function() {
	  $(this).animate({"left": "-=10px"}, "fast");
	});
	
	$("DIV.marco[id!=Atencion]").hover(function() {
	  $(this).animate({backgroundColor: "#fff"}, "fast");
	  $(this).find("div.destacado").animate({left: "+=15px"}, "fast");
	}, function() {
	  $(this).animate({backgroundColor: "#d2d2d2"}, "fast");
	  $(this).find("div.destacado").animate({left: "-=15px"}, "fast");
	});
	
	$("div.divCargos").click(function() {
		$(this).find("table").toggle("normal");
	});
	
	$("#empresaMenu").click(function() {
		$("#empresaSub").toggle("normal");
	});
	
	$("#nuevosMenu").click(function() {
		$("#nuevosSub").toggle("normal");
	});
	
	$("#agentesMenu").click(function() {
		$("#agentesSub").toggle("normal");
	});
	
	$("#cabecera").click(function() {
		ver('Inicio');
	});
	
	$("#marcoEmpresa").click(function() {
		ver('e1');
	});
	
	$("#marcoAgentes").click(function() {
		ver('a7');
	});
	
	$("#marcoNuevosAgentes").click(function() {
		ver('n1');
	});
	
	$("#marcoAccesoPrivado").click(function() {
		ver('a1');
	});

});

