ï»¿// RÃ©cupÃ¨re la valeur d'un Ã©lÃ©ment
function getE(id)
{
	if(document.getElementById) {
		return document.getElementById(id);
	} else if(document.all) {
		return document.all[id];
	} else return;
}

function openClose(id,mode)
{
	element = getE(id);
	img = getE('img_'+id);
	
	if(element.style) {
		if(mode == 0) {
			if(element.style.display == 'block' ) {
				element.style.display = 'none';
				img.src = 'img/plus.png';
			} else {
				element.style.display = 'block';
				img.src = 'img/moins.png';
			}
		} else if(mode == 1) {
			element.style.display = 'block';
			img.src = 'img/moins.png';
		} else if(mode == -1) {
			element.style.display = 'none';
			img.src = 'img/plus.png';
		}
	}
}
// Popup d'aperÃ§u d'un produit
function ouvrirApercu(img) {
	window.open('./apercu_'+img+'.html','AperÃ§u du produit '+img,'width=500,height=400,directories=0,location=0,menubar=0,toolbar=0');
}

// Joue sur le visibility d'un élément
function affiche(div,etat) {
	document.getElementById(div).style.visibility = (etat==1) ? "visible" : "hidden";
}

// Joue sur le display d'un Ã©lÃ©ment
function montre(div,etat) {
	document.getElementById(div).style.display = (etat==1) ? "block" : "none";
}

function resizeMe() {
	var img = document.getElementById('bigpreview');
	lImg = img.width+20;
	hImg = img.height+70;
	window.resizeTo(lImg,hImg);
	window.moveTo(100,100);
}

// Fonction d'ajout aux favoris
function addToBookmarks(url,title) {
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  window.external.AddFavorite(url,title);
  } else if (navigator.appName == "Netscape") {
    window.sidebar.addPanel(title,url,"");
  } else {
    alert("Faites CTRL+D (Netscape) ou CTRL+T (Opera) pour ajouter aux favoris");
  }
}

function search(asp) {
	getAjax('txt','/index/cdc?asp='+asp,'coupdecoeur');

	select = Math.round((arry_cdc.length - 1) * Math.random());
	setTimeout('search(\''+arry_cdc[select]+'\')',8000);
}

function gestionReponse(xhr){
    if (xhr.status == 200) {
        document.getElementById('coupdecoeur').innerHTML = xhr.responseText;
    }
}

function simpleGoTo(u) {
	document.location.href=u;
}

function blankGoTo(u) {
	window.open(u);
}

function page(pg) {
	directGoTo(urlbase+'?p='+pg);
}

function actionsubmit(form,url) {
	document.getElementById(form).action = url;
	document.getElementById(form).submit();
}
