var key_33 = ',Infant/Toddler,Pre-School,Kindergarten,1st Grade,2nd Grade,3rd Grade,4th Grade,5th Grade,6th Grade,7th Grade,8th Grade,9th Grade,10th Grade,11th Grade,12th Grade,Adult'; var key_array_33 = key_33.split(','); var key_22 = ',Airplanes/Airports,Animals,Boats,Bridges,Buildings,Camping,Cars & Trucks,Childhood,Civil Rights,Cowboys,Crime,Dance,Disaster,Earth,Eggs,Ethnic,Etiquette,Family,Farms,Firefighters,Ghosts,Government,Heroes,Human Body,Invention,Knights,Machines,Magic,Mail,Medicine,Monkeys,Music,Mythical Creatures,Nature,Parties,Pioneer/Frontier Life,Pirates,Police,Prayer,Puritans,Royalty,School,Science,Sea and Seashore,Sealife,Snakes,Soldiers,Space,Sports,Spy,Time Travel,Toys,Trains,Transportation,Travel,War'; var key_array_22 = key_22.split(','); var key_9 = ',Activity Books,Adventure,Anime,Anthology,Art,Autobiography,Bible Stories,Biography,Classics,Comic Books,Concept Books,Crime,Detective,Diary,Drama,Epic,Exploration,Fables,Fairy Tales,Fantasy,Folklore,Ghost Stories,Historical Fiction,History,Horror,Humor,Mystery,Myth/Legend,Nature,Nursery Rhymes,Optical Illusions,Poetry,Puzzles,Quest,Riddle,Science,Science Fiction,Short Stories,Suspense,Tall Tales,Thriller,Tragedy,Travel,Trickster Tales,Wordless'; var key_array_9 = key_9.split(','); var key_1 = ',Ant,Anteater,Badger,Bear,Bird,Bull,Cat,Chicken,Cow,Coyote,Crocodile,Deer,Dinosaur,Dog,Doll,Duck,Elephant,Elves & Fairies,Fox,Giant,Horse,Kangaroo,Lion,Lizard,Llama,Mermaid,Mole,Monkey,Mouse,Mythical Creatures,Otter,Owl,Penguin,Pig,Possum,Rabbit,Raven,Sheep,Squirrel,Teddy Bear,Tiger,Train,Trucks/Big Machines,Turtle,Unicorn,Wolf'; var key_array_1 = key_1.split(','); var key_5 = ',Adoption,Adversity,Anger,Bedtime,Being Different,Belonging,Betrayal,Bullying,Captivity,Cruelty,Danger,Deceit,Envy,Evil,Failure,Fear,Gossip,Greed,Grief,Growing Up,Guilt,Handicaps,Hatred,Hiding / hiding things,Hurt Feelings,Illness & Suffering,Loneliness,Loss,Lost / Being Lost,Love,Lying/Untruthfulness,Manners & Behavior,Meanness,Moral Challenges,Moving,New Baby,New Beginnings,Nightmares,Peer Pressure,Power,Prejudice,Pride,Promises,Questioning,Revenge,Separation,Stealing,Suicide,Talking to Strangers,Tardiness,Teasing,Temptation,Worry / Anxiety'; var key_array_5 = key_5.split(','); var key_26 = ',Being Prepared,Community,Compassion,Courage,Discipline,Freedom,Friendship,Generosity,Gratitude,Honor,Hope,Hospitality,Initiative,Joy,Justice,Kindness,Leadership,Learning,Loyalty,Making Choices,Patience,Patriotism,Resourcefulness,Responsibility,Teamwork,Trust,Truthfulness,Wisdom'; var key_array_26 = key_26.split(','); var key_32 = ',Highly Recommended,Recommended,Suggested,Potential,Popular'; var key_array_32 = key_32.split(','); var key_0 = ''; var key_33_short_name = new Array('','Infant','Pre-School','Kindergarten','1st','2nd','3rd','4th','5th','6th','7th','8th','9th','10th','11th','12th','Adult'); var key_22_short_name = new Array('','Airplanes','Animals','Boats','Bridges','Buildings','Camping','Cars','Childhood','Civil','Cowboys','Crime','Dance','Disaster','Earth','Eggs','Ethnic','Etiquette','Family','Farms','Firefighters','Ghosts','Government','Heroes','Human','Invention','Knights','Machines','Magic','Mail','Medicine','Monkeys','Music','Mythical','Nature','Parties','Pioneer','Pirates','Police','Prayer','Puritans','Royalty','School','Science','Sea','Sealife','Snakes','Soldiers','Space','Sports','Spy','Time','Toys','Trains','Transportation','Travel','War'); var key_9_short_name = new Array('','Activity','Adventure','Anime','Anthology','Art','Autobiography','Bible','Biography','Classics','Comic','Concept','Crime','Detective','Diary','Drama','Epic','Exploration','Fables','Fairy','Fantasy','Folklore','Ghost','Historical','History','Horror','Humor','Mystery','Myth','Nature','Nursery','Optical','Poetry','Puzzles','Quest','Riddle','Science','Science','Short','Suspense','Tall','Thriller','Tragedy','Travel','Trickster','Wordless'); var key_1_short_name = new Array('','Ant','Anteater','Badger','Bear','Bird','Bull','Cat','Chicken','Cow','Coyote','Crocodile','Deer','Dinosaur','Dog','Doll','Duck','Elephant','Elves','Fox','Giant','Horse','Kangaroo','Lion','Lizard','Llama','Mermaid','Mole','Monkey','Mouse','Mythical','Otter','Owl','Penguin','Pig','Possum','Rabbit','Raven','Sheep','Squirrel','Teddy','Tiger','Train','Trucks','Turtle','Unicorn','Wolf'); var key_5_short_name = new Array('','Adoption','Adversity','Anger','Bedtime','Being','Belonging','Betrayal','Bullying','Captivity','Cruelty','Danger','Deceit','Envy','Evil','Failure','Fear','Gossip','Greed','Grief','Growing','Guilt','Handicaps','Hatred','Hiding','Hurt','Illness','Loneliness','Loss','Lost','Love','Lying','Manners','Meanness','Moral','Moving','New','New','Nightmares','Peer','Power','Prejudice','Pride','Promises','Questioning','Revenge','Separation','Stealing','Suicide','Talking','Tardiness','Teasing','Temptation','Worry'); var key_26_short_name = new Array('','Being','Community','Compassion','Courage','Discipline','Freedom','Friendship','Generosity','Gratitude','Honor','Hope','Hospitality','Initiative','Joy','Justice','Kindness','Leadership','Learning','Loyalty','Making','Patience','Patriotism','Resourcefulness','Responsibility','Teamwork','Trust','Truthfulness','Wisdom'); var key_32_short_name = new Array('','Highly','Recommended','Suggested','Potential','Popular'); var key_0_short_name = new Array(''); var arrayLengths = '16,56,45,46,53,28,5,0';var number_of_fields = 7;var fieldNamesArray = new Array();fieldNamesArray[0] = 'ttmd_agegrade';fieldNamesArray[1] = 'ttmd_subject';fieldNamesArray[2] = 'ttmd_genre';fieldNamesArray[3] = 'ttmd_animal_other_protagonist';fieldNamesArray[4] = 'ttmd_emotions_issues';fieldNamesArray[5] = 'ttmd_values';fieldNamesArray[6] = 'ttmd_recommendation';fieldNamesArray[7] = 'title';fieldNamesArray[8] = 'author';function returnCategoryNumbers(){ return '33,22,9,1,5,26,32,0'; } function returnFieldCount(){ return arrayLengths; } function returnCategoryNames(){ return 'Age & Grade,Subject,Genre,Animal Protagonist,Emotions & Issues,Values,Recommendation, '; } function returnFieldNames(index){ eval ('var returnString = key_'+index); return returnString; } function clearScreenForLoading(){ document.getElementById('qbFrame').innerHTML = ''; } function isLoaded(){ return 1; } function returnCatNumberForText(inText){ for(var i = 0; i < fieldNamesArray.length; ++i){ if (fieldNamesArray[i] == inText){ return i; } } } function returnFieldNumForText(catNumber, inText){ var searchIndex = returnFieldNumberForIndex(catNumber); eval ('var searchArray = key_array_'+searchIndex); for(i = 0; i < searchArray.length; ++i){ if (searchArray[i].toLowerCase() == inText){ return i; } } } function returnImagePath(updn, selected){ return 'http://www.ttmd.com/images/iphone/icons_'+updn+'_'+selected+'.png'; } function returnFieldNumberForIndex(index){ var tempString = '33,22,9,1,5,26,32,0'; var tempArray = tempString.split(','); return tempArray[index]; } function clearField(index){ document.getElementById('qb_fld'+index).value=''; welcomeCheck(); } function welcomeCheck(){ var checkString = ''; for (var i = 0; i < 9; ++i){ checkString += document.getElementById('qb_fld'+i).value; } if (checkString.length == 0){ rgRestoreWelcome(); } } function rgRestoreWelcome(){ window.location = '#top'; sendStopLoad(); restoreWelcome(); } function clearAllFields(){ for (var i = 0; i < number_of_fields; ++i){ document.getElementById('qb_fld'+i).value=''; current_searched_values_array = new Array(); } welcomeCheck(); } function rgAjax(index, invalue){ storeWelcome(); clearScreenForLoading(); var searchFieldNumber = returnFieldNumberForIndex(index); var tempString = ''; if (invalue != ''){ eval ('tempString = key_array_'+searchFieldNumber+'['+invalue+']'); } document.getElementById('qb_fld'+index).value = tempString; if (appType == 1){ window.location = '#'+index; } /* Ugly HACK */ result_count = 1; qbAjax('sendStopLoad()'); buildValuesString(index, invalue); welcomeCheck(); } var current_searched_values_array = new Array('','','','','','',''); function returnSearchCount(){ var returnCount = 0; for (i in current_searched_values_array){ if (current_searched_values_array[i] != returnCount && current_searched_values_array[i] != undefined){ ++returnCount; } } return returnCount } function buildValuesString(index, invalue){ var searchFieldNumber = returnFieldNumberForIndex(index); var tempString = ''; if (invalue != ''){ eval ('tempString = key_'+searchFieldNumber+'_short_name['+invalue+']'); } current_searched_values_array[index] = tempString; var returnString = ''; var targetDiv = document.getElementById('rg_search_path_inner_div'); var comma = ''; for (i in current_searched_values_array){ if (current_searched_values_array[i].length > 0){ returnString += comma + current_searched_values_array[i]; if (comma == ''){ comma = ' · '; } } } targetDiv.innerHTML = returnString; } function selectDropDown(inVal, inIndex){ if (appType == 2){ var dd_index = returnFieldNumForText(inIndex, inVal); document.getElementById('ttmd_rg_selector_'+inIndex).selectedIndex = dd_index; buildValuesString(inIndex, dd_index); } } function clear_main_fields(){ for (var i = 0; i <= 6; ++i){ document.getElementById('qb_fld'+i).value = ''; } } function clear_title_author(){ document.getElementById('qb_fld7').value = ''; document.getElementById('qb_fld8').value = ''; }function sendSearch(fld,val){ current_searched_values_array[fld] = val; rgAjax(fld,val); } function clear_dropdown(catNumber){ if (document.getElementById('ttmd_rg_selector_'+catNumber).selectedIndex > 0){ document.getElementById('ttmd_rg_selector_'+catNumber).selectedIndex = 0; document.getElementById('qb_prod_details').style.display = 'none'; document.getElementById('non_gray_sort').style.display = 'none'; document.getElementById('qbFrame').style.display = 'block'; sendSearch(catNumber,''); } } function clear_all_dropdowns(){document.getElementById('ttmd_rg_selector_'+0).selectedIndex = 0;document.getElementById('qb_fld'+0).value = '';document.getElementById('ttmd_rg_selector_'+1).selectedIndex = 0;document.getElementById('qb_fld'+1).value = '';document.getElementById('ttmd_rg_selector_'+2).selectedIndex = 0;document.getElementById('qb_fld'+2).value = '';document.getElementById('ttmd_rg_selector_'+3).selectedIndex = 0;document.getElementById('qb_fld'+3).value = '';document.getElementById('ttmd_rg_selector_'+4).selectedIndex = 0;document.getElementById('qb_fld'+4).value = '';document.getElementById('ttmd_rg_selector_'+5).selectedIndex = 0;document.getElementById('qb_fld'+5).value = '';document.getElementById('ttmd_rg_selector_'+6).selectedIndex = 0;document.getElementById('qb_fld'+6).value = '';document.getElementById('qb_prod_details').style.display = 'none'; document.getElementById('non_gray_sort').style.display = 'none'; document.getElementById('qbFrame').style.display = 'block'; storeWelcome(); clearScreenForLoading(); current_searched_values_array = new Array(); document.getElementById('rg_search_path_inner_div').innerHTML = ''; welcomeCheck(); }var dropdown_0 = "
X

";document.write("
Age & Grade
" + dropdown_0); var dropdown_1 = "
X

";document.write("
Subject
" + dropdown_1); var dropdown_2 = "
X

";document.write("
Genre
" + dropdown_2); var dropdown_3 = "
X

";document.write("
Animal Protagonist
" + dropdown_3); var dropdown_4 = "
X

";document.write("
Emotions & Issues
" + dropdown_4); var dropdown_5 = "
X

";document.write("
Values
" + dropdown_5); var dropdown_6 = "
X

";document.write("
Recommendation
" + dropdown_6); document.write('
 
');document.write('
');