function launch_select(numLinea, id, idToChange, lang) {
	array_valores3rd = new Array();

	array_valores3rd[0] =	"third_select_"+numLinea+"__sillas";
	array_valores3rd[1] =	"third_select_"+numLinea+"__mesas";
	array_valores3rd[2] =	"third_select_"+numLinea+"__complementos";
	array_valores3rd[3] =	"third_select_"+numLinea+"__modular";
	array_valores3rd[4] =	"third_select_"+numLinea+"__diseno";
	array_valores3rd[5] =	"third_select_"+numLinea+"__construccion";

	idToBlock = "third_select_"+numLinea+"__"+document.getElementById(id).value;

	for (var i=0;i<=5;i++){
		if (idToBlock == array_valores3rd[i]){
 			document.getElementById(array_valores3rd[i]).style.display = "block";
		}else {
 			document.getElementById(array_valores3rd[i]).style.display = "none";
		}
	}

 	launch_img_preview (numLinea,document.getElementById(id).value,lang);
}

function launch_img_preview (numLinea,familia,lang){
// seleccione un elemento..
	if (document.getElementById("item_"+numLinea+"__"+familia).value == "selectItem") {
		document.getElementById("img_"+numLinea+"__div").innerHTML = "<img src=\"addonsdata/catalogo/fotos/nodisponible.gif\"/>\n";
	}else {
		switch (familia){
			case "sillas":
				idTabla = 0;
				break;
			case "mesas":
				idTabla = 1;
				break;
			case "complementos":
				idTabla = 2;
				break;
			case "modular":
				idTabla = 3;
				break;
			case "diseno":
				idTabla = 4;
				break;
			case "construccion":
				idTabla = 5;
				break;
			default:
				idTabla = 0;
		}

		id_Imagen = document.getElementById("item_"+numLinea+"__"+familia).value;
		id_Imagen = id_Imagen.split("__");

		if (id_Imagen[1] == "NONE") {
			srcImg = "addonsdata/catalogo/fotos/nodisponible.gif";
		}else{
			srcImg = "addonsdata/catalogo/fotos/"+familia+"/"+id_Imagen[1];
		}

		document.getElementById("img_"+numLinea+"__div").innerHTML = "<a href=\"#\" onclick=\"javascript: "
			+"popUpWindow('"+id_Imagen[0]+"','"+idTabla+"','"+lang+"'); return false;\">\n"
			+"	<img src=\""+srcImg+"\"/>\n"
			+"</a>\n";
	}
}

function popUpWindow (id,idTabla,lang){
	ancho = (screen.width-480)/2;
	alto = (screen.height-480)/2;
	window.open("popUpConfig.php?id="+id+"&tb="+idTabla+"&lang="+lang,"MODELO","toolbar=NO,location=NO,directories=NO,channelmode=NO,menubar=NO,status=NO,scrollbars=NO,resizable=NO,width=480,height=300,left="+ancho+",top="+alto );
}

function fillChecker (lang) {
	if (document.getElementById("empresa").value == "" || document.getElementById("email").value == "") {
		var texto;
		switch (lang) {
			case "es":
				texto = "Debe rellenar como minimo los campos de empresa y de email";
				break;
			case "en":
				texto = "You must fill company and email fields at least";
				break;
			case "pt":
				texto = "Pelo minimo debe encher os campos de companhia e de email";
				break;
		}
		alert (texto);
		return false;
	}else{
		return true;
	}
}