var scroll_px_max = 408;			//height of one scrolling div
var scroll_div_id = 'div_scroll_affiliate_website';
var scroll_step = -1;		//speed of scroll
var scroll_freq = 100;		//ms calling itself

var scroll_target_div;
var is_scrolling = false;
var scroll_px_top = 0;
var scroll_stopHandle;
function scrollHalt(){
	if (is_scrolling){
		clearTimeout(scroll_stopHandle);
		
	}
	is_scrolling = false;
}
function scrollPerform(){
	if(is_scrolling){
		scroll_px_top += scroll_step;
		
		
		scroll_target_div.scrollTop = scroll_px_top;
		
		if((scroll_px_top < 0) && (scroll_step < 0)){
			scroll_px_top = scroll_px_max + scroll_step;
		}
		else{
			if((scroll_px_top > scroll_px_max) && (scroll_step > 0)){	
				scroll_px_top = scroll_step;
			}
		}
		
		scroll_stopHandle = setTimeout('scrollPerform()', scroll_freq);
	}
}
function scrollStart(){
	if(!is_scrolling){
		scroll_target_div = document.getElementById(scroll_div_id);
		is_scrolling = true;
		scrollPerform();
	}
}