// These global variables are used for storage (used in the E2 set of tools)

var E2_toolkit=1 ;                         // used in generic procedures to signal that E2 library is being used (ie. writeStatus

var debugMode=0;                      // controls debug output: 0=none, 1=some, 2=too much (including debug window of contents)
var useFooter_flag=1 ;              // controls the creation, and use, of the "footer" block (at the bottom of the browser screen. 1=Yes, 0=No
var useHeader_flag=1 ;              // controls the creation, and use, of the "header" block (at the top of the browser screen. 1=Yes, 0=No
var strongTyping=2 ;                // enable strong typig of survey variable lookup (error generated if non existent variable). 0=no, 1=yes, 2=if debug_mode is on
// Note: this debugMode "javascript" variable is only used if debug_Mode "session-descriptor variable" is NOT specified 

var enableStrongTyping=0 ;          // this is changed, depending on values of strongTyping and debugMode (or debug_mode)

var specSections=new Object()  ;   // used to store SPEC info of all varieties.
    specSections['timerSpecs']=new Object() ; 
    specSections['saveNodeList']={} ;

var statusHistoryStuff=new Object() ;
    statusHistoryStuff.content='' ;
    statusHistoryStuff.count=0 ;

// attributes used when display a simpleHistory window
var simpleHistoryWindowAttributes='toolbar=0,location=0,directories=0,status=0,toolbar=0,scrollbars=1,resizable=1';
var simpleHistory={} ;                     // for storing simpleHistory specifications
    simpleHistory['names']=[];
    simpleHistory['gotSubmitted']=[];

// style used for first column (round column) of simpleHistory tables
var simpleHistoryStyleCol1='font-style:oblique;background-color:dcdcdc';        

var FileStuff= new Object()               // for storing pages (gotten from server)
var ControlVars=new Object() ;            // storage of various control paramters (such as from server)
var SvyGlobals=  new Object() ;           // for storage of current round's "global variables" (the dynamic vars downloaded or entered by participant)
var SvyGlobalsHistory=  new Object() ;        // archival storage of survey-globals
var SvyPriors=new Object() ;              // for storage of "prior" variables
var submitVars_list= new Object() ;        // for storage of "submitted" variables (used by the Do_Submit function)
var ModuleList= new Object()              // for storing modules

var gotParamFile=0 ;                   // used by Get_Parsm: set to 0 right before requesting paramters file from server, set to 1 when file recieved and parsed.
var queryFreq=4000        ;            // frequency to request info from server (reset in parameters file)
var showDescription=1  ;              // show description in footer
var messageBlockVuBgcolor='#edeeef' ; // background color used in popup message boxes (default is gray)

var valueSpecs=[] ;                             // for storage of attributes used to display input boxes 
var checkboxSpecs=[] ;                             // for storage of attributes used to display checkboxes 
var radioSpecs=[] ;                             // for storage of attributes used to display radio buttons
    radioSpecs[0]={};            // store some lookup tables here
var loopVarList={} ;            // for storing loop variable status (used by event handlers)

var doitSpecs=[] ;                             // for storage of equations specified in <doit>
var doitSpecsContent=[];                        // storage of <content> specified in <doit>

// the svyWindowSpecs is used to specify attributes for windows opened by the Do_VuModule, Do_RequestFileSvy,and div_to_frame functions.
// Object indices are by window (target) name; value is the "window open attributes"
// if a svyWindowsSpecs[target] is undefined, a default is used (typically  "toolbar=0,menubar=0,directories=0,scrollbars=1"

var svyWindowSpecs= new Object() ;
svyWindowSpecs['binfo']= "toolbar=0,scrollbars=1,menubar=0,directories=0,resizable=1" ;

supportedEvents=' EXEC BUTTON TIMER QUERY NOTIFY ';    // currently supported events (BE SURE to pad with spaces 

checkClassList=[];                      // list of elements with one of the special classes (SET, SUBMIT, KEYINC CHECKBOUNDS CONFIRM CHANGE INFOLINKS 

var doEquationsSet='' ;             // used to retain names of variables set in a call to e2_doEquations (used by retain="1" in a <INIT>)
var svy_retainVars='';              // used by retain="1" in <INIT>

var subStorage={} ;            // for storing <SUBS>

var listOfCssFiles=[];          // css files loaded (used for showingSource)


var  includesFile_iter=0   ;  // recursion check for <include>

var _writeAlertToken=0 ;        // used to suppress duration-close of writeAlert box (i.e.; a new writeAlert has closed)

var _popupWindowUse=0 ;    // ie hack (used by E2_xmlToDome 

var _queryState=0  ;    // used as default of state variable in <query>

var _spying=0 ;          // set to 1 if this is joinSpy 

var i_headerMessage,i_headerClientMessage,i_headerBlock,i_headerTime,i_headerButton ; // ids of blocks in header area 
   
var messageData={} ;                    // database for <message> data
var currentParticipants={};             // database for storing currentParticipant info (type="participants" in <general> area of CAP file

var  _dsvyRandoms={};           // used to store random-number-objects

var globalHistoryMaxRounds=4  ; //  maximum number of prior rounds to retain (in SvyGlobalsHistory object)

