    //TODO: Will break if 11 or more slides are entered

    //-----EDITABLE---------//
    var refresh_rate = 5; //# of ms before the scroll location will be recalculated
    var increment_by = 20; //# of px's showcase scrolls each recalculation
    var wait_time=7000; //how long an image remains static
    //var slide_width=document.getElementById("li0").width; //width of each image, must all be to same size for formatting
    //var slide_width=860; //hard coded, see previous
    var slide_width=660;
    
    //-----PROGRAMMATIC-----//
    var current_selected=0;//the index of the selected button/image
    var i=0;//used for a while loop to make sure the buttons are displaying the correct state and to count the # of images in the showcase
    var pause_var=0; //used as temp variable



    function handler()
    {
        if(!pause()){
        
        
            //non-continuous acceleration effect, not as chopped as the other, but still not rendered as well as would be desireable
            //if (loc() % slide_width < slide_width / 8 || loc() % slide_width > 7 * slide_width / 8) {increment_by=5;}
            //else {increment_by=20}
            scroll_to(loc()+increment_by);
        
        }
    }

    function pause(){
        
        if(loc() % slide_width < increment_by && pause_var < wait_time) {
            if (pause_var == 0) scroll_to(loc() - loc() % slide_width)//make sure image lines up perfectly
            pause_var += increment_by;
            return 1;				
        }
        else {
            
            //uncomment if you want a continuous acceleration effect. However, the effect is too CPU intensive as is and renders poorly.
            //for (var k = 1;k<=refresh_rate;k++){if ( loc() % slide_width  / (2*refresh_rate-1) < i * slide_width / (2*refresh_rate-1) || ( slide_width - loc() % slide_width ) / (2*refresh_rate-1) < i * slide_width / (2*refresh_rate-1) ) {clearInterval(interval1); self.setInterval("handler()", refresh_rate + 1 - k); break;}}
            
            
            return 0;
        }

    }

    function scroll_to(x)
    {
        document.getElementById("showcase").scrollLeft = x;
        if (loc()==x-increment_by || loc()==x-slide_width) scroll_to(0);  // if (hit end) go to beginning
        
        if (x < 0 )
        {
            while(document.getElementById("btn"+i))
                i++;
                
            scroll_to(slide_width*(i-1));
            i=0;
        }
        
        pause_var=0;
        if(loc() % slide_width == 0)
        {
            while(document.getElementById("btn" + i))
            {
                if (loc() / slide_width == i) 
                {
                    document.getElementById("btn"+ (loc() / slide_width)).src="/SiteCollectionImages/small_circle_focus1.png";
                    document.getElementById("captionbox").style.left=document.getElementById("btn"+i).offsetLeft-document.getElementById("reference_img").offsetLeft-document.getElementById("caption"+i).value.length*3 +28 + "px";
                    document.getElementById("captionbox").innerHTML=document.getElementById("caption"+i).value;
                }
                
                else 
                    document.getElementById("btn"+i).src="/SiteCollectionImages/gray_dot1.png";
        
                i++;
            }
        }
        i=0;
    }

    function loc(){
    return document.getElementById("showcase").scrollLeft;
    }

    function button_click(position,obj){
        scroll_to(position);
        clearInterval(interval1);
    }

    function button_hover(obj,i){
    if(obj != document.getElementById("btn"+ (loc() / slide_width))) obj.src="/SiteCollectionImages/small_circle_hover1.png";
    document.getElementById("captionboxsmall").style.visibility="visible";
    document.getElementById("captionboxsmall").style.left=document.getElementById("btn"+i).offsetLeft-document.getElementById("reference_img").offsetLeft-document.getElementById("caption"+i).value.length*3 + 64 + "px";
    document.getElementById("captionboxsmall").innerHTML=document.getElementById("caption"+i).value;
    }

    function button_out(obj){
    if(obj != document.getElementById("btn"+ (loc() / slide_width))) obj.src="/SiteCollectionImages/gray_dot1.png";
    document.getElementById("captionboxsmall").style.visibility="hidden";
    }

    function left_arrow_click(obj){
    if (loc() % slide_width == 0) scroll_to(loc() - loc() % slide_width - slide_width);
    else scroll_to(loc() - loc() % slide_width);
    clearInterval(interval1);
    }

    function left_arrow_hover(obj){
    obj.src="/SiteCollectionImages/left_arrow_hover.gif";
    }

    function left_arrow_out(obj){
    obj.src="/SiteCollectionImages/left_arrow_unfocus.gif";
    }

    function left_arrow_down(obj){
    obj.src="/SiteCollectionImages/left_arrow_press.gif";
    }

    function right_arrow_click(obj){
    scroll_to(loc() - loc() % slide_width + slide_width);
    clearInterval(interval1);
    }

    function right_arrow_hover(obj){
    obj.src="/SiteCollectionImages/right_arrow_hover.gif";
    }

    function right_arrow_out(obj){
    obj.src="/SiteCollectionImages/right_arrow_unfocus.gif";
    }

    function right_arrow_down(obj){
    obj.src="/SiteCollectionImages/right_arrow_press.gif";
    }



    var interval1 = self.setInterval("handler()", refresh_rate); //TODO: Firefox has a faster clock than IE, correct for the difference
    