function tPromociones()
{
	// Propiedades
	this.descripciones = new Array();
	this.dormitorios = new Array();
	this.enlaces = new Array();
	this.idspromocion = new Array();
	this.logos = new Array();
	this.nombres = new Array();
	this.nombrespoblacion = new Array();
	this.numsviviendas = new Array();
	this.tiposbien = new Array();
	this.prioridades = new Array();
	this.zonas = new Array();
	this.preferente = new Array();
	this.aX = new Array();
	this.aY = new Array();
	this.aEnlacesGoogle = new Array();
	this.aEsDeZona = new Array();
	
	this.init = function()
	{
		this.posicion = -1;								// Posición de entre todos los objs.
		this.longitud = 0;								// Número de bienes entre todos los objs.
		this.s = '';
	}
	
	this.init();

	this.ComprobarPosicion = function (pos)
	{
		this.posicion = pos;
		return (pos <= this.longitud);
	}
	
	this.anyadir = function(obj, inicio)
	{
		this.posicion = this.longitud;
		var i = 0;
		var j = 0;

		for (j = 0; j < obj.recordcount; j++)
		{
			i = inicio + j;
			
			this.descripciones[i] = obj.data.descripcion[j].toString();
			this.dormitorios[i] = obj.data.dormitorios[j].toString()
			this.enlaces[i] = obj.data.enlace[j].toString().replace('$1', 'window.open').replace('$2', '/buscar/obranueva/rastreo/index_promocion.cfm?id_promo=')
			this.idspromocion[i] = obj.data.id_promocion[j].toString()
			this.s = obj.data.logo[j].toString()
			this.logos[i] = ((!isNaN(this.s) && (this.s != ''))?obj.data.logo[parseInt(this.s)].toString():this.s)
			this.nombres[i] = obj.data.nombre[j].toString()			
			this.s = obj.data.nombrepoblacion[j].toString()
			this.nombrespoblacion[i] = (!isNaN(this.s))?obj.data.nombrepoblacion[parseInt(this.s)].toString():this.s			
			this.numsviviendas[i] = obj.data.num_viviendas[j].toString()
			this.s = obj.data.tipo_bienes[j].toString()
			this.tiposbien[i] = ((!isNaN(this.s) && (this.s != ''))?obj.data.tipo_bienes[parseInt(this.s)].toString():this.s)
			this.s = obj.data.zonatext[j].toString();
			this.zonas[i] = (!isNaN(this.s) && (this.s != ''))?obj.data.zonatext[parseInt(this.s)].toString():this.s			
			this.preferente[i] = obj.data.preferente[j].toString()
			this.aX[i] = obj.data.x_g[j].toString();
			this.aY[i] = obj.data.y_g[j].toString();
			this.aEnlacesGoogle[i] = obj.data.enlace_google[j].toString();
			this.aEsDeZona[i] = obj.data.esdezona[j].toString();
		}
		this.longitud += obj.recordcount
	}
	
	this.dameIdPromocion = function(pos)
	{
		return (this.ComprobarPosicion(pos))?this.idspromocion[pos]:'';
	}
	
	this.dameEnlacePromocion = function(pos)
	{
		return (this.ComprobarPosicion(pos))?this.enlaces[pos]:'';
	}
	
	this.dameNombrePoblacion = function(pos)
	{
		return (this.ComprobarPosicion(pos))?this.nombrespoblacion[pos]:'';
	}
	
	this.dameTipoViviendas = function(pos)
	{
		return (this.ComprobarPosicion(pos))?this.tiposbien[pos]:'';
	}
	
	this.dameDescripcion = function(pos)
	{
		return (this.ComprobarPosicion(pos))?this.descripciones[pos]:'';
	}
	
	this.dameDormitorios = function(pos)
	{
		return (this.ComprobarPosicion(pos))?this.dormitorios[pos]:'';
	}
	
	this.dameLogo = function(pos)
	{
		return (this.ComprobarPosicion(pos))?(this.logos[pos]):'';
	}
	
	this.dameNombrePromocion = function(pos)
	{
		return (this.ComprobarPosicion(pos))?this.nombres[pos]:'';
	}
	
	this.dameZona = function(pos)
	{
		return (this.ComprobarPosicion(pos))?this.zonas[pos]:'';
	}
	
	this.damePreferente = function(pos)
	{
		return (this.ComprobarPosicion(pos))?this.preferente[pos]:'';
	}
	
	this.damePosicion = function(id_promocion)
	{
		r = -1;
		for(i = 0; (i < this.idspromocion.length) && (r == -1); i++)
			(id_promocion == this.idspromocion[i])?r = i:'';
		return r;
	}
	
	this.dameX = function(pos)
	{
		return (this.ComprobarPosicion(pos))?this.aX[pos]:'';
	}
	
	this.dameY = function(pos)
	{
		return (this.ComprobarPosicion(pos))?this.aY[pos]:'';
	}
	
	this.dameEnlaceGoogle = function(pos)
	{
		return (this.ComprobarPosicion(pos))?this.aEnlacesGoogle[pos]:'';
	}
	
	this.dameEsDeZona = function(pos)
	{
		return (this.ComprobarPosicion(pos))?this.aEsDeZona[pos]:'';
	}
	
	this.desplazar = function(posicion, numVeces)
	{
		for (e in this)
		{
			if (typeof(this[e]) == 'object')
			{
				array = this[e]
				for(i = 1; i <= numVeces; i++)
					array.insertAt(-1, posicion)
			}
		}
		this.longitud += numVeces;
	}
}