function sponsorRotator(objectName, type) {
    if (type == 'fade') {

        $(document).ready(function () {
            $(objectName + ' div.inner').each(function () {
                var sponsorImage = new Array();
                var maxHeight = 0;
                var sponsorBlock = this;
                var sponsorDisplay = 0;
                var sponsorNext = 0;

                i = 0;
                $(sponsorBlock).find('li').each(function () {
                    this.style.position = 'absolute';
                    this.style.top = '0';
                    this.style.left = '0';
                    this.style.height = 'auto';
                    this.style.width = 'auto';
                    //this.style.width = width + 'px';
                    //this.style.height = height + 'px';
                    //this.style.lineHeight = height + 'px';

                    sponsorImage[i] = this;
                    i++;
                });

                $(window).load(function () {
                    for (var i = 0; i < sponsorImage.length; i++) {
                        $(sponsorImage[i]).each(function () {
                            sponsorImage[i].imgHeight = sponsorImage[i].offsetHeight;
                            if (sponsorImage[i].imgHeight > maxHeight) {
                                maxHeight = sponsorImage[i].imgHeight;
                            }
                            if (i > 0) {
                                $(this).hide();
                            }
                        });
                    }
                    sponsorBlock.style.height = maxHeight + 'px'
                    sponsorBlock.style.lineHeight = maxHeight + 'px';


                    setInterval(function () {
                        if (sponsorDisplay >= sponsorImage.length - 1) {
                            sponsorNext = 0;
                        }
                        else {
                            sponsorNext++;
                        }
                        $(sponsorImage[sponsorDisplay]).fadeOut(200);
                        $(sponsorImage[sponsorNext]).fadeIn(200);
                        sponsorDisplay = sponsorNext;
                    }, 5000);
                });
            });
        });
    }
};
