// JavaScript Document

// Pass data from txt files to arrays
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 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 offerscheck() {
		var holder = '';
		 var textfilename = 'arraydata/offers_blurb.txt';
		 xmlhttp.open("GET", [textfilename],true);
		   xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4) {
				 var holder = xmlhttp.responseText;
					if(holder != '') {
					document.getElementById('offers').style.display = "block";
	  				document.getElementById('offers_blurb').innerHTML = [holder];
					}
			  		else {
					document.getElementById('offers').style.display = "none";

					}
			  }
			}
	   		xmlhttp.send(null)
	  	}


	function newscheck() {
		var holder = '';
		 var textfilename = 'arraydata/news_blurb.txt';
		 xmlhttp.open("GET", [textfilename],true);
		   xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4) {
				 var holder = xmlhttp.responseText;
					if(holder != '') {
					document.getElementById('news').style.display = "block";
	  				document.getElementById('news_blurb').innerHTML = [holder];
					offerscheck() 
					}
			  		else {
					document.getElementById('news').style.display = "none";
					offerscheck() 
					}
			  }
			}
	   		xmlhttp.send(null)
	  	}
