function ver(a)
{
	if(a=='competicion')
	{
		document.getElementById('nueva_comp').style.display='';	
		document.getElementById('anadir_comp').style.display='';
	}	
	if(a=='equipacion')
	{
		document.getElementById('nueva_equip').style.display='';	
		document.getElementById('anadir_equip').style.display='';
	}		
	if(a=='pais')
	{
		document.getElementById('nuevo_pais').style.display='';	
		document.getElementById('anadir_pais').style.display='';
	}	
	if(a=='ciudad')
	{
		document.getElementById('nueva_ciudad').style.display='';	
		document.getElementById('anadir_ciudad').style.display='';
	}		
	if(a=='deporte')
	{
		document.getElementById('nuevo_deporte').style.display='';	
		document.getElementById('anadir_deporte').style.display='';
	}		
}
function enviar(formulario, id)
{
	if(formulario=="form_eq")
	{	
		form_eq.action='pag1_restringido.php?anadir_equipo=si';
		form_eq.submit();
	}
	if(formulario=="form_eq_mod")
	{	
		form_eq_mod.action='pag1_restringido.php?modificar_equipo=si&idEqu=' + id;
		form_eq_mod.submit();
	}	
	if(formulario=="form_comp")
	{	
		form_comp.action='pag1_restringido.php?anadir_competicion=si';
		form_comp.submit();
	}	
	if(formulario=="form_comp_mod")
	{	
		form_comp_mod.action='pag1_restringido.php?modificar_competicion=si&idCom=' + id;
		form_comp_mod.submit();
	}		
	if(formulario=="form_ciu")
	{	
		form_ciu.action='pag1_restringido.php?anadir_ciudad=si';
		form_ciu.submit();
	}			
	if(formulario=="form_ciu_mod")
	{	
		form_ciu_mod.action='pag1_restringido.php?modificar_ciudad=si&idCiu=' + id;
		form_ciu_mod.submit();
	}		
}

function borrar(tabla)
{
var agree=confirm("¿Seguro que desea borrar el/la " + tabla + "?");
if (agree)
	return true ;
else
	return false ;
}


function ver_foto(imageType,imageName,imageWidth,imageHeight,alt,posLeft,posTop) {  // v4.01

	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);

	newWindow.document.open();

	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 

	if (imageType == "swf"){

	newWindow.document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');

	newWindow.document.write('<param name=movie value=\"'+imageName+'\"><param name=quality value=high>');

	newWindow.document.write('<embed src=\"'+imageName+'\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');

	newWindow.document.write('</embed></object>');	}else{

	newWindow.document.write('<img src=\"'+imageName+'\" width='+imageWidth+' height='+imageHeight+' alt=\"'+alt+'\">'); 	}

	newWindow.document.write('</body></html>');

	newWindow.document.close();

	newWindow.focus();

}

function openWindow(url, name, width, height) {
     w = width
     h = height
     x = Math.round((screen.availWidth-w)/2); //center the top edge
     y = Math.round((screen.availHeight-h)/2); //center the left edge
     popupWin = window.open(url, name, "width="+w+",height="+h+",scrollbars=no,history=no,toolbar=no,resizable=1,statusbar=yes,top="+y+",left="+x+",screeenY="+y+",screenX="+x);
     popupWin.creator=self;
	 popupWin.window.focus();
}
function actualizar(url)
{
 	location.replace(url);
}

function menu(a)
{
	if(a=='color')
	{
		document.getElementById('color').style.display='';
		document.getElementById('imagen').style.display='none';		
		document.getElementById('repetir').style.display='none';	
		document.getElementById('imagen_fondo').value='';	
		document.getElementById('repetir').value='';	
	}	
	if(a=='imagen')
	{
		document.getElementById('imagen').style.display='';
		document.getElementById('repetir').style.display='';	
		document.getElementById('color').style.display='none';
		document.getElementById('color_fondo').value='';
	}	
}
function mostrar_color(col)
{
	form_par.color_fondo.value=col;
}

function limpia(id)
{
	document.getElementById(id).value='';
}


