﻿winMv = null;

function openWinMv(winUrl){
	winMv = window.open(winUrl, 'winMv', "height=600,width=600,top=150,left=600");
	winMv.opener.blur();
    return winMv;
}


function openWinMv2(winUrl) {
	alert(window.focus);
	alert(document.activeElement);
	// Cas de Opera/Safari : focus n'existe pas donc on ferme la fenetre
	if ((document.activeElement + "").indexOf('undefined') >= 0 ) {
		if (winMv != null && !winMv.closed) {
			winMv.close();
		}
		winMv = window.open(winUrl, 'winMv', "height=600,width=600,top=150,left=600");
		winMv.focus();
	}
	else {

		if (winMv == null || winMv.closed) {
			winMv = window.open(winUrl, 'winMv', "height=600,width=600,top=150,left=600");
		}
		else {
			winMv.location = winUrl;
		}

	    winMv.focus();
	}
	return winMv;
}

function closeWinMv() {
	if (winMv != null) {
		winMv.close();
		winMv = null;
	}
}