var loadingHTML = "

";
var etCom = "&";
var directionMenu = 'h';
var winParam;
function openConfig()
{
constructWinParam('div',"","
" + t_titreWindow,350,350);
trAjax("global_div_Config","/userConfig/genere_infos_xml.php", "/userConfig/config.xsl","post","",true,loadingHTML);
}
function global_Message(contenu,titre,width,height)
{
height = height || 350;
width = width || 350;
if (YAHOO.env.ua.ie>0) {
contenu = contenu.replace(/>/gi,'>');
contenu = contenu.replace(/</gi,'<');
contenu = contenu.replace(/&/gi,'&');
titre = titre.replace(/>/gi,'>');
titre = titre.replace(/</gi,'<');
titre = titre.replace(/&/gi,'&');
}
constructWinParam('div',contenu,titre,width,height);
}
function constructWinParam(type,contenu,titre,width,height)
{
try {
var idDivBrowser = 'global_divConfig';
if ($(idDivBrowser))
$(idDivBrowser).parentNode.removeChild($(idDivBrowser));
winParam = document.createElement('div');
winParam.id = idDivBrowser;
winParam.className = SKIN_PANEL_DEFAULT;
winParam.innerHTML = '';
document.body.appendChild(winParam);
winParam = new YAHOO.widget.Panel(idDivBrowser, {
draggable: true,
fixedcenter:true,
width: width+'px',
height: height+'px',
modal:true,
underlay:'none'
});
winParam.renderEvent.subscribe(function(e){
try {
var panelHeight = this.element.offsetHeight;
var headerHeight = this.header.offsetHeight; // Content + Padding + Border
var footerHeight = this.footer.offsetHeight; // Content + Padding + Border
var bodyHeight = (panelHeight - headerHeight - footerHeight);
var bodyContentHeight = (IE_QUIRKS) ? bodyHeight : bodyHeight - tabPaddingPanel[SKIN_PANEL_DEFAULT];
YAHOO.util.Dom.setStyle(this.body, 'height', bodyContentHeight + 'px');
if (IE_SYNC) {
this.sizeUnderlay();
this.syncIframe();
}
}catch(e){}
});
winParam.render();
winParam.show();
winParam.bringToTop();
winParam.close = winParam.hide;
if (type=='iframe') {
var liframe = document.createElement('iframe');
liframe.height = "100%";
liframe.width = "100%";
liframe.style.width = "100%";
liframe.style.height = "100%";
liframe.style.border = "none";
liframe.src = contenu;
liframe.setAttribute("frameBorder","0px");
winParam.appendToBody(liframe);
}
if (type=='div') {
winParam.setBody(contenu);
}
}
catch(e){
alert("Erreur dans constructWinParam : "+e.message)
}
}
function deconnexion()
{
//document.location.href= "/login/index.php?deconnect=1";
refreshDivLog(true);
}
function openConnexion()
{
constructWinParam('div',"","
" + t_titreWindowConnect,400,300);
trAjax("global_div_Connect","/login/index_xml.php", "/login/login.xsl","post","",true,loadingHTML,function(){
setTimeout(function(){
if ($('global_login')) {
$('global_login').focus();
}
},100);
});
}
function refreshDivLog(deconnect)
{
if ((deconnect!=null)&&(deconnect==true)) deconnect = '1';
else deconnect = '0';
var param = "body=1&template="+template+"&deconnect="+deconnect+"&coeffReduc="+coeffReduc;
setTimeout(function() {
trAjax("global_Header","/accueil/genere_Menu.php", "/accueil/header.xsl","post",param,true);
},0);
try{winParam.destroy();}catch(e){}
}
function closeWinParam()
{
try{winParam.close();}catch(e){}
}
function returnParamSousMenu(modeMenu,idMenu)
{
return "modeMenu="+modeMenu+"&idMenu="+idMenu;
}
function createDivInside(idDiv,Label)
{
return ""+Label+"
";
}
function tester_footer(fen)
{
return;
var hauteurFinWin = fen.getSize().height + fen.getPosition().top;
var hauteurDebFooter = document.body.scrollHeight - $('global_Footer').offsetHeight;
if (hauteurFinWin>=hauteurDebFooter)
document.getElementsByTagName('body')[0].style.height = hauteurDebFooter + $('global_Footer').offsetHeight + $('global_Footer').offsetHeight;
else
document.getElementsByTagName('body')[0].style.height = hauteurFinWin + $('global_Footer').offsetHeight;
}
function chargePage(idWebAreaTmp)
{
var url = new String(window.document.location);
if (url.toLowerCase().search('/admin/') != -1) {
window.document.location.href = '/index.php?idWebAreaToLoad='+idWebAreaTmp;
return;
}
for (var i=0; i!= tabWidget.length; i++) {
//tabWidget[i].panel.element.parentNode.removeChild(tabWidget[i].panel.element);
tabWidget[i].panel.destroy();
}
tabWidget = new Array();
largeurBody = document.body.offsetWidth;
nbWinRow = 0;
nbRow = 0;
debutWinX = 0;
debutWinY = 0;
nbWinMaxRow = 3;
tailleWinX = (300*largeurBody)/1152;
tailleWinY = (300*largeurBody)/1152;
espaceMinX = (50*largeurBody)/1152;
espaceMinY = (20*largeurBody)/1152;
espaceFenY = (50*largeurBody)/1152;
espaceFenX = (50*largeurBody)/1152;
espaceFenY = (60*largeurBody)/1152;
espaceHaut = (20*largeurBody)/1152;
idWebArea = idWebAreaTmp;
trAjax("global_Content","/webarea/index_xml.php", "/webarea/index.xsl","post","idWebArea="+idWebArea+"&urlDoc=/index.php?idWebAreaToLoad="+idWebArea,true,loadingHTML);
}
/*
executeActionOnglet(actionJS,posOnglet)
{
eval(actionJS);
}
*/
var oElementEC;
var aOverlaysEC = [];
// Passer les menus au dessus de tout le reste
function bringToTopMC(oElement) {
if (!oElement) return;
oElementEC = oElement;
try {
var aOverlays = [];
aOverlaysEC = aOverlays;
var Dom = YAHOO.util.Dom;
Dom.getElementsBy(isOverlayElementMC, "DIV", document.body);
aOverlays.sort(compareZIndexDescMC);
var oTopOverlay = aOverlays[0],
nTopZIndex;
if (oTopOverlay) {
nTopZIndex = Dom.getStyle(oTopOverlay, "zIndex");
if (!isNaN(nTopZIndex)) {
var bRequiresBump = false;
if (oTopOverlay != oElement) {
bRequiresBump = true;
} else if (aOverlays.length > 1) {
var nNextZIndex = Dom.getStyle(aOverlays[1], "zIndex");
// Don't rely on DOM order to stack if 2 overlays are at the same zindex.
if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) {
bRequiresBump = true;
}
}
if (bRequiresBump) {
YAHOO.util.Dom.setStyle(oElement, 'zIndex', (parseInt(nTopZIndex, 10) + 2));
}
}
}
}
catch(e){
//alert("Erreur dans bringToTopMC : "+e.message)
}
}
function isOverlayElementMC(p_oElement) {
var Overlay = YAHOO.widget.Overlay;
var Dom = YAHOO.util.Dom;
var oOverlay = Dom.hasClass(p_oElement, Overlay.CSS_OVERLAY);
var Panel = YAHOO.widget.Panel;
if (oOverlay && !Dom.isAncestor(oElementEC, oOverlay)) {
if (Panel && Dom.hasClass(p_oElement, Panel.CSS_PANEL)) {
aOverlaysEC[aOverlaysEC.length] = p_oElement.parentNode;
} else {
aOverlaysEC[aOverlaysEC.length] = p_oElement;
}
}
}
function compareZIndexDescMC(p_oOverlay1, p_oOverlay2) {
var Dom = YAHOO.util.Dom;
var sZIndex1 = Dom.getStyle(p_oOverlay1, "zIndex"),
sZIndex2 = Dom.getStyle(p_oOverlay2, "zIndex"),
nZIndex1 = (!sZIndex1 || isNaN(sZIndex1)) ? 0 : parseInt(sZIndex1, 10),
nZIndex2 = (!sZIndex2 || isNaN(sZIndex2)) ? 0 : parseInt(sZIndex2, 10);
if (nZIndex1 > nZIndex2) {
return -1;
} else if (nZIndex1 < nZIndex2) {
return 1;
} else {
return 0;
}
}