function rowOverEffect(object) {
  if (object.className == 'moduleRow') object.className = 'moduleRowOver';
}

function rowOutEffect(object) {
  if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}

function checkBox(object) {
  document.account_newsletter.elements[object].checked = !document.account_newsletter.elements[object].checked;
}


function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=150')
}


var i = 0; //initialize the counter
var slide; //setup the image array variable

function SlideShow() {


    //fade out the current slide
    $( slide[i] ).fade({ duration:1 });
    
    //add 1 to i 
    i++;		
    //check if we've reached the end of our slides, if so, rewind i to 0		
    if (i == slide.length) i = 0; 
    
    //fade in the next slide and after it's finished, loop this function
    $( slide[i] ).appear({ duration:1});
//    slide_id=setTimeout("$( slide[i] ).appear({ duration:1, afterFinish: function () { SlideShow(); } })",3000);
    slide_id=setTimeout("SlideShow()",5000);
} 

function stop_slideshow() {
            clearTimeout(slide_id);
}

//start my functions after the document has loaded
document.observe('dom:loaded', function () {


    //hide all of the slideshow images	
     $$('#bannerslide img').each(function(image){
	$(image).hide();
    });
	
    if ($('bannerslide')) {

        //dump the images into an array
	slide =  $('bannerslide').childElements();

        //fade in the first slide and after it's finished, start the slideshow
        slide_id=setTimeout("SlideShow()",0);
    }

    
});
