context: function hpDetectQuiz() {	// "sniff" (=detect) the quiz's type and intended browser version	// and cache the values in a global variable called "quiz"	// Hot Potatoes version	//	5 : HP5.3 (mac) or HP5.5 (win)	//	6 : HP6.0 (mac) or HP6.0 (win)	// intended browser version	//	3   : ns3, ie3 (frames)	//	4   : ns4, ie4 (cross browser dhtml)	//	5   : ie5 (frames, send results via CGI)	//	6   : ie6, op7, gecko (w3 standards)	//	6.1 : "drag and drop" versions of JMatch and JMix v6	// quiz type	// 	0 : unknown	//	1 : jbc	//	2 : jcloze	//	3 : jcross	//	4 : jmatch	//	5 : jmix	//	6 : jquiz	//	7 : rhubarb (TexToys)	//	8 : Sequitur (TexToys)		// rottmeier quiz type	//	1 : drop-down (JCloze)	//	2 : find-it (JCloze)	// shortcut to window object	var w = window;	// create the global "quiz" object, if necessary	if (!w.quiz) w.quiz = new Object();	// Hot Potatoes version	// 	HP6 v6:    Client()	// 	HP5 v4-v5: BrowserCheck()	//	    v3:    WinStringToMac() [JCloze, JCross, JQuiz]	//	    v3:    winrightchar     [JBC, JMatch]	//	    v3:    DownTime()       [JBC, JCloze, JQuiz]	if (!quiz.hp) {		quiz.hp = (w.Client) ? 6 : (w.BrowserCheck) ? 5 : (w.WinStringToMac || w.winrightchar) ? 5 : -1;	}	// check the version and type are not already set	if (!quiz.v || !quiz.t) {		// initialize version and type		var v = 0;		var t = 0;		var r = 0;		// set shortcuts to DOM objects		var d = document;		var f = d.forms;		if (f.QuizForm && f.CheckForm && w.CorrectAnswers) {			v = 3;			t = 4; // jmatch		} else if (w.FeedbackFrame && w.CodeFrame) { 			v = 3;			f = CodeFrame.document.forms;			t = (f.QuizForm) ? 1 : (f.Cloze) ? 2 : (f.Crossword) ? 3 : (f.QForm1) ? 6 : 0;		} else if (w.DynLayer) {			v = 4;			if (d.layers) {				// for NS4, adjust "f" to point to a forms object in a layer				var lyr = d.QuestionDiv || d.CWDiv || d.TitleDiv || null;				if (lyr) f = lyr.document.forms;			}			t = (f.QForm && f.QForm.FB0) ? 1 : (f.Cloze) ? 2 : (f.Crossword) ? 3 : (f.ExCheck) ? 4 : (f.QForm && f.QForm.Answer) ? 6 : 0;		} else if (w.TopFrame && w.BottomFrame) {			v = 5;			f = BottomFrame.document.forms;			t = (f.QForm && f.QForm.elements[0].name.substring(0,3)=='FB_') ? 1 : (f.Cloze) ? 2 : (w.GetAnswerOpener && GetAnswerOpener.indexOf('AnswerForm')>=0) ? 3 : (f.QForm && w.RItems) ? 4 : (f.ButtonForm) ? 5 : (f.QForm0 && f.Buttons0) ? 6 : 0;		} else if (hpObj(d, 'MainDiv')) {			v = 6;			var obj = (f.QForm) ? f.QForm.elements : null;			t = (obj && obj.length>0 && obj[0].id=='') ? 1 : (f.Cloze) ? 2 : (hpObj(d, 'GridDiv') || hpObj(d, 'Clues')) ? 3 : hpObj(d, 'MatchDiv') ? 4 : hpObj(d, 'SegmentDiv') ? 5 : ((f.QForm && f.QForm.Guess) || hpObj(d, 'Questions')) ? 6 : 0;				// sniff Rottmeier quizzes			if (window.Create_StateArray) {				if (t==2) { // JCloze					var obj = new Create_StateArray();					if (typeof(obj.GapLocked)=='boolean') r = 1; // drop-down (v2.4)					else if (typeof(obj.ErrorFound)=='boolean') r = 2; // find-it (v3.1a + v3.1b)					obj = null; // prevents memory leakage on some versions of IE				}			}		} else if (hpObj(d, 'D0')) {			v = 6.1; // drag and drop (HP5 and HP6)			t = (hpObj(d, 'F0')) ? 4 : (hpObj(d, 'Drop0')) ? 5 : 0;		} else if (w.Words && f.Rhubarb) {			v = 6;			t = 7; // rhubarb (TexToys)		} else if (w.Segments && hpObj(d, 'Story')) {			v = 6;			t = 8; // sequitur (TexToys)		}		quiz.v = v; // intended browser version		quiz.t = t; // quiz type		quiz.r = r; // rottmeier quiz type	}}
meta: 752	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/752/5237207862290e6950c71339743289f4d2d5f4d3/hotpot-full.js/clean/mod/hotpot/hotpot-full.js