﻿// 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,8) == "Mozilla") browser = "Firefox"
//else if (navigator.appName.substring(0,9) == "Microsoft") browser = "IE"


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

  if (args.place == "TangerOutlets07")
     {
     left = 1248;
     arrowtop = 353;
     } 
  else if (args.place == "ClarkeCycles07")
     {
     left = 364;
     arrowtop = 487;
     }
  else if (args.place == "PsychicReadingbyGianna")
     {
     left = 99;
     arrowtop = 327;
     }
  else if (args.place == "Herbery07")
     {
     left = 239;
     arrowtop =685;
     }	 
 else if (args.place == "CTRiverMuseum")
     {
     left = 669;
     arrowtop = 790;
     }
  else if (args.place == "PartnersAntiques")
     {
     left = 843;
     arrowtop =401;
     }	 
 else if (args.place == "LordNelsonAntiques")
     {
     left = 770;
     arrowtop =445;
     }
  else if (args.place == "Gabrielles07")
     {
     left = 68;
     arrowtop =252;
     }	 
 else if (args.place == "Scensibles")
     {
     left = 643;
     arrowtop = 433;
     }
  else if (args.place == "SpaofEssex07")
     {
     left =487;
     arrowtop =371;
     }	 
 else if (args.place == "ComfortInn07")
     {
     left =654;
     arrowtop = 1010;
     }
  else if (args.place == "EconoLodge")
     {
     left = 37;
     arrowtop =240;
     }	 
 else if (args.place == "WatersEdge")
     {
     left = 1162;
     arrowtop =471;
     }
  else if (args.place == "CaptainStannard07")
     {
     left = 956;
     arrowtop =434;
     }	 
  else if (args.place == "GriswoldInnStore")
     {
     left = 720;
     arrowtop =712;
     }	 
	else if (args.place == "SomSiamMiniGolf")
     {
     left = 237;
     arrowtop = 1275;
     }
 else if (args.place == "Sophias")
     {
     left = 632;
     arrowtop = 430;
     }
  else if (args.place == "HarbourSeal")
     {
     left = 623;
     arrowtop =429;
     }	 
 else if (args.place == "SocietysScissors")
     {
     left = 722;
     arrowtop = 753;
     }
  else if (args.place == "ScrapbookClubhouse07")
     {
     left = 1175;
     arrowtop =367;
     }	 
 else if (args.place == "redballoon")
     {
     left = 742;
     arrowtop = 779;
     }
  else if (args.place == "EssexEssentials")
     {
     left = 772;
     arrowtop =421;
     }	 
 else if (args.place == "EssexIslandMarina07")
     {
     left = 851;
     arrowtop = 729;
     }
  else if (args.place == "ChristmasBarn07")
     {
     left = 718;
     arrowtop =732;
     }	 
 else if (args.place == "PocketfulofPosies")
     {
     left = 783;
     arrowtop = 344;
     }
  else if (args.place == "GriswoldInn07")
     {
     left = 568;
     arrowtop =685;
     }	 
 else if (args.place == "PapercraftClubhouse")
     {
     left = 1186;
     arrowtop = 367;
     }
  else if (args.place == "ToysAhoy07")
     {
     left = 637;
     arrowtop =635;
     }	 
 else if (args.place == "LeftBankGallery")
     {
     left = 608;
     arrowtop = 438;
     }
  else if (args.place == "TissasLeSoukduMaroc")
     {
     left = 474;
     arrowtop = 321;
     }	 
 else if (args.place == "BoatiqueUSA")
     {
     left = 526;
     arrowtop = 780;
     }
  else if (args.place == "Super8")
     {
     left = 67;
     arrowtop =79;
     }	 
 else if (args.place == "PorkyPetes")
     {
     left = 206;
     arrowtop = 617;
     }
  else if (args.place == "BlackSeal07")
     {
     left = 790;
     arrowtop =486;
     }	 
 else if (args.place == "FreshSalt")
     {
     left = 743;
     arrowtop =462;
     }
  else if (args.place == "Silkworm")
     {
     left = 772;
     arrowtop =545;
     }	 
 else if (args.place == "JacksBaitTackle07")
     {
     left = 621;
     arrowtop = 326;
     }
  else if (args.place == "BellFlowerAntiques")
     {
     left = 577;
     arrowtop =657;
     }	 
 else if (args.place == "Ruffinos")
     {
     left = 295;
     arrowtop = 130;
     }
  else if (args.place == "Maggies07")
     {
     left = 33;
     arrowtop =76;
     }	 
 else if (args.place == "HeyDay")
     {
     left = 525;
     arrowtop = 449;
     }
  else if (args.place == "BrewerDauntlessMarina")
     {
     left = 585;
     arrowtop =902;
     }	 
 else if (args.place == "Isobels07")
     {
     left = 10;
     arrowtop = 34;
     }
  else if (args.place == "DeaconTimothyPratt07")
     {
     left = 463;
     arrowtop = 358;
     } 
  else if (args.place == "SaybrookPointInn07")
     {
     left = 711;
     arrowtop = 390;
     }
  else if (args.place == "BrewerFerryPointMarina")
     {
     left = 767;
     arrowtop = 980;
     }
  else if (args.place == "PastaVita")
     {
     left = 475;
     arrowtop = 52;
     }
  else if (args.place == "ActionSports")
     {
     left = 189;
     arrowtop =140;
     }	 
 else if (args.place == "Kumari")
     {
     left = 249;
     arrowtop = 103;
     }
  else if (args.place == "TerraMar")
     {
     left = 755;
     arrowtop =459;
     }	 
 else if (args.place == "KnightsInn")
     {
     left = 951;
     arrowtop =39;
     }
  else if (args.place == "Tiberios")
     {
     left = 202;
     arrowtop =147;
     }	 
 else if (args.place == "EssexSteamTrain07")
     {
     left = 166;
     arrowtop = 503;
     }
  else if (args.place == "EssexClipper07")
     {
     left =175;
     arrowtop =542;
     }	 
 else if (args.place == "HeritageMotorInn07")
     {
     left =179;
     arrowtop = 250;
     }
  else if (args.place == "LifeofRiley07")
     {
     left = 381;
     arrowtop =129;
     }	 
 else if (args.place == "TovasVintageShop07")
     {
     left = 248;
     arrowtop =241;
     }
  else if (args.place == "Lucky33")
     {
     left = 212;
     arrowtop =108;
     }	 
 else if (args.place == "OldSaybrookChamber")
     {
     left = 935;
     arrowtop = 113;
     }
 else if (args.place == "SilverLining07")
     {
     left = 1053;
     arrowtop = 311;
     }
  else if (args.place == "FrenchHen")
     {
     left = 608;
     arrowtop =485;
     }	 
 else if (args.place == "Bellwether")
     {
     left = 451;
     arrowtop = 124;
     }
  else if (args.place == "WholeEnchilada07")
     {
     left = 979;
     arrowtop =355;
     }	 
 else if (args.place == "SaigonCity07")
     {
     left = 286;
     arrowtop = 98;
     }
  else if (args.place == "Super807")
     {
     left = 82;
     arrowtop =81;
     }	 
 else if (args.place == "EssexGolfShoppe07")
     {
     left = 1081;
     arrowtop = 269;
     }
  else if (args.place == "ClintonAntiqueCenter07")
     {
     left = 290;
     arrowtop =397;
     }	 
 else if (args.place == "Bennys07")
     {
     left = 106;
     arrowtop = 209;
     }
  else if (args.place == "NorthCountryOutlet07")
     {
     left = 1290;
     arrowtop =377;
     }	 
 else if (args.place == "Savory07")
     {
     left = 1081;
     arrowtop = 438;
     }
  else if (args.place == "HarborBooks07")
     {
     left = 1090;
     arrowtop =324;
     }	 
 else if (args.place == "AngiesJewelry")
     {
     left = 975;
     arrowtop = 454;
     }
  else if (args.place == "Azul")
     {
     left = 1351;
     arrowtop =465;
     }	 
 else if (args.place == "PinkSleigh07")
     {
     left = 1231;
     arrowtop = 257;
     }
  else if (args.place == "GolfETC07")
     {
     left = 325;
     arrowtop =150;
     }	 
 else if (args.place == "Bump")
     {
     left = 1083;
     arrowtop = 447;
     }
  else if (args.place == "CentralGallery07")
     {
     left = 1081;
     arrowtop =459;
     }	 
 else if (args.place == "Tuskan")
     {
     left = 16;
     arrowtop =75;
     }	 
 else if (args.place == "LennyJoes207")
     {
     left = 558;
     arrowtop =343;
     }
  else if (args.place == "Fuzziwigs07")
     {
     left = 180;
     arrowtop =193;
     }	 
  else if (args.place == "ClamCastle07")
     {
     left = 44;
     arrowtop =412;
     }	 
 else if (args.place == "Peonies")
     {
     left = 80;
     arrowtop = 237;
     }
  else if (args.place == "CedarChest07")
     {
     left = 120;
     arrowtop =387;
     }	 
 else if (args.place == "BeautifulImpressions")
     {
     left = 1185;
     arrowtop = 342;
     }
  else if (args.place == "SomSiam")
     {
     left = 218;
     arrowtop =1179;
     }	 
 else if (args.place == "Weltners")
     {
     left = 718;
     arrowtop = 634;
     }
  else if (args.place == "LennyJoes07")
     {
     left = 69;
     arrowtop =313;
     }	 
  else if (args.place == "Peacock")
     {
     left = 220;
     arrowtop = 1163;
     }
 else if (args.place == "Peacock")
     {
     left = 220;
     arrowtop = 1163;
     }
else if (args.place == "StorkExchange")
     {
     left = 1248;
     arrowtop = 357;
     } 
else if (args.place == "NotJustACrock")
     {
     left = 1249;
     arrowtop = 344;
     } 
else if (args.place == "KeelingsLightingOutlet")
     {
     left = 1308;
     arrowtop = 369;
     } 
else if (args.place == "BernieFields07")
     {
     left = 1318;
     arrowtop = 482;
     } 
else if (args.place == "IvorytonPlayhouse07")
     {
     left = 202;
     arrowtop = 34;
     } 
else if (args.place == "JennsJetty")
     {
     left = 861;
     arrowtop = 358;
     } 
else if (args.place == "Venetucci")
     {
     left = 689;
     arrowtop = 426;
     } 
else if (args.place == "ChristoJewlers07")
     {
     left = 458;
     arrowtop = 313;
     } 
else if (args.place == "3LibertyGreen07")
     {
     left = 389;
     arrowtop = 292;
     } 
else if (args.place == "IndianRiverMarina")
     {
     left = 232;
     arrowtop = 432;
     } 
else if (args.place == "NuzzosApizza")
     {
     left = 43;
     arrowtop = 424;
     } 
else if (args.place == "PakIt")
     {
     left = 308;
     arrowtop = 151;
     } 
else if (args.place == "FashionImports")
     {
     left = 1073;
     arrowtop = 452;
     }
     else if (args.place == "Araucana07")
     {
     left = 1075;
     arrowtop = 427;
     }
else if (args.place == "FitnessAlcove")
     {
     left = 1072;
     arrowtop = 419;
     }
     else if (args.place == "SeaSide07")
     {
     left = 1082;
     arrowtop = 229;
     }   
     else if (args.place == "OtherPlace07")
     {
     left = 88;
     arrowtop = 209;
     }     
     else if (args.place == "PizzaWorks07")
     {
     left = 953;
     arrowtop = 31;
     }     
     else if (args.place == "Mazuki")
     {
     left = 404;
     arrowtop = 423;
     }     
     else if (args.place == "ShorelineQuickLube07")
     {
     left = 128;
     arrowtop = 132;
     }     
     else if (args.place == "ShawsClinton")
     {
     left = 435;
     arrowtop = 477;
     }
     else if (args.place == "ChamardVineyards")
     {
     left = 138;
     arrowtop = 23;
     }     
     else if (args.place == "MorganStanley")
     {
     left = 276;
     arrowtop = 614;
     } 
	 else if (args.place == "SandpiperInn07")
     {
     left = 57;
     arrowtop = 240;
     }    
	 else if (args.place == "waydownthere")
	 {
		 left = 1800;
		 arrowtop = 1800;
	 }
else
     { 
     args.place = "undefined";   
	 }
  
 /********************************************************
* END:  Code to specify position of arrow for each place
*/
//alert(args.place);

vertpos = arrowtop + menuheight;
horizpos = left + horizwidth;
         
scrollDown = vertpos - 170;
scrollRight = left - 300;

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


//<div style="position:absolute; left: 1231px; arrowtop: 251px; height: 27px; width: 27px;">
//<img src="../images/arrow.gif" name="arrow"  width="27" height="27" />

// Code to place arrow over map image 

if (args.place != "undefined")   
{
	  //alert("in docwrite");
      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);
 }
