<!--
/*
  myImages=[
    ["the-kimberly-hotel-ny-ny.gif","http://www.elegantsmallhotel.com/hotels/esh1220.html","The Kimberly Hotel - New York, NY","&nbsp;<b>The Kimberly Hotel</b><br>&nbsp;New York, NY"],
    ["barley-sheaf-barn-holicong-.gif","http://www.elegantsmallhotel.com/hotels/esh1821.html","Barley Sheaf Barn - Holicong, Pennsylvania","&nbsp;<b>Barley Sheaf Barn</b><br>&nbsp;Holicong, Pennsylvania"],
    ["grand-hotel-minerve-rome-it.gif","http://www.elegantsmallhotel.com/hotels/eww333.html","Grand Hotel Minerve - Rome, Italy","&nbsp;<b>Grand Hotel Minerve</b><br>&nbsp;Rome, Italy"],
    ["marshall-house-savanah-geor.gif","http://www.elegantsmallhotel.com/hotels/esh2022.html","Marshall House - Savanah, Georgia","&nbsp;<b>Marshall House</b><br>&nbsp;Savanah, Georgia"],
    ["monte-do-casal-estoi-portug.gif","http://www.elegantsmallhotel.com/hotels/eww1337.html","Monte do Casal - Estoi, Portugal","&nbsp;<b>Monte do Casal</b><br>&nbsp;Estoi, Portugal"],
    ["is-morus-hotel-sardinia-ita.gif","http://www.elegantsmallhotel.com/hotels/eww4632.html","Is Morus Hotel - Sardinia, Italy","&nbsp;<b>Is Morus Hotel</b><br>&nbsp;Sardinia, Italy"],
    ["8034eww.jpg","http://www.elegantsmallhotel.com/hotels/eww8034.html","El Tamarindo - Cihuatlan, Mexico","&nbsp;<b>El Tamarindo</b><br>&nbsp;Cihuatlan, Mexico"]
  ]

*/

  myImages=[
    ["images/carousel/esh1220.jpg","http://www.elegantsmallhotel.com/hotels/esh1220.html","The Kimberly Hotel - New York, NY","&nbsp;<b>The Kimberly Hotel</b><br>&nbsp;New York, NY"],
    ["images/carousel/eww12737.jpg","http://www.elegantsmallhotel.com/hotels/eww12737.html","Cabo Surf Hotel, San Jose del Cabo,   Mexico","&nbsp;<b>Cabo Surf Hotel</b><br>&nbsp;San Jose del Cabo,  Mexico"],
   // ["images/carousel/esh45.jpg","http://www.elegantsmallhotel.com/hotels/esh45.html","Castle Marne, Denver, Colorado","&nbsp;<b>Castle Marne</b><br>&nbsp;Denver, Colorado"],
    ["images/carousel/esh2038.jpg","http://www.elegantsmallhotel.com/hotels/esh2038.html","Chimney Hill Estate & Ol' Barn Inn, Lambertville, NJ","&nbsp;<b>Chimney Hill Estate & Ol' Barn Inn</b><br>&nbsp;Lambertville, NJ"],	
	["images/carousel/eww2479.jpg","http://www.elegantsmallhotel.com/hotels/eww2479.html","Hotel Britannique,Paris, France","&nbsp;<b>Hotel Britannique</b><br>&nbsp;Paris, France"],
    //["images/carousel/eww8458.jpg","http://www.elegantsmallhotel.com/hotels/eww8458.html","Maryland, Ikeja, Lagos","&nbsp;<b>Planet One</b><br>&nbsp;Ikeja, Lagos, Nigeria"],
    ["images/carousel/eww224.jpg","http://www.elegantsmallhotel.com/hotels/eww224.html","Avilia Hotel - Curacao, Willemstad, Curacao","&nbsp;<b>Avilia Hotel - Curacao</b><br>&nbsp;Willemstad, Curacao"],
    ["images/carousel/esh8587.jpg","http://www.elegantsmallhotel.com/hotels/esh8587.html","Dolphin Bay Resort &amp; Spa, Shell Beach, CA","&nbsp;<b>Dolphin Bay Resort &amp; Spa</b><br>&nbsp;Shell Beach, CA"],
	// ["images/carousel/eww8468.jpg","http://www.elegantsmallhotel.com/hotels/eww8468.html","Hotel La Mansion Inn, Quepos, Costa Rica","&nbsp;<b>Hotel La Mansion Inn</b><br>&nbsp;Quepos, Costa Rica"],
	 ["images/carousel/esh579.jpg","http://www.elegantsmallhotel.com/hotels/esh579.html","Seven Gables Inn, Pacific Grove, California","&nbsp;<b>Seven Gables Inn</b><br>&nbsp;Pacific Grove, California"],
	 ["images/carousel/eww2666.jpg","http://www.elegantsmallhotel.com/hotels/eww2666.html","Tongsai Bay Cottages & Hotel, Suratthani - Thailand","&nbsp;<b>Tongsai Bay Cottages & Hotel</b><br>&nbsp;Suratthani - Thailand"],
	["images/carousel/esh2444.jpg","http://www.elegantsmallhotel.com/hotels/esh2444.html","The Inn at Fox Hollow, Woodbury, New York ","&nbsp;<b>The Inn at Fox Hollow</b><br>&nbsp;Woodbury, New York "],
	["images/carousel/esh1835.jpg","http://www.elegantsmallhotel.com/hotels/esh1835.html","Two Meeting Street Inn, Charleston, South Carolina","&nbsp;<b>Two Meeting Street Inn - </b>&nbsp;Charleston, South Carolina"],
	["images/carousel/esh1886.jpg","http://www.elegantsmallhotel.com/hotels/esh1886.html","Morris House Hotel - Philadelphia, Pennsylvania","&nbsp;<b>Morris House Hotel</b><br>&nbsp;Philadelphia, Pennsylvania"],
	["images/carousel/esh70.jpg","http://www.elegantsmallhotel.com/hotels/esh70.html","The Inn At Rancho Santa Fe - Rancho Santa Fe, California","&nbsp;<b>The Inn At Rancho Santa Fe</b><br>&nbsp;Rancho Santa Fe, California"]
  ]


  dir=0 // 0 = left 1 = right
  speed=1 // pixels per scroll - larger is slower and jumpier
  scrollTime=30	// ms timer - larger = slower
  imageSize=0  // % set to zero to use fixedWidth and fixedHeight values
  fixedWidth=200 // set a fixed width
  fixedHeight=150 // set a fixed height
  spacerWidth=3 // space between images
  spacerColor='#eac117';

  biggest=0
  ieBorder=0
  totalWidth=0
  hs5Timer=null

  lastN=0
  count=0

  preload=new Array()
  for(var i=0;i<myImages.length;i++){
    preload[i]=[]
    for(var j=0;j<2;j++){
      preload[i][j]=new Image()
      preload[i][j].src=myImages[i][j]
    }
  }

  function initHS5(){
    scroll1=document.getElementById("scroller1")
    for(var k=0;k<myImages.length;k++){

      scroll1.innerHTML+='<img id="pic'+k+'" src="'+preload[k][0].src+'" alt="'+myImages[k][2]+'" title="'+myImages[k][2]+'" onclick="showTarget('+k+')" style="border-left:'+spacerWidth+'px solid '+spacerColor+'" onmouseover="testOver(this,this.offsetParent.id,'+k+')" onmouseout="testOut(event)">'

      if(imageSize!=0){ // use percentage size
        newWidth=preload[k][0].width/100*imageSize
        newHeight=preload[k][0].height/100*imageSize
      }
      else{ // use fixed size
        newWidth=fixedWidth
        newHeight=fixedHeight
      }

      document.getElementById("pic"+k).style.width=newWidth+"px"
      document.getElementById("pic"+k).style.height=newHeight+"px"

      if(document.getElementById("pic"+k).offsetHeight>biggest){
        biggest=document.getElementById("pic"+k).offsetHeight
      }

 //     totalWidth+=document.getElementById("pic"+k).offsetWidth+spacerWidth;
      totalWidth+=document.getElementById("pic"+k).offsetWidth;
    }

    totalWidth+=1

    for(var l=0;l<myImages.length;l++){ // vertically center images
      document.getElementById("pic"+l).style.marginBottom = (biggest-document.getElementById("pic"+l).offsetHeight)/2+"px"
    }

    if(document.getElementById&&document.all){
      ieBorder=parseInt(document.getElementById("scrollbox").style.borderTopWidth)*2
    }

    document.getElementById("scrollbox").style.height=biggest+ieBorder+"px"
    scroll1.style.width=totalWidth+"px"
    scroll2=document.getElementById("scroller2")
    scroll2.innerHTML=scroll1.innerHTML
    scroll2.style.left= (-scroll1.offsetWidth)+"px"
    scroll2.style.top= -scroll1.offsetHeight+"px"
    scroll2.style.width=totalWidth+"px"

    if(dir==1){
      speed= -speed
    }

    scrollHS5()
  }

  function scrollHS5(){
    clearTimeout(hs5Timer)
    scroll1Pos=parseInt(scroll1.style.left)
    scroll2Pos=parseInt(scroll2.style.left)
    scroll1Pos-=speed
    scroll2Pos-=speed
    scroll1.style.left=scroll1Pos+"px"
    scroll2.style.left=scroll2Pos+"px"
    hs5Timer=setTimeout("scrollHS5()",scrollTime)

    if(dir==0){
      if(scroll1Pos< -scroll1.offsetWidth){
        scroll1.style.left=scroll1.offsetWidth+"px"
      }

      if(scroll2Pos< -scroll1.offsetWidth){
        scroll2.style.left=scroll1.offsetWidth+"px"
      }
    }

    if(dir==1){
      if(scroll1Pos>parseInt(document.getElementById("scrollbox").style.width)){
        scroll1.style.left=scroll2Pos+ (-scroll1.offsetWidth)+"px"
      }

      if(scroll2Pos>parseInt(document.getElementById("scrollbox").style.width)){
        scroll2.style.left=scroll1Pos+ (-scroll2.offsetWidth)+"px"
      }
    }

  }

  st=null
  function pause(){
    clearTimeout(hs5Timer)
    clearTimeout(st)
  }

  function reStartHS5(){
    clearTimeout(st)
    st=setTimeout("scrollHS5()",100)
  }

  function showTarget(p)
  {
    if(myImages[p][1]!=""){
      paused=1
      document.location=myImages[p][1] 
    }
  }

  function testOver(obj,par,n){
    if(myImages[n][3]==""){return}
    document.getElementById("qw").innerHTML=myImages[n][3] 

    document.getElementById("qw").style.display="block"
    document.getElementById("qw").style.width=obj.offsetWidth+'px';
    document.getElementById("qw").style.height="40px"; //obj.offsetHeight+'px';

    bord=0
    if(fx){
    bord=parseInt(document.getElementById("scrollbox").style.borderLeftWidth)
    }

    document.getElementById("qw").style.left=obj.offsetLeft+document.getElementById(par).offsetLeft+bord+'px';
    document.getElementById("qw").style.top=(obj.offsetTop+document.getElementById(par).offsetTop)+obj.offsetHeight-document.getElementById("qw").offsetHeight+bord+'px';
  }

  fx=document.getElementById&&!document.all

  function testOut(e){
  if(e.toElement&&event.toElement.id!="qw"){
  document.getElementById("qw").style.display="none"
  }

  if(e.relatedTarget&&e.relatedTarget.id!="qw"){
  document.getElementById("qw").style.display="none"
  }
  }

-->
