/* =======================================================================================================
/* Fonction Javascript 
/* =======================================================================================================

/* --------------------------------------------------------------------------------------------
/* Swap between 2 div's and show OR hide them depending on which among the 2 
/* div's is shown or hidden
/*				
/* PREREQUIS : 1)	La structure de l'id/nom des DIV's DOIT ?tre : 
/* 						DIV 1 : id (=param?tre de la fonction) + "_1"  
/* 						DIV 2 : id (=param?tre de la fonction) + "_2"  
/* 						Exemple :
/*							id 		= ft_BATIOA/BATI-118617
/*							DIV 1 	= ft_BATIOA/BATI-118617_1
/*							DIV 2 	= ft_BATIOA/BATI-118617_2
/*
/*				2) 	L'identifiant de l'image sur laquelle on clique pour activer le swap des DIV's 
/*					DOIT avoir la structure suivante : 
/*						"img" + id (=param?tre de la fonction)
/*						Exemple : 
/*							id 	= ft_BATIOA/BATI-118617	
/*							id de l'image = <next:img src="..." id="imgft_BATIOA/BATI-118617" ...>
/*				
/* INPUT : id =	id 'commun' aux 2 DIV's
/*				Exemple : 
/*					id commun = ft_BATIOA/BATI-118617 (cfr. aussi prerequis 1 & 2)
/* OUTPUT : -
/* -------------------------------------------------------------------------------------------- */
function swah(id) { 

	// id de l'icone
	var idImg = id; 
	
	// id des 2 DIV's
	id1 = id + "_1";
	id2 = id + "_2";
	
	if (document.getElementById) { // DOM3 = IE5, NS6
		if (document.getElementById(id1).style.display == "block")
		{
			document.getElementById(id1).style.display = 'none';
			document.getElementById(id2).style.display = 'block';
			filter(("img"+idImg),'imgin');			
		} 
		else 
		{
			filter(("img"+idImg),'imgout');
			document.getElementById(id1).style.display = 'block';			
			document.getElementById(id2).style.display = 'none';			
		}	
	} 
	else 
	{ 
		if (document.layers) 
		{	
			if (document.id1.display == "block")
			{
				document.id1.display = 'none';
				document.id2.display = 'block';
				filter(("img"+idImg),'imgin');
			} 
			else 
			{
				filter(("img"+idImg),'imgout');	
				document.id1.display = 'block';
				document.id2.display = 'none';
			}
		} 
		else 
		{
			if (document.all.id1.style.visibility == "block")
			{
				document.all.id1.style.display = 'none';
				document.all.id2.style.display = 'block';
			} 
			else 
			{
				filter(("img"+idImg),'imgout');
				document.all.id1.style.display = 'block';
				document.all.id2.style.display = 'none';
			}
		}
	}
}


/* ==================================================================================================
/* Faire apparaitre/disparaitre un DIV (collapse expand single item)
/*  
/* collapse expand single item by Leo Charre & Jesse Fergusson
/* Internet Connection  2004 2005 ?
/* www.internetconnection.net
/* 
/* Usage:
/* 
/* place this in your HEAD tags:
/* 
/* 	<script language="JavaScript" src="/WHEREINPATH/collapse_expand_single_item.js"></script>
/* 
/* Place this in your HTML
/* 
/* 	<next:img src="/IMAGESDIR/u.gif" name="imgfirst" width="9" height="9" border="0" >
/* 	<a  href="#first" onClick="shoh('first');" >Customer Support</a>
/* 
/* <div style="display: none;" id="first" >
/* 			
/* 			With its friendly solutions-oriented 
/* 			approach, our timely and knowledgeable Technical Support Staff are 
/* 			completely at your disposal. Our Support Technicians are highly 
/* 			trained on the inner workings of the Internet and its associated 
/* 			technologies. Combined with effective troubleshooting techniques, 
/* 			we can quickly identify and resolve technical issues whether they 
/* 			are on our end or on the client end. 		      
/* 	
/* 	</div>
/* 
/* 
/* WHEREINPATH is where you are storing this script on your account
/* IMAGESDIR is where on your acoount you are storing the icons for (expanded collapsed)
/* ================================================================================================== */

imgout=new Image(9,9);
imgin=new Image(9,9);

/////////////////BEGIN USER EDITABLE///////////////////////////////
	imgout.src="skins/default/images/divers/open.gif";
	imgin.src="skins/default/images/divers/close.gif";
///////////////END USER EDITABLE///////////////////////////////////

/* -------------------------------------
/*  This switches expand collapse icons
/* ------------------------------------- */
function filter(imagename,objectsrc)
{
	if (document.images){
		//document.images[imagename].src=eval(objectsrc+".src");
				if(document.getElementById(imagename))
				{
					document.getElementById(imagename).src=eval(objectsrc+".src");
				}
	}
}

/* --------------------------------------------------------------
/* Show OR hide funtion depends on if element is shown or hidden
/* -------------------------------------------------------------- */
function shoh(id) 
{ 
	if (document.getElementById) { // DOM3 = IE5, NS6
		if (document.getElementById(id).style.display == "none"){
			document.getElementById(id).style.display = 'block';
			filter(("img"+id),'imgin');			
		} else {
			filter(("img"+id),'imgout');
			document.getElementById(id).style.display = 'none';			
		}	
	} else { 
		if (document.layers) {	
			if (document.id.display == "none"){
				document.id.display = 'block';
				filter(("img"+id),'imgin');
			} else {
				filter(("img"+id),'imgout');	
				document.id.display = 'none';
			}
		} else {
			if (document.all.id.style.visibility == "none"){
				document.all.id.style.display = 'block';
			} else {
				filter(("img"+id),'imgout');
				document.all.id.style.display = 'none';
			}
		}
	}
}



