///////////////////////////////////////////////////////////////////
//                         21/11/2002                            //
//        VIMPT NOTE! This code was moved from viewer.htm        //
///////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////
//        DO NOT REMOVE OR ALTER THIS COPYRIGHT NOTICE!          //
//             Copyright © Tel-Aviv Municipality                 //
//   The entire contents of this file is the sole property       //
//   of Tel-Aviv Municipality and is not to be copied,altered,   //
//   used, reused, or studied in whole or in part by any means   //
//      for any purpose except within Tel-Aviv municipality.     //
///////////////////////////////////////////////////////////////////

// INSTANCE VARIABLES
var is_nl;

is_nl = String.fromCharCode(13);

// GLOBAL VARIABLES
var gi_screensize;
var gs_rows;
var T, F;
T = true;
F = false;

// SCALE - 26/07/04 can be changed with scale (kanam)
gi_screensize = 17;
gi_scale      = 20000;
gb_scale      = F;

// Toolbar - 20/01/08 style - image directory
var gs_tools = 'classic';                     // modern/classic

// Favorite - 21/01/08 address (Used in fr_disclaimer)
var gs_favorite = 'http://gis.tel-aviv.gov.il/iview';

// flag - 22/10/03 moved and renamed gb_.. - from ArcIMSparam.js
var gb_iriaAssets = F;

// ACHIFA flag removed - 30/11/08

// MAX no. of features
var gi_maxfeatures = 500;                      // Max. no. of maptips

// 06/10/02 gs_iriaMail: Mailback address
// Removed 15/11/2004 - replaced by local variable is_iriamail in: fr_logo.htm
// var gs_iriaMail = 'mailto:bennyw@mail.tel-aviv.gov.il?CC=polakov_a@mail.tel-aviv.gov.il'

// 27/02/02 gs_iriaLanguage: Display Language ; hebrew/english
//          gs_iriaDir     : Text direction   ; Reset in jf_aimsResource_setlanguage()
var gs_iriaLanguage, gs_iriaDir;
gs_iriaLanguage = 'hebrew';                    // 'english';
gs_iriaDir      = ' DIR=rtl ALIGN=right ';     // ' DIR=ltr ALIGN=left ';

// 21/03/02 Application Mode Type: intranet,internet,kiosk,...
var gs_iriaMode;
gs_iriaMode = '';
// gs_iriaMode = 'intranet';
gs_iriaMode = 'internet';                   // 06/06/02 internet mode - some layers hidden
// gs_iriaMode = 'kiosk';                      // 01/05/02 kiosk mode - fewer and large buttons - layers as in internet mode
gs_iriaMode = (gs_iriaMode == '') ? 'intranet' : gs_iriaMode;

// 07/09/05 Application: iview,kiosk,nehasim,dvpt...
var gs_iriaApplication;
gs_iriaApplication = document.location.href;
gs_iriaApplication = gs_iriaApplication.replace(/\/\//gi, '\/');
gs_iriaApplication = gs_iriaApplication.replace(/\\\\/gi, '\/');
gs_iriaApplication = gs_iriaApplication.replace(/http:/gi, '');
gs_iriaApplication = gs_iriaApplication.replace(/www./gi,  '');
gs_iriaApplication = gs_iriaApplication.split('/')[2];

// 21/02/01 flag for initial map load completed
var gb_iriaMapLoaded;
gb_iriaMapLoaded = F;

// 29/08/05 flag for statistics
var gb_statistics;
gb_statistics = F;

// 14/09/05 flags for mapshots
var gb_iriaMapDebug, gb_iriaMapShots;
gb_iriaMapDebug = F;     // Set to T for mapshot list with coordinates
gb_iriaMapShots = F;     // Set to T to view mapshots with hyperlinks

var gw_query;                         // Query Window

var gr_samples;                       // Samples array
gr_samples = new Array();

// 12/03/02 - layer statuses saved when displaying lists (fr_list.htm)
var g_ActiveLayer, g_ActiveLayerType, g_ActiveLayerIndex
g_ActiveLayer      = -1
g_ActiveLayerType  = -1
g_ActiveLayerIndex = -1

// 4/12/01 - saves TOC tree between refreshes of the TOC
var gr_iriaTree, gr_iriaTree_org;
gr_iriaTree = new Array();

// 1/07/04 - layers listed alphabetically with layerID "|" concatenated
// Used for layer search in tree
var gr_layerabc;
gr_layerabc = new Array();

// 14/01/02 - layer dropdown
var gs_droplayer;
var gr_droplayer;
gs_droplayer = '';
gr_droplayer = new Array();           // 21/04/02 - Used by fr_sql.htm

// 18/02/02 - parameters to control opening mode
var gr_iriaURL;
gr_iriaURL = new class_urlparms(document.location.href);
function class_urlparms(as_url)
{
 var li, li_upb;
 var ls_eval, ls_parms;
 var lr_parms, lr_line;

 ls_parms = '';

 // Default values
 this.url        = as_url;
 this.gush       = '';
 this.helka      = '';
 this.street_no  = '';
 this.street_nam = '';
 this.tzomet     = '';
 this.house      = '';
 this.houseto    = '';
 this.zoom       = '';
 this.layers     = '';
 this.unlayers   = '';
 this.type       = '';
 this.layer      = '';
 this.field      = '';
 this.value      = '';
 this.mode       = '';
 this.thebutton  = '';
 this.panel      = '';
 this.prmapp     = '';

 this.x    = '';
 this.y    = '';
 this.minx = '';
 this.miny = '';
 this.maxx = '';
 this.maxy = '';

 this.zoom = (this.zoom == '') ? '300' : this.zoom ;

 li = as_url.indexOf('?')
 if (li > 0)
 {
  ls_parms = as_url.substr(li + 1);
  lr_parms = ls_parms.split('&');
  li_upb   = lr_parms.length;
  for (li=0;li<li_upb;li++)
  {
   if (lr_parms[li].indexOf('=') > -1)
   {
    lr_line = lr_parms[li].split('=');
    ls_eval = 'this.' + lr_line[0].toLowerCase() + '="' + lr_line[1] + '"'
    ls_eval = eval(ls_eval);
   }
  }
 }
}

gs_iriaMode = (gr_iriaURL.mode == 'kiosk') ? gr_iriaURL.mode : gs_iriaMode;

// 18/11/02 Find button resized
var gs_find;
gs_find  = ""
gs_find += "<TD VALIGN=bottom>\n";
gs_find += "&nbsp;\n";
gs_find += " <A onClick=f_submit() \n";
gs_find += "  onMouseOver=images['search'].src='../images/find_2.gif' \n";
gs_find += "  onMouseOut=images['search'].src='../images/find_1.gif'> \n";
gs_find += "   <IMG VALIGN=bottom BORDER=0 NAME=search SRC='../images/find_1.gif' ALT=ητω "
if (gs_iriaMode == 'kiosk') {gs_find += " WIDTH=25px HEIGHT=25px ";}
gs_find += "></A>\n";
gs_find += "&nbsp;\n";
gs_find += "</TD>\n";

