var xmlhttp = false;
var headline_count;
var headline_interval;
var old_headline = 0;
var current_headline=0;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
	xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
	xmlhttp = false;
}
}
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp = false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp = false;
	}
}

function PostContent() {
  	if(xmlhttp.readyState == 4){	//div content has loaded, start scrolling
  	
		document.getElementById('scrollup').innerHTML=xmlhttp.responseText;
		headline_count = $("div.headline").size();
  		$("div.headline:eq("+current_headline+")").css('top','5px');
  		headline_interval = setInterval(headline_rotate,5000); //time in milliseconds
	}}

function runAnnouncement1() {

	
	if (xmlhttp) {
	
		tmp = new Date();
		
		tmp = "?"+tmp.getTime();
		xmlhttp.open("GET", "EventFatch.aspx"+tmp);
		xmlhttp.onreadystatechange=PostContent;
		xmlhttp.send(null);
	}
	
}


function runAnnouncement() {

	
	if (xmlhttp) {
	
		tmp = new Date();
		
		tmp = "?"+tmp.getTime();
		xmlhttp.open("GET", "../EventFatch.aspx"+tmp);
		xmlhttp.onreadystatechange=PostContent;
		xmlhttp.send(null);
	}
	
}

function headline_rotate() {
  current_headline = (old_headline + 1) % headline_count; //remainder will always equal old_headline until it reaches headline_count - at which point it becomes zero. clock arithmetic
  $("div.headline:eq(" + old_headline + ")").animate({top: -205},"slow", function() {
    $(this).css('top','210px');
    });
  $("div.headline:eq(" + current_headline + ")").show().animate({top: 5},"slow");  
  old_headline = current_headline;
}









