function popfile(type,id) {
	if(type && id) {
		var w = 100;
		var h = 100;
		var t = (screen.height-h)/2;
		var l = (screen.width-w)/2;
		var	option = "location=no,status=yes,resizable=yes,";
		option += "scrollbars=yes,width="+w+",height="+h+",";
		option += "top="+t+",left="+l;
		nw = window.open('apercu.php?type='+type+'&id='+id,'pw',option);
	}
}

function popwin(url,name,w,h,optionlist,align)
{
	if(align == "center")
	{
		t = ((screen.height-h)/2);
		l = ((screen.width-w)/2);
		optionlist += (optionlist != "" ? "," : "")+"top="+t+",left="+l;
	}
	optionlist = optionlist != "" ? ","+optionlist : "";
	eval(name+" = window.open('"+url+"','"+name+"','width="+w+",height="+h+optionlist+"');");
	eval(name+".focus();");
}

function photopop(id) {
	if(id) {
		popwin('pop.php?id='+id,'pop'+id,600,600,'status=no,scrollbars=yes,resizable=yes','center');
	}
}

function affiche(id,type) {
	if(!isNaN(id) && type) {
		window.location.href = 'index.php?page=affiche&type='+type+'&id='+id;
	}
}

function printMe() {
	w		= 700;
	h 		= 580;
	t 	= (screen.height - h)/2;
	l 	= (screen.width - w)/2;
	print_win = window.open('print.php','printed','width='+w+', height='+h+', top='+t+', left='+l+', menubar=no, scrollbars=yes, status=yes, resizable=no');
	print_win.focus();
}

function printprocess() {
	document.getElementById('contentTOprint').innerHTML = '<table border="0">'+opener.document.getElementById('contenu').innerHTML+'</table>';
	document.getElementById('url').innerHTML += '<hr><a class="ariane" href="'+opener.window.location.href+'" target="_blank">'+opener.window.location.href+'</a>';
	document.title = opener.document.title;
	window.print();
}

function sendMe()
{
	w		= 380;
	h 		= 270;
	t 	= (screen.height - h)/2;
	l 	= (screen.width - w)/2;
	window.open('sendP.php','friendwin','width='+w+',height='+h+',top='+t+',left='+l+',status=yes,scrollbars=no,location=no,menubar=no,resizable=no');
}

function checkemail(f) {
	if(f.adresse.value.length == 0 || false) {
		alert("Adresse email saisie incorrecte.");
		return false;
	} else {
		return true;
	}
}