function decodeMsg(code, par) { // ENGLISH  var res = "";  if      (code == "INVALID_POSTAL_CODE")    { res = "Invalid postal code: <value>"; }  else if (code == "LONG_TEXT_LENGTH")       { res = "The text was longer than <value> characters. It has been truncated."; }  else if (code == "INVALID_NUMBER")         { res = "Invalid number: <value>"; }  else if (code == "NUMBER_IS_TOO_SMALL")    { res = "The number should not be less than <value>"; }  else if (code == "NUMBER_IS_TOO_LARGE")    { res = "The number should not be greater than <value>"; }  else if (code == "DATE_FORMAT_HELP")       { res = 'Please use one of the following formats:\\n'                                                   + '"2000/05/31", "31-MAY-2000" or "May 31, 2000"'; }  else if (code == "INVALID_DATE_FORMAT")    { res = 'Invalid date format: "<value>"\\n'                                                   + ' \\n'		                                           + 'Please use one of the following formats:\\n'	                                               + '"2000/05/31", "31-MAY-2000" or "May 31, 2000"'; }  else if (code == "INVALID_TIME_FORMAT")    { res = "Invalid time: <value> \\n"                                                   + " \\n"			                                       + "Please use one of the following formats:\n"			                                       + "14:15:00,  14:15,  14  or  2 PM"; }  else if (code == "INVALID_DATE")           { res = "Invalid Date Exception"; }  else if (code == "INVALID_TIME")           { res = "Invalid Time Exception"; }   else if (code == "DOWNPAYMENT_PERCENT")   { res = "Please enter a percent for the downpayment between 5 and 100."; }   else if (code == "DOWNPAYMENT_REQUIRED")  { res = "You have pressed cancel.  You must enter a percent for the downpayment.  Please try again."; }   else if (code == "INVALID_DOWNPAYMENT")   { res = "You have entered an invalid downpayment percentage, please try again."; }   else if (code == "LOCATION_REQUIREMENT")  { res = "For the selected property location, CMHC/GE require that for homes valued greater than $<value>, you must have a downpayment no less than 10%."; }   else if (code == "COMPLETE_MORTGAGE_1")   { res = "Please complete all fields for 'Mortgage 1' before calculating."; }   else if (code == "COMPLETE_MORTGAGE_2")   { res = "Please complete all fields for 'Mortgage 2' before calculating, or check 'Ignore'."; }   else if (code == "COMPLETE_FOR_AMORTIZ")  { res = "Please complete all fields for 'Mortgage 1' \n or 'Mortgage 2' before requesting a Amortization Schedule."; }   else if (code == "L_INSURANCE_MAXIMUM")   { res = "The maximum life insurance amount is $<value>"; }   else if (code == "CI_INSURANCE_MAXIMUM")  { res = "The maximum critical illness insurance amount is $<value>"; }   else if (code == "INSURANCE_MINIMUM")     { res = "The minimum mortgage amount is $<value>"; }   else if (code == "INS_TYPE_REQUIRED")     { res = "You must select Insurance Type."; }   else if (code == "INS_AMOUNT_REQUIRED")   { res = "You must enter a value for the Insurance Amount."; }   else if (code == "BORROWER_AGE_REQUIRED") { res = "You must select an age for the borrower."; }  if (res == "") { res = code; }  var p = res.indexOf("<value>");  if (p >= 0) {    res = res.substring(0,p) + par + res.substring(p+7, res.length);  }  else {    if (par != "" && par != null) {      res += ": " + par;    }  }  return res;}function monthToEnglish(theStr) { // FRENCH AND ENGLISH	var str = theStr;	var p1 = -1;	var p2 = -1;	var fs = str.toLowerCase();	for (var i=0; i<fs.length; i++) {	    var c = fs.substring(i,i+1);		var isChar = (c >= "a") && (c <= "z");		if (p1 < 0 && p2 < 0) { // before		  if (isChar) { p1 = i; }		}		else if (p1 >= 0 && p2 < 0) { // during		  if (!isChar) { p2 = i; }		}	}	if (p1 >= 0) {	  if (p2 < 0) { p2 = fs.length; }	  var wrd = fs.substring(p1,p2);	  var eng = wrd;	  if (wrd.length >= 2) {	    if      ("janvier".indexOf(wrd) == 0)   { eng = "jan"; }	    else if ("fevrier".indexOf(wrd) == 0)   { eng = "feb"; }	    else if ("février".indexOf(wrd) == 0)   { eng = "feb"; }	    else if ("mars".indexOf(wrd) == 0)      { eng = "mar"; }	    else if ("avril".indexOf(wrd) == 0)     { eng = "apr"; }	    else if ("mai".indexOf(wrd) == 0)       { eng = "may"; }	    else if ("juin".indexOf(wrd) == 0)      { eng = "jun"; }	    else if ("juillet".indexOf(wrd) == 0)   { eng = "jul"; }	    else if ("aout".indexOf(wrd) == 0)      { eng = "aug"; }	    else if ("août".indexOf(wrd) == 0)      { eng = "aug"; }	    else if ("septembre".indexOf(wrd) == 0) { eng = "sep"; }	    else if ("octobre".indexOf(wrd) == 0)   { eng = "oct"; }	    else if ("novembre".indexOf(wrd) == 0)  { eng = "nov"; }	    else if ("decembre".indexOf(wrd) == 0)  { eng = "dec"; }	    else if ("décembre".indexOf(wrd) == 0)  { eng = "dec"; }		if (p2 < fs.length && fs.substring(p2,p2+1) == ".") {		  p2 = p2 + 1;		}		if (eng != wrd) {		  str = str.substring(0,p1) + eng + str.substring(p2);		}	  }    }    return str;}function monthToLocale(theStr) { // ENGLISH    return theStr;}