/**
 *  Home page image swap
 *
 *  Author:    Chris Knowles <chris.knowles@ckweb.com.au>
 *  Version:   $Id$
 */

   
(function(){
       
    $E.onload(initImages);

    function initImages ()
    {
        var montage = new Image(884, 950);
        montage.src = "images/home/sprite.jpg";
        montage.onload = function()
        {
           rotateImages();
        }
    } 
    
    var position = 0;
    
    function rotateImages()
    {
        $D.id('banner').style.background = "transparent url(../images/home/sprite.jpg) no-repeat left top";
        setInterval(rotate, 6000);
    }
    
    function rotate()
    {
        position = position + 190;
        if (position == 950) {
            position = 0;
        }
        $D.id('banner').style.background = "transparent url(../images/home/sprite.jpg) no-repeat 0 -" + position + "px";
    }

})();


