function scroller(container_id, content_id, slider) {
	this.container = document.getElementById(container_id);
	this.content = document.getElementById(content_id);
	this.step = 5;
	this.interval = '';
	this.slider = slider;

	this.is_scroll_enabled = function() {
		return this.content.offsetHeight > this.container.offsetHeight;
	}

	this.get_y = function() {
		return parseInt(this.content.style.top);
	}

	this.scroll_to = function(y) {
		//alert(this.content.offsetHeight);
		//this.content = document.getElementById(content_id);
		if(y <= 0) {
			this.content.style.top = y + 'px';
		} else this.content.style.top = '0px';
	}

	this.scroll_up = function() {
		if (this.is_scroll_enabled()) {
			var to = this.get_y() + this.step < 0 ? this.get_y() + this.step : 0;
			this.scroll_to(to);
			if (to == 0) window.clearInterval(this.interval);
			if (this.slider) this.slider.setValue(to / this.get_min_y());
		}
	}

	this.scroll_down = function() {
		if (this.is_scroll_enabled()) {
			var to = (this.get_y() - this.step < 0 && this.get_y() - this.step >= this.get_min_y())
				? this.get_y() - this.step
				: this.get_min_y();

			this.scroll_to(to);
			if (to == this.get_min_y()) window.clearInterval(this.interval);
			if (this.slider) this.slider.setValue(to / this.get_min_y());
		}
	}

	this.get_min_y = function() {
		//alert(this.content.offsetHeight);
		return this.container.offsetHeight - this.content.offsetHeight;
	}

	this.scroll_to(0);
}

/*
function fix_png(element) {
	if (/MSIE (5\.5|6).+Win/.test(navigator.userAgent)) {
		var src;

		if (element.tagName == 'IMG') {
			if (/\.png$/.test(element.src)) {
				src = element.src;
				element.oSrc = element.dynsrc;
				element.src = '/images/dot.gif';
			}

		} else {
			src = element.currentStyle.backgroundImage.match('/url\("(.+\.png)"\)/i');
			if (src) {
				src = src[1];
				element.runtimeStyle.backgroundImage = 'none';
			}
		}

		if (src) element.runtimeStyle.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + src + '\', sizingMethod=\'scale\')';
	}
}
*/

