/**
 *
 * @author	Benoit Asselin <benoit(at)agenceici(dot)com>
 * @version	javascript.js, 2009/05/13
 * @link	http://www.agenceici.com/
 *
 */


var windowOnload = '';
window.onload = function(){ eval(windowOnload); };



/**
 * Convertir la transparence des images PNG sous Internet Explorer 6.0 et -
 * Ex: window.onload = function() { fixiePNG(); };
 * @param {String} p_path Chemin du fichier NONE.GIF (default: images/)
 */
function fixiePNG(p_path) {
	var msie = navigator.userAgent.match(/msie\s([\d\.]+)/i);
	if(msie && msie[1] <= '6.0') {
		p_path = p_path === undefined ? 'images/' : p_path;
		var png = /\.png$/i;
		var imgs = document.getElementsByTagName('img');
		for(var i = 0, l = imgs.length; i < l; i++) {
			if(png.test(imgs.item(i).src)) {
				imgs.item(i).style.width = imgs.item(i).offsetWidth;
				imgs.item(i).style.height = imgs.item(i).offsetHeight;
				imgs.item(i).style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + imgs.item(i).src + '\',sizingMethod=\'image\')';
				imgs.item(i).src = p_path + 'none.gif';
			}
		}
	}
}



/**
 * Mangeur de SPAM
 * @param {String} mt1 XXX_at_xxx_dot_xxx
 * @param {String} mt2 xxx_at_XXX_dot_xxx
 * @param {String} mt3 xxx_at_xxx_dot_XXX
 * @param {String} subject Objet du message
 * @return {Boolean} Toujours false
 */
function noSpam(mt1, mt2, mt3, subject) {
	var link = 'mailto:' + mt1 + '@' + mt2 + '.' + mt3;
	if(subject !== undefined) { link += '?subject=' + encodeURIComponent(subject); }
	window.location.href = link;
	return false;
}


