/**
 * Louvre Mécénat Entreprises
 * 
 */

/**********************************************************************************************
 *
 * ----- Object : Utils -----------------------------------------------------------------------
 *
**********************************************************************************************/

var Utils = function()
{
	
	// ----- Private vriables ---------------------------------------------------------------------
	var _ie = !+"\v1";
	
	
	/**********************************************************************************************
	 *
	 * ----- Private functions --------------------------------------------------------------------
	 *
	**********************************************************************************************/
	
	function _getScrollX()
	{
		return _ie ? document.documentElement.scrollLeft : window.pageXOffset;
	}
	
	function _getScrollY()
	{
		return _ie ? document.documentElement.scrollTop : window.pageYOffset;
	}
	
	function _getWidth()
	{
		return _ie ? document.documentElement.clientWidth : window.innerWidth;
	}
	
	function _getHeight()
	{
		return _ie ? document.documentElement.clientHeight : window.innerHeight;
	}
	
	/**********************************************************************************************
	 *
	 * ----- Public API ---------------------------------------------------------------------------
	 *
	**********************************************************************************************/
	
	return {
		ie					: _ie,
		getWindowWidth		: _getWidth,
		getWindowHeight		: _getHeight,
		getWindowScrollX	: _getScrollX,
		getWindowScrollY	: _getScrollY
	};
}();

/**********************************************************************************************
 *
 * ----- Object : Mecenat ---------------------------------------------------------------------
 *
**********************************************************************************************/

var Mecenat = function()
{
	// ----- Private vriables ---------------------------------------------------------------------
	var _swfid = 'flashcontent';
	
	
	/**********************************************************************************************
	 *
	 * ----- Private functions --------------------------------------------------------------------
	 *
	**********************************************************************************************/
	
	function _thisMovie()
	{
		return Utils.ie ? window[_swfid] : document[_swfid];
	}
	
	/**********************************************************************************************
	 *
	 * ----- Public API ---------------------------------------------------------------------------
	 *
	**********************************************************************************************/
	
	return {
		
		addScrollListener: function()
		{
			_thisMovie().noticeScroll(Utils.getWindowScrollY());
			window.onscroll = function () {
				_thisMovie().noticeScroll(Utils.getWindowScrollY());
			}
		},
		
		removeScrollListener: function()
		{
			window.onscroll = null;
		},
		
		setFlashHeight: function(newHeight)
		{
			var flashdiv = document.getElementById(_swfid);
			flashdiv.height = newHeight;
		}
		
	};
	
}();




