
var confirm = function (url,message)
{
  return _confirm('<a href=\''+url+'\'><img alt=\'OK\' src=\'/images/icons/accept.png\'></a>',message);
}

var confirmUpdate = function (url,area,message){
  return _confirm('<a onclick="new Ajax.Updater(\''+area+'\', \''+url+'\', {asynchronous:true, evalScripts:false, onLoading:function(request, json){new Effect.Fade(\'confirmWindow\', {duration:0.5});}}); return false;" href="#"><img alt="OK" src="/images/icons/accept.png"></a>',message);
}

var confirmReason = function(preset)
{
  switch(preset)
  {
        default : return false;
  }
}

var _confirm = function (okContent,message)
{
  cWindow = $('confirmWindow');
  if(cWindow==null) {
    cWindow = document.createElement("div");
    cWindow.setAttribute('id','confirmWindow');
    cWindow.setAttribute('align','center');
    document.body.appendChild(cWindow);
    cWindow = $('confirmWindow');
    cWindow.hide();
    cWindow.addClassName('confirm');
  }
  
  cWindow.innerHTML = message+
                      '<table style="width:100%; margin-top:2em;">'+
                      '<tbody><tr>'+
                      '<td style="width:50%; text-align:center">'+ okContent +'</td>'+
                      '<td style="width:50%; text-align:center">'+
                      '<a onclick="new Effect.Fade(\'confirmWindow\', {duration:0.5}); return false;" href="#">'+
                      '<img alt="OK" src="/images/icons/delete.png">'+
                      '</a>'+
                      '</td>'+
                      '</tbody></table>';
  return new Effect.Appear('confirmWindow', {duration:0.5});
}