// fai il submit quando viene premuto "enter",
// indipendentemente dal browser

function submitEnter(myfield,e)
{
	var keycode;
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	else return true;

	if (keycode == 13)
	{
	   myfield.form.submit();
	   return false;
	}
	else
	   return true;
}

function carrello(url, width, height, reload)
{
	if (document.all)
	{
		var x = window.screenLeft;
		var y = window.screenTop;
		var w = window.document.body.offsetWidth;
		var h = window.document.body.offsetHeight;
	}
	else
	{
		var x = window.screenX;
		var y = window.screenY;
		var w = window.outerWidth;
		var h = window.outerHeight;
	}
	var cntx = x + Math.round((w - width) / 2);
	var cnty = y + Math.round((h - height) / 2);
	winContent = window.open (url, 'carrello', 'left=' + cntx + ',top=' + cnty + ',width=' + width + ',height=' + height  + ',resizable=yes')
	//if (reload) setTimeout('window.location.reload()',2000);
	winContent.focus()

}

function centra(url, width, height)
   {
   if (document.all)
      {
      var x = window.screenLeft;
      var y = window.screenTop;
      var w = window.document.body.offsetWidth;
      var h = window.document.body.offsetHeight;
      }
  else
   {
   var x = window.screenX;
   var y = window.screenY;
   var w = window.outerWidth;
   var h = window.outerHeight;
   }
  var cntx = x + Math.round((w - width) / 2);
  var cnty = y + Math.round((h - height) / 2);
 winContent = window.open (url, null, 'left=' + cntx + ',top=' + cnty + ',width=' + width + ',height=' + height  + ',resizable=yes')

winContent.focus()

}