
var delayHigh = 100000;
var arrayHigh = new Array();
var pointHigh = 0;
var stopHigh	= false;

function stopHighLight() {
	stopHigh = true;
}

function startHighLight() {
	stopHigh = false;
}

function feedHighLight() {
	if (!stopHigh) {
  	var xmlHttp = GetXmlHttpObject();
  	var rssText = "";
  	
  	if (arrayHigh.length > 0) {
  		if (document.getElementById("highLight") != null) {
  			document.getElementById("highLight").innerHTML = arrayHigh[pointHigh++];
  			if (pointHigh == arrayHigh.length) pointHigh = 0;			
  		}
  	} else { 
  		if (xmlHttp != null) {
  			if (document.getElementById("highLight") != null) {
  				xmlHttp.onreadystatechange = function() {
    				if(xmlHttp.readyState == 4) {
  						rssText = xmlHttp.responseText;
  						arrayHigh = rssText.split("<\|>");
  						document.getElementById("highLight").innerHTML = arrayHigh[0];
  					}
  				}
  				xmlHttp.open("GET","showHLightRSS.php",true);
      		xmlHttp.send(null);			
    		}      
  		}
  	}
	}
 	setTimeout('feedHighLight()', delayHigh);
} 


function GetXmlHttpObject() {
	var xmlHttp = null;
	try {
  	// Firefox, Opera 8.0+, Safari
  	xmlHttp=new XMLHttpRequest();
  } catch (e) {  	
  	try {
			// Internet Explorer
    	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
    	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
	return xmlHttp;
}