<!--
 function on(img_name,img_src) {
 document[img_name].src=img_src;
 }

 function off(img_name,img_src) {
 document[img_name].src=img_src;
 }

function openwin(image) {
  targeturl = "slideshow.html?" + image;
  qtwin = window.open(targeturl,"slideshow",'toolbar=0,location=0, directories=0,status=0,menubar=0,scrollbars=0,resizable=0, width=730,height=600');

  // if (remote.opener == null) remote.opener = window; 
  // remote.opener.name = "opener";

  qtwin.focus();
}

function mainimage(img) {
  var query;
  if (!img) {
     query = window.location.search.substring(1);
  } else {
     query = img;
  }
  return 'images/' + query + '.jpg';
}

function linkThumbnailGallery() {
  if (window.innerWidth || window.innerHeight) { 
     docwidth = window.innerWidth; 
     docheight = window.innerHeight; 
  } 
  if (document.body.clientWidth || document.body.clientHeight){ 
     docwidth = document.body.clientWidth; 
     docheight = document.body.clientHeight; 
  } 

  if (docwidth > 780) {
        var currenturl = document.URL;
        currenturl = currenturl.replace("slideshow.html","index.html");
        document.location.href = currenturl; 
  } else {
        window.close();
  }
}

function loadImages() {
  var passthrough;
  if (window.location.search.substring(1) == 0) {
    document.getElementById('currentslide').innerHTML=1;
    passthrough=1;
    togglePlay();
  } else {
    document.getElementById('currentslide').innerHTML=window.location.search.substring(1);
  }

  document['fullimage'].src=mainimage(passthrough);
}

function loadImagesFancy() {
  var passthrough;
  if (window.location.search.substring(1) == 0) {
    document.getElementById('currentslide').innerHTML=1;
    passthrough=1;
    togglePlayFancy();
  } else {
    document.getElementById('currentslide').innerHTML=window.location.search.substring(1);
  }

  document['fullimage'].src=mainimage(passthrough);
  document['prevthumb'].src=prevthumbimage();
  document['nextthumb'].src=nextthumbimage();
}

function prevthumbimage() {
  var index = document.getElementById('currentslide').innerHTML;
  index--;

  if (document.getElementById('currentslide').innerHTML == 1) 
  { index = document.getElementById('lastslide').innerHTML; }

  return 'thumbnails/' + index + '.jpg';
}

function nextthumbimage() {
  var index = document.getElementById('currentslide').innerHTML;
  index++;

  if (index > document.getElementById('lastslide').innerHTML) 
  { index = 1; }

  return 'thumbnails/' + index + '.jpg';
}

function slideindex() {
  var query = window.location.search.substring(1);
  return query;
}

function nextslidefancy() {
  var index = document.getElementById('currentslide').innerHTML;
  index++;
  if (index > document.getElementById('lastslide').innerHTML) 
  { index = 1; }

  document.getElementById('currentslide').innerHTML=index;
  document['fullimage'].src="images/"+index+".jpg";
  document['prevthumb'].src=prevthumbimage();
  document['nextthumb'].src=nextthumbimage();
  frames['trackframe'].location.reload(1);
}

function prevslidefancy() {
  var index = document.getElementById('currentslide').innerHTML;
  index--;

  if (document.getElementById('currentslide').innerHTML == 1) 
  { index = document.getElementById('lastslide').innerHTML; }

  document.getElementById('currentslide').innerHTML=index;
  document['fullimage'].src="images/"+index+".jpg";
  document['prevthumb'].src=prevthumbimage();
  document['nextthumb'].src=nextthumbimage();
  frames['trackframe'].location.reload(1);
}

function nextslide() {
  var index = document.getElementById('currentslide').innerHTML;
  index++;
  if (index > document.getElementById('lastslide').innerHTML) 
  { index = 1; }

  document.getElementById('currentslide').innerHTML=index;
  document['fullimage'].src="images/"+index+".jpg";
  frames['trackframe'].location.reload(1);
  loadCaption();
}

function prevslide() {
  var index = document.getElementById('currentslide').innerHTML;
  index--;

  if (document.getElementById('currentslide').innerHTML == 1) 
  { index = document.getElementById('lastslide').innerHTML; }

  document.getElementById('currentslide').innerHTML=index;
  document['fullimage'].src="images/"+index+".jpg";
  frames['trackframe'].location.reload(1);
  loadCaption();
}

function playslideshow() {
  timerid = setInterval("nextslide()",4000);

  document.slider.flag.value = timerid;

  return timerid;
}

function playslideshowfancy() {
  timerid = setInterval("nextslidefancy()",4000);

  document.slider.flag.value = timerid;

  return timerid;
}

function stopslideshow(timerid) {
  clearTimeout(timerid);
  document.slider.flag.value = 0;
}

function togglePlay() {
  var button = document['playstop'].src;
  if (button.match('play_34.gif')) { 
      document['playstop'].src = '/fashion/fashionshows/images/stop_34.gif'; 
      playslideshow();
  } 
  else if (button.match('stop_34.gif')) {
      document['playstop'].src = '/fashion/fashionshows/images/play_34.gif'; 
      stopslideshow(document.slider.flag.value);
  }
}

function togglePlayFancy() {
  var button = document['playstop'].src;
  if (button.match('play_34.gif')) { 
      document['playstop'].src = '/fashion/fashionshows/images/stop_34.gif'; 
      playslideshowfancy();
  } 
  else if (button.match('stop_34.gif')) {
      document['playstop'].src = '/fashion/fashionshows/images/play_34.gif'; 
      stopslideshow(document.slider.flag.value);
  }
}

function loadCaption() {
  var img = document.getElementById('currentslide').innerHTML;

  if (caption[img]) {
      var arr = new Array();
      arr = caption[img].split(';');
      // document.getElementById('caption_who').innerHTML = arr[0] + "<br />";
      document.getElementById('caption_who').innerHTML = arr[0] + "<br />";
      document.getElementById('caption_when').innerHTML = arr[1];
      document.getElementById('caption_where').innerHTML = arr[2];
      if (arr[3]) {
      	document.getElementById('caption_credit').innerHTML = arr[3];
      } else {
	document.getElementById('caption_credit').innerHTML = "FIRST VIEW";
      }
  } else {
      document.getElementById('caption_who').innerHTML = " ";
      document.getElementById('caption_when').innerHTML = " ";
      document.getElementById('caption_where').innerHTML = " ";
      document.getElementById('caption_credit').innerHTML = "FIRST VIEW";
  }
}

// -->
