﻿
mySimpleDialog = new YAHOO.widget.SimpleDialog("dlg", { 
    width: "20em", 
    effect:{effect:YAHOO.widget.ContainerEffect.FADE, duration:0.25}, 
    fixedcenter:true,
    modal:true,
    visible:false,
    draggable:false 
});

mySimpleDialog.setHeader("Warning!");
mySimpleDialog.setBody("Are you sure you want to delete this item?");
mySimpleDialog.cfg.setProperty("icon",YAHOO.widget.SimpleDialog.ICON_WARN);

var delCmd = "";
 
var handleYes = function() {
     this.hide(); 
     if (delCmd!="") eval(delCmd);
}

var handleNo = function() {
    this.hide();
}

var myButtons = [ { text:"Yes", 
			        handler:handleYes },
		          { text:"Cancel", 
		  	        handler:handleNo,
			        isDefault:true } ];

mySimpleDialog.cfg.queueProperty("buttons", myButtons);
   
function delClick(cmd) 
{   
    delCmd = cmd;
    mySimpleDialog.render(document.body); 
    mySimpleDialog.show();
}
