function showMenu(menuid)
{
	document.getElementById(menuid).style.display = 'block';
	if(menuid == 'mnu-down1')
	{
		document.getElementById('mnc1').style.backgroundPosition = '0 -27px';
	}else if(menuid == 'mnu-down2')
	{
		document.getElementById('mnc2').style.backgroundPosition = '0 -27px';
	}
	else if(menuid == 'mnu-down3')
	{
		document.getElementById('mnc3').style.backgroundPosition = '0 -27px';
	}
	else if(menuid == 'mnu-down4')
	{
	
		document.getElementById('mnc4').style.backgroundPosition = '0 -27px';
	}
	else if(menuid == 'mnu-down5')
	{
	
		document.getElementById('mnc5').style.backgroundPosition = '0 -27px';
	}
	else if(menuid == 'mnu-down6')
	{
	
		document.getElementById('mnc6').style.backgroundPosition = '0 -27px';
	}
	else if(menuid == 'mnu-down7')
	{
	
		document.getElementById('mnc7').style.backgroundPosition = '0 -27px';
	}
	else if(menuid == 'mnu-down8')
	{
	
		document.getElementById('mnc8').style.backgroundPosition = '0 -27px';
	}
			
}


function hiddeMenu(menuid,archivo)
{
	document.getElementById(menuid).style.display = 'none';
	if(menuid == 'mnu-down1')
	{
		document.getElementById('mnc1').style.background = 'url(images/mnu1.jpg)';
		if(archivo == "/index.php"){
			document.getElementById('mnc1').style.backgroundPosition = '0 -27px';
		}
		
	} else if(menuid == 'mnu-down2')
	{
		document.getElementById('mnc2').style.background = 'url(images/mnu2.jpg)';
		if(archivo == "/noticias.php" || archivo == "/noticia.php"){
			document.getElementById('mnc2').style.backgroundPosition = '0 -27px';
		}
		
	}else if(menuid == 'mnu-down3')
	{
		document.getElementById('mnc3').style.background = 'url(images/mnu3.jpg)';
		if(archivo == "/estadisticas.php"){
			document.getElementById('mnc3').style.backgroundPosition = '0 -27px';
		}
		
	}else if(menuid == 'mnu-down4')
	{
		document.getElementById('mnc4').style.background = 'url(images/mnu4.jpg)';
		if(archivo == "/equipos.php" || archivo == "/perfil-jugador.php"){
			document.getElementById('mnc4').style.backgroundPosition = '0 -27px';
		}
		
	}else if(menuid == 'mnu-down5')
	{
		document.getElementById('mnc5').style.background = 'url(images/mnu5.jpg)';
		if(archivo == "/meridafc-club.php" || archivo == "/elclub.php" || archivo == "/contacto.php"){
			document.getElementById('mnc5').style.backgroundPosition = '0 -27px';
		}
		
	}else if(menuid == 'mnu-down6')
	{
		document.getElementById('mnc6').style.background = 'url(images/mnu6.jpg)';
		if(archivo == "/boletos.php" || archivo == "/boletos-info.php" || archivo == "/boletos-promos.php" || archivo == "/calendario-juegos-venados.php" || archivo == "/plano-estadio.php"){
			document.getElementById('mnc6').style.backgroundPosition = '0 -27px';
		}
		
	}else if(menuid == 'mnu-down7')
	{
		document.getElementById('mnc7').style.background = 'url(images/mnu7.jpg)';
		if(archivo == "/multimedia.php" || archivo == "/videos.php" || archivo == "/fotos.php" || archivo == "/audio.php"){
			document.getElementById('mnc7').style.backgroundPosition = '0 -27px';
		}
		
	}
	else if(menuid == 'mnu-down8')
	{
		document.getElementById('mnc8').style.background = 'url(images/mnu8.jpg)';
		if(archivo == "/soy-venado.php" || archivo == "/toolbar.php" || archivo == "/e-cards.php" || archivo == "/himno.php" || archivo == "/laporra.php"){
			document.getElementById('mnc8').style.backgroundPosition = '0 -27px';
		}
		
	}
	
}









function AgregarComentario(id,tipo)
{
	var comentario = document.getElementById('txtcomentarios').value;
	xajax_addComentario(comentario,id,tipo)
}

function showFotos(id,totalpics,idfoto,foto)
{
 
	var path = "imagenes/galerias/";
	document.getElementById('box-foto').style.backgroundImage =  "url(http://www.meridafutbolclub.com/imagenes/galerias/loader.gif)";
	document.getElementById('box-foto').style.backgroundRepeat = 'no-repeat';
	document.getElementById('box-foto').style.backgroundPosition = 'center'; 
	document.getElementById('foto').src = '';
	
	
	for(i = 1; i <= totalpics; i++)
	{

		if("picture"+i == id)
		{
			document.getElementById('picture'+i).className = 'linkscarousel2';
		
		}else{
		
			document.getElementById('picture'+i).className = 'linkscarousel';
		}

	}
	document.getElementById('foto').src = path + foto;

}

function printStats()
{

	ancho=710; alto=600;
	var _W=window.open('/imprimir-estadisticas.php',"_blank","scrollbars=yes,width="+ancho+",height="+alto); 
	_W.focus(); 
    iz=(screen.width-ancho) / 2;
    de=(screen.height-alto) / 2;
    _W.moveTo(iz,de);	
	
}
function printNoticia(id,cat)
{
	ancho=710; alto=500;
	var _W=window.open('/imprimir.php?id='+id+'&cat='+cat,"_blank","scrollbars=yes,width="+ancho+",height="+alto); 
	_W.focus(); 
    iz=(screen.width-ancho) / 2;
    de=(screen.height-alto) / 2;
    _W.moveTo(iz,de);	
}

function activarTab(id)
{
	var tabsTotal = 3;
	var tab = document.getElementById('tabMul'+id);
	var tabC = document.getElementById('tabC'+id);
	var i;
	
	for(i = 0;i<tabsTotal;i++)
	{
		if((i+1) == id)
		{
		
			tabC.style.display = 'block';
			tab.className = 'tabEnabled';
		}else{
		
				 document.getElementById('tabMul'+(i+1)).className = 'tabDisabled';
				 document.getElementById('tabC'+(i+1)).style.display = 'none';	
		}
	}
	
}


Cufon.replace('#head-content h1',{fontFamily: 'Helvetica Narrow'});
Cufon.replace('#numeroJugador',{fontFamily: 'Helvetica Narrow'});
Cufon.replace('#nombreJugador',{fontFamily: 'Helvetica Narrow'});
Cufon.replace('#nombreJugador2',{fontFamily: 'Helvetica Narrow'});
window.onload = function()
{
	selectTab('1');
	var favoritos =	document.getElementById('favoritos');
	
	if(favoritos)
	{
		favoritos.onclick = function()
		{
			AgregarFavoritos();
		}
	}
	var recomendar = document.getElementById('recomendar');			
	if(recomendar)
	{
		recomendar.onclick = function()
		{
			openWindow('recomendar.php','Recomendar a un amigo');
		}
	}	

}	
function selectTab(id)
{
	var x;
	try{
	var cBox1 = document.getElementById('contentBox1');
	var cBox2 = document.getElementById('contentBox2');
	
	var link1 = document.getElementById('link1');
	var link2 = document.getElementById('link2');
	
	if(id == 1)
	{
		cBox2.style.display = 'none';
		cBox1.style.display = 'block';
		link2.className = 'tabOff';
		link1.className = 'tabOn';
		link1.style.borderRightStyle ='solid';
		link1.style.borderRightWidth = '1px';
		link1.style.borderRightColor = '#1d1d1c';
		link2.style.border ='none';

		
		
	}else{

		cBox2.style.display = 'block';
		cBox1.style.display = 'none';	
		link2.className = 'tabOn';
		link2.style.borderLeftStyle ='solid';
		link2.style.borderLeftWidth = '1px';
		link2.style.borderLeftColor = '#1d1d1c';
		link1.style.border ='none';
		link1.className = 'tabOff';
	
	}
	} catch(x) {
	
	return 0;
	}
}
function filtroVideos()
{
	var anio = document.getElementById('anio').value;
	var mes = document.getElementById('meses').value;
	
	if(anio > 0 && mes > 0)
	{
	
		document.location.href  = 'videos.php?anio='+anio+'&meses='+mes;

	}else if(anio > 0 && mes < 1){
		
		document.location.href  = 'videos.php?anio='+anio;
	}else if(anio < 1 && mes > 0){
	
		document.location.href  = 'videos.php?meses='+mes;
	}
}
function verNewsComunidad(anio,id)
{
	document.location.href = 'elclub.php?year='+anio+'&id='+id;
}
function verNews(anio,id)
{
	document.location.href = 'noticias.php?year='+anio+'&id='+id;
}
function AgregarFavoritos() 
{
	if (navigator.appName=="Netscape") 
	{
		window.sidebar.addPanel(document.title,document.location.href,""); 
	}

	if (navigator.appName=="Microsoft Internet Explorer"){
	
		window.external.AddFavorite(location.href, document.title);
	}
}
function openWindow(modulo,titulo)
{
	ancho=400; alto=350;
	var W=window.open(modulo,"_blank","scrollbars=yes,width="+ancho+",height="+alto);
	W.focus();
	iz=(screen.width-ancho) / 2;
	de=(screen.height-alto) / 2;
	W.moveTo(iz,de);	
}
function vota(){

var opewindow;
for (i=0;i<document.encuesta.resp.length;i++){ 
	//alert(document.encuesta.resp[i].value);
	
       	if (document.encuesta.resp[i].checked){ 
          var id = document.encuesta.resp[i].value;
		  //alert( document.encuesta.resp[i].value);
		  MDM_openWindow('transaction.php?id='+id,'InterfaceAmigo','scrollbars=yes,width=280,height=350'); 
		  break;
		}
    }
}

function MDM_openWindow(theURL,winName,features){
          var _W=window.open(theURL,winName,features);
          _W.focus();
      _W.moveTo(20,20);
}
function validarEmail(email)
{
	re=/^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$/
    if(!re.exec(email))    {
        return false;
    }else{
        return true;
    }
}
function slideDots(a,b,index,d)
{
var x;



try{
	var slide1 = document.getElementById('slide1');
	var slide2 = document.getElementById('slide2');
	var slide3 = document.getElementById('slide3');
	if(index >= 1 && index <= 3)
	{	
		slide1.src = 'bton.gif';
		slide2.src = 'btoff.gif';
		slide3.src = 'btoff.gif';
		
	}
	else if(index >= 4 && index < 7)
	{
		slide1.src = 'btoff.gif';
		slide2.src = 'bton.gif';
		slide3.src = 'btoff.gif';
	}
	else if(index >= 7)
	{
		slide1.src = 'btoff.gif';
		slide2.src = 'btoff.gif';
		slide3.src = 'bton.gif';
	}
}catch(x)
{
	return 0;
}

}
function showTabShare()
{
	document.getElementById('sharePic').style.backgroundPosition = '0 -14px';
}
function hideTabShare()
{
	document.getElementById('sharePic').style.backgroundPosition = '0 0';
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
	
	
function escribir(obj,estado)
{
	if(estado){
			
			if(obj.value==obj.defaultValue){ obj.value='';}
		
	}
	else
	{
			if(obj.value==''){ obj.value=obj.defaultValue;}
	
	}
}

	
	
	/***********************************************
* Cool DHTML tooltip script II- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip

var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" src="arrow2.gif">') //write out pointer image

var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thewidth, thecolor){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width='100'
}
}

document.onmousemove=positiontip;
