var randnum = Math.random();
var inum = 3, control1 = 0;
// Change this number to the number of images you are using.
var rand1 = Math.round(randnum * (inum-1)) + 1;
images = new Array
images[1] = "images/fondo1.jpg";
images[2] = "images/fondo2.jpg";
images[3] = "images/fondo3.jpg";
// Ensure you have an array item for every image you are using.
var image = images[rand1];

document.write('<body style="background-position: center top; " background="' + image + '" text="white">')



function scrollWin(x){
$('html, body').animate({
scrollTop: $("#"+x).offset().top
}, 1000);
} 

function sigPortada(){
	try {
	if(control1==0){
		window.apiPorta = $("div.tabs").data("tabs");
		control1=1
	}
	apiPorta.next();
	sirf()
	} catch(e){};
}





var subMenu = 0;
/********* SLIDESHOW*********/
$(function() {
	$("div.tabs").tabs(".images > div", {
		effect: 'fade',
		fadeOutSpeed: 1000,
		rotate: true
	}).slideshow({ });
	$(".infor").css({'opacity': '0.8'})
	
	
		$("div.tabs2").tabs(".images2 > div", {
		effect: 'fade',
		fadeOutSpeed: 1000,
		rotate: true
	}).slideshow({ autoplay : true, interval : 5000});
	
	
	$(".funciones").click(
		function(){
			if(subMenu == 0){
				$("#subMenus").show()
				$('.subMenu').slideDown(400)
				subMenu = 1;
			} else {
				$('.subMenu').slideUp(400, function(){
					$("#subMenus").hide()
				})
				subMenu = 0;
				

			}
		}
	)
	
	$('.musica').hover(function(){
		$(this).text('PROXIMAMENTE').css({ 'font-size':'13px'})
	}, function(){
		$(this).text('MUSICA').removeAttr('style')
	})
	
});
