// JavaScript Document

function slideLine(div, ul, delay, speed, lh) {
	var divBox = (typeof div == 'string')?document.getElementById(div):div;
	var slideBox = (typeof ul == 'string')?document.getElementById(ul):ul;
	var cld = slideBox.getElementsByTagName('li')[0];
	if(null != cld){
		divBox.style.display = "block";
	var delay = delay||1000, speed=speed||20, lh = lh||20;
	var tid = null, pause = false;
	var start = function() {
		tid=setInterval(slide, speed);
	}
	var slide = function() {
		if (pause) return;
		slideBox.scrollTop += 2;	
		if (slideBox.scrollTop % lh == 0) {
			clearInterval(tid);
			slideBox.appendChild(slideBox.getElementsByTagName('li')[0]);
			if(lh/speed == 2){
				slideBox.appendChild(slideBox.getElementsByTagName('li')[0]);
			}
			slideBox.scrollTop = 0;
			setTimeout(start, delay);
		}
	}
	slideBox.onmouseover=function(){pause=true;}
	slideBox.onmouseout=function(){pause=false;}
	setTimeout(start, delay);
	}
	else{
        divBox.style.display = "none" ;
		}
}


function slideLineup(div, delay, speed, lh) {
	var slideBox = (typeof div == 'string')?document.getElementById(div):div;
	var delay = delay||1000, speed=speed||20, lh = lh||20;
	var tid = null, pause = false;
	var start = function() {
		tid=setInterval(slide, speed);
	}
	var slide = function() {
		if (pause) return;
		slideBox.scrollTop += 2;	
		if (slideBox.scrollTop % lh == 0) {
			clearInterval(tid);
			slideBox.appendChild(slideBox.getElementsByTagName('ul')[0]);
			if(lh/speed == 2){
				slideBox.appendChild(slideBox.getElementsByTagName('ul')[0]);
			}
			slideBox.scrollTop = 0;
			setTimeout(start, delay);
		}
	}
	slideBox.onmouseover=function(){pause=true;}
	slideBox.onmouseout=function(){pause=false;}
	setTimeout(start, delay);
}

