
	// --- !!!! COMPRESSER LA CLASSE DE CONNEXION !!!! --- //
	var connect = {
		init : function(){
			var _this = this;
			this.strForm = 
				'<style>'+
				'#cms_conn label{margin-left:3px; font-weight:bold; font-family:arial,sans-serif;}'+
				'#cms_conn input{font-size:11px;}'+
				'#cms_conn input[type=button],#cms_conn input[type=submit]{width:80px; background-image:url(__cms/__image/__layout/caption.gif);border:solid 1px #99BBE8;}'+
				'#cms_conn input[type="text"], #cms_conn input[type="password"]{border:solid 1px #99BBE8;}'+
				'</style>'+
				'<form method="POST" action="connexion.php">'+
				'<table id="cms_conn">'+
				'<tr>'+
				'<td><label>utilisateur :</label></td>'+
				'<td><input type="text" name="user" /></td>'+
				'</tr>'+
				'<tr>'+
				'<td><label>mot de passe :</label></td>'+
				'<td><input type="password" name="pass" /></td>'+
				'</tr>'+
				'<tr>'+
				'<td style="text-align:left;"><input id="__connect_bt_quit" type="button" value="annuler" /></td>'+
				'<td style="text-align:right;"><input type="submit" value="entrer" name="connect" /></td>'+
				'</tr>'+
				'</table>'+
				'</form>';
			this.divBg = document.createElement('div');
			this.divForm = document.createElement("div");
			this.divForm.id = "connexion";
			this.divForm.innerHTML = this.strForm;
			document.body.appendChild(this.divBg);
			document.body.appendChild(this.divForm);
			this.divForm.setAttribute(
				'style',
				'border:solid 2px #99BBE8;'+
				'color:#14335C;'+
				'position:absolute;'+
				'background-color:#EBF3FD;'+
				'top:'+(document.documentElement.scrollTop+150)+'px;'+
				'left:50%;'+
				'margin-left:-110px;');
			this.divBg.setAttribute(
				'style',
				'position:absolute;top:0;width:100%;height:'+document.body.offsetHeight+'px;background-color:#000;opacity:.5;');
			document.getElementById('__connect_bt_quit').onclick = function(){ _this.exit(); };
		},
		exit : function(id){
			document.body.removeChild(this.divBg);
			document.body.removeChild(this.divForm);
		}
	};
	// --- !!!! COMPRESSER LA CLASSE DE CONNEXION !!!! --- //
	
	var mootool = {
		start : function(filesArray){
			if(!this.ie){ 
				new navigation('menu','contenu');
				this.mainPlayer(filesArray);
			}
			if(this.ie && this.soundgal){ new iegal(); }
			if(this.ie && document.getElementById('portfolio')){ new portfolio(); }
			if(this.ie && document.getElementById('clip_container')){ new setClipPlayer('clip_container');};
		},
		mainPlayer : function(filesArray){
			var _this = this, f;
			if(cook.readCookie('stop')) f = '';
			else if(cook.readCookie('play')) f = cook.readCookie('play');
			else f = filesArray[1];
			this.insertPlayer(f);
			this.static_player = document.getElementById('staticplayer');
			this.menuSpan = document.getElementById('menu').getElementsByTagName('span');
			this.lastSpan = this.menuSpan[this.menuSpan.length-1];
			this.setSilence = document.createElement('a');
			this.setNoise = document.createElement('a');
			this.setMusic = document.createElement('a');
			
			this.setSilence.innerHTML = 'silence | ';
			this.setNoise.innerHTML = 'noise | ';
			this.setMusic.innerHTML = 'music';
			
			this.setSilence.href = '';
			this.setNoise.href = '';
			this.setMusic.href = '';
			
			this.lastSpan.appendChild(this.setSilence);
			this.lastSpan.appendChild(this.setNoise);
			this.lastSpan.appendChild(this.setMusic);
			
			this.setSilence.onclick = function(){ _this.static_player.sendEvent('STOP') ; cook.writeCookie('stop','1'); return false; };
			this.setNoise.onclick = function(){ _this.static_player.sendEvent('LOAD', filesArray[1]) ; cook.writeCookie('play',filesArray[1]); cook.writeCookie('stop',''); return false; };
			this.setMusic.onclick = function(){ _this.static_player.sendEvent('LOAD', filesArray[0]) ; cook.writeCookie('play',filesArray[0]); cook.writeCookie('stop',''); return false; };
			
		},
		insertPlayer : function(file){
			s1 = new SWFObject('__flvplayer/player.swf','staticplayer','1','1','9','#ffffff');
			s1.addParam('allowfullscreen','false');
			s1.addParam('allowscriptaccess','always');
			s1.addParam('wmode','opaque');
			s1.addParam('flashvars','file='+file+'&autostart=true&repeat=always');
			s1.write(document.getElementById('footer'));
		}
	};
	
	var popupimage = function(chemin,nom,param){
		popupImage = window.open('',nom,param)
		html = '<html>'+
			'<head>'+
			'</head>'+
			'<body leftmargin=0 marginwidth=0 topmargin=0 marginheight=0>'+
			'<img src="'+chemin+'" border=0>'+
			'</body>'+
			'</html>';
		popupImage.document.open();
		popupImage.document.write(html);
		popupImage.document.close();
	};
	
	var setPlayer = function(){
		this.container = document.getElementById('sound_gallery');
		this.playerContainer = this.container.getElementsByTagName('div');
		for(var i=0; i<this.playerContainer.length;i++){
			if(this.playerContainer[i].className == 'player_container')
				this.insertPlayer(this.playerContainer[i],this.playerContainer[i].getAttribute('rel'))
		}
	};
	setPlayer.prototype.insertPlayer = function(element,file){
		var s1 = new SWFObject('__flvplayer/player.swf','ply','100%','20','9','#ffffff');
		s1.addParam('allowfullscreen','false');
		s1.addParam('allowscriptaccess','always');
		s1.addParam('wmode','opaque');
		s1.addParam('flashvars','file='+file);
		s1.write(element);
	};
	
