
// Initialize the domain in order to access to the content of the document 
// ------------------------------------------------------------------------
document.domain = "coe.int";

var ieNavigator = (document.all) ? true : false; 
var othersNavigator = (document.getElementById && !document.all) ? true : false;

function getElement(idElem){
	
	if (ieNavigator)	
		return document.all[idElem];
	else
		return document.getElementById([idElem]);
}

function resizeIframe(idIframe) {


var objIframe = getElement(idIframe);
var iframeHeight = 0;

 try {


	if (objIframe) {
		if (objIframe.contentDocument) {
			iframeHeight=objIframe.contentDocument.body.offsetHeight;		// Find the height: Opera - Netscape - Mozilla (norme W3C)
		} else {
			iframeHeight=objIframe.contentWindow.document.body.scrollHeight;	// Find the height: IE - Mozilla - Netscape
		}
	}
	
	objIframe.style.height=iframeHeight + 30;

		//	objIframe.style.height=intFrameHeight ;
		// aucun traitement en cas d'erreur d'acces au contenu
		// la valeur par defaut est prise en compte, soit 2400 px
  } catch(e){
	//objIframe.style.height=2400;
  }

}


// Fonction qui remonte en haut de la page lorsque le contenu de l'IFRAME change

function gotoTopOfPage() {

try {
	var strOldUrl = parent.location;		// Utilisation de <parent>
	var strURL = new String(parent.location);

	var intPosEndURL = strURL.indexOf("#");
	var strNewUrl = "";

	// Pour aller au Top, on ajoute # à l'URL
	if (intPosEndURL > 0) strNewUrl = strURL.substring(0,intPosEndURL) + '#';
	else strNewUrl = strURL  + '#';

 		parent.location = strNewUrl;
  } catch(e) {
  
	var strOldUrl = document.location;		// Utilisation de <document>
	var strURL = new String(document.location);

	var intPosEndURL = strURL.indexOf("#");
	var strNewUrl = "";

	// Pour aller au Top, on ajoute # à l'URL
	if (intPosEndURL > 0) strNewUrl = strURL.substring(0,intPosEndURL) + '#';
	else strNewUrl = strURL  + '#';

 	document.location = strNewUrl;
  }
}
