// funcion para ir a un url
function url(resource) {
	self.location.href = resource;
}

// función para cambiar imagen del menu
function toggle(cl) {
	document.getElementById('menuholder').className = cl;
}

// imagen principal en el home
var imgs = new Array(3);
imgs[0] = 'img_home.jpg';
imgs[1] = 'img_home1.jpg';
imgs[2] = 'img_home2.jpg';
idx = Math.floor(Math.random() * imgs.length);
if(document.getElementById('mainimg')!=null) {
	document.getElementById('mainimg').src = 'images/'+imgs[idx];
}

// frases en páginas interiores
var phrases = new Array(3);
phrases[0] = 'El problema no es llegar, sino mantenerse';
phrases[1] = 'Si las cosas fueran fáciles, cualquier PENDEJO las haría';
phrases[2] = 'Never leave a man behind';
phrases[3] = 'We´ll cross that bridge when we come to it';
idx = Math.floor(Math.random() * phrases.length);
if(document.getElementById('phrase')!=null) {
	document.getElementById('phrase').innerHTML = phrases[idx];
}

// NUEVO
function randomImg(phrases) {
	var idx = Math.floor(Math.random() * phrases.length);
	if(document.getElementById('phrase')!=null) {
		document.getElementById('phrase').innerHTML = phrases[idx];
	}
}

setInterval("randomImg(phrases)",3000);