var petNames = new Array(); petNames["HM001"]="Frog"; petNames["HM002"]="Pig"; petNames["HM003"]="Cow"; petNames["HM004"]="Black Bear"; petNames["HM006"]="Lion"; petNames["HM007"]="Elephant"; petNames["HM008"]="Monkey"; petNames["HM009"]="Hippo"; petNames["HM010"]="Golden Retriever"; petNames["HM011"]="Cocker Spaniel"; petNames["HM012"]="St. Bernard"; petNames["HM013"]="Basset Hound"; petNames["HM014"]="Poodle"; petNames["HM015"]="Grey Cat"; petNames["HM016"]="Black & White Cat"; petNames["HM017"]="Orange Cat"; petNames["HM021"]="Googles"; petNames["HM031"]="Leopard"; petNames["HM032"]="Tiger"; petNames["HM040"]="Gorilla"; petNames["HM042"]="Striped Alley Cat"; petNames["HM068"]="Pegasus"; petNames["HM069"]="Unicorn"; petNames["HM070"]="Yorkie"; petNames["HM078"]="Rabbit"; petNames["HM080"]="Cheeky Monkey"; petNames["HM103"]="Horse"; petNames["HM104"]="Chihuahua"; petNames["HM105"]="Pug"; petNames["HM106"]="White Terrier"; petNames["HM107"]="Pink Poodle"; petNames["HM109"]="Tree Frog"; petNames["HM110"]="White Persian"; petNames["HM111"]="Panda"; petNames["HM113"]="Koala"; petNames["HM114"]="Bull Frog"; petNames["HM116"]="Polar Bear"; petNames["HM117"]="Pink Pony"; petNames["HM120"]="Husky"; petNames["HM123"]="Dalmatian"; petNames["HM126"]="Bull Dog"; petNames["HM131"]="Love Puppy"; petNames["HM134"]="Sherbet Bunny"; petNames["HM135"]="Black Cat"; petNames["HM136"]="Black Lab"; petNames["HM138"]="Chocolate Lab"; petNames["HM139"]="Clydesdale"; petNames["HM141"]="Beagle"; petNames["HM142"]="Spotted Frog"; petNames["HM143"]="Raccoon"; petNames["HM145"]="Black Friesian"; var clothingNames = new Array(); clothingNames["WE000052"]="Blue Ball Cap"; clothingNames["WE000053"]="Dude Cap"; clothingNames["WE000054"]="Khaki Cargo Pants"; clothingNames["WE000055"]="Camo Cargo Pants"; clothingNames["WE000056"]="Cuffed Jeans"; clothingNames["WE000057"]="Maroon Hoody"; clothingNames["WE000058"]="Bubble Vest"; clothingNames["WE000059"]="Blue & Pink Striped Polo Shirt"; clothingNames["WE000060"]="Wheel of Wow Tee"; clothingNames["WE000061"]="Layered Tee"; clothingNames["WE000062"]="Cute Cropped Jacket"; clothingNames["WE000063"]="Yellow Raincoat & Hat"; clothingNames["WE000064"]="Polka Dot PJ Top"; clothingNames["WE000065"]="Polka Dot PJ Bottom"; clothingNames["WE000066"]="Pink Baggy Jeans"; clothingNames["WE000067"]="Red Football Jersey"; clothingNames["WE000068"]="Red Sport Pants"; clothingNames["WE000069"]="Pink & Purple Fleece Top"; clothingNames["WE000070"]="Webkinz Pet Coat"; clothingNames["WE000071"]="Love Diva Pet Coat"; clothingNames["WE000072"]="Hand Knit Sweater"; clothingNames["WE000073"]="Leopard Tank"; clothingNames["WE000074"]="Cute Blouse"; clothingNames["WE000075"]="Shorts"; clothingNames["WE000076"]="Angel Dress w/Wings"; clothingNames["WE000077"]="Ballerina Costume"; clothingNames["WE000078"]="Terry Robe"; clothingNames["WE000079"]="Jean Jacket"; clothingNames["WE000080"]="Pink Knit Capelet"; clothingNames["WE000081"]="Polka Dot Hoody"; clothingNames["WE000082"]="Pink Striped Polo"; clothingNames["WE000083"]="Blue Floral Dress"; clothingNames["WE000084"]="Pumpkin Costume"; clothingNames["WE000085"]="Camo Tank Top"; clothingNames["WE000086"]="Rhinestone Jeans"; clothingNames["WE000087"]="Witch Costume"; clothingNames["WE000292"]="Santa Outfit"; var clothingExceptions = new Array(); clothingExceptions["WE000052"] = new Object(); clothingExceptions["WE000052"].dontfit = new Array("HM001","HM109","HM114","HM142"); clothingExceptions["WE000053"] = new Object(); clothingExceptions["WE000053"].dontfit = new Array("HM001","HM109","HM114","HM142"); clothingExceptions["WE000053"].loose = new Array("HM068"); clothingExceptions["WE000054"] = new Object(); clothingExceptions["WE000054"].dontfit = new Array("HM021","HM078","HM110","HM134","HM142"); clothingExceptions["WE000054"].loose = new Array("HM068","HM070"); clothingExceptions["WE000055"] = new Object(); clothingExceptions["WE000055"].dontfit = new Array("HM021","HM078","HM110","HM134","HM142"); clothingExceptions["WE000055"].loose = new Array("HM068","HM070"); clothingExceptions["WE000056"] = new Object(); clothingExceptions["WE000056"].dontfit = new Array("HM021","HM078","HM109","HM110","HM134","HM142"); clothingExceptions["WE000057"] = new Object(); clothingExceptions["WE000057"].dontfit = new Array("HM021","HM110"); clothingExceptions["WE000057"].loose = new Array("HM068"); clothingExceptions["WE000057"].tight = new Array("HM139"); clothingExceptions["WE000058"] = new Object(); clothingExceptions["WE000058"].dontfit = new Array("HM021","HM070","HM114","HM126","HM139"); clothingExceptions["WE000058"].tight = new Array("HM040","HM142"); clothingExceptions["WE000059"] = new Object(); clothingExceptions["WE000059"].dontfit = new Array("HM021","HM110","HM114"); clothingExceptions["WE000059"].tight = new Array("HM126","HM142"); clothingExceptions["WE000060"] = new Object(); clothingExceptions["WE000060"].dontfit = new Array("HM001","HM021","HM109","HM110","HM114","HM126","HM142"); clothingExceptions["WE000060"].tight = new Array("HM002","HM003","HM007","HM009","HM040","HM116"); clothingExceptions["WE000061"] = new Object(); clothingExceptions["WE000061"].dontfit = new Array("HM021","HM110","HM114"); clothingExceptions["WE000061"].tight = new Array("HM070","HM126","HM139","HM142"); clothingExceptions["WE000062"] = new Object(); clothingExceptions["WE000062"].dontfit = new Array("HM001","HM021","HM040","HM070","HM109","HM110","HM114","HM126","HM142"); clothingExceptions["WE000062"].tight = new Array("HM002","HM003","HM007","HM009","HM116","HM139"); clothingExceptions["WE000063"] = new Object(); clothingExceptions["WE000063"].dontfit = new Array("HM021","HM069","HM070","HM103","HM114","HM117","HM142","HM145"); clothingExceptions["WE000063"].tight = new Array("HM040","HM110","HM126","HM139"); clothingExceptions["WE000064"] = new Object(); clothingExceptions["WE000064"].dontfit = new Array("HM021","HM114"); clothingExceptions["WE000064"].loose = new Array("HM068"); clothingExceptions["WE000065"] = new Object(); clothingExceptions["WE000065"].dontfit = new Array("HM021","HM110"); clothingExceptions["WE000065"].loose = new Array("HM068"); clothingExceptions["WE000065"].tight = new Array("HM142"); clothingExceptions["WE000066"] = new Object(); clothingExceptions["WE000066"].dontfit = new Array("HM021","HM078","HM110","HM134","HM142"); clothingExceptions["WE000066"].loose = new Array("HM068","HM070"); clothingExceptions["WE000067"] = new Object(); clothingExceptions["WE000067"].dontfit = new Array("HM021"); clothingExceptions["WE000067"].tight = new Array("HM070","HM110","HM114","HM126","HM142"); clothingExceptions["WE000068"] = new Object(); clothingExceptions["WE000068"].dontfit = new Array("HM021","HM078","HM110","HM134"); clothingExceptions["WE000068"].tight = new Array("HM142"); clothingExceptions["WE000069"] = new Object(); clothingExceptions["WE000069"].dontfit = new Array("HM002","HM003","HM007","HM009","HM021","HM070","HM110","HM114","HM116","HM139"); clothingExceptions["WE000069"].tight = new Array("HM006","HM078","HM126","HM142"); clothingExceptions["WE000070"] = new Object(); clothingExceptions["WE000070"].dontfit = new Array("HM021","HM040","HM114"); clothingExceptions["WE000070"].tight = new Array("HM126","HM142"); clothingExceptions["WE000071"] = new Object(); clothingExceptions["WE000071"].dontfit = new Array("HM021","HM040","HM114"); clothingExceptions["WE000071"].tight = new Array("HM126","HM142"); clothingExceptions["WE000072"] = new Object(); clothingExceptions["WE000072"].dontfit = new Array("HM021","HM040"); clothingExceptions["WE000073"] = new Object(); clothingExceptions["WE000073"].dontfit = new Array("HM021","HM040","HM114"); clothingExceptions["WE000073"].tight = new Array("HM040","HM126","HM139"); clothingExceptions["WE000074"] = new Object(); clothingExceptions["WE000074"].dontfit = new Array("HM021","HM069","HM103","HM114","HM117","HM126","HM139","HM145"); clothingExceptions["WE000074"].tight = new Array("HM142"); clothingExceptions["WE000075"] = new Object(); clothingExceptions["WE000075"].dontfit = new Array("HM021","HM069","HM078","HM103","HM110","HM117","HM120","HM134","HM145"); clothingExceptions["WE000075"].tight = new Array("HM139"); clothingExceptions["WE000076"] = new Object(); clothingExceptions["WE000076"].dontfit = new Array("HM021","HM040","HM070","HM104","HM109","HM110","HM114","HM126","HM142"); clothingExceptions["WE000077"] = new Object(); clothingExceptions["WE000077"].dontfit = new Array("HM021","HM069","HM070","HM103","HM109","HM110","HM114","HM117","HM126","HM134","HM139","HM142","HM145"); clothingExceptions["WE000077"].tight = new Array("HM002","HM003","HM006","HM007","HM009","HM078","HM116"); clothingExceptions["WE000078"] = new Object(); clothingExceptions["WE000078"].dontfit = new Array("HM021"); clothingExceptions["WE000078"].tight = new Array("HM114"); clothingExceptions["WE000079"] = new Object(); clothingExceptions["WE000079"].dontfit = new Array("HM002","HM003","HM007","HM009","HM021","HM070","HM109","HM114","HM116","HM126","HM139","HM142"); clothingExceptions["WE000079"].tight = new Array("HM006","HM110"); clothingExceptions["WE000081"] = new Object(); clothingExceptions["WE000081"].dontfit = new Array("HM021","HM110"); clothingExceptions["WE000081"].loose = new Array("HM068"); clothingExceptions["WE000081"].tight = new Array("HM139"); clothingExceptions["WE000082"] = new Object(); clothingExceptions["WE000082"].dontfit = new Array("HM021","HM110","HM114"); clothingExceptions["WE000082"].tight = new Array("HM126","HM142"); clothingExceptions["WE000083"] = new Object(); clothingExceptions["WE000083"].dontfit = new Array("HM021","HM110","HM114"); clothingExceptions["WE000083"].tight = new Array("HM070","HM126","HM142"); clothingExceptions["WE000084"] = new Object(); clothingExceptions["WE000084"].dontfit = new Array("HM021","HM040","HM068","HM070","HM109","HM114","HM126","HM139","HM142"); clothingExceptions["WE000084"].tight = new Array("HM002","HM003","HM007","HM009","HM069","HM103","HM110","HM116","HM117","HM145"); clothingExceptions["WE000085"] = new Object(); clothingExceptions["WE000085"].dontfit = new Array("HM021","HM114"); clothingExceptions["WE000085"].tight = new Array("HM126","HM142"); clothingExceptions["WE000086"] = new Object(); clothingExceptions["WE000086"].dontfit = new Array("HM021","HM078","HM109","HM110","HM134","HM142"); clothingExceptions["WE000087"] = new Object(); clothingExceptions["WE000087"].dontfit = new Array("HM021","HM114"); clothingExceptions["WE000087"].loose = new Array("HM068"); clothingExceptions["WE000087"].tight = new Array("HM126","HM142"); clothingExceptions["WE000292"] = new Object(); clothingExceptions["WE000292"].dontfit = new Array("HM021","HM070","HM110","HM114","HM134"); clothingExceptions["WE000292"].tight = new Array("HM126","HM142"); function initClothingTool() { initPetMenu(); initClothingMenu(); openAnchor(); } function openAnchor() { var pageURL = document.URL; var anchorPos = pageURL.indexOf('#') if (anchorPos > -1) { var anchorName = pageURL.substr(anchorPos+1); if (anchorName.length == 5) { //if we have a pet code setMenu("petMenu", anchorName); } else if (anchorName.length == 8) { //if we have a clothing code setMenu("clothingMenu", anchorName); } } } function setMenu(givenMenu, givenCode) { var menu = document.getElementById(givenMenu); for (var i=1; i <= menu.length; i++) { if (menu.options[i].value == givenCode) { menu.selectedIndex = i; if (givenMenu == "petMenu") { beforePetSelected(); } else if (givenMenu == "clothingMenu") { beforeClothingSelected(); } break; } } } function initClothingMenu() { var menu = document.getElementById("clothingMenu"); var sortedClothing = new Array(); var sortCount = 0; menu.innerHTML = ""; for (var i in clothingNames) { if (typeof(clothingNames[i]) != "function") { sortedClothing[sortCount++] = clothingNames[i] + i; } } sortedClothing.sort(); addMenuItem(menu, "Choose a clothing item...", 0, true); for (var i = 0; i < sortedClothing.length; i++) { addMenuItem(menu, sortedClothing[i].substring(0,sortedClothing[i].length-8), sortedClothing[i].substring(sortedClothing[i].length-8,sortedClothing[i].length), false); } menu.selectedIndex = 0; /* for (var i in clothingNames) { if (typeof(clothingNames[i]) != "function") { var opt = document.createElement('option'); opt.text = clothingNames[i]; opt.value = i; try { menu.add(opt, null); } catch(ex) { menu.add(opt); } } }*/ menu.disabled = false; //beforeClothingSelected(); } function initPetMenu() { var menu = document.getElementById("petMenu"); var sortedPets = new Array(); var sortCount = 0; menu.innerHTML = ""; for (var i in petNames) { if (typeof(petNames[i]) != "function") { sortedPets[sortCount++] = petNames[i] + i; } } sortedPets.sort(); addMenuItem(menu, "Choose a pet...", 0, true); for (var i = 0; i < sortedPets.length; i++) { addMenuItem(menu, sortedPets[i].substring(0,sortedPets[i].length-5), sortedPets[i].substring(sortedPets[i].length-5,sortedPets[i].length), false); } menu.selectedIndex = 0; menu.disabled = false; } function beforePetSelected() { document.getElementById("clothingMenu").selectedIndex = 0; new Effect.Fade('fitsPets', {duration: 0.1}); new Effect.Fade('listLoose', {duration: 0.1}); new Effect.Fade('listTight', {duration: 0.1}); new Effect.Fade('listDontFit', {duration: 0.1, afterFinish: petSelected}); //petSelected(); } function beforeClothingSelected() { document.getElementById("petMenu").selectedIndex = 0; new Effect.Fade('listLoose', {duration: 0.1}); new Effect.Fade('listTight', {duration: 0.1}); new Effect.Fade('listDontFit', {duration: 0.1, afterFinish: clothingSelected}); } function clothingSelected() { var menu = document.getElementById("clothingMenu"); var fitsPets = document.getElementById("fitsPets"); var listLoose = document.getElementById("listLoose"); var listTight = document.getElementById("listTight"); var listDontFit = document.getElementById("listDontFit"); var clothingCode = menu.options[menu.selectedIndex].value; var errLoose = null; var errTight = null; var errDontFit = null; listLoose.innerHTML = listTight.innerHTML = listDontFit.innerHTML = ""; //listLoose.style.display = listTight.style.display = listDontFit.style.display = "none"; try { if (clothingExceptions[clothingCode].loose) { listLoose.innerHTML = outputPetList(clothingExceptions[clothingCode].loose, "Loose Fitting", "loose"); //listLoose.style.display = "block"; new Effect.Appear('listLoose', {duration: 0.2}); } } catch(errLoose) { listLoose.innerHTML = ""; } try { if (clothingExceptions[clothingCode].tight) { listTight.innerHTML = outputPetList(clothingExceptions[clothingCode].tight, "Tight Fitting", "tight"); //listTight.style.display = "block"; new Effect.Appear('listTight', {duration: 0.2}); } } catch(errTight) { listTight.innerHTML = ""; } try { if (clothingExceptions[clothingCode].dontfit) { listDontFit.innerHTML = outputPetList(clothingExceptions[clothingCode].dontfit, "Doesn't Fit", "dontfit"); //listDontFit.style.display = "block"; new Effect.Appear('listDontFit', {duration: 0.2}); } } catch(errDontFit) { listDontFit.innerHTML = ""; } if (listLoose.innerHTML == "" && listTight.innerHTML == "" && listDontFit.innerHTML == "") { if (clothingExceptions[clothingCode] == "Choose a clothing item...") //{ var fitMsg = 'Please Select a Clothing Item'; //} //else //{ // var fitMsg = '