/*****************************************************************************
'*                                                                           *
'* Fichier     : scripts/base.js                                             *
'* Application : Portail                                                     *
'* Société     : DoubleTrade                                                 *
'* Copyright   : (c) 2007 DoubleTrade                                        *
'* Auteur      : Sébastien Nussbaumer                                        *
'* Créé le     : 16 février 2006                                             *
'*                                                                           *
'* Description :                                                             *
'* Ce fichier javascript contient toutes les fonctions de base appelables    *
'* depuis toute page qui utilise CPageM2                                     *
'*                                                                           *
'****************************************************************************/

function _popup(psURL, psTitle, psWidth, psHeight) {
    window.open(psURL, psTitle, "resizable=1, location=0, scrollbars=1, status=0, menubar=0, dependent, left=10, top=10, height=" + psHeight + ", width=" + psWidth);
    return false;
}

function redirect(pUrl) {
    document.location.href = pUrl;
}

function $(pName) {
    return document.getElementById(pName);
}

function Swap1(pString, pValue) {
    return pString.replace("%1", pValue);
}

function Swap2(pString, pValue1, pValue2) {
    return Swap1(pString, pValue1).replace("%2", pValue2);
}

function Swap3(pString, pValue1, pValue2, pValue3) {
    return Swap2(pString, pValue1, pValue2).replace("%3", pValue3);
}

function SU(pString) {
    return escape(pString);
}

function SH(pString) {
    return pString.toString().replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
}

function SI(pString) {
	return SH(pString);
}

