//THE TOP SCRIPT, COLLECTING ALL THE USED SCRIPTS AND WRITING THEM IN THE CALLING WEB-PAGE
/* Revision-history
23-09-2002  New file by PG
10-10-2002 included the links .css here, moved this file and all ref's to the cask general root, stricter separated global and local scope, integrated the edu_interactive.js files into the files listed below   
27-9-2004 *fixed* lowercased "url_functs.js" because of Boerhaave server case-sensitive
*/
//debugging
//alert("included scripts_main.js")
function ia(string)
	{if(typeof i !="undefined"){alert(string+"\nThere is a global i with value "+i)}
	}

// WRITE ALL THE SCRIPTS TO INCLUDE IN THE LIST BELOW
//N.B.!!!! Don't forget the comma at the end of each .js file !!!!!!!
var glb_scriptlist=
"general_functs/test_functs.js,"    //no "+" at begin of 1st line
+"general_functs/debugsettings.js,"  //include the debug scripts first!!!
+"general_functs/debug.js,"			//include the debug scripts first!!!
+"display_functs/dhtmlapi.js,"
+"display_functs/display_in_nav_functs.js,"
+"display_functs/dynam_elem_functs.js,"
+"display_functs/expandcollapse.js,"
+"display_functs/maketable_functs.js,"
+"display_functs/objmoving_functs.js,"
+"display_functs/output_functs.js,"
+"display_functs/style_functs.js,"
+"display_functs/video_functs/changefilm.js,"
+"edu_functs/answerprocessing_functs/eventdecisionhandling.js,"
+"edu_functs/questionposing_functs/checktween.js,"
+"edu_functs/questionposing_functs/quiz_functs.js,"
+"general_functs/adobe_flash_functs.js,"
+"general_functs/autoexec_functs.js,"
+"general_functs/datetime.js,"
+"general_functs/designtools.js,"
+"general_functs/dom_functs.js,"
+"general_functs/declaration_glb_locations.js,"
+"general_functs/declaration_glb_objects.js,"
+"general_functs/declaration_glb_variables.js,"
+"general_functs/flash_communication_functs.js,"
+"general_functs/gen_programming.js,"
+"general_functs/init_plus_reset_functs.js,"
+"general_functs/language_functs.js,"
+"general_functs/logging.js,"
+"general_functs/maths.js,"
+"general_functs/metadata_functs.js,"
+"general_functs/promotional_plus_legal_functs.js,"
+"general_functs/scaling.js,"
+"general_functs/xml_functs.js,"
+"general_functs/admittance_functs/admittance_functs.js,"
//+"general_functs/menu_functs/lesson_list_constructor.js,"
+"general_functs/navigating_functs/navigation_between_pages.js,"
+"general_functs/navigating_functs/register_reading_scripts.js,"
+"general_functs/navigating_functs/state_functs.js,"
+"general_functs/navigating_functs/url_functs.js,"
+"general_functs/safety_functs/pageleavecontroller.js,"
+"general_functs/string_functs/conversion_functs.js,"
+"general_functs/string_functs/delimit_list_functs.js,"
+"general_functs/string_functs/stringfinding_functs.js,"
+"general_functs/windows_functs/openwin.js,"
+"general_functs/windows_functs/pass.js,"  //not yet very useful
+"input_functs/event_functs.js,"
+"input_functs/formreading_functs.js,"
+"input_functs/poscheck_functs.js,"



//THE GENERAL PATH FROM THE ROOT DIRECTORY TO THE DIRECTORY SHARED
var glb_pathfromroottoshared="shared/"















//===================================================================================
// MUTATIONS TO THE CODE BELOW IS NOT NECESSARY!!!
//N.B.: The word "script" is often broken or written incomplete 
//to avoid problems with .asp which will view it as a start of a new script

doinclude()

/////////////////////////////////////////////////////////////////////////////	
//FUNCTION DOINCLUDE()
/* Revision-history
??-10-2002  New file by PG
10-10-2002 included the link .css here
1-11-2006 ADD id's 'linked_stylesheet1,2' to the LINKs
*/
// writes all the .js files in the list above and the .css in the calling web-page	
function doinclude() 
    {var i
	// link the general style sheet repositories
	//NB: cask_styles1 to be replaced by cask_styles2 in the transition to CASK 2.0
	var string="<LINK rel=stylesheet type='text/css' id='linked_stylesheet1' href='"+glb_pathtoroot+glb_pathfromroottoshared+"css/cask_styles1.css'> "
	
	string+="<LINK rel=stylesheet type='text/css' id='linked_stylesheet2' href='"+glb_pathtoroot+glb_pathfromroottoshared+"css/cask_styles2.css'>"
	//alert(string)
	document.write(string)
	
	
	//put the .js files above in the array 'scrip' 
	var scrip= new Array
	scrip=readliststring(glb_scriptlist,",")

	// now write all the .js files in the calling (.htm or .asp) page
	for (i=0;i<scrip.length;i++)
		{
		var string="<SCR" + "IPT LANGUAGE='JavaScript1.2' src='"+glb_pathtoroot+glb_pathfromroottoshared+"scripts/"+scrip[i]+"'><\/SCR" + "IPT>"
		document.write(string)
		}
    }
	


/////////////////////////////////////////////////////////////////////////////	
/////////////////////////////////////////////////////////////////////////////	
//reads items in a string separated with a delimiter to an Array
//NB: It appeared to be necessary to include a copy of this function hard here:
//the document.write of it (func. readliststring()in delimit_list_coll.js) 
//appears to happen after get_scripts.js (with the calling of readliststring()) 
//is fully run. The calling of rls() here then causes an object missing error.
function readliststring(string,delimiter) 
	{var i
 	//init
	itemsread=new Array()
	arraypos=0
	substr=""
	//loop through all characters in the string
	for(i=0;i<string.length;i++) {
		if (string.charAt(i)!=delimiter) { //no delimiter character
            substr+=string.charAt(i)  //add this character to the previous read ones 
            } //end of if
		else { //delimiter reached
			itemsread[arraypos]=substr //place the substring in the array
			arraypos++ //set the pointer to the next arraypos
			substr="" //reset
			} //end else
		} //end of for loop
	if (substr!="") {//no delimiter on the end, the last substr must still be put in the array
        itemsread[arraypos]=substr //place the substring in the array
        }
	//ready; return result		
	return itemsread
    } //end of func readliststring


