function apareixa_ofertes(capa){
	if(document.getElementById('info'+capa).innerHTML==''){
		xajax_mesInfo(capa);
		document.getElementById('info'+capa).style.visibility='visible';
		document.getElementById('mes'+capa).innerHTML='[-]';
		
	}else{
		if(document.getElementById('info'+capa).style.visibility=='visible'){
			document.getElementById('info'+capa).style.visibility='hidden';
			document.getElementById('info'+capa).style.position='absolute';
			document.getElementById('mes'+capa).innerHTML='[+]';
		}else{
			document.getElementById('info'+capa).style.visibility='visible';
			document.getElementById('info'+capa).style.position='static';
			document.getElementById('mes'+capa).innerHTML='[-]';
		}
	}	
}

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;
}

//<![CDATA[
function load() {
	if (GBrowserIsCompatible()) {
		var icon = new GIcon();
		icon.image = '';
		icon.iconSize = new GSize(153, 50);
		icon.iconAnchor = new GPoint(0,-50);
		icon.infoWindowAnchor = new GPoint(0,0);
		var direccion = "<b>SOP SELECCIÓ, SL</b><br />\
		C/ Joan Coll, 1<br />\
		08401 - Granollers, Barcelona";
		var marcador = new GMarker(new GLatLng(41.611239,2.28771),icon); 
		GEvent.addListener(marcador, 'click', function(){marcador.openInfoWindowHtml(direccion);});
		var map = new GMap2(document.getElementById("map"));
		map.setCenter(new GLatLng(0.007412,0.014591), 16); 
		map.setMapType(G_NORMAL_MAP);
		map.addControl(new GSmallMapControl());
		map.addOverlay(marcador);
		marcador.openInfoWindowHtml(direccion);
	}
}
//]]>
