
function UpCase(stringa) {return stringa.substr(0,1).toUpperCase()+stringa.substr(1);}

function BigImage(image,title,wid,hgt) {
	sw=(screen.width-wid)/2;
	sh=(screen.height-hgt)/2;
	newwin=window.open('','newwin','width='+wid+',height='+hgt+',scrollbars=0,resizable=0,menubars=0,toolbars=0,loca tion=0,directories=0,status=0,top='+sh+',left='+sw+'');
	newwin.document.open();
	newwin.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\n');
	newwin.document.write('"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
	newwin.document.write('\n<html>\n<head>\n<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />\n');
	newwin.document.write('<meta http-equiv="Imagetoolbar" content="no" />\n');
	newwin.document.write('<title>'+title+'</title>\n');
	newwin.document.write('</head>');
	newwin.document.write('<body style="margin:0;padding:0">\n<img src="'+image+'" width="'+wid+'" height="'+hgt+'" />');
	newwin.document.write('\n</body></html>');
	newwin.document.close();
	newwin.focus();
}

// --- 	AGGIUNGI AI PREFERITI

	function bookmarksite(title, url) {
		if (document.all)	window.external.AddFavorite(url, title);
		else if (window.sidebar) window.sidebar.addPanel(title, url, "")
	}

// --- FORM

function verificaemail(str){
	var regexp=/^.+@.+\..{2,3}$/;
	return (regexp.test(str))
}

function textCounter( field, countfield, maxlimit ) {
  if ( field.value.length > maxlimit ) {
	field.value = field.value.substring( 0, maxlimit );
	alert( 'Limite massimo 255 caratteri inseriti' );
	return false;}
  else {countfield.value = maxlimit - field.value.length;}
}


