﻿// get arguments from URL (after the ?)
var args = getArgs();
var arrowtop = 0;
var left = 0;
var scrollDown = 0;
var scrollRight = 0;
var browser = "unknown";
var menuheight = 0;
var horizwidth = 0;

//if (navigator.appName.substring(0,9) == "Mozilla") browser = "Mozilla"
//else if (navigator.appName.substring(0,9) == "Microsoft") browser = "IE"
//else if (navigator.appName.substring(0,9) == "Safari") browser = "Safari"

/********************************************************
* BEGIN:  Code to specify position of arrow for each place
*/

  if (args.place == "PekingTokyo")
     {
     left = 732;
     arrowtop = 476;
     } 
   else if (args.place == "MysticKOA")
     {
     left = 951;
     arrowtop = 190;
     }
    else if (args.place == "AngelHaven")
     {
     left = 661;
     arrowtop = 581;
     }
   else if (args.place == "MysticMarriott")
     {
     left = 213;
     arrowtop = 315;
     }
   else if (args.place == "AnotherSecondPenny")
     {
     left = 1104;
     arrowtop = 78;
     }
   else if (args.place == "AbbeysLanternHillInn")
     {
     left = 754;
     arrowtop = 127;
     }
   else if (args.place == "HarpHound")
     {
     left = 58;
     arrowtop = 13;
     }
  else if (args.place == "Octagon")
     {
     left = 213;
     arrowtop = 362;
     }
   else if (args.place == "FiveGuys")
     {
     left = 710;
     arrowtop = 395;
     }
  else if (args.place == "HolidayInnExpress")
     {
     left = 631;
     arrowtop = 465;
     }
  else if (args.place == "ElizabethHarriet")
     {
     left = 912;
     arrowtop = 598;
     }
  else if (args.place == "MGMGrand")
     {
     left = 833;
     arrowtop = 12;
     }
  else if (args.place == "CoveFishMarket")
     {
     left = 943;
     arrowtop = 113;
     }
  else if (args.place == "PequotMuseum")
     {
     left = 665;
     arrowtop = 108;
     }
  else if (args.place == "MysticRiverYarns")
     {
     left = 405;
     arrowtop = 883;
     }
  else if (args.place == "BleuSquidBakery")
     {
     left = 922;
     arrowtop = 618;
     }	 
 else if (args.place == "Tastings")
     {
     left = 515;
     arrowtop = 190;
     }
  else if (args.place == "HyattPlaceMystic")
     {
     left = 600;
     arrowtop =498;
     }	 
 else if (args.place == "RAGeorgetti")
     {
     left = 860;
     arrowtop =523;
     }
  else if (args.place == "SeaBreezeInn")
     {
     left = 1187;
     arrowtop =193;
     }	 
 else if (args.place == "JakesWaybackBurgers")
     {
     left = 454;
     arrowtop = 220;
     }
  else if (args.place == "MysticPsychic")
     {
     left = 160;
     arrowtop =131;
     }	 
 else if (args.place == "MysticCigars")
     {
     left =318;
     arrowtop = 80;
     }
  else if (args.place == "DollarsSense")
     {
     left = 942;
     arrowtop =208;
     }	 
 else if (args.place == "PrescientStudiosGallery")
     {
     left = 113;
     arrowtop =38;
     }
  else if (args.place == "Stonegate")
     {
     left = 518;
     arrowtop =01;
     }	 
 else if (args.place == "DenisonNature")
     {
     left = 915;
     arrowtop = 449;
     }
 else if (args.place == "Foxwoods")
     {
     left = 701;
     arrowtop = 44;
     }
  else if (args.place == "Franklins")
     {
     left = 734;
     arrowtop =520;
     }	 
 else if (args.place == "ShadesofMystic")
     {
     left = 313;
     arrowtop = 123;
     }
  else if (args.place == "GrayGoose")
     {
     left = 724;
     arrowtop =646;
     }	 
 else if (args.place == "ArgiaCruises")
     {
     left = 327;
     arrowtop = 787;
     }
  else if (args.place == "PrescientStudios")
     {
     left = 1263;
     arrowtop =353;
     }	 
 else if (args.place == "HowardJohnson")
     {
     left = 418;
     arrowtop = 385;
     }
  else if (args.place == "IrishEyes")
     {
     left = 876;
     arrowtop =545;
     }	 
 else if (args.place == "MysticHilton")
     {
     left = 832;
     arrowtop = 434;
     }
  else if (args.place == "MangosPizza")
     {
     left = 917;
     arrowtop =527;
     }	 
 else if (args.place == "BeccaRose")
     {
     left = 940;
     arrowtop = 551;
     }
  else if (args.place == "VoyagerCruises")
     {
     left = 320;
     arrowtop =841;
     }	 
 else if (args.place == "McDonalds")
     {
     left = 616;
     arrowtop = 403;
     }
  else if (args.place == "LaQuinta")
     {
     left = 836;
     arrowtop =305;
     }	 
 else if (args.place == "SouthernExposure")
     {
     left = 918;
     arrowtop = 641;
     }
  else if (args.place == "MysticArmyNavy")
     {
     left = 655;
     arrowtop =556;
     }	 
 else if (args.place == "DaysInnMystic")
     {
     left = 522;
     arrowtop = 205;
     }
  else if (args.place == "JonathanEdwards")
     {
     left = 900;
     arrowtop =157;
     }	 
 else if (args.place == "MysticPizzaII")
     {
     left = 837;
     arrowtop =252;
     }
  else if (args.place == "KatzMeowAntiques")
     {
     left = 1253;
     arrowtop =118;
     }	 
  else if (args.place == "MysticSeaport")
     {
     left = 433;
     arrowtop =674;
     }	 
 else if (args.place == "DelSol")
     {
     left = 823;
     arrowtop = 624;
     }
  else if (args.place == "ResidenceInnMystic")
     {
     left = 603;
     arrowtop = 310;
     }	 
 else if (args.place == "ComfortInn")
     {
     left = 608;
     arrowtop = 196;
     }
  else if (args.place == "AmericasBestValueInn")
     {
     left = 1185;
     arrowtop =195;
     }	 
 else if (args.place == "DaysInn")
     {
     left = 475;
     arrowtop = 200;
     }
  else if (args.place == "OldMysticInn")
     {
     left = 593;
     arrowtop =109;
     }	 
 else if (args.place == "EconoLodge")
     {
     left = 461;
     arrowtop = 411;
     }
   else if (args.place == "PequotHotel")
     {
     left = 269;
     arrowtop = 118;
     }	 
else if (args.place == "ThaiOneOn")
     {
     left = 578;
     arrowtop =221;
     }	 
 else if (args.place == "ChicSheShop")
     {
     left = 684;
     arrowtop = 478;
     }
  else if (args.place == "MoheganSun")
     {
     left = 542;
     arrowtop =113;
     }	 
 else if (args.place == "UniversalPackageStore")
     {
     left = 213;
     arrowtop = 608;
     }
  else if (args.place == "PitaSpot")
     {
     left = 767;
     arrowtop =125;
     }	 
 else if (args.place == "TangerMystic")
     {
     left =193;
     arrowtop = 489;
     }
  else if (args.place == "Latitude")
     {
     left = 610;
     arrowtop =538;
     }	 
 else if (args.place == "SeaView")
     {
     left = 504;
     arrowtop = 509;
     }
  else if (args.place == "Boathouse")
     {
     left = 674;
     arrowtop =389;
     }	 
 else if (args.place == "PennywiseDT")
     {
     left = 330;
     arrowtop = 187;
     }
  else if (args.place == "WindjammerWine")
     {
     left = 709;
     arrowtop =276;
     }	 
 else if (args.place == "MysticHarbour")
     {
     left = 770;
     arrowtop = 338;
     }
  else if (args.place == "SilverPapillon")
     {
     left = 462;
     arrowtop =145;
     }	 
 else if (args.place == "WideWorldofBagels")
     {
     left = 486;
     arrowtop = 87;
     }
  else if (args.place == "Abbotts")
     {
     left = 237;
     arrowtop = 663;
     }	 
 else if (args.place == "Costellos")
     {
     left = 233;
     arrowtop = 727;
     }
  else if (args.place == "AKDasher")
     {
     left = 1243;
     arrowtop =494;
     }	 
 else if (args.place == "Chuckys")
     {
     left = 596;
     arrowtop = 509;
     }
  else if (args.place == "CladIn")
     {
     left = 194;
     arrowtop =9;
     }	 
 else if (args.place == "FortRachelMarina")
     {
     left = 104;
     arrowtop = 355;
     }
  else if (args.place == "Bartlebys")
     {
     left = 43;
     arrowtop =50;
     }	 
 else if (args.place == "BankSquareBooks")
     {
     left = 111;
     arrowtop = 153;
     }
  else if (args.place == "BlackOrchid")
     {
     left = 1128;
     arrowtop =544;
     }	 
 else if (args.place == "Margaritas")
     {
     left = 0;
     arrowtop =216;
     }
  else if (args.place == "CladInStonington")
     {
     left = 1125;
     arrowtop =451;
     }	 
 else if (args.place == "VoodooGrill")
     {
     left = 14;
     arrowtop = 164;
     }
 else if (args.place == "TidalRiverClothing")
     {
     left = 123;
     arrowtop =12;
     }	 
  else if (args.place == "CaptainDanielPackerInne")
     {
     left = 104;
     arrowtop =283;
     }	 
 else if (args.place == "FloodTide")
     {
     left = 793;
     arrowtop = 94;
     }
  else if (args.place == "IndigoBleu")
     {
     left = 1246;
     arrowtop =533;
     }	 
  else if (args.place == "CeeCees")
     {
     left = 253;
     arrowtop =12;
     }	 
 else if (args.place == "HarbourInne")
     {
     left = 437;
     arrowtop = 238;
     }
  else if (args.place == "VelvetSwan")
     {
     left = 222;
     arrowtop =24;
     }
 else if (args.place == "YogaShala")
     {
     left = 1024;
     arrowtop =224;
     }	 	 
 else if (args.place == "MysticArtsCenter")
     {
     left = 159;
     arrowtop = 205;
     }
  else if (args.place == "MysticArmy")
     {
     left = 158;
     arrowtop =153;
     }
 else if (args.place == "MysticDepot")
     {
     left = 600;
     arrowtop =220;
     }	 	 
 else if (args.place == "ShaBam")
     {
     left = 573;
     arrowtop = 139;
     }
  else if (args.place == "Angies")
     {
     left = 660;
     arrowtop =62;
     }	 
 else if (args.place == "MysticMarketEast")
     {
     left = 838;
     arrowtop = 124;
     }
  else if (args.place == "MysticMarket")
     {
     left = 6;
     arrowtop =347;
     }	 
 else if (args.place == "Pizzetta")
     {
     left = 113;
     arrowtop = 183;
     }
  else if (args.place == "MysticPizza")
     {
     left =0;
     arrowtop =95;
     }	 
 else if (args.place == "Zias")
     {
     left =1248;
     arrowtop = 525;
     }
  else if (args.place == "Zhangs")
     {
     left = 56;
     arrowtop =240;
     }	 
 else if (args.place == "MySistersWardrobe")
     {
     left = 172;
     arrowtop = 184;
     }
  else if (args.place == "COMIX")
     {
     left = 812;
     arrowtop =60;
     }	 
 else if (args.place == "SaltwaterFarmVineyard")
     {
     left = 1186;
     arrowtop = 241;
     }
  else if (args.place == "SeaSwirl")
     {
     left = 676;
     arrowtop =227;
     }	 
 else if (args.place == "DSBoutique")
     {
     left = 942;
     arrowtop = 208;
     }
  else if (args.place == "Shells")
     {
     left = 315;
     arrowtop =93;
     }	 
 else if (args.place == "SteamboatInn")
     {
     left = 252;
     arrowtop = 130;
     }
 else if (args.place == "MermaidInn")
     {
     left = 510;
     arrowtop =891;
     }	 
  else if (args.place == "TaberInne")
     {
     left = 798;
     arrowtop =237;
     }	 
 else if (args.place == "POSH")
     {
     left = 327;
     arrowtop = 78;
     }
  else if (args.place == "WhalersInn")
     {
     left = 402;
     arrowtop =127;
     }	 
 else if (args.place == "Whyevernot")
     {
     left = 237;
     arrowtop = 152;
     }
  else if (args.place == "Zhangs")
     {
     left = 91;
     arrowtop =194;
     }
 else if (args.place == "BlackDog")
     {
     left =226;
     arrowtop =149;
     }	
   else if (args.place == "HungryPalette")
     {
     left =1275;
     arrowtop =585;
     }
 else if (args.place == "Noahs")
     {
     left = 1160;
     arrowtop =594;
     }	  
 else if (args.place == "SeasonalOutfitters")
     {
     left = 659;
     arrowtop =126;
     }
 else if (args.place == "SPOysterCo")
     {
     left = 321;
     arrowtop =26
     }	  
 else if (args.place == "CoveLedgeInn")
     {
     left = 1276;
     arrowtop =136;
     }	  
 else if (args.place == "Pennywise")
     {
     left = 641;
     arrowtop =706;
     }	  
 else if (args.place == "RiversideOutdoorGear")
     {
     left = 310;
     arrowtop =144;
     }	  
 else if (args.place == "InnatMystic")
     {
     left =747;
     arrowtop =50;
     }
 else if (args.place == "FloodTide")
     {
     left =767;
     arrowtop =85;
     }
 else if (args.place == "Margaritaville")
     {
     left =197;
     arrowtop =430;
     }	
   else if (args.place == "AncientMariner")
     {
     left =208;
     arrowtop =124;
     }
 else if (args.place == "CarolynYostJewelry")
     {
     left = 1092;
     arrowtop =494;
     }	  
 else if (args.place == "VoodooGrill")
     {
     left = 32;
     arrowtop =210;
     }
  else if (args.place == "HardRockCafe")
     {
     left = 786;
     arrowtop =13;
     }	  
 else if (args.place == "Avantis")
     {
     left = 795;
     arrowtop =118;
     }
     else if (args.place == "TidalRiverClothing")
     {
     left = 123;
     arrowtop =14;
     }
  else if (args.place == "RiverWalk")
     {
     left = 414;
     arrowtop =822;
     }	  
 else if (args.place == "AjsBistro")
     {
     left = 443;
     arrowtop =38;
     }	  
 else if (args.place == "SkippersDock")
     {
     left = 1128;
     arrowtop =650;
     }
else
     { 
     args.place = "undefined";   
	 }

 /********************************************************
* END:  Code to specify position of arrow for each place
*/

vertpos = arrowtop + menuheight;

scrollDown = vertpos - 170;
scrollRight = left - 300;

if (scrollDown < 0) scrollDown = 0;
if (scrollRight < 0) scrollRight = 0;

// Code to place arrow over map image 

if (args.place != "undefined")   
{
      document.write('<div style="position:absolute; top: ');
	  document.write(arrowtop);
	  document.write('px; left: ');
	  document.write(left);
	  document.write('px; height: 27px; width: 27px;">');
      document.write('<img src="../images/arrow.gif" name="arrow" id="arrow" width="27" height="27" />');
      document.write('</div>');
      //document.arrow.scrollIntoView(true);
	  window.scrollTo(scrollRight,scrollDown);
//	if (left > 100) window.scrollBy(100,0);
//	if (arrowtop > 100) window.scrollBy(0,100);
 }
