function affImage(num){
	var i=1;
	while(document.getElementById("image"+i)){
		if(i==num) vis = "visible";
		else vis = "hidden";
		document.getElementById("image"+i).style.visibility = vis;
		i++;
	}
}

function imgCheck(id){
	if(document.getElementById(id))
		document.getElementById(id).checked=true;
}

function zoomin(pic,ml,mt){
	document.getElementById('show_pic').src = pic;
	document.getElementById('show_pic').style.marginLeft = -ml;
	document.getElementById('show_pic').style.display = 'block';
}

function zoom(urlimage){
	window.open("popup/zoomKdo.php?idkdo="+urlimage,'zoomProduit','width=500,height=500');
}

function zoom2(url, height){
	window.open('popup/zoom.php?id='+url,'zoom','width=500,height='+height);
}

function popDesc(url,width,height){
	window.open('popup/' + url,'description','width=' + width + ',height=' + height);
}

function clignotant(id) {
	if(document.getElementById(id)){
		if(document.getElementById(id).style.visibility = 'hidden')
			setTimeout("document.getElementById('"+id+"').style.visibility = 'visible';",500);
		else setTimeout("document.getElementById('"+id+"').style.visibility = 'hidden';",500);
	}
}

function clignoter() {
	if(document.getElementById('promo').style.visibility = 'hidden')
		setTimeout("document.getElementById('promo').style.visibility = 'visible';",500);
	else setTimeout("document.getElementById('promo').style.visibility = 'hidden';",500);
}

function get_bookmark(link,comm,url_page,title,add_name,dir){
	if(add_name==null) add_name = false;
	if(dir==null) dir = '';
	var name = add_name ? ' ' + comm : '';
	link = link.join('');
	link = link.replace('[URL]',url_page);
	link = link.replace('[TITLE]',title);
	document.write('<a href="' + link + '" target="_new" title="' + comm + '"><img src="' + dir + 'images/bm/' + comm.toLowerCase() + '.gif" alt="' + comm + '" style="margin:1px;" />' + name + '</a>');
}

function get_bookmarks(url,title){
	for(var i=0;i<a_comm.length;i++){
		link = a_link[i].join('');
		link = link.replace('[URL]',url);
		link = link.replace('[TITLE]',title);
		document.write('<a href="' + link + '" target="_new" title="' + a_comm[i] + '"><img src="images/bm/' + a_comm[i].toLowerCase() + '.gif" alt="' + a_comm[i] + '" style="margin:1px;" /></a>');
	}
}

var addFavorites = function addFavorites(lien){
	NomSite = lien.getAttribute('title').replace(' Añadir a tus favoritos ','');
	UrlSite = lien.getAttribute('href');
	if(window.sidebar) window.sidebar.addPanel(NomSite,UrlSite,""); //Mozilla, FireFox,...
	else if(window.external) window.external.AddFavorite(UrlSite, NomSite); //Internet explorer Windows
	else if(document.all && (navigator.userAgent.indexOf('Win') < 0)) alert ("Usa mazana + D para añadir " + NomSite + " a tus favoritos !"); //Internet explorer MAC
	else if(window.opera && window.print) alert ("Usa CTRL + D para añadir " + NomSite + " a tus favoritos !"); //Opera
	else alert ("Esta función no está disponible para tu navegador.");
}