function containsDOM (container, containee) {
  var isParent = false;
  do{
    if ((isParent = container == containee)) break;
    containee = containee.parentNode;
  }
  while (containee != null);
  return isParent;
}


function pageLoad(){

	try{setTimeout("newsScrollerInit()",2000);}catch(e){}

}


var tOutNews,tOutFinance,objNews,objFinance;
function newsScrollerInit(){
	try{
	var newsDiv1=document.getElementById('NewsScroller1');
	newsDiv2=document.createElement("div");
	for(var i=0;i<3;i++){newNode=newsDiv1.childNodes[i].cloneNode(true);newsDiv2.appendChild(newNode)}
	newsDiv2.id="NewsScroller2"
	newsDiv2.style.position="relative";
	newsDiv2.style.top=newsDiv1.offsetHeight;
	var fatherElem=newsDiv1.parentNode;
	fatherElem.appendChild(newsDiv2);
	objNews=document.getElementById("NewsScrollerContainer");
	objNews.style.top=0;
	AreaHeightNews=newsDiv1.offsetHeight;
	ScrollNewsDiv();
	}catch(e){}
}

function ScrollNewsDiv(){
	try{var num=parseInt(objNews.style.top)
  	objNews.style.top=num-(1);
    if(num<AreaHeightNews*(-1)){ clearTimeout(tOutNews);objNews.style.top=0 }
	tOutNews=setTimeout("ScrollNewsDiv()",70)}catch(e){}
}


function scrollStop(sType){	
	if(sType=="news") clearTimeout(tOutNews);
	else clearTimeout(tOutFinance);
}
function scrollResume(element,evt,sType){
	var isOut="";
	if (element.contains && evt.toElement){ isOut=(!element.contains(evt.toElement)); }
  	else if (evt.relatedTarget){ isOut=(!containsDOM(element, evt.relatedTarget)); }
	if(isOut){
		if(sType=="news") ScrollNewsDiv();
		else ScrollFinanceDiv();
	}
}