//<script>
//*****************************************************************************
//* Name:	CMessage
//* Desc:	This class displays all alert and confirmation messages to the user
//* Type:	Class
//*============================================================================
//* Modifications:
//* Date		Release		Developer		Description
//* 09/14/06	PC6-06		KERSEYP			Initial Creation
//*****************************************************************************
function CMessage() {

	// Messages
	this.MSG_ALL_NAVAWAY            = 1000;
	this.MSG_BEGIN_REVIEW			= 1001;
	this.MSG_ALL_CANCEL				= 1002;
	this.MSG_AUTO_REMOVECLMTS       = 1003;
	this.MSG_AUTO_NODISUBMIT		= 1004;
	this.MSG_AUTO_DISUBMIT          = 1005;

	// Warning Messages
	this.WARN_DATE_INVALIDMONTH		= 31;
	this.WARN_DATE_INVALIDDAY		= 32;
	this.WARN_DATE_INVALIDYEAR      = 33;
	this.WARN_DATE_INVALIDLOSSDATE  = 34;
	this.WARN_DATE_INVALIDDATEFORMAT= 35;
	this.WARN_DATE_PAST             = 36;
	this.WARN_DATE_FUTURE			= 37;
	this.WARN_DATE_INVALIDTIME		= 38;
	this.WARN_PHONE_INVALIDNUM		= 39;
	this.WARN_ZIP_INVALIDNUM		= 40;
	this.WARN_EMAIL_INVALIDEMAIL	= 41;
	this.WARN_POLICY_NOTVERIFIED	= 42;
	this.WARN_POLICY_REVERIFY		= 43;
	this.WARN_BOAT_NOTONPOLICY		= 44;
	this.WARN_LOSSCAUSE_INVALID		= 45;
	this.WARN_ALL_MAXLENGTH			= 46;
	this.WARN_GIS_REQUIREDFIELDS	= 47;
	this.WARN_AUTO_PDSUPPVEHICLE	= 48;
	this.WARN_AUTO_DICANCELLED      = 49;
	
	// Public Methods
	this.HandleAlert	= HandleAlert;
	this.HandleConfirm	= HandleConfirm;
}

function HandleAlert( iMessageType ) {
	var img = "<img src=\"/eClaims/nwimages/icon_caution.gif\" align=\"bottom\"/>&nbsp;";
	switch( iMessageType ) {
		case this.MSG_BEGIN_REVIEW			 : 
			idAlertMsg.innerHTML = img + "You must answer yes to at least one question to report an auto claim. Please review your selections.";
			idAlertMsg.className = "clsShow";
			break;
		case this.WARN_DATE_INVALIDMONTH	 : alert("Month must be between 1 and 12.");	break;
		case this.WARN_DATE_INVALIDDAY		 : alert("Day must be between 1 and 31."); break;
		case this.WARN_DATE_INVALIDYEAR      : alert("Please enter a valid 4 digit year."); break;
		case this.WARN_DATE_INVALIDLOSSDATE	 : alert("Date of incident invalid.  Please enter date of incident and try again."); break;
		case this.WARN_DATE_INVALIDDATEFORMAT: alert("Please enter a valid date in the mm/dd/yyyy format, e.g. 03/03/2000."); break;
		case this.WARN_DATE_PAST			 : alert("The date cannot be in the past. Please enter a valid date in the mm/dd/yyyy format, e.g. 3/29/2000."); break;
		case this.WARN_DATE_FUTURE			 : alert("The date cannot be in the future. Please enter a valid date in the mm/dd/yyyy format, e.g. 03/03/2000."); break;
		case this.WARN_DATE_INVALIDTIME		 : alert("Please enter valid time in hh:mm (09:30) format."); break;
		case this.WARN_PHONE_INVALIDNUM		 : alert("Please enter a valid phone number."); break;
		case this.WARN_ZIP_INVALIDNUM		 : alert("Please enter a valid zip code."); break;
		case this.WARN_EMAIL_INVALIDEMAIL	 : alert("Email Address must be at least 5 characters and contain an @ and a period."); break;
		case this.WARN_POLICY_NOTVERIFIED	 : alert("You must select the Display My Policy Information button to continue."); break;
		case this.WARN_POLICY_REVERIFY		 : alert("Information has changed. You must select the Display My Policy Information button again."); break;
		case this.WARN_BOAT_NOTONPOLICY		 : alert("No boat information found for this policy. Please try another policy."); break;
		case this.WARN_LOSSCAUSE_INVALID	 : alert("Loss Cause selected is invalid for the combination of damage indicated. Please select another loss cause."); break;
		case this.WARN_ALL_MAXLENGTH		 : alert("You have entered the maximum number of characters allowed for this field."); break;
		case this.WARN_GIS_REQUIREDFIELDS	 : alert("A valid address, city, and state must entered prior to trying to locate a Zip Code or County."); break;
		case this.WARN_AUTO_PDSUPPVEHICLE    : alert("When contacted by the Claims Professional handling your claim, please provide any information you may have about the other party at that time."); break;
		case this.WARN_AUTO_DICANCELLED		 : alert("Unfortunately we are unable to schedule your Drive In appointment.  A Claims Professional will be in contact by the end of the next business day to discuss obtaining an estimate for your vehicle."); break;
	}	
}

function HandleConfirm( iMessageType ) {
	switch( iMessageType ) {
		case this.MSG_ALL_NAVAWAY:
			return "You will lose all current claim information.";
			break;
		case this.MSG_ALL_CANCEL:
			return "You are about to cancel this claim.\n\nPress OK to cancel the claim, or Cancel to stay on the current page.";
			break;
		case this.MSG_AUTO_REMOVECLMTS:
			return confirm("Changing your selection will delete any data you may have entered on the Property Damage to Others page.");
			break;
		case this.MSG_AUTO_NODISUBMIT:
			return confirm("Are you sure you would like to submit your claim without scheduling a Drive-In appointment?")
			break;
		case this.MSG_AUTO_DISUBMIT:
			return confirm("By selecting this appointment time you will be submitting your claim.  Would you like to accept this appointment time?")
			break;
	}
}
//</script>
