// JavaScript Document
var newWin = null;
function closeWin(){
	if (newWin != null){
		if(!newWin.closed)
		newWin.close();
	}
}
function PopUp(URL, typeFenetre) {
	closeWin();
	switch(typeFenetre) {
		case'IMG':
			newWin = window.open(URL, "Frank", "toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no, top=0, left=100, width=640, height=640");
			break;
		case'IMG2':
			newWin = window.open(URL, "Frank", "toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no, top=0, left=100, width=440, height=440");
			break;
		case'IMG3':
			newWin = window.open(URL, "Frank", "toolbar=no, location=no, status=no, menubar=no, scrollbars=yes, resizable=no, top=0, left=100, width=840, height=600");
			break;	
		case'IMG4':
			newWin = window.open(URL, "Frank", "toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no, top=0, left=100, width=800, height=600");
			break;			
		case'PLANCHE':
			newWin = window.open(URL, "Frank", "toolbar=no, location=no, status=no, menubar=no, scrollbars=yes, resizable=no, top=0, left=100, width=840, height=600");
			break;
		case'FULL':
			hauteur = screen.height * 0.9;
			largeur = screen.width * 0.9;
			//hauteur = 0.9 * screen.height;
			//largeur = 0.9 * screen.height * (1024 / 768)-20;
			gauche = (screen.width -  largeur) / 2;
			newWin = window.open(URL, "Frank", "toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=yes, top=0, left="+gauche+", width="+largeur+", height="+hauteur+"");
			break;
		case'ELAN':
			newWin = window.open(URL, "Frank", "toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no, top=0, left=25, width=750, height=440");
			break;
		case'VIDEO':
			hauteur = 480;
			largeur = 640;
			haut = (screen.height -  hauteur) / 2;
			gauche = (screen.width -  largeur) / 2;
			newWin = window.open(URL, "Frank", "toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no, top="+haut+", left="+gauche+", width="+largeur+", height="+hauteur+"");
			break;
		case'VIDEO2':
			hauteur = 350;
			largeur = 450;
			haut = (screen.height -  hauteur) / 2;
			gauche = (screen.width -  largeur) / 2;
			newWin = window.open(URL, "Frank", "toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no, top="+haut+", left="+gauche+", width="+largeur+", height="+hauteur+"");
			break;

		default:
			newWin = window.open(URL, "Frank", "toolbar=no, location=no, status=no, menubar=no, scrollbars=yes, resizable=yes, top=0, left=100, width=440, height=460");
	}
	newWin.focus();
} 
function PopUp2(URL) {
	closeWin();
	newWin = window.open(URL, "Frank", "toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=yes, top=0, left=100, width=800, height=640");
	newWin.focus();
} 
function openWin(URL, w, h) { 
	//var winprop = "width=" + w + ",height=" + h;
	var winprop = "toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no, top=50, left=100, width=800, height=600";
	openwin = window.open(URL,'',winprop); 	
} 