/* Code and display of "Breed Comparator" - Copyright © 1995, 2003 Telemark Productions.
 * May not be duplicated in whole or in part. All rights reserved.
 *
 * Author: Rishi R. Kinra (rishi@kinra.net)
 *
 * This defines a BreedPropertyMap object for the comparator 
*/ 

function BreedPropertyMap() {
  //alert("Debug: BreedPropertyMap");
}

/********* Innner Class ********/    
function AlphabetEnumerator() { }
AlphabetEnumerator.MIN = 65;
AlphabetEnumerator.MAX = 90;
/*******************************/

/* 
 * @aKey
 * @aPropertyName must be a string 
 *
*/
BreedPropertyMap.getBreedPropertyValueByKey = function(aKey, aPropertyName) {
  var isDigitRegEx = /\d+/;
  // Converting to a string to do below matching
  aKey = new String(aKey);
  if( (aKey.match(isDigitRegEx)) == null ) {
    aKey = aKey.toUpperCase();
  }   
  if( (aPropertyName.match(isDigitRegEx)) != null ) {
    BreedPropertyMap.printNoValidParameterError("BreedPropertyMap.getBreedPropertyValueByKey: aPropertyName");
  }   
  //alert("aKey:" + aKey);
  aPropertyMap = new Array();
  for(j=0; j<BreedForCompare.propertyName.length; j++) {
    if(aPropertyName.toString() == (BreedForCompare.propertyName[j]).toString()) {
      //alert((aPropertyName.toString()).toUpperCase());
      // Assign the appropriate BreedPropertyMap into local aPropertyMap
      aPropertyMap = eval("BreedPropertyMap." + (aPropertyName.toString()).toUpperCase() + ";");
      break;
    }
  }  
  for(i=0;i<aPropertyMap.length;i++) {
    if(aPropertyMap[i] != null) {
      // Do a match to see if we have a number or character
      if( (aKey.match(isDigitRegEx)) == null ) {
        // Get By Alphabetic Enumeration
        for(ii=AlphabetEnumerator.MIN;ii<=AlphabetEnumerator.MAX;ii++) { // Char Code Unicode Number For Characters A-Z
         if(aKey.toString() == (String.fromCharCode(ii))) {
            //alert(ii);
            //alert(String.fromCharCode(ii) + "="+ aPropertyMap[((ii) - 65)] + "=" + ii)
            return aPropertyMap[((ii) - 65)]; // Remember return is here!
          }  
        }
      } else {  
        // If we can't do a matching by Alphnumeric keys then try match by iterator
        //
        
         //alert("Get By Iteration:" + aKey);
        
        // Make an exception for SERVICE PROPERETY since it actually starts with 0!
        // Talk to Ellen about this.
        if(((aPropertyName.toString()).toUpperCase() == "SERVICE") ||
           ((aPropertyName.toString()).toUpperCase() == "BARKING") ||
           ((aPropertyName.toString()).toUpperCase() == "WEATHER") ||
		   ((aPropertyName.toString()).toUpperCase() == "INDEPENDENCE") ||
		   ((aPropertyName.toString()).toUpperCase() == "PETS") ||
		   ((aPropertyName.toString()).toUpperCase() == "SPACE") ||
           ((aPropertyName.toString()).toUpperCase() == "DOCKING")) {
            return aPropertyMap[aKey];
        } else {
            return aPropertyMap[(aKey - 1)];
        }
        
      }
    }  
  }
}

BreedPropertyMap.printNoValidParameterError = function(s) {
     alert("Error! No valid parameter passed in method:" + s);
}


/* PROPERTY MAPS */
/********************************************************************/
BreedPropertyMap.SIZE = new Array();
BreedPropertyMap.SIZE[0] = "Very small (< 10 inches, < 15 pounds)";
BreedPropertyMap.SIZE[1] = "Small (9-15 inches, 15-35 pounds)";
BreedPropertyMap.SIZE[2] = "Medium (12-24 inches, 30-55 pounds)";
BreedPropertyMap.SIZE[3] = "Large (22-27 inches, 50-115 pounds)";
BreedPropertyMap.SIZE[4] = "Very large (> 25 inches, > 110 pounds)";
/********************************************************************/
BreedPropertyMap.COAT = new Array();
BreedPropertyMap.COAT[0] = "Short";
BreedPropertyMap.COAT[1] = "Curly";
BreedPropertyMap.COAT[2] = "Wiry";
BreedPropertyMap.COAT[3] = "Medium";
BreedPropertyMap.COAT[4] = "Feathered";
BreedPropertyMap.COAT[5] = "Fluffy";
BreedPropertyMap.COAT[6] = "Medium-long";
BreedPropertyMap.COAT[7] = "Long";
BreedPropertyMap.COAT[8] = "Hairless";
/********************************************************************/
BreedPropertyMap.BARKING = new Array();
BreedPropertyMap.BARKING[0] = "No barking, generally quiet";
BreedPropertyMap.BARKING[1] = "Not much barking";
BreedPropertyMap.BARKING[2] = "Average barking";
BreedPropertyMap.BARKING[3] = "Likes baying";
BreedPropertyMap.BARKING[4] = "Likes howling";
BreedPropertyMap.BARKING[5] = "Likes to bark";
/********************************************************************/
BreedPropertyMap.TYPE = new Array();
BreedPropertyMap.TYPE[0] = "Mastiff, bulldog";
BreedPropertyMap.TYPE[1] = "Spitz, Nordic";
BreedPropertyMap.TYPE[2] = "Terrier";
BreedPropertyMap.TYPE[3] = "Scent hound";
BreedPropertyMap.TYPE[4] = "Setter, retriever, pointer";
BreedPropertyMap.TYPE[5] = "Toy, miniature";
BreedPropertyMap.TYPE[6] = "Spaniel";
BreedPropertyMap.TYPE[7] = "Herding dog";
BreedPropertyMap.TYPE[8] = "Sighthound";
BreedPropertyMap.TYPE[9] = "Mountain dog, stock guard";
BreedPropertyMap.TYPE[10] = "Poodle, bichon";
BreedPropertyMap.TYPE[15] = "Pinscher, Schnauzer";
BreedPropertyMap.TYPE[25] = "Mastiff / Stock Guard or Mountain Dog";
/********************************************************************/
BreedPropertyMap.FRIENDLY = new Array(); 
BreedPropertyMap.FRIENDLY[0] = "Very wary of strangers, highly protective";
BreedPropertyMap.FRIENDLY[1] = "Moderately protective";
BreedPropertyMap.FRIENDLY[2] = "Reserved with strangers";
BreedPropertyMap.FRIENDLY[3] = "Fairly friendly with strangers";
BreedPropertyMap.FRIENDLY[4] = "Loves everyone";
/********************************************************************/	
BreedPropertyMap.INDEPENDENCE = new Array(); 
BreedPropertyMap.INDEPENDENCE[0] = "---";
BreedPropertyMap.INDEPENDENCE[1] = "Very dependent - needs people a lot";
BreedPropertyMap.INDEPENDENCE[2] = "Moderately dependent on people";
BreedPropertyMap.INDEPENDENCE[3] = "Not particularly dependent or independent";
BreedPropertyMap.INDEPENDENCE[4] = "Fairly independent";
BreedPropertyMap.INDEPENDENCE[5] = "Very independent";
/********************************************************************/	
BreedPropertyMap.DOMINANCE = new Array();
BreedPropertyMap.DOMINANCE[0] = "Very submissive";		 
BreedPropertyMap.DOMINANCE[1] = "Fairly submissive";		
BreedPropertyMap.DOMINANCE[2] = "Not particularly dominant or submissive";	
BreedPropertyMap.DOMINANCE[3] = "Fairly dominant";			
BreedPropertyMap.DOMINANCE[4] = "Very dominant";
/********************************************************************/	
BreedPropertyMap.TRAINING = new Array(); 
BreedPropertyMap.TRAINING[0] = "Very difficult to train";
BreedPropertyMap.TRAINING[1] = "Not easy to train"; 	
BreedPropertyMap.TRAINING[2] = "Moderately easy to train";
BreedPropertyMap.TRAINING[3] = "Easy to train"; 	
BreedPropertyMap.TRAINING[4] = "Very easy to train";
/********************************************************************/	
BreedPropertyMap.EXERCISE = new Array(); 
BreedPropertyMap.EXERCISE[0] = "Almost no exercise needed";	
BreedPropertyMap.EXERCISE[1] = "A little exercise needed";
BreedPropertyMap.EXERCISE[2] = "Moderate exercise needed";
BreedPropertyMap.EXERCISE[3] = "Lots of exercise needed";
BreedPropertyMap.EXERCISE[4] = "Vigorous daily exercise needed";
/********************************************************************/	
BreedPropertyMap.GROOMING = new Array(); 
BreedPropertyMap.GROOMING[0] = "Almost no grooming needed";	
BreedPropertyMap.GROOMING[1] = "A little grooming needed";	
BreedPropertyMap.GROOMING[2] = "Regular  grooming needed";	
BreedPropertyMap.GROOMING[3] = "Extensive grooming needed";  
BreedPropertyMap.GROOMING[4] = "Daily grooming is best";
/********************************************************************/	
BreedPropertyMap.PROFESSIONAL = new Array(); 
BreedPropertyMap.PROFESSIONAL[0] = "No trimming or stripping of the coat needed";
BreedPropertyMap.PROFESSIONAL[1] = "Some trimming and/or stripping of the coat needed (little skill required)";
BreedPropertyMap.PROFESSIONAL[2] = "Moderate trimming and/or stripping of the coat needed";
BreedPropertyMap.PROFESSIONAL[3] = "Skilled trimming and/or stripping of the coat needed";
BreedPropertyMap.PROFESSIONAL[4] = "Very elaborate, skilled trimming and/or stripping of the coat needed";
/********************************************************************/	
BreedPropertyMap.DOCKING = new Array(); 
BreedPropertyMap.DOCKING[0] = "Ears and tail are not cropped or docked";
BreedPropertyMap.DOCKING[1] = "Ears are customarily cropped";
BreedPropertyMap.DOCKING[2] = "Tail is customarily docked";
BreedPropertyMap.DOCKING[3] = "Customarily, ears are cropped and tail is docked";
/********************************************************************/	
BreedPropertyMap.NOVICE = new Array(); // ???
BreedPropertyMap.NOVICE[13] = "Not recommended for novice owners";
BreedPropertyMap.NOVICE[24] = "Suitable for novice owners";
/********************************************************************/	
BreedPropertyMap.CHILDREN = new Array(); 
BreedPropertyMap.CHILDREN[0] = "Not recommended with children";
BreedPropertyMap.CHILDREN[1] = "Good w/children only when raised with them from puppyhood";
BreedPropertyMap.CHILDREN[2] = "Best with older, considerate children";
BreedPropertyMap.CHILDREN[3] = "Good with children";
BreedPropertyMap.CHILDREN[4] = "Excellent with children";
/********************************************************************/	
BreedPropertyMap.PETS = new Array(); 
BreedPropertyMap.PETS[0] = "---";
BreedPropertyMap.PETS[1] = "Do not trust w/other pets";
BreedPropertyMap.PETS[2] = "May be aggressive w/same-sex dogs;  Do not trust w/non-canine pets";
BreedPropertyMap.PETS[3] = "Generally good w/other dogs in household;  Do not trust w/non-canine pets";
BreedPropertyMap.PETS[4] = "Good w/other pets only when raised with them from puppyhood";
BreedPropertyMap.PETS[5] = "Generally good w/other pets";
/********************************************************************/	
BreedPropertyMap.SPACE = new Array(); 
BreedPropertyMap.SPACE[0] = "---"; 
BreedPropertyMap.SPACE[1] = "OK without a yard"; 
BreedPropertyMap.SPACE[2] = "Needs at least a small outdoor yard";
BreedPropertyMap.SPACE[3] = "Needs an average sized yard";
BreedPropertyMap.SPACE[4] = "Best with large yard";
BreedPropertyMap.SPACE[5] = "Best with acreage";
/********************************************************************/	
BreedPropertyMap.WEATHER = new Array(); 
BreedPropertyMap.WEATHER[0] = "---";
BreedPropertyMap.WEATHER[1] = "Best in warm climates";
BreedPropertyMap.WEATHER[2] = "Best in cold climates";
BreedPropertyMap.WEATHER[3] = "Does well in most climates";
/********************************************************************/
BreedPropertyMap.COMBATIVENESS = new Array(); 
BreedPropertyMap.COMBATIVENESS[0] = "Friendly with other dogs.  Not dog-aggressive.";
BreedPropertyMap.COMBATIVENESS[1] = "Not generally dog-aggressive";
BreedPropertyMap.COMBATIVENESS[2] = "Can be a bit dog-aggressive";
BreedPropertyMap.COMBATIVENESS[3] = "Tends to be fairly dog-aggressive";
BreedPropertyMap.COMBATIVENESS[4] = "Very dog-aggressive";
/********************************************************************/
BreedPropertyMap.AVAILABILITY = new Array(); 
BreedPropertyMap.AVAILABILITY[0] = "Difficult to find";
BreedPropertyMap.AVAILABILITY[1] = "May take some effort to find";
BreedPropertyMap.AVAILABILITY[2] = "Moderately easy to find";
BreedPropertyMap.AVAILABILITY[3] = "Widely available";
BreedPropertyMap.AVAILABILITY[4] = "Very popular";
/********************************************************************/ 
BreedPropertyMap.LONGEVITY = new Array(); 
BreedPropertyMap.LONGEVITY[0] = "Short lifespan (under 10 years)";
BreedPropertyMap.LONGEVITY[1] = "Average lifespan (about 10-12 years)";
BreedPropertyMap.LONGEVITY[2] = "Fairly long lifespan (about 12-15 years)";
BreedPropertyMap.LONGEVITY[3] = "Long lifespan (15 + years)";
/********************************************************************/ 
BreedPropertyMap.APARTMENTS = new Array(); 
BreedPropertyMap.APARTMENTS[0] = "Not recommended for apartments";
BreedPropertyMap.APARTMENTS[1] = "If sufficiently exercised, will be okay in an apartment";
BreedPropertyMap.APARTMENTS[2] = "Good for apartment living";
/********************************************************************/ 
BreedPropertyMap.ACTIVITY_INDOORS = new Array(); 	
BreedPropertyMap.ACTIVITY_INDOORS[0] = "Very inactive indoors";
BreedPropertyMap.ACTIVITY_INDOORS[1] = "Relatively inactive indoors";
BreedPropertyMap.ACTIVITY_INDOORS[2] = "Moderately active indoors";
BreedPropertyMap.ACTIVITY_INDOORS[3] = "Fairly active indoors";
BreedPropertyMap.ACTIVITY_INDOORS[4] = "Very active indoors";
/********************************************************************/ 
BreedPropertyMap.SLEEPING = new Array(); 	
BreedPropertyMap.SLEEPING[9] = "Needs to sleep indoors"; //I=9
BreedPropertyMap.SLEEPING[15] = "Prefers to sleep outdoors"; //O=15
BreedPropertyMap.SLEEPING[5] = "Can sleep either indoors or outdoors"; //E=5
/********************************************************************/ 
BreedPropertyMap.SHEDDING = new Array(); 	
BreedPropertyMap.SHEDDING[0] = "None (or very light)";
BreedPropertyMap.SHEDDING[1] = "Average shedder";
BreedPropertyMap.SHEDDING[2] = "Seasonally heavy shedder";
BreedPropertyMap.SHEDDING[3] = "Constant shedder";
/********************************************************************/	
BreedPropertyMap.SERVICE = new Array(); 
BreedPropertyMap.SERVICE[0] = "Has been used as a hearing assistant";
BreedPropertyMap.SERVICE[1] = "Has been used as a guide dog for the blind";
BreedPropertyMap.SERVICE[2] = "Has been used as a service dog and/or guide dog";
/********************************************************************/	
BreedPropertyMap.JOGGING = new Array(); 
BreedPropertyMap.JOGGING[0] = "A poor jogging companion";	     
BreedPropertyMap.JOGGING[1] = "A fair jogging companion";
BreedPropertyMap.JOGGING[2] = "A fairly good jogging companion though small";     
BreedPropertyMap.JOGGING[3] = "A good jogging companion";
BreedPropertyMap.JOGGING[4] = "A very good jogging companion";
/********************************************************************/	
BreedPropertyMap.HUNTING = new Array();
BreedPropertyMap.HUNTING[13] = "No";	     
BreedPropertyMap.HUNTING[24] = "Yes"; 
/********************************************************************/	
BreedPropertyMap.SIGHTING = new Array();
BreedPropertyMap.SIGHTING[13] = "No";	     
BreedPropertyMap.SIGHTING[24] = "Yes"; 
/********************************************************************/	
BreedPropertyMap.TRACKING = new Array();
BreedPropertyMap.TRACKING[13] = "No";	     
BreedPropertyMap.TRACKING[24] = "Yes"; 
/********************************************************************/	
BreedPropertyMap.RETRIEVING = new Array();
BreedPropertyMap.RETRIEVING[13] = "No";	     
BreedPropertyMap.RETRIEVING[24] = "Yes"; 
/********************************************************************/	
BreedPropertyMap.POINTING = new Array();
BreedPropertyMap.POINTING[13] = "No";	     
BreedPropertyMap.POINTING[24] = "Yes"; 
/********************************************************************/	
BreedPropertyMap.HERDING = new Array();
BreedPropertyMap.HERDING[13] = "No";	     
BreedPropertyMap.HERDING[24] = "Yes"; 
/********************************************************************/	
BreedPropertyMap.WATCHDOG = new Array(); 
BreedPropertyMap.WATCHDOG[13] = "No";	     
BreedPropertyMap.WATCHDOG[24] = "Yes"; 
/********************************************************************/	
BreedPropertyMap.GUARDING = new Array(); 
BreedPropertyMap.GUARDING[13] = "No";	     
BreedPropertyMap.GUARDING[24] = "Yes"; 
/********************************************************************/	
BreedPropertyMap.POLICE = new Array(); 
BreedPropertyMap.POLICE[13] = "No";	     
BreedPropertyMap.POLICE[24] = "Yes"; 
/********************************************************************/	
BreedPropertyMap.SEARCHRESCUE = new Array();
BreedPropertyMap.SEARCHRESCUE[13] = "No";	     
BreedPropertyMap.SEARCHRESCUE[24] = "Yes"; 
/********************************************************************/	
BreedPropertyMap.WATERRESCUE = new Array();
BreedPropertyMap.WATERRESCUE[13] = "No";	     
BreedPropertyMap.WATERRESCUE[24] = "Yes"; 
/********************************************************************/	
BreedPropertyMap.GUIDING = new Array();
BreedPropertyMap.GUIDING[13] = "No";	     
BreedPropertyMap.GUIDING[24] = "Yes"; 
/********************************************************************/	
BreedPropertyMap.SLEDDING = new Array();
BreedPropertyMap.SLEDDING[13] = "No";	     
BreedPropertyMap.SLEDDING[24] = "Yes"; 
/********************************************************************/
BreedPropertyMap.CARTING = new Array();
BreedPropertyMap.CARTING[13] = "No";	     
BreedPropertyMap.CARTING[24] = "Yes"; 
/********************************************************************/
BreedPropertyMap.WEIGHTS = new Array();
BreedPropertyMap.WEIGHTS[13] = "No";	     
BreedPropertyMap.WEIGHTS[24] = "Yes"; 
/********************************************************************/
BreedPropertyMap.AGILITY = new Array();
BreedPropertyMap.AGILITY[13] = "No";	     
BreedPropertyMap.AGILITY[24] = "Yes"; 
/********************************************************************/
BreedPropertyMap.LURE = new Array(); 
BreedPropertyMap.LURE[13] = "No";	     
BreedPropertyMap.LURE[24] = "Yes"; 
/********************************************************************/
BreedPropertyMap.OBEDIENCE = new Array();
BreedPropertyMap.OBEDIENCE[13] = "No";	     
BreedPropertyMap.OBEDIENCE[24] = "Yes"; 
/********************************************************************/
BreedPropertyMap.SCHUTZHUND = new Array(); 
BreedPropertyMap.SCHUTZHUND[13] = "No";	     
BreedPropertyMap.SCHUTZHUND[24] = "Yes"; 
/********************************************************************/
BreedPropertyMap.TRICKS = new Array();
BreedPropertyMap.TRICKS[13] = "No";	     
BreedPropertyMap.TRICKS[24] = "Yes"; 
/********************************************************************/
