preload_image = new Image(50,50); 
preload_image.src="http://www.iparatodos.com.ar/ipt/img2/wait.gif"; 	  
	  
function chang_ov(url){
	document.getElementById(url).className = 'nav_activa'
	}
function chang_ou(url){
	if(menu != url){
		document.getElementById(url).className = '';
		}
	}
function ira(url){
	esperar();
	menu = url;
	check_nav();
	new Ajax.Updater('principal', 'inc_'+url+'.php?ms='+new Date().getTime() , { method: 'get' });
	}
	
function check_nav(){
	document.getElementById("inicio").className = '';
	document.getElementById("productos").className = '';
	document.getElementById("infraestructura").className = '';
	document.getElementById("administracion").className = '';
	document.getElementById("contacto").className = '';
	document.getElementById("clientes").className = '';
	
	try {
   document.getElementById(menu).className = 'nav_activa';
	}catch(mierror){
	   document.getElementById("inicio").className = 'nav_activa';
	} 
	
	}
function esperar(){
	document.getElementById('principal').innerHTML = "<br><br><br><br><br><br><br><br><p align='center'><img src='img2/wait.gif' width='50' height='50' align='absmiddle'>Un momento por favor.... </p><br><br><br><br><br><br><br><br><br>";
	}

function enviar_mail(){
	contacto = document.form1.contacto.value;
	txt = document.form1.txt.value;	
	esperar();
	menu = 'gracias';
	check_nav();

	new Ajax.Updater('principal', 'inc_gracias.php?ms='+new Date().getTime()+'&contacto='+contacto+'&txt='+txt , { method: 'get' });
}

function login(){
	document.form1.data.value = hex_md5(document.form1.pas.value);	
	document.form1.submit();
}


function login_clientes(){
	new Ajax.Updater('principal', 'cli_login.php?ms='+new Date().getTime() , {
	method: 'post',
 	parameters: {
		dni: document.form1.dni.value, 
		nro: document.form1.nro.value
		}
	});
}


function cli_abonos(){
	new Ajax.Updater('abonos_deuda', 'cli_get_abonos.php?ms='+new Date().getTime() , {
	method: 'post',
 	parameters: {
		id_conexion: document.form2.id_conexion.value
		}
	});
}

function close_cli_abonos(){
	document.getElementById('abonos_deuda').innerHTML ="";
}