// Global Javascript
<!--
function closeWindow() {
  self.close();
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function openPassWindow(url, name, w, h, perc) {
  var winX = 0;
  var winY = 0;

  if (parseInt(navigator.appVersion) >= 4) {
    winX = (screen.availWidth - w)*.5;
    winY = (screen.availHeight - h)*.5;
  }
  popupWin = window.open(url, name,'width=' + w + ',height=' + h + ',left=' + winX + ',top=' + winY);
}

/////////////////////////////////////////////////////////////
// RANDOM QUOTES
////////////////////////////////////////////////////////////

// Set up the image files to be used.
var theImages = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array.

theImages[0] = '../quotes/1.gif'
theImages[1] = '../quotes/2.gif'
theImages[2] = '../quotes/3.gif'
theImages[3] = '../quotes/4.gif'
theImages[4] = '../quotes/5.gif'
theImages[5] = '../quotes/6.gif'
theImages[6] = '../quotes/7.gif'
theImages[7] = '../quotes/8.gif'
theImages[8] = '../quotes/9.gif'
theImages[9] = '../quotes/10.gif'
theImages[10] = '../quotes/11.gif'

// do not edit anything below this line

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}

/////////////////////////////////////////////////////////////
// RANDOM DINNER PHOTOS
////////////////////////////////////////////////////////////

// Set up the image files to be used.
var thePlate = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array.

thePlate[0] = '../photos/crabcakes.jpg'
thePlate[1] = '../photos/french_onion.jpg'
thePlate[2] = '../photos/mixed_seafood.jpg'
thePlate[3] = '../photos/caponata_salad.jpg'
thePlate[4] = '../photos/spinnach_cake.jpg'
thePlate[5] = '../photos/beef_filet.jpg'
thePlate[6] = '../photos/shelburne_farms.jpg'

// do not edit anything below this line

var j = 0
var p = thePlate.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = thePlate[i]
}
var whichPlate = Math.round(Math.random()*(p-1));
function showPlate(){
document.write('<img src="'+thePlate[whichPlate]+'">');
}

/////////////////////////////////////////////////////////////
// GOOGLE API MAP
////////////////////////////////////////////////////////////

//<![CDATA[

function load() {
  if (GBrowserIsCompatible()) {
  function TextualZoomControl() {
	}
	TextualZoomControl.prototype = new GControl();
	
	// Creates a one DIV for each of the buttons and places them in a container
	// DIV which is returned as our control element. We add the control to
	// to the map container and return the element for the map class to
	// position properly.
	TextualZoomControl.prototype.initialize = function(map) {
	  var container = document.createElement("div");
	
	  var zoomInDiv = document.createElement("div");
	  this.setButtonStyle_(zoomInDiv);
	  container.appendChild(zoomInDiv);
	  zoomInDiv.appendChild(document.createTextNode("Zoom In"));
	  GEvent.addDomListener(zoomInDiv, "click", function() {
		map.zoomIn();
	  });
	
	  var zoomOutDiv = document.createElement("div");
	  this.setButtonStyle_(zoomOutDiv);
	  container.appendChild(zoomOutDiv);
	  zoomOutDiv.appendChild(document.createTextNode("Zoom Out"));
	  GEvent.addDomListener(zoomOutDiv, "click", function() {
		map.zoomOut();
	  });
	
	  map.getContainer().appendChild(container);
	  return container;
	}
	
	// By default, the control will appear in the top left corner of the
	// map with 7 pixels of padding.
	TextualZoomControl.prototype.getDefaultPosition = function() {
	  return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7, 7));
	}
	
	// Sets the proper CSS for the given button element.
	TextualZoomControl.prototype.setButtonStyle_ = function(button) {
	  button.style.textDecoration = "none";
	  button.style.color = "#D2183F";
	  button.style.backgroundColor = "white";
	  button.style.font = "10px Verdana";
	  button.style.border = "1px solid #D2183F";
	  button.style.padding = "2px";
	  button.style.marginBottom = "3px";
	  button.style.textAlign = "center";
	  button.style.width = "6em";
	  button.style.cursor = "pointer";
	}
  var map = new GMap2(document.getElementById("map"));
	//map.addControl(new GSmallMapControl());
	//map.addControl(new GMapTypeControl());
	map.addControl(new TextualZoomControl());
	map.setCenter(new GLatLng(44.42180, -73.21199), 13);
	//map.openInfoWindow(map.getCenter(),
	   // document.createTextNode("Come join us."));
	var point = new GLatLng(44.42180, -73.21199);
	map.addOverlay(new GMarker(point));
  }
}

//]]>

//-->