function getPainting( gallery, id )
{
  var obj = document.getElementById("Painting");

  obj.src = "/images/gallery/" + gallery + "/" + id + ".jpg";

  Spry.Utils.updateContent(
    "GalleryStoryBoard",
    "/inc/getstory.cfm?gallery=" + gallery + "&id=" + id,
    ( function() { Spry.Utils.updateContent( "AvailableOriginal", "/inc/getstory.cfm?gallery=" + gallery + "&id=" + id + "&availability=test" ); } ) );
}


function inquire( id ) {
  self.location.href = "/available_originals.cfm?id=" + id + "#Inquiry";
}


function toggle()
{
  var obj = null;
  
  for ( var i=1; i<=5; i++ ) {
    obj = document.getElementById("ShowStoryOpt"+i);

    if ( obj ) {
      if ( obj.innerHTML.search(/Show/i) >= 0 )
        positionStoryBoard();

      storyFade.start();
      obj.innerHTML = ( obj.innerHTML.search(/Show/i) < 0 )? "Show Story" : "Hide Story";
    }
  }
}


function positionStoryBoard()
{
  var obj = document.getElementById("Painting");
  
  var xP = getPageX( obj );
  var yP = getPageY( obj );
  var wP = parseInt( getWidth( obj ) );
  
  obj = document.getElementById("GalleryStoryBoard");
  var hG = parseInt( getHeight( obj ) );

  obj.style.left = xP + (wP / 2) + 50;
  obj.style.top = yP + 100;
}


function gotoGallery( panel )
{
  tb.showPanel( panel );
}

//setInterval( "positionStoryBoard()", 500 );
