
var geoXml;
var map;
function onLoad() {
  if (GBrowserIsCompatible()) {
	geoXml = new GGeoXml("http://maps.google.it/maps/ms?ie=UTF8&hl=it&msa=0&ll=44.713562,10.580349&spn=0.081,0.155354&z=13&om=1&msid=114050610824438354242.00043d9f197f35e0da057");
	map = new GMap2(document.getElementById("map"));
	map.addOverlay(geoXml);
	map.setCenter(new GLatLng(44.694773,10.528679), 9);
   	map.addControl(new GLargeMapControl());
    	
  }
} 


function popupc(URL,w,h,s){var l= Math.floor((screen.width-w)/2);var t = Math.floor((screen.height-h)/2);window.open(URL,"","width=" + w + ",height=" + h + ",top=" + t + ",left=" + l+ 'toolbar=0,scrollbars='+(s?'yes':'no')+',location=no,statusbar=no,menubar=no,resizable=no');}
var Checker={
	checks:{'nome':/.+/,'cognome':/.+/,'email':/^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/},
	check_form:function(){
		for(i in this.checks){
			el=document.getElementById(i);
			if(!this.checks[i].test(el.value)){
				el.focus();
				alert('Il campo "'+el.name+'" non sembra corretto.');
				return false;
			}
		}
		return true;
	}
};
input_focus=function(){
	this.style.backgroundColor='#f4f4f4';
	this.style.color='#B45314';
	this.style.fontWeight='bold';
};
input_blur=function(){
	this.style.backgroundColor='#fff';
	this.style.color='#404147';
	this.style.fontWeight='normal';
};
window.onload=function(){
	onLoad();
	inputs=document.getElementById('contatti').getElementsByTagName('input');
	inputs[inputs.length]=document.getElementById('contatti').getElementsByTagName('textarea')[0];
	for(i=0; i<inputs.length+1;i++){
		
		inputs[i].onfocus=input_focus;
		inputs[i].onblur=input_blur;
	}
	inputs[0].focus();
	document.getElementById('send').onclick=function(){
		if(Checker.check_form())document.getElementById('contatti').submit();
	};
};