var tiempo;
var foto = 1;
function cambia_principal(total){
	flash_nuevo = galeria[foto];
	enlace_nuevo = enlace[foto];
	$('#foto_flash').fadeOut("slow", function(){
		$('#foto_flash').attr({src: flash_nuevo});
		$('#foto_flash').css("position", 'relative');
		$('#foto_flash').css("z-index", '1');
		$('#enlace_flash').attr({href: enlace_nuevo});
		$('#enlace_flash').css("position", 'relative');
		$('#enlace_flash').css("z-index", '1');
	});
	$('#foto_flash').fadeIn("slow");
	
	foto = parseInt(foto)+1;
	if(foto == total){
		foto = 0;
	}
}

function loop(total){
	tiempo = setInterval("cambia_principal("+total+")",15000);
}
/*
function newsletterSubmit(value){
	var filter=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
	
	$('#enlaceNewsletter').attr('href', 'includes/newsletter/newsletter.php?email='+value);

	Shadowbox.init();

	$('#enlaceNewsletter').click();

	if (filter.test(value)) {

		$('#email').val('');

	}

	$('#email').focus();
}
*/
	
function playYoutube(codigo){
		//$('#reproduccion_actual').html('<object height="358" width="595"><param value="http://www.youtube.com/v/'+codigo+'?f=videos&amp;app=youtube_gdata&amp;autoplay=0" name="movie"/><param value="transparent" name="wmode"/><embed height="358" width="595" wmode="transparent" type="application/x-shockwave-flash" src="http://www.youtube.com/v/'+codigo+'?f=videos&amp;app=youtube_gdata&amp;autoplay=0&amp;rel=0"/></object>');
	$('#reproduccion_actual').html('<iframe src="http://player.vimeo.com/video/'+codigo+'?title=0&amp;byline=0&amp;portrait=0" width="595" height="358" frameborder="0"></iframe><p><a href="http://vimeo.com/'+codigo+'">BODY Desfilada Bau 2010 4/4</a> from <a href="http://vimeo.com/user6381590">Bau Escola Superior de Disseny</a> on <a href="http://vimeo.com">Vimeo</a>.');
}
