function popup(strTypeMedia,strfilePath, strWidth, strHeight){
//alert('bibi')
	var racine = "/test3";
	
	//validation des qq parametres de taille passés en paramètre
	if ( (strWidth == undefined) || (strWidth == 0) || (strWidth == '') ){
		strWidth = window.screen.width-250;
	}
	
	if ( (strHeight == undefined) || (strHeight == 0) || (strHeight == '') ){
		strHeight = window.screen.height-350;
	}
	
	
	var Left=(window.screen.width-parseInt(strWidth,10))/2; 
    var Top=(window.screen.height-parseInt(strHeight,10))/2; 
    
    
		
	switch (strTypeMedia)
	{
	 case "player":
	  	strHeight = parseInt(strHeight,10)+17;
		window.open('/player.shtml?file='+strfilePath+'&width='+strWidth+'&height='+strHeight+'&media='+strTypeMedia,'player','width='+strWidth+',height='+strHeight+',top='+Top+',left='+Left);
	 break;

	 case "Ang_player":
	  	strHeight = parseInt(strHeight,10)+17;
		window.open('Ang_player.shtml?file='+strfilePath+'&width='+strWidth+'&height='+strHeight+'&media='+strTypeMedia,'Ang_player','width='+strWidth+',height='+strHeight+',top='+Top+',left='+Left);
	 break;
		
		
		
		case "html":
		window.open('/'+strfilePath,'page','width='+strWidth+',height='+strHeight+',resizable=1,scrollbars=1,top='+Top+',left='+Left);
		
	   break;
	   
	   case "externe":
	   Top -= 150;
	   window.open(strfilePath,'externe','width='+strWidth+',height='+strHeight+',toolbar=1,titlebar=1,status=1,location=1,menubar=1,resizable=1,scrollbars=1,top='+Top+',left='+Left);
	   break;

	  case 2:
		 //jouer la vidéo dans un div
		 
		var tempObj = findObj(strIdPlayer);
		var strQktPlr = '';
		
		if (tempObj!=null){
			
			if (strfilePath!=''){
				
				strQktPlr += '<table border="1" style="background-color:red;"><tr><td align=right> <a href="javascript:hidePlayer(\''+strIdPlayer+'\');">X</a> </td><tr><td>';
				
				
				strQktPlr += '<object CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="320" height="256" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">';
				strQktPlr += '<param name="src" value="'+racine+strfilePath+'">';
				strQktPlr += '<param name="autoplay" value="true">';
				strQktPlr += '<param name="loop" value="false">';
				strQktPlr += '<param name="controller" value="true">';
				strQktPlr += '<embed src="'+racine+strfilePath+'" width="320" height="256" autoplay="true" loop="false" controller="true" pluginspage="http://www.apple.com/quicktime/"></embed>';
				strQktPlr += '</object>';
				//<!--param name="qtsrc" value="rtsp://realmedia.uic.edu/itl/ecampb5/demo_broad.mov"--> <!-- pour streaming, parametre a ajouter aussi dans la derniere ligne embed, si requise -->
				
				strQktPlr += '</td><tr></table>';
			}
			
				tempObj.style.display = '';		
				tempObj.innerHTML = strQktPlr;
				tempObj.top = window.screen.height/2-tempObj.height;		
				tempObj.left = window.screen.width/2-tempObj.width;
					
		}
		
		break;
		
	  default:
		window.open(racine+strfilePath);
	   break;
	} 

	
}




function hidePlayer(strIdPlayer){
	var tempObj = findObj(strIdPlayer);
		if (tempObj!=null){		
		tempObj.innerHTML = '';
		tempObj.style.display = 'none';
	}
}

//Pour trouver l'objet qu'on souhaite manipuler
//MM dreamweaver MX javascript code
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}

/*

function OpenCenterPopUp(){     
   
    //Videment faut modifier la config!! 
    var Configuration="'toolbar=no, menubar=no, location=no, directories=no, status=no, resizeable=no, width=350, height=350, left=" + Left + ", top=" + Top; 
    window.open('mon_fichierhtml.html','NomDeMaPopUp',Configuration); 
} 
var term = null 
function affiche(m) { 
if ((term==null) 
||(term.closed)) { 
term = window.open ("","term") 
term.document.open("text/plain") 
} 
term.document.write(m) 
} 

*/


///////////////////////////////////////////////////////////////////////////
// UTILITAIRES
///////////////////////////////////////////////////////////////////////////

//Pour Ie Mac
if(typeof Array.prototype.push=='undefined'){

	// on simule alors la fonction push
	// car elle n existe pas sous ie mac
	Array.prototype.push=function(){
		var i=0;
		b=this.length,a=arguments;
		for(i;i<a.length;i++)this[b+i]=a[i];
		return this.length;
    }	

}