
//*********START SCROLL CODE************
//updated 9/14/04 pw -- moved and renamed variable "url" and place it in the refreshFile()function

//Global Variables
var theHiLimit = 18;
var theLimit = -9000;
var redefined = false;
var textValue, tickerdiv, jsRef, delay;

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 changeValue() {
	if (dhtml){
		textValue.innerHTML = msg + ' ' + djmsg;
		refreshFile();
	}
}

function refreshFile() {
	var urlICCH = "http://rope.icgo.fimc.net/CUBE-NRE_NowPlaying.js?"
	var now = new Date();
	var Random = now.getTime();
	try {
		jsRef.src = urlICCH + Random.toString();
	}
	catch(e) {
		// Do Not Re-Load the Js file for Mac
	}
}

function findLimit() {
	if (document.getElementById) {
		theHiLimit = document.getElementById('dlscontent').offsetHeight;
	}
	else if (document.all) {
		theHiLimit = (document.all.dlscontent.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);
	}
}

//*********END SCROLL CODE************
//set to false, if ad exist this will be set to true in the ad server 
var isCM8Running = false;
//************* MEDIA PLAYER FUNCTION **********************//

var pSrc = "";
function openWindow(strURL){
	if (strURL.indexOf("type=R")> 0) {
		pSrc = "http://images.radcity.net/<%=gsLID%>/" + strURL.substring(strURL.indexOf("type=R")+12);
		if (document.all) {
		theWin = window.open(strURL, "newWin", "width=485,height=400,left=20,top=100,scrollbars=auto,resizable=yes")
		}else {
		theWin = window.open(strURL, "newWin", "width=485,height=430,left=20,top=100,scrollbars=auto,resizable=yes")
		}
		theWin.focus;
	
	}else{
		if (document.all) {
		theWin = window.open(strURL, "newWin", "width=485,height=400,left=20,top=100,scrollbars=auto,resizable=yes")
		}else {
		theWin = window.open(strURL, "newWin", "width=485,height=430,left=20,top=100,scrollbars=auto,resizable=yes")
		}
		theWin.focus;
	}
	
}

function writeAds() {
if(bodyLoaded){
	//writeIt("adbanner",'ADBANNER',468,60);
	writeIt("boxicon",'BOXICON',120,80);
	writeIt("boxicon2",'BOXICON2',120,80);
	writeIt("boxicon3",'RETAILBOX',120,80);
	
}
else {
	window.setTimeout("writeAds()", 1000)
	
}

}


function writeIt(theId,adServe,width,height) {
	newHtml = '<IFRAME src="' + baseHREF + random + sitearea + 'AAMSZ=' + width + 'X' + height + '/LOCATION=' + adServe +'" SCROLLING="NO" VSPACE="0" FRAMEBORDER="0" MARGINHEIGHT="0" MARGINWIDTH="0" WIDTH="' + width + '" HEIGHT="' + height + '"></IFRAME>';
	if (document.all)
		{
		document.all[theId].innerHTML = newHtml
		}
	if (document.getElementById)
		{
		document.getElementById(theId).innerHTML = newHtml;
		}
	
	
}

////////////////////////////CHECKM8 ad////////////////////////////////

var CM8checkCount = 0;
var bCheckWidth = false
//
// show chekm8 ad only if window width at least 900px and IE
if ((isIEBrowser) && (document.body.offsetWidth >= 900)) {
	bCheckWidth = true;
}

function showCM8Ad() {
	if ((isCM8Running) && (bCheckWidth))
		{
		//alert("check ad")
		isCM8Loaded();
		}
	else
		{
		//alert("don't check ad")
		showAllLayers()
		}
}

function isCM8Loaded(){
CM8statusCheck = eval(document.all.checkm8Ad_1);

	if (CM8statusCheck == "[object]")
    {
		//alert("exists");
		//nAdwidth = document.all.checkm8Ad_1.width
		//show layers
		showAllLayers()
    }
    else
    {
	 CM8checkCount ++ ;
	 if (CM8checkCount < 15) {//keep checking 
		window.setTimeout("isCM8Loaded()",500);
	 }
	 else{
		//show layers
		showAllLayers()
	 }	
    }

}

