
<!-- Begin Set Cookie

//LOOKS FOR THE COOKIE AND IF NOT FOUND LAUNCHES THE SURVEY FOR RANDOM USERS
//WITH A PROBABIITY THAT 1/2 OF USERS WITH COOKIES ENABLIED LANDING ON PAGE WILL BE PROMPTED


function checkCookie() {
var testuser = getCookie('mfrsurvey');
	if (testuser != "takesurvey") {
		var userNum = 10; 
		var statNum = 10; 
		var rndNum; 
		rndNum = Math.floor(Math.random()*statNum); 
		if ( rndNum <= userNum ){ 
			showIt();
		}
	}
}

function getCookie(name){
	if (document.cookie.length>0){
	  c_start=document.cookie.indexOf(name + "=");
	  if (c_start!=-1){
	    c_start=c_start + name.length+1;
	    c_end=document.cookie.indexOf(";",c_start);
	    if (c_end==-1) c_end=document.cookie.length;
	    return unescape(document.cookie.substring(c_start,c_end));
	    }
	  }
return "";
}

//SETS THE COOKIE WHEN USER REPLIES

function setCookie(name,value,exp)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+exp);
document.cookie=name+ "=" +escape(value)+
((exp==null) ? "" : ";expires="+exdate.toGMTString());
}

//THIS PLACES, LAUNCHES AND HIDES THE SURVEY

// change the # of y1 to adjuct the Y co-ordinate, the x co-ord is changed in the layer div left property
var y1 = 200;   
(document.getElementById) ? dom = true : dom = false;

function placeIt() {
  if (dom && !document.all) {document.getElementById("survey").style.top = window.pageYOffset + (window.innerHeight - (window.innerHeight-y1)) + "px";}
  if (document.all) {document.all["survey"].style.top = document.documentElement.scrollTop + (document.documentElement.clientHeight - (document.documentElement.clientHeight-y1)) + "px";}
  window.setTimeout("placeIt()", 100); }

function hideIt() {
  if (dom) {document.getElementById("survey").style.visibility='hidden';}
}

function showIt() {
  if (dom) {document.getElementById("survey").style.visibility='visible';}
}
// -->



