
//window.onerror = null;

window.onerror=no_error;

function no_error()
{ return true; }


function BoutonDroit()
{
        if((event.button==2)||(event.button==3)||(event.button==4))
                        alert('Ce contenu est protégé');
}
document.onmousedown=BoutonDroit;




function resizeOuterTo(w,h) {
 if (parseInt(navigator.appVersion)>3) {
   if (navigator.appName=="Netscape") {
   
	top.outerWidth=w;
    top.outerHeight=h;
	
	
   }
   else 
   {
   top.moveTo(0,0);
   top.resizeTo(w,h);
   }
   }
}

function init_position_popup(taille,index)
{
if (index==1)		//1= left / 2= top
	{
	return ((screen.width - taille) / 2);
	}
	else
	{
	return ((screen.height - taille) / 2);
	}	

//top = ((screen.height - 570) / 2);
//left =	((screen.width - 596) / 2);
}


//Fonctions audio ------------------
function CLOSE_audio()
	{
	audio.close();
	if (typeof(audio)=="undefined")
		{
		return false;
		}
		else
		{
		audio.close();
		}
	}
function test_if_exist()
	{
	if (typeof(v_audio)=="undefined")
		{
		return false;
		}
		else
		{
		return true;
		}
	}

function test_if_open()
	{
	if (typeof(v_audio)=="undefined")
		{
			return false;
			}
			else
			{
			if  (v_audio.closed)
				{
				return false;
				}
				else
				{
				return true;
				}
		}
}
//--------------------------------



function msg_size(accueil)
{
	//alert(typeof popstr);
	//if (typeof popstr=="undefined")
	
	screenW=screen.width;
	screenH=screen.height;	
	
	
	if(accueil==2)		// on renvois la largeur de l'écran
		{
		return screenW;
		void(0);
		}
		
	if(accueil==3)		// on renvois la hauteur de l'écran
		{
		return screenH;
		void(0);
		}
		
	if (screenW==1024)
		{
		if(accueil==1)
			{
			//document.MargeIMG.height=1;
			//document.MargeIMG.width=111;
			}
			else
			{
			resizeOuterTo(1024,765);
			}
		}
		else
		{
		if (screenW==1152)
			{
				if(accueil==1)
				{
				//document.MargeIMG.height=1;
				//document.MargeIMG.width=175;
				}
				else
				{
				resizeOuterTo(1152,screenH);
				}
			}
			else
			{
			if (screenW==1280)
				{
					if(accueil==1)
					{
					//document.MargeIMG.height=1;
					//document.MargeIMG.width=175;
					}
					else
					{
					resizeOuterTo(1280,screenH);
					}
				}
				else
				{
					if (screenW==800)
						{
							if(accueil==1)
							{
							//document.MargeIMG.height=1;
							//document.MargeIMG.width=111;
							}
							else
							{
							resizeOuterTo(800,600);
							}
						}
				}
			}
		}
		
	

}


function noclic(clic) { 
var msg="Pour toute copie nous contacter merci"; 
if (navigator.appName == 'Netscape' && clic.which==3) { 
alert(msg); 
return false;} 
else 
if (navigator.appName == 'Microsoft Internet Explorer' && 
event.button==2) { 
alert(msg); 
return false; 
} 
return true; 
} 




function pleinEcran()
  {
     window.resizeTo(screen.width+10,screen.height);    //on agrandit la fenetre à la taille de l'écran
     haut=screen.height-parent.document.body.clientHeight;  //calcul de la hauteur des barres d'outils
     window.moveTo (-5,-haut+27) ;  //on place la fenetre pour ne plus voir les barres de l'explorer
     window.resizeTo(screen.width+10,screen.height+haut);  //on agrandit la fenetre de façon à ne voir que la page
     
     if ((document.body.clientHeight > 768 && screen.height == 768)       //Ce test sert dans le cas ou la fenetre ie etait en mode agrandie
      || (document.body.clientHeight > 600 && screen.height == 600) )
  {
  var eccart = parent.document.body.clientHeight - screen.height;
  window.moveTo (-5,-haut+27+eccart);
                window.resizeTo(screen.width+10,screen.height+haut-eccart);
  }
  }






function textdefil(nblignes) {
	document.form1.deftext.value=msg.substring(position,position+73);
	position++;
	if(position == long) position=0;
	setTimeout("textdefil()",150); 
}






function openWindow(theURL,winName,features) { //v2.0
  	fonctionplus = 'copyhistory=false, resizable=false, scrollbars=false, directories=false, status=false';
	features2 = features + fonctionplus;
	window.open(theURL,winName,features2);
}
function openWindowScroll(theURL,winName,features) { //v2.0
  	fonctionplus = 'copyhistory=false, resizable=false, scrollbars=yes, directories=false, status=false';
	features2 = features + fonctionplus;
	window.open(theURL,winName,features2);
}

function getsize(value,mode){
		var sens = mode ;
		var valeur = value ;

		wid = screen.width;
		hit = screen.height;
		
		if (mode == 1){
			marge = (wid - valeur)/2 ;
			}
		else
			{
			marge = ((hit - valeur)/2) -30 ;
			}


		return marge;
}


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_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_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 changer_titre() { //v3.0
   
   }
    
function insert_music() {
document.writeln('<BGSOUND id="BGSOUND_ID" LOOP=1 SRC="silence.mid">');
document.writeln('<EMBED NAME="MUSIC1" SRC="album.mid" LOOP=FALSE AUTOSTART=FALSE HIDDEN=TRUE MASTERSOUND>');
}


function playSound() {
ver=parseInt(navigator.appVersion)
ie4=(ver>3  && navigator.appName!="Netscape")?1:0
ns4=(ver>3  && navigator.appName=="Netscape")?1:0
ns3=(ver==3 && navigator.appName=="Netscape")?1:0

 if (ie4) document.all['BGSOUND_ID'].src='album.mid';
 if ((ns4||ns3)
  && navigator.javaEnabled()
  && navigator.mimeTypes['audio/x-midi']
  && self.document.MUSIC1.IsReady()
 )
 {
  self.document.MUSIC1.play()
 }
}

function stopSound() {
ver=parseInt(navigator.appVersion)
ie4=(ver>3  && navigator.appName!="Netscape")?1:0
ns4=(ver>3  && navigator.appName=="Netscape")?1:0
ns3=(ver==3 && navigator.appName=="Netscape")?1:0

 if (ie4) document.all['BGSOUND_ID'].src='jsilence.mid';
 if ((ns4||ns3)
  && navigator.javaEnabled()
  && navigator.mimeTypes['audio/x-midi']
 )
 {
  self.document.MUSIC1.stop()
 }
}

function MM_controlSound(x, _sndObj, sndFile) { //v3.0
  var i, method = "", sndObj = eval(_sndObj);
  if (sndObj != null) {
    if (navigator.appName == 'Netscape') method = "play";
    else {
      if (window.MM_WMP == null) {
        window.MM_WMP = false;
        for(i in sndObj) if (i == "ActiveMovie") {
          window.MM_WMP = true; break;
      } }
      if (window.MM_WMP) method = "play";
      else if (sndObj.FileName) method = "run";
  } }
  if (method) eval(_sndObj+"."+method+"()");
  else window.location = sndFile;
}






function fond_sonore() {


}


function getsize(value,mode){
		var sens = mode ;
		var valeur = value ;

		wid = screen.width;
		hit = screen.height;
		
		if (mode == 1){
			marge = (wid - valeur)/2 ;
			}
		else
			{
			marge = ((hit - valeur)/2) -30 ;
			}


		return marge;
}





function fond_sonore()
{


}

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();
}



function changecurseur()
{
try {
	if (v6_curseur!="")
		{
		document.body.style.cursor=v6_curseur;
		}
		else
		{
		if (v5_curseur!="")	document.body.style.cursor=v5_curseur;		
		}
	}
catch (e) 
	{
	if (v5_curseur!="")	document.body.style.cursor=v5_curseur;
	}
}

function fond_sonore()
{
if (nav!="ns4" && nav!="ns6")
		{
		if (v7_son!='')
			{
			v7_son= v7_son.slice(4,v7_son.length-1);
			document.all.html_fond_sonore.src=v7_son;
			if (v8_son=='true') 
				{
				document.all.html_fond_sonore.loop=-1;
				}
			}
		}
}


function showFilled(Value) {
  return (Value > 9) ? "" + Value : "0" + Value;
}
function StartClock24() {
  TheTime = new Date;

  document.clock.showTime.value = showFilled(TheTime.getHours()) + ":" + showFilled(TheTime.getMinutes()) + ":" + showFilled(TheTime.getSeconds());
  setTimeout("StartClock24()",1000)
}





