
function XITI(pUrl,pID,pPage,pl,pDisplay)
{
	var iHTML    = '' ;
	var iDisplay = (!pDisplay) ? 'display: none; ' : '' ;
	var iDate    = new Date() ;
	var iRef ;
	try
	{
		iRef = top.document.referrer ;
	}
	catch(e)
	{
		iRef = document.referrer ;
	}
	iHTML += '<a target="_blank" title="XiTi 7.5 Free" href="http://www.xiti.com/xiti.asp?s=' + pID + '">' ;
	iHTML += '<img alt="XiTi 7.5 Free" style="' + iDisplay + 'border-width: 0px; width: 80px; height: 15px; vertical-align: middle;" src="http://' + pUrl + '?' ;
	iHTML += 's=' + pID ;
	iHTML += '&p=' + pPage ;
	iHTML += '&hl=' + iDate.getHours() + 'x' + iDate.getMinutes() + 'x' + iDate.getSeconds() ;
	if (parseFloat(navigator.appVersion) >= 4)
	{
		var iScreen = screen ;
		iHTML += '&r=' + iScreen.width + 'x' + iScreen.height + 'x' + iScreen.pixelDepth + 'x' + iScreen.colorDepth ;
	}
	iHTML += '&ref=' + iRef.replace(/["<>"]/g,'').replace(/&/g,'$') ;
	if (!pDisplay)
	{
		iHTML += '">XiTi 7.5 Free</a>' ;
		iHTML  = (pl == 'fr') ? ('Analyse d\'audience ' + iHTML) : (iHTML + ' Audience Analysis') ;
	}
	else
	{
		iHTML += '"></a>' ;
	}
	return iHTML ;
}

function PARAMETRES()
{
	var iUrl	= window.location.href ;
	var iReg1	= new RegExp('[?&#]+','g') ;
	var iReg2	= new RegExp('[=]+','g') ;
	var iTNom	= iUrl.split(iReg1) ;
	var iTParametres = new Array() ;
	var iTTemp ;
	var iT ;
	if (iTNom != null)
	{
		for (iT = 1 ; iT < iTNom.length ; iT++)
		{
			if (iTNom[iT].charAt(0) != '#')
			{
				iTTemp = iTNom[iT].split(iReg2) ;
				iTParametres[iTTemp[0]] = iTTemp[1] ;
			}
		}
	}
	return iTParametres ;
}

function DOCUMENTScrollTop(pPos)
{
	if (pPos >= 0)
	{
		document.body.scrollTop            = pPos ;
		document.documentElement.scrollTop = pPos ;
	}
	else return (document.body.scrollTop || document.documentElement.scrollTop) ;
}

function STRINGYearCopyright()
{
	var iDate = new Date() ;
	return iDate.getFullYear() ;
}

function STRINGPageAddress()
{
	var iAddress = window.location.href ;
	var iSlash   = iAddress.lastIndexOf('/') + 1 ;
	var iDiese   = iAddress.lastIndexOf('#') ;
	var iEnd     = (iDiese != -1) ? iDiese : iAddress.length ;
	return iAddress.substring(iSlash,iEnd) ;
}

function STRINGNumberFormat(pStr,pFormat)
{
	while (pStr.length < pFormat) { pStr = (' ' + pStr) ; }
	return pStr ;
}

function STRINGReverse(pStr)
{
	var iStr = '' ;
	var iI ;
	for (iI = (pStr.length - 1) ; iI >= 0 ; iI--)
	{
		iStr += pStr.charAt(iI) ;
	}
	return iStr ;
}

function NUMBERTabStr(pTab,pStr)
{
	var iNumber = -1 ;
	var iI ;
	for (iI = 0 ; iI < pTab.length ; iI++)
	{
		if (pTab[iI] == pStr)
		{
			iNumber = iI ;
		}
	}
	return iNumber ;
}

function NUMBERObjectWidth(pID)
{
	if (pID)
	{
		var iObject = document.getElementById('ID_' + pID) ;
		var iNumber = 0 ;
		if (document.body.offsetWidth     ) { iNumber = iObject.offsetWidth ;      } else
		if (document.body.clientWidth     ) { iNumber = iObject.clientWidth ;      } else
		if (document.body.style.pixelWidth) { iNumber = iObject.style.pixelWidth ; }
		return iNumber ;
	}
	else return document.body.scrollWidth ;
}

function NUMBERObjectHeight(pID)
{
	if (pID)
	{
		var iObject = document.getElementById('ID_' + pID) ;
		var iNumber = 0 ;
		if (document.body.offsetHeight     ) { iNumber = iObject.offsetHeight ;      } else
		if (document.body.clientHeight     ) { iNumber = iObject.clientHeight ;      } else
		if (document.body.style.pixelHeight) { iNumber = iObject.style.pixelHeight ; }
		return iNumber ;
	}
	else return document.body.scrollHeight ;
}

function IDDisplay(pID,pDisplay)
{
	document.getElementById('ID_' + pID).style.display = pDisplay ;
}

function IDTop(pID,pTop)
{
	document.getElementById('ID_' + pID).style.top = ('' + pTop + 'px') ;
}

function IDLeft(pID,pLeft)
{
	document.getElementById('ID_' + pID).style.left = ('' + pLeft + 'px') ;
}

function IDBackground(pID,pBackground)
{
	document.getElementById('ID_' + pID).style.background = pBackground ;
}

function IDVisibility(pID,pVisibility)
{
	document.getElementById('ID_' + pID).style.visibility = pVisibility ;
}

function IDSrc(pID,pSrc)
{
	document.getElementById('ID_' + pID).src = pSrc ;
}

function IDinnerHTML(pID,pHTML)
{
	document.getElementById('ID_' + pID).innerHTML = pHTML ;
}

function PageEspaces(pWidth,pHeight)
{
	if (window.innerWidth)
	{
		gPageEspaceH = (window.innerWidth  > pWidth ) ? Math.round((window.innerWidth  - pWidth ) / 2) : 0 ;
		gPageEspaceV = (window.innerHeight > pHeight) ? Math.round((window.innerHeight - pHeight) / 2) : 0 ;
	}
	else if (document.body)
	{
		gPageEspaceH = (document.body.clientWidth  > pWidth ) ? Math.round((document.body.clientWidth  - pWidth ) / 2) : 0 ;
		gPageEspaceV = (document.body.clientHeight > pHeight) ? Math.round((document.body.clientHeight - pHeight) / 2) : 0 ;
	}
	else if (document.documentElement)
	{
		gPageEspaceH = (document.documentElement.clientWidth  > pWidth ) ? Math.round((document.documentElement.clientWidth  - pWidth ) / 2) : 0 ;
		gPageEspaceV = (document.documentElement.clientHeight > pHeight) ? Math.round((document.documentElement.clientHeight - pHeight) / 2) : 0 ;
	}
	else
	{
		gPageEspaceH = (screen.availWidth  > pWidth ) ? Math.round((screen.availWidth  - pWidth ) / 4) : 0 ;
		gPageEspaceV = (screen.availHeight > pHeight) ? Math.round((screen.availHeight - pHeight) / 4) : 0 ;
	}
	return ((gPageEspaceH != 0) || (gPageEspaceV != 0))
}

function PageVisible()
{
	document.getElementById('ID_BLOCK_AVANT').style.display = 'none' ;
	document.getElementById('ID_BLOCK_APRES').style.display = 'block' ;
}

function PageReplace(pUrl)
{
	window.location.replace(pUrl) ;
}

function PageBack()
{
	history.back() ;
}

/*---------------------------------------------------------------------------------------------------------------------*/
/* CONSTANTES GLOBALES																			    */
/*---------------------------------------------------------------------------------------------------------------------*/
	gDataPath			= '../../' ;
/*---------------------------------------------------------------------------------------------------------------------*/
	gParametres		= PARAMETRES() ;
	gNavigator		= navigator.appName ;
/*---------------------------------------------------------------------------------------------------------------------*/
	gSiteWebmaster		= 'WEB&nbsp;&#149;&nbsp;ART&nbsp;&#149;&nbsp;MEDIA' ;
	gSiteLangue		= new Array('FR','EN','ES') ;
	gSiteVersion		= new Array('Version fran&ccedil;aise','English Version','Versi&oacute;n espa&ntilde;ola') ;
/*---------------------------------------------------------------------------------------------------------------------*/
	gTextBarHBig		= '&nbsp;<big>&#151;</big>&nbsp;' ;
	gTextBarH			= '&nbsp;&#150;&nbsp;' ;
	gTextBarVBig		= '&nbsp;<big>|</big>&nbsp;' ;
	gTextBarV			= '&nbsp;|&nbsp;' ;
/*---------------------------------------------------------------------------------------------------------------------*/
	gPageEspaceH		= 0 ;
	gPageEspaceV		= 0 ;
/*---------------------------------------------------------------------------------------------------------------------*/
