function Cabecera_Principal(Titol,Imatge)
	{
	document.write('		<table width="98%" height="30" border="0" align="center" cellpadding="0" cellspacing="0">');
	document.write('		  <tr>'); 
	document.write('			<td valign="middle" class="txttop" style="width:auto">FEDERACI&Oacute; CATALANA DE MOTOCICLISME</td>');
  document.write('      <td class="txttop" style="width:500px;text-align:right"><div style="float:right">&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;' + Titol + '</div><div id="dividioma" style="float:right"></div></td>');
  document.write('		  </tr>');
	document.write('		</table>');
	document.write('	 </TD>');
	document.write('  </TR>');
	document.write('  <TR>');
	document.write('    <TD width="100%" height="103" BGCOLOR="#000000">');
  
  document.write('      <table width="100%" height="103" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000">');
  document.write('        <tr height="103">');
  document.write('          <td width="135">');
  document.write('            <a href="default.asp"><img src="imatges/logo.jpg" alt="Federaci&oacute; Catalana de Motociclisme" width="135" height="103" border="0"><br></a>');
  document.write('          </td>');
  document.write('          <td width="auto">');
  document.write('           &nbsp;<br>');
  document.write('          </td>');
  document.write('          <td width="494">');      
  document.write('            <a href="default.asp"><img src="imatges/logo2.jpg" alt="Federaci&oacute; Catalana de Motociclisme" width="494" height="103" border="0"><br></a>');
  document.write('         </td>');
  document.write('         <td width="335" background="' + Imatge + '">');
  document.write('           <img src="imatges/top2.gif" alt="Federaci&oacute; Catalana de Motociclisme" width="84" height="103" border="0"><br>');
  document.write('         </td>');
  document.write('        </tr>');
  document.write('      </table>');
	}

function Cabecera_Secundaria()
	{
	document.write('<tr>'); 
	document.write('  <td bgcolor="#F7F7F7">');
	document.write('	<table width="100%" border="0" cellspacing="5" cellpadding="5">');
	document.write('	  <tr>');
	document.write('		<td width="33%" height="100" bgcolor="#FFFFFF"> <div align="center"><a href="http://www.gemocat.com/" target="_blank"><img src="imatges/gemocat.jpg" alt="GEMOCAT" width="200" height="93" border="0"></a></div></td>');
	document.write('		<td width="33%" bgcolor="#CCCCCC"><div align="center"><a href="imatges/Promo%20Derbi.pdf" target="_blank"><img src="imatges/copamotard.jpg" alt="copa motard" width="200" height="93" border="0"></a></div></td>');
	document.write('		<td width="33%" bgcolor="#D7141F"> <div align="center"><img src="imatges/apuntat.gif" alt="Moto Esport" width="200" height="50"></div></td>');
	document.write('	  </tr>');
	document.write('	</table>');
	document.write('  </td>');
	document.write('</tr>');
	}

function Peu_Principal(ididioma)
	{
	document.write('  <TR>'); 
	document.write('	<td height="30" background="imatges/bar.gif" bgcolor="#FFFFFF">');
	document.write('		<table width="100%" border="0" cellspacing="10" cellpadding="0">');
	document.write('			<tr>');

	if(ididioma==1)
	{
		document.write('			  <td><div align="left" class="txtbottom">&copy; Federaci&oacute; Catalana de Motociclisme | <a href="avislegal.asp" CLASS="LinkPeuPagina">Aviso legal</a> | <a href="credits.asp" CLASS="LinkPeuPagina">Créditos</a> | <a href="mapaweb.asp" CLASS="LinkPeuPagina">Mapa Web</a> | <a href="contacte.asp" CLASS="LinkPeuPagina">Contacta con nosotros</a></div></td>');
	}
	if(ididioma==2)
	{
		document.write('			  <td><div align="left" class="txtbottom">&copy; Federaci&oacute; Catalana de Motociclisme | <a href="avislegal.asp" CLASS="LinkPeuPagina">Av&iacute;s legal</a> | <a href="credits.asp" CLASS="LinkPeuPagina">Crèdits</a> | <a href="mapaweb.asp" CLASS="LinkPeuPagina">Mapa Web</a> | <a href="contacte.asp" CLASS="LinkPeuPagina">Contacta amb nosaltres</a></div></td>');
	}
	if(ididioma==3)
	{
		document.write('			  <td><div align="left" class="txtbottom">&copy; Federaci&oacute; Catalana de Motociclisme | <a href="avislegal.asp" CLASS="LinkPeuPagina">Legal Notice</a> | <a href="credits.asp" CLASS="LinkPeuPagina">Credits</a> | <a href="mapaweb.asp" CLASS="LinkPeuPagina">Site Map</a> | <a href="contacte.asp" CLASS="LinkPeuPagina">Contact us</a></div></td>');
	}

	document.write('			</tr>');
	document.write('		</table>');
	document.write('	</td>');
	document.write('  </TR>');
	document.write('  <TR>'); 
	document.write('	<td height="34" bgcolor="#F7F7F7">');
	document.write('		<table width="100%" border="0" cellspacing="10" cellpadding="0">');
	document.write('			<tr>');
	document.write('			  <td>&nbsp;</td>');
	document.write('			  <td><div align="right" class="txt"> Enric Granados, 112 2n 1a. 08008 Barcelona Tel. 93 415 11 84 - Fax 93 237 14 77 </div></td>');
	document.write('			</tr>');
	document.write('		</table>');
	document.write('	</td>');
	document.write('  </TR>');
	}

function abrirAlta()
  {
   window.open('federado_Insertar.asp','','height=825,width=775,scrollbars=1,resizable=1');
  }

function zonaprivada_home(idioma)
{
	document.write('<table width="100%" border="0" cellpadding="8" cellspacing="1" bgcolor="#D7141F">');
	document.write('	<tr>'); 
	
	if(idioma==1)
	{
		document.write('	  <td background="../imatges/bar.gif" class="txttop">ZONA PRIVADA</td>');
	}
	if(idioma==2)
	{
		document.write('	  <td background="../imatges/bar.gif" class="txttop">ZONA PRIVADA</td>');
	}
	if(idioma==3)
	{
		document.write('	  <td background="../imatges/bar.gif" class="txttop">PRIVATE ZONE</td>');
	}
	
	document.write('	</tr>');
	document.write('	<tr>'); 
	document.write('	  <td bgcolor="#FFFFFF" class="txt">');
	document.write('  		<table width="100%" border="0" cellspacing="0" cellpadding="7">');
	document.write('        <tr>');
	document.write('  				<td bgcolor="#FFFFFF">');
	document.write('              <table width="100%" border="0" cellpadding="0" cellspacing="0">');
	document.write('                <tr>');
	document.write('                  <td valign="top">');
	document.write('                    <form name="form_vip" method="post" action="privada_zonaentrar.asp" onSubmit="return comprueba_acceso();">');
	document.write('                      <table width="100%" border="0" cellspacing="8" cellpadding="0">');
	document.write('                        <tr>');
	document.write('                          <td class="categoria">');
	
	if(idioma==1)
	{
		document.write('                            <div align="right" class="txt">Categoría:</div>');
	}
	if(idioma==2)
	{
		document.write('                            <div align="right" class="txt">Categoria:</div>');
	}
	if(idioma==3)
	{
		document.write('                            <div align="right" class="txt">Category:</div>');
	}
	
	document.write('                          </td>');
	document.write('                          <td>');
	document.write('                            <div align="right">');
	document.write('                              <select name="zonaprivada" id="zonaprivada" class="txt" style="width:150px" onChange="javascript:cambio()">');

	if(idioma==1)
	{
		document.write('                                <option selected>Escoge la categoría</option>');
		document.write('                                <option value="4">Club</option>');
		document.write('                                <option value="5">Federado</option>');
		document.write('                                <!-- <option value="3">Prensa</option> -->');
	}
	if(idioma==2)
	{
		document.write('                                <option selected>Escull la categoria</option>');
		document.write('                                <option value="4">Club</option>');
		document.write('                                <option value="5">Federat</option>');
		document.write('                                <!-- <option value="3">Premsa</option> -->');
	}
	if(idioma==3)
	{
		document.write('                                <option selected>Choose your category</option>');
		document.write('                                <option value="4">Club</option>');
		document.write('                                <option value="5">Land</option>');
		document.write('                                <!-- <option value="3">Press</option> -->');
	}

	document.write('                              </select>');
	document.write('                            </div>');
	document.write('                          </td>');
	document.write('                          <td></td>');
	document.write('                        </tr>');
	document.write('                        <tr>');
	document.write('                          <td class="categoria">');

	if(idioma==1)
	{
		document.write('                            <div align="right" class="txt">Usuario:</div>');
	}
	if(idioma==2)
	{
		document.write('                            <div align="right" class="txt">Usuari:</div>');
	}
	if(idioma==3)
	{
		document.write('                            <div align="right" class="txt">User:</div>');
	}

	document.write('                          </td>');
	document.write('                          <td>');
	document.write('                            <div align="right">');
	document.write('                              <input class="txt" name="usuario" type="text" style="width:150px" maxlength="15">');
	document.write('                            </div>');
	document.write('                          </td>');
	document.write('                          <td></td>');
	document.write('                        </tr>');
	document.write('                        <tr>');
	document.write('                          <td class="categoria">');
	document.write('                            <div align="right" class="txt">Password: </div>');
	document.write('                          </td>');
	document.write('                          <td>');
	document.write('                            <div align="right">');
	document.write('                              <input class="txt" name="clave" type="password" style="width:150px" maxlength="15">');
	document.write('                            </div>');
	document.write('                          </td>');
	document.write('                          <td>');

	if(idioma==1)
	{
		document.write('                            <input name="Submit" type="submit" class="txt" value="Acceder">');
	}
	if(idioma==2)
	{
		document.write('                            <input name="Submit" type="submit" class="txt" value="Accedir">');
	}
	if(idioma==3)
	{
		document.write('                            <input name="Submit" type="submit" class="txt" value="Enter">');
	}
	document.write('                          </td>');
	document.write('                        </tr>');
	document.write('                      </table>');
	document.write('                    </form>');
	document.write('                  </td>');
	document.write('                </tr>');
	document.write('                <tr><td align="center">');
	if(idioma==1)
	{
		document.write('					<A HREF="javascript:;" onClick="abrirAlta()" class="titulnotis">Darse de alta como federado</A>');
	}
	if(idioma==2)
	{
		document.write('					<A HREF="javascript:;" onClick="abrirAlta()" class="titulnotis">Donar-se d´alta com federat</A>');
	}
	if(idioma==3)
	{
		document.write('					<A HREF="javascript:;" onClick="abrirAlta()" class="titulnotis">Darse de alta como federado</A>');
	}
	document.write('         		</td></tr>');
	document.write('              </table>');
	document.write('  				</td>');
	document.write('  			</tr>');
	document.write('  		</table>');
	document.write('    </td>');
	document.write('  </tr>');
	document.write('</table>');
	document.write('<br>');
}

function comprueba_acceso()
{
  if(document.getElementById("zonaprivada").value!="")
  {
    txt_zonaprivada=document.getElementById("zonaprivada").value;
    if(document.getElementById("usuario").value!="")
    {
      txt_usuario=document.getElementById("usuario").value;
      if(document.getElementById("clave").value!="")
      {
        txt_clave=document.getElementById("clave").value;
        form_vip.submit();
        return true;
      }
      else
      {
        alert("El camp password està buit");
        return false;
      }
    }
    else
    {
      alert("El camp usuari està buit");
      return false;
    }
  }
  else
  {
    alert("Ha de sel·leccionar una categoria");
    return false;
  }
}
function cambio()
{
  if (document.getElementById("zonaprivada").value=="3")
  { 
    alert("Estem treballant en la construcció d'aquesta zona privada. En breu estarà disponible. Gràcies");
  }
}
