
var settings = {	

	'img_width':			695,			//	width to resize all banners to, only takes effect if above is 1
	'img_height':			58, 			// 	height to resize all banners to, only takes effect if above is 1	
	'refresh_time':			6000,			//	the seconds between refreshs of the banners - use 0 to disable
	'refresh_max':			40,				//	maximum number of refreshs on each page load	
	'location_prefix': 		'banniere',	//	The prefix of the IDs of the <div> which wraps the banners - this div is generated dynamically.
											//  a number will be added on the end of this string. adLocation- was used by default before version 1.4.x												
	'window': 				'_self',		//	Window to open links in, _self = current, _blank = new. Use _top if in a frame!			
}


/**
		Banners
**/
// banner list syntax: new banner(website_name, website_url, banner_url, show_until_date, adlocation),  DATE FORMAT: dd/mm/yyyy
// if you're not using adlocations just leave it empty like '' as in the last example here
// to make sure a banner is always rotating, just set the date far into the future, i.e. year 3000
/*
var banners = [
	new banner('AwesomeStyles',			'http://www.awesomestyles.com', 			'images/4.jpg' , '_self'	),	
	new banner('Dreamhost',				'http://www.dreamhost.com/r.cgi?259541',	'images/6.gif', '_self')
]
*/
//         				There is no need to edit below here
///////////////////////////////////////////////////////////////////////////////////

var compteur=0;
var refresh_counter=0;

function banner(a,b,c,d){
	this.name=a;
	this.url=b;
	this.image=c;	
	this.target=d;
	this.oid=0;
	this.loc=settings.default_ad_loc	
}
function display_banners(a){		
	if(a<0||a>=banners.length){
		return
	}	
	var b=new Array();	
	b.push(banners[a]);		
	var d=Math.floor(Math.random()*b.length);
	var e=b[d];	
	var f=(settings.force_size==1)?' width="'+settings.img_width+'" height="'+settings.img_height+'"':'';
	var l=document.getElementById(settings.location_prefix);			
	l.innerHTML='<a href="'+e.url+'" title="'+e.name+'" target="'+e.target+'"><img border="0" src="'+e.image+'"'+f+' alt="'+e.name+'" /></a>';			
	return

}
		
function refresh_banners(){	
	if((refresh_counter==settings.refresh_max)||settings.refresh_time<1||AjustementPageSansHeader>0){		
	//AjustementPageSansHeader est plus grand que 0 pour page qui n'a pas de banniere (variable global)
		clearInterval(banner_refresh)
		return
	}
	
	compteur++;
	if (compteur>banners.length-1){
		compteur=0;
	}	
	$('#'+settings.location_prefix).fadeOut('fast',function(){
														  display_banners(compteur);
														  $('#'+settings.location_prefix).fadeIn('fast');
														  });	

	refresh_counter++;
	
}


