
function getElement(id) 
 	{ 
 	return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
	} 

function getContenuFrame(nomFrame)
	{ 
	var contenuFrame=null;
	
	if(platformDetect()=="mac")
		{
		return contenuFrame=document.frames[nomFrame];
		}
		else
		{
		
		var tmpFrame=getElement(nomFrame);
		
		
		 if (tmpFrame.contentWindow) 
			{
			// For IE5.5 and IE6 For NS6
			contenuFrame = tmpFrame.contentWindow;
			}
			else if (tmpFrame.document) 
			{
			// For IE5
			contenuFrame = tmpFrame;
			}
		return contenuFrame;
		}
	}
	
	function getHauteurDocument (tmpFrame)
		{
			return document.body && document.body.scrollHeight ? document.body.scrollHeight : document.height ? document.height : null; 

		}


 function redimmensionnerFrame(IDframe,tmpParent,hauteur)
	{ 

	tmpFrame=getElement(IDframe);

	if (typeof tmpFrame != 'undefined') 
		{ 
		if (hauteur<0)
			{
			docHeight =getHauteurDocument() ; 
			}
			else
			{
			docHeight=hauteur;
			}
	
	
		if(platformDetect()=="mac")
			{
			//alert("docHeight= "+docHeight);
			if (docHeight<1000)
				{
				docHeight=2000;
				}
			}
	
	
		
		tmpFrame.style.height = docHeight  +'px' ;
		
		}
		
		/*
	switch(IDframe)
			{
			case "contenu":
				//			
				break;
			default: 
				// frameTexteProgramme:
				
			//	parent.parent.redimmensionnerFrame("contenu",'',-1);
			
			
			}
			*/
	}
	
	
	function platformDetect()
	{
  	if(navigator.appVersion.indexOf("Win") != -1)
  		{
    	return("windows");
  		}
  		else if(navigator.appVersion.indexOf("Mac") != -1)
  		{
    	return("mac");
 		}
  		else
		{
		return ("Other");
		}
	}
	


