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) { // ENGLISH    return theStr;}*/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;}/* ttt stop translating to Frenchfunction monthToLocale(theStr) { // FRENCH	var str = theStr.toLowerCase();	var p = -1; 	var r = -1;	var wrd = "";	if      ((p=str.indexOf("jan")) >= 0 ) { wrd = "janv."; r = p; }	else if ((p=str.indexOf("feb")) >= 0 ) { wrd = "fevr."; r = p; } // wrd = "févr.";	else if ((p=str.indexOf("mar")) >= 0 ) { wrd = "mars";  r = p; }	else if ((p=str.indexOf("apr")) >= 0 ) { wrd = "avr.";  r = p; }	else if ((p=str.indexOf("may")) >= 0 ) { wrd = "mai";   r = p; }	else if ((p=str.indexOf("jun")) >= 0 ) { wrd = "juin";  r = p; }	else if ((p=str.indexOf("jul")) >= 0 ) { wrd = "juil."; r = p; }	else if ((p=str.indexOf("aug")) >= 0 ) { wrd = "aout."; r = p; } // wrd = "août.";	else if ((p=str.indexOf("sep")) >= 0 ) { wrd = "sept."; r = p; }	else if ((p=str.indexOf("oct")) >= 0 ) { wrd = "oct.";  r = p; }	else if ((p=str.indexOf("nov")) >= 0 ) { wrd = "nov.";  r = p; }	else if ((p=str.indexOf("dec")) >= 0 ) { wrd = "dec.";  r = p; } // wrd = "déc.";    var res;    if (wrd != "") { 	    res = str.substring(0,r) + wrd + str.substring(r+3);     } else {	    res = str;	}    return res;}*/