var GA_Short = new Array(); var GA_Long = new Array(); GA_Short[0] = "Rd"; GA_Long[0] = "Road"; GA_Short[1] = "State Highway"; GA_Long[1] = "SH."; GA_Short[2] = "Cr"; GA_Long[2] = "Cresent"; GA_Short[3] = "Pl"; GA_Long[3] = "Place"; GA_Short[4] = "Tce"; GA_Long[4] = "Terrace"; GA_Short[4] = "Ter"; GA_Long[4] = "Terrace"; GA_Short[5] = "Ave"; GA_Long[5] = "Avenue"; GA_Short[6] = "Dr"; GA_Long[6] = "Drive"; GA_Short[7] = "Blv"; GA_Long[7] = "Boulevard"; GA_Short[8] = "Pde"; GA_Long[8] = "Parade"; GA_Short[9] = "Cl"; GA_Long[9] = "Close"; GA_Short[10] = "Cr"; GA_Long[10] = "Corner"; GA_Short[11] = "St"; GA_Long[11] = "Street"; //--------------- GA_Short[12] = "4th"; GA_Long[12] = "Fourth"; GA_Short[13] = "5th"; GA_Long[13] = "Fifth"; GA_Short[14] = "6th"; GA_Long[14] = "Sixth"; GA_Short[15] = "7th"; GA_Long[15] = "Seventh"; GA_Short[16] = "8th"; GA_Long[16] = "Eighth"; GA_Short[17] = "9th"; GA_Long[17] = "Ninth"; GA_Short[18] = "10th"; GA_Long[18] = "Tenth"; GA_Short[19] = "11th"; GA_Long[19] = "Eleventh"; GA_Short[20] = "12th"; GA_Long[20] = "Twelfth"; GA_Short[21] = "13th"; GA_Long[21] = "Thirteenth"; GA_Short[22] = "14th"; GA_Long[22] = "Forteenth"; GA_Short[23] = "15th"; GA_Long[23] = "Fifteenth"; GA_Short[24] = "16th"; GA_Long[24] = "Sixteenth"; GA_Short[25] = "17th"; GA_Long[25] = "Seventeenth"; GA_Short[26] = "18th"; GA_Long[26] = "Eighteenth"; GA_Short[27] = "19th"; GA_Long[27] = "Nineteenth"; GA_Short[28] = "20th"; GA_Long[28] = "Twentieth"; GA_Short[29] = "21st"; GA_Long[29] = "Twentyfirst"; GA_Short[30] = "22nd"; GA_Long[30] = "Twentysecond"; GA_Short[31] = "23rd"; GA_Long[31] = "Twentythird"; GA_Short[32] = "1st"; GA_Long[32] = "First"; GA_Short[33] = "2nd"; GA_Long[33] = "Second"; GA_Short[34] = "3rd"; GA_Long[34] = "Third"; function RoadStreet_Fix(FieldID){ str = FieldID.value; var words = str.split(/\W+/); var NewStr=''; for (var w = 0; w < words.length; w++){ if ( words[w].capitalize() == 'State'){ if(words[w+1].capitalize() == 'Highway'){ words[w] = 'State Highway'; words[w+1] =''; } } for (var x = 0; x < GA_Short.length; x++) { if(words[w].capitalize() == GA_Short[x].capitalize()) words[w] = GA_Long[x] } if((NewStr!='')&&(words[w]!='')){ NewStr = NewStr + ' ';} NewStr = NewStr + words[w]; } FieldID.value = NewStr; } var GA_City_Short = new Array(); var GA_City_Long = new Array(); GA_City_Short[0] = "Mt Maungani"; GA_City_Long[0] = "Mount Maungani"; GA_City_Short[1] = "Mt"; GA_City_Long[1] = "Mount"; GA_City_Short[2] = "Tga"; GA_City_Long[2] = "Tauranga"; function TownCity_Fix(FieldID){ str = FieldID.value; var words = str.split(/\W+/); var NewStr=''; for (var w = 0; w < words.length; w++){ if ((words[w].capitalize() == 'Mt') && (words.length=1)){ words[w] = 'Mt Maungani'; } for (var x = 0; x < GA_City_Short.length; x++) { if(words[w].capitalize() == GA_City_Short[x].capitalize()){ words[w] = GA_City_Long[x]; } else{ if ((words[w] != 'Mt Maungani')&&(words[w] != 'Mount Maungani')){ words[w] = words[w].capitalize(); } } } if((NewStr!='')&&(words[w]!='')){ NewStr = NewStr + ' ';} NewStr = NewStr + words[w]; } FieldID.value = NewStr; }