ColorSpy = new Array();
ColorSpy[1] = "#FFFFFF";
ColorSpy[2] = "#FFFFDD";
ColorSpy[3] = "#FFFFCC";
ColorSpy[4] = "#FFFF99";
ColorSpy[5] = "#FFFF66";
ColorSpy[6] = "#FFFF33";
ColorSpy[7] = "#FFFF00";

var q=0;
var timeid = Array();
function get_count()
{
	var delay = 30000;
	getProducts();
	setTimeout("get_count()", delay);
}
function createRequestObject(){
	var request_o; 
	var browser = navigator.appName; 
	if(browser == "Microsoft Internet Explorer"){
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		request_o = new XMLHttpRequest();
	}
	return request_o; 
}
var http = createRequestObject(); 
function getFaq(q){
	var url="faq/"+q;
	http.open("get",url);
	http.onreadystatechange = handleProducts; 
	http.send(null);
}

function handleProducts(){
	if(http.readyState == 4){ 
		var response = http.responseText;
		 flash('faqItem');
		document.getElementById('faqItem').innerHTML = response;
	}
}

function flash(id) {
  timeid[id] = window.setTimeout("fadeInSpy(7, '"+id+"')",110);
}

function fadeInSpy(where, id) {
  if (where >= 1) {
    document.getElementById(id).style.backgroundColor = ColorSpy[where];
	 document.getElementById(id).style.borderColor = "#FFCC00";
    if (where > 1) {
      where -= 1;
      timeid[id] = window.setTimeout("fadeInSpy("+where+",'"+id+"')", 110);
	   document.getElementById(id).style.borderColor = "#FFCC00";
    } else {
      where -= 1;
      document.getElementById(id).style.backgroundColor = "transparent";
	   document.getElementById(id).style.borderColor = "#FFFFFF";
      myclearTimeout(id);
    }
  }
}
function myclearTimeout(id) {
  clearTimeout(timeid[id]);
} 