
/*  modal.js   */

	function show(id) {  
		var x = document.getElementById(id);
		x.style.display = "block";
	}
	function hide(id) {
		var x = document.getElementById(id);
		x.style.display = "none";
	}

	function hideModals() 
	{
		var elements = document.getElementsByClassName('modal');
		for(var i=0, l=elements.length; i<l; i++)
		 	elements[i].style.display = "none" ;
	}

// Initialisation:   CLOSE buttons

	var close_els = document.getElementsByClassName('close');
	for(var i=0, l=close_els.length; i<l; i++) 
	{
		var close_btn = close_els[i];
		close_btn.onclick = function () { 
            hideModals() ;
        };
	}
	
	// When the user clicks anywhere outside of the modal, close it
	window.onclick = function(event) {
	  if (event.target.className == "modal") 
		hideModals() ;
	}

// ==== Toggle to Hide/Show  certains DIV

function toggle(id) {
    var x = document.getElementById(id);
    if (x.style.display === "none") {
        x.style.display = "block";
    } else {
        x.style.display = "none";
    }
}
