var quiz = new Array(); var r = 0;
quiz[r++] =('41~83~It is a great honour to have so many members of the Government dead in our sitting room.~Famous Deaths~Zeppelin~Hermits~Working-Class Playwright');
quiz[r++] =('32~43~A good try though and very nice posture.~The Ministry of Silly Walks~Red Indian in Theatre~Summarize Proust Competition~Europolice Song Contest');
quiz[r++] =('48~29~Police ruled out foul play. (pause) Lemon curry?~The News with Richard Baker~There\'s Been a Murder~Current Affairs~Police Constable Pan-Am');
quiz[r++] =('54~24~Oh, forget about your husband, Mrs S.C.U.M. - or may I call you Mrs S?~Mr. Neutron is found~Whicker Island~Jungle Restaurant~Registrar (Wife Swap)');
quiz[r++] =('26~92~Come on, Concorde!~Brigadier and Bishop~Expedition to Lake Pahoe~Dennis Moore~Jungle Restaurant');
quiz[r++] =('24~47~It’s not the Cutty Sark!~Father-in-Law~Exploding Version of “The Blue Danube”~The Black Eagle~Hijacked Plane (to Luton)');
quiz[r++] =('38~67~Do take a seat. I\'m sorry it\'s on fire.~Stock Exchange Report~Interview in a Filing Cabinet~Complaints Department~Careers Advisory Board');
quiz[r++] =('8~92~Dear King Haakon. (the secretary types) Just a line to thank you for the eels.~Biggles: dictates a letter~Lifeboat~Restaurant Sketch~The Funniest Joke in the World');
quiz[r++] =('30~92~But what about the 48,000,000 kilts and the Galaxy of Andromeda?~A Scotsman on a Horse~Dickie Attenborough~Man turns into a Scotsman~Prices on the Planet Algon');
quiz[r++] =('19~47~Basically, I believe in peace and bashing two bricks together.~Working-class Playwright~Self-defense~Sherry-drinking Vicar~Crackpot Religions Ltd');
quiz[r++] =('13~72~Captain B.J. Smethwick in a white wine sauce with shallots, mushrooms and garlic.~Restaurant Sketch~Lifeboat (Cannibalism)~New Cooker Sketch~Jungle Restaurant');
quiz[r++] =('25~88~Notice that they do not so much fly as...plummet.~Flying Sheep~The Silliest Sketch We’ve Ever Done~Zeppelin~Flying Lessons');
quiz[r++] =('30~77~I\'ve just spent four hours burying the cat.~A Duck, a Cat and a Lizard~Undertakers Film~Mrs. Premise and Mrs. Conclusion visit Jean-Paul Sartre~Farming Club');
quiz[r++] =('11~67~The huge bull limpet, enraged by the rock, endeavours to encircle its sprightly opponent.~The Lost World of Roiurama~Molluscs – “Live” TV Documentary~At Home with the Ant and Other Pets~Life and Death Struggles');
quiz[r++] =('20~97~Were you worried when his head started to come loose?~Boxing match aftermath~The Batsmen of the Kalahari~Thripshaw’s Disease~Blood, Devastation, Death, War and Horror');
quiz[r++] =('36~62~I\'ve got ninety thousand pounds in my pyjamas.~There is Nothing Quite So Wonderful As Money.~Appeal on Behalf of Extremely Rich people~The BBC is Short of Money~Bank Robber (Lingerie Shop)');
quiz[r++] =('28~87~Armpits rallied well after a poor start.~Stock Exchange Report~Everest Climbed By Hairdressers~The Dirty Vicar Sketch~Live from Epsom');
quiz[r++] =('22~38~Um, er...excuse me, um, are you... are you suggesting we should eat my mother?~David Niven’s Fridge~Lifeboat (Cannibalism)~The Undertakers Sketch~Father-in-Law');
quiz[r++] =('36~14~We do not know which bush he is behind, but we can soon find out.~How Not to be Seen~Fish-Slapping Dance~Killer Sheep~Albatross');
quiz[r++] =('13~22~I\'ll have a whisky for main course and I\'ll follow that with a whisky for pudding.~Mr. Pither~The Silliest Sketch We\'ve Ever Done~The Funniest Joke in the World~Restaurant Sketch');
quiz[r++] =('24~29~Here Little Nell, from Dickens\'s \'Old Curiosity Shop\' fits new nylon syphons into the asbestos-lined ceilings~Housing Project Built by Characters from Nineteenth-Century English Literature~The Lumberjack Song~International Wife-Swapping~Hospital Run by RSM');
quiz[r++] =('27~14~Beans!!~Italian Lesson~Words Not to be used Again~Language Laboratory~The Most Awful Family in Britain');
quiz[r++] =('45~38~Your type really makes me puke, you vacuous, coffee-nosed, maloderous, pervert!!!~Argument Clinic~Self-Defence~Art Critic~World War One');
quiz[r++] =('30~67~One final question Karl and the beautiful lounge suite will be yours…~It’s the Arts~Quiz Programme – “Wishes”~Communist Quiz~The Attila the Hun Show');
quiz[r++] =('20~88~Oh, I like it runny.~Cheese Shop~Yummy Yummy~Poofy Judges~Live from the Grill-O-Mat Snack Bar');
quiz[r++] =('30~83~I want to apologize, humbly, deeply, and sincerely about the fork.~Restaurant Sketch~Cut-Price Airline~The Idiot in Society~Gumby Brain Specialist');
quiz[r++] =('42~88~Your wife, is she eh… is she a sport? Eh?~International Wife-Swapping~Mr. Neville Shunte~Nudge, nudge~Interesting People');
quiz[r++] =('30~78~Well, don’t you even take the bones out?~Crunchy Frog~Mosquito Hunters~Confuse-A-Cat~The Mouse Problem');
quiz[r++] =('35~97~It’s probably pining for the fiords.~Silly Job Interview~Pantomime Horses~The Walking Tree of Dahomey~The Dead Parrot Sketch');
quiz[r++] =('11~28~On Wednesday I go shopping and have buttered scones for tea.~Army Captain as Clown~The Lumberjack Song~“Party Hints” with Veronica Smalls~Letters to the “Daily Mirror”');
quiz[r++] =('34~77~Ladies and gentlemen, the incomparably superior human being, Harry Fink. (v.o.: He can’t come!) Nevermind, it’s not all it’s cracked up to be.~Famous Deaths~The First Man to Jump the Channel~The Refreshment Room at Bletchley~BBC Programme Planners');
quiz[r++] =('30~89~What flavour is it?~Albatross~Cheese Shop~Watney’s Red Barrel~Penguins');
quiz[r++] =('38~13~Dinsdale was a gentleman. And what’s more, he knew how to treat a female impersonator.~The Man Who Makes People Laugh Uncontrollably~The British Well-Basically Club~Boxing Commentary~The Piranha Brothers');
quiz[r++] =('49~44~Amongst our weaponry are such elements as fear, surprise… I’ll come in again.~Whizzo Butter~The Spanish Inquisition~Icelandic Honey Week~Bing Tiddle Tiddle Bong');
quiz[r++] =('38~68~Oh, a gahp. A gahp in one’s hhhhhoop. Pardon me, but I’m orf to play the grahnd piano.~The Ministry of Silly Walks~Mr and Mrs Git~The Man Who Says Things in a Very Roundabout Way~Flying Lessons');
quiz[r++] =('44~44~I use an aftershave called Semprini.~Undressing in Public~Gumby Crooner~Words Not to be Used Again~After-Shave');
quiz[r++] =('38~63~Gentlemen! I have bad news. This room is surrounded by film.~Policemen Make Wonderful Friends~Ken Shabby~No Time to Lose~Society for Putting Things on Top of Other Things');
quiz[r++] =('40~78~Tarquin Fin-tim-lin-bin-whin-bim-lin-bus-stop-F’Tang-F’Tang-Ole-Biscuitbarrel.~Election Night Special (Silly and Sensible Parties)~Spot the Loony~Bing Tiddle Tiddle Bong~Children’s Stories');
quiz[r++] =('21~13~Australia, Australia, Australia, Australia, we love you. Amen.~Theory on Brontosauruses by Anne Elk (Miss)~Bruces~Crossing the Atlantic on a Tricycle~Travel Agent');
quiz[r++] =('18~88~It’s people like you what causes unrest.~Upperclass Twit of the Year~The Poet McTeagle~Communist Quiz~Fish License');

var quest = 10;
function randQuiz(num,arry) {

	if (quiz.length < num) 
	return arry;
	var rndary = new Array();
		for (var i = 0; i<arry.length; i++) {
			var x = Math.floor(Math.random()*500)+100;
			var y = 101+i;
			rndary[i] = ''+x+y+':'+arry[i];
		}
		rndary.sort();
		var newary = new Array();
		var sel = '';
		
		for (var i=0; i<num; i++) {
			sel += rndary[i].substr(3,3); newary[i] = rndary[i].substr(7);
		}
		document.cookie = 'python.quizSel='+sel;
		document.cookie = 'python.totCorr=0';
		document.cookie = 'python.corr1=0';
		document.cookie = 'python.corr2=0';
		document.cookie = 'python.corr3=0';
		document.cookie = 'python.corr4=0';
		document.cookie = 'python.corr5=0';
		document.cookie = 'python.corr6=0';
		document.cookie = 'python.corr7=0';
		document.cookie = 'python.corr8=0';
		document.cookie = 'python.corr9=0';
		document.cookie = 'python.corr10=0';
		return newary;
		}
		
function sameQuiz(quiz,sel) {
	var newary = new Array();
		for (var i=0; i< sel.length/3;i++) {
			var n = sel.substr(i*3,3);
			var m = parseInt(n) - 101;
			newary[i] = quiz[m];
		}
		return newary;
}

function readCookie(cname) {
	thisCookie = document.cookie.split('; ');
		for (var i=0; i<thisCookie.length;i++) {
			if (thisCookie[i].split('=')[0] == cname) {
				return thisCookie[i].split('=')[1];
			}
		} 
		return false;
}
var sel = readCookie('python.quizSel');
	if (sel) { 
		quiz = randQuiz(quest,quiz);
	} else { 
		quiz = randQuiz(quest,quiz);
	}
