var anchof;
var altof;
// JavaScript Document
function handleHttpResponse() {
if (http.readyState == 4) {
if (http.status == 200) {
if (http.responseText.indexOf('invalid') == -1) {
	
// Armamos un array, usando la coma para separar elementos
//results = http.responseText.split(",");
//cargamsn(results[0],180,70)
if(http.responseText=="1"){
	document.location.href="admin/default.asp";
}else{
	cierracapa();
	cargamsn(http.responseText,280,140);
}
enProceso = false;
}
}
}
}

function handleHttpResponse2() {
if (http.readyState == 4) {
if (http.status == 200) {
if (http.responseText.indexOf('invalid') == -1) {
	
// Armamos un array, usando la coma para separar elementos
//results = http.responseText.split(",");
//cargamsn(results[0],180,70)
if(http.responseText=="1"){
	document.location.href="admin/default.asp";
}else{
	cierracapa();
	opacity('contenido', 30, 100, 2000);
	document.getElementById("contenido").innerHTML=http.responseText;
	
}
enProceso = false;
}
}
}
}

// JavaScript Document
function handleHttpResponse3() {
if (http.readyState == 4) {
if (http.status == 200) {
if (http.responseText.indexOf('invalid') == -1) {
	
// Armamos un array, usando la coma para separar elementos
//results = http.responseText.split(",");
//cargamsn(results[0],180,70)
if(http.responseText=="1"){
	document.location.href="admin/default.asp";
}else{
	cierracapa();
	anchof=parseInt(anchof)+250;
	altof=parseInt(altof)+42;
	cargaproducto(http.responseText,anchof,altof);
}
enProceso = false;
}
}
}
}

// JavaScript Document
function handleHttpResponsenoticia() {
if (http.readyState == 4) {
if (http.status == 200) {
if (http.responseText.indexOf('invalid') == -1) {
	
// Armamos un array, usando la coma para separar elementos
//results = http.responseText.split(",");
//cargamsn(results[0],180,70)
if(http.responseText=="1"){
	document.location.href="admin/default.asp";
}else{
	cierracapa();
	anchof=parseInt(anchof)+250;
	altof=parseInt(altof)+42;
	cargaproducto2(http.responseText,anchof,altof);
}
enProceso = false;
}
}
}
}

// JavaScript Document
function handleHttpResponse4() {
if (http.readyState == 4) {
if (http.status == 200) {
if (http.responseText.indexOf('invalid') == -1) {
	
// Armamos un array, usando la coma para separar elementos
//results = http.responseText.split(",");
//cargamsn(results[0],180,70)
if(http.responseText=="1"){
	document.location.href="admin/default.asp";
}else{
	cierracapa();
	anchof=parseInt(anchof)+250;
	altof=parseInt(altof)+42;
	cargamsn2(http.responseText,anchof,altof);
}
enProceso = false;
}
}
}
}


function verificaUsuario() {
getHTTPObject();
if (!enProceso) {
var valor = escape(document.form1.usuario.value);
var valor2 = escape(document.form1.password.value);
var valor3;
if(document.form1.cbxRemember.checked==true)
	valor3="1";
else
	valor3="0";
var url = "consulta.asp?usuario="+ valor+"&password="+valor2+"&recuerda="+valor3;
http.open("GET", url, true);
var cade='<table width="100%" style="margin:0px;"><tr><td align="center" valign="middle"><table border="0" align="center" cellpadding="5" cellspacing="0"><tr><td class="textoespera"><img src="images/progress.gif" width="16" height="16" hspace="2" vspace="5" alt="Cargando" /><br />Verificando usuario.<br /> Por Favor Espere.</td></tr></table></td></tr></table>';
cargamsn(cade,300,150)
http.onreadystatechange = handleHttpResponse;
enProceso = true;
http.send(null);
}
}

function verTablaProductos(familia) {
	parent.document.getElementById("ifra").src="familias.asp?muestra=si&familia="+familia+"&";
}

function verfamilias(linea,familia) {
	parent.document.getElementById("ifra").src="familias.asp?familia="+familia+"&linea="+ linea+"&";
}

function verproducto(producto,ancho,alto) {
	anchof=ancho;
	altof=alto;
	getHTTPObject();
	if (!enProceso) {
	var url = "verTablaProducto.asp?producto="+ producto;
	http.open("GET", url, true);
	var cade='<table width="100%" style="margin:0px;"><tr><td align="center" valign="middle"><table border="0" align="center" cellpadding="5" cellspacing="0"><tr><td class="textoespera"><img src="images/progress.gif" width="16" height="16" hspace="2" vspace="5" alt="Cargando" /><br />Buscando productos.<br /> Por Favor Espere.</td></tr></table></td></tr></table>';
	cargaproducto(cade,300,150)
	http.onreadystatechange = handleHttpResponse3;
	enProceso = true;
	http.send(null);
	}
}

function vernoticia(id,ancho,alto) {
	anchof=ancho;
	altof=alto;
	getHTTPObject();
	if (!enProceso) {
	var url = "verTablaNoticias.asp?id="+ id;
	http.open("GET", url, true);
	var cade='<table width="100%" style="margin:0px;"><tr><td align="center" valign="middle"><table border="0" align="center" cellpadding="5" cellspacing="0"><tr><td class="textoespera"><img src="images/progress.gif" width="16" height="16" hspace="2" vspace="5" alt="Cargando" /><br />Buscando noticias.<br /> Por Favor Espere.</td></tr></table></td></tr></table>';
	cargaproducto(cade,300,150);
	http.onreadystatechange = handleHttpResponsenoticia;
	enProceso = true;
	http.send(null);
	}
}


function verproducto3(producto,ancho,alto) {
	anchof=ancho;
	altof=alto;
	getHTTPObject();
	if (!enProceso) {
	var url = "../verTablaProducto2.asp?producto="+ producto;
	http.open("GET", url, true);
	var cade='<table width="100%" style="margin:0px;"><tr><td align="center" valign="middle"><table border="0" align="center" cellpadding="5" cellspacing="0"><tr><td class="textoespera"><img src="../images/progress.gif" width="16" height="16" hspace="2" vspace="5" alt="Cargando" /><br />Buscando productos.<br /> Por Favor Espere.</td></tr></table></td></tr></table>';
	cargamsn(cade,300,150)
	http.onreadystatechange = handleHttpResponse3;
	enProceso = true;
	http.send(null);
	}
}

function verproducto2(producto,ancho,alto) {
	anchof=ancho;
	altof=alto;
	getHTTPObject();
	if (!enProceso) {
	var url = "verTablaProducto.asp?producto="+ producto;
	http.open("GET", url, true);
	var cade='<table width="100%" style="margin:0px;"><tr><td align="center" valign="middle"><table border="0" align="center" cellpadding="5" cellspacing="0"><tr><td class="textoespera"><img src="images/progress.gif" width="16" height="16" hspace="2" vspace="5" alt="Cargando" /><br />Buscando productos.<br /> Por Favor Espere.</td></tr></table></td></tr></table>';
	cargamsn(cade,300,150)
	http.onreadystatechange = handleHttpResponse4;
	enProceso = true;
	http.send(null);
	}
}

function verificaEmail() {
getHTTPObject();
if (!enProceso) {
var valor = escape(document.form1.email.value);
var url = "consulta2.asp?email="+ valor;
http.open("GET", url, true);
var cade='<table width="100%" style="margin:0px;"><tr><td align="center" valign="middle"><table border="0" align="center" cellpadding="5" cellspacing="0"><tr><td class="textoespera"><img src="images/progress.gif" width="16" height="16" hspace="2" vspace="5" alt="Cargando" /><br />Verificando email.<br /> Por Favor Espere.</td></tr></table></td></tr></table>';
cargamsn(cade,300,150)
http.onreadystatechange = handleHttpResponse;
enProceso = true;
http.send(null);
}
}

function verificaAlta() {
getHTTPObject();
if (!enProceso) {
var nombre=escape(document.form2.nombre.value);
var apellido1=escape(document.form2.apellido1.value);
var nombreempresa=escape(document.form2['nombre_empresa'].value);
var razonsocial=escape(document.form2['razon_social'].value);
var cif=escape(document.form2.cif.value);
var telefono=escape(document.form2.telefono.value);
var email=escape(document.form2.email.value);
var apellido2=escape(document.form2.apellido2.value);
var nif=escape(document.form2.nif.value);
var cargo=escape(document.form2.cargo.value);
var pais=escape(document.form2.pais.value);
var provincia=escape(document.form2.provincia.value);
var localidad=escape(document.form2.localidad.value);
var cp=escape(document.form2.cp.value);
var direccion=escape(document.form2.direccion.value);
var movil=escape(document.form2.movil.value);
var fax=escape(document.form2.fax.value);
var web=escape(document.form2.web.value);
var descripcion=escape(document.form2.descripcion.value);
var categoriacliente=escape(document.form2['categoria_cliente'].value);

var url = "altas.asp?nombre="+ nombre+"&apellido1="+apellido1+"&apellido2="+apellido2+"&nombre_empresa="+nombreempresa+"&razon_social="+razonsocial+"&cif="+cif+"&telefono="+telefono+"&email="+email+"&nif="+nif+"&cargo="+cargo+"&pais="+pais+"&provincia="+provincia+"&localidad="+localidad+"&cp="+cp+"&direccion="+direccion+"&movil="+movil+"&fax="+fax+"&web="+web+"&descripcion="+descripcion+"&categoria_cliente="+categoriacliente;

http.open("GET", url, true);

var cade='<table width="100%" style="margin:0px;"><tr><td align="center" valign="middle"><table border="0" align="center" cellpadding="5" cellspacing="0"><tr><td class="textoespera"><img src="images/progress.gif" width="16" height="16" hspace="2" vspace="5" alt="Cargando" /><br />Procesando datos.<br /> Por Favor Espere.</td></tr></table></td></tr></table>';
cargamsn(cade,300,150)

http.onreadystatechange = handleHttpResponse;
enProceso = true;
http.send(null);
}
}

function cambiafoto(id){	
	document.location.href="cambiafoto.asp?id="+id;	
}

function cambiafoto2(id){
	document.location.href="cambiafoto2.asp?id="+id;	
}

function enviacontacto() {
getHTTPObject();
if (!enProceso) {
var nombre=escape(document.form2.nombre.value);
var nombreempresa=escape(document.form2['nombre_empresa'].value);
var telefono=escape(document.form2.telefono.value);
var email=escape(document.form2.email.value);
var descripcion=escape(document.form2.descripcion.value);

var url = "enviacontacto.asp?nombre="+ nombre+"&nombreempresa="+nombreempresa+"&telefono="+telefono+"&email="+email+"&descripcion="+descripcion;
http.open("GET", url, true);

var cade='<table width="100%" style="margin:0px;"><tr><td align="center" valign="middle"><table border="0" align="center" cellpadding="5" cellspacing="0"><tr><td class="textoespera"><img src="images/progress.gif" width="16" height="16" hspace="2" vspace="5" alt="Cargando" /><br />Procesando datos.<br /> Por Favor Espere.</td></tr></table></td></tr></table>';
cargamsn(cade,300,150)

http.onreadystatechange = handleHttpResponse;
enProceso = true;
http.send(null);
}
}

function getHTTPObject() {
var xmlhttp;
/*@cc_on
@if (@_jscript_version >= 5)
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) { xmlhttp = false; }
}
@else
xmlhttp = false;
@end @*/
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) { xmlhttp = false; }
}
return xmlhttp;
}

function vercliente(quien){
	document.location.href="datoscliente.asp?id_cliente="+quien+"&";
}

function verusuario(quien){
	document.location.href="datosusuario.asp?id_cliente="+quien+"&";
}

function nuevo(quien){
	if(quien=="usuario")
		document.location.href="nuevousuario.asp";
	else
		document.location.href="nuevocliente.asp";
}

function refresca(){
	var sURL = unescape(window.location.pathname);	
	document.location.href = sURL;
}

function cambiaunidad(check,num){
	if(check.checked==true){
		document.getElementById("unid"+String(num)).value="5001";
		document.getElementById("chkOferta"+String(num)).checked=true;
	}else{
		document.getElementById("unid"+String(num)).value="200";
		document.getElementById("chkOferta"+String(num)).checked=false;
	}
}

function cambiaoferta(check,num){
	if(check.checked==false){
		document.getElementById("unid"+String(num)).value="200";
		document.getElementById("chkPersonaliza"+String(num)).checked=false;
	}
}

function cargatabla(){
	var cadena,numfotos,columnas;
	numfotos=30;
	columnas=5;
	cadena="<table width='100%'>";
	for(i=0;i<numfotos;i++){
		nomfoto="foto"+i;
		if(((i)%columnas)==0)
			cadena+="<tr>";
		cadena+="<td align='center'><div id='"+nomfoto+"'><a href='javascript:cargaimg(\"images/amenitiesgran1.jpg\",390,500);'><img src='images/amenitiespeq1.jpg' vspace='7' border='0' alt='foto"+i+"'/></a></div><td>";
		if(((i+1)%columnas)==0)
			cadena+="</tr>";
	}
	cadena+="<table>";
	document.getElementById('contenido').style.height="429px";
	document.getElementById('contenido').style.width="589px";
	document.getElementById('contenido').style.overflow="auto";
	opacity('contenido', 30, 100, 1000);
	document.getElementById('contenido').innerHTML=cadena;
}

// Saca popups en capas, con tres parametros, imagen, ancho y alto
function cargaimg(imagen,ancho,alto){
	opacity('capafoto', 30, 100, 1000);
	document.getElementById("capafondo").style.visibility="visible";
	document.getElementById("capafondo").style.display="block";
	document.getElementById("capafoto").style.visibility="visible";
	document.getElementById("capafoto").style.display="block";
	document.getElementById("capafoto").innerHTML="<table border='0' cellspacing='0' cellpadding='0'><tr><td  bgcolor='#FFFFFF'><a href='javascript:cierracapa();'><img src='"+imagen+"' height='"+alto+"px' width='"+ancho+"px' id='fotogran' alt='Cerrar' border='0' style='border:solid 1px #4C6372;'/></a></td><td valign='top'><a href='javascript:cierracapa();'><div id='botcerrar'>Cerrar</div></a></td></tr></table>";
	
	document.getElementById("capafoto").style.top="50%";
	document.getElementById("capafoto").style.left="50%";
	document.getElementById("capafoto").style.marginLeft=-(ancho/2)+"px";
	document.getElementById("capafoto").style.marginTop=-(alto/2)+"px";
	if(!document.all){// es firefox
		document.getElementById("capafoto").style.width=ancho+"px";
		document.getElementById("capafoto").style.height=alto+"px";
	}
}
var cadena2="<br />Registrese o inserte su email. Le enviaremos su password<br /><br /><input name='email' type='text' class='cajastexto' id='email' maxlength='100' size='30'>&nbsp;&nbsp;<input type='button' value='Enviar' class='boton' onclick='javascript:verificaEmail();'>&nbsp;&nbsp;<input onclick='javascript:cierracapa();' type='button' class='boton' value='Cerrar'><br /><br /><a href='javascript:cierracapa();daraltas();'>Tambien puede darse de alta</a><br /><br />";
// Saca popups en capas, con tres parametros, imagen, ancho y alto
function cargamsn(texto,ancho,alto){
	opacity('capafoto', 30, 100, 1000);
	document.getElementById("capafondo").style.visibility="visible";
	document.getElementById("capafondo").style.display="block";
	document.getElementById("capafoto").style.visibility="visible";
	document.getElementById("capafoto").style.display="block";
	document.getElementById("capaframe").style.visibility="visible";
	document.getElementById("capaframe").style.display="block";
	document.getElementById("capafoto").innerHTML='<table height='+alto+'px width='+ancho+'px border="0" align="center" cellpadding="0" cellspacing="0" style="border:solid 1px #4C6372" valign="top"><tr><td height="20px" align="right" valign="top"><img src="images/barra.gif" width="100%" border="0" height="20px"></td></tr><tr><td align="center" valign="middle" bgcolor="#FFFFFF" class="txtgeneral">'+texto+'</td></tr></table></td></tr></table>';
	
	document.getElementById("capafoto").style.top="50%";
	document.getElementById("capafoto").style.left="50%";
	document.getElementById("capafoto").style.marginLeft=-(ancho/2)+"px";
	document.getElementById("capafoto").style.marginTop=-(alto/2)+"px";
	document.getElementById("capaframe").style.width=ancho;
	document.getElementById("capaframe").style.height=alto;
	document.getElementById("capaframe").style.top="50%";
	document.getElementById("capaframe").style.left="50%";
	document.getElementById("capaframe").style.marginLeft=-(ancho/2)+"px";
	document.getElementById("capaframe").style.marginTop=-(alto/2)+"px";
	
	if(!document.all){// es firefox
		document.getElementById("capafoto").style.width=ancho+"px";
		document.getElementById("capafoto").style.height=alto+"px";
		document.getElementById("capaframe").style.width=ancho+"px";
		document.getElementById("capaframe").style.height=alto+"px";
	}
}


function cargaproducto2(texto,ancho,alto){
	opacity('capafoto', 30, 100, 1000);
	document.getElementById("capafondo").style.visibility="visible";
	document.getElementById("capafondo").style.display="block";
	document.getElementById("capafoto").style.visibility="visible";
	document.getElementById("capafoto").style.display="block";
	document.getElementById("capaframe").style.visibility="visible";
	document.getElementById("capaframe").style.display="block";
	document.getElementById("capafoto").innerHTML='<table height='+alto+'px width='+ancho+'px border="0" align="center" cellpadding="0" cellspacing="0" style="border:solid 1px #4C6372" valign="top"><tr><td height="20px" align="right" valign="top"><img src="images/barra.gif" width="100%" border="0" height="20px"></td></tr><tr><td align="center" valign="middle" bgcolor="#FFFFFF" class="txtgeneral">'+texto+'</td></tr></table></td></tr></table>';
	document.getElementById("capafoto").style.top="50%";
	document.getElementById("capafoto").style.left="50%";
	document.getElementById("capafoto").style.marginLeft=-(ancho/2)+"px";
	document.getElementById("capafoto").style.marginTop=-(alto/2)+"px";
	document.getElementById("capaframe").style.width=ancho;
	document.getElementById("capaframe").style.height=alto;
	document.getElementById("capaframe").style.top="50%";
	document.getElementById("capaframe").style.left="50%";
	document.getElementById("capaframe").style.marginLeft=-(ancho/2)+"px";
	document.getElementById("capaframe").style.marginTop=-(alto/2)+"px";
	
	if(!document.all){// es firefox
		document.getElementById("capafoto").style.width=ancho+"px";
		document.getElementById("capafoto").style.height=alto+"px";
		document.getElementById("capaframe").style.width=ancho+"px";
		document.getElementById("capaframe").style.height=alto+"px";
	}
}


// Saca popups en capas, con tres parametros, imagen, ancho y alto
function cargaproducto(texto,ancho,alto){
	opacity('capafoto', 30, 100, 1000);
	parent.document.getElementById("capafondo").style.visibility="visible";
	parent.document.getElementById("capafondo").style.display="block";
	parent.document.getElementById("capafoto").style.visibility="visible";
	parent.document.getElementById("capafoto").style.display="block";
	parent.document.getElementById("capaframe").style.visibility="visible";
	parent.document.getElementById("capaframe").style.display="block";
	parent.document.getElementById("capafoto").innerHTML='<table height='+alto+'px width='+ancho+'px border="0" align="center" cellpadding="0" cellspacing="0" style="border:solid 1px #4C6372" valign="top"><tr><td height="20px" align="right" valign="top"><img src="images/barra.gif" width="100%" border="0" height="20px"></td></tr><tr><td align="center" valign="middle" bgcolor="#FFFFFF" class="txtgeneral">'+texto+'</td></tr></table></td></tr></table>';
	parent.document.getElementById("capafoto").style.top="50%";
	parent.document.getElementById("capafoto").style.left="50%";
	parent.document.getElementById("capafoto").style.marginLeft=-(ancho/2)+"px";
	parent.document.getElementById("capafoto").style.marginTop=-(alto/2)+"px";
	parent.document.getElementById("capaframe").style.width=ancho;
	parent.document.getElementById("capaframe").style.height=alto;
	parent.document.getElementById("capaframe").style.top="50%";
	parent.document.getElementById("capaframe").style.left="50%";
	parent.document.getElementById("capaframe").style.marginLeft=-(ancho/2)+"px";
	parent.document.getElementById("capaframe").style.marginTop=-(alto/2)+"px";
	
	if(!document.all){// es firefox
		parent.document.getElementById("capafoto").style.width=ancho+"px";
		parent.document.getElementById("capafoto").style.height=alto+"px";
		parent.document.getElementById("capaframe").style.width=ancho+"px";
		parent.document.getElementById("capaframe").style.height=alto+"px";
	}
}

function cargamsn2(texto,ancho,alto){
	opacity('capafoto', 30, 100, 1000);
	parent.document.getElementById("capafondo").style.visibility="visible";
	parent.document.getElementById("capafondo").style.display="block";
	parent.document.getElementById("capafoto").style.visibility="visible";
	parent.document.getElementById("capafoto").style.display="block";
	parent.document.getElementById("capaframe").style.visibility="visible";
	parent.document.getElementById("capaframe").style.display="block";
	parent.document.getElementById("capafoto").innerHTML='<table height='+alto+'px width='+ancho+'px border="0" align="center" cellpadding="0" cellspacing="0" style="border:solid 1px #4C6372" valign="top"><tr><td height="20px" align="right" valign="top"><img src="images/barra.gif" width="100%" border="0" height="20px"></td></tr><tr><td align="center" valign="middle" bgcolor="#FFFFFF" class="txtgeneral">'+texto+'</td></tr></table></td></tr></table>';
	
	parent.document.getElementById("capafoto").style.top="50%";
	parent.document.getElementById("capafoto").style.left="50%";
	parent.document.getElementById("capafoto").style.marginLeft=-(ancho/2)+"px";
	parent.document.getElementById("capafoto").style.marginTop=-(alto/2)+"px";
	parent.document.getElementById("capaframe").style.width=ancho;
	parent.document.getElementById("capaframe").style.height=alto;
	parent.document.getElementById("capaframe").style.top="50%";
	parent.document.getElementById("capaframe").style.left="50%";
	parent.document.getElementById("capaframe").style.marginLeft=-(ancho/2)+"px";
	parent.document.getElementById("capaframe").style.marginTop=-(alto/2)+"px";
	
	if(!parent.document.all){// es firefox
		parent.document.getElementById("capafoto").style.width=ancho+"px";
		parent.document.getElementById("capafoto").style.height=alto+"px";
		parent.document.getElementById("capaframe").style.width=ancho+"px";
		parent.document.getElementById("capaframe").style.height=alto+"px";
	}
}

function cargamsnadmin(texto,ancho,alto){
	opacity('capafoto', 30, 100, 1000);
	document.getElementById("capafondo").style.visibility="visible";
	document.getElementById("capafondo").style.display="block";
	document.getElementById("capafoto").style.visibility="visible";
	document.getElementById("capafoto").style.display="block";
	document.getElementById("capaframe").style.visibility="visible";
	document.getElementById("capaframe").style.display="block";
	document.getElementById("capafoto").innerHTML='<table height='+alto+'px width='+ancho+'px border="0" align="center" cellpadding="0" cellspacing="0" style="border:solid 1px #4C6372"><tr><td height="20px" align="right" valign="top"><img src="../images/barra.gif" width="100%" border="0" height="20px"></td></tr><tr><td align="center" valign="middle" bgcolor="#FFFFFF" class="txtgeneral">'+texto+'</td></tr></table></td></tr></table>';
	
	document.getElementById("capafoto").style.top="50%";
	document.getElementById("capafoto").style.left="50%";
	document.getElementById("capafoto").style.marginLeft=-(ancho/2)+"px";
	document.getElementById("capafoto").style.marginTop=-(alto/2)+"px";
	document.getElementById("capaframe").style.width=ancho;
	document.getElementById("capaframe").style.height=alto;
	document.getElementById("capaframe").style.top="50%";
	document.getElementById("capaframe").style.left="50%";
	document.getElementById("capaframe").style.marginLeft=-(ancho/2)+"px";
	document.getElementById("capaframe").style.marginTop=-(alto/2)+"px";
	
	if(!document.all){// es firefox
		document.getElementById("capafoto").style.width=ancho+"px";
		document.getElementById("capafoto").style.height=alto+"px";
		document.getElementById("capaframe").style.width=ancho+"px";
		document.getElementById("capaframe").style.height=alto+"px";
	}
}

// Cierra popups en capas
function cierracapa(){
	opacity('capafoto', 100, 0, 1000);
	document.getElementById("capafoto").style.display="none";
	document.getElementById("capafondo").style.display="none";
}

function daraltas(){
	document.location.href="altaclientes.asp";
}

function colorcambio(linea){
	linea.style.backgroundColor="#E2EAEB";
}

function colororigen(linea){
	linea.style.backgroundColor="#FFFFFF";
}

function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 

// Carga las imagenes
function loadImages() {
	if (document.getElementById){  // DOM3 = IE5, NS6
		document.getElementById('hidepage').style.visibility = 'hidden';
	}else {
		if (document.layers) { // Netscape 4
			document.hidepage.visibility = 'hidden';
		}else{   // IE 4
			document.all.hidepage.style.visibility = 'hidden';
		}
	}
}

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
}

function cargapdf(documento){
	opacity('contenido', 30, 100, 2000);
	document.getElementById("contenido").innerHTML='<iframe allowtransparency="true" frameborder="0" src="'+documento+'" height="100%" width="100%"></iframe>';
}