<!--
/*
  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/eww8391.jpg","http://www.elegantsmallhotel.com/hotels/eww8391.html","Hotel Universo, Lucca, Italy","&nbsp;<b>Hotel Universo</b><br>&nbsp; Lucca, Italy"],
    ["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/esh1750.jpg","http://www.elegantsmallhotel.com/hotels/esh1750.html","Buhl Mansion Guesthouse &amp; Spa, Sharon, PA","&nbsp;<b>Buhl Mansion Guesthouse &amp; Spa</b><br>&nbsp;Sharon, PA"],	
	["images/carousel/esh1830.jpg","http://www.elegantsmallhotel.com/hotels/esh1830.html","Tara - A Country Inn,Clark, Pennsylvania","&nbsp;<b>Tara - A Country Inn</b><br>&nbsp;Clark, Pennsylvania"],
 //   ["images/carousel/eww8389.jpg","http://www.elegantsmallhotel.com/hotels/eww8389.html","Las Alamandas, Jalisco, Mexico","&nbsp;<b>Las Alamandas</b><br>&nbsp;Jalisco, Mexico"],
    ["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/eww4541.jpg","http://www.elegantsmallhotel.com/hotels/eww4541.html","Hotel D'Este, Rome, Italy","&nbsp;<b>Hotel D'Este</b><br>&nbsp;Rome, Italy"],
	// ["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/esh859.jpg","http://www.elegantsmallhotel.com/hotels/esh859.html","York Harbor Inn,York Harbor,, Maine","&nbsp;<b>York Harbor Inn</b><br>&nbsp;York Harbor, Maine"],
	 ["images/carousel/eww8459.jpg","http://www.elegantsmallhotel.com/hotels/eww8459.html","Loharano Hotel, Nosy Be, Madagascar","&nbsp;<b>Loharano Hotel</b><br>&nbsp;Nosy Be, Madagascar"],
	["images/carousel/esh628.jpg","http://www.elegantsmallhotel.com/hotels/esh628.html","The Harraseeket Inn, Freeport, Maine","&nbsp;<b>The Harraseeket Inn</b><br>&nbsp;Freeport, Maine"],
	["images/carousel/esh565.jpg","http://www.elegantsmallhotel.com/hotels/esh565.html","Madrona Manor Wine Country Inn &amp; Restaurant, Healdsburgh, California","&nbsp;<b>Madrona Manor Wine Country Inn &amp; Restaurant, Healdsburgh, California</b><br>&nbsp;Portland, Oregon"],
	["images/carousel/esh1886.jpg","http://www.elegantsmallhotel.com/hotels/esh1886.html","Morris House Hotel - Philadelphia, Pennsylvania","&nbsp;<b>Morris House Hotel - Philadelphia</b><br>&nbsp;Philadelphia, Pennsylvania"]
  ]


  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"
  }
  }

-->