var whnewscrlpos=0;
var direction=1;
var ldirection=1;
function changeimg(i,j,cnt,dir) {
	if (j<cnt-1 && dir>0 || dir < 0 && j>0) {
		var a=document.getElementById('imggal_'+i+'_'+j);
		var b=document.getElementById('imggal_'+i+'_'+(j+dir));
		a.style.display='none';
		b.style.display='';
	}
}

function whnewscrl() {
	var  whnewscrl=document.getElementById('whnewscrl');
	whnewscrl.onmouseover=function() {
		direction=0;
	}
	whnewscrl.onmouseout=function() {
		direction=1;
	}
	//alert(whnewscrl.clientHeight);
	
	whnewscrl.childNodes[0].style.marginTop=whnewscrlpos+"px";
	var t=whnewscrl.childNodes[0].style.marginTop.replace('px','');
	if (t<-Math.round(whnewscrl.childNodes[0].clientHeight/2)) {
		whnewscrlpos=-1;
		//window.document.title=whnewscrl.childNodes[0].clientHeight;
	}
	if (t>10) {
		//direction=1;
	}
	whnewscrlpos-=direction	;
}
