/*

    Copyright 2003-2007 Purdue University. 

    Developed by: Peter Turbek, Department of Mathematics, Computer Science, and Statistics, Purdue University Calumet.


    This file is part of CaluMath.

    CaluMath is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    CaluMath is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

*/

//This file controls the various lists of CaluMath Page Maker objects//

if(window.CM_TopWindow==window){
//Comment: Everything here is for CM_TopWindow only.


//Comment: This file contains all of the functions that add objects created to various lists used in drop down menus. 

CaluMath.PM.GetListSetting= function(){
   //Comment: arguments[0] is a String, like "namedobjectlist" or "graphlist"
   var listtype=arguments[0];
   var tempobject=arguments[1];
   var tempcaswindow= tempobject.cm_getsetting("cm_caswindow");
   var tempnewplot= tempobject.cm_getsetting("newplot");
//   if(listtype=="functionplotlist" || listtype=="updatablefunctionplotlist" || listtype=="canaddhighlightslist" || listtype=="canaddtangentslist" || listtype=="cansupportsearcheslist" || listtype=="pointslist" || listtype=="draggedobjectslist" || listtype=="slidingscalelist"){
//   if(listtype=="rectangleslist" || listtype=="cansupportbuttonslist" || listtype=="functionplotlist" || listtype=="updatablefunctionplotlist" || listtype=="canaddhighlightslist" || listtype=="canaddtangentslist" || listtype=="cansupportsearcheslist" || listtype=="pointslist" || listtype=="draggedobjectslist" || listtype=="slidingscalelist"){
     if(CaluMath.PM.ListsSubordinateToNewPlotArray.cm_contains(listtype)){
      var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempnewplot][listtype],tempobject,2); 
      if(tempindex != null){
         return CaluMath.PM.PlotlistObject[tempnewplot][listtype][tempindex][1];
      };
   }
   else if(listtype=="namedobjectlist" || listtype=="staticobjectlist"){
      var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow][listtype],tempobject,2); 
      if(tempindex != null){
         return CaluMath.PM.PlotlistObject[tempcaswindow][listtype][tempindex][1];
      };
   }
   else{
      var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[listtype],tempobject,2); 
      if(tempindex != null){
         return CaluMath.PM.PlotlistObject[listtype][tempindex][1];
      };
   };
};

//I just added this. 

      CaluMath.PM.PlotlistObject["CM_ParentObject"]= new Object();
      CaluMath.PM.PlotlistObject["CM_ParentObject"].draggedobjectslist= new Array();
      CaluMath.PM.PlotlistObject["CM_ParentObject"].slidingscalelist= new Array();
//alerttest(CaluMath.PM.PlotlistObject["CM_ParentObject"]);

/*
      CaluMath.PM.PlotlistObject[temprequiredname].functionplotlist= new Array();
      CaluMath.PM.PlotlistObject[temprequiredname].updatablefunctionplotlist= new Array();
      CaluMath.PM.PlotlistObject[temprequiredname].pointslist= new Array();
      CaluMath.PM.PlotlistObject[temprequiredname].draggedobjectslist= new Array();
      CaluMath.PM.PlotlistObject[temprequiredname].linearplotlist= new Array();
      CaluMath.PM.PlotlistObject[temprequiredname].arcplotlist= new Array();
      CaluMath.PM.PlotlistObject[temprequiredname].animationplotlist= new Array();
      CaluMath.PM.PlotlistObject[temprequiredname].canaddhighlightslist= new Array();
      CaluMath.PM.PlotlistObject[temprequiredname].canaddtangentslist= new Array();
      CaluMath.PM.PlotlistObject[temprequiredname].canaddtextplotslist= new Array();
      CaluMath.PM.PlotlistObject[temprequiredname].cansupportbuttonslist= new Array();
      CaluMath.PM.PlotlistObject[temprequiredname].cansupportsearcheslist= new Array();
*/

//Comment: If newplot is named H. then CaluMath.PM.PlotlistObject.H is constructed and the following lists are properties of CaluMath.PM.PlotlistObject.H, for example CaluMath.PM.PlotlistObject.H.functionplotlist. This is not true of all lists, many lists are not properties of a newplot and are directly properties of CaluMath.PM.PlotlistObject. 
//CM_ListsSubordinateToNewPlotArray=["functionplotlist", "updatablefunctionplotlist", "pointslist","rectangleslist","draggedobjectslist","slidingscalelist","linearplotlist","arcplotlist","animationplotlist","canaddhighlightslist","canaddtangentslist","canaddtextplotslist","cansupportbuttonslist","cansupportsearcheslist","canaddverticeslist"];

//Comment: I stopped making slidingscalelist subordinate to newplotlist. 
//CaluMath.PM.ListsSubordinateToNewPlotArray=["functionplotlist", "updatablefunctionplotlist", "pointslist","textplotlist","rectangleslist","draggedobjectslist","slidingscalelist","linearplotlist","arcplotlist","canaddhighlightslist","canaddtangentslist","canaddtextplotslist","cansupportbuttonslist","cansupportsearcheslist","canaddverticeslist"];
CaluMath.PM.ListsSubordinateToNewPlotArray=["functionplotlist", "updatablefunctionplotlist", "pointslist","textplotlist","rectangleslist","draggedobjectslist","linearplotlist","arcplotlist","canaddhighlightslist","canaddtangentslist","canaddtextplotslist","cansupportbuttonslist","cansupportsearcheslist","canaddverticeslist"];

CaluMath.PM.CheckAxesListExists = function(){
   var tempobject=arguments[0];
   var temprequiredplot= arguments[1]; 
   if(CaluMath.PM.PlotlistObject[temprequiredplot]==null){
      CaluMath.PM.PlotlistObject[temprequiredplot]= new Object();
      var CM_ListsSubordinateToNewPlotArraylength=CaluMath.PM.ListsSubordinateToNewPlotArray.length;
      for(var i=0; i< CM_ListsSubordinateToNewPlotArraylength; i++){
           CaluMath.PM.PlotlistObject[temprequiredplot][CaluMath.PM.ListsSubordinateToNewPlotArray[i]]= new Array();
      };
   };
};



CaluMath.PM.AddToListsnewplot=function(){ 
   var tempobject=arguments[0];
   var temprequiredname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");
   CaluMath.PM.PlotlistObject.newplotlist=CaluMath.PM.PlotlistObject.newplotlist.concat([[temprequiredname, temprequiredname, tempobject, tempobject.name]]);
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.concat([[temprequiredname, temprequiredname, tempobject, tempobject.name]]);
   if(CaluMath.PM.PlotlistObject[temprequiredname]==null){
      CaluMath.PM.PlotlistObject[temprequiredname]=new Object();
//Comment: NOTE THAT ALL OF THESE MUST BE ADDRESSED IN CaluMath.PM.AssignOldValues IN CaluMath.PM.PageMakerMainFile.js AND ALSO IN CaluMath.PM.GetListSetting ABOVE //// 
      var CM_ListsSubordinateToNewPlotArraylength=CaluMath.PM.ListsSubordinateToNewPlotArray.length;

      CaluMath.PM.PlotlistObject[temprequiredname].newplot=tempobject;
      for(var i=0; i< CM_ListsSubordinateToNewPlotArraylength; i++){
           CaluMath.PM.PlotlistObject[temprequiredname][CaluMath.PM.ListsSubordinateToNewPlotArray[i]]= new Array();
      };
   };

   if(CaluMath.PM.PlotlistObject[temprequiredname].newplot==null){
      CaluMath.PM.PlotlistObject[temprequiredname].newplot=tempobject;
   };

   var temprequiredname= CaluMath.PM.GetPageMakerGraphFullName(tempobject);
   var caswindow= CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");
   CaluMath.PM.PlotlistObject.namedobjectlist.push([temprequiredname+".xaxis", temprequiredname+".cm_xaxiscollection", tempobject]);
   CaluMath.PM.PlotlistObject.namedobjectlist.push([temprequiredname+".yaxis", temprequiredname+".cm_yaxiscollection", tempobject]);
   CaluMath.PM.PlotlistObject.namedobjectlist.push([temprequiredname+".xticks", temprequiredname+".cm_xtickcollection", tempobject]);
   CaluMath.PM.PlotlistObject.namedobjectlist.push([temprequiredname+".yticks", temprequiredname+".cm_ytickcollection", tempobject]);
   CaluMath.PM.PlotlistObject.namedobjectlist.push([temprequiredname+".xlabels", temprequiredname+".cm_xlabelcollection", tempobject]);
   CaluMath.PM.PlotlistObject.namedobjectlist.push([temprequiredname+".ylabels", temprequiredname+".cm_ylabelcollection", tempobject]);
};

CaluMath.PM.PageMakernewplotDefault.ListArray=["newplotlist","graphlist"];

CaluMath.PM.DeleteFromListsnewplot=function(){
   var tempobject=arguments[0];
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");
   var tempname= CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.newplotlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.newplotlist=CaluMath.PM.PlotlistObject.newplotlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.newplotlist.slice(tempindex+1));
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.graphlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.graphlist.slice(tempindex+1));
   //Comment: We do this once each for xaxis, yaxis, xticks, yticks, xlabel and ylabel
   for(var i=0; i<6; i++){
      var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.namedobjectlist,tempobject,2); 
      CaluMath.PM.PlotlistObject.namedobjectlist=CaluMath.PM.PlotlistObject.namedobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.namedobjectlist.slice(tempindex+1));
   };
};


CaluMath.PM.MakeSpecialAddToLists=function(){ 
//Comment: This is a function that returns, for now, either CaluMath.PM.AddToListsdefinedconstant or CaluMath.PM.AddToListsdefinedfunction. It is used for objects, such as definedconstant or definedfunction, where defining a new constant or function with the same name as a previous one overwrites the previous one.
   var type=arguments[0];

   if(type !="splitfunction" && type !="gettextboxvalue" && type !="getboxindex" ){
      var typeliststring=type+"list"; 
   }
   else if(type =="splitfunction"){
      var typeliststring="definedfunctionlist"; 
   }
   else{
      var typeliststring="variablenamelist"; 
   }
   var tempfunction=function(){
      var tempobject=arguments[0];
      var nameinput=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 
      var typelist=CaluMath.PM.PlotlistObject[typeliststring];
      var typelistlength=typelist.length;
      if(typelistlength==0){
         CaluMath.PM.PlotlistObject[typeliststring]=CaluMath.PM.PlotlistObject[typeliststring].concat([[nameinput,nameinput, tempobject, tempobject.name]]);
      }
      else{
      //Comment: I have commented out all the things that stop you from renaming constants variables and functions.
         CaluMath.PM.PlotlistObject[typeliststring]=CaluMath.PM.PlotlistObject[typeliststring].concat([[nameinput,nameinput, tempobject, tempobject.name]]);
      };
      if(type=="definedfunction" || type=="splitfunction"){
         var typelist=CaluMath.PM.PlotlistObject["allfunctionslist"];
         var typelistlength=typelist.length;
         if(typelistlength==0){
            CaluMath.PM.PlotlistObject["allfunctionslist"]=CaluMath.PM.PlotlistObject["allfunctionslist"].concat([[nameinput,nameinput, tempobject, tempobject.name]]);
         }
         else{
         //Comment: I have commented out all the things that stop you from renaming constants variables and functions.
            CaluMath.PM.PlotlistObject["allfunctionslist"]=CaluMath.PM.PlotlistObject["allfunctionslist"].concat([[nameinput,nameinput, tempobject, tempobject.name]]);
         };
      };
   };
   return window["CaluMath"]["PM"]["AddToLists"+type]=tempfunction;

};

CaluMath.PM.PageMakerdefinedconstantDefault.ListArray=["definedconstantlist"];
CaluMath.PM.PageMakervariablenameDefault.ListArray = ["namedobjectlist", "variablenamelist"];
CaluMath.PM.PageMakerdefinedfunctionDefault.ListArray=["definedfunctionlist"];
CaluMath.PM.PageMakersplitfunctionDefault.ListArray=["definedfunctionlist"];
CaluMath.PM.PageMakergettextboxvalueDefault.ListArray = ["variablenamelist"];
CaluMath.PM.PageMakergetboxindexDefault.ListArray = ["variablenamelist"];

//Comment: The returns from the two functions below are CaluMath.PM.AddToListsdefinedconstant and CaluMath.PM.AddToListsdefinedfunction.
CaluMath.PM.MakeSpecialAddToLists("definedconstant");
CaluMath.PM.MakeSpecialAddToLists("variablename");
CaluMath.PM.MakeSpecialAddToLists("definedfunction");
CaluMath.PM.MakeSpecialAddToLists("splitfunction");
CaluMath.PM.MakeSpecialAddToLists("gettextboxvalue");
CaluMath.PM.MakeSpecialAddToLists("getboxindex");

CaluMath.PM.DeleteFromListsdefinedconstant=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.definedconstantlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.definedconstantlist=CaluMath.PM.PlotlistObject.definedconstantlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.definedconstantlist.slice(tempindex+1));
};

CaluMath.PM.DeleteFromListsvariablename=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.variablenamelist,tempobject,2); 
   CaluMath.PM.PlotlistObject.variablenamelist=CaluMath.PM.PlotlistObject.variablenamelist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.variablenamelist.slice(tempindex+1));
};


CaluMath.PM.DeleteFromListsdefinedfunction=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.definedfunctionlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.definedfunctionlist=CaluMath.PM.PlotlistObject.definedfunctionlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.definedfunctionlist.slice(tempindex+1));
};

CaluMath.PM.DeleteFromListssplitfunction=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.definedfunctionlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.definedfunctionlist=CaluMath.PM.PlotlistObject.definedfunctionlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.definedfunctionlist.slice(tempindex+1));
};

CaluMath.PM.DeleteFromListsgettextboxvalue=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.variablenamelist,tempobject,2); 
   CaluMath.PM.PlotlistObject.variablenamelist=CaluMath.PM.PlotlistObject.variablenamelist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.variablenamelist.slice(tempindex+1));
};

CaluMath.PM.DeleteFromListsgetboxindex=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.variablenamelist,tempobject,2); 
   CaluMath.PM.PlotlistObject.variablenamelist=CaluMath.PM.PlotlistObject.variablenamelist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.variablenamelist.slice(tempindex+1));
};

CaluMath.PM.AddToListsdiscretefunctionfrompointsarray=function(){ 
   var tempobject=arguments[0];
   var tempname=tempobject.cm_getsetting("name")
   CaluMath.PM.PlotlistObject["discretefunctionlist"].push([tempname, tempname, tempobject]);
   CaluMath.PM.PlotlistObject["allfunctionslist"].push([tempname, tempname, tempobject]);
};

CaluMath.PM.DeleteFromListsdiscretefunctionfrompointsarray=function(){ 
   var tempobject=arguments[0];
   var tempname=tempobject.cm_getsetting("name");
      var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject["discretefunctionlist"],tempobject,2); 
      CaluMath.PM.PlotlistObject["discretefunctionlist"]=CaluMath.PM.PlotlistObject["discretefunctionlist"].slice(0,tempindex).concat(CaluMath.PM.PlotlistObject["discretefunctionlist"].slice(tempindex+1));
      var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject["allfunctionslist"],tempobject,2); 
      CaluMath.PM.PlotlistObject["allfunctionslist"]=CaluMath.PM.PlotlistObject["allfunctionslist"].slice(0,tempindex).concat(CaluMath.PM.PlotlistObject["allfunctionslist"].slice(tempindex+1));
};

//CaluMath.PM.PageMakerdiscretefunctionfrompointsarrayDefault.ListArray=["graphlist", "cansupportbuttonslist"];
CaluMath.PM.PageMakerdiscretefunctionfrompointsarrayDefault.ListArray=["discretefunctionplot"];

      

  
CaluMath.PM.AddToListsfunctionplot=function(){ 
   var tempobject=arguments[0]; //alerttest(tempobject);
   var temprequiredplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot"); 
   var temprequiredname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"definedfunction"); 

   //Comment: We do this in case a newly loaded page is being parsed and functionplots etc. are defined in a button action or 
   // routine before the axes are created. 
   CaluMath.PM.CheckAxesListExists(tempobject, temprequiredplot);

      CaluMath.PM.PlotlistObject[temprequiredplot].functionplotlist=CaluMath.PM.PlotlistObject[temprequiredplot].functionplotlist.concat([[temprequiredname,temprequiredname,tempobject]]);
      CaluMath.PM.PlotlistObject[temprequiredplot].canaddhighlightslist=CaluMath.PM.PlotlistObject[temprequiredplot].canaddhighlightslist.concat([[temprequiredname,temprequiredname,tempobject]]);
      CaluMath.PM.PlotlistObject[temprequiredplot].canaddtangentslist=CaluMath.PM.PlotlistObject[temprequiredplot].canaddtangentslist.concat([[temprequiredname,temprequiredname,tempobject]]);
      CaluMath.PM.PlotlistObject[temprequiredplot].canaddtextplotslist=CaluMath.PM.PlotlistObject[temprequiredplot].canaddtextplotslist.concat([[temprequiredname,temprequiredname,tempobject]]);
      CaluMath.PM.PlotlistObject[temprequiredplot].cansupportbuttonslist.push([temprequiredname,temprequiredname,tempobject]);
      CaluMath.PM.PlotlistObject[temprequiredplot].cansupportsearcheslist.push([temprequiredname,temprequiredname,tempobject]);
      var temprequiredname= CaluMath.PM.GetPageMakerGraphFullName(tempobject);
      CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.concat([[temprequiredname,temprequiredname,tempobject]]);

};

CaluMath.PM.PageMakerfunctionplotDefault.ListArray=["functionplotlist", "canaddhighlightslist", "canaddtangentslist", "canaddtextplotslist", "graphlist", "cansupportbuttonslist", "cansupportsearcheslist"];

CaluMath.PM.DeleteFromListsfunctionplot=function(){
   var tempobject=arguments[0];
   var tempplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot");
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].functionplotlist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].functionplotlist=CaluMath.PM.PlotlistObject[tempplot].functionplotlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].functionplotlist.slice(tempindex+1));

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].canaddtangentslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].canaddtangentslist=CaluMath.PM.PlotlistObject[tempplot].canaddtangentslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].canaddtangentslist.slice(tempindex+1));

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].canaddhighlightslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].canaddhighlightslist=CaluMath.PM.PlotlistObject[tempplot].canaddhighlightslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].canaddhighlightslist.slice(tempindex+1));

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].canaddtextplotslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].canaddtextplotslist=CaluMath.PM.PlotlistObject[tempplot].canaddtextplotslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].canaddtextplotslist.slice(tempindex+1));

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].cansupportbuttonslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].cansupportbuttonslist.splice(tempindex,1); 

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].cansupportsearcheslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].cansupportsearcheslist.splice(tempindex,1); 

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.graphlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.graphlist.slice(tempindex+1));

};

CaluMath.PM.AddToListsdiscretefunctionplot=function(){ 
   var tempobject=arguments[0]; //alerttest(tempobject);
   var temprequiredplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot"); 
   var temprequiredname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"discretefunction"); 

   //Comment: We do this in case a newly loaded page is being parsed and functionplots etc. are defined in a button action or 
   // routine before the axes are created. 
   CaluMath.PM.CheckAxesListExists(tempobject, temprequiredplot);

      CaluMath.PM.PlotlistObject[temprequiredplot].canaddhighlightslist=CaluMath.PM.PlotlistObject[temprequiredplot].canaddhighlightslist.concat([[temprequiredname,temprequiredname,tempobject]]);

      var temprequiredname= CaluMath.PM.GetPageMakerGraphFullName(tempobject);
      CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.concat([[temprequiredname,temprequiredname,tempobject]]);

};

CaluMath.PM.PageMakerfunctionplotDefault.ListArray=["graphlist"];

CaluMath.PM.DeleteFromListsdiscretefunctionplot=function(){
   var tempobject=arguments[0];
   var tempplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot");

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.graphlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.graphlist.slice(tempindex+1));

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].canaddhighlightslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].canaddhighlightslist=CaluMath.PM.PlotlistObject[tempplot].canaddhighlightslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].canaddhighlightslist.slice(tempindex+1));

};



CaluMath.PM.AddToListsupdatablefunctionplot=function(){ 
   var tempobject=arguments[0]; //alerttest(tempobject);
   var temprequiredplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot"); 
   var temprequiredname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 

   //Comment: We do this in case a newly loaded page is being parsed and functionplots etc. are defined in a button action or 
   // routine before the axes are created. 
   CaluMath.PM.CheckAxesListExists(tempobject, temprequiredplot);

      CaluMath.PM.PlotlistObject[temprequiredplot].functionplotlist=CaluMath.PM.PlotlistObject[temprequiredplot].functionplotlist.concat([[temprequiredname,temprequiredname,tempobject]]);
      CaluMath.PM.PlotlistObject[temprequiredplot].updatablefunctionplotlist=CaluMath.PM.PlotlistObject[temprequiredplot].updatablefunctionplotlist.concat([[temprequiredname,temprequiredname,tempobject]]);
      CaluMath.PM.PlotlistObject[temprequiredplot].canaddhighlightslist=CaluMath.PM.PlotlistObject[temprequiredplot].canaddhighlightslist.concat([[temprequiredname,temprequiredname,tempobject]]);
      CaluMath.PM.PlotlistObject[temprequiredplot].canaddtangentslist=CaluMath.PM.PlotlistObject[temprequiredplot].canaddtangentslist.concat([[temprequiredname,temprequiredname,tempobject]]);
      CaluMath.PM.PlotlistObject[temprequiredplot].canaddtextplotslist=CaluMath.PM.PlotlistObject[temprequiredplot].canaddtextplotslist.concat([[temprequiredname,temprequiredname,tempobject]]);
      CaluMath.PM.PlotlistObject[temprequiredplot].cansupportbuttonslist.push([temprequiredname,temprequiredname,tempobject]);
      CaluMath.PM.PlotlistObject[temprequiredplot].cansupportsearcheslist.push([temprequiredname,temprequiredname,tempobject]);
      var temprequiredname= CaluMath.PM.GetPageMakerGraphFullName(tempobject);
      CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.concat([[temprequiredname,temprequiredname,tempobject]]);

};

CaluMath.PM.PageMakerupdatablefunctionplotDefault.ListArray=["functionplotlist", "updatablefunctionplotlist", "canaddhighlightslist", "canaddtangentslist", "canaddtextplotslist", "graphlist", "cansupportbuttonslist", "cansupportsearcheslist"];

CaluMath.PM.DeleteFromListsupdatablefunctionplot=function(){
   var tempobject=arguments[0];
   var tempplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot");
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].functionplotlist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].functionplotlist=CaluMath.PM.PlotlistObject[tempplot].functionplotlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].functionplotlist.slice(tempindex+1));

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].updatablefunctionplotlist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].updatablefunctionplotlist=CaluMath.PM.PlotlistObject[tempplot].updatablefunctionplotlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].updatablefunctionplotlist.slice(tempindex+1));

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].canaddtangentslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].canaddtangentslist=CaluMath.PM.PlotlistObject[tempplot].canaddtangentslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].canaddtangentslist.slice(tempindex+1));

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].canaddhighlightslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].canaddhighlightslist=CaluMath.PM.PlotlistObject[tempplot].canaddhighlightslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].canaddhighlightslist.slice(tempindex+1));

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].canaddtextplotslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].canaddtextplotslist=CaluMath.PM.PlotlistObject[tempplot].canaddtextplotslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].canaddtextplotslist.slice(tempindex+1));

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].cansupportbuttonslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].cansupportbuttonslist.splice(tempindex,1); 

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].cansupportsearcheslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].cansupportsearcheslist.splice(tempindex,1); 

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.graphlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.graphlist.slice(tempindex+1));

};



CaluMath.PM.AddToListsarcplot=function(){ 
   var tempobject=arguments[0]; //alerttest(tempobject);
   var temprequiredplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot"); 
   var temprequiredname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 

   //Comment: We do this in case a newly loaded page is being parsed and functionplots etc. are defined in a button action or 
   // routine before the axes are created. 
   CaluMath.PM.CheckAxesListExists(tempobject, temprequiredplot);

      CaluMath.PM.PlotlistObject[temprequiredplot].arcplotlist=CaluMath.PM.PlotlistObject[temprequiredplot].arcplotlist.concat([[temprequiredname,temprequiredname,tempobject]]);
      CaluMath.PM.PlotlistObject[temprequiredplot].canaddhighlightslist=CaluMath.PM.PlotlistObject[temprequiredplot].canaddhighlightslist.concat([[temprequiredname,temprequiredname,tempobject]]);
      CaluMath.PM.PlotlistObject[temprequiredplot].canaddtangentslist=CaluMath.PM.PlotlistObject[temprequiredplot].canaddtangentslist.concat([[temprequiredname,temprequiredname,tempobject]]);
//      CaluMath.PM.PlotlistObject[temprequiredplot].canaddtextplotslist=CaluMath.PM.PlotlistObject[temprequiredplot].canaddtextplotslist.concat([[temprequiredname,temprequiredname,tempobject]]);
      CaluMath.PM.PlotlistObject[temprequiredplot].cansupportbuttonslist.push([temprequiredname,temprequiredname,tempobject]);
      CaluMath.PM.PlotlistObject[temprequiredplot].cansupportsearcheslist.push([temprequiredname,temprequiredname,tempobject]);
      var temprequiredname= CaluMath.PM.GetPageMakerGraphFullName(tempobject);
      CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.concat([[temprequiredname,temprequiredname,tempobject]]);

};

CaluMath.PM.PageMakerarcplotDefault.ListArray=["arcplotlist", "canaddhighlightslist", "canaddtangentslist",  "graphlist", "cansupportbuttonslist", "cansupportsearcheslist"];

CaluMath.PM.DeleteFromListsarcplot=function(){
   var tempobject=arguments[0];
   var tempplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot");
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].arcplotlist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].arcplotlist=CaluMath.PM.PlotlistObject[tempplot].arcplotlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].arcplotlist.slice(tempindex+1));

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].canaddtangentslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].canaddtangentslist=CaluMath.PM.PlotlistObject[tempplot].canaddtangentslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].canaddtangentslist.slice(tempindex+1));

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].canaddhighlightslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].canaddhighlightslist=CaluMath.PM.PlotlistObject[tempplot].canaddhighlightslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].canaddhighlightslist.slice(tempindex+1));

//   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].canaddtextplotslist,tempobject,2); 
//   CaluMath.PM.PlotlistObject[tempplot].canaddtextplotslist=CaluMath.PM.PlotlistObject[tempplot].canaddtextplotslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].canaddtextplotslist.slice(tempindex+1));

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].cansupportbuttonslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].cansupportbuttonslist.splice(tempindex,1); 

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].cansupportsearcheslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].cansupportsearcheslist.splice(tempindex,1); 

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.graphlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.graphlist.slice(tempindex+1));

};



  
CaluMath.PM.AddToListsanimationplot=function(){ 
   var tempobject=arguments[0]; //alerttest(tempobject);
   var temprequiredplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot"); 
   var temprequiredname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 

   //Comment: We do this in case a newly loaded page is being parsed and functionplots etc. are defined in a button action or 
   // routine before the axes are created. 
   CaluMath.PM.CheckAxesListExists(tempobject, temprequiredplot);

//      CaluMath.PM.PlotlistObject[temprequiredplot].animationplotlist=CaluMath.PM.PlotlistObject[temprequiredplot].animationplotlist.concat([[temprequiredname,temprequiredname,tempobject]]);
      CaluMath.PM.PlotlistObject[temprequiredplot].cansupportbuttonslist.push([temprequiredname,temprequiredname,tempobject]);
      var temprequiredname= CaluMath.PM.GetPageMakerGraphFullName(tempobject);
      CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.concat([[temprequiredname,temprequiredname,tempobject]]);
      CaluMath.PM.PlotlistObject.animationplotlist=CaluMath.PM.PlotlistObject.animationplotlist.concat([[temprequiredname,temprequiredname,tempobject]]);

};

CaluMath.PM.PageMakeranimationplotDefault.ListArray=["animationplotlist", "graphlist", "cansupportbuttonslist"];


CaluMath.PM.DeleteFromListsanimationplot=function(){
   var tempobject=arguments[0];
   var tempplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot");
//   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].animationplotlist,tempobject,2); 
//   CaluMath.PM.PlotlistObject[tempplot].animationplotlist=CaluMath.PM.PlotlistObject[tempplot].animationplotlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].animationplotlist.slice(tempindex+1));

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.graphlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.graphlist.slice(tempindex+1));
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].cansupportbuttonslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].cansupportbuttonslist.splice(tempindex,1); 
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.animationplotlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.animationplotlist=CaluMath.PM.PlotlistObject.animationplotlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.animationplotlist.slice(tempindex+1));
};

 
CaluMath.PM.AddToListscompositeanimation=function(){ 
   var tempobject=arguments[0]; //alerttest(tempobject);
   var temprequiredname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 

      CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.concat([[temprequiredname,temprequiredname,tempobject]]);
      CaluMath.PM.PlotlistObject.animationplotlist=CaluMath.PM.PlotlistObject.animationplotlist.concat([[temprequiredname,temprequiredname,tempobject]]);

};

CaluMath.PM.PageMakercompositeanimationDefault.ListArray=["animationplotlist", "graphlist"];


CaluMath.PM.DeleteFromListscompositeanimation=function(){
   var tempobject=arguments[0];

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.graphlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.graphlist.slice(tempindex+1));
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.animationplotlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.animationplotlist=CaluMath.PM.PlotlistObject.animationplotlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.animationplotlist.slice(tempindex+1));
};





CaluMath.PM.AddToListstangent=function(){ 
   var tempobject=arguments[0];
   var temprequiredplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot"); 
   var tempgraph=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"tangentparent"); 
   var temprequiredname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 

   //Comment: We do this in case a newly loaded page is being parsed and functionplots etc. are defined in a button action or 
   // routine before the axes are created. 
   CaluMath.PM.CheckAxesListExists(tempobject, temprequiredplot);

   CaluMath.PM.PlotlistObject[temprequiredplot].canaddhighlightslist=CaluMath.PM.PlotlistObject[temprequiredplot].canaddhighlightslist.concat([[temprequiredname,temprequiredname,tempobject]]);

   var temprequiredname= CaluMath.PM.GetPageMakerGraphFullName(tempobject);
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.concat([[temprequiredname,temprequiredname,tempobject]]);

};

CaluMath.PM.PageMakertangentDefault.ListArray=["canaddhighlightslist", "graphlist"];



CaluMath.PM.DeleteFromListstangent=function(){
   var tempobject=arguments[0];
   var tempplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot");
   var tempgraph=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"tangentparent");
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].canaddhighlightslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].canaddhighlightslist=CaluMath.PM.PlotlistObject[tempplot].canaddhighlightslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].canaddhighlightslist.slice(tempindex+1));
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.graphlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.graphlist.slice(tempindex+1));
};



CaluMath.PM.AddToListspointplot=function(){ 
   var tempobject=arguments[0]; 
   var temprequiredplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot"); 
   var temprequiredname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 

   //Comment: We do this in case a newly loaded page is being parsed and functionplots etc. are defined in a button action or 
   // routine before the axes are created. 
   CaluMath.PM.CheckAxesListExists(tempobject, temprequiredplot);

   CaluMath.PM.PlotlistObject[temprequiredplot].pointslist=CaluMath.PM.PlotlistObject[temprequiredplot].pointslist.concat([[temprequiredname,temprequiredname,tempobject]]);
   CaluMath.PM.PlotlistObject[temprequiredplot].draggedobjectslist=CaluMath.PM.PlotlistObject[temprequiredplot].draggedobjectslist.concat([[temprequiredname,temprequiredname,tempobject]]);

   var temprequiredname= CaluMath.PM.GetPageMakerGraphFullName(tempobject);
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.concat([[temprequiredname,temprequiredname,tempobject]]);
};

CaluMath.PM.PageMakerpointplotDefault.ListArray=["graphlist", "pointslist","draggedobjectslist"];


CaluMath.PM.DeleteFromListspointplot=function(){
   var tempobject=arguments[0];
   var tempplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot"); 
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.graphlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.graphlist.slice(tempindex+1));

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].pointslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].pointslist=CaluMath.PM.PlotlistObject[tempplot].pointslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].pointslist.slice(tempindex+1));
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist=CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist.slice(tempindex+1));

};

CaluMath.PM.AddToListsrectangleplot=function(){ 
   var tempobject=arguments[0]; 
   var temprequiredplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot"); 
   var temprequiredname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 

   //Comment: We do this in case a newly loaded page is being parsed and functionplots etc. are defined in a button action or 
   // routine before the axes are created. 
   CaluMath.PM.CheckAxesListExists(tempobject, temprequiredplot);

   CaluMath.PM.PlotlistObject[temprequiredplot].rectangleslist=CaluMath.PM.PlotlistObject[temprequiredplot].rectangleslist.concat([[temprequiredname,temprequiredname,tempobject]]);
   CaluMath.PM.PlotlistObject[temprequiredplot].draggedobjectslist=CaluMath.PM.PlotlistObject[temprequiredplot].draggedobjectslist.concat([[temprequiredname,temprequiredname,tempobject]]);

   var temprequiredname= CaluMath.PM.GetPageMakerGraphFullName(tempobject);
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.concat([[temprequiredname,temprequiredname,tempobject]]);
};

CaluMath.PM.PageMakerrectangleplotDefault.ListArray=["graphlist", "rectangleslist","draggedobjectslist"];


CaluMath.PM.DeleteFromListsrectangleplot=function(){
   var tempobject=arguments[0];
   var tempplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot"); 
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.graphlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.graphlist.slice(tempindex+1));

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].rectangleslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].rectangleslist=CaluMath.PM.PlotlistObject[tempplot].rectangleslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].rectangleslist.slice(tempindex+1));
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist=CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist.slice(tempindex+1));

};



CaluMath.PM.AddToListshighlight=function(){ 
   var tempobject=arguments[0];
   var temprequiredplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot"); 
   var temprequiredname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 

   //Comment: We do this in case a newly loaded page is being parsed and functionplots etc. are defined in a button action or 
   // routine before the axes are created. 
   CaluMath.PM.CheckAxesListExists(tempobject, temprequiredplot);

   CaluMath.PM.PlotlistObject[temprequiredplot].pointslist=CaluMath.PM.PlotlistObject[temprequiredplot].pointslist.concat([[temprequiredname,temprequiredname,tempobject]]);
   CaluMath.PM.PlotlistObject[temprequiredplot].draggedobjectslist=CaluMath.PM.PlotlistObject[temprequiredplot].draggedobjectslist.concat([[temprequiredname,temprequiredname,tempobject]]);

   var temprequiredname= CaluMath.PM.GetPageMakerGraphFullName(tempobject);
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.concat([[temprequiredname,temprequiredname,tempobject]]);
};

CaluMath.PM.PageMakerhighlightDefault.ListArray=["graphlist", "pointslist", "draggedobjectslist"];

CaluMath.PM.DeleteFromListshighlight=function(){
   var tempobject=arguments[0];
   var tempplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot"); 
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.graphlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.graphlist.slice(tempindex+1));
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].pointslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].pointslist=CaluMath.PM.PlotlistObject[tempplot].pointslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].pointslist.slice(tempindex+1));
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist=CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist.slice(tempindex+1));
};

CaluMath.PM.AddToListslinearplot=function(){ 
   var tempobject=arguments[0];
   var temprequiredplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot"); 
   var temprequiredname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");  

   //Comment: We do this in case a newly loaded page is being parsed and functionplots etc. are defined in a button action or 
   // routine before the axes are created. 
   CaluMath.PM.CheckAxesListExists(tempobject, temprequiredplot);

   CaluMath.PM.PlotlistObject[temprequiredplot].cansupportbuttonslist.push([temprequiredname,temprequiredname,tempobject]);
   CaluMath.PM.PlotlistObject[temprequiredplot].cansupportsearcheslist.push([temprequiredname,temprequiredname,tempobject]);

   CaluMath.PM.PlotlistObject[temprequiredplot].canaddhighlightslist=CaluMath.PM.PlotlistObject[temprequiredplot].canaddhighlightslist.concat([[temprequiredname,temprequiredname,tempobject]]);
   CaluMath.PM.PlotlistObject[temprequiredplot].canaddverticeslist=CaluMath.PM.PlotlistObject[temprequiredplot].canaddverticeslist.concat([[temprequiredname,temprequiredname,tempobject]]);
   CaluMath.PM.PlotlistObject[temprequiredplot].linearplotlist.push([temprequiredname,temprequiredname,tempobject]);
   var temprequiredname= CaluMath.PM.GetPageMakerGraphFullName(tempobject);
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.concat([[temprequiredname,temprequiredname,tempobject]]);

};

CaluMath.PM.PageMakerlinearplotDefault.ListArray=["linearplotlist", "canaddverticeslist", "canaddhighlightslist", "graphlist" , "cansupportbuttonslist", "cansupportsearcheslist" ];


CaluMath.PM.DeleteFromListslinearplot=function(){
   var tempobject=arguments[0];
   var temprequiredname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");  
   var tempplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot");
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].cansupportbuttonslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].cansupportbuttonslist.splice(tempindex,1); 
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].cansupportsearcheslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].cansupportsearcheslist.splice(tempindex,1); 
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].canaddverticeslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].canaddverticeslist.splice(tempindex,1);
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].canaddhighlightslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].canaddhighlightslist.splice(tempindex,1);
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].linearplotlist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].linearplotlist.splice(tempindex,1);
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.graphlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.graphlist.splice(tempindex,1);
};


CaluMath.PM.AddToListsaddlinearplotsegment=function(){ 
};

CaluMath.PM.DeleteFromListsaddlinearplotsegment=function(){ 
};

CaluMath.PM.AddToListsbuttons=function(){ 
   var tempobject=arguments[0];
   var temprequiredplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot"); 
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");

   //Comment: We do this in case a newly loaded page is being parsed and functionplots etc. are defined in a button action or 
   // routine before the axes are created. 
   CaluMath.PM.CheckAxesListExists(tempobject, temprequiredplot);

   if(temprequiredplot.length == 0){
      temprequiredplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"graph"); 
      var temprequiredname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 
   }
   var temprequireddefinedfunction=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"definedfunction");
   if(temprequireddefinedfunction.length == 0){
      var temprequireddefinedfunction=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"graph");
   };
   if(temprequireddefinedfunction==null || temprequireddefinedfunction=="none" || temprequireddefinedfunction=="n/a" || (temprequireddefinedfunction.cm_constructorname =="String" && temprequireddefinedfunction.length==0)){
      var definedfunctionstring=".";
   }
   else{
      var definedfunctionstring= "."+temprequireddefinedfunction+".";
   };



   if(tempobject.type == "input"){
      CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist = CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[temprequiredplot+definedfunctionstring+"cm_input",temprequiredplot+definedfunctionstring+"cm_input", tempobject]]);
      CaluMath.PM.PlotlistObject.textboxlist = CaluMath.PM.PlotlistObject.textboxlist.concat([[temprequiredplot+definedfunctionstring+"cm_input",temprequiredplot+definedfunctionstring+"cm_input", tempobject]]);
      CaluMath.PM.PlotlistObject.focuslist = CaluMath.PM.PlotlistObject.focuslist.concat([[temprequiredplot+definedfunctionstring+"cm_input",temprequiredplot+definedfunctionstring+"cm_input", tempobject]]);
   }
   else if(tempobject.type == "output"){
      CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist = CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[temprequiredplot+definedfunctionstring+"cm_output",temprequiredplot+definedfunctionstring+"cm_output", tempobject]]);
      CaluMath.PM.PlotlistObject.textboxlist = CaluMath.PM.PlotlistObject.textboxlist.concat([[temprequiredplot+definedfunctionstring+"cm_output",temprequiredplot+definedfunctionstring+"cm_output", tempobject]]);
      CaluMath.PM.PlotlistObject.focuslist = CaluMath.PM.PlotlistObject.focuslist.concat([[temprequiredplot+definedfunctionstring+"cm_output",temprequiredplot+definedfunctionstring+"cm_output", tempobject]]);
   }
   else if(tempobject.type == "animationoutput"){
      CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist = CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[CaluMath.PM.GetPageMakerObjectSetting(tempobject,"animationplot")+"."+temprequiredname,CaluMath.PM.GetPageMakerObjectSetting(tempobject,"animationplot")+"."+temprequiredname+"", tempobject]]);
      CaluMath.PM.PlotlistObject.textboxlist = CaluMath.PM.PlotlistObject.textboxlist.concat([[CaluMath.PM.GetPageMakerObjectSetting(tempobject,"animationplot")+"."+temprequiredname,CaluMath.PM.GetPageMakerObjectSetting(tempobject,"animationplot")+"."+temprequiredname+"", tempobject]]);
      CaluMath.PM.PlotlistObject.focuslist = CaluMath.PM.PlotlistObject.focuslist.concat([[CaluMath.PM.GetPageMakerObjectSetting(tempobject,"animationplot")+"."+temprequiredname,CaluMath.PM.GetPageMakerObjectSetting(tempobject,"animationplot")+"."+temprequiredname+"", tempobject]]);
   }
   else if(tempobject.type == "select"){
      CaluMath.PM.PlotlistObject.boxeslist = CaluMath.PM.PlotlistObject.boxeslist.concat([[temprequiredplot+definedfunctionstring+"functionmenu",temprequiredplot+definedfunctionstring+"functionmenu", tempobject]]);
      CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist = CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[temprequiredplot+definedfunctionstring+"functionmenu",temprequiredplot+definedfunctionstring+"functionmenu", tempobject]]);
      CaluMath.PM.PlotlistObject.focuslist = CaluMath.PM.PlotlistObject.focuslist.concat([[temprequiredplot+definedfunctionstring+"functionmenu",temprequiredplot+definedfunctionstring+"cm_functionmenu", tempobject]]);
   }
   else if(tempobject.type == "inputtext"){
   var temprequiredname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 
      CaluMath.PM.PlotlistObject.textboxlist = CaluMath.PM.PlotlistObject.textboxlist.concat([[temprequiredplot+definedfunctionstring+temprequiredname,temprequiredplot+definedfunctionstring+temprequiredname+"", tempobject]]);
      CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist = CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[temprequiredplot+definedfunctionstring+temprequiredname,temprequiredplot+definedfunctionstring+temprequiredname+"", tempobject]]);
      CaluMath.PM.PlotlistObject.focuslist = CaluMath.PM.PlotlistObject.focuslist.concat([[temprequiredplot+definedfunctionstring+temprequiredname,temprequiredplot+definedfunctionstring+temprequiredname+"", tempobject]]);
   }
   else if(tempobject.type == "inputarea"){
      var temprequiredname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 
      CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist = CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[temprequiredplot+definedfunctionstring+temprequiredname,temprequiredplot+definedfunctionstring+temprequiredname+"", tempobject]]);
      CaluMath.PM.PlotlistObject.textboxlist = CaluMath.PM.PlotlistObject.textboxlist.concat([[temprequiredplot+definedfunctionstring+temprequiredname,temprequiredplot+definedfunctionstring+temprequiredname+"", tempobject]]);
      CaluMath.PM.PlotlistObject.focuslist = CaluMath.PM.PlotlistObject.focuslist.concat([[temprequiredplot+definedfunctionstring+temprequiredname,temprequiredplot+definedfunctionstring+temprequiredname+"", tempobject]]);
   }
   else if(tempobject.type == "highlightclickbutton"){
      if(definedfunctionstring=="."){
        CaluMath.PM.PlotlistObject[temprequiredplot].newplot.forremovalarray=CaluMath.PM.PlotlistObject[temprequiredplot].newplot.forremovalarray.concat(tempobject);
      }
      else{
         var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[temprequiredplot].canaddhighlightslist,temprequireddefinedfunction,0);
         //Comment: The line below has caused errors with name changes of plots and needs to be looked at. 
         CaluMath.PM.PlotlistObject[temprequiredplot].canaddhighlightslist[tempindex][2].forremovalarray= CaluMath.PM.PlotlistObject[temprequiredplot].canaddhighlightslist[tempindex][2].forremovalarray.concat(tempobject);
      };
//      CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist = CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[temprequiredplot+definedfunctionstring+"cm_"+tempobject.type,temprequiredplot+definedfunctionstring+"cm_"+tempobject.type+"", tempobject]]);
//      CaluMath.PM.PlotlistObject.buttonlist= CaluMath.PM.PlotlistObject.buttonlist.concat([[temprequiredplot+definedfunctionstring+tempobject.type,temprequiredplot+definedfunctionstring+tempobject.type, tempobject]]);
//      CaluMath.PM.PlotlistObject.focuslist= CaluMath.PM.PlotlistObject.focuslist.concat([[temprequiredplot+definedfunctionstring+"cm_"+tempobject.type,temprequiredplot+definedfunctionstring+"cm_"+tempobject.type, tempobject]]);
      CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist = CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[temprequiredplot+definedfunctionstring+""+tempobject.type,temprequiredplot+definedfunctionstring+"cm_"+tempobject.type+"", tempobject]]);
      CaluMath.PM.PlotlistObject.buttonlist= CaluMath.PM.PlotlistObject.buttonlist.concat([[temprequiredplot+definedfunctionstring+tempobject.type,temprequiredplot+definedfunctionstring+"cm_"+tempobject.type, tempobject]]);
      CaluMath.PM.PlotlistObject.focuslist= CaluMath.PM.PlotlistObject.focuslist.concat([[temprequiredplot+definedfunctionstring+"cm_"+tempobject.type,temprequiredplot+definedfunctionstring+""+tempobject.type, tempobject]]);
   } 
   else if(tempobject.type == "button" || tempobject.type == "clickbutton"){
      var temprequiredname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 
//      CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist = CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[temprequiredplot+definedfunctionstring+temprequiredname,temprequiredplot+definedfunctionstring+temprequiredname+'', tempobject]]);
      CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist = CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[temprequiredplot+definedfunctionstring+temprequiredname,temprequiredplot+definedfunctionstring+temprequiredname+'', tempobject]]);
      CaluMath.PM.PlotlistObject.buttonlist= CaluMath.PM.PlotlistObject.buttonlist.concat([[temprequiredplot+definedfunctionstring+temprequiredname,temprequiredplot+definedfunctionstring+temprequiredname, tempobject]]);
      CaluMath.PM.PlotlistObject.focuslist= CaluMath.PM.PlotlistObject.focuslist.concat([[temprequiredplot+definedfunctionstring+temprequiredname,temprequiredplot+definedfunctionstring+temprequiredname, tempobject]]);
      CaluMath.PM.PlotlistObject.executeroutinelist=CaluMath.PM.PlotlistObject.executeroutinelist.concat([[temprequiredplot+definedfunctionstring+temprequiredname+".cm_node.onclick", temprequiredplot+definedfunctionstring+temprequiredname+".cm_node.onclick", tempobject]]);
   }
   else if(tempobject.type == "boxes" || tempobject.type == "dropdownmenu"){
      var temprequiredname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 
      CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist = CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[temprequiredplot+definedfunctionstring+temprequiredname,temprequiredplot+definedfunctionstring+temprequiredname, tempobject]]);
      CaluMath.PM.PlotlistObject.boxeslist= CaluMath.PM.PlotlistObject.boxeslist.concat([[temprequiredplot+definedfunctionstring+temprequiredname,temprequiredplot+definedfunctionstring+temprequiredname, tempobject]]);
      CaluMath.PM.PlotlistObject.focuslist= CaluMath.PM.PlotlistObject.focuslist.concat([[temprequiredplot+definedfunctionstring+temprequiredname,temprequiredplot+definedfunctionstring+temprequiredname, tempobject]]);
   }
//   else if(tempobject.type == "dropdownmenu"){
//      var temprequiredname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 
//      CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist = CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[temprequiredplot+'.'+temprequiredname,temprequiredplot+'.'+temprequiredname+'', tempobject]]);
//      CaluMath.PM.PlotlistObject.boxeslist= CaluMath.PM.PlotlistObject.boxeslist.concat([[temprequiredplot+'.'+temprequiredname,temprequiredplot+'.'+temprequiredname+'', tempobject]]);
//      CaluMath.PM.PlotlistObject.dropdownmenulist= CaluMath.PM.PlotlistObject.dropdownmenulist.concat([[temprequiredplot+'.'+temprequiredname,temprequiredplot+'.'+temprequiredname+'', tempobject]]);
//      CaluMath.PM.PlotlistObject.focuslist= CaluMath.PM.PlotlistObject.focuslist.concat([[temprequiredplot+'.'+temprequiredname,temprequiredplot+'.'+temprequiredname+'', tempobject]]);
//   }
   else{
      if(CaluMath.PM.GetPageMakerObjectSetting(tempobject,"animationplot").length==0){
         CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist = CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[temprequiredplot+definedfunctionstring+"cm_"+tempobject.type,temprequiredplot+definedfunctionstring+"cm_"+tempobject.type+"", tempobject]]);
         CaluMath.PM.PlotlistObject.buttonlist= CaluMath.PM.PlotlistObject.buttonlist.concat([[temprequiredplot+definedfunctionstring+"cm_"+tempobject.type,temprequiredplot+definedfunctionstring+"cm_"+tempobject.type, tempobject]]);
         CaluMath.PM.PlotlistObject.focuslist= CaluMath.PM.PlotlistObject.focuslist.concat([[temprequiredplot+definedfunctionstring+"cm_"+tempobject.type,temprequiredplot+definedfunctionstring+"cm_"+tempobject.type, tempobject]]);
      }
      else{
         CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist = CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[CaluMath.PM.GetPageMakerObjectSetting(tempobject,"animationplot")+".cm_"+tempobject.type,CaluMath.PM.GetPageMakerObjectSetting(tempobject,"animationplot")+".cm_"+tempobject.type+"", tempobject]]);
         CaluMath.PM.PlotlistObject.buttonlist= CaluMath.PM.PlotlistObject.buttonlist.concat([[CaluMath.PM.GetPageMakerObjectSetting(tempobject,"animationplot")+".cm_"+tempobject.type,CaluMath.PM.GetPageMakerObjectSetting(tempobject,"animationplot")+".cm_"+tempobject.type, tempobject]]);
         CaluMath.PM.PlotlistObject.focuslist= CaluMath.PM.PlotlistObject.focuslist.concat([[CaluMath.PM.GetPageMakerObjectSetting(tempobject,"animationplot")+".cm_"+tempobject.type,CaluMath.PM.GetPageMakerObjectSetting(tempobject,"animationplot")+".cm_"+tempobject.type, tempobject]]);
         CaluMath.PM.PlotlistObject.executeroutinelist=CaluMath.PM.PlotlistObject.executeroutinelist.concat([[CaluMath.PM.GetPageMakerObjectSetting(tempobject,"animationplot")+".cm_"+tempobject.type+".cm_node.onclick", CaluMath.PM.GetPageMakerObjectSetting(tempobject,"animationplot")+".cm_"+tempobject.type+".cm_node.onclick", tempobject]]);

      };
   }; 
};


CaluMath.PM.PageMakerinputDefault.ListArray=["namedobjectlist", "textboxlist", "focuslist"];
CaluMath.PM.PageMakeroutputDefault.ListArray=["namedobjectlist", "textboxlist", "focuslist"];
CaluMath.PM.PageMakeranimationoutputDefault.ListArray=["namedobjectlist", "textboxlist", "focuslist"];
CaluMath.PM.PageMakerselectDefault.ListArray=["namedobjectlist", "focuslist"];
CaluMath.PM.PageMakerinputtextDefault.ListArray=["namedobjectlist", "textboxlist", "focuslist"];
CaluMath.PM.PageMakerinputareaDefault.ListArray=["namedobjectlist", "textboxlist", "focuslist"];
CaluMath.PM.PageMakerboxesDefault.ListArray=["namedobjectlist", "boxeslist", "focuslist"];
CaluMath.PM.PageMakerboxesDefault.ListArray=["namedobjectlist", "boxeslist", "focuslist"];

CaluMath.PM.PageMakerhighlightclickbuttonDefault.ListArray=["namedobjectlist", "buttonlist", "focuslist"];
CaluMath.PM.PageMakerclickbuttonDefault.ListArray=["namedobjectlist", "buttonlist", "focuslist", "executeroutinelist"];
CaluMath.PM.PageMakerbuttonDefault.ListArray=["namedobjectlist", "buttonlist", "focuslist", "executeroutinelist"];


CaluMath.PM.PageMakertangentclickbuttonDefault.ListArray = ["namedobjectlist", "buttonlist", "focuslist"];
CaluMath.PM.PageMakerpointclickbuttonDefault.ListArray = ["namedobjectlist", "buttonlist", "focuslist"];
CaluMath.PM.PageMakerremoveclickbuttonDefault.ListArray = ["namedobjectlist", "buttonlist", "focuslist"];
CaluMath.PM.PageMakerendremoveclickbuttonDefault.ListArray = ["namedobjectlist", "buttonlist", "focuslist"];
CaluMath.PM.PageMakercalculatorbuttonDefault.ListArray = ["namedobjectlist", "buttonlist", "focuslist"];
CaluMath.PM.PageMakerjavascriptbuttonDefault.ListArray = ["namedobjectlist", "buttonlist", "focuslist"];
CaluMath.PM.PageMakerenterbuttonDefault.ListArray = ["namedobjectlist", "buttonlist", "focuslist"];

CaluMath.PM.PageMakerstartbuttonDefault.ListArray = ["namedobjectlist", "buttonlist", "focuslist"];
CaluMath.PM.PageMakerstopbuttonDefault.ListArray = ["namedobjectlist", "buttonlist", "focuslist"];
CaluMath.PM.PageMakerstepbuttonDefault.ListArray = ["namedobjectlist", "buttonlist", "focuslist"];
CaluMath.PM.PageMakerresetbuttonDefault.ListArray = ["namedobjectlist", "buttonlist", "focuslist"];
CaluMath.PM.PageMakerincreasespeedbuttonDefault.ListArray = ["namedobjectlist", "buttonlist", "focuslist"];
CaluMath.PM.PageMakerdecreasespeedbuttonDefault.ListArray = ["namedobjectlist", "buttonlist", "focuslist"];
CaluMath.PM.PageMakerchangedirectionbuttonDefault.ListArray = ["namedobjectlist", "buttonlist", "focuslist"];

CaluMath.PM.DeleteFromListsbuttons=function(){ 

//alerttest("doing button deletions");
   var tempobject=arguments[0];
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(tempindex+1));
   if(tempobject.type != "boxes" && tempobject.type != "dropdownmenu"){
      var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.buttonlist,tempobject,2); 
      CaluMath.PM.PlotlistObject.buttonlist=CaluMath.PM.PlotlistObject.buttonlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.buttonlist.slice(tempindex+1));
      var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.executeroutinelist,tempobject,2); 
      CaluMath.PM.PlotlistObject.executeroutinelist=CaluMath.PM.PlotlistObject.executeroutinelist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.executeroutinelist.slice(tempindex+1));
   }
   else if(tempobject.type == "boxes" || tempobject.type == "dropdownmenu"){
      var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.boxeslist,tempobject,2); 
      CaluMath.PM.PlotlistObject.boxeslist=CaluMath.PM.PlotlistObject.boxeslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.boxeslist.slice(tempindex+1));
   };
//   else if(tempobject.type == "dropdownmenu"){
//      var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.dropdownmenulist,tempobject,2); 
//      CaluMath.PM.PlotlistObject.boxeslist=CaluMath.PM.PlotlistObject.dropdownmenulist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.boxeslist.slice(tempindex+1));
//   };

   if(tempobject.type == "input" || tempobject.type == "output" || tempobject.type == "inputtext" ||tempobject.type == "inputarea" ||tempobject.type == "animationoutput"){
      var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.textboxlist,tempobject,2); 
      CaluMath.PM.PlotlistObject.textboxlist=CaluMath.PM.PlotlistObject.textboxlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.textboxlist.slice(tempindex+1));
   };

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(tempindex+1));

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.focuslist,tempobject,2); 
   CaluMath.PM.PlotlistObject.focuslist=CaluMath.PM.PlotlistObject.focuslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.focuslist.slice(tempindex+1));
};



CaluMath.PM.AddToListstangentclickbutton=CaluMath.PM.AddToListsbuttons;
CaluMath.PM.AddToListshighlightclickbutton=CaluMath.PM.AddToListsbuttons;
CaluMath.PM.AddToListspointclickbutton=CaluMath.PM.AddToListsbuttons;
CaluMath.PM.AddToListsremoveclickbutton=CaluMath.PM.AddToListsbuttons;
CaluMath.PM.AddToListsendremoveclickbutton=CaluMath.PM.AddToListsbuttons;
CaluMath.PM.AddToListscalculatorbutton=CaluMath.PM.AddToListsbuttons;
CaluMath.PM.AddToListsjavascriptbutton=CaluMath.PM.AddToListsbuttons;
CaluMath.PM.AddToListsenterbutton=CaluMath.PM.AddToListsbuttons;
CaluMath.PM.AddToListsinput=CaluMath.PM.AddToListsbuttons;
CaluMath.PM.AddToListsoutput=CaluMath.PM.AddToListsbuttons;
CaluMath.PM.AddToListsselect=CaluMath.PM.AddToListsbuttons;
CaluMath.PM.AddToListsbutton=CaluMath.PM.AddToListsbuttons; 
CaluMath.PM.AddToListsclickbutton=CaluMath.PM.AddToListsbuttons; 
CaluMath.PM.AddToListsboxes=CaluMath.PM.AddToListsbuttons; 
CaluMath.PM.AddToListsdropdownmenu=CaluMath.PM.AddToListsbuttons; 
CaluMath.PM.AddToListsinputtext=CaluMath.PM.AddToListsbuttons; 
CaluMath.PM.AddToListsinputarea=CaluMath.PM.AddToListsbuttons; 

CaluMath.PM.AddToListsstartbutton=CaluMath.PM.AddToListsbuttons;
CaluMath.PM.AddToListsstopbutton=CaluMath.PM.AddToListsbuttons;
CaluMath.PM.AddToListsstepbutton=CaluMath.PM.AddToListsbuttons;
CaluMath.PM.AddToListsresetbutton=CaluMath.PM.AddToListsbuttons;
CaluMath.PM.AddToListsincreasespeedbutton=CaluMath.PM.AddToListsbuttons;
CaluMath.PM.AddToListsdecreasespeedbutton=CaluMath.PM.AddToListsbuttons;
CaluMath.PM.AddToListschangedirectionbutton=CaluMath.PM.AddToListsbuttons;
CaluMath.PM.AddToListsallanimationbutton=CaluMath.PM.AddToListsbuttons;
CaluMath.PM.AddToListsanimationoutput=CaluMath.PM.AddToListsbuttons;


CaluMath.PM.DeleteFromListstangentclickbutton=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListshighlightclickbutton=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListspointclickbutton=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListsremoveclickbutton=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListsendremoveclickbutton=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListscalculatorbutton=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListsjavascriptbutton=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListsenterbutton=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListsinput=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListsoutput=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListsselect=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListsbutton=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListsclickbutton=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListsboxes=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListsdropdownmenu=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListsinputtext=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListsinputarea=CaluMath.PM.DeleteFromListsbuttons;

CaluMath.PM.DeleteFromListsstartbutton=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListsstopbutton=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListsstepbutton=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListsresetbutton=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListsincreasespeedbutton=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListsdecreasespeedbutton=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListschangedirectionbutton=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListsallanimationbutton=CaluMath.PM.DeleteFromListsbuttons;
CaluMath.PM.DeleteFromListsanimationoutput=CaluMath.PM.DeleteFromListsbuttons;



CaluMath.PM.AddToListslinebreak=function(){ 
};
CaluMath.PM.DeleteFromListslinebreak=function(){
};


CaluMath.PM.AddToListsbuttonaction=function(){ 
   var tempobject=arguments[0];
   var tempbutton=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"button");
   var type=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"type");
   if(type=="cm_add"){
      var tempname="_ButtonAction";
   }
   else{
      var tempname="_ClickAction";
   };
      CaluMath.PM.PlotlistObject.buttonactionlist=CaluMath.PM.PlotlistObject.buttonactionlist.concat([[tempbutton+''+tempname, tempbutton+''+tempname+''+tempname, tempobject]]);

//   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
//   if(tempname.match(/\S/)){
//      CaluMath.PM.PlotlistObject.buttonactionlist=CaluMath.PM.PlotlistObject.buttonactionlist.concat([[tempbutton+'.'+tempname, tempbutton+'.'+tempname+'.'+tempname, tempobject]]);
//   };


};

CaluMath.PM.PageMakerbuttonactionDefault.ListArray = ["buttonactionlist"];

CaluMath.PM.DeleteFromListsbuttonaction=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.buttonactionlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.buttonactionlist=CaluMath.PM.PlotlistObject.buttonactionlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.buttonactionlist.slice(tempindex+1));
};

CaluMath.PM.AddToListsforloop=function(){ 
   var tempobject=arguments[0];
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
   CaluMath.PM.PlotlistObject.forlooplist=CaluMath.PM.PlotlistObject.forlooplist.concat([[tempname, tempname, tempobject]]);
};

CaluMath.PM.PageMakerforloopDefault.ListArray = ["forlooplist"];

CaluMath.PM.DeleteFromListsforloop=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.forlooplist,tempobject,2); 
   CaluMath.PM.PlotlistObject.forlooplist=CaluMath.PM.PlotlistObject.forlooplist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.forlooplist.slice(tempindex+1));
};

CaluMath.PM.AddToListsaddtoforloop=function(){ 
};

CaluMath.PM.PageMakeraddtoforloopDefault.ListArray= [];

CaluMath.PM.DeleteFromListsaddtoforloop=function(){
};


CaluMath.PM.AddToListsconditional=function(){ 
   var tempobject=arguments[0];
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
   if(tempname.match(/\S/)){
      CaluMath.PM.PlotlistObject.conditionallist=CaluMath.PM.PlotlistObject.conditionallist.concat([[tempname, tempname, tempobject]]);
   };
};

CaluMath.PM.PageMakerconditionalDefault.ListArray = ["conditionallist"];

CaluMath.PM.DeleteFromListsconditional=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.conditionallist,tempobject,2); 
   CaluMath.PM.PlotlistObject.conditionallist=CaluMath.PM.PlotlistObject.conditionallist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.conditionallist.slice(tempindex+1));
};

CaluMath.PM.AddToListsremovegraph=function(){ 
};
CaluMath.PM.DeleteFromListsremovegraph=function(){
};


CaluMath.PM.AddToListshideandunhidegraph=function(){ 
};
CaluMath.PM.DeleteFromListshideandunhidegraph=function(){
};

CaluMath.PM.AddToListsnameclickedpoint=function(){ 
   var tempobject=arguments[0];
   var temprequiredname= CaluMath.PM.GetPageMakerObjectSetting(tempobject, "name");
   CaluMath.PM.PlotlistObject.nameclickedpointlist=CaluMath.PM.PlotlistObject.nameclickedpointlist.concat([[temprequiredname,temprequiredname,tempobject]]);
};

CaluMath.PM.PageMakernameclickedpointDefault.ListArray = ["nameclickedpointlist"];

CaluMath.PM.DeleteFromListsnameclickedpoint=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.nameclickedpointlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.nameclickedpointlist=CaluMath.PM.PlotlistObject.nameclickedpointlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.nameclickedpointlist.slice(tempindex+1));
};

CaluMath.PM.AddToListscomparison=function(){ 
   var tempobject=arguments[0];
   var temprequiredname= CaluMath.PM.GetPageMakerObjectSetting(tempobject, "name");
   if(temprequiredname.match(/\S/)){
      CaluMath.PM.PlotlistObject.comparisonlist=CaluMath.PM.PlotlistObject.comparisonlist.concat([[temprequiredname,temprequiredname,tempobject]]);
   };
};

CaluMath.PM.PageMakercomparisonDefault.ListArray = ["comparisonlist"];

CaluMath.PM.DeleteFromListscomparison=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.comparisonlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.comparisonlist=CaluMath.PM.PlotlistObject.comparisonlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.comparisonlist.slice(tempindex+1));
};

CaluMath.PM.AddToListsaddtobuttonaction=function(){ 
};

CaluMath.PM.PageMakeraddtobuttonactionDefault.ListArray= [];

CaluMath.PM.DeleteFromListsaddtobuttonaction=function(){
};

CaluMath.PM.AddToListsbuttonactionnext=function(){ 
};
CaluMath.PM.DeleteFromListsbuttonactionnext=function(){
};

CaluMath.PM.AddToListshideandunhide=function(){ 
};
CaluMath.PM.DeleteFromListshideandunhide=function(){
};

CaluMath.PM.AddToListsremovehtml=function(){ 
};
CaluMath.PM.DeleteFromListsremovehtml=function(){
};

CaluMath.PM.AddToListsp=function(){ 
   var tempobject=arguments[0]; //alerttest(tempobject.constructor==CM_TopWindow.Object);
CaluMath.PM.AssignCasWindowToTextChildrenPrepFunction();
CaluMath.PM.AssignCasWindowToTextChildren();
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");
    if(tempcaswindow.length ==0){
//alerttest([tempobject, "Here is its tempwindow",tempobject.cm_caswindow]);
      tempcaswindow=tempobject.cm_caswindow;
   };

   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
      if(tempname.length != 0){
      var temparray= CM_TopWindow.Array();
      temparray[0] = tempname; 
      temparray[1] = tempname+"";
      temparray[2] = tempobject;
         if(CM_TopWindow.CaluMath.PM.PlotlistObject[tempcaswindow] != null){
            CM_TopWindow.CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.push(temparray);
         }
         else{
            alert("Something is out of order. You are placing objects in the New Window "+ tempcaswindow+" however that window has not been constructed yet. Please address this to avoid errors.");
         };
      };
};

CaluMath.PM.PageMakerhtmltextDefault.ListArray=["namedobjectlist", "caswindowlist"];

CaluMath.PM.DeleteFromListsp=function(){
   var tempobject=arguments[0];
   var tempcaswindow=tempobject.cm_getsetting("cm_caswindow");
   if(tempcaswindow.length ==0){
      tempcaswindow=tempobject.cm_caswindow;
   };

   if(tempcaswindow != null && tempcaswindow.length >0){
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist,tempobject,2); 
   CM_TopWindow.CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CM_TopWindow.CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(0,tempindex).concat(CM_TopWindow.CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(tempindex+1));
   }
};

//CM_DeleteFromListsh1=CaluMath.PM.DeleteFromListsp;
//CM_DeleteFromListsh2=CaluMath.PM.DeleteFromListsp;
//CM_DeleteFromListsdiv=CaluMath.PM.DeleteFromListsp;
//CM_DeleteFromListsspan=CaluMath.PM.DeleteFromListsp;
//CM_AddToListsalert=CaluMath.PM.AddToListsp;

//CM_AddToListsh1=CaluMath.PM.AddToListsp;
//CM_AddToListsh2=CaluMath.PM.AddToListsp;
//CM_AddToListsdiv=CaluMath.PM.AddToListsp;
//CM_AddToListsspan=CaluMath.PM.AddToListsp;


//CaluMath.Html.AddToListsgettextboxvalue = function(){ TAKEN CARE OF BY SPECIALTY LISTS ABOVE
//};
//CaluMath.Html.DeleteFromListsgettextboxvalue = function(){
//};

CaluMath.PM.AddToListsputtextboxvalue=function(){ 
};
CaluMath.PM.DeleteFromListsputtextboxvalue=function(){
};

//CaluMath.Html.AddToListsgetboxindex = function(){   TAKEN CARE OF BY SPECIALTY LISTS ABOVE
//};
//CaluMath.Html.DeleteFromListsgetboxindex = function(){
//};

CaluMath.PM.AddToListsputboxindex=function(){ 
};
CaluMath.PM.DeleteFromListsputboxindex=function(){
};

CaluMath.PM.AddToListssearch=function(){ 
};
CaluMath.PM.DeleteFromListssearch=function(){
};

CaluMath.PM.AddToListslabelvertex=function(){ 
};
CaluMath.PM.DeleteFromListslabelvertex=function(){
};
CaluMath.PM.AddToListslabelallvertices=function(){ 
};
CaluMath.PM.DeleteFromListslabelallvertices=function(){
};


CaluMath.PM.AddToListsaddtoconditional=function(){ 
};
CaluMath.PM.DeleteFromListsaddtoconditional=function(){
};

CaluMath.PM.AddToListstextplot=function(){ 
   var tempobject=arguments[0];
   var tempplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot"); 
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 

   //Comment: We do this in case a newly loaded page is being parsed and functionplots etc. are defined in a button action or 
   // routine before the axes are created. 
   CaluMath.PM.CheckAxesListExists(tempobject, tempplot);

//   CaluMath.PM.PlotlistObject.textplotlist=CaluMath.PM.PlotlistObject.textplotlist.concat([[tempplot, tempname, tempobject]]);
   CaluMath.PM.PlotlistObject[tempplot].textplotlist=CaluMath.PM.PlotlistObject.textplotlist.concat([[tempname, tempname, tempobject]]);
//   CaluMath.PM.PlotlistObject.namedobjectlist = CaluMath.PM.PlotlistObject.namedobjectlist.concat([[tempplot+"."+tempname,tempplot+"."+tempname,tempobject]]);
   CaluMath.PM.PlotlistObject.graphlist = CaluMath.PM.PlotlistObject.graphlist.concat([[tempplot+"."+tempname,tempplot+"."+tempname,tempobject]]);

};

CaluMath.PM.PageMakertextplotDefault.ListArray = ["textplotlist", "graphlist"];

CaluMath.PM.DeleteFromListstextplot=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.textplotlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.textplotlist=CaluMath.PM.PlotlistObject.textplotlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.textplotlist.slice(tempindex+1));
//   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.namedobjectlist,tempobject,2); 
//   CaluMath.PM.PlotlistObject.namedobjectlist=CaluMath.PM.PlotlistObject.namedobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.namedobjectlist.slice(tempindex+1));
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.graphlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.graphlist.slice(tempindex+1));

};

CaluMath.PM.AddToListsmovetextplot=function(){
};
 
CaluMath.PM.DeleteFromListsmovetextplot=function(){
};


CaluMath.PM.AddToListslabelplot=function(){ 
   var tempobject=arguments[0];
   var tempplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot"); 
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 
   CaluMath.PM.PlotlistObject.graphlist = CaluMath.PM.PlotlistObject.graphlist.concat([[tempplot+"."+tempname,tempplot+"."+tempname,tempobject]]);
};

CaluMath.PM.PageMakerlabelplotDefault.ListArray = ["graphlist"];

CaluMath.PM.DeleteFromListslabelplot=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.namedobjectlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.namedobjectlist.slice(tempindex+1));
};

CaluMath.PM.AddToListsjavascript=function(){ 
};
CaluMath.PM.DeleteFromListsjavascript=function(){
};

CaluMath.PM.AddToListsroutine=function(){ 
   var tempobject=arguments[0];
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
   CaluMath.PM.PlotlistObject.routinelist=CaluMath.PM.PlotlistObject.routinelist.concat([[tempname, tempname, tempobject]]);
   CaluMath.PM.PlotlistObject.executeroutinelist=CaluMath.PM.PlotlistObject.executeroutinelist.concat([[tempname, tempname, tempobject]]);
};

CaluMath.PM.PageMakerroutineDefault.ListArray = ["routinelist", "executeroutinelist"];

CaluMath.PM.DeleteFromListsroutine=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.routinelist,tempobject,2); 
   CaluMath.PM.PlotlistObject.routinelist=CaluMath.PM.PlotlistObject.routinelist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.routinelist.slice(tempindex+1));
   CaluMath.PM.PlotlistObject.executeroutinelist=CaluMath.PM.PlotlistObject.executeroutinelist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.routinelist.slice(tempindex+1));
};

CaluMath.PM.AddToListsexecuteroutine=function(){ 
   var tempobject=arguments[0];
   var routine= CaluMath.PM.GetPageMakerObjectSetting(tempobject,"routine");
   CaluMath.PM.PlotlistObject.executeroutinelist.push([routine, routine, tempobject]);
};

CaluMath.PM.PageMakerexecuteroutineDefault.ListArray = ["executeroutinelist"];

CaluMath.PM.DeleteFromListsexecuteroutine=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.executeroutinelist,tempobject,2); 
   CaluMath.PM.PlotlistObject.executeroutinelist.splice(tempindex,1); 
};

CaluMath.PM.AddToListscm_alert=function(){ 
};

CaluMath.PM.PageMakercm_alertDefault.ListArray= [];

CaluMath.PM.DeleteFromListscm_alert=function(){
};

CaluMath.PM.AddToListsendinsertionarray=function(){ 
};
CaluMath.PM.DeleteFromListsendinsertionarray=function(){
};

CaluMath.PM.AddToListsputfocus=function(){ 
};
CaluMath.PM.DeleteFromListsputfocus=function(){
};

CaluMath.PM.AddToListswebpagename=function(){ 
};
CaluMath.PM.DeleteFromListswebpagename=function(){
};

CaluMath.PM.AddToListsactivatedragpoint=function(){ 
};
CaluMath.PM.DeleteFromListsactivatedragpoint=function(){
};


CaluMath.PM.AddToListsdeactivatedragpoint=function(){ 
};
CaluMath.PM.DeleteFromListsdeactivatedragpoint=function(){
};

CaluMath.PM.AddToListsactivatedragrectangle=function(){ 
};
CaluMath.PM.DeleteFromListsactivatedragrectangle=function(){
};


CaluMath.PM.AddToListsdeactivatedragrectangle=function(){ 
};
CaluMath.PM.DeleteFromListsdeactivatedragrectangle=function(){
};

CaluMath.PM.AddToListsactivatestretchrectangle=function(){ 
};
CaluMath.PM.DeleteFromListsactivatestretchrectangle=function(){
};


CaluMath.PM.AddToListsdeactivatestretchrectangle=function(){ 
};
CaluMath.PM.DeleteFromListsdeactivatestretchrectangle=function(){
};

CaluMath.PM.AddToListsactivateviewrectangle=function(){ 
   var tempobject=arguments[0]; 
   var temprequiredplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot"); 
   var temprequiredname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 

   //Comment: We do this in case a newly loaded page is being parsed and functionplots etc. are defined in a button action or 
   // routine before the axes are created. 
   CaluMath.PM.CheckAxesListExists(tempobject, temprequiredplot);

   CaluMath.PM.PlotlistObject[temprequiredplot].rectangleslist=CaluMath.PM.PlotlistObject[temprequiredplot].rectangleslist.concat([[temprequiredname,temprequiredname,tempobject]]);
   CaluMath.PM.PlotlistObject[temprequiredplot].draggedobjectslist=CaluMath.PM.PlotlistObject[temprequiredplot].draggedobjectslist.concat([[temprequiredname,temprequiredname,tempobject]]);

   var temprequiredname= CaluMath.PM.GetPageMakerGraphFullName(tempobject);
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.concat([[temprequiredname,temprequiredname,tempobject]]);
};

CaluMath.PM.PageMakeractivateviewrectangleDefault.ListArray=["graphlist", "rectangleslist","draggeddobjectslist"];


CaluMath.PM.DeleteFromListsactivateviewrectangle=function(){
   var tempobject=arguments[0];
   var tempplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot"); 
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.graphlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.graphlist.slice(tempindex+1));

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].rectangleslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].rectangleslist=CaluMath.PM.PlotlistObject[tempplot].rectangleslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].rectangleslist.slice(tempindex+1));
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist=CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist.slice(tempindex+1));

};


CaluMath.PM.AddToListsdeactivateviewrectangle=function(){ 
};
CaluMath.PM.DeleteFromListsdeactivateviewrectangle=function(){
};

CaluMath.PM.AddToListsmoverectangle=function(){ 
};
CaluMath.PM.DeleteFromListsmoverectangle=function(){
};

CaluMath.PM.AddToListsdeactivateclickableaxes=function(){ 
};
CaluMath.PM.DeleteFromListsdeactivateclickableaxes=function(){
};




CaluMath.PM.AddToListsactivateslidingscale=function(){ 
};
CaluMath.PM.DeleteFromListsactivateslidingscale=function(){
};


CaluMath.PM.AddToListsdeactivateslidingscale=function(){ 
};
CaluMath.PM.DeleteFromListsdeactivateslidingscale=function(){
};

CaluMath.PM.AddToListsactivatecapturedragpath=function(){ 
   var tempobject=arguments[0]; 
   var temprequiredplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot"); 
//   var temprequiredname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 

   //Comment: We do this in case a newly loaded page is being parsed and functionplots etc. are defined in a button action or 
   // routine before the axes are created. 
   CaluMath.PM.CheckAxesListExists(tempobject, temprequiredplot);

      CaluMath.PM.PlotlistObject[temprequiredplot].draggedobjectslist=CaluMath.PM.PlotlistObject[temprequiredplot].draggedobjectslist.concat([["capture drag path","capture drag path",tempobject]]);
};
CaluMath.PM.DeleteFromListsactivatecapturedragpath=function(){
   var tempobject=arguments[0];
   var tempplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot");
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist=CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist.slice(tempindex+1));
};


CaluMath.PM.AddToListsdeactivatecapturedragpath=function(){ 
};
CaluMath.PM.DeleteFromListsdeactivatecapturedragpath=function(){
};


CaluMath.PM.AddToListsslidingscale=function(){ 
   var tempobject=arguments[0]; 
//   var temprequiredplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot"); 
   var temprequiredname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 
//   CaluMath.PM.PlotlistObject[temprequiredplot].draggedobjectslist=CaluMath.PM.PlotlistObject[temprequiredplot].draggedobjectslist.concat([[temprequiredname,temprequiredname,tempobject]]);

//   CaluMath.PM.PlotlistObject[temprequiredplot].slidingscalelist=CaluMath.PM.PlotlistObject[temprequiredplot].slidingscalelist.concat([[temprequiredname,temprequiredname,tempobject]]);
   CaluMath.PM.PlotlistObject.slidingscalelist=CaluMath.PM.PlotlistObject.slidingscalelist.concat([['CM_ParentObject.'+temprequiredname,'CM_ParentObject.'+temprequiredname,tempobject]]);
};

CaluMath.PM.PageMakerslidingscaleDefault.ListArray=["slidingscalelist"];


CaluMath.PM.DeleteFromListsslidingscale=function(){
   var tempobject=arguments[0];
   var tempplot=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"newplot"); 

//   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist,tempobject,2); 
//   CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist=CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].draggedobjectslist.slice(tempindex+1));

//   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempplot].slidingscalelist,tempobject,2); 
//   CaluMath.PM.PlotlistObject[tempplot].slidingscalelist=CaluMath.PM.PlotlistObject[tempplot].slidingscalelist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempplot].slidingscalelist.slice(tempindex+1));

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.slidingscalelist,tempobject,2); 
   CaluMath.PM.PlotlistObject.slidingscalelist=CaluMath.PM.PlotlistObject.slidingscalelist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.slidingscalelist.slice(tempindex+1));

};


CaluMath.PM.AddToListsnamedraggedvalue=function(){ 
};
CaluMath.PM.DeleteFromListsnamedraggedvalue=function(){
};

CaluMath.PM.AddToListsnameanimationvalue=function(){ 
};
CaluMath.PM.DeleteFromListsnameanimationvalue=function(){
};


CaluMath.PM.AddToListsdragroutine=function(){ 
};
CaluMath.PM.DeleteFromListsdragroutine=function(){
};

CaluMath.PM.AddToListsanimationroutine=function(){ 
};
CaluMath.PM.DeleteFromListsanimationroutine=function(){
};

CaluMath.PM.AddToListsupdateareabetweenfunctionsplot=function(){ 
};
CaluMath.PM.DeleteFromListsupdateareabetweenfunctionsplot=function(){
};

CaluMath.PM.AddToListsupdatefunctionplot=function(){ 
};
CaluMath.PM.DeleteFromListsupdatefunctionplot=function(){
};

CaluMath.PM.AddToListsupdatetangentplot=function(){ 
};
CaluMath.PM.DeleteFromListsupdatetangentplot=function(){
};

CaluMath.PM.AddToListsupdateblanksegments=function(){ 
};
CaluMath.PM.DeleteFromListsupdateblanksegments=function(){
};


CaluMath.PM.AddToListsmovepoint=function(){ 
};
CaluMath.PM.DeleteFromListsmovepoint=function(){
};




CaluMath.PM.AddToListstextstylesheet=function(){ 
   var tempobject=arguments[0];
   CaluMath.PM.PlotlistObject.textstylesheetlist.push(tempobject);
};

CaluMath.PM.PageMakertextstylesheetDefault.ListArray = ["textstylesheetlist"];

CaluMath.PM.DeleteFromListstextstylesheet=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.textstylesheetlist,tempobject); 
   CaluMath.PM.PlotlistObject.textstylesheetlist=CaluMath.PM.PlotlistObject.textstylesheetlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.textstylesheetlist.slice(tempindex+1));
};



CaluMath.PM.AddToListsarrow=function(){ 
   var tempobject=arguments[0];
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
   var temprequiredname= CaluMath.PM.GetPageMakerGraphFullName(tempobject);
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.concat([[temprequiredname,temprequiredname,tempobject]]);
};

CaluMath.PM.PageMakerarrowDefault.ListArray = ["graphlist"];

CaluMath.PM.DeleteFromListsarrow=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.graphlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.graphlist.slice(tempindex+1));
};

CaluMath.PM.AddToListsbracket=function(){ 
   var tempobject=arguments[0];
   var temprequiredname= CaluMath.PM.GetPageMakerGraphFullName(tempobject);

   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.concat([[temprequiredname,temprequiredname,tempobject]]);
};

CaluMath.PM.PageMakerbracketDefault.ListArray = ["graphlist"];

CaluMath.PM.DeleteFromListsbracket=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.graphlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.graphlist.slice(tempindex+1));
};

CaluMath.PM.AddToListspointbrackets3=function(){ 
   var tempobject=arguments[0];
   var temprequiredname= CaluMath.PM.GetPageMakerGraphFullName(tempobject);

   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.concat([[temprequiredname,temprequiredname,tempobject]]);
};

CaluMath.PM.PageMakerpointbrackets3Default.ListArray = ["graphlist"];

CaluMath.PM.DeleteFromListspointbrackets3=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.graphlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.graphlist.slice(tempindex+1));
};

CaluMath.PM.AddToListspointbrackets2=function(){ 
   var tempobject=arguments[0];
   var temprequiredname= CaluMath.PM.GetPageMakerGraphFullName(tempobject);

   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.concat([[temprequiredname,temprequiredname,tempobject]]);
};

CaluMath.PM.PageMakerpointbrackets2Default.ListArray = ["graphlist"];


CaluMath.PM.DeleteFromListspointbrackets2=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.graphlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.graphlist.slice(tempindex+1));
};

CaluMath.PM.AddToListspointbrackets1=function(){ 
   var tempobject=arguments[0];
   var temprequiredname= CaluMath.PM.GetPageMakerGraphFullName(tempobject);

   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.concat([[temprequiredname,temprequiredname,tempobject]]);
};

CaluMath.PM.PageMakerpointbrackets1Default.ListArray = ["graphlist"];

CaluMath.PM.DeleteFromListspointbrackets1=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.graphlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.graphlist=CaluMath.PM.PlotlistObject.graphlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.graphlist.slice(tempindex+1));
};

CaluMath.PM.AddToListsfocusobject=function(){ 
   var tempobject=arguments[0];
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");

   CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[tempcaswindow+".CM_ParentObject."+tempname,tempcaswindow+".CM_ParentObject."+tempname,tempobject]]);
   CaluMath.PM.PlotlistObject.focuslist=CaluMath.PM.PlotlistObject.focuslist.concat([[tempcaswindow+".CM_ParentObject."+tempname,tempcaswindow+".CM_ParentObject."+tempname,tempobject]]);
};

CaluMath.PM.PageMakerfocusobjectDefault.ListArray = ["namedobjectlist", "focuslist"];

CaluMath.PM.DeleteFromListsfocusobject=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.focuslist,tempobject,2); 
   CaluMath.PM.PlotlistObject.focuslist=CaluMath.PM.PlotlistObject.focuslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.focuslist.slice(tempindex+1));
};


CaluMath.PM.AddToListslink=function(){ 
   var tempobject=arguments[0];
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");

   var tempaddress=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"address"); 
   CaluMath.PM.PlotlistObject.linkslist = CaluMath.PM.PlotlistObject.linkslist.concat([[tempaddress,tempaddress,tempobject]]);

   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 
   CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist = CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[tempname,tempname+"",tempobject]]);
};

CaluMath.PM.PageMakerlinkDefault.ListArray = ["namedobjectlist", "linkslist"];

CaluMath.PM.DeleteFromListslink=function(){
   var tempobject=arguments[0];
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.linkslist,tempobject,2); 
   CaluMath.PM.PlotlistObject.linkslist=CaluMath.PM.PlotlistObject.linkslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.linkslist.slice(tempindex+1));

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(tempindex+1));
};

CaluMath.PM.AddToListsimage=function(){ 
   var tempobject=arguments[0];
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");

   var tempaddress=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"address"); 
   CaluMath.PM.PlotlistObject.imageslist = CaluMath.PM.PlotlistObject.imageslist.concat([[tempaddress,tempaddress,tempobject]]);

   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name"); 
   CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist = CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[tempname,tempname+"",tempobject]]);
};

CaluMath.PM.PageMakerimageDefault.ListArray = ["namedobjectlist", "imageslist"];

CaluMath.PM.DeleteFromListsimage=function(){
   var tempobject=arguments[0];
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.imageslist,tempobject,2); 
   CaluMath.PM.PlotlistObject.imageslist=CaluMath.PM.PlotlistObject.imageslist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.imageslist.slice(tempindex+1));

   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(tempindex+1));
};

CaluMath.PM.AddToListsaddtoroutine=function(){ 
};

CaluMath.PM.DeleteFromListsaddtoroutine=function(){
};


CaluMath.PM.AddToListsiframecontainer=function(){ 
   var tempobject=arguments[0];
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");

   CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist.concat([[tempname, tempname, tempobject]]);
   CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[tempname, tempname, tempobject]]);
};

CaluMath.PM.PageMakeriframecontainerDefault.ListArray = ["namedobjectlist", "staticobjectlist"];


CaluMath.PM.DeleteFromListsiframecontainer=function(){
   var tempobject=arguments[0];
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist.slice(tempindex+1));
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(tempindex+1));
};


CaluMath.PM.AddToListstable=function(){ 
   var tempobject=arguments[0];
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
   var tempdynamic=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"dynamic");


   if(tempdynamic=="no"){
      CaluMath.PM.PlotlistObject.tablelist=CaluMath.PM.PlotlistObject.tablelist.concat([[tempname, tempname, tempobject]]);
      CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist.concat([[tempname, tempname, tempobject]]);
      CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[tempname, tempname, tempobject]]);
   }
   else{
      CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[tempname, tempname, tempobject]]);
      CaluMath.PM.PlotlistObject.tablelist=CaluMath.PM.PlotlistObject.tablelist.concat([[tempname, tempname+'.cm_node[0]', tempobject]]);
   };

   var temprows=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"rows");
   var tempcols=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"columns");
   for(var i=0; i< temprows; i++){
      CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist = CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[tempname+"R"+i,tempname+"R"+i, tempobject.childarray[i]]]);
      for(var j=0; j< tempcols; j++){
         CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist = CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[tempname+"R"+i+"C"+j,tempname+"R"+i+"C"+j, tempobject.childarray[i].childarray[j]]]);
         if(CaluMath.PM.GetPageMakerObjectSetting(tempobject,"dynamic")=="no"){
            CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist = CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist.concat([[tempname+"R"+i+"C"+j,tempname+"R"+i+"C"+j, tempobject.childarray[i].childarray[j]]]);
         };
      };
   };
};

CaluMath.PM.DeleteFromListstable=function(){
   var tempobject=arguments[0];
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
//alerttest([tempname, tempcaswindow]);
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.tablelist,tempobject,2); 
   CaluMath.PM.PlotlistObject.tablelist=CaluMath.PM.PlotlistObject.tablelist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.tablelist.slice(tempindex+1));
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist.slice(tempindex+1));
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(tempindex+1));
   var temprows=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"rows");
   var tempcols=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"columns");
      for(var i=0; i< temprows; i++){
         var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist,tempname+"R"+i,0); 
         CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(tempindex+1));
            for(var j=0; j< tempcols; j++){
               var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist,tempname+"R"+i+"C"+j,0); 
               CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(tempindex+1));
               var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist,tempname+"R"+i+"C"+j,0); 
               CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist.slice(tempindex+1));
            };
      };
};

CaluMath.PM.AddToListsfunctiontable=function(){ 
   var tempobject=arguments[0];
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");


      CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[tempname, tempname, tempobject]]);
      CaluMath.PM.PlotlistObject.functiontablelist=CaluMath.PM.PlotlistObject.functiontablelist.concat([[tempname, tempname+'.cm_node[0]', tempobject]]);

   var temprows=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"rows");
   var tempcols=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"columns");
};

CaluMath.PM.DeleteFromListsfunctiontable=function(){
   var tempobject=arguments[0];
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.functiontablelist,tempobject,2); 
   CaluMath.PM.PlotlistObject.functiontablelist=CaluMath.PM.PlotlistObject.functiontablelist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.functiontablelist.slice(tempindex+1));
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(tempindex+1));
   var temprows=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"rows");
   var tempcols=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"columns");
};

CaluMath.PM.AddToListstablefromdata=function(){ 
   var tempobject=arguments[0];
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");

      CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[tempname, tempname, tempobject]]);
//      CaluMath.PM.PlotlistObject.tablefromdatalist=CaluMath.PM.PlotlistObject.tablefromdatalist.concat([[tempname, tempname+'.cm_node[0]', tempobject]]);
      CaluMath.PM.PlotlistObject.tablefromdatalist=CaluMath.PM.PlotlistObject.tablefromdatalist.concat([[tempname, tempname, tempobject]]);

   var temprows=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"rows");
   var tempcols=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"columns");
};

CaluMath.PM.DeleteFromListstablefromdata=function(){
   var tempobject=arguments[0];
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.tablefromdatalist,tempobject,2); 
   CaluMath.PM.PlotlistObject.tablefromdatalist=CaluMath.PM.PlotlistObject.tablefromdatalist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.functiontablelist.slice(tempindex+1));
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(tempindex+1));
   var temprows=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"rows");
   var tempcols=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"columns");
};


CaluMath.PM.AddToListsdiscretefunctionconstructiontable=function(){ 
   var tempobject=arguments[0];
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
   CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[tempname, tempname+"_CaluMath.Html.Table", tempobject]]);
};

CaluMath.PM.DeleteFromListsdiscretefunctionconstructiontable=function(){
   var tempobject=arguments[0];
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(tempindex+1));
};


CaluMath.PM.AddToListsinserttablerow=function(){ 
};

CaluMath.PM.DeleteFromListsinserttablerow=function(){
};

CaluMath.PM.AddToListsinserttablecolumn=function(){ 
};

CaluMath.PM.DeleteFromListsinserttablecolumn=function(){
};

CaluMath.PM.AddToListsdeletetablerow=function(){ 
};

CaluMath.PM.DeleteFromListsdeletetablerow=function(){
};

CaluMath.PM.AddToListsdeletetablecolumn=function(){ 
};

CaluMath.PM.DeleteFromListsdeletetablecolumn=function(){
};


CaluMath.PM.AddToListstablecolumn=function(){ 
};

CaluMath.PM.DeleteFromListstablecolumn=function(){
};

CaluMath.PM.AddToListstablerow=function(){ 
};

CaluMath.PM.DeleteFromListstablerow=function(){
};

CaluMath.PM.AddToListscomment=function(){ 
};

CaluMath.PM.DeleteFromListscomment=function(){
};

CaluMath.PM.AddToListschangelinks=function(){ 
};

CaluMath.PM.DeleteFromListschangelinks=function(){
};

CaluMath.PM.AddToListschangeimages=function(){ 
};

CaluMath.PM.DeleteFromListschangeimages=function(){
};

CaluMath.PM.AddToListsaddhtml=function(){ 
};

CaluMath.PM.DeleteFromListsaddhtml=function(){
};

CaluMath.PM.AddToListsheadhtml=function(){ 
};

CaluMath.PM.DeleteFromListsheadhtml=function(){
};

CaluMath.PM.DeleteFromListstablerow=function(){
   var tempobject=arguments[0];
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");

   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.tablelist,tempobject,2); 
   CaluMath.PM.PlotlistObject.tablelist=CaluMath.PM.PlotlistObject.tablelist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.tablelist.slice(tempindex+1));
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist.slice(tempindex+1));
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(tempindex+1));
   var temprows=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"rows");
   var tempcols=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"columns");
   for(var i=0; i< temprows; i++){
      var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist,tempname+"R"+i,0); 
      CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(tempindex+1));
      for(var j=0; j< tempcols; j++){
         var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist,tempname+"R"+i+"C"+j,0); 
//alerttest([tempindex, CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist[tempindex]]);
         CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(tempindex+1));
         var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist,tempname+"R"+i+"C"+j,0); 
//alerttest([tempindex, CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist[tempindex]]);
         CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].staticobjectlist.slice(tempindex+1));
      };
   };
};

CaluMath.PM.AddToListstablecell=function(){ 
};

CaluMath.PM.DeleteFromListstablecell=function(){
};

CaluMath.PM.AddToListstablerow=function(){ 
};

CaluMath.PM.DeleteFromListstablerow=function(){
};


CaluMath.PM.AddToListslist=function(){ 
   var tempobject=arguments[0];
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");


      CaluMath.PM.PlotlistObject.listlist=CaluMath.PM.PlotlistObject.listlist.concat([[tempname, tempname, tempobject]]);
      CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[tempname, tempname, tempobject]]);

   var tempitems=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"items");
   if(CaluMath.PM.GetPageMakerObjectSetting(tempobject,"listtype") != "dl"){
      for(var i=1; i<= tempitems; i++){
         CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist = CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[tempname+"I"+i,tempname+"I"+i, tempobject.childarray[i-1]]]);
      };
   }
   else{
      for(var i=1; i<= tempitems; i++){
         CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist = CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[tempname+"T"+i,tempname+"T"+i, tempobject.childarray[2*i-2]]]);
         CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist = CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.concat([[tempname+"D"+i,tempname+"D"+i, tempobject.childarray[2*i-1]]]);
      };
   };

};

CaluMath.PM.DeleteFromListslist=function(){
   var tempobject=arguments[0];
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.listlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.listlist=CaluMath.PM.PlotlistObject.listlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject.listlist.slice(tempindex+1));
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist,tempobject,2); 
   CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(tempindex+1));
   var tempitems=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"items");
   if(CaluMath.PM.GetPageMakerObjectSetting(tempobject,"listtype") != "dl"){
      for(var i=1; i<= tempitems; i++){
         var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist,tempname+"I"+i,0); 
         CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(tempindex+1));
      };
   }
   else{
      for(var i=1; i<= tempitems; i++){
         var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist,tempname+"T"+i,0); 
         CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(tempindex+1));
         var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist,tempname+"D"+i,0); 
         CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist=CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(0,tempindex).concat(CaluMath.PM.PlotlistObject[tempcaswindow].namedobjectlist.slice(tempindex+1));
      };
   };

};






CaluMath.PM.AddToListsinsertlistitem=function(){ 
};

CaluMath.PM.DeleteFromListsinsertlistitem=function(){
};



CaluMath.PM.AddToListsdeletelistitem=function(){ 
};

CaluMath.PM.DeleteFromListsdeletelistitem=function(){
};

CaluMath.PM.AddToListslistitem=function(){ 
};

CaluMath.PM.DeleteFromListslistitem=function(){
};



CaluMath.PM.AddToListsnewwindow=function(){ 
   var tempobject=arguments[0];
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
   CM_TopWindow.CaluMath.PM.PlotlistObject.newwindowlist.push([tempname, tempname, tempobject]);
   CaluMath.PM.PlotlistObject[tempname]=new Object();
//   CaluMath.PM.PlotlistObject[tempname].iframelist=new Array();
   CaluMath.PM.PlotlistObject[tempname].namedobjectlist=new Array();
   CaluMath.PM.PlotlistObject[tempname].staticobjectlist=new Array();

};

CaluMath.PM.PageMakernewwindowDefault.ListArray = ["newwindowlist"];

CaluMath.PM.DeleteFromListsnewwindow=function(){
   var tempobject=arguments[0];
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
//   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.namedobjectlist,tempobject,2); 
//   CM_TopWindow.CaluMath.PM.PlotlistObject.namedobjectlist=CM_TopWindow.CaluMath.PM.PlotlistObject.namedobjectlist.slice(0,tempindex).concat(CM_TopWindow.CaluMath.PM.PlotlistObject.namedobjectlist.slice(tempindex+1));
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.newwindowlist,tempobject,2); 
   CM_TopWindow.CaluMath.PM.PlotlistObject.newwindowlist=CM_TopWindow.CaluMath.PM.PlotlistObject.newwindowlist.slice(0,tempindex).concat(CM_TopWindow.CaluMath.PM.PlotlistObject.newwindowlist.slice(tempindex+1));
//   CaluMath.PM.PlotlistObject[tempname].iframelist=null;
   CaluMath.PM.PlotlistObject[tempname]=null;
};

CaluMath.PM.AddToListsiframe=function(){ 
   var tempobject=arguments[0];
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
   var tempcaswindow=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"cm_caswindow");
   CaluMath.PM.PlotlistObject.iframelist.push([tempcaswindow+"."+tempname,tempcaswindow+"."+tempname, tempobject]);
};

CaluMath.PM.PageMakeriframeDefault.ListArray = ["iframelist"];

CaluMath.PM.DeleteFromListsiframe=function(){
   var tempobject=arguments[0];
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.iframelist,tempobject,2); 
   CaluMath.PM.PlotlistObject.iframelist.splice(tempindex,1);
};

 
CaluMath.PM.AddToListsaddtonewwindow=function(){ 
};

CaluMath.PM.PageMakeraddtonewwindowDefault.ListArray= [];

CaluMath.PM.DeleteFromListsaddtonewwindow=function(){
};


CaluMath.PM.AddToListsrescaleaxes=function(){ 
};

CaluMath.PM.PageMakerrescaleaxesDefault.ListArray= [];

CaluMath.PM.DeleteFromListsrescaleaxes=function(){
};

CaluMath.PM.AddToListsaddtoboxordropdown=function(){ 
};

CaluMath.PM.PageMakeraddtoboxordropdownDefault.ListArray= [];

CaluMath.PM.DeleteFromListsaddtoboxordropdown=function(){
};


CaluMath.PM.AddToListschangebuttontype=function(){ 
};
CaluMath.PM.DeleteFromListschangebuttontype=function(){
};

//CaluMath.Html.AddToListsmoveobject = function(){ 
//};
//CaluMath.Html.DeleteFromListsmoveobject = function(){
//};

CaluMath.PM.AddToListsimportpage=function(){ 
};
CaluMath.PM.DeleteFromListsimportpage=function(){
};

CaluMath.PM.AddToListsclipboardplaceholder=function(){ 
};
CaluMath.PM.DeleteFromListsclipboardplaceholder=function(){
};
CaluMath.PM.AddToListsclipboard=function(){ 
};
CaluMath.PM.DeleteFromListsclipboard=function(){
};

CaluMath.PM.AddToListshtmltext=CaluMath.PM.AddToListsp;
CaluMath.PM.AddToListstext=CaluMath.PM.AddToListsp;
CaluMath.PM.DeleteFromListshtmltext=CaluMath.PM.DeleteFromListsp;
CaluMath.PM.DeleteFromListstext=CaluMath.PM.DeleteFromListsp;

CaluMath.PM.AddToListscoordinates=function(){ 
   var tempobject=arguments[0];
   var tempname=CaluMath.PM.GetPageMakerObjectSetting(tempobject,"name");
   //Comment: The use of tempdefinedfunction here is useless. These things never actually appear in a dropdown menu, only in the List that opens in a window so users can edit. 
   CaluMath.PM.PlotlistObject.mathtextlist.push([tempname, tempname, tempobject]);
};

CaluMath.PM.PageMakercoordinatesDefault.ListArray = ["mathtextlist"];


CaluMath.PM.DeleteFromListscoordinates=function(){
   var tempobject=arguments[0];
   var tempindex = CaluMath.PM.ArrayIndex(CaluMath.PM.PlotlistObject.mathtextlist,tempobject,2); 
   CaluMath.PM.PlotlistObject.mathtextlist.splice(tempindex,1);
};

};

