<!--
function AgregarFavoritos(Titulo,URL) {
	if (navigator.appName=="Netscape") {
		window.sidebar.addPanel(Titulo,URL,""); 
	}
	if (navigator.appName=="Microsoft Internet Explorer"){
		window.external.AddFavorite(URL,Titulo);
	}
}

function EnviarPagina() {
	script = "http://www.alfombraswall.com.ar/enviarpagina.php";
	referer = document.location;
	url = script+"?url="+referer;
	name = '_blank';
	features = 'width=420,height=380';
	window.open(url,name,features);
}

function items(id){
	ocultaItems()
	var obj = document.getElementById('item_' + id)
	if(obj.style.display == 'block') obj.style.display = 'none'
	else obj.style.display = 'block'
}
function ocultaItems(){
	listado = document.getElementById('listaItem')
	contenedores = listado.getElementsByTagName('div')
	numContenedores = contenedores.length
	for(m=0; m < numContenedores; m++){
		if(contenedores[m].id.indexOf('item_') == 0)
		contenedores[m].style.display = 'none'
	}
}

// ------------------------------------------------------------

function mostrar(id){
	var obj = document.getElementById('fila_' + id)
	if(obj.style.display == 'none') { 
		ocultar()
		obj.style.display = 'block'
	} else {
		obj.style.display = 'none'
	}
}
function ocultar(){
	listado = document.getElementById('lista')
	contenedores = listado.getElementsByTagName('dd')
	numContenedores = contenedores.length
	for(m=0; m < numContenedores; m++){
		if(contenedores[m].id.indexOf('fila_') == 0)
		contenedores[m].style.display = 'none'
	}
}

function mostrar_info(id){
	obj1 = document.getElementById('marca_' + id)
	obj2 = document.getElementById('info_' + id)
	obj1.className  = "logo"
	if(obj2.style.display == 'none') { 		
		ocultar_info()
		obj1.className  = "logoExp"
		obj2.style.display = 'block'		
	} else {
		obj2.style.display = 'none'
	}
}
function ocultar_info(){
	listado_info = document.getElementById('lista_info')
	contenedores_info = listado_info.getElementsByTagName('div')
	numContenedores_info = contenedores_info.length
	for(n=0; n < numContenedores_info; n++){
		if(contenedores_info[n].id.indexOf('info_') == 0)
		contenedores_info[n].style.display = 'none'
		if(contenedores_info[n].className.indexOf('logo') == 0)
		contenedores_info[n].className = "logo"
	}
}

// --- Prohibir click derecho --- //

var message = ""; 

function clickIE(){ 
	if (document.all){ 
		(message); 
		return false; 
	} 
} 

function clickNS(e){ 
	if (document.layers || (document.getElementById && !document.all)){ 
		if (e.which == 2 || e.which == 3){ 
		(message); 
		return false; 
		} 
	} 
} 

if (document.layers){ 
	document.captureEvents(Event.MOUSEDOWN); 
	document.onmousedown = clickNS; 
} else { 
	document.onmouseup = clickNS; 
	document.oncontextmenu = clickIE; 
} 
document.oncontextmenu = new Function("return true") // false

// --- MENU IMAGENES CON FRASE EN OVER --- //

startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace
        (" over", "");
   }
   }
  }
 }
}
window.onload=startList;


// --- Validar Formularios --- //

/* 
DENTRO DEL HTML
function validar(form) {
	with (form) {
		if (validarVacio(Apellido,"Apellido")==false) {return false;};
		if (validarAlfabetico(Apellido,"Apellido")==false) {return false;};
		if (validarVacio(Nombre,"Nombre")==false) {return false;};
		if (validarAlfabetico(Nombre,"Nombre")==false) {return false;};
		if (validarVacio(Domicilio,"Domicilio")==false) {return false;};
		if (validarVacio(Localidad,"Localidad")==false) {return false;};
		if (validarVacio(CodPos,"CP")==false) {return false;};
		if (validarAlfanumerico(CodPos,"CP")==false) {return false;};
		if (validarVacio(TelParticular,"Telefono Particular")==false) {return false;};
		if (validarAlfanumerico(TelParticular,"Telefono Particular")==false) {return false;};		
		if (validarVacio(TelMensajes,"Telefono Mensajes")==false) {return false;};
		if (validarAlfanumerico(TelMensajes,"Telefono Mensajes")==false) {return false;};
		if (validarVacio(DNI,"Numero de Documento")==false) {return false;};
		if (validarNumero(DNI,"Numero de Documento")==false) {return false;};
		if (validarNumero(CI,"Numero de Cedula")==false) {return false;};
	}
}
DENTRO DE LA ETIQUETA FORM
onsubmit="return validar(this)"
*/

function validarVacio (input, nombre) {
	if( input.style )
		input.style.backgroundColor = "#FFF";

	if ( (input.value==null) || (input.value.length==0) ) {
		alert("El campo "+nombre+" es obligatorio.");
		input.focus();
		input.style.backgroundColor = "#EFEFEF";
		return false;
	}
	return true;
}

function validarFecha (input, nombre) {
	if( input.style )
		input.style.backgroundColor = "#FFF";

	var ValidChars = "0123456789-/";
	var Char;

	for (i = 0; i < input.value.length; i++) { 
		Char = input.value.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) {
			alert("El campo "+nombre+" debe tener formato de fecha.");
			input.focus();
			input.style.backgroundColor = "#EFEFEF";
			return false;
		}
	}
	return true;
}


function validarNumero (input, nombre) {
	if( input.style )
		input.style.backgroundColor = "#FFF";

	var ValidChars = "0123456789";
	var Char;

	for (i = 0; i < input.value.length; i++) { 
		Char = input.value.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) {
			alert("El campo "+nombre+" debe contener solo numeros.");
			input.focus();
			input.style.backgroundColor = "#EFEFEF";
			return false;
		}
	}
	return true;
}


function validarNumeroMayorCero (input, nombre) {
	if( input.style )
		input.style.backgroundColor = "#FFF";

	var ValidChars = "0123456789.";
	var Char;

	for (i = 0; i < input.value.length; i++) { 
		Char = input.value.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) {
			alert("El campo "+nombre+" debe contener solo numeros.");
			input.focus();
			input.style.backgroundColor = "#EFEFEF";
			return false;
		}
	}
	if( input.value == 0 ) {
		alert("El campo "+nombre+" debe contener un número mayor a cero.");
		input.focus();
		input.style.backgroundColor = "#EFEFEF";
		return false;
	}
	return true;
}


function validarEmail (input, nombre) {
	if( input.style )
		input.style.backgroundColor = "#FFF";

	if ((input.value == "") ||
	    (input.value == null) ||
	    (input.value.indexOf('@') == -1) || 
	    (input.value.indexOf('.') == -1)) {
		alert("El campo "+nombre+" debe contener una dirección de Email válida.");
		input.focus();
		input.style.backgroundColor = "#EFEFEF";
		return false;
	}
	return true;
}

function validarAlfanumerico (input, nombre) {
	if( input.style )
		input.style.backgroundColor = "#FFF";

	var ValidChars = "ABCDEFGHIJKLMNÑOPQRSTUVWXYZabcdefghijklmnñopqrstuvwxyz0123456789áéíóúÁÉÍÓÚäëïöü.-,° _\"\\/#$&'()*+:;=<>?@[]^";
	var Char;

	for (i = 0; i < input.value.length; i++) { 
		Char = input.value.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) {
			alert("El campo "+nombre+" debe contener solo caracteres alfanumericos.");
			input.focus();
			input.style.backgroundColor = "#EFEFEF";
			return false;
		}
	}
	return true;
}

function validarAlfabetico (input, nombre) {
	if( input.style )
		input.style.backgroundColor = "#FFF";

	var ValidChars = "ABCDEFGHIJKLMNÑOPQRSTUVWXYZabcdefghijklmnñopqrstuvwxyzáéíóúÁÉÍÓÚäëïöü '`";
	var Char;

	for (i = 0; i < input.value.length; i++) { 
		Char = input.value.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) {
			alert("El campo "+nombre+" debe contener solo caracteres del alfabeto.");
			input.focus();
			input.style.backgroundColor = "#EFEFEF";
			return false;
		}
	}
	return true;
}

function validarInput(tipo, input, nombre) {
	var ret = false;

	switch(tipo) {
		case 'vacio':
			ret = validarVacio(input, nombre);
			break;
		case 'numero':
			ret = validarNumero(input, nombre);
			break;
		case 'email':
			ret = validarEmail(input, nombre);
			break;
		case 'alfanumerico':
			ret = validarAlfanumerico(input, nombre);
			break;
		case 'alfabetico':
			ret = validarAlfabetico (input, nombre);
			break;
		case 'fecha':
			ret = validarFecha (input, nombre);
			break;
		default:
			ret = false;
			break;
	}
	return ret;
}

