﻿
    // Get the page setup for scrolling through the images 
    function initialize() {
        var images = $get('images');

        // Determine how many images were provided

        images.imageCount = 0;
        for (var i = 0; i < images.childNodes.length; i++) {
            var child = images.childNodes[i];
            if (child.tagName && child.tagName.toLowerCase() == 'div') {
                images.imageCount++;
            }
        }
        images.style.width = (images.imageCount * 783) + 'px';
        images.style.left = '0px';
        images.visibleIndex = 0;
        toggleButtonVisibility(images);

    }

    // Enable/disable buttons depending on whether or not there are more images 
    function toggleButtonVisibility() {
//        var images = $get('images');
//        var previous = $get('ctl00_Content_previousbtn');
//        var next = $get('ctl00_Content_nextbtn');

//        previous.style.visibility = (images.visibleIndex > 0) ? 'visible' : 'hidden';
//        next.style.visibility = (images.visibleIndex < images.imageCount - 1) ? 'visible' : 'hidden';

    }

    // Move to the next image

    function move(behavior, delta) {        
        var images = $get('images');        
        images.visibleIndex = delta;
        var animation = behavior._onClick._animation._animations[1]._animations[0];
        animation.set_startValue(parseInt(images.style.left));
        animation.set_endValue(images.visibleIndex * -783);
    }
    function changebg(color) {
        if (document.getElementById('bannertype').className != color) { document.getElementById('bannertype').className = color; }        
    }
    
