var _ad; var _tb; var _adTop; var _maxScroll; var _lastPos=0;
		
function adinit()
{
	if(document.getElementById('ad-left'))
	{
		_ad=document.getElementById('ad-left');
		_adTop=_ad.offsetTop;
		_maxScroll=document.getElementById('contenu').offsetHeight-document.getElementById('ad-extra').offsetHeight+_adTop-_ad.offsetHeight-10;
		
		if(_maxScroll>_adTop)
			adScroll();
	}
}

function pos()
{
	if(window.innerHeight)
		return window.pageYOffset;
	if(document.documentElement&&document.documentElement.scrollTop)
		return document.documentElement.scrollTop;
	if(document.body)
		return document.body.scrollTop; return 0;
}

function adScroll()
{
	if(_lastPos!=pos())
	{
		_lastPos=pos();
		
		if(pos()<_maxScroll&&pos()>_adTop)
			_ad.style.top=pos()+'px';
		else if(pos()<_maxScroll)
			_ad.style.top=_adTop+'px';
		else _ad.style.top=_maxScroll+'px';
	}
	
	setTimeout('adScroll()', 10);
}
function ouvrePage(url){
	window.open("http://www.toulouseweb.com/count_pubs.php?mini=0&nom=bandeau-annonce_keloccaz&nom_fichier=bandeau-annonce_keloccaz.gif&sous_menu=petites%20annonces&url="+url);
}