/* *******std********* */
/* mlsx main menu data */
/* ******************* */
/* CODEDATE 11 Jun 2001 MD$Objects.js */
function MD$SystemOptions()
  {
     this.HotMailButton = 'Y'; // hotmail button appears for expanded reports
     this.PublishButton = 'Y'; // publish button appears for expanded reports
     this.RoutingButton = 'Y'; // routing button appears for expanded reports
     this.PDRButton     = 'N'; // property disclosure reports
     this.GreetingMessage = 'Y'; // issue the greeting message   
  }

function MD$Button(title,gif,disable)
  {
    /* button definitions */
    this.Gif       = gif;          // button gif
    this.MenuTitle = title;        // title displayed on menu
    if (typeof(disable) == "undefined") this.ButtonDisabled = false;
      else this.ButtonDisabled = true;
    this.F          = new Array(); // function info
  }

function MD$Function(name,href,cookie)
  {
    /* required function definitions     */
    this.Name    = name;   // function name displayed to user
    this.HREF    = href;   // location to set to start this function
    if (typeof(cookie) == "undefined") this.Cookie = "";
      else this.Cookie  = cookie; // xploresearch searchtemplate cookie

    /* the following properties are used only if Cookie is set to  */
    /* searhtemplate=std*.htm                                      */
    this.Icon = ""; // stdsearch icon gif
    this.Tab1 = ""; // stdsearch tab1 gif or tab1 html (searching)
    this.Nav1 = "stdnav1nomap.htm"; // stdsearch navigation bar #1
    this.Nav2 = "stdnav2nomap.htm"; // stdsearch navigation bar #2

    this.GeoRpt         = "MLSX_PALL_FULL"; // name of report for GeoURLCommand (see report_script.js)
    this.GeoCodeFieldName="GEOCODE"; // must be upper case
    this.BaseFile       = ""; // the base file for this function
    this.KeyField       = ""; // key field for the base file (used by some reports) 
    this.CrFldsTemplate = ""; // LoadFieldCommand fields template for custom reports
    this.CrFldsTable    = ""; // LoadFieldCommand fields trough table for custom reports
    this.ViewFolder     = "stdviewresults.htm"; // ViewFolder html file 
    this.ViewTab        = ""; // stdsearch view gif or view html (viewing)
    this.ViewOptions    = ""; // view options (name of report options pool)
    this.ViewExpOptions = ""; // view options for the expanded reports (name of report options pool)
    this.PrintFolder    = "stdprintresults.htm"; // PrintFolder html file 
    this.PrintTab       = ""; // stdsearch print gif or print html (printing)
    this.PrintOptions   = ""; // print options (name of print options pool)
    this.PrintFramesetCol = "42%,29%,29%"; // 3 columns users for print folder
                                           // set to "75%,25%" for 2 columns
    this.SearchFunction = ""; // search function 
    this.ReportFunction = ""; // report function
    this.Panel1Prompt   = "Select Search Type:"; // prompt to display in panel1

    this.Panel3Control     = "stdsearchany.htm"; // default ctl html for add more criteria
    this.Panel3Options     = ""; // field group to display in panel3 if stdsearchany.htm
    this.Panel3FramesetRow = "18%,82%";     // frameset row=    if stdsearchany.htm
    this.Panel3FramesetCol = "25%,38%,37%"; // frameset col=    if stdsearchany.htm
    this.Panel3ButtonSrc   = "spbuttons.htm";

    this.MenuSecurity      = ""; // the compass function code to be used for security
                                 // if user can run this cmps func => user can run this xplr func
    this.HotMailButton = ''; //  override the setting at the system level
    this.PublishButton = ''; //  override the setting at the system level
    this.RoutingButton = ''; //  override the setting at the system level   
    this.PDRButton     = ''; //  override the setting at the system level
    this.DisableVirtualTours = 'N'; // disable virtual tours for a function

    this.Tab1Help = new Array(); // help for the first tab (usually search) new for 1.3
    this.Tab2Help = new Array(); // help for the second tab (usually view) new for 1.3
    this.Tab3Help = new Array(); // help for the third tab (usually print) new for 1.3

    this.PublishShowRoute = "PUB_SHOWROUTE"; // publish show route report
    this.PublishShowMap   = "PUB_MAP";       // publish show map report
    this.PublishShowTour  = "PUB_SHOWTOUR";  // publish show tour report

    this.O    = new Array(); // panel 1 options
  }

function MD$FunctionOption(name,value)
  {
     this.Name  = name;                 // options displayed
     // value associated with each option  can be html or function call
     if (typeof(value) == "undefined") this.Value = "stdsearchin.htm";
       else this.Value = value;
     this.Panel2Prompt   = "Enter Search Criteria:";// panel 2 prompt to display
     this.TipHelp        = "s2help.html";// panel 2 Tip Help file

     /* the next three properties are used to override the coresponding properties of the */
     /* MD$Function object */
     this.ViewOptions    = ""; // view options (name of report options pool)
     this.ViewExpOptions = ""; // view options for the expanded reports (name of report options pool)
     this.PrintOptions   = ""; // print options (name of print options pool)

     this.I              = new Array(); // panel 2 inputs
  }

function MD$InputSelect(name,fieldname,size)
  {
    this.Name      = name;
    this.FieldName = fieldname;
    this.DoSearch  = "Yes";
    this.Type      = "SELECT";
    this.Size      = size;
    this.OnChange  = ""; // specify an onChange statement to override the generated onChange 
    this.O         = new Array();
  }

function MD$InputOption(name,value,selected)
  {
    this.Name      = name;       
    this.Value     = value;
    if (typeof(selected) == "undefined") this.Selected = false;
      else this.Selected = true;
  }

function MD$InputText(name,fieldname,size,value)
  {
    this.Name      = name;
    this.FieldName = fieldname;
    this.DoSearch  = "Yes";
    this.Type      = "TEXT";
    this.Size      = size;
    this.OnChange  = ""; // specify an onChange statement to override the generated onChange   
    if (typeof(value) == "undefined") this.Value = "";
      else this.Value = value;
/*  this.O         = new Array();    should never be any options */
  }

function MD$InputHeader(name)
  {
    this.Name      = name;
/*  this.FieldName = ""; */
/*  this.DoSearch  = ""; */
    this.Type      = "HEADER"; 
/*  this.Size      = ""; */
/*  this.Value     = ""; */
/*  this.O         = new Array();    should never be any options */
  }

function MD$InputHidden(name,value)
  {
/*  this.Name      = ""; */
    this.FieldName = name;
/*  this.DoSearch  = ""; */
    this.Type      = "HIDDEN"; 
/*  this.Size      = ""; */
    this.Value     = value;
/*  this.O         = new Array();    should never be any options */
  }

function MD$InputSubmit(name) 
  {
    this.Name     = name;
/*  this.FieldName = ""; */
/*  this.DoSearch  = ""; */
    this.Type      = "SUBMIT"; 
/*  this.Size      = ""; */
/*  this.Value     = ""; */
/*  this.O         = new Array();    should never be any options */
  }


function MD$Binoculars(fieldname,type,altfunction,top,left)
  {
     if (typeof(top) == "undefined") this.BinocularsTop = "";
       else this.BinocularsTop  = top;      // panel 2 Binoculars top location
     if (typeof(left) == "undefined") this.BinocularsLeft = "";
       else this.BinocularsLeft = left;     // panel 2 Binoculars left location
     this.TableHelpParms = "document.forms[0],'"+fieldname+
                           "','"+type+"','"+altfunction+"'";
                                        // table help call parms
     /* if the binoculars are to FOLLOW an input item in a table this object then */
     /* needs the properties of an input item. the binoculars are used this way in */
     /* reverse prospecting and as a free floating item every where else */
/*   this.Name      = "";   */
     this.FieldName = fieldname;
/*   this.DoSearch  = "";   */      
     this.Type      = "BINOCULARS";
/*   this.Size      = "";   */
/*   this.Value     = "";   */
/*   this.O         = new Array();    should never be any options */
  }

function MD$GetYesterday()
  {
    var mm,dd,yy;
    var today = new Date();
    var yesterday = new Date();
    var year;
    var leap_year;
    days_per_month     = new Array();
    days_per_month[0]  = 31;
    days_per_month[1]  = 28;
    days_per_month[2]  = 31;
    days_per_month[3]  = 30;
    days_per_month[4]  = 31;
    days_per_month[5]  = 30;
    days_per_month[6]  = 31;
    days_per_month[7]  = 31;
    days_per_month[8]  = 30;
    days_per_month[9]  = 31;
    days_per_month[10] = 30;
    days_per_month[11] = 31;

    /* get mm dd yy for yesterday */
    mm = today.getMonth();
    dd = today.getDate()-1;
    yy = today.getYear();

    if (dd < 1) {
      mm = mm - 1;
      if (mm <0 ) {
         mm = 11;
         yy = yy - 1;
      }
      year = yy +1900;
      if (yy<50) year = yy + 2000;
      leap_year = eval(parseInt(eval("year/4"))+'*4');
      if (year == leap_year) days_per_month[1] = 29;
      dd = days_per_month[mm];
    }

    yesterday.setMonth(mm);
    yesterday.setDate(dd);
    yesterday.setYear(yy);
 
    return yesterday;
  }

function MD$FieldGroup()
  {
     this.O = new Array();
  }

function MD$FieldGroupOption(name,table,fieldnamecol,fieldtypecol,
                         fielddisplaynamecol,boxsize)
  {
     this.Name     = name; // the name displayed in the panel 3 selection box
     this.Table    = table;   // the fields table used in the GEN_LIST url
     this.Template = "stdfields.template"; // the template used in the GEN_LIST url
     this.FieldNameCol        = fieldnamecol;
     this.FieldTypeCol        = fieldtypecol;
     this.FieldDisplayNameCol = fielddisplaynamecol;
     if (typeof(boxsize) == "undefined") this.BoxSize = 9;
       else this.BoxSize = boxsize;
  }


function MD$View()
  {
     this.O = new Array();
     this.DontPublishReports = ''; // string containg names of reports not to be
                                   // published
  }

function MD$ViewOption(name,report,type)      
  {
    this.Name     = name;   // the name displayed in the view selection box
    this.Value    = report; // the compass report to be used
    // Type = 'R' DoReport if from stdvlpanel1.htm
    // Type = 'R' DoSingleReport if from stdvlpanel1exdpand.htm
    // type = 'T' DoTwoFrameReport
    // type = 'C' DoCompoundReport
    // type = 'M' Report with EMBEDDED MAP (ILAYER / IFRAME)
    // type = 'F' PC access flyer (requires FlyerSetup.htm)
    // type = 'P' Palm list data  (requires PalmSetup.htm)
    if (typeof(type) == "undefined") this.Type = 'R'; 
      else this.Type = type.toUpperCase();
  }

function MD$Print()
  {
     this.O = new Array();
  }

function MD$PrintOption(name,report,type)
  {
    this.Name     = name;   // the name displayed for this report
    this.Value    = report; // the compass report to be used
    // type = 'M' Report with EMBEDDED MAP (ILAYER / IFRAME)
    if (typeof(type) == "undefined") this.Type = ''; 
      else this.Type = type.toUpperCase();     
  }

function MD$YearFix(yy)
  {
    /* for dates after 1/31/99 netscape and ie javascript getYear() methods */
    /* operate differently this functions corrects this problem             */
    /* netscape always subtracts 1900 from the year and IE subtracts 1900   */
    /* for years up to 2000 for 2000 and later IE returns a 4 digit number  */

    if (yy <= 100) yy = yy +1900;

    yy = yy.toString();
    if (yy.length == 4) yy = yy.substring(2,4);
    if (yy.length == 3) yy = yy.substring(1,3);
    if (yy.length == 1) yy = '0'+yy;
    return yy;
  }

function MD$DaysBack(days)
  {
    var mm,dd,yy;
    var year;
    days_per_month     = new Array();
    days_per_month[0]  = 31;
    days_per_month[1]  = 28;
    days_per_month[2]  = 31;
    days_per_month[3]  = 30;
    days_per_month[4]  = 31;
    days_per_month[5]  = 30;
    days_per_month[6]  = 31;
    days_per_month[7]  = 31;
    days_per_month[8]  = 30;
    days_per_month[9]  = 31;
    days_per_month[10] = 30;
    days_per_month[11] = 31;
    mm = MD$Today.getMonth() + 1;
    dd = MD$Today.getDate();
    yy = MD$YearFix(MD$Today.getYear());

    /* get year and leap year data */
    year = eval(yy+'+1900');
    if (yy<50) year = eval(yy+'+2000');
    leap_year = eval(parseInt(eval("year/4"))+'*4');
    if (year == leap_year)  days_per_month[1] = 29;
 
    /* backup the number of days */
    dd = dd - days;
    while(dd <= 0) {
      mm = mm - 1;
      if (mm <=0) {
        mm = 12;
        yy = yy - 1;
      }
      dd = days_per_month[mm-1] + dd;
    }

    yy = yy.toString();
    if (yy.length == 4) yy = yy.substring(2,4);
    if (yy.length == 3) yy = yy.substring(1,3);
    if (yy.length == 1) yy = '0'+yy;

    return(mm+'/'+dd+'/'+yy);
  }

var MD$B  = new Array();    /* button array */
var MD$FG = new Array();    /* field groups for panel3 option array */
var MD$V  = new Array();    /* view option array */
var MD$P  = new Array();    /* print option array */

var MD$Today = new Date();
var MD$Yesterday = MD$GetYesterday();
