function Identidad ( )
{

    Identidad.prototype.CreateDatosRecintos = function ( id , datos )
	{


		var info = new Object ( );
		info.Logo 		= datos['Img'];
		info.UrlMasInfo = datos['Info'];
		info.Content1 	= ""
		info.Content2 	= "";



		info.Content3 	= this.Cortar ( Utils.Capitalize ( datos['Nombre'] )  , 29 , 26 , "..." );
		info.Content4 	= this.Cortar ( Utils.Capitalize ( datos['Direccion'] ) , 29 , 26 , "..." );
		info.Content5 	= this.Cortar ( Utils.Capitalize ( datos['Poblacion'] ) , 29 , 26 , "..." );
		info.Content6	= this.Cortar ( Utils.Capitalize ( datos['Provincia'] ) , 29 , 26 , "..." );



		return info;
	}

    Identidad.prototype.CreateDatosDestacado = function ( id , datos )
	{

		var info = new Object ( );
		info.Logo 		= datos['Imagen'];
		info.UrlMasInfo = datos['UrlMasInfo'];
		info.Content1 	= datos['Banner'];

		if ( datos['Agotado'].toUpperCase() == "S" )
		{
			info.Content2 	= Literal['Agotado'];
		}else
		{
			info.Content2 	= "";
		}

		if ( datos['Cancelado'].toUpperCase() == "S" )
		{
			info.Content2 	= Literal['Cancelado'];
		}else
		{
			info.Content2 	= "";
		}




		info.Content3 	= datos['Titulo'];
		info.Content5 	= datos['Desc1'];
		info.Content4 	= "";
		info.Content6 	= "";
		if ( datos['Activo'].toUpperCase() == "S" )
		{
			info.Activo = true;
		}else
		{
			info.Activo = false;
		}

		return info;
	}

    Identidad.prototype.CreateDatosEventos = function ( id , datos )
	{

    fechas = "";
    if ( datos['VerFecha'] == "S" ){
  		if ( datos['DesdeFecha'] == datos['HastaFecha'] )
  		{
  			var fechas = Utils.LiteralFecha ( datos['DesdeFecha'] , "FECHA" );
  			fechas += " | " + Utils.LiteralFecha ( datos['DesdeFecha'] , "HORA" );
  		}else
  		{
  			var fechas = Literal['Del'] + " " + Utils.LiteralFecha ( datos['DesdeFecha'] , "FECHA" );
  			fechas += " " + Literal['Al'].toLowerCase() + " " + Utils.LiteralFecha ( datos['HastaFecha'] , "FECHA" );
  		}
    }else if ( datos['VerHora'] == "S" ){
  		fechas = Utils.LiteralFecha ( datos['DesdeFecha'] , "HORA" );
    }

		


		var info = new Object ( );
		info.Logo 		= datos['Img'];
		info.UrlMasInfo = datos['Info'];
		info.Content1 	= datos['TipoE'];
		//(atca.53869 Clasificación moral)
    //info.Content2 	= "";
    if (datos['AliasCalif'] == 'PC')
      {
        info.Content2 = "";
        info.Content21 = "";
      }
      else
      {
        info.Content2 = datos['AliasCalif'];
        info.Content21 = datos['Calificacion'];
      }
    


		info.Content3 	= this.Cortar ( datos['Nombre'].toUpperCase() , 25 , 22 , "..." );

		if ( datos['Recinto'].length == 1 )
		{
			info.Content4 	= this.Cortar ( Utils.Capitalize ( datos['Recinto'][0]['Nombre'] ) , 29 , 26 , "..." );
			info.Content5 	= this.Cortar ( Utils.Capitalize ( datos['Recinto'][0]['Poblacion'] ) , 29 , 26 , "..." );
		}else
		{
			info.Content4 	= Literal['VariosRecintos'];
			info.Content5 	= "";
		}

		info.Content6 	= fechas;

		return info;
	}

	Identidad.prototype.FichaRecintos = function ( objDatos, idx )
	{
		/* 
			1.- Tipo Evento
			2.- AGOTADO
			3.- Primera Linea. Titulo
			4.- Segunda Linea. Recinto
			5.- Tercera Linea. Direccion
			6.- Cuarta Linea. Fecha y Hora.
		*/


		if ( ! objDatos )
		{
			return "";
		}

		if ( objDatos.UrlMasInfo != "" )
		{
			objDatos.UrlMasInfo = '<a href="#" onClick="Contenidos.ShowMasInfo(\'' + objDatos.UrlMasInfo + '\')"><img src="../static/web/img/masInfo.jpg" border="0"></a>';
		}

			

		var enlace = 'style="cursor:pointer" onClick="Contenidos.Link(' + idx + ')"';

		var cadena = '\
		<table height="83" width="230" border="0" class="bgFicha" cellpadding="0" cellspacing="0" >\
		<tr height="5px">\
			<td ' + enlace + ' bgcolor="#ffffff" width="58" rowspan="4" valign="top">\
				<img src="' + objDatos.Logo + '" onError="this.style.visibility=\'hidden\'" width="58" height="83" border="0" />\
			</td>\
			<td ' + enlace + ' width="6"  class="bgFichaColor1" >&nbsp;</td>\
			<td ' + enlace + ' height="18" colspan="2" nowrap class="bgFichaColor1"><font class="tipo_evento">' + objDatos.Content3 + '</font></td>\
		</tr>\
		<tr >\
			<td ' + enlace + ' rowspan="3" width="6"  class="detalle_evento" >&nbsp;</td>\
			<td ' + enlace + ' colspan="2" class="detalle_evento">' + objDatos.Content4 + '</td>\
		</tr>\
		<tr >\
			<td ' + enlace + ' colspan="2" class="detalle_evento">' + objDatos.Content5 + '</td>\
		</tr>\
		<tr >\
			<td width="224" ' + enlace + ' class="detalle_evento">' + objDatos.Content6 + '</td>\
			<td width="6" valign="bottom" align="right" >' + objDatos.UrlMasInfo + '</td>\
		</tr>\
		</table>';

		return cadena;	

	}

	Identidad.prototype.FichaEventos = function ( objDatos , idx )
	{
		/* 
			1.- Tipo Evento
			2.- AGOTADO
			3.- Primera Linea. Titulo
			4.- Segunda Linea. Recinto
			5.- Tercera Linea. Direccion
			6.- Cuarta Linea. Fecha y Hora.
		*/


		if ( ! objDatos )
		{
			return "";
		}


		if ( objDatos.Content2 != "" )
		{
			//(atca.53869 Clasificación moral)
      objDatos.Content2 = '<td width="5" class="bgFichaEventoCalificacionMoral">&nbsp;</td>\
				<td width="80" class="bgFichaEventoCalificacionMoral">\
          <span>\
            <a title="' + objDatos.Content21 + '">\
              '+ objDatos.Content2 + '\
            </a>\
          </span>\
        </td>\
				<td class="bgFichaEventoCalificacionMoral">&nbsp;</td>';

		}else
		{
			objDatos.Content2 = '<td width="5" class="detalle_evento">&nbsp;</td>\
				<td width="80" class="detalle_evento">&nbsp;</td>\
				<td class="detalle_evento">&nbsp;</td>';
		}

		if ( objDatos.Content1 == "" )
		{
			objDatos.Content1 = '<img src="../static/web/img/bit.gif" width="68" height="1">';
		}

		if ( objDatos.UrlMasInfo != "" )
		{
			objDatos.UrlMasInfo = '<a href="#" onClick="Contenidos.ShowMasInfo(\'' + objDatos.UrlMasInfo + '\')"><img src="../static/web/img/masInfo.jpg" border="0"></a>';
		}


		var enlace = 'style="cursor:pointer" onClick="Contenidos.Link(' + idx + ')"';



		var cadena = '\
		<table height="83" width="230" class="bgFicha" border="0" cellpadding="0" cellspacing="0">\
		<tr height="5px">\
			<td ' + enlace + ' class="detalle_evento" width="58" rowspan="5" valign="top">\
				<img src="' + objDatos.Logo + '" onError="this.style.visibility=\'hidden\'" width="58" height="83" border="0" />\
			</td>\
			<td ' + enlace + ' height="5" width="6"  class="bgFichaColor1" >&nbsp;</td>\
			<td ' + enlace + ' width="80" nowrap class="bgFichaColor1"><span class="tipo_evento">' + objDatos.Content1 + '</span></td>\
			' + objDatos.Content2 + '\
		</tr>\
		<tr>\
			<td ' + enlace + ' rowspan="4" width="6" >&nbsp;</td>\
			<td ' + enlace + ' colspan="3" class="titulo_evento">' + objDatos.Content3 + '</td>\
			<td rowspan="4" width="6" valign="bottom" >' + objDatos.UrlMasInfo + '</td>\
		</tr>\
		<tr>\
			<td ' + enlace + ' height="15" colspan="3" nowrap class="detalle_evento">' + objDatos.Content4 + '</td>\
		</tr>\
		<tr>\
			<td ' + enlace + ' height="15" colspan="3" nowrap class="detalle_evento">' + objDatos.Content5 + '</td>\
		</tr>\
		<tr>\
			<td ' + enlace + ' height="15" colspan="3" nowrap class="detalle_evento">' + objDatos.Content6 + '</td>\
		</tr>\
		</table>';

		return cadena;	

	}

	Identidad.prototype.FichaDestacados = function ( objDatos , idx )
	{
		/* 
			1.- Tipo Evento
			2.- AGOTADO
			3.- Primera Linea. Titulo
			4.- Segunda Linea. Recinto
			5.- Tercera Linea. Direccion
			6.- Cuarta Linea. Fecha y Hora.
		*/


		if ( ! objDatos )
		{
			return "";
		}


		if ( objDatos.Content2 != "" )
		{
			objDatos.Content2 = '<td width="5" class="bgFichaColor2">&nbsp;</td>\
				<td width="80" class="bgFichaColor2" align="center"><span class="tipo_evento">' + objDatos.Content2 + '</span></td>\
				<td class="bgFichaColor2">&nbsp;</td>';

		}else
		{
			objDatos.Content2 = '<td width="5" class="detalle_evento">&nbsp;</td>\
				<td width="80" class="detalle_evento">&nbsp;</td>\
				<td class="detalle_evento">&nbsp;</td>';
		}

		if ( objDatos.Content1 == "" )
		{
			objDatos.Content1 = '<img src="../static/web/img/bit.gif" width="68" height="1">';
		}

		if ( objDatos.UrlMasInfo != "" )
		{
			objDatos.UrlMasInfo = '<a href="#" onClick="Contenidos.ShowMasInfo(\'' + objDatos.UrlMasInfo + '\')"><img src="../static/web/img/masInfo.jpg" border="0"></a>';
		}


		var enlace = "";
		if ( objDatos.Activo )
		{
			enlace = 'style="cursor:pointer" onClick="Contenidos.Link(' + idx + ')"';
		}



		var cadena = '\
		<table height="83" width="230" class="bgFicha" border="0" cellpadding="0" cellspacing="0">\
		<tr height="5px">\
			<td ' + enlace + ' width="58" rowspan="5" valign="top">\
				<img src="' + objDatos.Logo + '" onError="this.style.visibility=\'hidden\'" width="58" height="83" border="0" />\
			</td>\
			<td ' + enlace + ' height="5" width="6"  class="bgFichaColor1" >&nbsp;</td>\
			<td ' + enlace + ' width="80" nowrap class="bgFichaColor1"><span class="tipo_evento">' + objDatos.Content1 + '</span></td>\
			' + objDatos.Content2 + '\
		</tr>\
		<tr>\
			<td ' + enlace + ' rowspan="4" width="6" >&nbsp;</td>\
			<td ' + enlace + ' colspan="3" class="titulo_evento">' + objDatos.Content3 + '</td>\
			<td rowspan="4" width="6" valign="bottom" >' + objDatos.UrlMasInfo + '</td>\
		</tr>\
		<tr>\
			<td ' + enlace + ' height="15" colspan="3" class="detalle_evento">' + objDatos.Content4 + '</td>\
		</tr>\
		<tr>\
			<td ' + enlace + ' height="15" colspan="3" class="detalle_evento">' + objDatos.Content5 + '</td>\
		</tr>\
		<tr>\
			<td ' + enlace + ' height="15" colspan="3" class="detalle_evento">' + objDatos.Content6 + '</td>\
		</tr>\
		</table>';

		return cadena;	

	}

	Identidad.prototype.Cortar = function ( cadena , maxLen, corteLen, sufijo )
	{
		if ( cadena.length > maxLen )
		{
			cadena 	= cadena.substring(0,corteLen) + sufijo;
		}
		return cadena;
	}

    Identidad.prototype.CrearEncabezadoSesion = function ( )
	{

		var session = Logica.Session;
    var calificacion = "";
		var masInfoRecinto = "";
		var masInfoEvento = "";
		
		if ( session.Recinto.Info != "" )
		{
			masInfoRecinto = '<a href="#" onClick="Contenidos.ShowMasInfo(\'' + session.Recinto.Info + '\')"><img src="../static/web/img/masInfo.gif" border="0"></a>';
		}
		if ( session.Evento.Info != "" )
		{
			masInfoEvento = '<a href="#" onClick="Contenidos.ShowMasInfo(\'' + session.Evento.Info + '\')"><img src="../static/web/img/masInfo.gif" border="0"></a>';
		}

		var literal = session.Recinto.Nombre;
		literal += " - " + session.Poblacion.Nombre;
		
		if((session.Evento.AliasCalif=="")||(session.Evento.AliasCalif=="PC"))
    {
		  calificacion = "&nbsp;";
    }else
    {
  		calificacion = session.Evento.Calificacion;
    }

// PARA PONER LA CALIFICACION
//      			<td width="50%" class="CabeceraSesionBgTitulo" align="right">&nbsp;&nbsp;<span class="CabeceraSesionTxtTitulo">' + calificacion + '&nbsp;&nbsp;</span></td>\

		//(atca.53869 Clasificación moral)
		var cadena = '<br>\
		<table align="center" width="100%" border="0" cellpadding="0" cellspacing="0">\
		<tr>\
			<td width="60" rowspan="3" valign="top">\
				<img src="' + session.Evento.Logo + '" onError="this.style.visibility=\'hidden\'" width="60" height="83" border="0" />\
			</td>\
			<td colspan="2" class="CabeceraSesionBgTitulo"  align="center">\
			   <table width="100%">\
			     <tr>\
      			<td width="50%" class="CabeceraSesionBgTitulo" >&nbsp;&nbsp;<span class="CabeceraSesionTxtTitulo">' + session.TipoE.Nombre + '</span></td>\
      			<td width="50%" class="CabeceraSesionBgTitulo" align="right">&nbsp;</span></td>\
      		</tr>\
      	</table>\
      </td>\
		</tr>\
		<tr class="CabeceraSesionBgCuerpo">\
			<td width="30" align="center">' + masInfoEvento + '</td>\
			<td class="CabeceraSesionTxtLinea1"><b>' + session.Evento.Titulo + '</b></td> \
      <td class="CabeceraSesionTxtLinealCalificacionMoral">' + calificacion + '</td>\
		</tr>\
		<tr class="CabeceraSesionBgCuerpo">\
			<td width="30" align="center">' + masInfoRecinto + '</td>\
			<td class="CabeceraSesionTxtLinea2">' + literal + '</td>\
      <td class="CabeceraSesionTxtLinealCalificacionMoral">&nbsp;</td>\
		</tr>\
		</table>\
		<br>';


		return cadena;	

	}
   Identidad.prototype.CreateListaZonasVenta = function ( item , nombre, opcion, imagenMapa )
    {


		var fecha = "";
		var enlaceCambiarFecha = "";
		if ( Logica.Session.Sesion.VerFecha )
		{
			fecha = Utils.LiteralFecha ( Logica.Session.Sesion.HoraSes , "DIA-SEMANA-CORTO" );
		}
		if ( Logica.Session.Sesion.VerHora )
		{
			fecha += " | " + Logica.Session.Sesion.Hora + " h.";
		}

		if ( ( Logica.Session.Sesion.VerFecha ) || ( Logica.Session.Sesion.VerHora ) )
		{
			enlaceCambiarFecha = Contenidos.EnlaceCambiar ( "Accion.CambiarFechaSesion()" , "<b>" + Literal['CambiarFecha'] + "</b>" );
		}


		var info = '\
			<table cellspacing="0" cellpadding="0" width="500" > \
		    <tr > \
				<td height="35" class="detalle_evento" nowrap colspan="2" align="left"><b>' + fecha + '</b></td> \
				<td colspan="3" align="left">\
					<table cellspacing="0" cellpadding="0" width="100%" > \
					<tr>\
						<td class="titulo_evento" nowrap align="right">' + enlaceCambiarFecha + '</td>';

						if ( ( opcion == "Bloque" ) && ( Aforo.Bloques['Zona'].length > 1 ) )
						{
							info += '<td>&nbsp;&nbsp;</td>\
									<td >' + Contenidos.EnlaceCambiar("Aforo.CambiarZona()" , "<b>" + Literal['CambiarZona'] + "</b>" ) + '</td>';
						}

			info += '</tr>\
					</table>\
				</td>\
			</tr>\
		    <tr height="25" class="bgTdTitulo"> \
		    <td class="txtTituloTabla" colspan="2" align="left">' + Literal['Zona'] + '</td> \
		    <td class="txtTituloTabla" align="center">' + Literal['Precio'] + '</td>';

			if ( Logica.Session.Sesion.VerDisponible )
			{
				info += '<td class="txtTituloTabla" align="right">' + Literal['Aforo'] + '</td> \
				<td class="txtTituloTabla" align="right">' + Literal['Libres'] + '</td>';
			}else
			{
				info += '<td >&nbsp;</td> \
				<td >&nbsp;</td>';
			}

		    info += '<td class="txtTituloTabla" align="right">&nbsp;</td> \
		    </tr>';


		for ( var i=0 ; i < item.length; i ++ )
		{


			var imagen = "";
			var enlace = "";
			if ( ( item[i]['MaxPrecio'] >= 0 ) && ( item[i]['MinPrecio'] >= 0 ) )
			{
				if ( item[i]['MaxPrecio'] == item[i]['MinPrecio'] )
				{
					var precios = Utils.FormatearImporte ( item[i]['MaxPrecio'] ) + " &euro;";
				}else
				{
					var precios = Utils.FormatearImporte ( item[i]['MinPrecio'] ) + "&euro; - " + Utils.FormatearImporte ( item[i]['MaxPrecio'] ) + "&euro;";
				}
			}else
			{
				var precios = "&nbsp";
			}


			if ( opcion == "Zona" )
			{
				
				if ( item[i]['ImagenMapa'] != "" )
				{
					imagen = Aforo.icoPath + "/" + item[i]['ImagenMapa'];
				}

				if ( item[i]['Disponible'] > 0 )
				{
					var estiloDisponible = "txtVerde";
					enlace = 'Aforo.DefineZonaAforo(' + i + ');Aforo.Procesar()';
				}else
				{
					var estiloDisponible = "txtRojo";
				}

			}else
			{
				if ( item[i]['Disponible'] > 0 )
				{
					var estiloDisponible = "txtVerde";
					enlace = 'Aforo.DefineBloqueAforo(' + i + ');Aforo.Procesar()';
				}else
				{
					var estiloDisponible = "txtRojo";
				}


				if ( item[i]['ImagenMapa'] != "" )
				{
					imagen = Aforo.icoPath + "/" + item[i]['LibIconos'] + "/" + item[i]['ImagenMapa'];
				}
			}


			info += '<tr height="25" class="bgTdTabla" \
							id="trZona_' + i + '" \
							style="cursor:pointer" ';

			if ( enlace != "" )
			{
				info += 'onClick="' + enlace + '" ';
			}


			if ( item[i]['ImagenMapa'] != "" )
			{
				info += 'onMouseOver="Aforo.CambiaPlano(\'' + imagen + '\', ' + i + ', true)" \
				onMouseOut="Aforo.CambiaPlano(\'' + imagenMapa + '\', '+ i + ', false)"';
			}

				info += ' >\
					<td width="25" valign="middle" align="center"> \
						<div style="width:10px;height:7px;background-color:#'+item[i]['Color']+'" ></div> \
					</td> \
					<td width="200" class="detalle_evento" align="left" >&nbsp;'+item[i][nombre]+'</td>\
					<td width="100" nowrap class="detalle_evento" align="right" ><b>'+precios+'</b></td>';

					if ( Logica.Session.Sesion.VerDisponible )
					{
						info += '<td width="100" class="detalle_evento" align="right" >'+item[i]['AforoTotal']+'</td>\
						<td width="100" class="' + estiloDisponible + '" align="right" >'+item[i]['Disponible']+'</td>';
					}else
					{
						info += '<td >&nbsp;</td>\
						<td>&nbsp;</td>';
					}

					info += '<td width="100" class="detalle_evento" align="right" >';
					if ( enlace != "" )
					{
						info += '<img src="../static/web/img/comprar.jpg">';
					}
					info += '</td>\
					</tr>\
					<tr class="bgBlanco"><td colspan="6" ><img src="../static/web/img/bit.gif" width="1" height="2" /></td>\
					</tr>';
		}


		info += '</table>';
		return info;

    };

}	
