function load_images(box,imagen,enlace) {
	$(box).innerHTML = "<a href='"+enlace+"'><img src='"+imagen+"' border='0'></a>";
}

function load_images_inside(box,imagen) {
	$(box).innerHTML = "<img src='"+imagen+"' border='0'>"
}

function load_video(src) {
	var aleatorio;
	aleatorio = Math.round(Math.random() * 1000);
	$('vplayer_home').innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="545" height="307" id="VPlayer" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="VPlayer.swf?video_ref='+src+'&r='+aleatorio+'" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed src="VPlayer.swf?video_ref='+src+'&r='+aleatorio+'" quality="high" bgcolor="#ffffff" width="545" height="307" name="VPlayer" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" /></object>';
}

function historial(any) {
	document.getElementById('historial_'+any).style.display = 'block';
}

function send_contact_form() {
	
	if (document.contact_form.nom_cognoms.value!='' && document.contact_form.empresa.value!='' && document.contact_form.telefon.value!='' && document.contact_form.correu.value!='' && document.contact_form.consulta.value!='' ) {
	
		var ok=0;
		
		if (isNaN(document.contact_form.telefon.value)) {
			document.getElementById('telefon_error').style.display = 'block';
		} else {
			ok++;
		}
		
		var s = document.contact_form.correu.value;
		var filter=/^[A-Za-z_.][A-Za-z0-9_.]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;
		if (s.length == 0 ) theElement.focus();
		if (filter.test(s))
			ok++;
		else
			document.getElementById('correu_error').style.display = 'block';
		
		if (ok==2) {
			document.contact_form.submit();
		}
		
//		document.contact_form.submit();
	} else {
		
		if (document.contact_form.nom_cognoms.value=='' ) {
			document.getElementById('nom_error').className='si_display';
		}
		
		if (document.contact_form.empresa.value=='' ) {
			document.getElementById('empresa_error').className='si_display';
		}
		
		if (document.contact_form.telefon.value=='' ) {
			document.getElementById('telefon_error').className='si_display';
		}
		
		if (document.contact_form.correu.value=='' ) {
			document.getElementById('correu_error').className='si_display';
		}
		
		if (document.contact_form.consulta.value=='' ) {
			document.getElementById('consulta_error').className='si_display';
		}
	}
}

function send_int_form() {
	
	if ( document.internacional_form.int_1.value!='' && document.internacional_form.int_2.value!='' && document.internacional_form.int_3.value!='' && document.internacional_form.int_4.value!='' && document.internacional_form.int_5.value!='' && document.internacional_form.int_6.value!='' && document.internacional_form.int_7.value!='' ) {
		document.internacional_form.submit();
	} else {
		
		if (document.internacional_form.int_1.value=='' ) {
			document.getElementById('error_1').className='si_display';
		}
		
		if (document.internacional_form.int_2.value=='' ) {
			document.getElementById('error_2').className='si_display';
		}
		
		if (document.internacional_form.int_3.value=='' ) {
			document.getElementById('error_3').className='si_display';
		}
		
		if (document.internacional_form.int_4.value=='' ) {
			document.getElementById('error_4').className='si_display';
		}
		
		if (document.internacional_form.int_5.value=='' ) {
			document.getElementById('error_5').className='si_display';
		}
		
		if (document.internacional_form.int_6.value=='' ) {
			document.getElementById('error_6').className='si_display';
		}
		
		if (document.internacional_form.int_7.value=='' ) {
			document.getElementById('error_7').className='si_display';
		}
		
		if (document.internacional_form.int_8.value=='' ) {
			document.getElementById('error_8').className='si_display';
		}
		window.location.href='#top_form';
		
	}
	
}

function ocultar_sms(opt) {
	
	document.getElementById(opt).className='no_display';
	
}
