extend(Modal, createjs.Container);

function Modal(txt)
{	
	this.initialize();
//--------------------------------//
	var _changes = new createjs.Container()

	// var al = alpha ? alpha : 0

	var sh = new createjs.Shape()
	sh.graphics.beginFill("000").drawRect(0,0,WIDTHGAME, HEIGHTGAME)
	// sh.alpha = al

	var f = new createjs.Sprite(jsons["JSON2"])
	f.gotoAndStop("window")
	f.scaleX = f.scaleY = .8
	setCoor(f, 126, -254)
	f.x = WIDTHGAME/2 - f.getBounds().width*f.scaleX/2
	// dragAndDrop(f)

	var text = new createjs.Sprite(jsons["JSON2"])
	text.gotoAndStop(txt)
	setCoor(text, 239, 130)
	text.x = WIDTHGAME/2 - text.getBounds().width/2
	text.y = 170/__koefDisplay - text.getBounds().height/2
	// dragAndDrop(text)
	this.addChild(_changes)

	_changes.addChild(f)
	_changes.addChild(text)

	this.slideFromTop = function(cb) {
		_changes.y = -180/__koefDisplay

		tw_tweenTo(_changes, {x: _changes.x, y: .1, d: .5, call: cb} )
	}

	this.slideToTop = function(cb) {
		var _curY = -180/__koefDisplay

		tw_tweenTo(_changes, {x: _changes.x, y: _curY, d: .5, call: cb} )
	}

	this.slideOnBottom = function(cb) {
		tw_tweenTo(_changes, {x: _changes.x, y: HEIGHTGAME, d: .5, call: cb} )
	}

	this.removeTweens = function(){
		tw_removeTween(_changes)
	}

	this.getChanges = function(){
		return _changes
	}

	this.getText = function(){
		return txt
	}

}