function clickInfo(event, idInfo) {
	//if an element is invisible, make it visible, else make it ivisible
    if(document.getElementById(idInfo).style.opacity == 0) {
        popDownMenu(idInfo, 0, 100, 300, event);
    } else {
        popDownMenu(idInfo, 100, 0, 240, event);
		document.getElementById(idInfo).style.display='none';
    } 		
}	

// THESE TWO FUNCTIONS SHOWS OR HIDES THE MENU AND CHANGES THE OPACITY
//-------------------------------------------------------------------------------------------------------------------

//change the opacity for different browsers
function changeMenuOpacity(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
} 

//-------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------
// This function makes the popdown menu to apper
function popDownMenu(id, opacStart, opacEnd, millisec, event) {
	x=event.clientX;
	y=event.clientY;
	
	// alterning to fit design
	x = x-43;
	y = 30;
	
	var theGalleriesMenu = document.getElementById(id).style;
	theGalleriesMenu.top= y + 'px';
	theGalleriesMenu.left= x + 'px';
	
	theGalleriesMenu.display='block';
	
	//speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeMenuOpacity(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeMenuOpacity(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}





