var TypeID = 0;
var TypeTab = 0;

//delete icon
function DelIcon(id, tab){
	TypeID = id;
	TypeTab = tab;
	var dialog = "Are you sure you want to delete this item?";
 	Dialog.confirm(dialog, {width:270, className: "bluelighting", okLabel: "Yes", id:"DconfirmID",cancelLabel:"No",onOk:function(){DelIconOK();return true;},onCancel:function(){return false;}});
}

function DelIconOK(){
	var params = "id=" + TypeID + "&tab=" + TypeTab;
	new Ajax.Request('administrator/ajax/delicon.php', {parameters:params, onSuccess:function(t){handlerFuncDelIcon(t);}, onFailure:errFunc});
}

var errFunc = function(t) {
    alert('Error ' + t.status + ' -- ' + t.statusText);
}

function handlerFuncDelIcon(t){
	Dialog.alert("Your item will be deleted in a few minutes. Thanks for using Iconator!", {className: 'bluelighting', width:270, height:70, okLabel: "close",onOk:function(){window.location = window.location;return true;}});	
}