/*
 * Evento
 * 
 * Version: 	$Revision: 1.0 $
 * Author:  Antonio Hernández Ritoré 
 */
 
function Evento(fecha,hora,titulo,estado,lugar){
// 	Definicion de atributos
	this.fecha = fecha;
	this.dia = fecha.substring(0,2);
	this.mes = fecha.substring(3,5);
	this.ano = fecha.substring(6,10);;
	this.hora = hora;
	this.titulo = titulo;
	this.estado = estado;
	this.lugar = lugar;	
	this.descripcion = null;
	this.precio = null;	
	this.imagenAc = null;
	this.imagenAg = null;
	this.url = null;	

		
//	Definicion de metodos
	this.setDescripcion = setDescripcion;
	this.setPrecio = setPrecio;
	this.setImagenAc = setImagenAc;
	this.setImagenAg = setImagenAg;	
	this.setUrl = setUrl;		
	this.toString = toString;	
	this.toAgenda = toAgenda;	
}

function setDescripcion(desc){
	this.descripcion = desc;
}

function setPrecio(precio){
	this.precio = precio;
}

function setImagenAc(imagen){
	this.imagenAc = imagen;
}

function setImagenAg(imagen){
	this.imagenAg = imagen;
}

function setUrl(url){
	this.url = url;
}

function toString(){
	if(this.titulo!="-"){
		s = "<LI><SPAN class=\"etiq\">" + this.titulo + "</SPAN>";
		s += "<BR>" + this.fecha + " [" + this.hora + "h]";
		s += "<BR>" + this.lugar;
		
		if(this.descripcion!=null){
			s += "<BR>" + this.descripcion;
		}
		if(this.imagenAc!=null){
			s += "<BR><IMG src=\"images/" + this.imagenAc + "\">";
		}
		s += "</LI>";
		
	}else{
		s = "<HR>";
	}
	return s;
}

function toAgenda(){
	if(this.titulo!="-"){
		s = "<SPAN class=\"agtit\">" + this.titulo + "</SPAN>";
		s += "<DIV class=\"agdes\">" + this.lugar;
		if(this.descripcion!=null){
			s += "<P align='justify'>" + this.descripcion + "</P>";
		}
		if(this.imagenAg!=null){
			s += "<P style='text-align:center'><IMG src=\"images/agenda/" + this.imagenAg + "\"></P>";
		}

	}else{
		s = "<HR>";
	}
	return s;
}



