/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \
|		Copyrigth (c) 2004 Smart Agence
|		Webdesign : Smart Agence
|		http://www.smartagence.com/
\ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */


/* Fonction d'agrandissement des images sur les pages du site (agrandissement des captures d'écrans des références)  © TYPO3 */
function openPic(url,winName,winParams) {
		var theWindow = window.open(url,winName,winParams);
		if (theWindow)	{theWindow.focus();}
}

/* Fonction pour le SiteMap */
function RnkFolder(element) {
	var el=document.getElementById(element);
	var es=el.parentNode.style;
	var et=el.parentNode.parentNode.firstChild.style;
	el.parentNode.parentNode.firstChild.blur();
	es.display=es.display=="none"||es.display==""||!es.display?"block":"none";
	et.backgroundImage=et.backgroundImage=="url(../../img/fd_on.gif)"?"url(../../img/fd_off.gif)":"url(../../img/fd_on.gif)";
}

/* Fonction qui permet de crypter les mails */
function UnCryptMailto(s) {//
	var n=0;
	var r="";
	for(var i=0; i < s.length; i++) {
		n=s.charCodeAt(i);
		if (n>=8364) {n = 128;}
		r += String.fromCharCode(n-(3));
	}
	return r;
}

function linkTo_UnCryptMailto(s)	{//
	location.href=UnCryptMailto(s);
}


/* Ajoutés par Rémy pour les légendes */
function $id(sId){
	return document.getElementById(sId);
}

function legendHandler(){
	if(document.getElementById && document.createElement){	// lets pass ONLY modern browsers for DOM manipulation
		var oLegendDiv = $id("legende");
		if(oLegendDiv){	// we do something ONLY if this block does exist
			// hiding the legend block
			oLegendDiv.className = "out_of_screen";

			// creating the "question mark" paragraph, used to show/hide the legend block
			var oQuestionMarkParagraph = document.createElement('p');
			var oLegendLink = document.createElement("a");
			var oLegendImage = document.createElement("img");
			oLegendImage.setAttribute("src","img/icones/legende.gif");
			oLegendImage.setAttribute("alt","L&eacute;gende");
			oLegendLink.appendChild(oLegendImage);
			oQuestionMarkParagraph.appendChild(oLegendLink);
			// inserting it
			$id("infos_header").insertBefore(oQuestionMarkParagraph,$id("infos_header").firstChild);

			oLegendLink.onmouseover = function(){
				oLegendDiv.className = "shown";
			}
			oLegendLink.onmouseout = function(){
				oLegendDiv.className = "out_of_screen";
			}
		}
	}
}



function afficheFlashAccueilSA() {
	var retour = "";

	document.write('<object type="application/x-shockwave-flash" data="media/swf/bandeau_home.swf" width="976" height="200">');
	document.write('<param name="movie" value="media/swf/bandeau_home.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('</object>');

	return retour;
}
