function processSlideshow(elem, imageList, linkList, imageDuration, fadeSpeed, current) {
    var listSize = imageList.length;
    if (!current || current >= listSize) current = 0;
    if (!imageDuration) imageDuration = 2000;
    if (!fadeSpeed) fadeSpeed = 1000;
    $(elem + " a").attr("href", linkList[current]);
    $(elem + " img").attr("src", imageList[current]);
    if (current == (listSize - 1)) {
        $(elem).css("background", "url(" + imageList[0] + ") no-repeat");
    } else {
        $(elem).css("background", "url(" + imageList[current + 1] + ") no-repeat");
    }
    $(elem + " img").animate({ opacity: "1" }, imageDuration).
	      animate({ opacity: "0.01" }, fadeSpeed, function () {
	          $(this).css("opacity", "1"); processSlideshow(elem, imageList, linkList, imageDuration, fadeSpeed, current + 1)
	      });

	  }

	  function OpenVRWindow() {
	      try {
	          var vrUrl = 'http://oi.vresp.com?fid=bed85c995b';
	          var width = 600;
	          var height = 450;
	          var left = (screen.width - width) / 2;
	          var top = (screen.height - height) / 2;
	          // Note:  If element doesn't exist, function will error from here
	          var emailAddress = document.getElementById('VrEmailAddress');
	          if ((emailAddress.value.length === 0) || (emailAddress.value == 'Enter Email Address')) {
	              return true;
	          }
	          vrUrl += "&email_address=";
	          vrUrl += emailAddress.value;
	          var params = 'width=' + width + ', height=' + height;
	          params += ', top=' + top + ', left=' + left;
	          params += ', directories=no';
	          params += ', location=no';
	          params += ', menubar=no';
	          params += ', resizable=yes';
	          params += ', scrollbars=yes';
	          params += ', status=no';
	          params += ', toolbar=no';
              try
              {
                  newwin = window.open(vrUrl, 'vr_optin_popup', params);
	              emailAddress.value = "";
    	          if (window.focus) { newwin.focus() }
              }
    	      catch (err) {
    	          //alert("Pop-up blocker prevented e-mail submission.  Please enable pop-ups to continue.");
    	      }
    	  }
	      catch (err) {
	          alert("An error occurred during e-mail submission: " + err.description);
	      }
	          return true;
}

