var sitemapIframe;
var sitemapMask;

function dimensions() {
	var de = document.documentElement;
	return {
		winW: window.innerWidth || (de && de.clientWidth) || document.body.clientWidth,
		winH: window.innerHeight || (de && de.clientHeight) || document.body.clientHeight,
		pageW: de.scrollWidth || window.scrollWidth,
		pageH: de.scrollHeight || window.scrollHeight
	};
};

//positionnement iframe + dimensions mask
function positionIframe(){
	sitemapIframe = document.getElementById('content');
	sitemapMask = document.getElementById('mask');
	if(!sitemapIframe) {return;}
	var dim = dimensions();
	sitemapIframe.style.left = Math.round((dim.winW - sitemapIframe.width) / 2) + 'px';
	sitemapIframe.style.top = Math.round((dim.winH - sitemapIframe.height) / 2) + 'px';
	if(sitemapMask) {
		sitemapMask.style.height = dim.pageH > dim.winH ? dim.pageH + 'px' : dim.winH + 'px';
		sitemapMask.style.width = dim.pageW > dim.winW ? dim.pageW + 'px' : dim.winW + 'px';
	}
};

//cacher iframe
function cacheIframe(){
	if(!sitemapIframe) {return true;}
	sitemapIframe.style.display = "none";
	
	if(sitemapMask) {sitemapMask.style.display = "none";}
	
	showMeJS();
	
	return true;
}

//montrer iframe
function montreIframe(_lang){
	if(!sitemapIframe) {return true;}
	sitemapIframe.src = "sitemap-"+_lang+".html";
	if(sitemapMask) {sitemapMask.style.display = "block";}
	if (thisMovie("JMWeston")) {
		setTimeout("sitemapIframe.style.display = 'block'", 1500);
	} else {
		sitemapIframe.style.display = "block";
	}
	return false;
}

//fin affichage contenu iframe

//execution du window.onload se fait dans l'ordre inverse de déclaration pour IE...!
addEvent(window, "resize", positionIframe);
addEvent(window, "load", positionIframe);
//
