//<!--
var FTP="http://10103.m1.gulliver.com/gfm/10103/m";

//********************* POPUP ************************//
var newWin = null;
function closeWin(){
if (newWin != null){
if(!newWin.closed)
newWin.close();
}
}
function popUp(strURL,strType,strHeight,strWidth) {
closeWin();
var strOptions="";
if (strType=="console") strOptions="resizable,scrollbars,height="+strHeight+",width="+strWidth;
if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
newWin = window.open(strURL, 'newWin', strOptions);
newWin.focus();
}
//********************* FIN POPUP ************************//


function Ajax_Js(id)
{
  var fo = document.getElementById(id);
  
  var url = fo.options[ fo.selectedIndex ].value;
  
  if (url == '')
  {
    return false;
  }
  
  Display('loading_form');
  G_change_content ('form_p', main_url, ''+url+'');
  
  return false;

}


function Ajax_Js2(id, id_session)
{
  var fo = document.getElementById(id);
  var selected = fo.options[ fo.selectedIndex ].value;
  
  //var url = 'AJAX=1&FORM=1&EXEC=HOME&ID_SESSION='+id_session+'&CHOICE='+id+'';
  var url = 'AJAX=1&FORM=1&EXEC=HOME&ID_SESSION='+id_session+'&'+id+'='+selected+'';
  
  if (url == '')
  {
    return false;
  }
  
  window.alert(url);
  
  Display('loading_form');
  G_change_content ('form_p', main_url, ''+url+'');
  
  return false;

}

function xGetElementById(e)
{
  if (typeof(e)=='string')
  {
    if (document.getElementById)
    {
      e=document.getElementById(e);
    }
    else if (document.all)
    {
      e=document.all[e];
    }
  }
  else
  {
    e=null;
  }
  return e;
}

function DisplayHide (id)
{ 
  if (document.getElementById(id).style.display == 'block')
  {
    document.getElementById(id).style.display = 'none';
  }
  else
  {
    document.getElementById(id).style.display = 'block';
  }
}

function Display (id)
{
  document.getElementById(id).style.display = 'block';
}
function Hide (id)
{
  document.getElementById(id).style.display = 'none';
}


function hover(obj){
  if(document.all)
  {
    UL = obj.getElementsByTagName('ul');
    
    if(UL.length > 0)
    {
      sousMenu = UL[0].style;
      if(sousMenu.display == 'none' || sousMenu.display == '')
      {
        sousMenu.display = 'block';
        if(obj.className=="level1")
        {
        }
      }
      else
      {
        sousMenu.display = 'none';
        if(obj.className=="level1")
        {
        }
      }
    }
    else
    {
    }
  }
}

function setHover()
{
  LI = document.getElementById('menu').getElementsByTagName('li');
  nLI = LI.length;

  for(i=0; i < nLI; i++){
    LI[i].onmouseover = function()
    {
      //if (document.getElementById && document.getElementById('visite')) 
      //{
      //  document.getElementById('visite').style.display='none';
      //}
      hover(this);
    }
    LI[i].onmouseout = function()
    {
      hover(this);
      //if (document.getElementById && document.getElementById('visite'))
      //{
        //document.getElementById('visite').style.display='block';
      //}
    }
  }
}

/*-----------------------------------------------------------
    Toggles element's display value
    Input: any number of element id's
    Output: none 
    ---------------------------------------------------------*/
function toggleDisp() {
    for (var i=0;i<arguments.length;i++){
        var d = $(arguments[i]);
        if (d.style.display == 'none')
            d.style.display = 'block';
        else
            d.style.display = 'none';
    }
}
/*-----------------------------------------------------------
    Toggles tabs - Closes any open tabs, and then opens current tab
    Input:     1.The number of the current tab
                    2.The number of tabs
                    3.(optional)The number of the tab to leave open
                    4.(optional)Pass in true or false whether or not to animate the open/close of the tabs
    Output: none 
    ---------------------------------------------------------*/
function toggleTab(num,numelems,opennum,animate) {

    animate = false;

    if ($('tabContent'+num).style.display == 'none'){
        for (var i=1;i<=numelems;i++){
            if ((opennum == null) || (opennum != i)){
                var temph = 'tabHeader'+i;
                var h = $(temph);
                if (!h){
                    var h = $('tabHeaderActive');
                    h.id = temph;
                }
                var tempc = 'tabContent'+i;
                var c = $(tempc);
                if(c.style.display != 'none'){
                    if (animate || typeof animate == 'undefined')
                    {
                        Effect.toggle(tempc,'blind',{duration:0.3, queue:{scope:'menus', limit: 3}});
                        //Effect.toggle(tempc,'blind',{duration:0.5, queue:{scope:'menus', limit: 3}});
                    }
                    else
                        toggleDisp(tempc);
                }
            }
        }
        var h = $('tabHeader'+num);
        if (h)
            h.id = 'tabHeaderActive';
        h.blur();
        var c = $('tabContent'+num);
        c.style.marginTop = '2px';
        if (animate || typeof animate == 'undefined')
        {
            Effect.toggle('tabContent'+num,'blind',{duration:0.3, queue:{scope:'menus', position:'end', limit: 3}});
            //Effect.toggle('tabContent'+num,'blind',{duration:0.5, queue:{scope:'menus', position:'end', limit: 3}});
        }
        else{
            toggleDisp('tabContent'+num);
        }
    }
}


//-->
