selNews=1;
csPage=1;
function showNews(id)
{
	if (id==selNews) return ;
//	$('cont_favorits_'+selNews).fade({duration: 0.5, afterFinish: function () {	$('cont_favorits_'+id).appear();	}});
	$('cont_favorits_'+selNews).fade({duration: 0.5});
	$('cont_favorits_'+id).appear({duration: 0.5});	
//	$('cont_favorits_'+selNews).fade({duration: 0.5});


	selNews=id;	
}

function hnextNews()
{
   total=	$$("div.js_stiri").size();
   if (csPage==3)
   		return
	start=((csPage-1)*4)+1;
	end=(csPage)*4;
	if (end>total) end=total;
	for (i=start;i<=end;i++)
		$('js_'+i).hide();
	start=((csPage)*4)+1;
	end=(csPage+1)*4;
	if (end>total)
		end=total;
	for (i=start;i<=end;i++)
		$('js_'+i).show();
   csPage++;
}

function hprevNews()
{
   total=	$$("div.js_stiri").size();
   if (csPage==1)
   		return
	start=((csPage-1)*4)+1;
	end=(csPage)*4;
	if (end>total) end=total;
	for (i=start;i<=end;i++)
		$('js_'+i).hide();
	start=((csPage-2)*4)+1;
	end=(csPage-1)*4;
	for (i=start;i<=end;i++)
		$('js_'+i).show();
   csPage--;
	
	
}
      var scroller  = null;
      var scrollbar = null;
//Event.observe(window, 'load', function() { $('overlay').hide();  }  )
document.observe("dom:loaded", function() {
//				$('js_prev_stiri').onclick=function() {hprevNews()};
//				$('js_next_stiri').onclick=function() {hnextNews()};
				$$("img.preload").each(function(e) {  
										preloadimage = new Image();						
										preloadimage.src=e.src;});
      scroller  = new jsScroller(document.getElementById("stiriScroll"), 290, 306);
      scrollbar = new jsScrollbar (document.getElementById("Scrollbar-Container"), scroller, false);
	
										})