﻿//Script per fare il submit del login al premere il tasto invio.

document.onkeydown = keyDown; 
function keyDown(e){
    var bt;
    if(typeof document.getElementById("ctl00_loginView_ASPXAUTH_Login")!= undefined)
    {
        bt=document.getElementById("ctl00_loginView_ASPXAUTH_Login");
        
        
        if (document.layers) { 
		if (e.which == 13) 
		    {
                if(typeof bt == undefined)
                {
                    alert("box");
                }
                else
                {
                    bt.click();
                }
		    }
    			
	    } 

	    if (document.all) { 
		    if (event.keyCode == 13)
		    {
                if(typeof bt == undefined)
                {
                    alert("box");
                }
                else
                {
                    bt.click();
                }
            }
	    } 
    }
} 

//Script per far comparire dinamicamente le scritte "username" e "password" nei rispettivi campi.
//Versione 1.0
//Autore: Vincenzo Pizio

//da mettere sul campo username legato all'evento "onfocus"
function t1(obj)
{
    if (obj.value=="username")
    {
        obj.value="";
    }
    obj.focus();
}
//da mettere sul campo username legato all'evento "onblur"
function t1_out(obj)
{
    if (obj.value=="")
    {
        obj.value="username";
    }
}

//da mettere sul campo con il testo password legato all'evento "onfocus"
function t2(obj)
{
    var p=document.getElementById("password");
    p.style.display="block";
    obj.style.display="none";
    p.focus();
}

//da mettere sul campo password legato all'evento "onblur"
function t2_out(obj)
{
    if (obj.value=="")
    {
        var p=document.getElementById("passwordFittizzia");
        p.style.display="block";
        obj.style.display="none";
        p.value="password";
    }
}
