<!-- 
// (C) 2001 TrainingTools.com
// WhereWasI(TM) is a Trademark of TrainingTools.com
// WhereWasIt(TM) is a Trademark of TrainingTools.com

var winpopup;
var pageLocation = new String();
var nextyear = new Date();
var x=0;
			
pageLocation = document.location.href;
			
nextyear.setFullYear(nextyear.getFullYear() +1);
			
course_dir = pageLocation.split('/');
while (course_dir[x] != "tutorial") {
	x=x+1;
	}//end while
course_name=course_dir[x+1];
			
MountPoint = course_dir[0]+"/";
for (y=1;y<=x;y++) {
	MountPoint += course_dir[y] + "/";
	}

//Preload our images
var WWIT_off = new Image();
WWIT_off.src = "../../WhutWuzIt.gif";

var WWIT_on = new Image();
WWIT_on.src = "../../WhutWuzIt2.gif"
//alert('Loaded...');

function MouseOver(imageName,state) {
	if (document.images) { // if browser supports images
		//alert('called MouseOver, browser supports images');
		if( eval(imageName + "_" + state + ".complete") ) { //is the image completely downloaded
			//alert('called MouseOver, browser supports images, load completed');
			//alert(document.images[imageName].src);
			//alert(eval( imageName + "_" + state + ".src" ));
			document.images[imageName].src = eval( imageName + "_" + state + ".src" );
			} //end if
		} //end if
} //end function MouseOver

function nav(pagenum,path) {
			if (winpopup) if (winpopup.closed == false) winpopup.close();
			//alert(path);
			document.cookie = "Bookmark"+ escape(course_name) +"=Course=" + escape(course_name) + "&Chapter=" + escape(path) + "&Page=" + escape(pagenum) + "; expires="+nextyear.toGMTString() + "; path=/;";

			//alert(MountPoint + course_name + "/"+path+"pg"+pagenum+"_text.htm");

			parent.frames[1].location.href= MountPoint + course_name + "/"+path+"pg"+pagenum+"_nav.htm";			
			parent.frames[0].location.href= MountPoint + course_name + "/"+path+"pg"+pagenum+"_text.htm";
			parent.parent.frames[0].location.href="/tutorial/"+ course_name +"/top.htm";

}// End nav Function

function getCookie( cookie_var ) {

	//Retrieve all of the cookies into a variable called all cookies 
	var allcookies = document.cookie; 

	//Locate the position of the cookie label
	var pos = allcookies.indexOf(cookie_var);      

	// if pos = -1 then cookie label wasn't found 
	if (pos != -1) { 
      
		//Locate the beginning and end of the value of our cookie label

		// Locate the start of the cookie var add the # characters found plus one 
		var start = pos + cookie_var.length; 
           
		//find the end of the value 
		var end = allcookies.indexOf(";",start); 
      
		// if end is equal to negative one then set it to the length of allcookies 
		if (end == -1) end = allcookies.length; 
           
	     //convert the sub string or value of the parameter and store it in answer. 
		answer = unescape( allcookies.substring(start,end) ); 
		
		//display the value 
		//alert(answer); 
		
		return answer;
	} // end if 

} //end function getCookie

function Format_What( pagenum, path ) {
	var WhatWuzIt, chapter, course;
	var args = new Object();

	WhatWuzIt = getCookie("WWIT"+ escape( course_name ) + path + pagenum + "=" );
	//alert(WhatWuzIt);
	if (WhatWuzIt != null){
	
		var pairs = WhatWuzIt.split('&');
		for( var i=0; i < pairs.length; i++ ) {
			var pos = pairs[i].indexOf('=');
			if (pos==-1) continue;
			var argname = pairs[i].substring(0,pos);
			//alert(argname);
			var value = pairs[i].substring(pos+1);
			//alert(value);
			args[argname] = unescape(value);
		} //end for
	
		//var pagePath = '/tutorial/' + args['Course'] + '/'+ args['Chapter'] +"pg"+args['Page']+"_text.htm";
		//alert(pagePath);
		return args['WWIT'];
	} else {
		return "";
	} //end if
}//end func Format_BookMarks

function WhutItWuzStatus( pagenum,path ) {

	var WhatItWuz = Format_What(pagenum,path);
	//alert(WhatItWuz);
	if ( WhatItWuz.length > 0 ) {
	
		MouseOver('WWIT','on');
		}
	else {
  		MouseOver('WWIT','off');
		}
} //end func WhutItWuzStatus
	
function CheckWhutItWuz( pagenum,path, create) {

	var WhatItWuz = Format_What(pagenum,path);
	//alert(WhatItWuz);
	if (WhatItWuz.length > 0 || create == 'yes') {
	
		MouseOver('WWIT','on');
			
		winpopup = window.open('','popup','height=230,width=310,menubar=no,scrollbars=yes,status=no,toolbar=no,screenX=100,screenY=100,left=100,top=100');
		winpopup.focus();
		//winpopup.document.open('text/plain');

		 //stuff = "<SCRIPT LANGUAGE=\"JAVASCRIPT\" SRC=\"../../Setbkmrk.js\"></SCRIPT>\n";
		var stuff = "<SCRIPT LANGUAGE=\"JAVASCRIPT\">\n";
		stuff=stuff+"function CreateWhatWasIt(pagenum,path) { \n";
		stuff=stuff+"var pageLocation = new String();\n";
		stuff=stuff+"var nextyear = new Date();\n";
		stuff=stuff+"var lifetime='; expires='+nextyear.toGMTString();\n";
		stuff=stuff+"var x=0;\n";
			
		stuff=stuff+"pageLocation = document.location.href;\n";
			
		stuff=stuff+"nextyear.setFullYear(nextyear.getFullYear() +1);\n";
			
		stuff=stuff+"course_dir = pageLocation.split('/');\n";
		stuff=stuff+"while (course_dir[x] != 'tutorial') {\n";
		stuff=stuff+"	x=x+1;\n";
		stuff=stuff+"}//end while\n";
		stuff=stuff+"course_name=course_dir[x+1];\n";
			
		stuff=stuff+"MountPoint = course_dir[0]+'/';\n";
		stuff=stuff+"for (y=1;y<=x;y++) {\n";
		stuff=stuff+"	MountPoint += course_dir[y] + '/';\n";
		stuff=stuff+"	}\n";
			
		//alert(path);
		stuff=stuff+"//alert('WWIT'+ escape(course_name) +'=Course=' + escape(course_name) + '&Chapter=' + escape(path) + '&Page=' + escape(pagenum) + '&WWIT='+escape(document.form1.WWIT.value)+'; expires='+nextyear.toGMTString() + '; path=/;'); \n";
		//stuff=stuff+"window.document.domain=;\n";
		//clear notation if empty
		stuff=stuff+"if(document.form1.WWIT.value != '') lifetime = '; expires='+nextyear.toGMTString(); ";

		stuff=stuff+"window.opener.document.cookie='WWIT'+ escape(course_name) + escape(path) + escape(pagenum) + '=WWIT='+escape(document.form1.WWIT.value)+ lifetime + '; path=/;'; \n";
		stuff=stuff+"} // end CreateWhatWasIt\n";
		stuff=stuff+"</SCRIPT>\n";
	
		winpopup.document.write('<HTML>\n<HEAD>\n');
		winpopup.document.write('<TITLE>WhatWasIt?</TITLE>\n');
		winpopup.document.writeln(stuff);

		winpopup.document.write('</HEAD>\n');
		winpopup.document.write('<BODY >\n');
		winpopup.document.write('<form name="form1" method="post" action="">\n');
		winpopup.document.write('<IMG SRC="../../whatwasit_title.gif"><BR>\n');
		winpopup.document.write('<textarea name="WWIT" ROWS="7" COLS="30" WRAP="virtual">'+WhatItWuz+'</Textarea>\n<BR>\n');
		winpopup.document.write('<A HREF="javascript:" onclick="CreateWhatWasIt(\''+pagenum+'\',\''+path+ '\'); window.close();"><IMG SRC="../../save_note.gif" BORDER="0"></A>');
		//winpopup.document.write('<input type="Button" name="Submit" value="Save" onclick="CreateWhatWasIt(\''+pagenum+'\',\''+path+ '\'); window.close();">\n');
		winpopup.document.write('<A HREF="javascript:" onclick="document.form1.WWIT.value=\'\';CreateWhatWasIt(\''+pagenum+'\',\''+path+ '\'); window.close();"><IMG SRC="../../delete_note.gif" BORDER="0"></A>');
		//winpopup.document.write('<input type="Button" name="Submit" value="Delete" onclick="document.form1.WWIT.value=\'\';CreateWhatWasIt(\''+pagenum+'\',\''+path+ '\'); window.close();">\n');
		winpopup.document.write('<A HREF="javascript:" onclick="window.print();"><IMG SRC="../../print_note.gif" BORDER="0"></A>\n');
		//winpopup.document.write('<input type="Button" name="Submit" value="Print" onclick="window.print();"\n');
		winpopup.document.write('</form>\n');
		//winpopup.document.write(document.location.href);
		winpopup.document.write('</BODY>\n');
		winpopup.document.write('</HTML>\n');
		winpopup.document.close();
		} //end if
}


function GetWhutItWuz( course_name ) {
 	winpopup = window.open('../../WhatWuzIt.htm','popup','height=250,width=250,menubar=no,scrollbars=yes,status=no,toolbar=no,screenX=100,screenY=100,left=100,top=100');
//return Format_What( course_name ) ;
}



<!-- 

// -->



