/*if (token2 > tdat.length) 
if (token2 > tdat.length) 
	function walk(dat, def, path, value, sudo, extra) 	{				var setter, token, result, tdat, tdef, k, token2, tdat2, di, token3;		 		setter = typeof value === "string";		token = path.shift();				if (!def) 		{			return setReturn(401, 'Unknown element: ' + token, 'false');		}		tdat = dat[token];		tdef = def[token];				if (!tdef) 		{			return setReturn(401, 'Unknown element: ' + token, 'false');		}				if (tdef.type == Function) // adl.nav.request.choice ... target=blabla 		{			token2 = path.shift();			result = tdef.children.type.getValue(token2, tdef.children); 			return setReturn(0, '', result);		}		if (path[0] && path[0].charAt(0)==="_") 		{			if (path.length>1) 			{				return setReturn(401, 'Unknown element', '');			}			if (setter) 			{				return setReturn(404, 'read only', false);			}			if ('_children' === path[0]) 			{				if (!tdef.children) 				{					return setReturn(301, 'Data model element does not have children', '');				}				result = []; 				for (k in tdef.children) 				{					result.push(k);				}  				return setReturn(0, '', result.join(","));			}						if ('_count' === path[0]) 			{				return tdef.type !== Array ? 					setReturn(301, 'Data model element cannot have count', '') :					setReturn(0, '', (tdat && tdat.length ? tdat.length : 0).toString());			}				if (token==="cmi" && '_version' === path[0]) 			{				return setReturn(0, '', '1.0');			}		}		if (tdef.type == Array) // checks two tokens in one step e.g. "interactions" and "1"		{			token2 = path.shift() || "";			var m = token2.match(/^([^\d]*)(0|[1-9]\d{0,8})$/);			if (token2.length===0 || m && m[1]) 			{				return setReturn(401, 'Index expected');			} 			else if (!m) 			{				return setReturn(setter ? 351 : 301, 'Index not an integer');			}			token2 = Number(token2);			tdat = tdat ? tdat : new Array();			tdat2 = tdat[token2];			token3 = path[0] || null;			//alert(tdat.length+ "compared to:"+token2);					if (setter)			{				/*if (token2 > tdat.length) 				{					return setReturn(351, 'Data model element collection set out of order');				}*/				if (tdef.maxOccur && token2+1 > tdef.maxOccur) 				{					return setReturn(301, '');				}				if (tdat2 === undefined) 				{					tdat2 = new Object();				}				extra.index = token2;				extra.parent.push(dat);				if (tdef.unique===token3)				{					for (di=tdat.length; di--;) 					{						if (tdat[di][tdef.unique]===value) 						{							if (di!==token2) 							{								extra.error = {code: 351, diagnostic: "not unique"};								break;							}						}					}				}				result = walk(tdat2, tdef.children, path, value, sudo, extra);				if (!error) 				{					tdat[token2] = tdat2;					dat[token] = tdat;				}				return result;			}			else if (tdat2)			{				return walk(tdat2, tdef.children, path, value, sudo, extra);			}			else			{				return setReturn(301, 'Data Model Collection Element Request Out Of Range');			}		}				if (tdef.type == Object)		{			if (typeof tdat === "undefined") // FF fails on  (tdat === undefined)			{				if (setter)				{					tdat = new Object();					extra.parent.push(dat);					result = walk(tdat, tdef.children, path, value, sudo, extra);					if (!error) 					{						dat[token] = tdat;					}					return result;				}				else				{					return setReturn(tdef.children[path.pop()] ? 403 : 401, 'Not inited or defined: ' + token);				}			}			else			{				if (setter) {					extra.parent.push(dat);				}				return walk(tdat, tdef.children, path, value, sudo, extra);			}		}				if (setter)		{			if (tdef.writeOnce && dat[token] && dat[token]!=value) 			{				return setReturn(351, 'write only once');			}			if (tdef.permission === READONLY && !sudo) 			{				return setReturn(404, 'readonly:' + token);			}			if (path.length)  			{ 				return setReturn(401	, 'Unknown element');			}			if (tdef.dependsOn) {				extra.parent.push(dat);				var dep = tdef.dependsOn.split(" ");				for (di=dep.length; di--;) 				{					var dj = extra.parent.length-1;					var dp = dep[di].split(".");					var dpar = extra.parent;					if (dpar[dpar.length-dp.length][dp.pop()]===undefined)					{						return setReturn(408, 'dependency on ..' + dep[di]);					}				}			}			result = tdef.type.isValid(value, tdef, extra);			if (extra.error) 			{				return setReturn(extra.error.code, extra.error.diagnostic);			}			if (!result) 			{				return setReturn(406, 'value not valid');			}			if (value.indexOf("{order_matters")==0){	window.order_matters = true;} 			dat[token] = value;			dirty = true;			return setReturn(0, '');		}		else // getter		{			if (tdef.permission === WRITEONLY && !sudo) 			{				return setReturn(405, 'writeonly:' + token);			}			else if (path.length)  			{ 				return setReturn(401, 'Unknown element');			}			else if (tdef.getValueOf) 			{				return setReturn(0, '', tdef.getValueOf(tdef, tdat));			}			else if (tdat===undefined || tdat===null)			{				if (tdef['default']) 				{					return setReturn(0, '', tdef['default']);				}				else				{					return setReturn(403, 'not initialized ' + token);				}			} 			else			{if (window.order_matters) {	window.order_matters = false;} 				return setReturn(0, '', String(tdat));			}		}	}
6251	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/6251/a5d1d329f71095a5c0c81c6399a53ea97893b4ce/rte.js/clean/Modules/Scorm2004/scripts/rte.js