// --------------------------------------------------------------
// 6768FenderTagDecoder.js Java Script file
// Copyright (c) 2005 Jani Immonen
// www.jani-immonen.net
// Date: 26.12.2005
//
// This file implements 1967-1968 Mopar Fender Tag Decoder
// Information may or may not be correct, use at your own risk
//



// define the error handler
onerror = ErrorHandler;
function ErrorHandler(strMessage, strURL, iLine)
{
	var strError="";
	strError = "JavaScript error!\n\n";
	strError += "Error: " + strMessage + "\n";
	strError += "URL: " + strURL + "\n";
	strError += "Line: " + iLine + "\n\n";
	strError += "Click OK to continue.\n\n";
	alert(strError);
	return true;
}


// TestTAG
// fills the input boxes with my -68 Coronet Convertible Fender Tag Info
function TestTAG()
{
	document.TAGDecodedForm.boxLine1.value = "  54        6     1  ";
	document.TAGDecodedForm.boxLine2.value = "1      1 8     11   11";
	document.TAGDecodedForm.boxLine3.value = "9 0   8  1  P6R WW1 R  ";
	document.TAGDecodedForm.boxLine4.value = "wp27 41 5 43 b21 100000";
}


// ClearTAG
// clear input and result boxes
function ClearTAG()
{
	document.TAGDecodedForm.boxLine1.value = "";
	document.TAGDecodedForm.boxLine2.value = "";
	document.TAGDecodedForm.boxLine3.value = "";
	document.TAGDecodedForm.boxLine4.value = "";
	document.TAGDecodedForm.boxResults.value = "";
}


// DecodeTAG
// get information from input boxes and decode
function DecodeTAG()
{
	// make all input uppercase
	document.TAGDecodedForm.boxLine1.value = document.TAGDecodedForm.boxLine1.value.toUpperCase();
	document.TAGDecodedForm.boxLine2.value = document.TAGDecodedForm.boxLine2.value.toUpperCase();
	document.TAGDecodedForm.boxLine3.value = document.TAGDecodedForm.boxLine3.value.toUpperCase();
	document.TAGDecodedForm.boxLine4.value = document.TAGDecodedForm.boxLine4.value.toUpperCase();

	var strTemp = "";
	var strMessage = "";
	var strTireCode = "";
	var iPosition = 0;
	var strYear = "1968";


	// decode car body information
	strMessage = "CAR: ";
	strTemp = GetBodyInfo(document.TAGDecodedForm.boxLine4.value.substr(iPosition, 4));
	strMessage += strTemp;
	strMessage += "\n";
	iPosition += 5;		// skip 4 chars + space

	// decode engine information
	strMessage += "ENGINE: ";
	strTemp = GetEngineCode(document.TAGDecodedForm.boxLine4.value.substr(iPosition, 2));
	strMessage += strTemp;
	strMessage += "\n";
	iPosition += 3;		// skip 2 chars + space

	// decode transmission information
	strMessage += "TRANSMISSION: ";
	strTemp = GetTransmissionCode(document.TAGDecodedForm.boxLine4.value.substr(iPosition, 1));
	strMessage += strTemp;
	strMessage += "\n";
	iPosition += 2;		// skip 1 char + space

	// decode tire code, tire code may have 3 numbers (67)
	// or 2 numbers (68)
	strMessage += "TIRES: ";
	strTireCode = document.TAGDecodedForm.boxLine4.value.substr(iPosition, 3);
	strTemp = GetTireCode(strTireCode);
	strMessage += strTemp;
	strMessage += "\n";
	if (strTireCode.charAt(2) == ' ')
	{
		// 3rd. character is space, assume 2 char tire code (68)
		iPosition += 3;	// skip 2 chars + space
	}
	else
	{
		// 3rd. character is not space, assume 3 char tire code (67)
		iPosition += 4; // skip 3 chars + space
		strYear = "1967";
	}
	strMessage += "MODEL YEAR: ";
	strMessage += strYear;
	strMessage += "\n";
	
	// decode build date
	strMessage += "BUILD DATE: ";
	strTemp = GetBuildDate(document.TAGDecodedForm.boxLine4.value.substr(iPosition, 3));
	strMessage += strTemp;
	strMessage += "\n";
	// decode axle information
	strMessage += "AXLE: ";
	strTemp = GetAxleCode(document.TAGDecodedForm.boxLine3.value.substr(9, 2));
	strMessage += strTemp;
	strMessage += "\n";
	// decode interior code
	strMessage += "INTERIOR: ";
	strTemp = GetTrimCode(document.TAGDecodedForm.boxLine3.value.substr(12, 3));
	strMessage += strTemp;
	strMessage += "\n";
	// decode paint
	strMessage += "PAINT: ";
	strTemp = GetPaintCode(document.TAGDecodedForm.boxLine3.value.substr(16, 3), strYear);
	strMessage += strTemp;
	strMessage += "\n";
	// decode UBS code
	strMessage += "OTHER: ";
	strTemp = GetUBSCode(document.TAGDecodedForm.boxLine3.value.substr(20, 3), strYear);
	strMessage += strTemp;
	strMessage += "\n\n";
	// get molding options "12345678"
	strMessage += "MOLDINGS:\n";
	var strSequence = "12345678";
	strMessage += GetOptions(strSequence, 23, document.TAGDecodedForm.boxLine3.value);
	// get "ABC" options
	strMessage += "\nABC OPTIONS:\n";
	strSequence = "ABCDEFGHJKLMNPQRSTVWXYZ";
	strMessage += GetOptions(strSequence, 23, document.TAGDecodedForm.boxLine2.value);
	// get "abc" options
	strMessage += "\nabc OPTIONS:\n";
	strSequence = "  abcdefghjkmnpqrtuwy";
	strMessage += GetOptions(strSequence, 23, document.TAGDecodedForm.boxLine1.value);
	// copy result into the results text box
	document.TAGDecodedForm.boxResults.value = strMessage;
}
// GetBodyInfo
// This function decodes body information.
// This is the bottom left 4 characters.
function GetBodyInfo(strBody) {
    var strDescription = "";
    // DODGE
    // Check Coronet
    if (strBody.charAt(0) == 'W' && strBody.charAt(1) == 'L') strDescription = "Dodge Coronet ";
    if (strBody.charAt(0) == 'W' && strBody.charAt(1) == 'M') strDescription = "Dodge Coronet Super Bee ";
    if (strBody.charAt(0) == 'W' && strBody.charAt(1) == 'H') strDescription = "Dodge Coronet 440 ";
    if (strBody.charAt(0) == 'W' && strBody.charAt(1) == 'P') strDescription = "Dodge Coronet 500 ";
    if (strBody.charAt(0) == 'W' && strBody.charAt(1) == 'S') strDescription = "Dodge Coronet R/T ";
    // Charger
    if (strBody.charAt(0) == 'X' && strBody.charAt(1) == 'P') strDescription = "Dodge Charger ";
    if (strBody.charAt(0) == 'X' && strBody.charAt(1) == 'S') strDescription = "Dodge Charger R/T ";
    // Dart
    if (strBody.charAt(0) == 'L' && strBody.charAt(1) == 'S') strDescription = "Dodge Dart GTS ";
    if (strBody.charAt(0) == 'L' && strBody.charAt(1) == 'P') strDescription = "Dodge Dart GT ";
    if (strBody.charAt(0) == 'L' && strBody.charAt(1) == 'H') strDescription = "Dodge Dart ";
    // Polara
    if (strBody.charAt(0) == 'D' && strBody.charAt(1) == 'L') strDescription = "Dodge Polara ";
    if (strBody.charAt(0) == 'D' && strBody.charAt(1) == 'M') strDescription = "Dodge Polara ";
    if (strBody.charAt(0) == 'D' && strBody.charAt(1) == 'H') strDescription = "Dodge Polara ";
    if (strBody.charAt(0) == 'D' && strBody.charAt(1) == 'P') strDescription = "Dodge Polara ";
    if (strBody.charAt(0) == 'D' && strBody.charAt(1) == 'S') strDescription = "Dodge Polara ";
    if (strBody.charAt(0) == 'D' && strBody.charAt(1) == 'K') strDescription = "Dodge Polara (Police) ";
    // PLYMOUTH
    // RoadRunner
    if (strBody.charAt(0) == 'R' && strBody.charAt(1) == 'M') strDescription = "Plymouth RoadRunner ";
    // GTX
    if (strBody.charAt(0) == 'R' && strBody.charAt(1) == 'S') strDescription = "Plymouth GTX ";
    // Belvedere
    if (strBody.charAt(0) == 'R' && strBody.charAt(1) == 'L') strDescription = "Plymouth Belvedere ";
    if (strBody.charAt(0) == 'R' && strBody.charAt(1) == 'H') strDescription = "Plymouth Belvedere ";
    // Satellite
    if (strBody.charAt(0) == 'R' && strBody.charAt(1) == 'P') strDescription = "Plymouth Satellite ";
    // Valiant
    if (strBody.charAt(0) == 'V' && strBody.charAt(1) == 'L') strDescription = "Plymouth Valiant ";
    // Barracuda
    if (strBody.charAt(0) == 'B' && strBody.charAt(1) == 'L') strDescription = "Plymouth Barracuda ";
    if (strBody.charAt(0) == 'B' && strBody.charAt(1) == 'H') strDescription = "Plymouth Barracuda ";
    if (strBody.charAt(0) == 'B' && strBody.charAt(1) == 'S') strDescription = "Plymouth 'Cuda ";
    // Fury
    if (strBody.charAt(0) == 'P' && strBody.charAt(1) == 'S') strDescription = "Plymouth Fury ";
    if (strBody.charAt(0) == 'P' && strBody.charAt(1) == 'M') strDescription = "Plymouth Fury III ";
    if (strBody.charAt(0) == 'P' && strBody.charAt(1) == 'H') strDescription = "Plymouth Sport Fury ";
    if (strBody.charAt(0) == 'P' && strBody.charAt(1) == 'P') strDescription = "Plymouth VIP ";
    // CHRYSLER
    // 300
    if (strBody.charAt(0) == 'C' && strBody.charAt(1) == 'M') strDescription = "Chrysler 300 ";
    // New Yorker
    if (strBody.charAt(0) == 'C' && strBody.charAt(1) == 'H') strDescription = "Chrysler New Yorker ";
    // Newport
    if (strBody.charAt(0) == 'C' && strBody.charAt(1) == 'L') strDescription = "Chrysler Newport ";
    // Imperial
    if (strBody.charAt(0) == 'Y' && strBody.charAt(1) == 'M') strDescription = "Chrysler Imperial ";
    if (strDescription == "") return "Unknown Make and Model.";
    // body style
    if (strBody.charAt(2) == '2' && strBody.charAt(3) == '1') {
        return strDescription + "2 Door Pillar Coupe";
    }
    if (strBody.charAt(2) == '2' && strBody.charAt(3) == '3') {
        return strDescription + "2 Door Hardtop";
    }
    if (strBody.charAt(2) == '2' && strBody.charAt(3) == '7') {
        return strDescription + "2 Door Convertible";
    }
    if (strBody.charAt(2) == '2' && strBody.charAt(3) == '9') {
        return strDescription + "2 Door Sports Hardtop";
    }
    if (strBody.charAt(2) == '4' && strBody.charAt(3) == '1') {
        return strDescription + "4 Door Sedan";
    }
    if (strBody.charAt(2) == '4' && strBody.charAt(3) == '3') {
        return strDescription + "4 Door Hardtop";
    }
    if (strBody.charAt(2) == '4' && strBody.charAt(3) == '5') {
        return strDescription + "6 Passenger Station Wagon";
    }
    if (strBody.charAt(2) == '4' && strBody.charAt(3) == '6') {
        return strDescription + "9 Passenger Station Wagon";
    }
    return strDescription + " Unknown Body Style.";
}
// GetEngineCode
// This function decodes engine code number
// found next to body information
function GetEngineCode(strEngineCode) {
    switch (strEngineCode) {
        case "11": return "170cid Slant Six";
        case "21": return "225cid Slant Six";
        case "31": return "273cid 2-bbl V8";
        case "32": return "273cid 4-bbl HP V8";
        case "41": return "318cid 2-bbl V8";
        case "52": return "340cid 4-bbl HP V8";
        case "61": return "383cid 2-bbl V8";
        case "62": return "383cid 4-bbl HP V8";
        case "73": return "426cid Hemi 2x4-bbl HP V8";
        case "81": return "440cid 4-bbl V8";
        case "83": return "440cid 4-bbl HP V8";
        default: return "Unknown Engine code.";
    }
}

// GetTransmissionCode
// This function decodes transmission code number
// found next to engine code number
function GetTransmissionCode(strTransmissionCode) {
    switch (strTransmissionCode) {
        case "1": return "3-Speed Manual Column Shift";
        case "2": return "3-Speed Manual Column Shift HD";
        case "3": return "4-Speed Manual Floor Shift";
        case "5": return "3-Speed Automatic";
        case "6": return "3-Speed Automatic HD";
        case "9": return "Special Order Transmssion";
        default: return "Unknown transmission code";
    }
}

// GetTireCode
// This function decodes tire code number
// found next to transmission code number
function GetTireCode(strTireCode) {
    switch (strTireCode) {
    case "23 ": return "6.95x14 White Sidewall";
	case "26 ": return "D70x14 Black Sidewall";
	case "27 ": return "D70x14 White Sidewall";
	case "28 ": return "D70x14 Red Sidewall, nylon belted";
	case "33 ": return "7.35x14";
	case "38 ": return "E70x14 Red Sidewall, steel belted";
	case "39 ": return "E70x14 White Sidewall";
	case "42 ": return "E70x14 Red Sidewall, fiberglas belted";
	case "43 ": return "7.75x14 White Sidewall";
	case "44 ": return "F70x14 Red Sidewall, Steel Belted";
	case "45 ": return "F70x15 Red Sidewall, nylon belted";
	case "46 ": return "F70x14 White Sidewall, steel belted";
	case "51 ": return "8.25x14 Blue Sidewall";
	case "52 ": return "8.25x14 White Sidewall";
	case "85 ": return "G70x15 White Sidewall, fiberglas belted";
	case "99 ": return "Special Order Tires";

	// cbodydrydock.com speculation: 3rd number on 67 tire code may mean:
	// 4 - no spare tire included
    // 5 - spare tire included
	case "135": return "7.00x13 white Sidewall";
	case "235": return "6.95x14 White Sidewall";
	case "285": return "D70x14 Red Sidewall, nylon belted";
	case "435": return "7.75 x 14 WSW";
	case "485": return "7.75 x 14 Red Streak Tires";
	case "635": return "8.55 x 14 White Wall 2-4 Ply Steel Belt";

	default: return "Unknown tire code";
	}
}


// GetBuildDate
// This function decodes build date
// found next to tire code number
function GetBuildDate(strBuildDate)
{
	var strDescription = "";

	if (strBuildDate.charAt(0) == '1') strDescription = "January ";
	if (strBuildDate.charAt(0) == '2') strDescription = "February ";
	if (strBuildDate.charAt(0) == '3') strDescription = "March ";
	if (strBuildDate.charAt(0) == '4') strDescription = "April ";
	if (strBuildDate.charAt(0) == '5') strDescription = "May ";
	if (strBuildDate.charAt(0) == '6') strDescription = "June ";
	if (strBuildDate.charAt(0) == '7') strDescription = "July ";
	if (strBuildDate.charAt(0) == '8') strDescription = "August ";
	if (strBuildDate.charAt(0) == '9') strDescription = "September ";
	if (strBuildDate.charAt(0) == 'A') strDescription = "October ";
	if (strBuildDate.charAt(0) == 'B') strDescription = "November ";
	if (strBuildDate.charAt(0) == 'C') strDescription = "December ";

	if (strDescription == "") return "Unknown build date";

	strDescription += strBuildDate.substr(1);
	return strDescription + ".";
}


// GetAxleCode
// This function decodes rear axle code
// found next to build date
function GetAxleCode(strAxleCode)
{
	var strDescription = "";

	if (strAxleCode.charAt(0) == '1') strDescription = "2.76 Rear Axle Ratio";
	if (strAxleCode.charAt(0) == '2') strDescription = "2.94 Rear Axle Ratio";
	if (strAxleCode.charAt(0) == '4') strDescription = "3.23 Rear Axle Ratio";
	if (strAxleCode.charAt(0) == '6') strDescription = "3.54/3.55 Rear Axle Ratio (Dana60 or 8 3/4)";
	if (strAxleCode.charAt(0) == '7') strDescription = "3.91 Rear Axle Ratio";

	if (strDescription == "") return "Unknown Axle Code";



	if (strAxleCode.charAt(1) == '8') strDescription += ", Sure Grip";

	return strDescription;

}


// GetTrimCode
// This function decodes TRM interior code
// found next to AX code
function GetTrimCode(strTrimCode) {
    var strDescription = "";
    if (strTrimCode.charAt(0) == 'C') strDescription = "Charger Trim Grade";
    if (strTrimCode.charAt(0) == 'H') strDescription = "High Trim Grade";
    if (strTrimCode.charAt(0) == 'D') strDescription = "Deluxe Trim Grade";
    if (strTrimCode.charAt(0) == 'P') strDescription = "Premium Trim Grade";
    if (strTrimCode.charAt(0) == 'S') strDescription = "Sport Trim Grade";
	
	if (strTrimCode.charAt(1) == '4') strDescription += ", Vinyl Split Bench Seats.";
	if (strTrimCode.charAt(1) == '5') strDescription += ", Vinyl Bench Seats.";
	if (strTrimCode.charAt(1) == '6') strDescription += ", Vinyl Bucket Seats.";
	if (strTrimCode.charAt(1) == '7') strDescription += ", Vinyl and Cloth Bucket Seats.";

	if (strTrimCode.charAt(2) == 'A') strDescription += " Gray Interior.";
	if (strTrimCode.charAt(2) == 'B') strDescription += " Light Blue Interior.";
	if (strTrimCode.charAt(2) == 'C') strDescription += " White on Blue Interior.";

	if (strTrimCode.charAt(2) == 'D') strDescription += " White on Green Interior.";
	if (strTrimCode.charAt(2) == 'E') strDescription += " White on Gold Interior.";
	if (strTrimCode.charAt(2) == 'F') strDescription += " Green Interior.";
	if (strTrimCode.charAt(2) == 'H') strDescription += " White on Tan Interior.";
	if (strTrimCode.charAt(2) == 'K') strDescription += " Copper Interior.";
	if (strTrimCode.charAt(2) == 'L') strDescription += " Tan Interior.";
	if (strTrimCode.charAt(2) == 'N') strDescription += " Gold on Black Interior.";
	if (strTrimCode.charAt(2) == 'Q') strDescription += " Turquise Interior.";
	if (strTrimCode.charAt(2) == 'R') strDescription += " Red Interior.";
	if (strTrimCode.charAt(2) == 'S') strDescription += " Silver on Black Interior.";
	if (strTrimCode.charAt(2) == 'V') strDescription += " White on Red Interior.";
	if (strTrimCode.charAt(2) == 'W') strDescription += " White on Black Interior.";
	if (strTrimCode.charAt(2) == 'X') strDescription += " Black Interior.";
	if (strTrimCode.charAt(2) == 'Y') strDescription += " Gold Interior.";

	return strDescription;
}


// GetPaintCode
// This function decodes PNT exterior paint code
// found next to TRM code
function GetPaintCode(strPaintCode, strYear)
{
	var strColor = "";
	var strDescription = "";

	if (	strPaintCode.charAt(0) == '9' &&
			strPaintCode.charAt(1) == '9' &&
			strPaintCode.charAt(2) == '9')
	{
		strDescription = "Special Order Paint."
	}
	else
	{
		strColor = GetPaintName(strPaintCode.charAt(0), strYear);

		if (strPaintCode.charAt(2) == '1')
		{
			strDescription = strColor;
			strDescription += ".";
		}
		else if (strPaintCode.charAt(2) == '2')
		{
			strDescription = "Two Tone Paint, ";
			strDescription += strColor;
			strDescription += " Upper Body Color and ";
			strColor = GetPaintName(strPaintCode.charAt(1), strYear);
			strDescription += strColor;
			strDescription += " Lower Body Color.";
		}
		else if (strPaintCode.charAt(2) == '4')
		{
			strDescription = strColor;
			strDescription += " w/ Racing Stripe";
		}
	}

	return strDescription;
}



// GetUBSCode
// This function decodes UBS code
// found next to PNT code
function GetUBSCode(strUBSCode, strYear)
{
	var strColor;
	strColor = GetPaintName(strUBSCode.charAt(0), strYear);

	var strDescription = "";
	if (strColor != "")
	{
		strDescription = strColor;
		strDescription += " Upper Door Frame Color. ";
	}
	
	strColor = GetPaintName(strUBSCode.charAt(1), strYear);
	if (strColor != "")
	{
		strDescription += strColor;
		strDescription += " Racing Stripe. ";
	}

	// check buffed paint code only if car is silver metallic
	if (strUBSCode.charAt(0) == 'A' && strUBSCode.charAt(1) != "" && strUBSCode.charAt(1) != ' ')
	{
		strDescription += "Buffed Paint. ";
	}

	switch (strUBSCode.charAt(2))
	{
	case '0': strDescription += "Black Bumble-Bee Sport Stripe. "; break;
	case '1': strDescription += "Black Horizontal Sport Stripe. "; break;
	case '2': strDescription += "Red Horizontal Sport Stripe. "; break;
	case '3': strDescription += "White Horizontal Sport Stripe. "; break;
	case '4': strDescription += "Red Bumble-Bee Sport Stripe. "; break;
	case '5': strDescription += "Blue Horizontal Sport Stripe. "; break;
	case '6': strDescription += "Green Horizontal Sport Stripe. "; break;
	case '7': strDescription += "White Bumble-Bee Sport Stripe. "; break;
	case '8': strDescription += "Stripe Deleted. "; break;
	case '9': strDescription += "Stripe Deleted. "; break;

	case 'B': strDescription += "Black Horizontal Accent Stripe. "; break;
	case 'H': strDescription += "Red Horizontal Accent Stripe. "; break;
	case 'W': strDescription += "White Horizontal Accent Stripe. "; break;
	case 'C': strDescription += "Blue Horizontal Accent Stripe. "; break;
	case 'P': strDescription += "Green Horizontal Accent Stripe. "; break;
	}
	return strDescription;
}



// GetOptions
// get individual options from given options sequece
function GetOptions(strSequence, iNumChars, strOptionsLine)
{
	var strTemp = "";
	var strMessage = "";
	var i=0;
	while (strOptionsLine.length < iNumChars)
	{
		strOptionsLine += " ";
	}
	for (i=0; i<strSequence.length; i++)
	{
		if (strOptionsLine.charAt(i) != ' ')
		{
			var iNumber = strOptionsLine.charCodeAt(i) - 48;
			strTemp = GetOption(strSequence.charAt(i), iNumber);
			if (strTemp != "")
			{
				strMessage += strTemp;
				strMessage += "\n";
			}
		}
	}
	return strMessage;
}

// GetOption
// This function gets the letters A-Z, a-z, and 1-8
// and number below them and returns
// option description.
function GetOption(strLetter, iNumber)
{
	if (strLetter == " ") return "";

	var strDescription = strLetter + iNumber + ": ";

	switch (strLetter)
	{
	case "1":
		if (iNumber == 4) return strDescription + "Sill Mouldings";
		if (iNumber == 9) return strDescription + "Wide Sill Mouldings";
		break;
	case "2":
		if (iNumber == 5) return strDescription + "Drip Rail Mouldings";
		break;
	case "3":
		if (iNumber == 0) return strDescription + "Body Belt Mouldings";
		break;
	case "4":
		if (iNumber == 7) return strDescription + "'B' Pillar Mouldings (for coupe)";
		break;
	case "5":
		if (iNumber == 5) return strDescription + "Body Side Mouldings";
		break;
	case "7":
		if (iNumber == 8) return strDescription + "Wheel Lip Mouldings";
		break;

	case "A":
		if (iNumber == 1) return strDescription + "26in Radiator";
		break;
	case "B":
		if (iNumber == 3) return strDescription + "Cruise Control";
		break;
	case "C":
		break;
	case "D":
		if (iNumber == 9) return strDescription + "Front Disk Brakes";
		break;
	case "E":
		if (iNumber == 1) return strDescription + "Cleaner Air Package";
		break;
	case "F":
		if (iNumber == 0) return strDescription + "Decor Package";
		if (iNumber == 5) return strDescription + "Special Body Style, GTX only";
		if (iNumber == 7) return strDescription + "Barracuda Formula S Package";
		break;
	case "H":
		if (iNumber == 1) return strDescription + "Power Brakes";
		if (iNumber == 2) return strDescription + "Power Locks";
		break;
	case "J":
		if (iNumber == 8) return strDescription + "Remote Trunk Release";
		break;
	case "K":
		if (iNumber == 8) return strDescription + "Power Windows";
		break;
	case "L":
		if (iNumber == 9) return strDescription + "Power Vent Windows";
		break;
	case "M":
		if (iNumber == 2) return strDescription + "Assembly plant: Hamtrack";
		break;
	case "N":
		if (iNumber == 8) return strDescription + "Rear Window Defogger";
		break;
	case "P":
		if (iNumber == 6) return strDescription + "Rear Seat Speaker";
		if (iNumber == 7) return strDescription + "Stereo Tape Player";
		break;
	case "Q":
		if (iNumber == 9) return strDescription + "Sentinel Lighting";
		break;
	case "R":
		if (iNumber == 0) return strDescription + "AM 8-Track Radio";
		if (iNumber == 1) return strDescription + "AM Radio";
		if (iNumber == 2) return strDescription + "Music Master AM Radio";
		if (iNumber == 8) return strDescription + "AM/FM Radio";
		break;
	case "S":
		if (iNumber == 1) return strDescription + "Air Conditioning";
		if (iNumber == 3) return strDescription + "Autotemp Air Conditioning";
		break;
	case "T":
		if (iNumber == 4) return strDescription + "Vacuum meter";
		if (iNumber == 7) return strDescription + "Tachometer";
		break;
	case "X":
		if (iNumber == 1) return strDescription + "Tinted Glass (all)";
		if (iNumber == 2) return strDescription + "Tinted Windshield Only";
		break;
	case "Y":
		if (iNumber == 0) return strDescription + "Green Convertible Top";
		if (iNumber == 1) return strDescription + "Black Convertible Top";
		if (iNumber == 2) return strDescription + "White Convertible Top";
		if (iNumber == 4) return strDescription + "Green Vinyl Top";
		if (iNumber == 5) return strDescription + "Vinyl Top, Unknown Color";
		if (iNumber == 6) return strDescription + "Black Vinyl Top";
		if (iNumber == 7) return strDescription + "White Vinyl Top";
		break;
	case "W":
		if (iNumber == 9) return strDescription + "3 Speed Wipers";
		break;
	case "Z":
		if (iNumber == 8) return strDescription + "Performance Hood Treatment (Roadrunner/GTX)";
		break;

	case "a":
		if (iNumber == 5) return strDescription + "Center Front Seat";
		if (iNumber == 6) return strDescription + "Console";
		break;
	case "b":
		if (iNumber == 3) return strDescription + "50/50 Split Front Bench Seat";
		if (iNumber == 4) return strDescription + "Bucket Seats";
		if (iNumber == 5) return strDescription + "Rear Arm Rest w/ Ashtray";
		break;
    case "g":
        // this is speculation from cbodydrydock.com, note that there are other 2 codes
        // for this same option, m6 and p6
        if (iNumber == 6) return strDescription + "Driver's Outside Remote Operated Mirror";
        break;
    case "h":
		if (iNumber == 7) return strDescription + "Fender or Hood Mounted Turn Signal Indicators";
		break;
	case "j":
		if (iNumber == 0) return strDescription + "Tilt/Telescoping Steering Column";
		if (iNumber == 4) return strDescription + "Moulding - Body Sill Narrow";
		break;
	case "k":
		if (iNumber == 7) return strDescription + "Passenger Outside Manual Mirror";
		break;
	case "m":
		if (iNumber == 6) return strDescription + "Driver's Outside Remote Operated Mirror";
		break;
	case "p":
		if (iNumber == 6) return strDescription + "Driver's Outside Remote Operated Mirror";
		break;
	case "u":
		if (iNumber == 1) return strDescription + "Sold Car When Built (Somebody Ordered It)";
		break;
	case "w":
		if (iNumber == 6) return strDescription + "Build to Spec's for Canada";
		if (iNumber == 7) return strDescription + "Build to Spec's for Export";
		break;
	case "y":
		if (iNumber == 9) return strDescription + "Special Order";
		break;

	default:
		break;
	}

	return strDescription + "Unknown Option";
}


function GetPaintName(strLetter, strYear)
{
	if (strLetter == "" || strLetter == " ") return "";

	if (strYear == "1967")
	{
		switch (strLetter)
		{
	    case "A": return "Silver Metallic (Dodge, Plymouth), Silver Mist Metallic (Chrysler, Imperial)";
	    case "B": return "Black (Dodge, Plymouth), Formal Black (Chrysler, Imperial)";
	    case "C": return "Medium Blue Metallic (Dodge, Plymouth), Arctic Blue Metallic (Chrysler), Aegean Blue Metallic (Imperial)";
	    case "D": return "Light Blue Metallic (Dodge, Plymouth), Crystal Blue Metallic (Chrysler), Wedgewood Blue Metallic (Imperial)";
	    case "E": return "Dark Blue Metallic (Dodge, Plymouth), Regal Blue Metallic (Chrysler, Imperial)";
	    case "F": return "Light Green Metallic (Dodge, Plymouth), Mint Green Metallic (Chrysler), Haze Green Metallic (Imperial)";
	    case "G": return "Dark Green Metallic (Dodge, Plymouth), Pine Green Metallic (Chrysler), Forest Green Metallic (Imperial)";
	    case "H": return "Dark Copper Metallic (Dodge, Plymouth)";
		case "J": return "Chestnut Metallic (Dodge), Mahogany Metallic (Chrysler), Sema Metallic (Imperial)";
		case "K": return "Medium Turquoise Metallic (Dodge), Light Turquoise Metallic (Plymouth), Mist Turquoise Metallic (Chrysler), Aqua Turquoise Metallic (Imperial)";
		case "L": return "Dark Turquoise Metallic (Dodge, Plymouth), Twilight Turquoise Metallic (Chrysler, Imperial)";
		case "M": return "Turbine Bronze Metallic";
		case "P": return "Bright Red (Dodge, Plymouth), Scorch Red (Chrysler), Flame (Imperial)";
		case "Q": return "Dark Red Metallic (Dodge, Plymouth), Ruby Red Metallic (Chrysler), Plum Red Metallic (Imperial)";
		case "R": return "Yellow (Dodge, Plymouth), Daffodil Yellow (Chrysler, Imperial)";
		case "S": return "Cream (Dodge), Soft Yellow (Plymouth), Ivory (Chrysler, Imperial)";
		case "T": return "Medium Copper Metallic (Dodge, Plymouth)";
		case "U": return "Light Blue Metallic (Dodge)";
		case "W": return "White (Dodge, Plymouth), Persian White (Chrysler, Imperial)";
		case "X": return "Light Tan (Dodge), Beige (Plymouth), Sandalwood (Chrysler), Imperial Navaho Beige (Imperial)";
		case "Y": return "Medium Tan Metallic (Dodge), Light Tan Metallic (Plymouth), Desert Dune Metallic (Chrysler), Imperial Fawn Metallic (Imperial)";
		case "Z": return "Gold Metallic (Dodge, Plymouth), Spice Gold Metallic (Chrysler), Cinnamon Gold Metallic (Imperial)";
		case "3": return "Charger Red (Dodge)";
		case "5": return "Charcoal Gray Metallic (Imperial)";
		case "6": return "Mauve Metallic (Dodge, Plymouth), Mauve Mist Metallic (Chrysler), Dust Pink Metallic (Imperial)";
		case "7": return "Ruby Metallic (Imperial)";
		case "8": return "Bright Blue Metallic (Dodge, Plymouth), Mediterranean Blue Metallic (Chrysler)";
		case "9": return "Special Order";
		}
	}
	else    // 1968
	{
		switch (strLetter)
		{
	    case "A": return "Silver Metallic (Dodge) Buffed Silver Metallic (Plymouth), Silver Haze Metallic (Chrysler, Imperial)";
	    case "B": return "Black (Dodge, Plymouth), Formal Black (Chrysler, Imperial)";
	    case "C": return "Medium Blue Metallic (Dodge, Plymouth), Consort Blue Metallic (Chrysler, Imperial)";
	    case "D": return "Pale Blue Metallic (Dodge), Mist Blue Metallic (Plymouth), Sky Blue Metallic (Chrysler, Imperial)";
	    case "E": return "Dark Blue Metallic (Dodge), Midnight Blue Metallic (Plymouth), Military Blue Metallic (Chrysler, Imperial)";
	    case "F": return "Light Green Metallic (Dodge), Mist Green Metallic (Plymouth), Frost Green Metallic (Chrysler, Imperial)";
	    case "G": return "Racing Green Metallic (Dodge), Forest Green Metallic (Plymouth, Chrysler, Imperial)";
	    case "H": return "Light Gold Metallic (Dodge), Yellow Gold (Plymouth), Antique Ivory (Chrysler), Champagne (Imperial)";
	    case "J": return "Medium Gold Metallic (Dodge), Ember Gold Metallic (Plymouth), Sovereign Gold Metallic (Chrysler, Imperial)";
	    case "K": return "Light Turquoise Metallic (Dodge), Mist Turquoise Metallic (Plymouth, Chrysler, Imperial)";
	    case "L": return "Medium Dark Turquoise Metallic (Dodge), Surf Turqoise Metallic (Plymouth)";
	    case "M": return "Bronze Metallic (Dodge), Turbine Bronze Metallic (Plymouth, Chrysler, Imperial)";
	    case "P": return "Red (Dodge), Matador Red (Plymouth), Scorch Red (Chrysler), Flame (Imperial)";
	    case "Q": return "Bright Blue Metallic (Dodge), Electric Blue Metallic (Plymouth)";
	    case "R": return "Burgundy Metallic";
	    case "S": return "Yellow (Dodge), Sunfire Yellow (Plymouth)";
	    case "T": return "Medium Green Metallic (Dodge), Avocado Green Metallic (Plymouth), Meadow Green Metallic (Chrysler, Imperial)";
	    case "U": return "Light Blue Metallic (Dodge), Frost Blue Metallic (Plymouth)";
	    case "W": return "White (Dodge), Sable White (Plymouth), Polar White (Chrysler, Imperial)";
	    case "X": return "Beige (Dodge), Satin Beige (Plymouth), Sandalwood (Chrysler), Imperial Navaho Beige (Imperial)";
	    case "Y": return "Medium Tan Metallic (Dodge), Sierra Tan Metallic (Plymouth), Beige Mist Metallic (Chrysler, Imperial)";
	    case "Z": return "Gold Metallic (Dodge)";
	    case "2": return "Hawaiian Blue (Plymouth)";
	    case "3": return "Bright Red (Dodge)";
	    case "4": return "Bright Turquoise Metallic";
	    case "5": return "Charcoal Gray Metallic (Imperial)";
	    case "6": return "Dark Green Metallic (Dodge)";
	    case "8": return "Bright Blue Metallic (Dodge)";
		case "9": return "Special Order";
		}
	}

	return "Unknown Color";
}


