
(function($) {

var ver = '0.01';

var opts = {
	cssAfterOut: { display: 'none' },
	animHide: { width: 0, height: 0, top: 75, left: 95 },
	animShow: { top: 0, left: 20, width: 150, height: 150 },	
	speedOut: 600,
	easeOut: null
};

$.fn.acmhomemenu = function() {

	var divs = $(this).children().get();
	$(divs[0]).css('left', '100px');
	$(divs[0]).click (function() {
		window.location.href = "/consultoria";
	});
	
	$(divs[1]).css('left', '290px');
	$(divs[1]).click (function() {
		window.location.href = "/tecnologias-de-la-informacion";
	});	
	
	$(divs[2]).css('left', '480px');
	$(divs[2]).click (function() {
		window.location.href = "/ingenieria";
	});	

	
	$(this).children().hover (function() {
	
		if (this.flagAnim) {
			return;
		}
	
		this.flagAnim = 1;
		var parent = this;
	
		$(this).find("img").animate (opts.animHide, opts.speedOut, opts.easeOut, function() {
        	$(this).css (opts.cssAfterOut);
   		   	$(this).siblings (".menu-blurb").fadeIn (500, function() {
   		   		if (parent.requestShowImage) {
   		   			$(parent).find(".menu-blurb").fadeOut (500, function() {
   						$(this).siblings("img").show().animate (opts.animShow, opts.speedOut, opts.easeOut, function() {
   		   					parent.requestShowImage = 0;
   		   					parent.flagAnim = 0;   						
   						});
    				});
   		   		} else {
   		   			parent.flagAnim = 0;
   		   		}
   		   	});
    	});
    	
   	}, function() {
   		var parent = this;
   		if (this.flagAnim) {
   			this.requestShowImage = 1;
   			return;
   		}
   		$(this).find(".menu-blurb").fadeOut (500, function() {
   			$(this).siblings("img").show().animate (opts.animShow, opts.speedOut, opts.easeOut);
    	});
   	});
};

})(jQuery);


