/*******************************************************************************
*                                                                               
*                                                                               
*  lpt.js                                                                       
*                                                                               
*                                                                               
*******************************************************************************/

function g(id)
{
	return document.getElementById(id);
}

//------------------------------------------------------------------------------
// Lpt functions                                                                
//------------------------------------------------------------------------------

Lpt =
{
	fontSize: null,
	setFontSize: function(size)
	{
		if (size == this.fontSize)
			return;
		this.fontSize = size;
		var link2 = document.getElementsByTagName('link')[1];
		link2.setAttribute('href', 'style/size-'
			+(size == '+' ? 'bigger' : 'normal') +'.css');
		Lpt.refreshScrollPane();
	},
	
	imprimer: function()
	{
		window.print();
	},
	
	resizeHeight: function(id, height)
	{
		g(id).style.height = height+'px';
	},
	
	refreshScrollPane: function()
	{
		$('.scroll-pane').jScrollPane({showArrows:false, scrollbarWidth: 7});
	}, 
	
	openMore :function()
	{
		g('openBt').style.display = 'none';
		g('more-books').style.display = 'block';
	}, 
	
	collapseMore :function()
	{
		g('openBt').style.display = 'block';
		g('more-books').style.display = 'none';
	}
};

//------------------------------------------------------------------------------
// Main object                                                                  
//------------------------------------------------------------------------------

Main =
{
	run: function()
	{
		this.include('swfobject.js');
		this.include('jquery.js');
		this.include('dimensions.js');
		this.include('mousewheel.js');
		if(navigator.userAgent.toLowerCase().indexOf('firefox')!=-1 || navigator.userAgent.toLowerCase().indexOf('msie')!=-1)
			this.include('scrollpane.js');
	},
	
	include: function(jsFile)
	{
		// with document.write we're sure that the script will be loaded and 
		// executed just after the current script and in the correct order 
		document.write('<script'
			+' type="text/javascript"'
			+' src="js/' +jsFile +'"></script>');
	}
};

//------------------------------------------------------------------------------
// Main initialization                                                          
//------------------------------------------------------------------------------

Main.run();

