//SCRIPTSROLL
window.onDomReady = DomReady;

function DomReady(fn) {
	//W3C
	if(document.addEventListener) {
		document.addEventListener("DOMContentLoaded", fn, false);
	}
	//IE
	else {
		document.onreadystatechange = function(){readyState(fn)}
	}
}

//IE execute function
function readyState(fn) {
	//dom is ready for interaction
	if(document.readyState == "interactive" || document.readyState == "complete") {
		fn();
	}
}

// resize scroll divs
var ie = (document.all) ? 1 : 0;

function resizeScroller() {
	if (ie) {
		//document.all.selection.style.pixelTop = document.body.scrollTop + topOffset;
		document.all.container.style.width = (document.body.clientWidth-container);
//		document.all.container.style.width = (document.body.clientWidth-565)+'px';
		//document.all.blog_scroll.style.width = (document.body.clientWidth-500)+'px';
		//document.all.news_scroll.style.width = (document.body.clientWidth-500)+'px';
	} else {
		//document.all.selection.style.top = window.pageYOffset + topOffset;
		document.getElementById('container').style.width = (window.innerWidth-container);
//		document.getElementById('container').style.width = (window.innerWidth-750)+'px';
//		document.getElementById('container').style.width = (window.innerWidth-610)+'px';
		//document.getElementById('blog_scroll').style.width = (window.innerWidth-500)+'px';
		//document.getElementById('news_scroll').style.width = (window.innerWidth-500)+'px';
	}
}

function doLoad() {
	resizeScroller();
	window.onresize = resizeScroller;
}

//window.onload = doLoad;
window.onDomReady(doLoad);


// auto scroll code
scrollStep=2;

timerLeft="";
timerRight="";

function toLeft(id){
  document.getElementById(id).scrollLeft=0;
}

function scrollDivLeft(id){
  clearTimeout(timerRight) ;
  document.getElementById(id).scrollLeft+=scrollStep;
  timerRight=setTimeout("scrollDivLeft('"+id+"')",0);
}

function scrollDivRight(id){
  clearTimeout(timerLeft);
  document.getElementById(id).scrollLeft-=scrollStep;
  timerLeft=setTimeout("scrollDivRight('"+id+"')",0);
}

function toRight(id){
  document.getElementById(id).scrollLeft=document.getElementById(id).scrollWidth;
}

function stopMe(){
  clearTimeout(timerRight) ;
  clearTimeout(timerLeft);
}

-->
