var ostamp, boxcontent

function q4bountyshow() {
	ostamp = document.getElementById("ostamp");
	boxcontent = document.getElementById("boxcontent");
	ostamp.style.display = "none";
	var DateToday=new Date()
	var months=new Array(12)
	months[0]="January"
	months[1]="February"
	months[2]="March"
	months[3]="April"
	months[4]="May"
	months[5]="June"
	months[6]="July"
	months[7]="August"
	months[8]="September"
	months[9]="October"
	months[10]="November"
	months[11]="December"
	boxcontent.innerHTML = "<div style=\"text-align:center;font-family:verdana,arial,helvetica,sans-serif;\" id=\"content\"><span style=\"font-size:14px;line-height:12pt;font-weight:bold;\">"+months[DateToday.getMonth()]+" special!</span><br /><div style=\"text-align:justify;width:90%;margin:0px auto;font-size:12px;\">Some customers are eligible for an additional <span style=\"font-weight:bold;\">$100</span> back for a total of up to <span style=\"font-weight:bold;\">$300</span> off our standard pricing.  Enter your telephone number (including area code) and ZIP code to see your discount.<br /><div style=\"text-align:center;line-height:20pt;\"><label for=\"areacode\">Phone:</label> <input id=\"areacode\" size=\"3\" maxlength=\"3\" style=\"width:29px;height:19px;font-family:verdana,arial,helvetica,sans-serif;\" /> <input id=\"prefix\" size=\"3\" maxlength=\"3\" style=\"width:29px;height:19px;font-family:verdana,arial,helvetica,sans-serif;\" /> <input id=\"suffix\" size=\"4\" maxlength=\"4\" style=\"width:37px;height:19px;font-family:verdana,arial,helvetica,sans-serif;\" /><br /><label for=\"ZIP\">ZIP code:</label> <input id=\"ZIP\" size=\"5\" maxlength=\"5\" style=\"width:45px;height:19px;font-family:verdana,arial,helvetica,sans-serif;\" />&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"default.asp\" style=\"border:1px black solid;padding:2px;text-decoration:none;\" onclick=\"checkBounty();return false;\">Go</a><br /><span style=\"line-height:12pt;color:red;font-weight:bold;\" id=\"error\"></span><div style=\"width:100%;text-align:right;\" id=\"q4nothanks\"><a href=\"default.asp\" style=\"line-height:12pt;color:#000;\" onclick=\"q4bountyclose();return false;\">No thanks.</a></div></div></div></div>";
}

/* Create a new XMLHttpRequest object to talk to the Web server */
var xmlHttp = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
@end @*/

if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}
	
function checkBounty() {
	var phno = document.getElementById("areacode").value + document.getElementById("prefix").value + document.getElementById("suffix").value;
	var zip = document.getElementById("ZIP").value;
	var url = "q4/q4bounty.asp?phno=" + escape(phno) + "&zip=" + escape(zip);
	//alert(phno)
	//alert(zip)
	//alert(url)
	xmlHttp.open("GET",url,true);
	xmlHttp.onreadystatechange = showBounty;
	xmlHttp.send(null);
}

function showBounty() {
	if (xmlHttp.readyState == 2) {
	}
	
	if (xmlHttp.readyState == 4) {
		var bountyval = xmlHttp.responseText;
		if (bountyval=="Y") {
			loadNewFile("q4/q4yes.html","boxcontent");
		} else if (bountyval=="N") {
			loadNewFile("q4/q4no.html","boxcontent");
		} else {
			document.getElementById("error").innerHTML = bountyval;
			document.getElementById("q4nothanks").style.display = "none";
		}
	}
}

function q4bountyclose() {
	ostamp = document.getElementById("ostamp");
	boxcontent = document.getElementById("boxcontent");
	ostamp.style.display = "block";
	boxcontent.innerHTML = "<a href=\"100back.pdf\" style=\"font-size:62px;font-weight:bold;line-height:46px;color:#d52500;text-decoration:none;\" onclick=\"q4bountyshow();return false;\">$300</a><br /><a href=\"100back.pdf\"  style=\"line-height:18px;font-weight:bold;color:#d52500;\" onclick=\"q4bountyshow();return false;\">BACK</a><br /><span style=\"line-height:12px;\">+</span><br />3 MONTHS FREE<br /><span style=\"font-size:10;line-height:8px;\"><a href=\"http://www.bettersat.com\" style=\"text-decoration:none;hover:none;color:black;cursor:text;\">YOUR</a> <a href=\"http://www.dishpronto.com/home/dnt2/\" style=\"text-decoration:none;hover:none;color:black;cursor:text;\">CHOICE OF</a></span><br /><div style=\"width:170px;margin:0px auto;\"><img src=\"/images/hbofrnt.gif\" alt=\"HBO\" /><img src=\"/images/cinemaxfrnt.gif\" alt=\"Cinemax\" /><br /><img src=\"/images/showtimefrnt.gif\" alt=\"Showtime Unlimited\" /><img src=\"/images/starzfrnt.gif\" alt=\"Starz Super Pak\" /></div>";
}

function loadNewFile(url, target){
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		req = new ActiveXObject("Microsoft.XMLHTTP");
	}
	if (req != undefined) {
		req.onreadystatechange = function() {loadNewFileDone(url, target);};
		req.open("GET", url, true);
		req.send("");
	}
}

function loadNewFileDone(url, target) {
	if (req.readyState == 4) {
		if (req.status == 200) {
			document.getElementById(target).innerHTML = req.responseText;
		}
	}
}