// JavaScript Document

<!--  to hide script contents from old browsers
// variables defined here may be accessed by any of the frames
// defined below via the parent.variable_name command. NOTE: if the
// NetScape window is resized, the variables will be reset to their
// initial values. ie: these variables are available to the child frames.

// VARIABLES:::::::::::::::::::::::::::::::::::::::::::::::::::::
var totalnum = 1;	// total # of questions
	correctans = 0;	// the # (from1 to 3) of the correct answer to each question
	count = 0;		// counter variable. Initialized to zero.
	totalright = 0;	// total # of questions answered right. Initialized to 0.  
	correcttext = "blank";   // the text of the correct answer.
	q = 58;			// number of possible questions to choose from
	r = 0;			// used by Randnum to generate a random number
	s = 0;
	t = 0;			// used so q isn't reset to anything.
	n = 1;			// used to refer to question number
	temp = 0;		// used in AssignCode to prevent repeat randoms

// FUNCTIONS:::::::::::::::::::::::::::::::::::::::::::
// These functions are used to generate an array of 10 random questions pulled
// from the total question pool. If they were in the quizzy.html listing, this
// array would be reset each question resulting in possible repeated questions.

// This function defines an array such that the first property, length
// (with index of zero), represents the number of elements in array.
// The remaining properties have an integer index of 1 or greater, and
// are initialized to 0.

function MakeArray (n) {
	this.length = n;
	for (var i = 1; i <= n; i++) {
		this [i] = 0 }
		return this
}

// This function is used to generate the two properties of the randarray objects below.
// questnum is the question number from the questarray below.
// onoff is used to prevent a question number from being picked more than once.
function Randy(questnum, onoff) {
	this.questnum = questnum;
	this.onoff = onoff;
}



// This function generates random number between 0 and one less than the total number of possible questions
function Randnum(r) {
	t = q
	t = t - 1				// because r may be 0 so have to add 1 later
	now = new Date
	r = now.getTime()
	r = r/1000				// gives me a decimal to work with
	s = Math.floor(r)	// loses the decimal
	r = r - s			// returns a value between 0 and 1
	r = r * t				// returns a number from 0 to q
	r = Math.round(r)
	r = r + 1
	return r
}



// This function assigns a question number to each randarray[] from 1 to q
function AssignCode () {
	for ( n = 1; n <= totalnum; n++) {
		randarray[n].questnum = Randnum()
		temp = randarray[n].questnum
		while (randarray[temp].onoff > 0) {
			if (randarray[n].questnum == q) {
				randarray[n].questnum = 1
				}
			else{
				randarray[n].questnum = randarray[n].questnum + 1
				}
			temp = randarray[n].questnum
		}
		randarray[temp].onoff = 1
	}
}

// This function initializes all of randarray to 0
function InitRandArray() {
	randarray = new MakeArray(q)
		for (var i = 1; i <= q; i++)
		randarray[i] = new Randy(0, 0)
}

// This function is used to create the properties of the questarray object below.

function Questans (question, answer1, answer2, answer3, correctanswer, extra) {
	this.question = question;
	this.answer1 = answer1;
	this.answer2 = answer2;
	this.answer3 = answer3;
	this.correctanswer = correctanswer;
	this.extra = extra;
}

function DefineQuestionPool() {
	questarray = new MakeArray(q)
	questarray[1] = new Questans("'Star Wars' was based on which Akira Kurosawa film?", "'Yojimbo'.", "'The Seven  Samurai'.", "'The Hidden Fortress'.", 3, " ")
	questarray[2] = new Questans("The sound of the tornado in 'Twister' was really:", "the moan of a camel.", "the sound engineer blowing over the top of a beer bottle.", "an oboe.", 1, " ")
	questarray[3] = new Questans("For their work in 'Sabrina', Humphrey Bogart was paid $300,000 and William Holden made $150.000. How much was Audrey Hepburn paid?", "$15,000.", "$250,000.", "$500,000.", 1, " ")
	questarray[4] = new Questans("Who played Andy Warhol in the film 'Basquiat'?", "himself.", "Dennis Hopper.", "David Bowie.", 3, " ")
	questarray[5] = new Questans("Why does Indiana Jones shoot the swordsman in 'Raiders of the Lost Ark'?", "It was written that way in the script.", 
	"Harrison Ford had diarrhea that day and did not want to film a long fight scene.", "A stuntman was injured in rehearsal so they changed it.", 2, "'Can't I just shoot him?' is what Ford said when told about the scene.")
	questarray[6] = new Questans("Who was the mother of Cary Grant's only child, Jennifer?", "Dyan Cannon.", "Virginia Cherrill.", "Betsy Drake.", 1, "Grant married five women. The other two were Barbara Hutton and Barbara Harris.")
	questarray[7] = new Questans("Who said, 'I have a face like the behind of an elephant?", "Ernest Borgnine.", "Charles Laughton.", "Sophia Loren.", 2, " ")
	questarray[8] = new Questans("'The Preacher's Wife' (1996) is a remake of 'The Bishop's Wife' (1947). In that film, who played the Bishop?", "Jimmy Stewart.", "Cary Grant.", "David Niven.", 3, " ")
	questarray[9] = new Questans("Who played the bartender in the biker bar in 'Leaving Las Vegas'?", "Julian Lennon.", "Danny Huston.", "Marc Coppola.", 1, " ")
	questarray[10] = new Questans("Johnny Depp, for his role as 'Don Juan de Marco', learned his Spanish accent by:", "Studying in Barcelona for three months.", "Watching reruns of Fantasy Island.", "Just being himself. Spanish is his native tongue.",
 2, " ")
	questarray[11] = new Questans("Uma Thurman's mother was once married to:", "Peter Matthiessen.", "Johnny Carson.", "Timothy Leary.", 3, " ")
	questarray[12] = new Questans("Who won the Oscar in 1939's 'The Philadelphia Story'?", "Jimmy Stewart.", "Katharine Hepburn.", "Ruth Hussey.", 1, "Hepburn was nominated for Best Actress and Hussey was nominated for Best Supporting Actress.")
	questarray[13] = new Questans("'Apocalypse: Now' was to be shot in 6 weeks. How long did it actually take to shoot?", "about 6 months.", "about 16 months.", "about 26 months.", 2, " ")
	questarray[14] = new Questans("In 'The Adventures of Buckaroo Banzai', what character does Jeff Goldblum play?", "Reno Nevada.", "New Jersey.", "Pinky Carruthers", 2, " ")
	questarray[15] = new Questans("Dooley Wilson (Sam from 'Casablanca') was a professional:", "drummer.", "piano player", "trumpet player", 1, " ")
	questarray[16] = new Questans("Who said, 'The length of a film should be directly related to the endurance of the human bladder'?", "Kenneth Branagh.", "Billy Wilder.", "Alfred Hitchcock.", 3, " ")
	questarray[17] = new Questans("The making of which film crashed the most cars in movie history?", "The Cannonball Run.", "The Blues Brothers.", "The Gumball Rally.", 2, " ")
	questarray[18] = new Questans("How many women have speaking roles in 'Lawrence of Arabia'?", "5", "1", "0", 3, " ")
	questarray[19] = new Questans("What is Nicolas Cage's real name?", "Nicolas Coppola", "Nicolas Scorsese", "Nicolas Roeg", 1, "His uncle is Francis Ford Coppola, the director.")
	questarray[20] = new Questans("Which 'Dirty Harry' film featured Robert Urich, David Soul, and Suzanne Somers?", "'Sudden Impact'", "'The Enforcer'", "'Magnum Force'", 3, " ")
	questarray[21] = new Questans("What film critic co-wrote  'Beyond the Valley of the Dolls' and 'Beneath the Valley of the Ultra-Vixens'?", "Gene Siskel", "Roger Ebert", "Marc Horton", 2, " ")
	questarray[22] = new Questans("In which 'StarTrek' movie does James T. Kirk die?", "'The Wrath of Khan'", "'Generations'", "'The Undiscovered Country'", 2, " ")
	questarray[23] = new Questans("'A Fistful of Dollars' is based on which Akira Kurosawa film?", "'Yojimbo'.", "'The Seven  Samurai'.", "'The Hidden Fortress'.", 1, "'Last Man Standing' is also based on 'Yojimbo'.")
	questarray[24] = new Questans("How was the title of 'Dr. No' originally translated into Japanese by United Artists?", "Dr. Naughty.", "Stop the Evil Doctor.", "We Don't Want A Doctor.", 3, " ")
	questarray[25] = new Questans("According to Andrew Lloyd-Webber, how many false starts has the movie 'Evita' had in the last 20 years?", "7.", "17.", "27.", 3, 
	"Francis Ford Coppola, Richard Attenborough, and Oliver Stone are some of the directors who have tried and failed to bring it to the screen.")
	questarray[26] = new Questans("Which member of the Rat Pack died on Christmas Day, 1995?", "Sammy Davis Junior.", "Dean Martin.", "Frank Sinatra.", 2, "Dean Martin's real name was Dino Crocetti.")
	questarray[27] = new Questans("Who said of Akira Kurasawa, 'I am proud of nothing I have done other than with him'?", "Ken Takakura.", "Toshiro Mifune.", "Tatsuya Nakadai.", 2, "Mifune appeared in 16 Kurasawa films.")
	questarray[28] = new Questans("Marion Michael Morrison is the real name of which famous person?", "John Wayne.", "Jim Morrison.", "Michael J. Fox.", 1, "He was billed as 'Duke Morrison' in some of his early films.")
	questarray[29] = new Questans("How many times did Marlene Dietrich marry?", "Never.", "Once.", "Five Times.", 2, "Though she only lived with Rudolf Sieber from 1924 to 1929, they remained married until his death in 1976.")
	questarray[30] = new Questans("For which three films did Ingrid Bergman win her Academy Awards?", "'Gaslight, 'Anastasia', and 'Murder on the Orient Express'.", "'Gaslight', 'For Whom the Bell Tolls', and 'Murder on the Orient Express'.", 
	"'Casablanca', 'Notorious', and 'For Whom the Bell Tolls'.", 1, " ")
	questarray[31] = new Questans("What is the name of the civil rights leader killed in 'Ghosts of Mississippi'?", "Bobby DeLaughter.", "Myrlie Evers.", "Medgar Evers.", 3, " ")
	questarray[32] = new Questans("What film introduced the world to the magic of Dean Martin singing 'That's Amore'?", "'My Little Irma'.", "'The Caddy'.", "'Hollywood or Bust'.", 2, "")
	questarray[33] = new Questans("Who is known as 'The Japanese Clint Eastwood'?", "Ken Takakura.", "Toshiro Mifune.", "Tatsuya Nakadai.", 1, " ")
	questarray[34] = new Questans("Who was Mia Farrow last ex-husband?", "Woody Allen.", "Frank Sinatra.", "Andre Previn.", 3, "Farrow and Allen never married.")
	questarray[35] = new Questans("What is the name of the film in which Fred Astaire dances on the ceiling?", "'Royal Wedding'.", "'Top Hat'.", "'You'll Never Get Rich'.", 1, "This movie also has the 'hatrack' dance.")
	questarray[36] = new Questans("In how many of his 55 films does Alfred Hitchcock appear?", "55.", "53.", "36.", 3, "He did his first cameos because he was short of extras.")
	questarray[37] = new Questans("What is the record for the most custard pies thrown in a movie?", "150.", "1298.", "3000.", 3, "The film was Laurel and Hardy's 'The Battle of the Century'.")
	questarray[38] = new Questans("What were the shoes made of that Charlie Chaplin eats in 'The Gold Rush'?", "Leather.", "Licorice.", "Dyed Pizza Dough.", 2, " ")
	questarray[39] = new Questans("Who played Mike Hammer in 'The Girl Hunters'?", "Mickey Spillane.", "Ralph Meeker.", "Armand Assante.", 1, "Spillane is also the author of the Mike Hammer series.")
	questarray[40] = new Questans("Who played the bartender in 'The Right Stuff'?", "John Glenn.", "Alan B. Shephard.", "Chuck Yeager.", 3, " ")
	questarray[41] = new Questans("The Mllenium Falcon from 'Star Wars' is modelled after:", "A hamburger with an olive beside it.", "The rocket ship from 'Beneath the Planet of the Apes'.", "A paperweight owned by Arthur C. Clarke.", 1, " ")
	questarray[42] = new Questans("How long did 'Natural Born Killers' take to edit?", "6 months.", "11 months.", "2 years.", 2, "150 scenes were either reshot or cut from the film in order to get an R rating.")
	questarray[43] = new Questans("In 'Swing Time' there is a scene in which Ginger Rogers is interrupted washing her hair. What does she really have in her hair at that point?", "Shampoo.", "Egg whites.", "Whipped cream.", 3, " ")
	questarray[44] = new Questans("What film marked Jonathan Demme's feature film directorial debut?", "'Caged Heat'.", "'Crazy Mama'.", "'Melvin and Howard'.", 1, "He also wrote the screenplay for this classic prison chixploitation flick.")
	questarray[45] = new Questans("Which actor or actress has been nominated for more Academy Awards than any other?", "Ingrid Bergman.", "Katharine Hepburn.", "Paul Newman.", 2, "She was nominated for 12 and won four.")
	questarray[46] = new Questans("Who was the only actor or actress to win an Academy Award for a role in a Hitchcock film?", "Joan Fontaine.", "Anthony Perkins.", "Cary Grant.", 1, 
"She won Best Actress in 1941 for 'Suspicion'. Her sister, Olivia De Havilland, was also nominated that year for 'Hold Back the Dawn'.")
	questarray[47] = new Questans("What is Woody Allen's real name?", "Howard Allen Arshap.", "Allan Stewart Konisberg.", "Allan J. Kayser.", 2, " ")
	questarray[48] = new Questans("What are the names of River Phoenix's siblings?", "Rain, Liberty, Summer, and Joaquim.", "Brooke, Myfawnwy, Rain, and Joaquim.", "Moon-Unit, Chastity, Dweezil, and Rumor", 
	1, "Rain and Joaquim are also successful actors.")
	questarray[49] = new Questans("Who played Elvis Presley in 'True Romance'?", "Himself.", "Nicholas Cage.", "Val Kilmer.", 3, " ")
	questarray[50] = new Questans("Who is Mia Farrow's godmother?", "Louella Parsons.", "Hedda Hopper.", "Maureen O'Sullivan.", 1, "Her real (ungodly?) mother is Maureen O'Sullivan.")
	questarray[51] = new Questans("Who said, 'Because I dislike being quoted, I lie almost constantly about my work'?", "Woody Allen.", "Alfred Hitchcock.", "Terry Gilliam.", 3, " ")
	questarray[52] = new Questans("What is the name of Tracy Lord's cat?", "Magnum P.I.", "Steve McGarret.", "Pussy.", 2, "Tracy is such a big 5 - 0 fan that she chose the name 'Lord' after 'Jack Lord'.")
	questarray[53] = new Questans("What was Judi Dench's nickname on the set of 'Shakespeare in Love'?", "Queen Bee", "Tudor Spice", "Liz", 2,
	"She was given the name because of the funky platform shoes she wore under her costume to make her taller.")
	questarray[54] = new Questans("Where was Keanu Reeves born?", "Moose Jaw.", "Edmonton.", "Beirut.", 3, " ")
	questarray[55] = new Questans("According to Scott Hamilton, 'Comedy starts at...'?", "Moose Jaw.", "Edmonton.", "Toronto.", 2, 
	"From a 1993 quote: 'There are no comedy stylings on the West Coast. Comedy starts at Edmonton. As you go East, it gets darker. By the time you hit Newfoundland, it's pitch-black.'")
	questarray[56] = new Questans("How old was Jim Carrey when he first sent his resum&eacute; to the Carol Burnett show?", "10.", "14.", "18.", 1, " ")
	questarray[57] = new Questans("Who provided the voice of ET in the film 'ET the Extra-Terrestrial'?", "James Earl Jones.", "Debra Winger.", "Cher.", 2, " ")
	questarray[58] = new Questans("Who portrayed God in the film 'Dogma'?", "Alanis Morissette.", "George Burns.", "George Carlin.", 1, " ")

	

// Of 58 questions so far, there are 20 ones, 20 twos, and 18 threes.

}

InitRandArray()
DefineQuestionPool()


// end hiding contents from old browsers  -->


