var newsticker = {
items: 10,
titles: ['Senstar expands US operations to meet growing demand in Perimeter Intrusion Detection market', 'Senstar continues to make moves in the US Market', 'Senstar completes first European installation of newest microwave system', 'Senstar books more orders from the Corrections Security Market in Canada and Australia', 'Senstar\'s innovative solution enables real-time alerting for wildlife on highways', 'Senstar to showcase products & solutions aimed at CFATS market as ASIS 2011', 'Senstar welcomes new President and Executive Director for US operation', 'Senstar Incorporated Joins SOCMA', 'Senstar opens Singapore Office to develop territory business', 'Senstar\'s μltraWave microwave sensor features superior networking, ease-of-use & ultra reliability', ],
blurbs: ['    February 17, 2012 - Herndon, Virginia - Senstar Inc. (\"Senstar\" or the \"Company\") is pleased to announce the hiring of ...', 'Expands representation by partnering with Gold Line Marketing Ottawa, Ontario - February 17, 2012 - Senstar Corporation ...', 'Ottawa, Ontario - February 9th, 2012 - Senstar\'s latest product launch, &micro;ltraWave, the most advanced digital microwave ...', 'Ottawa, ON - December 6, 2011 - Senstar Corporation (\"Senstar\" or the \"Company\"), today announced that it has recently booked ...', 'Herndon, VA - October 3, 2011 - The Colorado Department of Transportation (CDOT) has put into operation and continues to test ...', 'Herndon, VA - August 22, 2011 - With growing demand by organizations in the petrochemical market, Senstar, a world leader in ...', ' Herndon, VA - June 6, 2011 -  Senstar Corporation, a world leader in outdoor perimeter security technology and products, is ...', 'Herndon, VA, April 27, 2011 - Senstar Inc., a world leader and the trusted choice for perimeter intrusion detection ...', 'Ottawa, ON - April 15, 2011 - Senstar Corporation, a world-leader in outdoor perimeter security technology and products, is ...', 'Las Vegas, Nevada - April 6, 2011 - Senstar Corporation, a world leader in outdoor perimeter security technology and ...', ],
links: ['/index.php?page=news&news=31&nav1=5&nav2=40', '/index.php?page=news&news=30&nav1=5&nav2=40', '/index.php?page=news&news=29&nav1=5&nav2=40', '/index.php?page=news&news=28&nav1=5&nav2=40', '/index.php?page=news&news=27&nav1=5&nav2=40', '/index.php?page=news&news=26&nav1=5&nav2=40', '/index.php?page=news&news=25&nav1=5&nav2=40', '/index.php?page=news&news=24&nav1=5&nav2=40', '/index.php?page=news&news=23&nav1=5&nav2=40', '/index.php?page=news&news=22&nav1=5&nav2=40', ],
dates: ['February 22, 2012', 'February 21, 2012', 'February 9, 2012', 'December 16, 2011', 'October 3, 2011', 'August 22, 2011', 'June 6, 2011', 'April 27, 2011', 'April 15, 2011', 'April 6, 2011', ],
padding: ' - ',
divId: 'news_ticker_div',
containerId: 'the_news_ticker',
tickTime: 8000,
moreLink: 1,
	count: 0,
	index: 0,
		
	init: function() 
	{	
	newsticker.tick(newsticker.index);
	}, 
	tick: function(key)
	{
		var div = document.getElementById(newsticker.divId);
		if (!div) return;
		
		if (key >= newsticker.items) key = 0; // outside of range, reset
		if (div.firstChild != null) 
		{
			div.removeChild(div.firstChild); // remove previous text 
		}
		
        var child = document.createElement('div');
        var h3 = document.createElement('h3');
        var h3text = document.createTextNode(newsticker.titles[key]);
        h3.appendChild(h3text);
        child.appendChild(h3);
        
        var pdate = document.createElement('p');
        var emdate = document.createElement('em');
        var datetext = document.createTextNode(newsticker.dates[key]);
        emdate.appendChild(datetext);
        pdate.appendChild(emdate);
        child.appendChild(pdate);
        
        var pdetails = document.createElement('p');
        var detailstext = document.createTextNode(newsticker.blurbs[key]);
        pdetails.appendChild(detailstext);
        child.appendChild(pdetails);
        
       
        var phref = document.createElement('p');
        var href = document.createElement('a');
        href.href = newsticker.links[key];
        href.title = "READ MORE";
        var hreftext = document.createTextNode("// READ MORE");
        href.appendChild(hreftext);
        phref.appendChild(href);
        child.appendChild(phref);
        
		div.appendChild(child);
		newsticker.fade(0, newsticker.divId, 1);
				
		window.setTimeout("newsticker.startkill(" + key + ")", newsticker.tickTime);
		newsticker.count++;
	},
	startkill: function(key)
	{
		var div = document.getElementById(newsticker.divId);
		if (!div) return;
				
		newsticker.fade(100, newsticker.divId, -1);
		newsticker.index = key + 1;
		window.setTimeout("newsticker.tick(" + newsticker.index + ")", 400);
	},
	fade: function(opacity, objname, inout)
	{
		var obj = document.getElementById(objname);
		
		if (obj)
		{
			if (opacity <= 100 && opacity >= 0)
			{
				if (obj.style.MozOpacity != null) 
				{
					obj.style.MozOpacity = (opacity/100)-.001;
				} 
				else if (obj.style.opacity != null) 
				{
					obj.style.opacity = (opacity/100)-.001;
				} 
				else if (obj.style.filter != null) 
				{
					obj.style.filter = "alpha(opacity="+opacity+")";
				}
				
				if (inout > 0) opacity += 10;
				else if (inout < 0) opacity -= 10;
				
				window.setTimeout("newsticker.fade("+opacity+", '"+objname+"', "+inout+")", 35);
			}
		}
	}	
}
newsticker.init();

