// change the div which is visble

	function change_div(target, selection)
		{
		document.getElementById(target).innerHTML = document.getElementById(selection).innerHTML; 
		div = document.getElementById(target); 
		div.style.display = 'block';
		}
		
// show the selected div		
	function show_main(selection)
		{
		div = document.getElementById(edition); div.style.display = 'none';
		div = document.getElementById(selection); div.style.display = 'block';
		edition = selection;
		}
		
// show and mask instructions associated with a form
	function inverse(show, mask)
		{
		document.getElementById(mask).style.display = 'none';
		document.getElementById(show).style.display = 'block';
		}
		
// show and mask instructions associated with a form
	function show_instruction(instruction)
		{
		document.getElementById(instruction).style.display = 'block';
		}	
			
	function mask_instruction(instruction)
		{
		document.getElementById(instruction).style.display = 'none';
		}
		
// show and mask alert box

	function show_alert(message, close)
		{
		if(close == 0){close_button="";} else {close_button='<a class="pointer" onClick="mask_alert()" >Close</a>'}
		
		document.getElementById('alert').innerHTML = '<H1>Message</H1><p>' + message + '</p>' + close_button ; 
		div2 = document.getElementById("alert"); div2.style.display = 'block';
		}
		
	function mask_alert()
		{
		document.getElementById('alert').innerHTML = ""; 
		div2 = document.getElementById("alert"); div2.style.display = 'none';
		}

	
		
// verify if an email is valid

	function valide_email(email)
		{
	     var modele = /^[a-zA-Z0-9\.\-_]+@[a-zA-Z0-9\.\-_]+\.[a-zA-Z]{2,5}$/i;
	     if (modele.test(email))
	        { msg = "";  } else {msg = "Provided email is not valid !";  }		 
	         return msg;
	     }
	     
// mask an email for mailto

function msg(title, name, domain, subject)
	{
		var mailto="<a href=mailto:";
		mailto +=name +  String.fromCharCode(32+32) +domain;
		mailto+="?subject=" + subject;
		mailto+=">";
		mailto+=title;
		mailto+="</a>";
		document.write(mailto);
	}
