/*****************************************************************************
SHAJAX - Auxiliar Window Control
Copyright (C) 2006  Daniel Dalgo

This library is free software; you can redistribute it and/or modify it under 
the terms of the GNU Lesser General Public License as published by the 
Free Software Foundation; either version 2.1 of the License, or (at your option) 
any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY 
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along 
with this library; if not, write to the Free Software Foundation, Inc., 59 
Temple Place, Suite 330, Boston, MA 02111-1307 USA 
*****************************************************************************
*****************************************************************************
*****************************  CONTACT **************************************
							   -------
PLEASE, CONTACT US AT:
www.7bits.com.ec
ddalgo@7bits.com.ec
Quito, Ecuador
*****************************************************************************
***************************  EXTRA FILES ************************************
							 -----------
Also, please refer to the helper files annexed
- "updates.txt" 
- "bugs.txt"
for info about new features or bugs in this library, and also use it 
for post your own information. Contact us using the media referred above, in
the CONTACT section.

All the files referred here, in the EXTRA FILES section, and the new info
posted in those files are also covered for the license here mentioned.
*****************************************************************************/

// Javascript

/** Crea un objeto de tipo 'VentanaAuxImagesArray'
 */
function VentanaAuxImagesArray(imgMaximizar, imgMinimizar, imgCerrar){
	this.imgMaximizar=(imgMaximizar?new String(imgMaximizar):null);
	this.imgMinimizar=(imgMinimizar?new String(imgMinimizar):null);
	this.imgCerrar=(imgCerrar?new String(imgCerrar):null);
}

/** Función de la Clase que crea un objeto de tipo VentanaAuxImagesArray
 * pero con todos sus elementos ya inicializados a null
 */
VentanaAuxImagesArray.crearObjeto=function(){
	return new VentanaAuxImagesArray(null, null, null);
}

/** Función que devuelve una imagen concreta de acuerdo a un código de ubicación, así si
 * se envía:
 * 		dato		=>	devuelve la imagen para
 *		-----		-----------------------
 *		 '0'		Cerrar
 *		 'x'		Maximizar
 *		 'm'		Minimizar
 */
VentanaAuxImagesArray.prototype.getImage=function(dato){
	var szValor;
	var szDato=new String(dato);
	var blFlag=true;
	
	if(szDato=="0" && blFlag){
		szValor=this.imgCerrar;
		blFlag=false;
	}
	if(szDato=="x" && blFlag){
		szValor=this.imgMaximizar;
		blFlag=false;
	}
	if(szDato=="m" && blFlag){
		szValor=this.imgMinimizar;
		blFlag=false;
	}
	
	if(!szValor){
		if(typeof szValor=="undefined"){
			szValor=null;
		}
	}
	
	return szValor;
}

/** Función que establece una imagen concreta de acuerdo a un código de ubicación, así si
 * se envía:
 * 		dato		=>	establece la imagen para
 *		-----		----------------------------
 *		 '0'		Cerrar
 *		 'x'		Maximizar
 *		 'm'		Minimizar
 */
VentanaAuxImagesArray.prototype.setImage=function(dato, imgRuta){
	var szImgRuta=new String(imgRuta);
	var szDato=new String(dato);
	
	if(szDato=="0"){
		this.imgCerrar=szImgRuta;
		return;
	}
	if(szDato=="x"){
		this.imgMaximizar=szImgRuta;
		return;
	}
	if(szDato=="m"){
		this.imgMinimizar=szImgRuta;
		return;
	}
}

