swapSplash = function(vid){
  	        videoURL = 'splash.php?mv=' + vid;
           new Ajax.Updater('main', videoURL, {asynchronous:true});
       }
       
swapUtil = function(vid){
           new Ajax.Updater('main', vid, {asynchronous:true});
       }
       
swapOpacity = function(elm){
    y = 0
    while(y < 17){
        if(y == elm){
            document.getElementById(y).className = 'op_full';
        } else {
            document.getElementById(y).className = 'op_partial';
        }
    y++;
    }
}
       
function initCarousel_html_carousel() {carousel = new Carousel('html-carousel', {animHandler:animHandler, animParameters:{duration:0.5}, buttonStateHandler:buttonStateHandler, nextElementID:'next-arrow', prevElementID:'prev-arrow', size:14})};Event.observe(window, 'load', initCarousel_html_carousel);

function buttonStateHandler(button, enabled) {
 if (button == "prev-arrow") 
   $('prev-arrow').src = enabled ? "images/left-arrow.gif" : "images/left-arrow-alt.gif"
 else 
   $('next-arrow').src = enabled ? "images/right-arrow.gif" : "images/right-arrow-alt.gif"
}

function animHandler(carouselID, status, direction) {
  var region = $(carouselID).down(".carousel-clip-region")
  if (status == "before") {
    Effect.Fade(region, {to: 0.3, queue: { position:'end', scope: "carousel" }, duration: 0.2})
  }
  if (status == "after") {
    Effect.Fade(region, {to: 1, queue: { position:'end', scope: "carousel" }, duration: 0.2})
  }
}
