function 
indirizzoEmailValido(this_field) 
   {
   if(this_field.value== "")
      return;
   if(this_field.value.indexOf("@") < 0)
      {
      this_field.focus();
      alert("Si prega di inserire un indirizzo email valido");
      }
   }

function 
controllaDati(modulo) 
   {
   if(modulo.password.value == "") 
      {
      modulo.password.focus();
      alert("Si prega di inserire una password");
      return false;	
      }
   return true;	
   }

function 
setCookie (name, value, expires, path, domain, secure) 
	{
	var curCookie = name + "=" + escape(value) + (expires ? "; expires=" + expires : "") + (path ? "; path=" + path : "") + (domain ? "; domain=" + domain : "") + (secure ? "secure" : "");
	document.cookie = curCookie;
	}

function 
getCookie (name) 
	{
	var prefix = name + '=';
	var c = document.cookie;
	var nullstring = '';
	var cookieStartIndex = c.indexOf(prefix);
	if (cookieStartIndex == -1)
		return nullstring;
	var cookieEndIndex = c.indexOf(";", cookieStartIndex + prefix.length);
	if (cookieEndIndex == -1)
		cookieEndIndex = c.length;
	return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));
	}

function 
deleteCookie (name, path, domain) 
	{
	if (getCookie(name))
		document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}

function 
fixDate (date) 
	{
	var base = new Date(0);
	var skew = base.getTime();
	if (skew > 0)
		date.setTime(date.getTime() - skew);
	}


function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}

function apri(url, w, h) {
var windowprops = "width=" + w + ",height=" + h;
popup = window.open(url,'remote',windowprops);
}

function
countClick(company, company_url, from) 
        {
        var elImage = document.createElement('img');
        elImage.setAttribute('id', 'count_' + parseInt(Math.random()*99999999));
        elImage.setAttribute('alt', '');
        elImage.setAttribute('src', 'http://www.beppegrillo.it/count_click.php?company=' + company + '&company_url=' + company_url + '&from=' + from + '&cb=' + parseInt(Math.random()*99999999));
        elImage.style.display = 'none';
        document.body.appendChild(elImage);
        return true;
        } // countClick
