(function () {
	YAHOO.namespace ("tecnopyme.widget"); 

  YAHOO.tecnopyme.widget.SimpleDialogYesNo = function(el, dialogText) {
					var config =  { width: "300px",
																			   fixedcenter: true,
																			   visible: false,
																			   draggable: true,
																			   close: true,
																			   modal: true,
																			   text: dialogText,
																			   icon: YAHOO.widget.SimpleDialog.ICON_HELP,
																			   constraintoviewport: true,
																			   buttons: [ { text:"S&iacute;", handler:this.handleYes },
																						  { text:"No",  handler:this.handleNo, isDefault:true } ]
																			 } ;
																			 
         if (arguments.length > 0) 
                YAHOO.tecnopyme.widget.SimpleDialogYesNo.superclass.constructor.call(this, el, config);
                
        this.setHeader("Aviso");
        this.eventYes = new YAHOO.util.CustomEvent("eventYes", this); 
				this.eventNo = new YAHOO.util.CustomEvent("eventNo", this); 
				
  };       
 YAHOO.lang.extend(YAHOO.tecnopyme.widget.SimpleDialogYesNo, YAHOO.widget.SimpleDialog, { 
 			handleYes : function() {
				this.eventYes.fire();
				this.hide();
			},
			handleNo : function() {
				this.eventNo.fire();
				this.hide();
			}

 });
 
   YAHOO.tecnopyme.widget.SimpleDialogYesNoCancel = function(el, dialogText) {
					var config =  { width: "300px",
																			   fixedcenter: true,
																			   visible: false,
																			   draggable: true,
																			   close: true,
																			   modal: true,
																			   text: dialogText,
																			   icon: YAHOO.widget.SimpleDialog.ICON_HELP,
																			   constraintoviewport: true,
																			   buttons: [ { text:"S&iacute;", handler:this.handleYes, isDefault:true },
																						  { text:"No",  handler:this.handleNo },
																						  { text:"Cancel",  handler:this.handleCancel }
																							 ]
																			 } ;
																			 
         if (arguments.length > 0) 
                YAHOO.tecnopyme.widget.SimpleDialogYesNoCancel.superclass.constructor.call(this, el, config);
                
        this.setHeader("Aviso");
        this.eventYes = new YAHOO.util.CustomEvent("eventYes", this); 
				this.eventNo = new YAHOO.util.CustomEvent("eventNo", this); 
				this.eventCancel = new YAHOO.util.CustomEvent("eventCancel", this); 
				
  };       
 YAHOO.lang.extend(YAHOO.tecnopyme.widget.SimpleDialogYesNoCancel, YAHOO.widget.SimpleDialog, { 
 			handleYes : function() {
				this.eventYes.fire();
				this.hide();
			},
			handleNo : function() {
				this.eventNo.fire();
				this.hide();
			},
			handleCancel : function() {
				this.eventCancel.fire();
				this.hide();
			}
			

 });
 //SimpleDialogAlert
 YAHOO.tecnopyme.widget.SimpleDialogAlert = function(el, dialogText) {
					var config =  { width: "300px",
																			   fixedcenter: true,
																			   visible: false,
																			   draggable: true,
																			   close: true,
																			   modal: true,
																			   text: dialogText,
																			   icon: YAHOO.widget.SimpleDialog.ICON_ALARM,
																			   constraintoviewport: true,
																			   buttons: [ { text:"Ok", handler:this.handleOk, isDefault:true }]
																			 } ;
																			 
         if (arguments.length > 0) 
                YAHOO.tecnopyme.widget.SimpleDialogYesNo.superclass.constructor.call(this, el, config);
                
        this.setHeader("Aviso");
        this.eventOk = new YAHOO.util.CustomEvent("eventOk", this); 
				
  };       
 YAHOO.lang.extend(YAHOO.tecnopyme.widget.SimpleDialogAlert, YAHOO.widget.SimpleDialog, { 
 			handleOk : function() {
				this.eventOk.fire();
				this.hide();
			}
 });
 
 }());
