<!--
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.scuadra.com/enviarpagina.php";
	referer = document.location;
	url = script+"?url="+referer;
	name = '_blank';
	features = 'width=420,height=380';
	window.open(url,name,features);
}

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

function MostrarFecha()
   {
   var nombres_dias = new Array("Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado")
   var nombres_meses = new Array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre")

   var fecha_actual = new Date()

   dia_mes = fecha_actual.getDate()		//dia del mes
   dia_semana = fecha_actual.getDay()		//dia de la semana
   mes = fecha_actual.getMonth() + 1
   anio = fecha_actual.getFullYear()

   //escribe en pagina
   //document.write(nombres_dias[dia_semana] + ", " + dia_mes + " de " + nombres_meses[mes - 1] + " de " + anio)
	document.write("Buenos Aires, " + dia_mes + " de " + nombres_meses[mes - 1] + " de " + anio)
   }

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

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'
	}
}

// --- 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

// --- 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;
}

// --- Igualar alto de columnas --- //
	function altura(){
		al = new Array();
		max = 0;
		try{
			if(document.getElementById){
				for(i=0;i<arguments.length;i++){
					if(document.getElementById(arguments[i]))
						al[i] = document.getElementById(arguments[i]).offsetHeight;
				}
				max = mayor(al);
				if(max > 0){
					for(i=0;i<arguments.length;i++){
						if(document.getElementById(arguments[i]))
							document.getElementById(arguments[i]).style.height = max + 'px';
					}
				}
			}
		}
		catch (exc) {
			alert("Se ha producido un error en la carga del CSS. La página seguirá operativa pero algo más lenta.");
			throw exc;
		}
	}
	function mayor(datos){
		salida = 0;
		for(i=0;i<datos.length;i++){
			if(parseInt(datos[i]) > salida)
				salida = datos[i];
		}
		return salida;
	}
