function HtmlWindow(idVentana) {
	this.idVentana = idVentana;
	this.init = cargarVentana;
}

function cargarVentana() {
	// Establecemos los efectos de movimiento de la ventana
	if(this.bMover)	{
		var $myDrag = new Draggable('wnd_' + this.idVentana,{handle: 'title_' + this.idVentana});
	}
	
	if(this.bVerMinizar) {
		$(this.idVentana + '_Min').idVentana = this.idVentana;
		$(this.idVentana + '_Min').shadeImg = this.shadeImg;
		$(this.idVentana + '_Min').unShadeImg = this.unShadeImg;
		$(this.idVentana + '_Min').onclick = function () {			
			if($(this.idVentana).style.display=='none') {
				//this.className = this.className.replace('minizada','');
				this.style.backgroundImage = "url('"+ this.shadeImg +"')";
			} else {
				//this.className += ' minizada';
				this.style.backgroundImage = "url('"+ this.unShadeImg +"')";
			}
			Effect.toggle(this.idVentana,'blind',{duration: 0.2});			
		}
		
		// Efectos de Intercambio de botones
		$(this.idVentana + '_Min').onmouseover = function () {
			this.style.cursor = 'pointer';
			this.style.backgroundPosition = '-19px 0px';
		}		
		$(this.idVentana + '_Min').onmouseout = function () {
			this.style.cursor = 'normal';
			this.style.backgroundPosition = '0px 0px';
		}
	}

	if(this.bVerCerrar) {
		$(this.idVentana + '_Cerrar').onmouseover = function () {
			this.style.cursor = 'pointer';
			this.style.backgroundPosition = '-19px 0px';
		}
		$(this.idVentana + '_Cerrar').onmouseout = function () {
			this.style.cursor = 'normal';
			this.style.backgroundPosition = '0px 0px';
		}
		if(typeof(this.onclose)=='function') 
			$(this.idVentana + '_Cerrar').onclose = this.onclose;
		$(this.idVentana + '_Cerrar').onclick = function() {
			this.parentNode.parentNode.style.display = 'none';			
			if(typeof(this.onclose)=='function') this.onclose();
		}
	}
	
	if(this.bMostrarAyuda) {
		$(this.idVentana + '_Ayuda').onmouseover = function () {
			this.style.cursor = 'pointer';
			this.style.backgroundPosition = '-19px 0px';
		}
		$(this.idVentana + '_Ayuda').onmouseout = function () {
			this.style.cursor = 'normal';
			this.style.backgroundPosition = '0px 0px';
		}
	}
}