function CheckFields(form_) {
	if ( form_.login_name.value == "") {
		alert("Inserire una E-Mail");
		return false;
	}
	if  ( form_.login_pwd.value == "") {
		alert("Inserire una Password");
		return false;
	}
	return true;
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}

function LoginBox(ch_id, path) {
username = getCookie('AG_UserLogin');
userlabel = Base64.decode(getCookie('AG_UserLabel'));
if (username!=null && username!="") {
document.write('<a href="'+path+'/1,1641,'+ch_id+'_NWL,00.html" class="linkbold">utente: '+userlabel+'</a>\n');
document.write('<a class="linknormal" href="/logout/1,2855,,00.html">logout</a>\n');
} else {
document.write('<a href="'+path+'/1,1641,'+ch_id+'_NWL,00.html" class="linkbold">login</a>\n');
}
}

function VisualizzaRegistrazione(ch_id, path) {
var
  noUdbChannel = 51 // per energia 24, per ora	
username = getCookie('AG_UserLogin');
if (username==null || username=="") {
	if (ch_id != noUdbChannel) {
		formtipo = 'UDB'
	} else {
		formtipo = 'NWL'
	}
document.write('<a href="'+path+'/1,1641,'+ch_id+'_'+formtipo+',00.html"> registrati</a>\n');
}
}

