var DoRedirect = "true"; 	//true = existe redireccionamiento, false = sin redireccionamiento
var RedirectTo = "index.php";	//a donde redirecciona
var AmmountPreloads = 22; 	//cantidad de files a prelodear

//no tocar
var imgArray = CreateArray(AmmountPreloads + 1,2);

	imgArray[1][0] = "./Imagenes/home.jpg";				//ruta al archivo
	imgArray[1][1] = "image"; 					//tipo de archivo
	//Inicia imagenes Header
	imgArray[2][0] = "./Imagenes/header/barra-sola.jpg";
	imgArray[3][0] = "./Imagenes/header/links/rojo/amigos.png";
	imgArray[4][0] = "./Imagenes/header/links/rojo/contacto.png";
	imgArray[5][0] = "./Imagenes/header/links/rojo/discos.png";
	imgArray[6][0] = "./Imagenes/header/links/rojo/fotos.png";
	imgArray[7][0] = "./Imagenes/header/links/rojo/historia.png";
	imgArray[8][0] = "./Imagenes/header/links/rojo/inicio.png";
	imgArray[9][0] = "./Imagenes/header/links/rojo/myspace.png";
	imgArray[10][0] = "./Imagenes/header/links/rojo/shows.png";
	imgArray[11][0] = "./Imagenes/header/links/rojo/videos.png";
	imgArray[12][0] = "./Imagenes/header/links/negro/amigos.png";
	imgArray[13][0] = "./Imagenes/header/links/negro/contacto.png";
	imgArray[14][0] = "./Imagenes/header/links/negro/discos.png";
	imgArray[15][0] = "./Imagenes/header/links/negro/fotos.png";
	imgArray[16][0] = "./Imagenes/header/links/negro/historia.png";
	imgArray[17][0] = "./Imagenes/header/links/negro/inicio.png";
	imgArray[18][0] = "./Imagenes/header/links/negro/myspace.png";
	imgArray[19][0] = "./Imagenes/header/links/negro/shows.png";
	imgArray[20][0] = "./Imagenes/header/links/negro/videos.png";
	//termina imagenes Header

	imgArray[21][0] = "./Imagenes/index/club.png";
	imgArray[22][0] = "./Imagenes/index/cultural.png";

	//PARA prelodear FLASH!
//	imgArray[4][0] = "flashmovie1.swf";	//path del flash
//	imgArray[4][1] = "flash"; 		//tipo de archivo


//Inicia Codigo

	function CreateArray(dim1) {
		if (CreateArray.arguments.length == 1) {
			return new Array(dim1);
		} else {
			var multiArray = new Array(dim1)
			for (var i = 0; i < dim1; i++) {
				multiArray[i] = new Array(CreateArray.arguments[1]);
			}
			return multiArray;
		}
	}

window.document.write("<div id='preloadLayer' style='position:absolute; left:0px; top:0px; width:0px; height:1px; z-index:1; visibility: hidden;'>");


var LastType = "";
for (loop = 1; loop < imgArray.length; loop++) {
	var PrintString = "";
	var CheckType = "";


	if ( imgArray[loop][0] ) {
	if ( imgArray[loop][1] == "image" || (!imgArray[loop][1] && LastType == "image" )) {
		PrintString = "<img src='" + imgArray[loop][0] + "'>";
	} else if ( imgArray[loop][1] == "flash" || (!imgArray[loop][1] && LastType == "flash" )) {
		//Again, a pretty simple flash code is written to the page
		PrintString = "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'> <PARAM NAME=movie VALUE='" + imgArray[loop][0] + "'> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#000000> <EMBED src='" + imgArray[loop][0] + "' quality=high bgcolor=#000000 ALIGN='' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED></OBJECT>";
	} else {
		//O NO!! The type of load they specified is not supported!! Lets alert the user
		alert("Preloader: El tipo '" + imgArray[loop][1] + "' no es soportado, igualmente la pagina se vera correctamente.");
	}
	if ( imgArray[loop][1] ) { LastType = imgArray[loop][1]; } }

	window.document.write("<br />" + PrintString);
}

window.document.write("</div>");


//redireccionamiento
function Redirect() {
    window.location.replace(RedirectTo);
}

if ( DoRedirect == "true" ) {
	window.onload = Redirect;
}