// $RCSfile: script.js,v $
// @version $Source: /cvs/directtelweb/includes/script.js,v $, $Revision: 1.4 $, $Date: 2006/11/29 12:27:31 $, $State: Exp $

window.onload = function(){
	scrollNews();
}


function newwindow(thisObj,myname,w,h,scroll){ 
	var winl = 0;
	var wint = 0;
	winl = (screen.width-w)/2;
	if (navigator.userAgent.indexOf("Opera")==-1){  //Opera needs to be zero as it keeps popups within the browser content area
		wint = (screen.height-h)/2;
	}
	settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',toolbar=no,location=no,status=no,menubar=no,resizable=yes,dependent=no' 
	
	// Get HREF from link
	thisHref = thisObj.getAttribute("href");
	win=window.open(thisHref,myname,settings) 
	if(parseInt(navigator.appVersion) >= 4){win.window.focus();} 
	return false;
}

// ENDS

// NEWS SCROLLER 

function scrollNews(){
	var newsLength = document.getElementById('newsfix').offsetWidth;
	
	newsLength = -newsLength;
	news=document.getElementById("newsscrollerinner");	
	leftVal=news.style.left.substr(0, news.style.left.length-2);

	if(leftVal < newsLength){
		news.style.left= "350px";
	} else {
		news.style.left=(leftVal-1)+"px";
	}
		
	id=setTimeout("scrollNews()",20);
}
