var emag;

function openEmag() {
/*
	if (exists && emag) {
		emag = window.open("http://canalplus.canal-plus.com/lib/emag.php?site_from=1", 'emag', 'height=586,width=798,scrollbars=no');
	}
*/
	
	if (!emag || emag.closed) {
		emag = window.open("http://canalplus.canal-plus.com/lib/emag.php?site_from=1", 'emag', 'height=592,width=780,scrollbars=no');
	} else {
		emag.focus();
	}
}
function openEmagAuthentification() {

	if (!emag || emag.closed) {
		emag = window.open("http://canalplus.canal-plus.com/lib/emag.php?site_from=1&etape=3", 'emag', 'height=592,width=780,scrollbars=no');
	} else {
		emag.focus();
	}
}
function openEmagChoixPapier() {
	if (!emag || emag.closed) {
		emag = window.open("http://canalplus.canal-plus.com/lib/emag.php?site_from=1&etape=2&msg=8", 'emag', 'height=592,width=780,scrollbars=no');
	} else {
		emag.focus();
	}
}
function openEmagDesinscNews(){
	if (!emag || emag.closed) {
		emag = window.open("http://canalplus.canal-plus.com/lib/emag.php?site_from=1&desinsc_news=1", 'emag', 'height=592,width=780,scrollbars=no');
	} else {
		emag.focus();
	}
}