
var ie = (document.all) ? true : false;				// True si le navigateur est IE
var ns4 = (document.layers) ? true : false;			// True si le navigateur est NS version < 6
var ns6 = (document.getElementById) ? true : false; // True si le navigateur est NS version 6 (firefox)

function DisplayPopUp( title, url, width, height ) {
	option = "width="+width+",height="+height+",toolbar=no,location=no,menubar=no,status=no,scrollbars=no,resizable=no,alwaysRaised=1,dependent=1";
	w = window.open(url, title, option);
	w.focus();
}

function DisplayScrollablePopUp( title, url, width, height ) {

	option = "width="+width+",height="+height+",toolbar=no,location=no,menubar=no,status=no,scrollbars=yes,resizable=no,alwaysRaised=1,dependent=1,backcolor=black";
	w = window.open(url, title, option);
	w.focus();
}

function DisplayScrollableResizablePopUp( title, url, width, height ) {
	option = "width="+width+",height="+height+",toolbar=no,location=no,menubar=no,status=no,scrollbars=yes,resizable=yes,alwaysRaised=1,dependent=1";
	w = window.open(url, title, option);
	w.focus();
}

function SetDivContent( layer, contenuHtml ) {
   if(ie) document.all[layer].innerHTML = contenuHtml;
   else if(ns4) document.layers[layer].innerHTML = contenuHtml;
   else if(ns6) document.getElementById(layer).innerHTML = contenuHtml;
}

function PortletOpenOrClose( div ) {
	div_id = document.getElementById(div);
	sts = div_id.style.display;
	if( sts == "none" ) {
		div_id.style.display = "inline";
		sts = "Y";
	} else {
		div_id.style.display = "none";
		sts = "N";
	}
	return sts;
}
function stripslashes( str ) {
    return (str+'').replace(/\\(.?)/g, function (s, n1) {
        switch(n1) {
            case '\\':
                return '\\';
            case '0':
                return '\0';
            case '':
                return '';
            default:
                return n1;
        }
    });
}

