
	//--- Check Login Form
	function fCheckLogin()
	{
		var blnReturn 		= true;
		var strFieldFocus 	= "";
		
		//--- admin_username
		var oLabel = $('lblAdminUsername');
		
		if ( $F('admin_username') == "" || $F('admin_username') == null )
		{
			oLabel.innerHTML = "Richiesto.";
			blnReturn = false;
			if ( strFieldFocus == "" ) strFieldFocus = "admin_username";
		}
		else oLabel.innerHTML = "";
		
		
		//--- admin_username
		var oLabel = $('lblAdminPassword');
		
		if ( $F('admin_password') == "" || $F('admin_password') == null )
		{
			oLabel.innerHTML = "Richiesto.";
			blnReturn = false;
			if ( strFieldFocus == "" ) strFieldFocus = "admin_password";
		}
		else oLabel.innerHTML = "";
		
		
		if ( ! blnReturn ) $('boxEffect').highlight( { startcolor: '#ffc49d' } );
		if ( strFieldFocus != "" ) $( strFieldFocus ).focus();
		
		if ( blnReturn ) fLoadEssentials();
		
		return blnReturn;
	}
	
	
	//--- Load Essentials
	function fLoadEssentials()
	{
		fPreloadImmagine( 'immagini/preload/loader-square.gif' );
		fPreloadImmagine( 'immagini/splash/splash_gestione.jpg' );
		fPreloadImmagine( 'immagini/splash/splash_w3c.jpg' );
		fPreloadImmagine( 'immagini/splash/splash_browser.jpg' );
		fPreloadImmagine( 'immagini/splash/splash_dynform.jpg' );
		
		setTimeout("",3000);
	};
	
	//--- Carica pagina
	function redirectPage( pblnLoginFailed, pstrID_Commento )
	{
		if ( ! pblnLoginFailed )
			location.href = "index.php"
								+ ( pstrID_Commento != "" ? "?id_commento=" + pstrID_Commento : "" );
		else
			location.href = "login.php?cmd=failed" + ( pstrID_Commento != "" ? "&id_commento=" + pstrID_Commento : "" );
	}

