//////////////////////////////////////////////////////////////////
//Redéfinit les fonctions alert et confirm en utilisant VB script
// doc sur : http://www.webreference.com/dhtml/column22/js-vbNewjs.html
//////////////////////////////////////////////////////////////////

IE4 = document.all;

var icon_x = 1;
var icon_question = 2;
var icon_exclamation = 3;
var icon_info = 4
;
/*
title - a string to be displayed in the dialog title bar
mess - a string to be displayed as the message to the user
icon - an integer between 0 and 4, inclusive, denoting the icon to be displayed (refer to table on earlier page)
mods - an integer, either 0 or 1, denoting the modality of the dialog (refer to table on earlier page)

         //1 =X rond rouge + beep argh!
         //2 =? triangle
         //3 =! triangle
         //4 =i Bulle

*/
// Exemple : newAlert("DHTML Lab","No confusing captions",4,0);
function newAlert(title,mess,icon,mods) {
   (IE4) ? makeMsgBox(title,mess,icon,0,0,mods) : alert(mess);
}

/*
title - a string to be displayed in the dialog title bar
mess - a string to be displayed as the message to the user
icon - an integer, either 0 or 1, denoting whether no icon or the Question icon is displayed.
defbut - an integer between 0 and 1, inclusive, denoting the default button
mods - an integer, either 0 or 1, denoting the modality of the dialog
*/
// Exemple : newConfirm("DHTML Lab Confirmation Request","Are you confused yet?",1,1,0);
function newConfirm(title,mess,icon,defbut,mods) {
   if (IE4) {
      icon = (icon==0) ? 0 : 2;
      defbut = (defbut==0) ? 0 : 1;
      retVal = makeMsgBox(title,mess,icon,4,defbut,mods);
      retVal = (retVal==6);
   }
   else {
      retVal = confirm(mess);
   }
   return retVal;
}

/*
title - a string to be displayed in the dialog title bar
mess - a string to be displayed as the message to the user (a prompt)
def - a string to be displayed in the input area as the default response
*/
// Exemple : newPrompt("DHTML Lab User Input Request","Enter your name, please:","Ishmael");
function newPrompt(title,mess,def) {
   retVal = (IE4) ? makeInputBox(title,mess,def) : prompt(mess,def);
   return retVal;
}

function IEBox(title,mess,icon,buts,defbut,mods) {
   retVal = (IE4) ? makeMsgBox(title,mess,icon,buts,defbut,mods) : null;
   return retVal;
}
