/*
 Author 		: Chairat Panpun
 Date		: 8/11/00
 Description 	: This module generates an alert or confirm window by calling
	a function name along with specify some appropriate arguements.
 Module 		: Controlled-Message Functions
 Supervisor 	: Mark Able 
 Version 		: 1.0  
 Compatability	: IE 4.0+/Netscape 4.0+ 
*/

/* 
 Alert1(intId, strInp) generates a dialog box with a single OK button that 
 displays a message subject to intId together with an input strInp.
*/
function Alert1(intId, strInp) {	
	switch(parseInt(intId)) {
		case 1	: return(alert(strInp + " must not be blank, please re-enter."));
		case 2	: return(alert(strInp + " must be selected."));
		case 3	: return(alert(strInp + " cannot be zero, please try again."));
		case 4	: return(alert(strInp + " already exists, please try again."));
		case 5	: return(alert(strInp + " does not exist, please try again."));
		case 6	: return(alert(strInp + " is already in use, please enter another."));
		case 7	: return(alert(strInp + " is invalid, please re-enter."));
		case 8	: return(alert("Please enter " + strInp + "."));
		case 9	: return(alert("Please select " + strInp + "."));
		case 10	: return(alert(strInp + " can contain characters A-z, space, hyphens and single quote only, please re-enter."));
		case 11	: return(alert(strInp + " can contain characters A-z only, please re-enter."));
		case 12	: return(alert(strInp + " can contain numeric only, please re-enter."));
		case 13 : return(alert(strInp + " allows only file extension .bmp, .jpg, .jpeg, .jpe, .gif, .tif and tiff."));		
		case 14	: return(alert(strInp + " must not be blank, please contact administrator."));		
		case 15	: return(alert(strInp + " is invalid date, please re-enter."));				
		case 16	: return(alert("Please enter a valid " + strInp + "."));
		case 17	: return(alert("You must select at least one " + strInp + "."));		
		case 18	: return(alert(strInp + " can not be in the past, please re-enter."));						
		case 19	: return(alert("You can not delete this " + strInp + "."));				
		case 20	: return(alert("You can not have space in " + strInp + "."));
		case 21 : return(alert(strInp + " is expired, please try again."));
		case 22	: return(alert(strInp + " can contain characters A-z and numeric only, please re-enter."));
		case 23	: return(alert(strInp + " can contain english language only, please re-enter."));
		case 24 : return(alert(strInp + " must be positive integer."));
		default	: return(alert("undefined"));
	}		
}

/* 
 Alert2(intId, strInp1, strInp2) generates a dialog box with a single OK button that 
 displays a message subject to intId together with two input strInp.
*/
function Alert2(intId, strInp1, strInp2) {
	switch(parseInt(intId)) {
		case 1	: return(alert(strInp1 + " is maximum of " + strInp2 + " characters, please re-enter."));
		case 2	: return(alert("You can not delete this " + strInp1 + " until " + strInp2 + " are deleted."));
		case 3	: return(alert(strInp1 + " must be greater than " + strInp2 + ", please correct this."));
		case 4	: return(alert(strInp1 + " must not be less than " + strInp2 + ", please correct this."));
		case 5	: return(alert(strInp1 + " must be equal to " + strInp2 + ", please correct this."));
		case 6	: return(alert(strInp1 + " must be less than " + strInp2 + ", please correct this."));
		case 7	: return(alert(strInp1 + " must not be greater than " + strInp2 + ", please correct this."));
		case 8	: return(alert(strInp1 + " and " + strInp2 + " must be the same, please correct this."));
		case 9	: return(alert("Not allow enabling the " + strInp1 + ", please complete " + strInp2 + " information first."));
		case 10	: return(alert("You must select a " + strInp1 + " before update " + strInp2 ));
		case 11	: return(alert(strInp1 + " earlier than " + strInp2 ));
		case 12	: return(alert("Please add " + strInp1 + " before adding " + strInp2 ));
		case 13	: return(alert(strInp1 + " is minimum of " + strInp2 + " characters, please re-enter."));
		case 14	: return(alert("You must enter some " + strInp1 + " informaiton " + strInp1 + " is maximum of " + strInp2 + " characters, please re-enter."));		
		case 15 : return(alert(strInp1 + " is maximum " + strInp2 + " , please re-enter."));		
        case 16	: return(alert(strInp1 + " must be later than " + strInp2 + ", please correct this."));
		case 17	: return(alert("You must enter " + strInp1 + " is maximum of " + strInp2 + " characters, please re-enter."));		
		case 18	: return(alert("You must select " + strInp1 + " which you would like to " + strInp2 + " group."));
		case 19	: return(alert("You must select " + strInp1 + " which you would like to " + strInp2 + "."));
		case 20	: return(alert("Please select " + strInp1 + " file for uploading again."));
		case 21 : return("Only 'txt' extensions is allowed. Please select file for uploading again.\n");
		case 22	: return(alert(strInp1 + " is maximum of " + strInp2 + " characters, please re-enter."));
		default	: return(alert("undefined"));
	}
}

/* 
 Confirm1(intId, strInp) generates a dialog box with two buttons (OK and Cancel) that 
 displays a message subject to intId together with an input strInp.
*/
function Confirm1(intId, strInp) {	
	switch(parseInt(intId)) {
		case 1	: return(confirm("Are you sure you want to delete " + strInp + "?"));
		case 2	: return(confirm("Are you sure you want to accept " + strInp + "?"));
		case 3	: return(confirm("Are you sure you want to reject " + strInp + "?"));
		case 4	: return(confirm("Are you sure you want to email to " + strInp + "?"));
		case 5	: return(confirm("Are you sure you would like to delete " + strInp + "?"));
		default	: return(confirm("undefined"));
	}
}

/*
 Confirm2(intId, strInp1, strInp2) generates a dialog box with two buttons (OK and Cancel) that 
 displays a message subject to intId together with two input strInpings.
*/
function Confirm2(intId, strInp1, strInp2) {	
	switch(parseInt(intId)) {
		case 1	: return(confirm("Are you sure you want to delete " + strInp1 + " " + strInp2 + "?"));
		case 2	: return(confirm("Are you sure you want to accept " + strInp1 + " " + strInp2 + "?"));
		case 3	: return(confirm("Are you sure you want to reject " + strInp1 + " " + strInp2 + "?"));
		case 4	: return(confirm("Are you sure you want to email to " + strInp1 + " " + strInp2 + "?"));
		default	: return(confirm("undefined"));
	}		
}

function alertms1(intId, strInp) {	
//-----------------------------------------------------------------------------
// Function Name:	alertms1(intId, strInp)
//
// Functionality:	Generates a dialog box with a single OK button that
//					displays a message subject to intId together with an input strInp.
//
// Input		:	pattern of message and Prefix of the message
//
// Output		:	true or false (status of validate pattern checking).
//-----------------------------------------------------------------------------
	switch(parseInt(intId)) {
		case 1	: return(strInp + " must not be blank, please re-enter.");
		case 2	: return(strInp + " must be selected.");
		case 3	: return(strInp + " cannot be zero, please try again.");
		case 4	: return(strInp + " already exists, please try again.");
		case 5	: return(strInp + " does not exist, please try again.");
		case 6	: return(strInp + " is already in use, please enter another.");
		case 7	: return(strInp + " is invalid, please re-enter.");
		case 8	: return("Please enter " + strInp + ".");
		case 9	: return("Please select " + strInp + ".");
		case 10	: return(strInp + " can contain characters A-z, space, hyphens and single quote only, please re-enter.");
		case 11	: return(strInp + " can contain characters A-z only, please re-enter.");
		case 12	: return(strInp + " can contain numeric only, please re-enter.");
		case 13 : return(strInp + " allows only file extension .bmp, .jpg, .jpeg, .jpe, .gif, .tif and tiff.");
		case 14	: return(strInp + " must not be blank, please contact administrator.");		
		case 15	: return(strInp + " is invalid date, please re-enter.");				
		case 16	: return("Please enter a valid " + strInp + ".");
		case 17	: return("You must select at least one " + strInp + ".");		
		case 18	: return(strInp + " can not be in the past.");						
		case 19	: return("You can not delete this " + strInp + ".");				
		case 20	: return("You can not have space in " + strInp + ".");
		//case 21	: return("Please fill in " + strInp + " in correct format.");
		case 21	: return("Please fill in a correct formats of " + strInp + ".");
		case 22	: return(strInp + " is invalid date, please re-select.");
		default	: return("undefined");
	}		
}

//</Script>