﻿
//this opens a new browser window at the specified size. the imgUrl querystring is also created to allow the new page's script to populate the page correctly.
function showLargeView(URL) { 
  window.open("LargeProductView.aspx?imgUrl=" + URL,"largeView", "width=450, height=480, scrollbars=yes, resizable=yes");
}

//when products have multiple images this script allows them to be clicked to switch from thumbnail (row of these displayed under the main image) to full view with no page refresh or AJAX involvement.
function swapThumbnailImage(image) { 
  document.getElementById("ctl00_Content_fvDetails_imgDetail").src = "productImages/" + image;
  document.getElementById("ctl00_Content_fvDetails_imgDetail").onclick = function(){showLargeView(image)};
}

//as showLargeView above
function showMap(map) { 
 window.open("MapView.aspx?map=" + map,"mapView", "width=792, height=645, scrollbars=yes, resizable=yes, location=1 ");
 }

//this switched an image from and from its typical normal and mouseover states. remember that onmouseout events are need to revert to the original image, calling this script again.

//id = image id within the page (and with any added ASP.NET naming)
//src = the replacement image to swap the original image with.
function swapImage(id, src) {
  document.getElementById(id).src = src;
}
