// script compatible JavaScript 1.3 (NN4.5+, IE4, etc.)

var banners = new Array();
/*
	variables editables dans le format:
	banners[banners.length] = new banner("src", "href", "alt", width, height);
	ne pas utiliser de double-quotes (") dans les valeurs, meme avec backslash: \"
*/


banners[banners.length] = new banner(
	{'fr': "/images/commanditaires/logo_desjardins_234x60.png", 'en': "/images/commanditaires/logo_desjardins_234x60.png"},
	{'fr': "/fr/coupe/commanditaires/", 'en': "/en/coupe/sponsors/"},
	{
		'fr': "Caisses partenaires de la communaut&eacute; gaie et lesbienne de Montr&eacute;al",
		'en': "Caisses that are partners of the Montreal gay and lesbian community"
	},
	234,
	60
);

/*
banners[banners.length] = new banner(
	{'fr': "/images/commanditaires/logo_desjardins.gif", 'en': "/images/commanditaires/logo_desjardins.gif"},
	{'fr': "http://www.desjardins.com/", 'en': "http://www.espacecourbe.com/"},
	{
		'fr': "Desjardins",
		'en': "Desjardins"
	},
	120,
	90
);
*/

// fin des variables ditables

function banner(src, href, alt, width, height)
{
	this.src = src;
	this.href = href;
	this.alt = alt;
	this.width = width;
	this.height = height;
}

function banalise(str)
{
	if (typeof encodeURIComponent == "function")
	{
		return encodeURIComponent(str);
	}
	else
	{
		return escape(str).replace(/\//g,'%2F');
	}
}


function choosePub(lang)
{
	var rand = Math.floor(Math.random()*banners.length);
	var pub = banners[rand];
	return	'<a href="/redirige.php?url='
		+ banalise(pub.href[lang]) +
		'"><img src="' +
		pub.src[lang] + '" width="' + pub.width +
		'" height="' + pub.height + 
		'" alt="' + pub.alt[lang].replace(/\"/g,'') + 
		'" title="' + pub.alt[lang].replace(/\"/g,'') + 
		'" border="0"></a>';
	/*
	return	'<a href="/redirige.php?url='
		+ banalise(pub.href[lang]) +
		'" target="_blank"><img src="' +
		pub.src[lang] + '" width="' + pub.width +
		'" height="' + pub.height + 
		'" alt="' + pub.alt[lang].replace(/\"/g,'') + 
		'" title="' + pub.alt[lang].replace(/\"/g,'') + 
		'" border="0"></a>';
	*/
}



