function Option(text, value, selected) {
	this.text = text;
	this.value = value;
	this.selected = selected;
	
	this.print = function() {
		document.write('<option value="'+this.value+'"'+(selected ? " SELECTED" : "")+'>'+this.text+'</option>');
	};
}

function Category(name) {
	if (!name) name = "";
	this.optGroupName = name;
	this.options = new Array();
	
	this.addOption = function(text, value, selected) {
		if (!value) value = text;
		if (!selected) selected = false;
		this.options[this.options.length] = new Option(text, value, selected);
	};
	
	this.print = function() {
		if (this.name != "")
			document.write('<optgroup label="'+this.optGroupName+'">\n');
		
		for (var i = 0; i < this.options.length; i++)
		{
			this.options[i].print();
		}
		
		if (this.name != "")
			document.write('</optgroup>');
	};
}

/* Categories Class */
function CategoryList() {
	this.cats = new Array();
	//alert("cl");
	
	this.print = function() {
		for (var i = 0; i < this.cats.length; i++)
		{
			this.cats[i].print();
		}
	};
	
	var len = this.cats.length;
	this.cats[len] = new Category();
	this.cats[len].addOption("Please Select...", "Please Select...", true); /* prompt for selection */
	
	len = this.cats.length;
	this.cats[len] = new Category("Most Popular");
	this.cats[len].addOption("General");
	this.cats[len].addOption("General Sport");
	this.cats[len].addOption("TV Trivia");
	this.cats[len].addOption("Movies");
		this.cats[len].addOption("True or False");
	
	
	len = this.cats.length;
	this.cats[len] = new Category("Factual");
	this.cats[len].addOption("Animals");
	this.cats[len].addOption("Astrology");
	this.cats[len].addOption("Crime");
	this.cats[len].addOption("Customs");
	this.cats[len].addOption("Famous Firsts");
	this.cats[len].addOption("History");
	this.cats[len].addOption("Kings & Queens");
	this.cats[len].addOption("Latin Phrases");
	this.cats[len].addOption("Living World");
	this.cats[len].addOption("Science");
	this.cats[len].addOption("Technology");
	this.cats[len].addOption("The Bible");
	this.cats[len].addOption("The Human Body");
	this.cats[len].addOption("Transport");
	this.cats[len].addOption("True or False");
	this.cats[len].addOption("Wartime");
	this.cats[len].addOption("What Year");
	this.cats[len].addOption("World Leaders");
	this.cats[len].addOption("World Records");
	this.cats[len].addOption("World War II");
	this.cats[len].addOption("World at War");

	len = this.cats.length;
	this.cats[len] = new Category("Food & Drink");
	this.cats[len].addOption("Food & Drink");
	this.cats[len].addOption("Herbs & Spices");
	this.cats[len].addOption("Spirits & Cocktails");
	this.cats[len].addOption("Wine");

	len = this.cats.length;
	this.cats[len] = new Category("Entertainment");
	this.cats[len].addOption("80's Movies");
	this.cats[len].addOption("90's Movies");
	this.cats[len].addOption("James Bond");
	this.cats[len].addOption("Movie Stars");
	this.cats[len].addOption("Movies");
	this.cats[len].addOption("Sci Fi & Fantasy");
	this.cats[len].addOption("Star Marriges");
	this.cats[len].addOption("The Beatles");
	this.cats[len].addOption("TV Sitcoms");
	this.cats[len].addOption("TV Trivia");

	len = this.cats.length;
	this.cats[len] = new Category("Geography/Places");
	this.cats[len].addOption("Around Europe");
	this.cats[len].addOption("Around UK");
	this.cats[len].addOption("Australia");
	this.cats[len].addOption("Capital Cities");
	this.cats[len].addOption("Flags");
	this.cats[len].addOption("Geography");
	this.cats[len].addOption("Ireland");
	this.cats[len].addOption("Islands");
	this.cats[len].addOption("Mountains");
	this.cats[len].addOption("Places");
	this.cats[len].addOption("Rivers");
	this.cats[len].addOption("Where in the World");

	len = this.cats.length;
	this.cats[len] = new Category("UK Specific");
	this.cats[len].addOption("UK General");
	this.cats[len].addOption("Geography");
	this.cats[len].addOption("History");
	this.cats[len].addOption("Politics");
	this.cats[len].addOption("Famous People");

	len = this.cats.length;
	this.cats[len] = new Category("Sport");
	this.cats[len].addOption("World Cup");
	this.cats[len].addOption("World Cup Picture Round");
	this.cats[len].addOption("Football");
	this.cats[len].addOption("Rugby");
	this.cats[len].addOption("Rugby World Cup");
	
	this.cats[len].addOption("General Sport");
	this.cats[len].addOption("Tennis");
	this.cats[len].addOption("The Olympics");
	this.cats[len].addOption("Yachting");
	this.cats[len].addOption("Basketball");
	this.cats[len].addOption("Cricket");
	this.cats[len].addOption("Golf");

	len = this.cats.length;
	this.cats[len] = new Category("Music");
	this.cats[len].addOption("Karaoke");
	this.cats[len].addOption("Movie Music");
	this.cats[len].addOption("Music & Musicals");
	this.cats[len].addOption("Musical Greats");
	this.cats[len].addOption("Popular Music");
	this.cats[len].addOption("Sinatra");

	len = this.cats.length;
	this.cats[len] = new Category("Words/Literature");
	this.cats[len].addOption("Alphabet");
	this.cats[len].addOption("Books");
	this.cats[len].addOption("Crossword Clues");
	this.cats[len].addOption("Harry Potter");
	this.cats[len].addOption("Latin Phrases");
	this.cats[len].addOption("Literature");
	this.cats[len].addOption("Names the Same");
	this.cats[len].addOption("Scrabble");
	this.cats[len].addOption("Shakespeare");
	this.cats[len].addOption("Spelling Bee");
	this.cats[len].addOption("Words");

/*	len = this.cats.length;
	this.cats[len] = new Category("Music Round Topics");
	this.cats[len].addOption("Movie Themes");
	this.cats[len].addOption("Name that Tune");
	this.cats[len].addOption("Name that Beatles Tune");
	this.cats[len].addOption("Name that Elvis Tune");
	this.cats[len].addOption("Backwards Classics (well known songs played backwards)");
	this.cats[len].addOption("Cover Versions");
	this.cats[len].addOption("Who's it About");
	this.cats[len].addOption("Solo Artists");
	this.cats[len].addOption("Name that TV Commercial");
	this.cats[len].addOption("60s");
	this.cats[len].addOption("70s");

	len = this.cats.length;
	this.cats[len] = new Category("Themed Trivia");
	this.cats[len].addOption("Sport");
	this.cats[len].addOption("New Zealand");
	this.cats[len].addOption("Music");
	this.cats[len].addOption("Movies");
	this.cats[len].addOption("60s");
	this.cats[len].addOption("Simpsons");
	this.cats[len].addOption("Television");
*/	
		
	this.print();
}

/* Music Round Class */
function MusicRound() {
	this.cats = new Array();
	alert("mr");
	
	this.print = function() {
		for (var i = 0; i < this.cats.length; i++)
		{
			this.cats[i].print();
		}
	};
	
	var len = this.cats.length;
	this.cats[len] = new Category();
	this.cats[len].addOption("Please Select...", "Please Select...", true); /* prompt for selection */
	
	len = this.cats.length;
	this.cats[len] = new Category("Music Round Topics");
	this.cats[len].addOption("Movie Themes");
	this.cats[len].addOption("Name that Tune");
	this.cats[len].addOption("Name that Beatles Tune");
	this.cats[len].addOption("Name that Elvis Tune");
	this.cats[len].addOption("Backwards Classics (well known songs played backwards)");
	this.cats[len].addOption("Cover Versions");
	this.cats[len].addOption("Who's it About");
	this.cats[len].addOption("Solo Artists");
	this.cats[len].addOption("Name that TV Commercial");
	this.cats[len].addOption("60s");
	this.cats[len].addOption("70s");

	this.print();
}

/* Themed Package Class */
function ThemedPackage() {
	this.cats = new Array();
	alert("tp");
	
	this.print = function() {
		for (var i = 0; i < this.cats.length; i++)
		{
			this.cats[i].print();
		}
	};
	
	var len = this.cats.length;
	this.cats[len] = new Category();
	this.cats[len].addOption("Please Select...", "Please Select...", true); /* prompt for selection */
	
	len = this.cats.length;
	this.cats[len] = new Category("Themed Trivia");
	this.cats[len].addOption("Sport");
	this.cats[len].addOption("New Zealand");
	this.cats[len].addOption("Music");
	this.cats[len].addOption("Movies");
	this.cats[len].addOption("60s");
	this.cats[len].addOption("Simpsons");
	this.cats[len].addOption("Television");
		
	this.print();
}