// JavaScript Document

/* ouverture pop in */
function modal(w,h,url){
	if(!document.getElementById('iframe')){ /* empecher la creation de plusieurs fenetres modal */
		var modal = document.createElement('iframe');
		modal.style.height = h+'px';
		modal.style.width = w+'px';
		modal.style.marginLeft = (w/2)*(-1)+'px';
		modal.style.marginTop = (h/2)*(-1)+'px';
		modal.frameBorder=0;
		modal.src = url;
		modal.setAttribute('id','iframe');
		document.body.appendChild(modal);
		
		var backmodal = document.createElement('div');
		backmodal.style.height = (h+10)+'px';
		backmodal.style.width = (w+10)+'px';
		backmodal.style.marginLeft = ((w+10)/2)*(-1)+'px';
		backmodal.style.marginTop = ((h+10)/2)*(-1)+'px';
		backmodal.setAttribute('id','back');
		document.body.appendChild(backmodal);
		}
}

/* fermeture pop in */
function fFH(){
	var elem1 = window.parent.document.getElementById('iframe');
	var elem2 = window.parent.document.getElementById('back');
	(elem1.parentNode).removeChild(elem1);
	(elem2.parentNode).removeChild(elem2);
}