//fichier JavaScript d'ouverture openIMIN
function openIMIN(adr_serveur , service , url_erreur, url_retour)
{
	var fqdn = "" + _extractFQDN();
	var url_retour2 = "" + url_retour;
	if (url_retour2 == "undefined")
		url_retour2 = "http://" + fqdn + "/";
	window.open(adr_serveur + "/imin_servlets/KmdmQuery?SERVICE=" + service + "&URL_ERREUR=" + url_erreur + "&FQDN=" + fqdn + "&URL_RETOUR=" + url_retour2,"IMIN","menubar=0,resizable=0,scrollbars=no");	
	
}


function _extractFQDN()
{
	var fqdn = "" + window.location;
	if (fqdn.indexOf("file://") != -1)
	{
		fqdn = "page_locale";	
	}
	else
	{
		var position = fqdn.lastIndexOf("://");
		//si on ne trouve pas de ':/', pbm, on renvoi toute l'URL
		if (position == -1)
			return fqdn;
		fqdn = fqdn.substring(position + 3, fqdn.length);
		position=fqdn.indexOf("/");
		fqdn = fqdn.substring(0, position);
	}
	return fqdn;
}
