// tableau des listes croisees
if (!crossedList) {
	var crossedList = new Array();
	// compteur de liste croisee
	var cptCrossedList = 0;
}

function changeTheme1(numList, list, indice) {
	var elt = list.parentNode.parentNode.parentNode.childNodes;
	for (var i = 0; i < elt.length; i++) {
		if (elt[i].className == "listHead listHeadCroisee") {
			elt = elt[i].getElementsByTagName("form")[0].getElementsByTagName("select")[0];

			elt.options.length = 0;
			for (var j = 0; j < crossedList[numList].theme1[indice].key.length; j++) {
				var label = crossedList[numList].theme2[crossedList[numList].theme1[indice].key[j]].label;
				var optionTmp = crossedList[numList].theme2[crossedList[numList].theme1[indice].key[j]].key;

				var option = new Option(label, optionTmp);
				elt.options[elt.options.length] = option;
			}
			elt.options[0].selected = true;

			break;
		}
	}

	if (crossedList[numList].blockAffiche!= null) {
		crossedList[numList].blockAffiche.style.display = "none";
		crossedList[numList].blockAffiche = null;
	}

}

function changeTheme2(numList, list, indice) {
	var elt = list.parentNode.parentNode.parentNode.childNodes;
	var j = 0;

	if (crossedList[numList].blockAffiche != null) {
		crossedList[numList].blockAffiche.style.display = "none";
		crossedList[numList].blockAffiche = null;
	}

	for (var i = 0; i < elt.length; i++) {
		if (elt[i].className == "listBody") {
			j++;

			if (j == indice) {
				crossedList[numList].blockAffiche = elt[i];
                                crossedList[numList].blockAffiche.style.display = "block";
                                jQuery(elt[i]).find('img.visualsImg').attr("height", function(){
                                        var newImg=new Image();
                                        newImg.src=this.src;
                                        return newImg.height;
                                });
                                jQuery(elt[i]).find('img.visualsImg').attr("width", function(){
                                        var newImg=new Image();
                                        newImg.src=this.src;
                                        return newImg.width;
                                });
				break;
			}
		}
	}
}

