if (typeof popUp == 'undefined') {
	/**
	 * Function: popUp
	 * 
	 * Parameters:
	 *  - String url a appeler
	 *  - String id de la fenetre
	 *  - Number largeur
	 *  - Number hauteur
	 *  - Int 1 pour afficher la scrollbar, sinon 0
	 */	 	 	
	var popUp = function(sUrl, sId, nLargeur, nHauteur, nScrollBar) {	
		var nX = (screen.availWidth) ? Math.round(screen.availWidth/2 - nLargeur/2) : 0;
	  	var nY = (screen.availHeight) ? Math.round(screen.availHeight/2 -nHauteur/2) : 0;
	  	var sOptions = 'width='+nLargeur+', height='+nHauteur+', left='+nX+', top='+nY+', scrollbars='+nScrollBar+', resizable=no';
	  	fenetreFocus = window.open(sUrl, sId, sOptions);
	  	try {
	  		if (fenetreFocus.window.focus) fenetreFocus.window.focus();
	  		return fenetreFocus;
		} catch(e) {} 
	};
}

if (typeof JSClient == 'undefined') {
	/**
	 * Object: JSClient
	 * Recuperation du "innerWidth" et "innerHeight" (initialisation automatique), 
	 * actualisation auto des valeurs lors du redimensionnement du client
	 * 
	 * 	Usage:
	 * 	 JSClient.nLARGEUR pour recuperer la largeur en Number
	 * 	 JSClient.nLARGEUR pour recuperer la hauteur en Number	 
	 */	 
	var JSClient = {INSTANCE:null};
	JSClient.initialise = function() {
		if (JSClient.INSTANCE == null) {
			JSClient.INSTANCE = this;
			JSClient.nLARGEUR = 0;
			JSClient.nHAUTEUR = 0;
			JSClient.actualiseDimensions();
			Event.observe(window, 'resize', function(event) { 
				JSClient.actualiseDimensions(); 
			});
		}
	};
	JSClient.actualiseDimensions = function() {
		if (typeof(window.innerWidth) == 'number') {
		    JSClient.nLARGEUR = window.innerWidth;
		    JSClient.nHAUTEUR = window.innerHeight;
		} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
			// IE 6+ en 'standards compliant mode'
			JSClient.nLARGEUR = document.documentElement.clientWidth;
			JSClient.nHAUTEUR = document.documentElement.clientHeight;
		} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
			// IE 4 compatible
			JSClient.nLARGEUR = document.body.clientWidth;
			JSClient.nHAUTEUR = document.body.clientHeight;
		}
	};
	JSClient.initialise();
}
if (typeof getSO == 'undefined') {
	var getSO = function(swf) {
		if (document[swf]) {
			return document[swf];
		} else if (window[swf]) {
			return window[swf];
		}
	};
}
if (typeof sendEvent == 'undefined') {
	var sendEvent = function(swf, typ, prm) {
		getSO(swf).sendEvent(typ, prm);	
	};
}
var nCharg;
var soBoiteModale;
getUpdate = function(typ, pr1, pr2, swf) {
	var sProp = "", sHtml = "";
	switch (typ) {
	//
	// ===== Evenements natifs
	case 'time' :
		
		break;
	case 'volume' :
		
		break;
	case 'item' :
		
		break;
	case 'state' :
		
		break;
	case 'load' :
		
		break;
	case 'size' :
		
		break;
	case '2exvia_click' :	
		
		
		var oVariables = pr1.evalJSON();
		var nItem = pr2;
		var zoomLargeur = oVariables.zoomWidth || screen.availWidth;
		var zoomHauteur = oVariables.zoomHeight || screen.availHeight;
		var zoomFile = oVariables.zoomFile;
		var zoomConfig = oVariables.zoomConfig;
		// 
		// ===== Memorisation du dernier item selectionne
		var zoomPlayItem = oVariables.nItem;
		
//	console.log(zoomLargeur);
//	console.log(zoomHauteur);
//	console.log(zoomFile);
//	console.log(zoomConfig);
	
	/*
		var oVariables = pr1.evalJSON();
		var nItem = pr2;
		var zoomLargeur = oVariables.zoomWidth || screen.availWidth;
		var zoomHauteur = oVariables.zoomHeight || screen.availHeight;
		var zoomFile = oVariables.zoomFile;
		var zoomConfig = oVariables.zoomConfig;
		// 
		// ===== Memorisation du dernier item selectionne
		var zoomPlayItem = oVariables.nItem;
		
		zoomFile=251;
		zoomConfig='imagerotator5';
		
		if (zoomFile != undefined && zoomConfig != undefined) {
			if (oVariables.javascriptid != undefined) {
				//
				// ===== Mise en pause du player parent
				sendEvent(oVariables.javascriptid, 'playpause');
			}
			//
			// ===== Ouverture du zoom
			popUp('./page_390.php?'
				+'file='+zoomFile
				+'&config='+zoomConfig, 'zoom', zoomLargeur, zoomHauteur, 0);
		}
	*/	
		
		
		
	/*
	
		//
		// ===== Evenement javascript personnalise "click" dispatche par un swf
		var oVariables = pr1.evalJSON();
		var nItem = pr2;
		if (oVariables.javascriptid.indexOf('imagerotator') === 0) {
			sendEvent(oVariables.javascriptid, 'playpause');
			
			//$(oVariables.javascriptid).style.display = 'none';
			
			Modalbox.show('httpservices/swfobject.httpservice.php', {
				title:'Zoom',
				method:'post', 
				params:oVariables,
				width:JSClient.nLARGEUR-200,
				height:JSClient.nHAUTEUR-50,
				overlayOpacity: .4,
				afterLoad:function() {
					var nLargeur = $('MB_window').getDimensions().width-50; 
					var nHauteur = $('MB_window').getDimensions().height-50;
					soBoiteModale = new SWFObject(oVariables.cheminPlayer, 'soBoiteModale', nLargeur, nHauteur, '8');
					soBoiteModale.addParam('allowscriptaccess', 'always');
					soBoiteModale.addParam('wmode', 'transparent');
					soBoiteModale.addVariable('config', oVariables.config);
					soBoiteModale.addVariable('cheminPlayer', oVariables.cheminPlayer);
					soBoiteModale.addVariable('file', oVariables.file);
					soBoiteModale.addVariable('width', nLargeur);
					soBoiteModale.addVariable('height', nHauteur);
					soBoiteModale.addVariable('enablejs', 'true');
					soBoiteModale.addVariable('javascriptid', 'soBoiteModale');
					soBoiteModale.write('boiteImageRotator');
					if (nCharg != undefined) {
						clearInterval(nCharg);
					}
					nCharg = setInterval(function() {
						if (typeof getSO('soBoiteModale').sendEvent == 'function') {
							sendEvent('soBoiteModale', 'playitem', nItem);
							clearInterval(nCharg);
						}
					}, 400);
				
				}, 
				afterHide:function() {
					sendEvent(oVariables.javascriptid, 'playpause');
				}
			});
		}
	*/
		break;
	}	
};