var delay = 2000;
var delay2 = 400; //delays en mil·lisegons
var curindex = 0;

var randomimages = new Array();

	randomimages[0] = "images/anim/biking2.gif";
	randomimages[1] = "images/anim/biking3.gif";
	randomimages[2] = "images/anim/biking5.gif";
	randomimages[3] = "images/anim/biking6.gif";
	randomimages[4] = "images/anim/giro1.gif";
	randomimages[5] = "images/anim/giro3.gif";
	randomimages[6] = "images/anim/giro5.gif";
	randomimages[7] = "images/anim/giro9.gif";

var images = new Array();

	images[0] = "images/fons.gif";
	images[1] = "images/fons2.gif";
	images[2] = "images/imese.gif";
	images[3] = "images/right.gif";
	images[4] = "images/logo_cam.gif";
	images[5] = "images/logo_ue.gif";

var preload = new Array();
var preload2 = new Array();

//document.write('<img name="defaultimage" src="'+randomimages[Math.floor(Math.random()*(randomimages.length))]+'">')

function canviar_imatges()
{
	if (curindex==(tempindex=Math.floor(Math.random()*(randomimages.length))))
	{
		curindex=curindex==0? 1 : curindex-1;
	}
	else
		curindex=tempindex;
	document.images.monitor1.src=randomimages[curindex];
	document.images.monitor2.src=randomimages[curindex];
	document.images.monitor3.src=randomimages[curindex];
	document.images.monitor4.src=randomimages[curindex];
	window.setTimeout("canviar_imatges()", delay);
}


function precarga()
{
	if (document.images)
	{
		for (n=0;n<randomimages.length;n++) //precārrega de les imatges del cos de la homepage
		{
			preload[n]=new Image();
			preload[n].src=images[n];
		}
		for (n=0;n<images.length;n++) //precārrega de les imatges del cos de la homepage
		{
			preload2[n]=new Image();
			preload2[n].src=images[n];
		}
		window.setTimeout("canviar_imatges()", delay);
	}
}

function abrirGracias()
{
  window.open("gracias.html","ventana1","width=375,height=400,scrollbars=NO");
}
function abrirCam()
{
  window.open("cam.htm","ventana1","width=600,height=400,scrollbars=NO");
}
function abrirNews()
{
  window.open("lista_news.php","ventana2","width=375,height=400,scrollbars=YES");
}
function abrirSalidas()
{
  window.open("lista_salidas.php","ventana3","width=375,height=400,scrollbars=YES");
}
function abrirCatalogo()
{
  window.open("catalogo.php","ventana4","width=620,height=430,scrollbars=YES");
}
function abrirArticulo(id, art, cat)
{
  aux = "articulo.php?id=" + id;
  aux = aux + "&artic=" + art;
  aux = aux + "&categ=" + cat;
  window.open(aux,"ventana4","width=620,height=430,scrollbars=YES");
}
function abrirLinks()
{
  window.open("links.html","ventana5","width=460,height=400,scrollbars=NO");
}
function abrirForo()
{
}
function abrirFormulario(Id)
{
  var aux;
  aux  = "correo.php?id=" + Id;
  window.open(aux,"ventana7","width=600,height=615,scrollbars=NO");
}
function abrirRegist()
{
  window.open("regist.php","ventana1","width=375,height=540,scrollbars=YES");
}
function abrirLinkExt(index)
{
	switch (index)
	{
		case 1: donde="http://www.amigosdelciclismo.com/";
		break;
		case 2: donde="http://www.bikeweb.org";
		break;
		case 3: donde="http://www.globeros.com";
		break;
		case 4: donde="http://www.solomountainbike.com/";
		break;
		case 5: donde="http://www.bikeride.com";
		break;
		case 6: donde="http://www.bikecrawler.com/";
		break;
		case 7: donde="http://www.bikeafondo.es/";
		break;
		case 8: donde="http://www.euskalnet.net/xudaondo";
		break;
		case 9: donde="http://www.shimano-europe.com";
		break;
		case 10: donde="http://www.campagnolo.com";
		break;
		case 11: donde="http://www.bh-bikes.com";
		break;
		case 12: donde="http://www.trekbikes.com";
		break;
		case 13: donde="http://www.dirtracing.es";
		break;
		case 14: donde="http://www.motordealer.com";
		break;
		case 15: donde="http://www.macario.com";
		break;
		case 16: donde="http://www.gtbicycles.com";
		break;
		case 17: donde="http://www.teambike.es";
		break;
		case 18: donde="http://amigosdelciclismo.com/rutas/home.htm";
		break;
		case 19: donde="http://www.arrakis.es/~nnui/cicloturismo.htm";
		break;
		case 20: donde="http://tuspain.com/travel/bike.htm";
		break;
		case 21: donde="http://www.eniac.es/usuarios/map/index.htm";
		break; //no sería necesario, pero...
	}
	/*screenX=window.screenLeft;
	screenY=window.screenTop;
	width=window.availWidth;
	height=window.availHeight;*/
	window.open(donde,"","resizable=1,toolbar=1,location=1,directories=1,addressbar=1,scrollbars=1,status=1,menubar=1,top=0,left=0,screenX=window.screenLeft,screenY=window.screenTop,width=window.availWidth,height=window.availHeight"); 
}

function hidestatus(){
window.status=''
return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover=hidestatus
document.onmouseout=hidestatus         