var theHiLimit = 18;
var theLimit = -9000;
var redefined = false;
var theHiLimit2 = 78;
var theLimit2 = -9000;
var redefined2 = false;
var url = "../images/nowplaying.js.php?";
var url2 = "../images/nowplaying2.js.php?";
var textValue, tickerdiv, jsRef, delay, msg;
var textValue2, tickerdiv2, jsRef2, delay2, msg2;

function initDLSscroll() {
	var moving = false;
	if (document.all) {
		textValue = document.all.dlscontent;
		tickerdiv = document.all.dlscontent.style;
		jsRef = document.all.DLSfeed;
		delay = 30;
	}
	else if (document.getElementById) {
		textValue = document.getElementById('dlscontent');
		tickerdiv = document.getElementById('dlscontent').style;
		jsRef = document.getElementById('DLSfeed');
		delay = 30;
	}
	changeValue();
	DLSscroll();
}

function initDLSscroll2() {
	var moving2 = false;
	if (document.all) {
		textValue2 = document.all.dlscontent2;
		tickerdiv2 = document.all.dlscontent2.style;
		jsRef2 = document.all.DLSfeed2;
		delay2 = 32;
	}
	else if (document.getElementById) {
		textValue2 = document.getElementById('dlscontent2');
		tickerdiv2 = document.getElementById('dlscontent2').style;
		jsRef2 = document.getElementById('DLSfeed2');
		delay2 = 32;
	}

	changeValue2();
	DLSscroll2();
}


function changeValue() {
	if (dhtml){
		textValue.innerHTML = msg + ' ' + djmsg;
		refreshFile();
	}
}

function changeValue2() {
	if (dhtml){
		textValue2.innerHTML = msg2 + ' ' + djmsg2;
		refreshFile2();
	}
}

function refreshFile() {
	var now = new Date();
	var Random = now.getTime();
	try {
		jsRef.src = url + Random.toString();
	}
	catch(e) {
		// Do Not Re-Load the Js file for Mac
		msg = "";
	}
}

function refreshFile2() {
	var now = new Date();
	var Random = now.getTime();
	try {
		jsRef2.src = url2 + Random.toString();
	}
	catch(e) {
		// Do Not Re-Load the Js file for Mac
		msg2 = "";
	}
}

function findLimit() {
	if (document.getElementById) {
		theHiLimit = document.getElementById('dlscontent').offsetHeight;
	}
	else if (document.all) {
		theHiLimit = (document.all.dlscontent.scrollHeight);
	}
}

function findLimit2() {
	if (document.getElementById) {
		theHiLimit2 = document.getElementById('dlscontent2').offsetHeight;
	}
	else if (document.all) {
		theHiLimit2 = (document.all.dlscontent2.scrollHeight);
	}
}

function DLSscroll() {
	findLimit();
	if ((parseInt(theHiLimit) <= 17) && (redefined == false)) { theLimit = -1 * (parseInt(tickerdiv.width)+30); redefined = true; }
	if (parseInt(tickerdiv.left) > theLimit) {
		tickerdiv.left = parseInt(parseInt(tickerdiv.left) - 2);
		tickerdiv.width = parseInt(tickerdiv.width) + 2;
		setTimeout('DLSscroll()', delay);
		}
	else {
//alert("starting");
		tickerdiv.left = 271;
		tickerdiv.width = 30;
		changeValue();
		redefined = false;
		setTimeout('DLSscroll()', delay);
	}
}

function DLSscroll2() {
	findLimit2();
	if ((parseInt(theHiLimit2) <= 78) && (redefined2 == false)) { theLimit2 = -1 * (parseInt(tickerdiv2.width)+30); redefined2 = true; }
	if (parseInt(tickerdiv2.left) > theLimit2) {
		tickerdiv2.left = parseInt(parseInt(tickerdiv2.left) - 2);
		tickerdiv2.width = parseInt(tickerdiv2.width) + 2;
		setTimeout('DLSscroll2()', delay2);
		}
	else {
		tickerdiv2.left = 710;
		tickerdiv2.width = 270;
		changeValue2();
		redefined2 = false;
		setTimeout('DLSscroll2()', delay2);
	}
	
}

