/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \
|		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;
}

/********* JS de typo3 *******/
var browserName=navigator.appName;var browserVer=parseInt(navigator.appVersion);var version="";var msie4=(browserName=="Microsoft Internet Explorer"&&browserVer>=4);if((browserName=="Netscape"&&browserVer>=3)||msie4||browserName=="Konqueror"||browserName=="Opera"){version="n3";}else{version="n2";}
function blurLink(theObject){if(msie4){theObject.blur();}}
function decryptCharcode(n,start,end,offset){n=n+offset;if(offset>0&&n>end){n=start+(n-end-1);}else if(offset<0&&n<start){n=end-(start-n-1);}
return String.fromCharCode(n);}
function decryptString(enc,offset){var dec="";var len=enc.length;for(var i=0;i<len;i++){var n=enc.charCodeAt(i);if(n>=0x2B&&n<=0x3A){dec+=decryptCharcode(n,0x2B,0x3A,offset);}else if(n>=0x40&&n<=0x5A){dec+=decryptCharcode(n,0x40,0x5A,offset);}else if(n>=0x61&&n<=0x7A){dec+=decryptCharcode(n,0x61,0x7A,offset);}else{dec+=enc.charAt(i);}}
return dec;}
function linkTo_UnCryptMailto(s){location.href=decryptString(s,5);}


