/* *************************************************** */
/* popup interne des pages (affichage PPT) */
/* reprise existant */
/* *************************************************** */


  var divArray = new Array();
  var popup;

function popupPPT(name,pwindow)
  {
    var html;
    
    html = '';
    var htmlDebut;
    var htmlFin;
    var today = new Date();
    now = today.getTime();
    
    htmlDebut = '<html><head><title></title><link rel="stylesheet" href="/aloha/_system/css/styles.css" type="text/css"></head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><div class="couleurBleu" align="center">';
    htmlFin = '</div></body></html>';
    
    // IE
    if (document.all)
    {
      html = document.all(name).innerHTML;
      html = htmlDebut + html + htmlFin;
      pwindow = window.open("","slidePopup" + now,"height=550,width=738,menubar=yes,resizable=no,scrollbars=yes,status=no,toolbar=no,location=no");
      pwindow.document.write(html);
    } // NETSCAPE
    else if (document.layers)
    {
      pwindow = window.open("","slidePopup" + now,"height=580,width=740,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no,location=no");
      pwindow.document.write("");
      pwindow.document.close();
      pwindow.document.open();
      pwindow.document.write(htmlDebut + divArray[name] + htmlFin);
      pwindow.document.close();
    }
  }


/* *************************************************** */
/* menus de gauche  */
/* *************************************************** */

var a;
var enablepersist="off" 
var collapseprevious="yes" 
if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
} 

function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
ccollect[inc++]=alltags[i]
}}
function contractcontent(omit){ 
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit) 
ccollect[inc].style.display="none"
inc++ 
}}
function expandcontent(cid){

if (typeof ccollect!="undefined"){

if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
}} 

function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
} 
function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}}
return returnvalue;
} 
function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
} 
function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
} 
document.cookie=window.location.pathname+"="+selectedItem
} 
function do_onload(){
	uniqueidn=window.location.pathname+"firsttimeload"
	getElementbyClass("switchcontent")
	if (enablepersist=="on" && typeof ccollect!="undefined"){
		document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0" 
		firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
		if (!firsttimeload) 
		revivecontent()

	}
	sUrl = document.location.href;
	if (sUrl.indexOf("finaclub/directioncommerciale/")>0) expandcontent('sc1');
	if (sUrl.indexOf("finaclub/directionservicesclient/")>0) expandcontent('sc2');
	if (sUrl.indexOf("finaclub/recouvrement/")>0) expandcontent('sc3');
	if (sUrl.indexOf("finaclub/pilotagenormesrisques/")>0) expandcontent('sc4');
	if (sUrl.indexOf("finaclub/dsio/")>0) expandcontent('sc5');
	if (sUrl.indexOf("finaclub/bureautique/")>0) expandcontent('sc6');
} 

if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate

function popup() {
			var a;			
			a=window.open( 'pop.htm','pop','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=500,height=500');
		}	
/* Elements 1 à 7 : page d'accueil */		
var IDX1 = 0;	
var IDX2 = 0;	
var IDX3 = 0;	
var IDX4 = 0;	
var IDX5 = 0;	
var IDX6 = 0;	
var IDX7 = 0;

/* Element 8 : fiche personne */		
var IDX8 = 0;
var IDX9 = 0;
 
function ouvre1()
{ if (IDX1 == 0) {ouvretout(); IDX1 ++;  document.getElementById('sc1img').src='../images/commun/gra_moins.gif';			
}else{document.getElementById('sc1img').src='../images/commun/gra_plus.gif'; IDX1 = 0}}
function ouvre2()
{ if (IDX2 == 0) {ouvretout(); IDX2 ++; document.getElementById('sc2img').src='../images/commun/gra_moins.gif';
}else{document.getElementById('sc2img').src='../images/commun/gra_plus.gif'; IDX2 = 0}}
function ouvre3()
{ if (IDX3 == 0) {ouvretout(); IDX3 ++; document.getElementById('sc3img').src='../images/commun/gra_moins_blanc.gif';
}else{document.getElementById('sc3img').src='../images/commun/gra_plus_blanc.gif'; IDX3 = 0}}
function ouvre4()
{ if (IDX4 == 0) { ouvretout(); IDX4 ++; document.getElementById('sc4img').src='../images/commun/gra_moins_blanc.gif';
}else{document.getElementById('sc4img').src='../images/commun/gra_plus_blanc.gif'; IDX4 = 0}}
function ouvre5()
{ if (IDX5 == 0) {ouvretout(); IDX5 ++; document.getElementById('sc5img').src='../images/commun/gra_moins_blanc.gif';
}else{document.getElementById('sc5img').src='../images/commun/gra_plus_blanc.gif'; IDX5 = 0}}
function ouvre6()
{ if (IDX6 == 0) {ouvretout(); IDX6 ++; document.getElementById('sc6img').src='../images/commun/gra_moins_blanc.gif';		
}else{document.getElementById('sc6img').src='../images/commun/gra_plus_blanc.gif'; IDX6 = 0}}	
function ouvre7()
{ if (IDX7 == 0) {ouvretout(); IDX7 ++; document.getElementById('sc7img').src='../images/commun/gra_moins_blanc.gif';		
}else{document.getElementById('sc7img').src='../images/commun/gra_plus_blanc.gif'; IDX7 = 0}}	

// fiche personne
function ouvre8() { 
if (IDX8 == 0) {
	IDX9=0; document.getElementById('sc9img').src='../images/commun/gra_plus.gif';
	IDX8 ++; document.getElementById('sc8img').src='../images/commun/gra_moins.gif';		
}else{
	document.getElementById('sc8img').src='../images/commun/gra_plus.gif'; IDX8 = 0
}}

function ouvre9() { 
    
if (IDX9 == 0) {
	IDX8=0; document.getElementById('sc8img').src='../images/commun/gra_plus.gif';
	IDX9 ++; document.getElementById('sc9img').src='../images/commun/gra_moins.gif';
}else{
	document.getElementById('sc9img').src='../images/commun/gra_plus.gif'; IDX9 = 0
}}	
		
function ouvretout(){
document.getElementById('sc1img').src='../images/commun/gra_plus.gif';
document.getElementById('sc2img').src='../images/commun/gra_plus.gif';
document.getElementById('sc3img').src='../images/commun/gra_plus_blanc.gif';
document.getElementById('sc4img').src='../images/commun/gra_plus_blanc.gif';
document.getElementById('sc5img').src='../images/commun/gra_plus_blanc.gif'; 
document.getElementById('sc6img').src='../images/commun/gra_plus_blanc.gif';
document.getElementById('sc7img').src='../images/commun/gra_plus_blanc.gif';
IDX1 = 0; IDX2 = 0; IDX3 = 0;	IDX4 = 0; IDX5 = 0;	IDX6 = 0; IDX7 = 0; 
}
