
/* desactivation selection et click droit */		
	
function disableselect(e){
// return false;
return true;
}

function reEnable(){
return true;
}

//if IE4+
// document.onselectstart=new Function ("return false");
// document.oncontextmenu=new Function ("return false");
document.onselectstart=new Function ("return true");
document.oncontextmenu=new Function ("return true");


//if NS6
if (window.sidebar){
document.onmousedown=disableselect;
document.onmouseup=reEnable;
document.oncontextmenu=disableselect;
}


/* / desactivation */

/* controle de la position de la souris */

function register_position(){

// mouse_x = 0;
// mouse_y = 0;

// document.onmousemove = function(){ position(); }
document.onmousemove = position;


}

function position(evt){

if(!evt) evt = window.event;
mouse_x = evt.clientX;
mouse_y = evt.clientY;
// alert(mouse_x);

} 

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;}

/* / controle de la posirtion de la souris */


function setAlpha(elementId,alpha)
{
	document.getElementById(elementId).style.opacity = alpha / 100;
	/** Test pour notre cher IE */
	if (document.body.filters != undefined)
	{
		document.getElementById(elementId).style.filter = 'alpha(opacity:' + alpha + ')';
	}
}


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);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	

/**************************************** light box pascal *******************************/

function getScrollPosition()
{
	return Array((document.documentElement && document.documentElement.scrollLeft) || window.pageXOffset || self.pageXOffset || document.body.scrollLeft,(document.documentElement && document.documentElement.scrollTop) || window.pageYOffset || self.pageYOffset || document.body.scrollTop);
}


function lightclip(IdClip, TypeDisp, DimH, DimW){

	document.getElementById('ClipFront_'+IdClip).style.display = TypeDisp;
	document.getElementById('ClipFront_'+IdClip).style.height = DimH + 'px';
	document.getElementById('ClipFront_'+IdClip).style.width = DimW + 'px';
	document.body.scrollTop = "0px";
	document.documentElement.scrollTop = "0px";

	if(TypeDisp == "block" ) { 
	
	TypeDispOp = "none"; 
	document.getElementById('ClipBack').style.display = "block";
	
	}else{ 
	
	TypeDispOp = "block"; 
	document.getElementById('ClipBack').style.display = "none";
	
	}
	
	 document.getElementById('ClipFront_'+IdClip).style.opacity = 0;
     document.getElementById('ClipFront_'+IdClip).style.filter = "alpha(opacity=" + (0) + ")";
			 
	setTimeout("animationClipLight('0', '"+IdClip+"', '"+DimH+"', '"+DimW+"')",1);

			 
}

function lightclip_(IdClip, TypeDisp, DimH, DimW){

	document.getElementById('ClipFront_'+IdClip).style.display = TypeDisp;
	document.getElementById('ClipFront_'+IdClip).style.height = DimH + 'px';
	document.getElementById('ClipFront_'+IdClip).style.width = DimW + 'px';
	document.body.scrollTop = "0px";
	document.documentElement.scrollTop = "0px";

	if(TypeDisp == "block" ) { 
	
	TypeDispOp = "none"; 
	document.getElementById('ClipBack').style.display = "block";
	
	}else{ 
	
	TypeDispOp = "block"; 
	document.getElementById('ClipBack').style.display = "none";
	
	}
	

			 
}

function lightclose(IdClip, TypeDisp){

	document.getElementById('ClipFront_'+IdClip).style.display = TypeDisp;
	
	TypeDispOp = "block";  
	document.getElementById('ClipBack').style.display = "none";
	
	
}


function animationClipLight (x, IdClip, DimH, DimW) {
			
	 var hauteur_ecran;
	 var largeur_ecran;

	 
	hauteur_ecran = document.documentElement.clientHeight;
	largeur_ecran = document.documentElement.clientWidth;


	 largeur_ecran_ideal = ((largeur_ecran-DimW)/2);
	 
	 if(hauteur_ecran <= 800){
		hauteur_ecran_ideal = ((hauteur_ecran-DimH-100)/2);
	 }else{
		hauteur_ecran_ideal = ((hauteur_ecran-DimH-200)/2);
	 }


	document.getElementById("ClipFront_"+IdClip).style.left = (largeur_ecran_ideal-(x*0)-5) + "px";
	document.getElementById("ClipFront_"+IdClip).style.top = (hauteur_ecran_ideal) + "px";
	 
	document.getElementById('ClipFront_'+IdClip).style.opacity = x*0.1;
	document.getElementById('ClipFront_'+IdClip).style.filter = "alpha(opacity=" + (x*20) + ")";


	if (x < 10) {
			   var appelSuivant = 'animationClipLight(' + (x+1) +', '+IdClip+', '+DimH+', '+DimW+')';
			   setTimeout(appelSuivant, 50);
		
	 }	

}



function lightclipWysy(IdClip, TypeDisp, DimH, DimW){

	document.getElementById('ClipFront_'+IdClip).style.display = TypeDisp;
	document.getElementById('ClipFront_'+IdClip).style.height = DimH + 'px';
	document.getElementById('ClipFront_'+IdClip).style.width = DimW + 'px';
	document.body.scrollTop = "0px";
	document.documentElement.scrollTop = "0px";

	if(TypeDisp == "block" ) { 
	
	TypeDispOp = "none"; 
	document.getElementById('ClipBackHome').style.display = "block";
	
	}else{ 
	
	TypeDispOp = "block"; 
	document.getElementById('ClipBackHome').style.display = "none";
	
	}
 
}

function lightcloseWysy(IdClip, TypeDisp){

	document.getElementById('ClipFront_'+IdClip).style.display = TypeDisp;
	
	TypeDispOp = "block"; 
	document.getElementById('ClipBackHome').style.display = "none";
	
	
}


function openApp(dossier, nom_app, box_height, box_width, option){

	req = control_httprequest();
	req.open('GET', dossier + nom_app , false);
    req.send(null);
	
	document.getElementById(option).innerHTML = req.responseText;
	
	//appel de la box
	option == "load_fl" ? lightclip('1', 'block', box_height, box_width) : "";
	
}


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

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







