// JavaScript Document
window.onerror = null;

//initialise all variables

var olddiv = 0;   //this will become a reference to the object that is being shown or was last shown
                  //in all cases, the object that is shown/hidden will be a <div ..> element

/*function getRefToDivNest( divID, oDoc ) {
	if( !oDoc ) { oDoc = document; }
	if( document.layers ) {
		if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
			for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
				y = getRefToDivNest(divID,oDoc.layers[x].document); }
			return y; } }
	if( document.getElementById ) { return document.getElementById(divID); }
	if( document.all ) { return document.all[divID]; }
	return document[divID];
}*/

function showdiv(thisdiv) {
	document.getElementById(thisdiv).style.display = 'block';
}

function hdiv(thisdiv) {
	
	document.getElementById(thisdiv).style.display = 'none';
}

//Use only to do swap
function hidediv() {
	if( olddiv ) {
		if( olddiv.style ) {
			//DOM compliant
			olddiv.style.visibility = 'hidden';
		} else {
			//Netscape and old versions of Mozilla compliant
			olddiv.visibility = 'hide';
		}
		//No need for else notifyFail()
		//If it was going to fail, it would have failed while it was being shown
	}
	olddiv = false;
}

function notifyFail() {
	
}

function addItem(divID,imgURL,aLink,aDesc) {

	document.write("<li>");	
		document.write("<div id='"+divID+"' ");
			document.write(" style='background-image:url("+imgURL+");' ");
			document.write("class='sans-roll-over'>");
			document.write("<img src='../../medias/produits/filet-gch.gif' align='right'  border='0' >");
		document.write("</div>");
	document.write("<div class='sans-roll-over-texte' >");
		document.write("<img src='../../medias/produits/filet-dt.gif' align='middle' border='0' >");
		document.write("<a href='"+aLink+"' name=''  id=notselected>");
		document.write("<span onMouseOver=showdiv('"+divID+"'); onMouseOut=hdiv('"+divID+"')>");
		document.write(aDesc+"</span></a>");
	document.write("</div>");
	document.write("</li>");
	
}


function addSelectedItem(divID,imgURL,aLink,aDesc) {

	document.write("<li>");	
		document.write("<div id='"+divID+"' ");
			document.write(" style='background-image:url("+imgURL+");' ");
			document.write("class='sans-roll-over'>");
			document.write("<img src='../../medias/produits/filet-gch.gif' align='right'  border='0' >");
		document.write("</div>");
	document.write("<div class='sans-roll-over-texte' >");
		document.write("<img src='../../medias/produits/filet-dt.gif' align='middle' border='0' >");
		document.write("<a href='"+aLink+"' name=''  id=selected>");
		document.write("<span onMouseOver=showdiv('"+divID+"'); onMouseOut=hdiv('"+divID+"')>");
		document.write(aDesc+"</span></a>");
	document.write("</div>");
	document.write("</li>");
	
}


