var currentMnu = -1;
var paisVisible = false;


$(document).ready( function()
{
        $('a.mnuCLenses').click(function()
        {
                clickMenu(0);
        });
        
        $('a.mnuLCareProd').click(function()
        {
                clickMenu(1);
        });
        
        $('a.mnuMoreWebsites').click(function()
        {
                clickMenu(2);
        });
        
        $('a.linkBanderas').click(function()
        {
                clickMenu(3);
        });
        
        
        $(".header").animate(
        { 
                height: "25px"
        }, 500);
        
        $('div.contactLenses').animate(
        {
                opacity: 0
        }, 500).css("visibility","hidden");
        
        $('div.lensCareProducts').animate(
        {
                opacity: 0
        }, 500).css("visibility","hidden");
        
        $('div.moreWebSites').animate(
        {
                opacity: 0
        }, 500).css("visibility","hidden");
        
        $('div.countries').animate(
        {
                opacity: 0
        }, 500).css("visibility", "hidden");
        
});

function clickMenu(id)
{
        var subM = new Array();
        
        subM[0] = new Array();
        subM[0][0] = $('div.contactLenses');
        subM[0][1] = "85px";
        
        subM[1] = new Array();
        subM[1][0] = $('div.lensCareProducts');
        subM[1][1] = "50px";
        
        subM[2] = new Array();
        subM[2][0] = $('div.moreWebSites');
        subM[2][1] = "68px";
               
        if(currentMnu!=-1 )
        {
                subM[currentMnu][0].animate(
                {
                        opacity: 0
                }, 
                {
                        duration: 500,
                        complete: function()
                        {
                                $(this).css("visibility","hidden");
                        }
                });
        }
        
        if(currentMnu!=id)
        {
                currentMnu = id;
                
                subM[currentMnu][0].animate(
                {
                        opacity: 1.0
                }, 500).css("visibility","visible");
                
                $(".header").animate(
                { 
                        height: subM[currentMnu][1]
                }, 500);
        }
        else
        {
                currentMnu = -1;
                $(".header").animate(
                { 
                        height: "25px"
                }, 500);
        }
}
