function showFlash() {
	var cookie = readCookie("userChoice");
	if (cookie != null) return;
	$e("survey").style.display = "block";	
}
function runPopup() {
	// Generate Random Number 1-500
	var rand_no = Math.ceil( Math.random() * 500 );
	if (rand_no < 499) { return 1; 	}
	var cookie = readCookie("userChoice");
	if ($e("surveyHome") && cookie != null) {
		$e("hide300x250").style.display = "block";
	}
	else if ($e("surveyHome") && cookie == null) {
		$e("surveyHome").style.display = "block";
		$e("hide300x250").style.display = "none";
		setTimeout("showSurveyHtml()",2000); //show survey options form
	} else if ($e("survey") && cookie == null) {
		$e("survey").style.display = "block";
		setTimeout("showSurveyHtml()",2000); //show survey options form
	}		
	else {
		setTimeout("showFlash()", 7000);
	}
}
if (window.addEventListener) { window.addEventListener("load", runPopup, false) }
if (window.attachEvent) { window.attachEvent("onload", runPopup) }

//For all pages 
function storeReply(reply) {
	if (reply == "Yes") {
		createCookie("userChoice", reply, 30);
		window.open("http://www.marketingresearchresources.com/mrIWeb/mrIWeb.dll?I.Project=tim05208mr", "_blank");
	}
	if (reply == "No") {
		createCookie("userChoice", reply, 30);
	}
	if (reply == "Maybe" || reply == "close") {
		createCookie("userChoice", reply, 10);
	}
	if ($e("surveyHome")) {
		$e("surveyHome").style.display = "none";
		$e("hide300x250").style.display = "block";
		$e("hide300x250").getElementsByTagName("table")[0].style.display = "block";
		//$e("prpswf").getElementsByTagName("embed")[0].style.height = "250";
	}
	else  {
		$e("survey").style.display = "none";
	}
}
//called by surveyHome.swf on last frame
function showSurveyHtml(){
	$e('surveyHomeText').style.visibility='visible';
}