<!--


var oIFC_IHM_Container_ObjetCourrant = '';
var sIFC_IHM_Container_ObjetDeplacer = '';

function IFC_IHM_ContainerIframeId( oObjet )
{		
	var reg1 = /<IFRAME.*IFRAME>/;				
	var reg2 = /id=([a-zA-Z]*)/;
	sVal = reg1.exec( oObjet.innerHTML );
	if( sVal != null) 
	{
		sVal = reg2.exec( sVal );
		if( sVal != null )
		{
			 return sVal[1];
		}					
	}
	return '';
}

function IFC_IHM_ContainerLoad( sObjet )
{
	// --- Si des IFRAME alors ont leur affecte la class des iframe container
	oObjet = document.getElementById('oIFC_IHM_CONTAINER_ContainerId_'+sObjet );	
	
	sIframeId = IFC_IHM_ContainerIframeId( oObjet );
	if( sIframeId != '' ) 
	{
	 	eval( "document."+sIframeId+".className='IFC_IHM_Container_Style_Iframe';" );
	}
}

function IFC_IHM_ContainerDeplacer( sObjet )
{
	// --- Si depart
	if( sIFC_IHM_Container_ObjetDeplacer == '') 
	{
		sIFC_IHM_Container_ObjetDeplacer = sObjet;
		document.getElementById('oIFC_IHM_CONTAINER_ContainerId_'+sObjet).style.border = '2px solid #FF0000';		
	}
	else
	{
		document.getElementById('oIFC_IHM_CONTAINER_ContainerId_'+sIFC_IHM_Container_ObjetDeplacer).style.border = '0px solid #000000';
		
		// --- Annulation du deplacement
		if( sObjet != sIFC_IHM_Container_ObjetDeplacer )
		{
			// --- Permutte les ID des div de resize
			oObjetResizeD = document.getElementById('oIFC_IHM_CONTAINER_ResizeId_'+sIFC_IHM_Container_ObjetDeplacer);
			oObjetResizeA = document.getElementById('oIFC_IHM_CONTAINER_ResizeId_'+sObjet );						
			sTemp = oObjetResizeD.id;
			oObjetResizeD.id = oObjetResizeA.id;
			oObjetResizeA.id = sTemp;
			
			// --- Permutte les container
			oObjetDepart = document.getElementById('oIFC_IHM_CONTAINER_ContainerId_'+sIFC_IHM_Container_ObjetDeplacer);			
			oObjetArrive = document.getElementById('oIFC_IHM_CONTAINER_ContainerId_'+sObjet );
			
			
			// --- Si des IFRAME dans la permutation
			sIframeDepartUrl = '';
			sIframeArriveUrl = '';			
			sIframeDepartId = IFC_IHM_ContainerIframeId( oObjetDepart );
			if( sIframeDepartId != '' ) eval( "sIframeDepartUrl = document."+sIframeDepartId+".location.href; ");			
			sIframeArriveId = IFC_IHM_ContainerIframeId( oObjetArrive );
			if( sIframeArriveId != '' ) eval( "sIframeArriveUrl = document."+sIframeArriveId+".location.href; ");
					 
			
			// --- Permute les ID
			sTemp = oObjetDepart.id;
			oObjetDepart.id = oObjetArrive.id;
			oObjetArrive.id = sTemp;						

								
			// --- Permutte le contenu
			sTemp = oObjetDepart.innerHTML;
			oObjetDepart.innerHTML = oObjetArrive.innerHTML;
			oObjetArrive.innerHTML = sTemp;
							
			// --- Permutte les tailles
			sTempX = oObjetDepart.style.width;
			sTempY = oObjetDepart.style.height;				
			oObjetDepart.style.width = oObjetArrive.style.width;
			oObjetDepart.style.height = oObjetArrive.style.height;			
			oObjetArrive.style.width = sTempX;
			oObjetArrive.style.height = sTempY;	
				
			// --- Permute les URL si IFRAME
			if( sIframeDepartUrl != '' ) eval( "document."+sIframeDepartId+".location.href = '"+sIframeDepartUrl+"';" );
			if( sIframeArriveUrl != '' ) eval( "document."+sIframeArriveId+".location.href = '"+sIframeArriveUrl+"';" );
		}
				
		sIFC_IHM_Container_ObjetDeplacer = '';
	}
	
}

function IFC_IHM_ContainerClipClap( sObjet )
{
	if( document.getElementById( 'oIFC_IHM_CONTAINER_ContenuId_'+sObjet ).style.display == 'none' ) 
	{
		document.getElementById( 'oIFC_IHM_CONTAINER_ContainerId_'+sObjet ).style.height = document.getElementById( 'oIFC_IHM_CONTAINER_ContainerId_'+sObjet ).TailleCourrant;
		
		document.getElementById( 'oIFC_IHM_CONTAINER_ContenuId_'+sObjet ).style.display = 'block';
		//document.getElementById( 'oIFC_IHM_CONTAINER_ResizeIconeId_'+sObjet ).style.display = 'block';		
	}
	else 
	{	
		//document.getElementById( 'oIFC_IHM_CONTAINER_ResizeIconeId_'+sObjet ).style.display = 'none';
		
		document.getElementById( 'oIFC_IHM_CONTAINER_ContainerId_'+sObjet ).TailleCourrant = document.getElementById( 'oIFC_IHM_CONTAINER_ContainerId_'+sObjet ).style.height;
		document.getElementById( 'oIFC_IHM_CONTAINER_ContainerId_'+sObjet ).style.height = '16px';
		
		document.getElementById( 'oIFC_IHM_CONTAINER_ContenuId_'+sObjet ).style.display = 'none';				
	}
}


function IFC_IHM_ContainerResize( sObjet )
{				
	oObjetCourrantTemp = document.getElementById( 'oIFC_IHM_CONTAINER_ContainerId_'+sObjet );
	
	oObjetMatrice = document.getElementById( 'oIFC_IHM_CONTAINER_ResizeId_'+sObjet );
	oObjetMatrice.style.display = 'block';		
	oObjetMatrice.style.top 	= oObjetCourrantTemp.offsetTop;
	oObjetMatrice.style.left 	= oObjetCourrantTemp.offsetLeft;		
	oObjetMatrice.style.width 	= oObjetCourrantTemp.style.width;
	oObjetMatrice.style.height 	= oObjetCourrantTemp.style.height;
	
	// --- Marque la taille du container a resize
	oIFC_IHM_Container_ObjetCourrant = oObjetMatrice; //document.getElementById( 'oIdContainer_'+sObjet );	
	oIFC_IHM_Container_ObjetCourrant.style.border 		= '2px solid #ff0000';
	oIFC_IHM_Container_ObjetCourrant.nResizePositionX_i = event.clientX;
	oIFC_IHM_Container_ObjetCourrant.nResizeTailleX_i 	= oObjetCourrantTemp.offsetWidth;
	oIFC_IHM_Container_ObjetCourrant.nResizePositionY_i = event.clientY;
	oIFC_IHM_Container_ObjetCourrant.nResizeTailleY_i 	= oObjetCourrantTemp.offsetHeight;
	oIFC_IHM_Container_ObjetCourrant.sCid_i				= sObjet;
	
	window.document.attachEvent("onmousemove",IFC_IHM_ContainerResizeDeplace);
	window.document.attachEvent("onmouseup", IFC_IHM_ContainerResizeFin);
}

function IFC_IHM_ContainerResizeDeplace( event )
{		
	// --- Pour le resize de la zone
	var nTailleX = oIFC_IHM_Container_ObjetCourrant.nResizeTailleX_i + event.clientX - oIFC_IHM_Container_ObjetCourrant.nResizePositionX_i;
	var nTailleY = oIFC_IHM_Container_ObjetCourrant.nResizeTailleY_i + event.clientY - oIFC_IHM_Container_ObjetCourrant.nResizePositionY_i;
	
	nTailleX = nTailleX < 155?155:nTailleX;
	nTailleY = nTailleY < 100?100:nTailleY;
	
	oIFC_IHM_Container_ObjetCourrant.style.width = nTailleX+'px';
	oIFC_IHM_Container_ObjetCourrant.style.height = nTailleY+'px';
}

function IFC_IHM_ContainerResizeFin( event )
{		
	oContainerResize = document.getElementById( 'oIFC_IHM_CONTAINER_ContainerId_'+oIFC_IHM_Container_ObjetCourrant.sCid_i );	
	oContainerResize.style.width =  oIFC_IHM_Container_ObjetCourrant.style.width;
	oContainerResize.style.height = oIFC_IHM_Container_ObjetCourrant.style.height;
			
	//oContainerResize = document.getElementById( 'oIFC_IHM_CONTAINER_TitreId_'+oIFC_IHM_Container_ObjetCourrant.sCid_i );			
	//oContainerResize.style.width = (oIFC_IHM_Container_ObjetCourrant.offsetWidth-46)+'px';
	
	oIFC_IHM_Container_ObjetCourrant.style.display = 'none';
	
	window.document.detachEvent("onmousemove",IFC_IHM_ContainerResizeDeplace);
	window.document.detachEvent("onmouseup",IFC_IHM_ContainerResizeFin);			
}

//-->
