/**
LaBox v.1 pour thickbox 3.1 && jQuery 1.2.6
Fonction d'appel a la fonction d'ouverture de TickBox
@author JOSEPH-AGATHE Julien
@date 05/11/08

=================
## UTILISATION ##
=================
jquery et thickbox en ligne
appel : showModal(url, {params});
Exemple showModal('http://www.pop-corn.tv', {mode: 'iframe', height: 400, width: 200});


================
## PARAMETRES ##
================
	title		 : Titre de la modalbox
	width/height : Dimensions de la modal. Par defaut 500*500
	mode		 : Type d'affichage. 
					   Iframe (resultat HTML dans une iframe dans la modal)
					   Ajax (reponse HTML dans la modal)
					   Inline (affichage d'un div caché dans la modal /!\ Seul les enfants du div sont affichés.
						   OK : <div id="divID"><p>contenu affiche</p></div>
						   Erreur : <div id="divID">contenu non affiche</div>
	divID		 : Nom du DIV pour l'appel Inline
	fixed		 : Desactive le clique sur le fond pour desactiver la modal
*/
	
function showModal( sURL, aParams )
{
	var iWidth = 500;
	var iHeight = 500;
	var sMode = '';
	var sFixed = '';
	var sTitle = '';
	var sParams = sURL + '?';
	
	if( typeof(aParams.title) != 'undefined' ) sTitle = aParams.title;

	if( typeof(aParams.width) != 'undefined' ) iWidth = aParams.width;
	if( typeof(aParams.height) != 'undefined' ) iHeight = aParams.height;
	
	if( typeof(aParams.mode) != 'undefined')
	{
		if( aParams.mode == 'iframe' ) sMode = '&TB_iframe=true';
		else if( aParams.mode == 'inline' ) sParams = '#TB_inline?inlineId=' + aParams.divID + '&';
	}

	if( typeof(aParams.fixed) != 'undefined' && aParams.fixed ) sFixed = '&modal=true';

	sParams += 'height=' + iHeight + '&width=' + iWidth + sMode + sFixed;

	tb_show(sTitle, sParams );
}

function hideModal( sUrl, aParams )
{
	tb_remove();
}