function canvifoto(pos,total){
	for(i=0;i<total;i++){
		document.getElementById('img_'+i).style.position='absolute';
		document.getElementById('img_'+i).style.visibility='hidden';
	}

	document.getElementById('img_'+pos).style.position='static';
	document.getElementById('img_'+pos).style.visibility='visible';
}

function comprovacio(camps,noms,eltexte,frase){
	camps=camps.split(',');
	noms=noms.split(',');
	correcte=1;

	for(i=0;i<(camps.length);i++){
		if(camps[i]=='email'){
			if ((document.getElementById('email').value =="") || !(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById('email').value))){
      			alert(eltexte+noms[i]);
      			return (false);
    		}
		}else	if(!document.getElementById(camps[i]).value){
			alert(eltexte+noms[i]);
			document.getElementById(camps[i]).focus();
			correcte=0;
			return (false);
		}
	}

	if(correcte){
		return true
	}else return false;
}

function canvitd(num,actiu){
	if(actiu=="on"){
		document.getElementById("td_"+num).className='tdon';
		document.getElementById("link_"+num).className='linkon';
		document.getElementById("tdtxt_"+num).className='tdtxton';
	}else{
		document.getElementById("td_"+num).className='tdoff';
		document.getElementById("link_"+num).className='linkoff';
		document.getElementById("tdtxt_"+num).className='tdtxtoff';
	}
}

function ocultarmenu(capa1,capa2){
	document.getElementById('subm').style.visibility='hidden';
	document.getElementById('indus').style.visibility='hidden';
	document.getElementById('decsuelo').style.visibility='hidden';
	document.getElementById('decpared').style.visibility='hidden';
	document.getElementById('submemp').style.visibility='hidden';
	document.getElementById('submtien').style.visibility='hidden';
	document.getElementById('piedra').style.visibility='hidden';
	document.getElementById('dep').style.visibility='hidden';
	document.getElementById('pinturaind').style.visibility='hidden';
	document.getElementById('pinturadec').style.visibility='hidden';
	//document.getElementById('pinturapla').style.visibility='hidden';
	document.getElementById('prope').style.visibility='hidden';

	if(capa1) document.getElementById(capa1).style.visibility='visible';
	if(capa2) document.getElementById(capa2).style.visibility='visible';

}

//<![CDATA[
function load() {
	if (GBrowserIsCompatible()) {
		var icon = new GIcon();
		icon.image = 'http://www.pavitecco.com/img/logo.jpg';
		icon.iconSize = new GSize(153, 50);
		icon.iconAnchor = new GPoint(200, 0);
		//icon.infoWindowAnchor = new GPoint(0,0);
		/*var direccion = "<span style='color:#000000'>\
		<b>PAVITECCO IBERICA SUPERFICIES INDUSTRIALES, S.L.</b><br />\
		C/ Del Coure 24, nave 1 Parcela 28<br />\
		43006 Tarragona</span>";*/
		var marcador = new GMarker(new GLatLng(41.13846,1.216586),icon);
		GEvent.addListener(marcador, 'click', function(){marcador.openInfoWindowHtml(direccion);});
		var map = new GMap2(document.getElementById("map"));
		map.setCenter(new GLatLng(41.13846,1.216586), 16);
		map.setMapType(G_NORMAL_MAP);
		map.addControl(new GSmallMapControl());
		map.addOverlay(marcador);
		marcador.openInfoWindowHtml(direccion);
	}
}
//]]>
