/*
Copyright (c) 2009, Devel-Tech Inc., dti@develtech.ca
All rights reserved.
Redistribution and/or use in source and binary forms, with or without modification, 
are NOT permitted without the express written consent of Devel-Tech Inc. 
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
var red_iconfile = "./images/reddotSmall.png";
var grey_iconfile = "./images/reddotSmallGrey.png";
var cyan_iconfile = "./images/reddotSmallBlue.png";
var large_red_iconfile = "./images/reddotLarge.png";
var large_cyan_iconfile = "./images/bluedotLarge.png";
/*
var groceries_iconfile = "./images/groceries.png";
var drugs_iconfile = "./images/drugs.png";
var facilities_iconfile = "./images/facilities.png"; 
var bars_iconfile = "./images/bars.png";
var coffeeshops_iconfile = "./images/coffeehouse.png";
var cinemas_iconfile = "./images/movies.png";
var parks_iconfile = "./images/picnic.png";
var retail_iconfile = "./images/shopping.png"; 
var daycare_iconfile = "./images/facilities.png";
*/
var groceries_iconfile = "./images/iconMap_groceries.png";
var drugs_iconfile = "./images/iconMap_drugstore.png";
var facilities_iconfile = "./images/iconMap_facility.png"; 
var bars_iconfile = "./images/iconMap_bar.png";
var coffeeshops_iconfile = "./images/iconMap_coffee.png";
var cinemas_iconfile = "./images/iconMap_movies.png";
var parks_iconfile = "./images/iconMap_picnicpark.png";
var retail_iconfile = "./images/iconMap_shops.png"; 
var daycare_iconfile = "./images/iconMap_daycare.png";
var offleash_iconfile = "./images/iconMap_dogPark.png";
var haschecked = 1;
var checkbox_image_width = 12;
var checkbox_image_height = 20;
var showcriteria = 0; var competitor_view = 0;
var workingflag = 0; var keyword_txt = "";
var myzoomflag = 0; var filterson = 0; 
var proximityon = 0; var startup = 1;
var site_link = ""; var storedflag = 0;
var max_marker_points = 300; var dragzoomflag = 0; 
var unhighlighted = 0; var midcolwidth = 0;
var cookiename = "mapinfo"; var cookienamePC = "mapinfoPC";
var cookienamebasic = "mapbasic"; var cookienamecommunity = "mapcomm";
var cookienameSN = "mapinfoSN";
var expiredays = 30;
var myPano;
var searchpoint;
var whichpanel = "basic";
var commflag = 0;
var schoolflag = 0;
var community_centroids = new Array();
var city_sections = new Array(); var city_locations = new Array();
var community_list = new Array(); var area_list = new Array();
var instructions_txt = "";
var community_markers = new Array();
var col1width = 0; var col2width = 0; var col3width = 0; var colheight = 0;
var col1widthW = 0; var col2widthW = 0; var col3widthW = 0;
var tabletopdivcontent = ""; var keyword_txt = ""; var footercontent = ""; var footercontent2 = "";
var whichscreen = ""; var whichscreen2 = ""; var communitiesname = "";
var col1A = 0; var col1B = 0; var col2A = 0; var col2B = 0; var col2C = 0; var col3A = 0; var mapwidth = 0;
var progressBar = null;
var tab_basic = ""; var tab_community = ""; var tab_proximity = "";
var refine_basic_txt = ""; var refine_community_txt = ""; var refine_proximity_txt = "";
var refine_pcode_txt = ""; var refine_streetname_txt = "";
var curprog = 0;
var landContentg;
var buscaptiong;
var searchlineg;
var totcaptiong;
var myresults = new Array();
var searchpoint = null;
var curdivname = "";
var curcheckname = "";
var search_markers = new Array(); var searchid = -1;
var groceries = ""; var drugs = ""; var fitness = ""; var bars = "";
var coffeeshops = ""; var cinemas = ""; var parks = ""; var retail = "";
var numgroceries = 0; var numdrugs = 0; var numfacilities = 0; var numbars = 0;
var numcoffeeshops = 0; var numcinemas = 0; var numparks = 0; var numretail = 0;
function addOption(theSel, theText, theValue)
{
var newOpt = new Option(theText, theValue);
var selLength = theSel.length;
theSel.options[selLength] = newOpt;
changeRefineButton();
}
function deleteOption(theSel, theIndex)
{ 
var selLength = theSel.length;
if(selLength>0){theSel.options[theIndex] = null;}
changeRefineButton();
}
function moveOptions(theSelFrom, theSelTo)
{
var selLength = theSelFrom.length;
var selectedText = new Array();
var selectedValues = new Array();
var selectedCount = 0;
var i;
for(i=selLength-1; i>=0; i--)
{
if(theSelFrom.options[i].selected)
{
selectedText[selectedCount] = theSelFrom.options[i].text;
selectedValues[selectedCount] = theSelFrom.options[i].value;
deleteOption(theSelFrom, i);
selectedCount++;
}
}
for(i=selectedCount-1; i>=0; i--){addOption(theSelTo, selectedText[i], selectedValues[i]);}
changeRefineButton();
}
function moveOptions2(theSelFrom, theSelTo)
{
var selLength = theSelFrom.length;
var selectedText = new Array();
var selectedValues = new Array();
var selectedCount = 0;
var selectedCount2 = theSelFrom.length;
var i;
for(i=selLength-1; i>=0; i--)
{
if(theSelFrom.options[i].selected)
{
selectedText[selectedCount] = theSelFrom.options[i].text;
selectedValues[selectedCount] = theSelFrom.options[i].value;
deleteOption(theSelFrom, i);
selectedCount++;
selectedCount2--;
}
}
for(i=selectedCount-1; i>=0; i--){addOption(theSelTo, selectedText[i], selectedValues[i]);}
changeRefineButton();
}
function sortOptions(theSel)
{
for (var i = 0; i < theSel.length-1; i++)
{
for (var j = i+1; j < theSel.length; j++)
{
if (theSel.options[j].text < theSel.options[i].text)
{
var temp = theSel.options[i].text;
var value = theSel.options[i].value;
theSel.options[i].text = theSel.options[j].text;
theSel.options[i].value = theSel.options[j].value;
theSel.options[j].text = text;
theSel.options[j].value = value;
}
}
}
}

