
function validarRut(rut,rut_d){
	var M=0,S=1;
	T=rut;
	for(;T;T=Math.floor(T/10))
		S=(S+T%10*(9-M++%6))%11;
	digito= S?S-1:'K';
	if(rut_d.toUpperCase()==digito)
		return true;
	else{
		alert('Rut Inválido');
		return false;
	}
}

function navActivacion(id, nav)
{
  $('.'+nav).removeClass("activo");
  $('#'+id).addClass("activo");
}

function screenAdjust(id){

  var ancho_pantalla =screen.height;
  var alto_pantalla=screen.height;

  var div = document.getElementById(id);
  var ancho_div=div.offsetWidth; //obtener alto de un div
  var alto_div=div.offsetHeight; //obtener alto de un div
 //  document.writeln((alto)/2);

  div.style.marginLeft =  ((ancho_pantalla-(ancho_div/2))/4)+"px";
  div.style.marginTop = ((alto_pantalla - (alto_div*1.6))/4) +"px";

}