
function preg_quote(str) {
	return (str + '').replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g,
			"\\$1");
}

function buildTopicsMenu() {
	var topics = {
		"Science/Math" : [ {
			"n" : "Math",
			"d" : 0
		}, {
			"n" : "Algebra",
			"d" : 1
		}, {
			"n" : "Elementary Math",
			"d" : 1
		}, {
			"n" : "Fractions",
			"d" : 1
		}, {
			"n" : "Geometry",
			"d" : 1
		}, {
			"n" : "Measurement",
			"d" : 1
		}, {
			"n" : "Money",
			"d" : 1
		}, {
			"n" : "Science",
			"d" : 0
		}, {
			"n" : "Astronomy/ Space",
			"d" : 1
		}, {
			"n" : "Meteors & Asteroids",
			"d" : 2
		}, {
			"n" : "Planets",
			"d" : 2
		}, {
			"n" : "Solar System",
			"d" : 2
		}, {
			"n" : "Space Exploration",
			"d" : 2
		}, {
			"n" : "Stars",
			"d" : 2
		}, {
			"n" : "Sun",
			"d" : 2
		}, {
			"n" : "Universe",
			"d" : 2
		}, {
			"n" : "Earth Science",
			"d" : 1
		}, {
			"n" : "Earth",
			"d" : 2
		}, {
			"n" : "Environmental Science/ Ecology",
			"d" : 2
		}, {
			"n" : "Global Warming",
			"d" : 3
		}, {
			"n" : "Greenhouse Effect",
			"d" : 3
		}, {
			"n" : "Pollution",
			"d" : 3
		}, {
			"n" : "Recycle/ Reduce/ Reuse",
			"d" : 3
		}, {
			"n" : "Fossils & Dinosaurs",
			"d" : 2
		}, {
			"n" : "Landforms",
			"d" : 2
		}, {
			"n" : "Rocks & Minerals",
			"d" : 2
		}, {
			"n" : "Seasons",
			"d" : 2
		}, {
			"n" : "Soil",
			"d" : 2
		}, {
			"n" : "Water",
			"d" : 2
		}, {
			"n" : "Bodies of Water",
			"d" : 3
		}, {
			"n" : "Water cycle",
			"d" : 3
		}, {
			"n" : "Weather",
			"d" : 2
		}, {
			"n" : "Clouds",
			"d" : 3
		}, {
			"n" : "Droughts",
			"d" : 3
		}, {
			"n" : "General",
			"d" : 3
		}, {
			"n" : "Natural Disasters",
			"d" : 3
		}, {
			"n" : "Precipitation",
			"d" : 3
		}, {
			"n" : "Storms",
			"d" : 3
		}, {
			"n" : "Sun",
			"d" : 3
		}, {
			"n" : "Temperature",
			"d" : 3
		}, {
			"n" : "Wind",
			"d" : 3
		}, {
			"n" : "Health & Human Body",
			"d" : 1
		}, {
			"n" : "Body Systems",
			"d" : 2
		}, {
			"n" : "Circulatory",
			"d" : 3
		}, {
			"n" : "Digestive",
			"d" : 3
		}, {
			"n" : "Nervous",
			"d" : 3
		}, {
			"n" : "Respiratory",
			"d" : 3
		}, {
			"n" : "Sensory",
			"d" : 3
		}, {
			"n" : "Skeletal",
			"d" : 3
		}, {
			"n" : "Cells",
			"d" : 2
		}, {
			"n" : "DNA & Genetics",
			"d" : 2
		}, {
			"n" : "Forensics/ Crime Science",
			"d" : 2
		}, {
			"n" : "Health",
			"d" : 2
		}, {
			"n" : "Development",
			"d" : 3
		}, {
			"n" : "Disease",
			"d" : 3
		}, {
			"n" : "Medicine",
			"d" : 3
		}, {
			"n" : "Nutrition",
			"d" : 3
		}, {
			"n" : "Human Body",
			"d" : 2
		}, {
			"n" : "Life Science",
			"d" : 1
		}, {
			"n" : "Animals",
			"d" : 2
		}, {
			"n" : "Adaptation",
			"d" : 3
		}, {
			"n" : "Amphibians",
			"d" : 3
		}, {
			"n" : "Babies",
			"d" : 3
		}, {
			"n" : "Birds",
			"d" : 3
		}, {
			"n" : "Camouflage",
			"d" : 3
		}, {
			"n" : "Endangered & Extinct Species",
			"d" : 3
		}, {
			"n" : "Fish",
			"d" : 3
		}, {
			"n" : "Hibernation",
			"d" : 3
		}, {
			"n" : "Insects & Spiders",
			"d" : 3
		}, {
			"n" : "Life Cycle",
			"d" : 3
		}, {
			"n" : "Mammals",
			"d" : 3
		}, {
			"n" : "Farm Animals",
			"d" : 4
		}, {
			"n" : "Pets",
			"d" : 4
		}, {
			"n" : "Cats",
			"d" : 5
		}, {
			"n" : "Dogs",
			"d" : 5
		}, {
			"n" : "Horses",
			"d" : 5
		}, {
			"n" : "Other",
			"d" : 5
		}, {
			"n" : "Wild Animals",
			"d" : 4
		}, {
			"n" : "Marine Life",
			"d" : 3
		}, {
			"n" : "Migration",
			"d" : 3
		}, {
			"n" : "Reptiles",
			"d" : 3
		}, {
			"n" : "Biomes",
			"d" : 2
		}, {
			"n" : "Evolution",
			"d" : 2
		}, {
			"n" : "Food Webs",
			"d" : 2
		}, {
			"n" : "Habitats",
			"d" : 2
		}, {
			"n" : "Botany",
			"d" : 2
		}, {
			"n" : "Life Cycle",
			"d" : 3
		}, {
			"n" : "Parts of Plants",
			"d" : 3
		}, {
			"n" : "Plants--General",
			"d" : 3
		}, {
			"n" : "Processes",
			"d" : 3
		}, {
			"n" : "Physical Science",
			"d" : 1
		}, {
			"n" : "Chemistry",
			"d" : 2
		}, {
			"n" : "Electricity",
			"d" : 2
		}, {
			"n" : "Energy",
			"d" : 2
		}, {
			"n" : "Forces & Motion",
			"d" : 2
		}, {
			"n" : "Machines",
			"d" : 2
		}, {
			"n" : "Airplanes & Other Flying Machines",
			"d" : 3
		}, {
			"n" : "Motorcycles",
			"d" : 3
		}, {
			"n" : "Simple Machines",
			"d" : 3
		}, {
			"n" : "Magnetism",
			"d" : 2
		}, {
			"n" : "Materials",
			"d" : 2
		}, {
			"n" : "Physics",
			"d" : 2
		}, {
			"n" : "Technology & Computers",
			"d" : 2
		}, {
			"n" : "Science Experiments & Projects",
			"d" : 1
		}, {
			"n" : "Scientific Method",
			"d" : 1
		}, {
			"n" : "Scientists & Inventors",
			"d" : 1
		} ],
		"Social Studies" : [ {
			"n" : "History",
			"d" : 0
		}, {
			"n" : "Canadian",
			"d" : 1
		}, {
			"n" : "U.S.",
			"d" : 1
		}, {
			"n" : "American Revolution",
			"d" : 2
		}, {
			"n" : "Civil Rights",
			"d" : 2
		}, {
			"n" : "Civil War & Reconstruction",
			"d" : 2
		}, {
			"n" : "Colonial Times",
			"d" : 2
		}, {
			"n" : "Frontier & Pioneer Life",
			"d" : 2
		}, {
			"n" : "Great Depression",
			"d" : 2
		}, {
			"n" : "Immigration",
			"d" : 2
		}, {
			"n" : "Missions",
			"d" : 2
		}, {
			"n" : "Other",
			"d" : 2
		}, {
			"n" : "18th Century & Earlier",
			"d" : 2
		}, {
			"n" : "19th Century",
			"d" : 2
		}, {
			"n" : "20th Century",
			"d" : 2
		}, {
			"n" : "World",
			"d" : 1
		}, {
			"n" : "Ancient Civilizations",
			"d" : 2
		}, {
			"n" : "Egypt",
			"d" : 3
		}, {
			"n" : "Other",
			"d" : 3
		}, {
			"n" : "Exploration & Discovery",
			"d" : 2
		}, {
			"n" : "Holocaust",
			"d" : 2
		}, {
			"n" : "Wars",
			"d" : 2
		}, {
			"n" : "Korean War",
			"d" : 3
		}, {
			"n" : "Vietnam War",
			"d" : 3
		}, {
			"n" : "World War I",
			"d" : 3
		}, {
			"n" : "World War II",
			"d" : 3
		}, {
			"n" : "18th Century & Earlier",
			"d" : 2
		}, {
			"n" : "19th Century",
			"d" : 2
		}, {
			"n" : "Social Issues",
			"d" : 0
		}, {
			"n" : "Societal Issues",
			"d" : 1
		}, {
			"n" : "Bullying",
			"d" : 2
		}, {
			"n" : "Homelessness",
			"d" : 2
		}, {
			"n" : "Suicide",
			"d" : 2
		}, {
			"n" : "World Issues",
			"d" : 1
		}, {
			"n" : "Genocide",
			"d" : 2
		}, {
			"n" : "Global Warming & Recycling",
			"d" : 2
		}, {
			"n" : "Immigration",
			"d" : 2
		}, {
			"n" : "Terrorism",
			"d" : 2
		}, {
			"n" : "Social Studies",
			"d" : 0
		}, {
			"n" : "Biographies",
			"d" : 1
		}, {
			"n" : "Historical Figures",
			"d" : 2
		}, {
			"n" : "American",
			"d" : 3
		}, {
			"n" : "Political Figures",
			"d" : 2
		}, {
			"n" : "American",
			"d" : 3
		}, {
			"n" : "World",
			"d" : 3
		}, {
			"n" : "Presidents & Their Families",
			"d" : 2
		}, {
			"n" : "Character Education",
			"d" : 1
		}, {
			"n" : "Anger/ Self-Control",
			"d" : 2
		}, {
			"n" : "Bullying/ Fairness",
			"d" : 2
		}, {
			"n" : "Compassion/ Caring/ Kindness/ Generosity/ Helpfulness",
			"d" : 2
		}, {
			"n" : "Courage/ Determination/ Fortitude",
			"d" : 2
		}, {
			"n" : "Honesty/ Integrity/ Trustworthiness",
			"d" : 2
		}, {
			"n" : "Patriotism/ Citizenship",
			"d" : 2
		}, {
			"n" : "Responsibility/ Dependability/ Reliability",
			"d" : 2
		}, {
			"n" : "Civics",
			"d" : 1
		}, {
			"n" : "Government",
			"d" : 2
		}, {
			"n" : "U.S.",
			"d" : 3
		}, {
			"n" : "General",
			"d" : 4
		}, {
			"n" : "Judicial Branch",
			"d" : 4
		}, {
			"n" : "World",
			"d" : 3
		}, {
			"n" : "Military",
			"d" : 2
		}, {
			"n" : "Community",
			"d" : 1
		}, {
			"n" : "Daily Life",
			"d" : 2
		}, {
			"n" : "Geography",
			"d" : 1
		}, {
			"n" : "Canada",
			"d" : 2
		}, {
			"n" : "Continents",
			"d" : 2
		}, {
			"n" : "Countries",
			"d" : 2
		}, {
			"n" : "Maps & Mapreading",
			"d" : 2
		}, {
			"n" : "States",
			"d" : 2
		}, {
			"n" : "California",
			"d" : 3
		}, {
			"n" : "History",
			"d" : 1
		}, {
			"n" : "Canadian",
			"d" : 2
		}, {
			"n" : "U.S.",
			"d" : 2
		}, {
			"n" : "American Revolution",
			"d" : 3
		}, {
			"n" : "Civil Rights",
			"d" : 3
		}, {
			"n" : "Civil War & Reconstruction",
			"d" : 3
		}, {
			"n" : "Colonial Times",
			"d" : 3
		}, {
			"n" : "Frontier & Pioneer Life",
			"d" : 3
		}, {
			"n" : "Great Depression",
			"d" : 3
		}, {
			"n" : "Immigration",
			"d" : 3
		}, {
			"n" : "Missions",
			"d" : 3
		}, {
			"n" : "Other",
			"d" : 3
		}, {
			"n" : "18th Century & Earlier",
			"d" : 3
		}, {
			"n" : "19th Century",
			"d" : 3
		}, {
			"n" : "20th Century",
			"d" : 3
		}, {
			"n" : "World",
			"d" : 2
		}, {
			"n" : "Ancient Civilizations",
			"d" : 3
		}, {
			"n" : "Egypt",
			"d" : 4
		}, {
			"n" : "Other",
			"d" : 4
		}, {
			"n" : "Exploration & Discovery",
			"d" : 3
		}, {
			"n" : "Holocaust",
			"d" : 3
		}, {
			"n" : "Wars",
			"d" : 3
		}, {
			"n" : "Korean War",
			"d" : 4
		}, {
			"n" : "Vietnam War",
			"d" : 4
		}, {
			"n" : "World War I",
			"d" : 4
		}, {
			"n" : "World War II",
			"d" : 4
		}, {
			"n" : "18th Century & Earlier",
			"d" : 3
		}, {
			"n" : "19th Century",
			"d" : 3
		}, {
			"n" : "Religion",
			"d" : 1
		}, {
			"n" : "Christianity",
			"d" : 2
		}, {
			"n" : "Hinduism",
			"d" : 2
		}, {
			"n" : "Judaism",
			"d" : 2
		}, {
			"n" : "Social Issues",
			"d" : 1
		}, {
			"n" : "Societal Issues",
			"d" : 2
		}, {
			"n" : "Bullying",
			"d" : 3
		}, {
			"n" : "Homelessness",
			"d" : 3
		}, {
			"n" : "Suicide",
			"d" : 3
		}, {
			"n" : "World Issues",
			"d" : 2
		}, {
			"n" : "Genocide",
			"d" : 3
		}, {
			"n" : "Global Warming & Recycling",
			"d" : 3
		}, {
			"n" : "Immigration",
			"d" : 3
		}, {
			"n" : "Terrorism",
			"d" : 3
		} ],
		"Language Arts" : [ {
			"n" : "Language Arts",
			"d" : 0
		}, {
			"n" : "Authors",
			"d" : 1
		}, {
			"n" : "Contemporary",
			"d" : 2
		}, {
			"n" : "Classics",
			"d" : 1
		}, {
			"n" : "College Prep",
			"d" : 1
		}, {
			"n" : "Advanced Placement",
			"d" : 2
		}, {
			"n" : "College Admissions",
			"d" : 2
		}, {
			"n" : "Selecting A College",
			"d" : 2
		}, {
			"n" : "SAT Test Prep",
			"d" : 2
		}, {
			"n" : "Drama",
			"d" : 1
		}, {
			"n" : "Essays",
			"d" : 1
		}, {
			"n" : "Folklore/ Fairy Tales",
			"d" : 1
		}, {
			"n" : "Fables",
			"d" : 2
		}, {
			"n" : "Fairy Tales",
			"d" : 2
		}, {
			"n" : "Folklore",
			"d" : 2
		}, {
			"n" : "Africa",
			"d" : 3
		}, {
			"n" : "African American",
			"d" : 3
		}, {
			"n" : "Anthologies",
			"d" : 3
		}, {
			"n" : "Asia",
			"d" : 3
		}, {
			"n" : "Caribbean",
			"d" : 3
		}, {
			"n" : "Europe",
			"d" : 3
		}, {
			"n" : "Mexico",
			"d" : 3
		}, {
			"n" : "Middle East",
			"d" : 3
		}, {
			"n" : "Native American",
			"d" : 3
		}, {
			"n" : "Russia",
			"d" : 3
		}, {
			"n" : "United States",
			"d" : 3
		}, {
			"n" : "Fractured Fairy Tales",
			"d" : 2
		}, {
			"n" : "Tall Tales",
			"d" : 2
		}, {
			"n" : "Grammar",
			"d" : 1
		}, {
			"n" : "Literary Criticism",
			"d" : 1
		}, {
			"n" : "Mythology",
			"d" : 1
		}, {
			"n" : "Poetry",
			"d" : 1
		}, {
			"n" : "African American",
			"d" : 2
		}, {
			"n" : "Animals",
			"d" : 2
		}, {
			"n" : "Family",
			"d" : 2
		}, {
			"n" : "Hispanic/ Hispanic Americans",
			"d" : 2
		}, {
			"n" : "Historical",
			"d" : 2
		}, {
			"n" : "Holidays",
			"d" : 2
		}, {
			"n" : "Humorous",
			"d" : 2
		}, {
			"n" : "Native American",
			"d" : 2
		}, {
			"n" : "Nature",
			"d" : 2
		}, {
			"n" : "School",
			"d" : 2
		}, {
			"n" : "Research",
			"d" : 1
		}, {
			"n" : "Shakespeare",
			"d" : 1
		}, {
			"n" : "Short Stories",
			"d" : 1
		}, {
			"n" : "Speeches",
			"d" : 1
		}, {
			"n" : "Writing/ Composition",
			"d" : 1
		} ],
		"Character Ed" : [ {
			"n" : "Character Education",
			"d" : 0
		}, {
			"n" : "Anger/ Self-Control",
			"d" : 1
		}, {
			"n" : "Bullying/ Fairness",
			"d" : 1
		}, {
			"n" : "Compassion/ Caring/ Kindness/ Generosity/ Helpfulness",
			"d" : 1
		}, {
			"n" : "Courage/ Determination/ Fortitude",
			"d" : 1
		}, {
			"n" : "Honesty/ Integrity/ Trustworthiness",
			"d" : 1
		}, {
			"n" : "Patriotism/ Citizenship",
			"d" : 1
		}, {
			"n" : "Responsibility/ Dependability/ Reliability",
			"d" : 1
		} ],
		"Biographies" : [ {
			"n" : "Biographies",
			"d" : 0
		}, {
			"n" : "Artists",
			"d" : 1
		}, {
			"n" : "Authors",
			"d" : 1
		}, {
			"n" : "Contemporary",
			"d" : 2
		}, {
			"n" : "Entertainers",
			"d" : 1
		}, {
			"n" : "American",
			"d" : 2
		}, {
			"n" : "Explorers",
			"d" : 1
		}, {
			"n" : "Firsts In Their Field",
			"d" : 1
		}, {
			"n" : "American",
			"d" : 2
		}, {
			"n" : "Historical Figures",
			"d" : 1
		}, {
			"n" : "American",
			"d" : 2
		}, {
			"n" : "Multicultural",
			"d" : 1
		}, {
			"n" : "African American",
			"d" : 2
		}, {
			"n" : "Asian American",
			"d" : 2
		}, {
			"n" : "Hispanic/ Latino",
			"d" : 2
		}, {
			"n" : "Musicians",
			"d" : 1
		}, {
			"n" : "Overcoming The Odds",
			"d" : 1
		}, {
			"n" : "Political Figures",
			"d" : 1
		}, {
			"n" : "American",
			"d" : 2
		}, {
			"n" : "World",
			"d" : 2
		}, {
			"n" : "Presidents & Their Families",
			"d" : 1
		}, {
			"n" : "Scientists & Inventors",
			"d" : 1
		}, {
			"n" : "Athletes/ Sports Figures",
			"d" : 1
		}, {
			"n" : "Women",
			"d" : 1
		} ],
		"Fiction" : [ {
			"n" : "Fiction",
			"d" : 0
		}, {
			"n" : "Adventure",
			"d" : 1
		}, {
			"n" : "Angels",
			"d" : 1
		}, {
			"n" : "Animals",
			"d" : 1
		}, {
			"n" : "Animal Sounds",
			"d" : 2
		}, {
			"n" : "Bats",
			"d" : 2
		}, {
			"n" : "Bears",
			"d" : 2
		}, {
			"n" : "Birds",
			"d" : 2
		}, {
			"n" : "Cats",
			"d" : 2
		}, {
			"n" : "Chickens",
			"d" : 2
		}, {
			"n" : "Dinosaurs",
			"d" : 2
		}, {
			"n" : "Dogs",
			"d" : 2
		}, {
			"n" : "Ducks & Geese",
			"d" : 2
		}, {
			"n" : "Elephants",
			"d" : 2
		}, {
			"n" : "Farm Animals",
			"d" : 2
		}, {
			"n" : "Fishes & Fishing",
			"d" : 2
		}, {
			"n" : "Foxes",
			"d" : 2
		}, {
			"n" : "Frogs & Toads",
			"d" : 2
		}, {
			"n" : "Horses",
			"d" : 2
		}, {
			"n" : "Insects",
			"d" : 2
		}, {
			"n" : "Lions & Tigers",
			"d" : 2
		}, {
			"n" : "Marine Animals",
			"d" : 2
		}, {
			"n" : "Mice",
			"d" : 2
		}, {
			"n" : "Monkeys, Apes, & Gorillas",
			"d" : 2
		}, {
			"n" : "Pigs",
			"d" : 2
		}, {
			"n" : "Rabbits",
			"d" : 2
		}, {
			"n" : "Sheep",
			"d" : 2
		}, {
			"n" : "Snakes",
			"d" : 2
		}, {
			"n" : "Turtles",
			"d" : 2
		}, {
			"n" : "Wolves",
			"d" : 2
		}, {
			"n" : "Zoos",
			"d" : 2
		}, {
			"n" : "Bedtime",
			"d" : 1
		}, {
			"n" : "Behavior",
			"d" : 1
		}, {
			"n" : "Careers",
			"d" : 1
		}, {
			"n" : "Firemen",
			"d" : 2
		}, {
			"n" : "Childhood",
			"d" : 1
		}, {
			"n" : "Christian Fiction",
			"d" : 1
		}, {
			"n" : "Circus",
			"d" : 1
		}, {
			"n" : "City & Town Life",
			"d" : 1
		}, {
			"n" : "Cleanliness",
			"d" : 1
		}, {
			"n" : "Clothing & Dress",
			"d" : 1
		}, {
			"n" : "Coming Of Age",
			"d" : 1
		}, {
			"n" : "Computers & The Internet",
			"d" : 1
		}, {
			"n" : "Country Life",
			"d" : 1
		}, {
			"n" : "Cowboys & Ranch Life",
			"d" : 1
		}, {
			"n" : "Death & Grief",
			"d" : 1
		}, {
			"n" : "Disabilities & Illness",
			"d" : 1
		}, {
			"n" : "Dragons",
			"d" : 1
		}, {
			"n" : "Dreams",
			"d" : 1
		}, {
			"n" : "Family",
			"d" : 1
		}, {
			"n" : "Adoption",
			"d" : 2
		}, {
			"n" : "Animal Characters In Family Stories",
			"d" : 2
		}, {
			"n" : "Babies",
			"d" : 2
		}, {
			"n" : "Divorce & Stepfamilies",
			"d" : 2
		}, {
			"n" : "Family Life",
			"d" : 2
		}, {
			"n" : "Grandparents",
			"d" : 2
		}, {
			"n" : "Orphans",
			"d" : 2
		}, {
			"n" : "Parent-Child Relationship",
			"d" : 2
		}, {
			"n" : "Relatives",
			"d" : 2
		}, {
			"n" : "Siblings",
			"d" : 2
		}, {
			"n" : "Surrogate Families",
			"d" : 2
		}, {
			"n" : "Fantasy",
			"d" : 1
		}, {
			"n" : "Farm Life",
			"d" : 1
		}, {
			"n" : "Feelings & Emotions",
			"d" : 1
		}, {
			"n" : "Fiction Based On Myths, Bible, Fairy Tales & Books",
			"d" : 1
		}, {
			"n" : "Food",
			"d" : 1
		}, {
			"n" : "Friendship",
			"d" : 1
		}, {
			"n" : "Gardening",
			"d" : 1
		}, {
			"n" : "Ghosts",
			"d" : 1
		}, {
			"n" : "Growing Up",
			"d" : 1
		}, {
			"n" : "Health & Hygiene",
			"d" : 1
		}, {
			"n" : "Historical Fiction",
			"d" : 1
		}, {
			"n" : "Civil Rights",
			"d" : 2
		}, {
			"n" : "Civil War",
			"d" : 2
		}, {
			"n" : "Frontier & Pioneer Life",
			"d" : 2
		}, {
			"n" : "Great Britain: 18th Century & Earlier",
			"d" : 2
		}, {
			"n" : "Great Britain: 19th Century",
			"d" : 2
		}, {
			"n" : "Great Britain: 20th Century",
			"d" : 2
		}, {
			"n" : "Great Depression",
			"d" : 2
		}, {
			"n" : "Holocaust",
			"d" : 2
		}, {
			"n" : "Immigrants",
			"d" : 2
		}, {
			"n" : "Revolutionary War",
			"d" : 2
		}, {
			"n" : "Slavery",
			"d" : 2
		}, {
			"n" : "United States: 18th Century & Earlier",
			"d" : 2
		}, {
			"n" : "United States: 19th Century",
			"d" : 2
		}, {
			"n" : "United States: 20th Century",
			"d" : 2
		}, {
			"n" : "Vietnam War",
			"d" : 2
		}, {
			"n" : "World War I",
			"d" : 2
		}, {
			"n" : "World War II",
			"d" : 2
		}, {
			"n" : "World: 18th Century & Earlier",
			"d" : 2
		}, {
			"n" : "World: 19th Century",
			"d" : 2
		}, {
			"n" : "World: 20th Century",
			"d" : 2
		}, {
			"n" : "Holidays & Celebrations",
			"d" : 1
		}, {
			"n" : "Birthdays",
			"d" : 2
		}, {
			"n" : "Christmas",
			"d" : 2
		}, {
			"n" : "Easter",
			"d" : 2
		}, {
			"n" : "Halloween",
			"d" : 2
		}, {
			"n" : "Jewish Holidays",
			"d" : 2
		}, {
			"n" : "Thanksgiving",
			"d" : 2
		}, {
			"n" : "Valentine's Day",
			"d" : 2
		}, {
			"n" : "4th Of July",
			"d" : 2
		}, {
			"n" : "Horror",
			"d" : 1
		}, {
			"n" : "Humorous Fiction",
			"d" : 1
		}, {
			"n" : "Identity",
			"d" : 1
		}, {
			"n" : "Imaginary Friends",
			"d" : 1
		}, {
			"n" : "Imagination",
			"d" : 1
		}, {
			"n" : "Individuality",
			"d" : 1
		}, {
			"n" : "Lost Children",
			"d" : 1
		}, {
			"n" : "Magic",
			"d" : 1
		}, {
			"n" : "Monsters",
			"d" : 1
		}, {
			"n" : "Moving",
			"d" : 1
		}, {
			"n" : "Mystery",
			"d" : 1
		}, {
			"n" : "Nature & Ecology",
			"d" : 1
		}, {
			"n" : "Neighbors",
			"d" : 1
		}, {
			"n" : "Night",
			"d" : 1
		}, {
			"n" : "Novels In Verse",
			"d" : 1
		}, {
			"n" : "Fine Arts",
			"d" : 1
		}, {
			"n" : "Acting & Theater",
			"d" : 2
		}, {
			"n" : "Art",
			"d" : 2
		}, {
			"n" : "Dance",
			"d" : 2
		}, {
			"n" : "Picnics",
			"d" : 1
		}, {
			"n" : "Pirates",
			"d" : 1
		}, {
			"n" : "Princes & Princesses",
			"d" : 1
		}, {
			"n" : "Reading & Writing",
			"d" : 1
		}, {
			"n" : "Romance",
			"d" : 1
		}, {
			"n" : "Safety",
			"d" : 1
		}, {
			"n" : "School",
			"d" : 1
		}, {
			"n" : "First Day Of School",
			"d" : 2
		}, {
			"n" : "Libraries",
			"d" : 2
		}, {
			"n" : "School Adventures",
			"d" : 2
		}, {
			"n" : "Show & Tell",
			"d" : 2
		}, {
			"n" : "Teachers",
			"d" : 2
		}, {
			"n" : "Science Fiction",
			"d" : 1
		}, {
			"n" : "Seashore",
			"d" : 1
		}, {
			"n" : "Seasons",
			"d" : 1
		}, {
			"n" : "Autumn",
			"d" : 2
		}, {
			"n" : "Spring",
			"d" : 2
		}, {
			"n" : "Summer",
			"d" : 2
		}, {
			"n" : "Winter",
			"d" : 2
		}, {
			"n" : "Self-Acceptance",
			"d" : 1
		}, {
			"n" : "Self-Discovery",
			"d" : 1
		}, {
			"n" : "Self-Esteem",
			"d" : 1
		}, {
			"n" : "Social Issues",
			"d" : 1
		}, {
			"n" : "AIDS",
			"d" : 2
		}, {
			"n" : "Bullying",
			"d" : 2
		}, {
			"n" : "Crime & Violence",
			"d" : 2
		}, {
			"n" : "Eating Disorders",
			"d" : 2
		}, {
			"n" : "Ecology & Environment",
			"d" : 2
		}, {
			"n" : "Elections",
			"d" : 2
		}, {
			"n" : "Gangs",
			"d" : 2
		}, {
			"n" : "Gays & Lesbians",
			"d" : 2
		}, {
			"n" : "Homelessness",
			"d" : 2
		}, {
			"n" : "Mental & Emotional Issues",
			"d" : 2
		}, {
			"n" : "Racism & Prejudice",
			"d" : 2
		}, {
			"n" : "Rape & Abuse",
			"d" : 2
		}, {
			"n" : "Runaways",
			"d" : 2
		}, {
			"n" : "Suicide",
			"d" : 2
		}, {
			"n" : "Teenage Pregnancy",
			"d" : 2
		}, {
			"n" : "Terrorism",
			"d" : 2
		}, {
			"n" : "Sports",
			"d" : 1
		}, {
			"n" : "Auto Racing",
			"d" : 2
		}, {
			"n" : "Baseball & Softball",
			"d" : 2
		}, {
			"n" : "Basketball",
			"d" : 2
		}, {
			"n" : "Bikes & Bicycling",
			"d" : 2
		}, {
			"n" : "Cheerleading",
			"d" : 2
		}, {
			"n" : "Football",
			"d" : 2
		}, {
			"n" : "Hockey",
			"d" : 2
		}, {
			"n" : "Martial Arts",
			"d" : 2
		}, {
			"n" : "Skateboard",
			"d" : 2
		}, {
			"n" : "Soccer",
			"d" : 2
		}, {
			"n" : "Wrestling",
			"d" : 2
		}, {
			"n" : "Supernatural",
			"d" : 1
		}, {
			"n" : "Survival",
			"d" : 1
		}, {
			"n" : "Teddy Bears",
			"d" : 1
		}, {
			"n" : "Time Travel",
			"d" : 1
		}, {
			"n" : "Tooth Fairies",
			"d" : 1
		}, {
			"n" : "Toys",
			"d" : 1
		}, {
			"n" : "Transportation & Machines",
			"d" : 1
		}, {
			"n" : "Boats & Boating",
			"d" : 2
		}, {
			"n" : "Machinery",
			"d" : 2
		}, {
			"n" : "Trains",
			"d" : 2
		}, {
			"n" : "Transportation",
			"d" : 2
		}, {
			"n" : "Travel & Vacation",
			"d" : 1
		}, {
			"n" : "Urban",
			"d" : 1
		}, {
			"n" : "Vampires",
			"d" : 1
		}, {
			"n" : "Weather",
			"d" : 1
		}, {
			"n" : "Weddings",
			"d" : 1
		}, {
			"n" : "Western",
			"d" : 1
		}, {
			"n" : "Witches",
			"d" : 1
		}, {
			"n" : "Women",
			"d" : 1
		} ],
		"Early Literacy" : [ {
			"n" : "Early Literacy",
			"d" : 0
		}, {
			"n" : "Alphabet",
			"d" : 1
		}, {
			"n" : "Blends",
			"d" : 1
		}, {
			"n" : "Colors",
			"d" : 1
		}, {
			"n" : "Consonants",
			"d" : 1
		}, {
			"n" : "Counting",
			"d" : 1
		}, {
			"n" : "Counting Backwards",
			"d" : 1
		}, {
			"n" : "Nursery Rhymes",
			"d" : 1
		}, {
			"n" : "Opposites",
			"d" : 1
		}, {
			"n" : "Phonics",
			"d" : 1
		}, {
			"n" : "Sight Words",
			"d" : 1
		}, {
			"n" : "Size/ Shape",
			"d" : 1
		}, {
			"n" : "Vowels & Vowel Sounds",
			"d" : 1
		}, {
			"n" : "Wordless",
			"d" : 1
		} ],
		"More" : [ {
			"n" : "College Prep",
			"d" : 0
		}, {
			"n" : "Advanced Placement",
			"d" : 1
		}, {
			"n" : "College Admissions",
			"d" : 1
		}, {
			"n" : "Selecting A College",
			"d" : 1
		}, {
			"n" : "SAT Test Prep",
			"d" : 1
		}, {
			"n" : "Fine Arts",
			"d" : 0
		}, {
			"n" : "Art",
			"d" : 1
		}, {
			"n" : "Artists",
			"d" : 1
		}, {
			"n" : "Crafts",
			"d" : 1
		}, {
			"n" : "Drawing/ Painting",
			"d" : 1
		}, {
			"n" : "Music",
			"d" : 1
		}, {
			"n" : "Photography",
			"d" : 1
		}, {
			"n" : "Holidays & Celebrations",
			"d" : 0
		}, {
			"n" : "Birthdays",
			"d" : 1
		}, {
			"n" : "Christmas",
			"d" : 1
		}, {
			"n" : "Earth Day",
			"d" : 1
		}, {
			"n" : "Easter",
			"d" : 1
		}, {
			"n" : "Halloween",
			"d" : 1
		}, {
			"n" : "Multicultural",
			"d" : 1
		}, {
			"n" : "African American",
			"d" : 2
		}, {
			"n" : "Jewish",
			"d" : 2
		}, {
			"n" : "Patriotic",
			"d" : 1
		}, {
			"n" : "Thanksgiving",
			"d" : 1
		}, {
			"n" : "Valentine's Day",
			"d" : 1
		}, {
			"n" : "100th Day Of School",
			"d" : 1
		}, {
			"n" : "Humor",
			"d" : 0
		}, {
			"n" : "Comic Book Compilations",
			"d" : 1
		}, {
			"n" : "Jokes & Riddles",
			"d" : 1
		}, {
			"n" : "Professional",
			"d" : 0
		}, {
			"n" : "Activity",
			"d" : 1
		}, {
			"n" : "Book Selection",
			"d" : 1
		}, {
			"n" : "Comprehension",
			"d" : 1
		}, {
			"n" : "Early Childhood",
			"d" : 1
		}, {
			"n" : "Language Arts",
			"d" : 1
		}, {
			"n" : "Library",
			"d" : 1
		}, {
			"n" : "Math",
			"d" : 1
		}, {
			"n" : "Multicultural",
			"d" : 1
		}, {
			"n" : "Other",
			"d" : 1
		}, {
			"n" : "Reading",
			"d" : 1
		}, {
			"n" : "Science",
			"d" : 1
		}, {
			"n" : "Social Studies",
			"d" : 1
		}, {
			"n" : "Writing",
			"d" : 1
		}, {
			"n" : "Reference",
			"d" : 0
		}, {
			"n" : "Almanacs",
			"d" : 1
		}, {
			"n" : "Atlases",
			"d" : 1
		}, {
			"n" : "Dictionaries",
			"d" : 1
		}, {
			"n" : "Dictionaries by Subject",
			"d" : 1
		}, {
			"n" : "Dictionary/ Thesaurus",
			"d" : 1
		}, {
			"n" : "Encyclopedias",
			"d" : 1
		}, {
			"n" : "Encyclopedias by Subject",
			"d" : 1
		}, {
			"n" : "Foreign Language Reference",
			"d" : 1
		}, {
			"n" : "History, Geography, & Social Studies",
			"d" : 1
		}, {
			"n" : "Math",
			"d" : 1
		}, {
			"n" : "Other",
			"d" : 1
		}, {
			"n" : "Picture Dictionaries",
			"d" : 1
		}, {
			"n" : "Quotations",
			"d" : 1
		}, {
			"n" : "Science Reference",
			"d" : 1
		}, {
			"n" : "Speech Collections",
			"d" : 1
		}, {
			"n" : "Thesauri",
			"d" : 1
		}, {
			"n" : "Sports",
			"d" : 0
		}, {
			"n" : "Auto Racing",
			"d" : 1
		}, {
			"n" : "Baseball & Softball",
			"d" : 1
		}, {
			"n" : "Basketball",
			"d" : 1
		}, {
			"n" : "Bikes & Bicycling",
			"d" : 1
		}, {
			"n" : "Cheerleading",
			"d" : 1
		}, {
			"n" : "Football",
			"d" : 1
		}, {
			"n" : "Hockey",
			"d" : 1
		}, {
			"n" : "Martial Arts",
			"d" : 1
		}, {
			"n" : "Skateboard",
			"d" : 1
		}, {
			"n" : "Soccer",
			"d" : 1
		}, {
			"n" : "Wrestling",
			"d" : 1
		} ]
	}
	var topicsMenusElement = $('<div id="icatalogMenus"></div>');
	$('#topdivide').after(topicsMenusElement);
	var htmlWrite = new Array();
	for ( var parentCategory in topics) {
		var topicTree = new Array()
		htmlWrite.push('<div id="' + parentCategory.replace(/\W/g, '')
				+ '" class="icatalogMenu">');
		var categoryTopics = topics[parentCategory];
		var remainder = categoryTopics.length % 5;
		var itemsPerColumn = Math.floor(categoryTopics.length / 5);
		var k = 0;
		htmlWrite.push('<ul>');
		for ( var i = 0; i < 5; i++) {
			for ( var j = 0; k < categoryTopics.length
					&& j - (remainder > 0 ? 1 : 0) < itemsPerColumn; j++) {
				var topic = categoryTopics[k++];
				htmlWrite.push('<li class="tm' + topic.d + '">');
				while (topicTree.length > 0 && topic.d < topicTree.length) {
					topicTree.pop();
				}
				topicTree.push(topic.n);
				htmlWrite.push('<a href="' + path + '/SearchTopic/%22'
						+ topicTree.join("%22 AND %22") + '%22">' + topic.n
						+ '</a>');
				htmlWrite.push('</li>');
			}
			if (remainder > 0)
				remainder--;
			htmlWrite.push('</ul>');
			if (i < 4)
				htmlWrite.push('<ul>');
		}
		htmlWrite.push('<div class="clearer"></div></div>');
	}
	topicsMenusElement.html(htmlWrite.join(''));
	$('#headerIcatalogMenubar').find('li').each(function() {
		var listItem = $(this);
		var a = listItem.find('a').eq(0);
		var menuId = a.attr('id');
		a.removeAttr('href');
		menuId = menuId.replace('menu', '');
		var menuIdElement = $("#" + menuId);
		if (menuIdElement) {
			$("#" + menuId).hide();
			listItem.insidedrop = false;
			listItem.insidemenu = false;
			listItem.bind('mouseenter', function() {
				if (topicsClickEnabled) {
					$(this).insidemenu = true;
					$('#headerIcatalogMenubar').find('li').each(function() {
						var hideElement = $(this).find('a').eq(0).attr('id');
						hideElement = hideElement.replace('menu', '');
						$('#' + hideElement).hide();
						$(this).removeClass('Active');
					});
					$(this).addClass('Active');
					var showElement = $(this).find('a').eq(0).attr('id');
					showElement = showElement.replace('menu', '');
					$('#' + showElement).show();

				}
			});
			menuIdElement.bind('mouseleave', function() {
				if (topicsClickEnabled) {
					var hideElement = "menu" + $(this).attr('id');
					$("#" + hideElement).parent().insidedrop = false;
					$('#' + hideElement).parent().removeClass('Active');
					$(this).hide();
				}
			});
		}
	});
}
var topicsClickEnabled = false;

function loadTabs() {
	var tabContents = $('div.tabContent');
	tabContents.css({
		"display" : "none"
	});
	if (tabContents.length > 0)
		tabContents.eq(0).css({
			"display" : "block"
		});
	var firstTabFound = false;
	$('.tabsUl')
			.each(
					function() {
						$(this)
								.find('li')
								.each(
										function() {
											var href = $(this).children().eq(0)
													.attr('href');
											if (href.indexOf('#') > 0)
												href = href.substr(href
														.indexOf('#'),
														href.length - 1);
											if (href.substr(0, 1) == "#") {
												href = href.substr(1,
														href.length - 1);
												if (!firstTabFound) {
													$(this)
															.addClass(
																	"ui-tabs-selected")
															.addClass(
																	"ui-state-active");
													firstTabFound = true;
												}
												$(this)
														.click(
																function(e) {
																	$('.tabsUl')
																			.each(
																					function() {
																						$(
																								this)
																								.find(
																										'li')
																								.each(
																										function() {
																											$(
																													this)
																													.removeClass(
																															"ui-tabs-selected")
																													.removeClass(
																															"ui-state-active");
																										});
																					});
																	$(
																			'div.tabContent')
																			.each(
																					function() {
																						$(
																								this)
																								.css(
																										{
																											"display" : "none"
																										});
																					});
																	if ($('#'
																			+ href)) {
																		$(
																				'#'
																						+ href)
																				.css(
																						{
																							"display" : "block"
																						});
																		$(this)
																				.addClass(
																						"ui-tabs-selected")
																				.addClass(
																						"ui-state-active");
																	}
																	return false;
																});
											}
										});
					});
	var tabsel = window.location.hash;
	if (tabsel) {
		$('.tabsUl').each(function() {
			$(this).find('li').each(function() {
				var href = $(this).children().eq(0).attr('href');
				if (href.indexOf('#') > 0)
					href = href.substr(href.indexOf('#'), href.length - 1);
				if (href == tabsel)
					$(this).click();
			});
		});
	}
}

$(document).ready(
		function() {
			if ($('#headerIcatalogMenubar')) {
				$('#headerIcatalogMenubar').contents().find("li").click(
						function() {
							if (!topicsClickEnabled) {
								topicsClickEnabled = true;
								buildTopicsMenu();
							}
							$(this).trigger('mouseenter');
							return false;
						});
			}

			$('input.noautocomplete').removeClass("noautocomplete");

			$('a.popup').click(function() {
				var url = $(this).attr("href");

				if (url.substr(0, 1) == '/')
					window.open(url);
				else if (url.substr(0, 4) == 'http')
					window.open(url);
				else
					window.open(path + '/' + url);
				return false;
			});

			if ($(".popupPromptWindow").length > 0) {
				var e = $(".popupPromptWindow").eq(0).contents().find(
						'input[type=text]');
				if (e.length > 0)
					e[0].focus();
			}

			$("#headerQuickSearchQ").result(function(event, data, formatted) {
				$("#simpleSearchForm").submit();
			});

		});
function openMovie(name, w, h) {
	w = w || 640;
	h = h || 498;
	window.open(name, "", config = "width=" + w + ",height=" + h
			+ ",menubar=0,scrollbars=0");
}
if (typeof deconcept == "undefined") {
	var deconcept = new Object();
}
if (typeof deconcept.util == "undefined") {
	deconcept.util = new Object();
}
if (typeof deconcept.SWFObjectUtil == "undefined") {
	deconcept.SWFObjectUtil = new Object();
}
deconcept.SWFObject = function(_1, id, w, h, _5, c, _7, _8, _9, _a) {
	if (!document.getElementById) {
		return;
	}
	this.DETECT_KEY = _a ? _a : "detectflash";
	this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	if (_1) {
		this.setAttribute("swf", _1);
	}
	if (id) {
		this.setAttribute("id", id);
	}
	if (w) {
		this.setAttribute("width", w);
	}
	if (h) {
		this.setAttribute("height", h);
	}
	if (_5) {
		this.setAttribute("version", new deconcept.PlayerVersion(_5.toString()
				.split(".")));
	}
	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
	if (!window.opera && document.all && this.installedVer.major > 7) {
		deconcept.SWFObject.doPrepUnload = true;
	}
	if (c) {
		this.addParam("bgcolor", c);
	}
	var q = _7 ? _7 : "high";
	this.addParam("quality", q);
	this.setAttribute("useExpressInstall", false);
	this.setAttribute("doExpressInstall", false);
	var _c = (_8) ? _8 : window.location;
	this.setAttribute("xiRedirectUrl", _c);
	this.setAttribute("redirectUrl", "");
	if (_9) {
		this.setAttribute("redirectUrl", _9);
	}
};
deconcept.SWFObject.prototype = {
	useExpressInstall : function(_d) {
		this.xiSWFPath = !_d ? "expressinstall.swf" : _d;
		this.setAttribute("useExpressInstall", true);
	},
	setAttribute : function(_e, _f) {
		this.attributes[_e] = _f;
	},
	getAttribute : function(_10) {
		return this.attributes[_10];
	},
	addParam : function(_11, _12) {
		this.params[_11] = _12;
	},
	getParams : function() {
		return this.params;
	},
	addVariable : function(_13, _14) {
		this.variables[_13] = _14;
	},
	getVariable : function(_15) {
		return this.variables[_15];
	},
	getVariables : function() {
		return this.variables;
	},
	getVariablePairs : function() {
		var _16 = new Array();
		var key;
		var _18 = this.getVariables();
		for (key in _18) {
			_16[_16.length] = key + "=" + _18[key];
		}
		return _16;
	},
	getSWFHTML : function() {
		var _19 = "";
		if (navigator.plugins && navigator.mimeTypes
				&& navigator.mimeTypes.length) {
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "PlugIn");
				this.setAttribute("swf", this.xiSWFPath);
			}
			_19 = "<embed type=\"application/x-shockwave-flash\" src=\""
					+ this.getAttribute("swf") + "\" width=\""
					+ this.getAttribute("width") + "\" height=\""
					+ this.getAttribute("height") + "\" style=\""
					+ this.getAttribute("style") + "\"";
			_19 += " id=\"" + this.getAttribute("id") + "\" name=\""
					+ this.getAttribute("id") + "\" ";
			var _1a = this.getParams();
			for ( var key in _1a) {
				_19 += [ key ] + "=\"" + _1a[key] + "\" ";
			}
			var _1c = this.getVariablePairs().join("&");
			if (_1c.length > 0) {
				_19 += "flashvars=\"" + _1c + "\"";
			}
			_19 += "/>";
		} else {
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "ActiveX");
				this.setAttribute("swf", this.xiSWFPath);
			}
			_19 = "<object id=\""
					+ this.getAttribute("id")
					+ "\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""
					+ this.getAttribute("width") + "\" height=\""
					+ this.getAttribute("height") + "\" style=\""
					+ this.getAttribute("style") + "\">";
			_19 += "<param name=\"movie\" value=\"" + this.getAttribute("swf")
					+ "\" />";
			var _1d = this.getParams();
			for ( var key in _1d) {
				_19 += "<param name=\"" + key + "\" value=\"" + _1d[key]
						+ "\" />";
			}
			var _1f = this.getVariablePairs().join("&");
			if (_1f.length > 0) {
				_19 += "<param name=\"flashvars\" value=\"" + _1f + "\" />";
			}
			_19 += "</object>";
		}
		return _19;
	},
	write : function(_20) {
		if (this.getAttribute("useExpressInstall")) {
			var _21 = new deconcept.PlayerVersion([ 6, 0, 65 ]);
			if (this.installedVer.versionIsValid(_21)
					&& !this.installedVer.versionIsValid(this
							.getAttribute("version"))) {
				this.setAttribute("doExpressInstall", true);
				this.addVariable("MMredirectURL", escape(this
						.getAttribute("xiRedirectUrl")));
				document.title = document.title.slice(0, 47)
						+ " - Flash Player Installation";
				this.addVariable("MMdoctitle", document.title);
			}
		}
		if (this.skipDetect
				|| this.getAttribute("doExpressInstall")
				|| this.installedVer.versionIsValid(this
						.getAttribute("version"))) {
			var n = (typeof _20 == "string") ? document.getElementById(_20)
					: _20;
			n.innerHTML = this.getSWFHTML();
			return true;
		} else {
			if (this.getAttribute("redirectUrl") != "") {
				document.location.replace(this.getAttribute("redirectUrl"));
			}
		}
		return false;
	}
};
deconcept.SWFObjectUtil.getPlayerVersion = function() {
	var _23 = new deconcept.PlayerVersion([ 0, 0, 0 ]);
	if (navigator.plugins && navigator.mimeTypes.length) {
		var x = navigator.plugins["Shockwave Flash"];
		if (x && x.description) {
			_23 = new deconcept.PlayerVersion(x.description.replace(
					/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".")
					.split("."));
		}
	} else {
		if (navigator.userAgent
				&& navigator.userAgent.indexOf("Windows CE") >= 0) {
			var axo = 1;
			var _26 = 3;
			while (axo) {
				try {
					_26++;
					axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."
							+ _26);
					_23 = new deconcept.PlayerVersion([ _26, 0, 0 ]);
				} catch (e) {
					axo = null;
				}
			}
		} else {
			try {
				var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
			} catch (e) {
				try {
					var axo = new ActiveXObject(
							"ShockwaveFlash.ShockwaveFlash.6");
					_23 = new deconcept.PlayerVersion([ 6, 0, 21 ]);
					axo.AllowScriptAccess = "always";
				} catch (e) {
					if (_23.major == 6) {
						return _23;
					}
				}
				try {
					axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
				} catch (e) {
				}
			}
			if (axo != null) {
				_23 = new deconcept.PlayerVersion(axo.GetVariable("$version")
						.split(" ")[1].split(","));
			}
		}
	}
	return _23;
};
deconcept.PlayerVersion = function(_29) {
	this.major = _29[0] != null ? parseInt(_29[0]) : 0;
	this.minor = _29[1] != null ? parseInt(_29[1]) : 0;
	this.rev = _29[2] != null ? parseInt(_29[2]) : 0;
};
deconcept.PlayerVersion.prototype.versionIsValid = function(fv) {
	if (this.major < fv.major) {
		return false;
	}
	if (this.major > fv.major) {
		return true;
	}
	if (this.minor < fv.minor) {
		return false;
	}
	if (this.minor > fv.minor) {
		return true;
	}
	if (this.rev < fv.rev) {
		return false;
	}
	return true;
};
deconcept.util = {
	getRequestParameter : function(_2b) {
		var q = document.location.search || document.location.hash;
		if (_2b == null) {
			return q;
		}
		if (q) {
			var _2d = q.substring(1).split("&");
			for ( var i = 0; i < _2d.length; i++) {
				if (_2d[i].substring(0, _2d[i].indexOf("=")) == _2b) {
					return _2d[i].substring((_2d[i].indexOf("=") + 1));
				}
			}
		}
		return "";
	}
};
deconcept.SWFObjectUtil.cleanupSWFs = function() {
	var _2f = document.getElementsByTagName("OBJECT");
	for ( var i = _2f.length - 1; i >= 0; i--) {
		_2f[i].style.display = "none";
		for ( var x in _2f[i]) {
			if (typeof _2f[i][x] == "function") {
				_2f[i][x] = function() {
				};
			}
		}
	}
};
if (deconcept.SWFObject.doPrepUnload) {
	if (!deconcept.unloadSet) {
		deconcept.SWFObjectUtil.prepUnload = function() {
			__flash_unloadHandler = function() {
			};
			__flash_savedUnloadHandler = function() {
			};
			window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs);
		};
		window
				.attachEvent("onbeforeunload",
						deconcept.SWFObjectUtil.prepUnload);
		deconcept.unloadSet = true;
	}
}
if (!document.getElementById && document.all) {
	document.getElementById = function(id) {
		return document.all[id];
	};
}
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject;
var SWFObject = deconcept.SWFObject;
$.tablesorter.addParser({
	id : 'taglessSort',
	is : function(s) {
		return false;
	},
	format : function(s) {
		return s.replace(/<.[^>]+?>/g, '');
	},
	type : 'text'
});
$.tablesorter.addParser({
	id : 'interestLevel',
	is : function(s) {
		return false;
	},
	format : function(s) {
		return s.replace(/^PROF/, ':').replace(/K/g, '0').replace(/P/g, ' ');
	},
	type : 'text'
});
$.tablesorter.addParser({
	id : 'commasafenumeric',
	is : function(s) {
		return false;
	},
	format : function(s) {
		var n = parseFloat(s.replace(/,/g, ''));
		if (isNaN(n))
			return 0;
		return n
	},
	type : 'numeric'
});
function closePopup() {
	$(".popupPromptWindow").fadeOut();
	return false;
}
$(document)
		.ready(
				function() {
					if ($("#leftMenu").length) {
						$(".subItem").hide();
						$("#leftMenu ul:first li").has('div').addClass('arrow');

						$(function() {
							$("#leftMenu ul:first li")
									.hover(
											function() {
												var pos = $(this).position();
												if ($(this).css(
														'border-top-style') == 'none') {
													jQuery("div", this)
															.css('display',
																	'block')
															.css('visibility',
																	'visible')
															.css('top', pos.top)
															.css(
																	'left',
																	pos.left - 25)
															.css('padding-top',
																	'5px');
												} else {
													jQuery("div", this)
															.css('display',
																	'block')
															.css('visibility',
																	'visible')
															.css('top', pos.top)
															.css(
																	'left',
																	pos.left - 25);
												}
											},
											function() {
												jQuery("div", this).css(
														'display', 'none').css(
														'visibility', 'hidden');
											})
						});
					}

					$(".autofocus").focus();

					if ($("#headerQuickSearchQt").length) {
						$('#headerQuickSearchQt').val('easy');
					}

					if ($("#headerQuickSearchQ").length) {
						$("#headerQuickSearchQ")
								.autocomplete(
										path
												+ "/JSONResponses/searchHinter.jsp",
										{
											cacheLength : 1,
											matchContains : true,
											matchSubset : false,
											selectFirst : false,
											scroll : false,
											highlight : function(result, query) {

												var qTokens = jQuery
														.trim(query).split(' ');
												qTokens.sort(function(a, b) {
													return b.length - a.length;
												});

												var resultD = eval('(' + result
														+ ')');

												var divider = false;
												if (resultD.index == 0)
													this.maxTypedIndex = -2;

												if (resultD.type) {
													this.maxTypedIndex = resultD.index;
												} else if (resultD.index == this.maxTypedIndex + 1) {
													divider = true;
												}

												var rTokens = resultD.query
														.split(' ');
												var r = '<div class="ac_result'
														+ (divider ? ' divider'
																: '') + '">';
												if (resultD.type)
													r += '<span class="ac_type">'
															+ resultD.typeName
															+ ' search for</span> ';

												for ( var rt in rTokens) {
													var token = rTokens[rt];
													for ( var qt in qTokens) {
														var qToken = qTokens[qt];
														var i = token
																.toLowerCase()
																.indexOf(
																		qToken
																				.toLowerCase());
														if (i == 0) {
															token = token
																	.substring(
																			0,
																			i)
																	+ '<strong>'
																	+ token
																			.substring(
																					i,
																					i
																							+ qToken.length)
																	+ '</strong>'
																	+ token
																			.substring(
																					i
																							+ qToken.length,
																					token.length);
															break;
														}
													}

													r += token + ' ';
												}

												r += '</div>'

												return r;
											},
											formatResult : function(data,
													position, count) {
												return data;
											}
										}).result(
										function(event, item) {
											event.stopPropagation();

											var data = eval('(' + item + ')');
											var qq = data.query.replace(/"/g,
													"");
											if (data.quote)
												qq = '"' + qq + '"';

											$('#headerQuickSearchQ').val(qq);
											if (data.type)
												$('#headerQuickSearchQt').val(
														data.type);
											else
												$('#headerQuickSearchQt').val(
														'easy');

											$('#headerQuickSearch').submit();
										});
					}
					$(function() {
						// Accordion
						if ($('#accordion').length != 0) {
							$("#accordion").accordion({
								header : "h3"
							});
						}
						// Tabs
						if ($('#tabs').length != 0) {
							$('#tabs').tabs();
						}
						// Dialog
						if ($('#dialog').length != 0) {
							$('#dialog').dialog({
								autoOpen : false,
								width : 600,
								buttons : {
									"Ok" : function() {
										$(this).dialog("close");
									},
									"Cancel" : function() {
										$(this).dialog("close");
									}
								}
							});
						}

						// Dialog Link
						if ($('#dialog_link').length != 0) {
							$('#dialog_link').click(function() {
								$('#dialog').dialog('open');
								return false;
							});
						}

						// hover states on the static widgets
						if ($('#dialog_link').length != 0) {
							$('#dialog_link').hover(function() {
								$(this).addClass('ui-state-hover');
							}, function() {
								$(this).removeClass('ui-state-hover');
							});
						}
						if ($('ul#icons li').length != 0) {
							$('ul#icons li').hover(function() {
								$(this).addClass('ui-state-hover');
							}, function() {
								$(this).removeClass('ui-state-hover');
							});
						}
					});
				});
function checkAllCheckboxes(name, checked) {
	$("#" + name + " tbody > tr > td > input:checkbox")
			.attr('checked', checked);
}
