/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  Permission granted to use this code 
  as long as this entire notice is included.
*************************************************************************/

// resize fix for ns4
var origWidth, origHeight;
if (document.layers) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

var page_loaded; // set true onload (avoid errors onmouseover/out before page loaded)
function initInfoLyr() {
  page_loaded = true; 
  writeToLayer('DiapoImg', origMsg, descriptif); // write first message onload
}

function writeToLayer(id, sHTML, Hpx, Lpx) {
//  if (!page_loaded) return;
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
	if (!el) return;

	if (Hpx && Lpx) {
		var style = ' style="height: ' + Hpx + 'px; width: ' + Lpx + 'px;"';
	}	else {
		var style = '';
	}

	var cntnt = '<div '+ style + '>' + sHTML.replace(/#/g, "\"") + '</div>';
	//var cntnt = '<table border="0"><tr height="450"><TD valign="center">' + sHTML.replace(/#/g, "\"") + '</TD></tr></table>';
  if (typeof el.innerHTML!="undefined") {
		el.innerHTML = cntnt;
  } else if (document.layers) {
		el.document.write(cntnt);
		el.document.close();
  }
}