 /****************************************
 * Moteur de Module
 * créé pour le site MuseWorld
 * écrit par Laurent MINGUET
 * (c)2009 2S Creation - tout droit réservé
 */
 
function moteurModuleAction_CB(target)
{
	document.getElementById(target).innerHTML = http_result;
}

function moteurModuleAction(url, target)
{
	HTTPObject_add(url , null, null, "moteurModuleAction_CB('"+target+"')");
}

function moteurModuleWindowOpen(url, width, height)
{
	var sc_mod = false;
	var sc_val = 0;
	if (document.body.scrollTop)
	{
//		sc_val = document.body.scrollTop;
		sc_mod = true;
	}
	else
	{
//		sc_val = document.documentElement.scrollTop;
		sc_mod = false;
	}

	if (document.getElementById('TB_window'))
	{
		document.getElementById('TB_window').innerHTML = '';
		document.getElementById('TB_window').setOpacity(0);
	}

	if (width)	url+= '&width='+width;
	if (height)	url+= '&height='+height;
	TB_show('', url, false);
	if (document.getElementById('TB_title'))		document.getElementById('TB_title').style.display = 'none';
	if (document.getElementById('TB_ajaxContent'))	document.getElementById('TB_ajaxContent').style.width = '100%';
//	document.getElementById('bloc-flash').innerHTML = '';

	if (sc_mod)
		document.body.scrollTop = sc_val;		
	else
		document.documentElement.scrollTop = sc_val;
}


function moteurModuleWindowClose(fonction, action)
{
	if (fonction && action) eval(fonction+'("'+action+'")');
	TB_remove();
}

function  moteur_getLeft(obj)
{
	var val = obj.offsetLeft;
	
	if (obj.offsetParent)
	{
		val+= moteur_getLeft(obj.offsetParent);
	}

	return val;
}

function  moteur_getTop(obj)
{
	var val = obj.offsetTop;

	if (obj.offsetParent)
	{
		val+= moteur_getTop(obj.offsetParent);
	}
	return val;
}

function  moteur_getWidth(obj)
{
	var val = obj.offsetWidth;
	
	return val;
}

function moteur_getHeight(obj)
{
	var val = obj.offsetHeight;
	//alert(val);
	return val;
}

function showProfilMuse(uid)
{
	document.location.href = '?pid=145&cid=288&obj=mprofil&fnc=mesAmisProfil&muse='+uid;
}