
// WebTicker by Mioplanet
// www.mioplanet.com

TICKER_CONTENT = document.getElementById("TICKER").innerHTML;
 
TICKER_RIGHTTOLEFT = false;
TICKER_SPEED = 3;
TICKER_STYLE = "font-family:Arial; font-size:12px; color:#444444";
TICKER_PAUSED = false;

ticker_start();

var array_text = new Array();
array_text[0] = "<b>Final version of -Territory Manager- </b> Align and Optimize your sales territories by Zip Postal Codes"
array_text[1] = "<b>Maintain your reports updated!</b> You can update and overwrite your reports easily!"
array_text[2] = "<b>Lots of maps to choose!</b> More than 60 countries available!"
array_text[3] = "<b>More accurate maps!</b> Use zip/postal column of your excel to get more accurate maps!"
array_text[4] = "<b>Cool map viewer!</b> Just click on any map and see!"
array_text[5] = "<b>Search by Category!</b> To cut to the chase"
array_text[6] = "<span style='color:#B22222'><b>New feature! Send to co-workers!</b> Now you can send privately a map to your co-workers!</span>"
array_text[7] = "<span style='color:#B22222'><b>New feature! Filter grid!</b> Now you can filter your excel columns as you wish and see the results in the map!</span>"
array_text[8] = "<span style='color:#B22222'><b>New feature! Pie Charts!</b> Select two or more columns and see your data as a pie chart for each territory!</span>"

for (var i = array_text.length-1; i >= 0; i--) {
    TICKER_CONTENT += array_text[i] + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
}

function ticker_start() {
    var tickerSupported = false;
    
	TICKER_WIDTH = document.getElementById("TICKER").style.width;
	var img = "<img src=ticker_space.gif width="+TICKER_WIDTH+" height=0>";

	// Firefox
	if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("Safari")!=-1) {
		document.getElementById("TICKER").innerHTML = "<TABLE  cellspacing='0' cellpadding='0' width='100%'><TR><TD nowrap='nowrap'>"+img+"<SPAN style='"+TICKER_STYLE+"' ID='TICKER_BODY' width='100%'>&nbsp;</SPAN>"+img+"</TD></TR></TABLE>";
		tickerSupported = true;
	}
	// IE
	if (navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Opera")==-1) {
	    //document.getElementById("TICKER").innerHTML = "<DIV nowrap='nowrap' style='width:100%;'>"+img+"<SPAN style='"+TICKER_STYLE+"' ID='TICKER_BODY' width='100%'></SPAN>"+img+"</DIV>";
	    document.getElementById("TICKER").innerHTML = "<TABLE  cellspacing='0' cellpadding='0' width='100%'><TR><TD nowrap='nowrap'>" + img + "<SPAN style='" + TICKER_STYLE + "' ID='TICKER_BODY' width='100%'>&nbsp;</SPAN>" + img + "</TD></TR></TABLE>";
		tickerSupported = true;
	}
	if (!tickerSupported) {
	    document.getElementById("TICKER").outerHTML = "";
	}
	else {
	    document.getElementById("TICKER").scrollLeft = TICKER_RIGHTTOLEFT ? document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth : 0;
	    //var randomnumber = Math.floor(Math.random() * array_text.length);
	    //TICKER_CONTENT = array_text[randomnumber];
	    document.getElementById("TICKER_BODY").innerHTML = TICKER_CONTENT;
	    document.getElementById("TICKER").style.display = "block";
	    TICKER_tick();
	}
}

function TICKER_tick() {
	if(!TICKER_PAUSED) document.getElementById("TICKER").scrollLeft += TICKER_SPEED * (TICKER_RIGHTTOLEFT ? -1 : 1);
	if (TICKER_RIGHTTOLEFT && document.getElementById("TICKER").scrollLeft <= 0) {
	    document.getElementById("TICKER").scrollLeft = document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth;
	}
	if (!TICKER_RIGHTTOLEFT && document.getElementById("TICKER").scrollLeft >= document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth) {
	    document.getElementById("TICKER").scrollLeft = 0;
	    //var randomnumber = Math.floor(Math.random() * array_text.length);
	    //TICKER_CONTENT = array_text[randomnumber];
	    document.getElementById("TICKER_BODY").innerHTML = TICKER_CONTENT;
	}
	window.setTimeout("TICKER_tick()", 30);
}

