﻿// Archivo JScript

//Muestra el Contenido del Menu
function Menu(pag)
{
   if(pag=="1")
   {
      //parent.iframeVisitas.location.href="visitasweb/UpdVisitasWeb.aspx?link=1";
      parent.contenido.location.href="nosotros/historia.htm";
	  parent.botones.location.href="nosotros/nosotrosbotones.htm";
       //location.href="nosotros/nosotros-cont.htm ";
   }
    if(pag=="2")
   {
      //parent.iframeVisitas.location.href="visitasweb/UpdVisitasWeb.aspx?link=2";
      parent.contenido.location.href="clientes/clientes.htm";
      parent.botones.location.href="clientes/clientesbotones.htm";	  
        //location.href="clientes/clientes_cont.htm";// target=general";
   }    
   if(pag=="3")
   {
      //parent.iframeVisitas.location.href="visitasweb/UpdVisitasWeb.aspx?link=3";  
      //parent.contenido.location.href="presupuestos/presupuestos.aspx";
	 parent.contenido.location.href="nosotros/historia.htm";
	parent.botones.location.href="nosotros/nosotrosbotones.htm";
	//parent.botones.location.href="presupuestos/presupuestobotones.htm";	
       //location.href="nosotros/nosotros-cont.htm ";
   }
    if(pag=="4")
   {
      //parent.iframeVisitas.location.href="visitasweb/UpdVisitasWeb.aspx?link=4";
      parent.contenido.location.href="especialidades/bioquimica.htm";
	  parent.botones.location.href="especialidades/especialidadesbotones.htm";
        //location.href="clientes/clientes_cont.htm";// target=general";
   }   
    if(pag=="5")
   {
      //parent.iframeVisitas.location.href="visitasweb/UpdVisitasWeb.aspx?link=5";
      parent.contenido.location.href="servicios/callcenter.htm";
	  parent.botones.location.href="servicios/serviciosbotones.htm";
      
        //location.href="clientes/clientes_cont.htm";// target=general";
   }       
    return false;
}


 
function openLogin()
{
    var login = document.form1.txtlogin.value;
    login=login.toLowerCase();
    login=login.replace('ñ','n');
    var pass  = document.form1.txtpass.value;
    pass=pass.toLowerCase();
    pass=pass.replace('ñ','n');
  
  
    if(ValidaLogin(login,pass))
    {   
        //alert(pass);
	    document.form1.txtpass.value = '';	    
	    if(login=="I838" || login=="i838" || login=="I8387" || login=="i8387")
	        window.location = "../../Extranet/ValidaLog.aspx?login=" + login + "&pass=" + pass + "&flag=log";
			//window.open("../../Extranet/ValidaLog.aspx?login=" + login + "&pass=" + pass + "&flag=log",'mywindow1','menubar=0,resizable=1,status=1, scrollbars=1,width=300,height=100,top=1,left=1');            
        else
            window.location = "../../Extranet/ValidaLog.aspx?login=" + login + "&pass=" + pass + "&flag=log";
			//window.open("../../Extranet/ValidaLog.aspx?login=" + login + "&pass=" + pass + "&flag=log",'mywindow1','menubar=0,resizable=yes,status=no, scrollbars=no,width=300,height=100,top=1,left=1');
        //window.open("Default2.aspx?login=" + login + "&pass=" + pass + "&flag=log",'mywindow1','menubar=0,resizable=no,status=0, scrollbars=no,width=300,height=100,top=1,left=1');
    }
}

function openRegistraPac()
{      
   window.open("../../Extranet/ValidaLog.aspx?flag=reg",'mywindow2','menubar=0,resizable=no,status=0, scrollbars=no,width=300,height=100,top=1,left=1');
}

function openConsulLog()
{   
    Abrir("../../Extranet/Consultalogin.aspx");
}

function ValidaLogin(login,pass)
{   
    if(login=='')
    {
        alert('Ingrese su nombre de usuario por favor');
        //document.form1.txtlogin.focus(); //---> Problemas con el Internet Explorer
        return false;
    }
    if(pass=='')
    {
        alert('Ingrese su password por favor');
       // document.form1.txtpass.focus();
        return false;        
    }
    return true; 
}

function verIntranet()
{
	var url="http://www.blufsteinlab.com/Intranet/AtencionCliente/LoginForm.aspx?txtWind=NO";
	PopUp(url,600,800);
}

var ancho = 115; //300 //115
var alto = 70; //100 //70
var fin = 266; 
var x = 64; 
var y = 20;

function verConsultaLogin()
{
    var url="../../Extranet/ConsultaLogin.aspx";
    window.open(url,'popup','status=0,resizable=no,scrollbars=no,toolbar=0,top=0,left=0,width=266,fullscreen=no,height=170');
}

function Abrir(pagina)
{     
     ventana = window.open(pagina,'mywindow3','menubar=0,resizable=no,status=0, scrollbars=no,height=1,width=1,top=x,left=y,screenX=x,screenY=y');
     abre();     
}

function openmail()
{window.open("https://mail.blufsteinlab.com");
	
}




//function ocultarPanel()	
//{     
//    //var nom='';
//    //var nom2='';
//   try
//   {
//        parent.iframeconsulta.location.href="blank.htm";
//        //if(document.getElementById("consulta") !=null)
//        //{
//	    document.getElementById("consulta").style.visibility = "hidden";
//	    //}
//	    document.getElementById("consulta").style.left = 0;
//	    document.getElementById("consulta").style.top = 0;
//	    document.getElementById("consulta").style.height=0;
//	    document.getElementById("consulta").style.width=0;  
//	}
//	catch(e){
//	    //alert(e.name + " - " + e.message);
//	}
//}


//function MostrarPanel()	
//{     
//    parent.iframeconsulta.location.href="../../Extranet/Consultalogin.aspx";
//	document.getElementById("consulta").style.visibility = "visible";
//	document.getElementById("consulta").style.left = 180;
//	document.getElementById("consulta").style.top = 130;
//	document.getElementById("consulta").style.height=170;
//	ocument.getElementById("consulta").style.width=266;
//}


//function iniciar()	
//{
//    parent.iframeconsulta.location.href="../../Extranet/Consultalogin.aspx";
//}

function Mayusculas()
{
    if (((event.keyCode) >= 97) && ((event.keyCode) <= 122))
    {
        event.keyCode = event.keyCode - 32
    }
}

function openEstadistica()
{
     window.open('visitasweb/VisitaEstadistica.aspx','popup','status=0,resizable=no,scrollbars=no,toolbar=0,top=0,left=0,width=300,fullscreen=no,height=200');
}

function keytexto()
{
    if(event.keyCode==13)
    {   
        //alert('hola') ;
        openLogin();
        return false;
    }
    else
        return true;
}
 
//function abre()
//{
//    if (ancho <= fin) 
//	{
//     ventana.moveTo(x, y);
//     ventana.resizeTo(ancho, alto);
//     x += 5;
//     y += 5;
//     ancho += 15;
//     alto += 15;
//     timer = setTimeout("abre()", 1);
//    }
//   else 
//    {
//     clearTimeout(timer); 
//     ancho = 115; 
//     alto =70; 
//     fin = 266; 
//     x = 64; 
//     y = 20;   
//    }
//}

function Over(src) 
{
    src.bgColor="#9CF3D5"; src.style.cursor="hand";
} 

function Out(src) 
{ 
    src.bgColor="#FFFFFF"; src.style.cursor="default"; 
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


