function control_httprequest(){var req = false;if (window.XMLHttpRequest) {try{req = new XMLHttpRequest();} catch (e) {req = false;}} else if(window.ActiveXObject){try{req = new ActiveXObject("Msxml2.XMLHTTP");}catch (e){try{req=new ActiveXObject("Microsoft.XMLHTTP");}catch (e){req = false;}}}return req;}

// function addLoadEvent(func) {
        // var oldonload = window.onload;
        // if (typeof window.onload != 'function') {
                // window.onload = func;
        // }
        // else {
                // window.onload = function() {
                        // oldonload();
                        // func();
                // }
        // }
// }


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// sortir d'un frame pas cool
if (window!=top) { top.location=window.location; }


// POP CENTER

function PopupCentrer(page,largeur,hauteur,options) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  //var top='0';
  //var left='0';
/*  window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options); */
  window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


// FIX PNG

var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

function fixPNG(myImage) 
{
    if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
    {
       var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
	   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
	   var imgTitle = (myImage.title) ? 
		             "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
	   var imgStyle = "display:inline-block;" + myImage.style.cssText
	   var strNewHTML = "<span " + imgID + imgClass + imgTitle
                  + " style=\"" + "width:" + myImage.width 
                  + "px; height:" + myImage.height 
                  + "px;" + imgStyle + ";"
                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
	   myImage.outerHTML = strNewHTML	  
    }
}



						
/*



<div class="vign" >
<a href="javascript:void(0);" class="vign" onClick = "lightclip('1', 'block','400', '600')" >
<img src="mon image.jpg" width="87" height="108"  id="ClipVign_1" /></a>
</div>

<div id="ClipFront_1" class="ClipBoxContent" >

<div><a href="javascript:;" onClick = "lightclose('1', 'none')" style="color:#fff">- fermer -</a></div>

</div>


<div id="ClipBack" class="ClipBoxObscur"></div>


*/
	
	

function clear_champs(id, nom_label){
	
	if(document.getElementById(id).value == nom_label){
	document.getElementById(id).value="";
	}
	
}

function hoverdiv_link(arg, type_color){ document.getElementById(arg).style.color = "#" + type_color; }
function outdiv_link(arg){ document.getElementById(arg).style.color = ""; }


function AlphaPub(arg){
	 // document.getElementById(arg).object.filters.alpha.opacity = "50";
}
	  


function opacity_hover(id, alpha){
	alpha = (!alpha ? 50 : alpha);
	var target = document.getElementById(id);
	document.getElementById(id).style.opacity = (alpha/100);
	target.style.filter = 'alpha(opacity='+alpha+')';
	target.style.display = '';	
}
function opacity_out(id, alpha){
	alpha = (!alpha ? 100 : alpha);
	var target = document.getElementById(id);
	document.getElementById(id).style.opacity = (alpha/100);
	target.style.filter = 'alpha(opacity='+alpha+')';
	target.style.display = '';	
}
	  
function BtOver(arg, act){
	
	arg_tmp = document.getElementById("sm_tmp").value;
	arg_encours = document.getElementById("sm_encours").value;
	
	(arg_tmp.length > 0 ? document.getElementById(arg_tmp).style.visibility = "hidden" : "");
	
	document.getElementById(arg).style.visibility = "visible";
	document.getElementById("sm_tmp").value = arg;	
	
	if(act != arg){ document.getElementById(arg_encours).style.visibility = "hidden"; }
	
	// document.getElementById("debug_menu").innerHTML = arg + " - " + act + " - " + arg_encours;
}

function BtOnClick(arg){ document.getElementById("sm_encours").value = arg; }
  
function BtOut(arg, act){

	arg_encours = document.getElementById("sm_encours").value;
	
	if(act != arg){ 
	
	document.getElementById(arg_encours).style.visibility = "visible";
	document.getElementById(arg).style.visibility = "hidden";
	
	}
	// alert(arg_encours);
	
}


//PLF-http://www.jejavascript.net/
function prechargimg() {
var doc=document;
if(doc.images){ if(!doc.precharg) doc.precharg=new Array();
var i,j=doc.precharg.length,x=prechargimg.arguments; for(i=0; i<x.length; i++)
if (x[i].indexOf("#")!=0){ doc.precharg[j]=new Image; doc.precharg[j++].src=x[i];}}
}
	  

	  
function code_mail(mail_1, mail_2, mail_4, mail_5, mail_7, real, classMail){

	// code_mail("s", "g", "athe", "nium", "fr", "real", "LinkContact");
	
	tg = "<";
	mail_3 = "@";
	mail_6 = ".";
	
	if(real = "real"){
		texte = mail_1+mail_2+mail_3+mail_4+mail_5+mail_6+mail_7;
	}else{
		texte = real;
	}
	
	document.write (tg+"a hr"+"ef=\"mai"+"lto:"+mail_1+mail_2+mail_3+mail_4+mail_5+mail_6+mail_7 + "\"" + "class=\"" + classMail + "\" >" + texte + "<"+"a"+"/>");

}
	

/* switch image */

	function switch_img(dossier, nom_image, idDiv){
	// alert(dossier);
		idDiv == "" ? idDiv = "zone_visuel" : "";
		document.images[idDiv].src = dossier + nom_image +".jpg";
	}
	
	function switch_img_auto(dossier, nom_image, Lib, idDiv){
	// alert(dossier);
		idDiv == "" ? idDiv = "zone_visuel" : "";
		document.images[idDiv].src = dossier + nom_image +"";
		document.getElementById('lib_' + idDiv).innerHTML = Lib;
	}
	
	  



	  
	  
	  
	  
	  
	  





