	var scrollnews = document.getElementById('headlineMove');
	var newscontainer = document.getElementById('headlineDiv');
//	var scrollpic = document.getElementById('picScrool').InnerText;
	var liWidth;
	var lis = scrollnews.getElementsByTagName('li');
	var items = 8;

	var is_stop = 0;
	var autoStep = 12;

	
	newscontainer.parentNode.onmouseover = function() { is_stop = 1; }
	newscontainer.parentNode.onmouseout = function() { is_stop = 0; }

	function scroller(){
	
		hl_html = '';
		headlineAds.sort(function(){return Math.random()>0.5?-1:1;});
		for(i=0; i<headlineAds.length; i++){
			showimg = '\images/nopic.gif';//(i<10) ? headlineAds[i][2] : 
			hl_html += "<li><div class=\"headlineAd\"><a href=\"" + headlineAds[i][1] + "\" rel=\"nofollow\" target=\"_blank\" title=\"" + headlineAds[i][0] + "\"><img src=\""+showimg+"\" id=\"hlimg" + i + "\"><br />" + headlineAds[i][0] + "</a></div></li>";
		}
		scrollnews.innerHTML = hl_html;
		if(lis.length>0){
		liWidth = lis[0].offsetWidth;
		}
		newscontainer.scrollLeft = 0;
		if(headlineAds.length > items){
			scrollnews.innerHTML += hl_html;
			newscontainer.scrollLeft = liWidth;
		}
		
		scroll(1, autoStep);
		var timer1 = setInterval(function(){
			if(!is_stop && headlineAds.length > items) scroll(1, autoStep);
		},2000);
		
	}

	scroller();

	function scroll(dirc, step){
		var hlimg, ml = 0;//var step = 3;
		var reg = /hlimg([0-9]+)/;
		
		for(i=0;i<10;i++){
		if(lis[i]!=null){
			hlimg = lis[i].getElementsByTagName('img');
			reg.test(hlimg[0].id);
			if(hlimg[0].src != headlineAds[RegExp.$1][2]) hlimg[0].src = headlineAds[RegExp.$1][2];
			}
		}
		var timer2 = setInterval(function(){
			if(is_stop && step == autoStep) return false;
			if(liWidth-ml < 15) step = 2;
			(ml) += step;
			newscontainer.scrollLeft += dirc*step;
			if(ml >= liWidth){
				clearInterval(timer2);
				ml = 0;
				if(dirc == 1) lis[0].parentNode.appendChild(lis[0]);
				else lis[lis.length-1].parentNode.insertBefore(lis[lis.length-1],lis[0]);
				newscontainer.scrollLeft = liWidth;
			}
		},30);
	}