// JavaScript Document
/*Esta variable es la ruta de la carpeta raiz de Halconesxalapa*/
var ruta =  "/halconesxalapa/";

function menu_superior() {
var equipo = ruta + "equipo/"; 
var localidades = ruta + "localidades/"; 
var zonafan = ruta + "zona_fan/"; 
var historia = ruta + "historia/";
var calendario = ruta + "calendario/";
var estadisticas = ruta + "estadisticas/";
var noticias = ruta + "noticias/";
var club = ruta + "club/";
var academia = ruta + "academia/";

document.write("<ul id='menu'>");
document.write("<li><span><a href='"+ ruta +"index.html'>HOME</a></span></li>");

document.write("<li><span>EQUIPO</span>");
document.write("<!--[if lte IE 6]><a href='" + equipo + "index.html'><table><tr><td><![endif]-->");
document.write("<dl>");
document.write("	<dt><a href='" + equipo + "index.html'>EQUIPO</a></dt>");
document.write("	<dd><a href='" + equipo + "index.html'>Roster</a></dd>");
document.write("	<dd><a href='" + historia + "index.html'>Historia</a></dd>");
document.write("	<dd><a href='http://www.lnbp.com.mx/web2/admin_lv2/estadisticas/alltables.php#gral' rel='external'>Tabla de posiciones</a></dd>");
document.write("	<dd><a href='" + equipo + "transmisiones.html'>Transmisiones</a></dd>");

document.write("</dl>");
document.write("<!--[if lte IE 6]></td></tr></table></a><![endif]-->");
document.write("</li>");

document.write("<li><span><a href='"+ calendario +"index.html'>CALENDARIO</a></span></li>");

document.write("<li><span>ESTADISTICAS</span>");
document.write("<!--[if lte IE 6]><a href='" + ruta + "index.html'><table><tr><td><![endif]-->");
document.write("<dl>");
document.write("	<dt><a href='" + estadisticas + "index.html'>ESTADISTICAS</a></dt>");

document.write("	<dd><a href='" + estadisticas + "index.html'>Temporada 2009-10</a></dd>");
document.write("	<dd><a href='" + estadisticas + "temporada2008-09.html'>Temporada 2008-09</a></dd>");  
document.write("	<dd><a href='" + estadisticas + "temporada2007-08.html'>Temporada 2007-08</a></dd>");    
document.write("	<dd><a href='" + estadisticas + "temporada2006-07.html'>Temporada 2006</a></dd>");
document.write("	<dd><a href='" + estadisticas + "temporada2005-06.html'>Temporada 2005</a></dd>"); 
document.write("	<dd><a href='" + estadisticas + "temporada2004-05.html'>Temporada 2004</a></dd>");
document.write("	<dd><a href='" + estadisticas + "temporada2003-04.html'>Temporada 2003</a></dd>");
document.write("</dl>");
document.write("<!--[if lte IE 6]></td></tr></table></a><![endif]-->");
document.write("</li>");


document.write("<li><span>LOCALIDADES</span>");
document.write("<!--[if lte IE 6]><a href='" + localidades + "index.html'><table><tr><td><![endif]-->");
document.write("<dl>");
document.write("	<dt><a href='" + localidades + "index.html'>LOCALIDADES</a></dt>");

document.write("	<dd><a href='" + localidades + "index.html'>Abonos</a></dd>");
document.write("	<dd><a href='" + localidades + "boletos.html'>Boletos individuales</a></dd>");
document.write("	<dd><a href='" + localidades + "promociones.html'>Boletos Promociones</a></dd>");
document.write("	<dd><a href='" + localidades + "gimnasiouniversitario.html'>Mapa del Gimnasio</a></dd>");
document.write("</dl>");
document.write("<!--[if lte IE 6]></td></tr></table></a><![endif]-->");
document.write("</li>");

document.write("<li><span><a href='" + noticias + "index.html'>NOTICIAS</a></span></li>");

document.write("<li><span>ZONA FAN</span>");
document.write("<!--[if lte IE 6]><a href='" + zonafan + "index.html'><table><tr><td><![endif]-->");
document.write("<dl>");
document.write("	<dt><a href='" + zonafan + "index.html'>ZONA FAN</a></dt>");

document.write("	<dd><a href='" + zonafan + "galeria-juegos.html'>Galer&iacute;a de juegos</a></dd>");
document.write("	<dd><a href='" + zonafan + "porra.html'>Porra oficial</a></dd>");
document.write("	<dd><a href='" + zonafan + "index.html'>Trivias</a></dd>");
document.write("	<dd><a href='" + zonafan + "cubihalcon.html'>Cubi halc&oacute;n</a></dd>");
document.write("	<dd><a href='" + ruta + "foros/index.php' rel='external'>Foro</a></dd>");

document.write("	<dd><a href='" + zonafan + "tapices.html'>Wallpapers</a></dd>");
document.write("</dl>");
document.write("<!--[if lte IE 6]></td></tr></table></a><![endif]-->");
document.write("</li>");
document.write("<li><span>CLUB XALAPA</span>");
document.write("<!--[if lte IE 6]><a href='" + club + "index.html'><table><tr><td><![endif]-->");
document.write("<dl>");
document.write("	<dt><a href='" + club + "index.html'>CLUB XALAPA</a></dt>");

document.write("	<dd><a href='" + club + "index.html'>Misi&oacute;n-visi&oacute;n</a></dd>");
document.write("	<dd><a href='" + club + "directorio.html'>Directorio</a></dd>"); 
document.write("	<dd><a href='" + ruta + "contacto/index.html'>Cont&aacute;ctanos</a></dd>"); 
document.write("</dl>");

document.write("<!--[if lte IE 6]></td></tr></table></a><![endif]-->");
document.write("</li>");
document.write("<li><span>ACADEMIA</span>");
document.write("<!--[if lte IE 6]><a href='" + academia + "index.html'><table><tr><td><![endif]-->");
document.write("<dl>");
document.write("	<dt><a href='" + academia + "index.html'>ACADEMIA</a></dt>");

document.write("	<dd><a href='" + academia + "historia.html'>Historia</a></dd>");
document.write("	<dd><a href='" + academia + "index.html'>Objetivo</a></dd>");   
document.write("	<dd><a href='" + academia + "informes.html'>Informaci&oacute;n</a></dd>"); 
document.write("	<dd><a href='" + academia + "entrenadores.html'>Entrenadores</a></dd>"); 
document.write("	<dd><a href='" + academia + "materialdidactico.html'>Descargas</a></dd>");        
document.write("</dl>");
document.write("<!--[if lte IE 6]></td></tr></table></a><![endif]-->");
document.write("</li>");
document.write("</ul>");
}
/*Patrocinadores*/
function patrocinadores(){
	document.write(" <ul id='Patrocinadores'>");
	document.write("  <li id='Xalapa'><a href='http://www.hotelxalapa.com.mx/' rel='external' title='Hotel XALAPA'>&nbsp;</a></li>");
	document.write("  <li id='Ado'><a href='http://www.ado.com.mx/' rel='external' title='ADO'>&nbsp;</a></li>");
	document.write("  <li id='Key'><a href='http://www.keytalent.net/' rel='external' title='Key Talent'>&nbsp;</a></li>");
	document.write("  <li id='Corona'><a href='http://www.gmodelo.com.mx/' rel='external' title='Corona Extra'>&nbsp;</a></li>");
	document.write("  <li id='Comex'><a href='http://www.comex.com.mx/' rel='external' title='Comex'>&nbsp;</a></li>");
	document.write("  <li id='Gpg'><a href='http://www.gpgweb.com.mx/' rel='external' title='GPG Publicidad'>&nbsp;</a></li>");
	document.write("  <li id='Ferche'><a href='http://ferchegas.com.mx/' rel='external' title='FERCHE GAS'>&nbsp;</a></li>");
	document.write("  <li id='Adx'><a href='http://www.adx.com.mx/' rel='external' title='ADX'>&nbsp;</a></li>");
	
	document.write("  <li id='Gym' class='Bloque2'><a href='http://www.goldsgymmexico.com/' rel='external' title='GOLD'S GYM'>&nbsp;</a></li>");
	document.write("  <li id='Spa' class='Bloque2'><a href='http://www.burasan.com/hakimfitness/' rel='external' title='Hakim Spa'>&nbsp;</a></li>");
	document.write("  <li id='Ideas' class='Bloque2'><a href='http://www.ideasimpresos.com/' rel='external' title='iDeas Impresi&oacute;n Digital'>&nbsp;</a></li>");
	document.write("  <li id='Trevino' class='Bloque2'><a href='http://www.trevicom.com.mx/'rel='external' title='Trevi&ntilde;o Computaci&oacute;n'>&nbsp;</a></li>");
	document.write("  <li id='Xallapan' class='Bloque2'><a href='http://www.xallapan.com/' rel='external' title='Agua Purificada XALLAPAN'>&nbsp;</a></li>");
	document.write("  <li id='Total' class='Bloque2'><a href='http://www.electrolitsport.com/' rel='external' title='Electrolit HIDRATACI&Oacute;N TOTAL'>&nbsp;</a></li>");
	document.write("  <li id='Rtv' class='Bloque2'><a href='http://www.rtv.org.mx/' rel='external' title='RTV Radio Televisi&oacute;n de Veracruz'>&nbsp;</a></li>");
	document.write("  <li id='Acontecer' class='Bloque2'><a href='#' rel='external' title='acontecer'>&nbsp;</a></li>");
	document.write("  <li id='Spalding' class='Bloque2'><a href='http://www.spalding.com/' rel='external' title='SPALDING'>&nbsp;</a></li>");
	document.write("  <li id='Gatorade' class='Bloque2'><a href='http://www.gatorade.com.mx/' rel='external' title='Gatorade'>&nbsp;</a></li>");
	document.write(" </ul>"); 
}


/*Esto es para mostrar plecas aleatorias*/
var total_img = 3; //total de iágenes
var url_img =  ruta + "images/Home/caratula/caratula-"; //url de las imagenes aleatorias
function FondoPleca(){
 var img_aleatoria= "url("+url_img+Math.floor( Math.random() * total_img + 1)+ ".jpg" + ")";
   $("#PlecaHalcones").css('background-image', img_aleatoria);
}

function AgregaFondo(){
	if ($("#ContentTitulos.Fondo-Roster").length > 0) { //#some element exists 
		$("#FondoDerecha").addClass('FVerde');
		$("#Titulo span").addClass('slash-FVerde');
	}
	if ($("#ContentTitulos.Fondo-Calendario").length > 0) { //#some element exists 
		$("#FondoDerecha").addClass('FPlata1');
		$("#Titulo span").addClass('slash-FPlata1');		
	}
	if ($("#ContentTitulos.Fondo-Localidades").length > 0) { //#some element exists 
	    $("#FondoDerecha").addClass('FAzul2');
		$("#Titulo span").addClass('slash-FAzul2');
	}
	if ($("#ContentTitulos.Fondo-Academia").length > 0) { //#some element exists 
  	    $("#FondoDerecha").addClass('FVerde2');	
		$("#Titulo span").addClass('slash-FVerde2');
	}
	if ($("#ContentTitulos.Fondo-Zona").length > 0) { //#some element exists 
  	    $("#FondoDerecha").addClass('FAzul');
		$("#Titulo span").addClass('slash-FAzul');
	}
	if ($("#ContentTitulos.Fondo-Club").length > 0) { //#some element exists 
  	    $("#FondoDerecha").addClass('FAzulClub');
		$("#Titulo span").addClass('slash-FAzulClub');
	}
	if ($("#ContentTitulos.Fondo-Mapa").length > 0) { //#some element exists 
  	    $("#FondoDerecha").addClass('FVerde2');	;
	}

		  
}
/*Esto es para mostrar los jugadores de fondo aleatorio*/
var total_jugadores = 7; //total de iágenes
var url_jugador = ruta + "images/Home/fondo/"; //url de las imagenes aleatorias
function FondoPagina(){
 var img_aleatoria= "url("+url_jugador+Math.floor( Math.random() * total_jugadores + 1)+ ".jpg" + ")";
   $("#MasterPage").css('background-image', img_aleatoria);
}

/*Administrador de onload para html*/
function addLoadEvent (func) { 
	var oldonload = window.onload; 
	if (typeof window.onload != 'function') { 
			window.onload = func; 
		
		} 
		else { 
			window.onload = function() { 
				if (oldonload) { 
					oldonload(); 
				} 
					func(); 
			} 
	} 
}

/***** Es para el slide de Noticias de la Index *******/
// SET THIS VARIABLE FOR DELAY, 1000 = 1 SECOND
var delayLength = 4000;
function doMove(panelWidth, tooFar) {

	var leftValue = $("#mover").css("left");
	
	// Fix for IE
	if (leftValue == "auto") { leftValue = 0; };
	
	var movement = parseFloat(leftValue, 10) - panelWidth;
	if (movement == tooFar) {
		$(".PieNota").animate({opacity:0.0,
			"top": 305
		}, function() {
			$("#mover").animate({
				"left": 0
			}, function() {
				$(".PieNota").animate({opacity: 1,
					"top": 315
				});
			});
		});
	}
	else {
		$(".PieNota").animate({opacity:0.0,
			"top": 305
		}, function() {
			$("#mover").animate({
				"left": movement
			}, function() {
				$(".PieNota").animate({opacity: 1,
					"top": 315 //mueve hacia arriba
				});
			});
		});
	}
}

function Slide(){
    var $slide1 = $("#mover #slide-1");
	var panelWidth = 0;

	var panelWidth = $slide1.css("width");
	var panelPaddingLeft = $slide1.css("paddingLeft");
	var panelPaddingRight = $slide1.css("paddingRight");
	panelWidth = parseFloat(panelWidth, 10);
	panelPaddingLeft = parseFloat(panelPaddingLeft, 10);
	panelPaddingRight = parseFloat(panelPaddingRight, 10);

	panelWidth = panelWidth + panelPaddingLeft + panelPaddingRight;

	var numPanels = $(".slide").length;
	var tooFar = -(panelWidth * numPanels);
	var totalMoverwidth = numPanels * panelWidth;
	$("#mover").css("width", totalMoverwidth);

	//$("#slider").append('<a href="#" id="slider-stopper">Stop</a>');

	sliderIntervalID = setInterval(function(){
		doMove(panelWidth, tooFar);
	}, delayLength);
	
	//pauses on hover Simon
	$('.slide').hover(function() {
		clearInterval(sliderIntervalID);
	},
	function() {
		sliderIntervalID = setInterval(function(){
				doMove(panelWidth, tooFar);
			}, delayLength);
	});

}


function Links(){
	//para la opacidad en el Menu
	$('#MenuSuperior dd').css('opacity',0.9);
	
	$('a[rel="external"]').click( function() {
			  this.target = "_blank";
	});
	
	$('a[class="tblank"]').click( function() {
			  this.target = "_blank";
	});
}