

<!--
/******************************************
    Librairie
******************************************/

var InternetExplorer= navigator.appName.indexOf ("Microsoft") !=-1; // verif du navigateur
var Version = parseInt(navigator.appVersion);
var TheWindow;

if(navigator.userAgent.indexOf('Win') != -1) {// verif de la plateforme
    var isPC=1;
}// PC
else if ((navigator.userAgent.indexOf('Mac') != -1) && InternetExplorer) {// MAc IE
    var isPC=0; 
}
else if ((navigator.userAgent.indexOf('Mac') != -1) && !InternetExplorer) {//MAc NETSCAPE
     var isPC=0; 
}
else {// on sait pas
    var isPC=1; 
}


/**** Open window ****/
function openwindow(theurl,winname,theWidth,theHeight,theScroll){

if (TheWindow && !TheWindow.closed) { 
	TheWindow.close();
	TheWindow = null;
}

if (theScroll) {
	if (InternetExplorer && !isPC){
		theWidth=theWidth;
	}else{
		theWidth=eval(theWidth+16);
	}
}
winfeatures="height="+theHeight+",width="+theWidth+",status=0,toolbar=0,scrollbars="+theScroll+",top=0,left=0,screenX=0,screenY=0,resizable=0";
TheWindow = window.open(theurl,winname,winfeatures);
TheWindow.focus();
}

function openwindowext(theurl,winname,theWidth,theHeight,theScroll,theX,theY){
if (TheWindow && !TheWindow.closed) {TheWindow.document.close(); TheWindow = null;}
if (theScroll) {
	if (InternetExplorer && !isPC){
		theWidth=theWidth;
	}else{
		theWidth=eval(theWidth+16);
	}
}
winfeatures="height="+theHeight+",width="+theWidth+",status=0,toolbar=0,scrollbars="+theScroll+",top="+theY+",left="+theX+",screenX=0,screenY=0,resizable=0";
TheWindow = window.open(theurl,winname,winfeatures);
TheWindow.focus();
}

function CloseWindowOpen()
{
if (TheWindow && !TheWindow.closed) { 
	TheWindow.close();
	TheWindow = null;
}
}

/**** Gestion des Rollovers ****/
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.0
  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 && document.getElementById) x=document.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_swapImage2() { //v3.0
var i,j=0,x,a=MM_swapImage2.arguments;

for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null) {
   		x.src=a[i+2];
   		x.alt = a[i+1];
   }
}


function check_mail(field_email) {
src = field_email;

s=src.value.replace(/[^A-Za-z0-9\.@-]/g, "");
s=s.replace(/\s|\_/g,"");
src.value=s;
lg=s.length;
at=s.indexOf('@');
pt=s.lastIndexOf('.');
e=(s.length < 10 | s.length >80 | at==-1 | pt==-1 | pt<at | (lg-pt>4) |
(lg-pt<=2) | at<3 | (pt-at<4)) ?true:false;

return (e) ? false : true;
}

function replaceDoublyEscapedSequence ( str ) {
  var arrayUmlautDoublyEscapedChars = new Array ( "&amp;auml;", "&amp;Auml;", "&amp;ouml;", "&amp;Ouml;", "&amp;uuml;", "&amp;Uuml;", "&amp;szlig;" );
  var arrayUmlautChars = new Array ( "\344", "\304", "\366", "\326", "\374", "\334", "\337" );

  return replaceEscapedSequences( str, arrayUmlautDoublyEscapedChars, arrayUmlautChars);
}

function replaceEscapedSequence ( str ) {
  var arrayUmlautEscapedChars = new Array ( "&auml;", "&Auml;", "&ouml;", "&Ouml;", "&uuml;", "&Uuml;", "&szlig;" );
  var arrayUmlautChars = new Array ( "\344", "\304", "\366", "\326", "\374", "\334", "\337" );

  return replaceEscapedSequences( str, arrayUmlautEscapedChars, arrayUmlautChars);
}

function replaceEscapedSequences ( str, escapedArray, octalArray ) {
  //takes a string as input and replaces HTML escape codes of the form &; with the corresponding
  //character value this is because the javascript functions natively show the text and do not interpret
  //the escape sequences.
  
  //arrayUmlautChars = new Array ( 'ä', 'Ä', 'ö', 'Ö', 'ü', 'Ü', 'ß' ) ;
  //var arrayUmlautEscapeChars = new Array ( "&auml;", "&Auml;", "&ouml;", "&Ouml;", "&uuml;", "&Uuml;", "&szlig;" );
  //var arrayUmlautChars = new Array ( "\344", "\304", "\366", "\326", "\374", "\334", "\337" );
  var arrayUmlautEscapeChars = escapedArray;
  var arrayUmlautChars = octalArray;

  var finalString;
  var holdString = str;

  // Check each string for the umlaut escape sequence and replace with the relevant character if found.
  for ( i=0; i < arrayUmlautEscapeChars.length; i++)
  {
  	var searchString = new String ( arrayUmlautEscapeChars [i] );
	var regExpr = /searchString/;
	replaceStr = new String ( arrayUmlautChars [i] );

        var indexPos = -2;
	found = 0;

	var tempString = holdString;	
	//Stores the intermediates state of the string as it being processed. This will be come the final string
	//to return to the user.
	finalString = holdString;

	holdString = "";

	// Repeat until no more umlaut escape sequences are found in the string
	while ( indexPos != -1 )
	{	
		indexPos = tempString.search ( searchString );

		// Process the original string and replace the character found in indexPos
		if ( indexPos != -1 )
		{ 
			found ++;
			if ( indexPos > 0)
			{ 
				holdString += tempString.substring ( 0, indexPos );			
			}
			holdString += replaceStr;
			tempString = tempString.substring ( ( indexPos + searchString.length ), tempString.length ); 
		}
		else 
		{
			// If the umlaut escape sequence was found then process the remainder of the string 
		  	if ( found > 0) 
		  	{
		 		holdString += tempString.substring ( 0, tempString.length);
		  	}
		  	else 
		 	{	
		 		//Here no matches were found so take a copy of the original string
				holdString = tempString;
		 	}
			//Reset the found variable to zero
	 	 	found = 0;
		} //endif
	} //endwhile
  } //endfor 
  finalString =  holdString;
  return finalString;
}

function open_video(num) {
	openwindow('video.php?num='+num,'lido',320,256,0);
}


function open_music() {
	openwindow('music_bonheur.php','lido',320,110,0);
}

//-->

