(document.getElementById) ? dom = true : dom = false;
var y1 = 200;   // change the # on the left to adjuct the Y co-ordinate
 
function hideIt() {
  if (dom) {document.getElementById("layer1").style.visibility='hidden';}
  if (document.layers) {document.layers["layer1"].visibility='hide';} }
 
function showIt() {
  if (dom) {document.getElementById("layer1").style.visibility='visible';}
  if (document.layers) {document.layers["layer1"].visibility='show';} }
 
function placeIt() {
 if (dom && !document.all) {document.getElementById("layer1").style.top = window.pageYOffset + (window.innerHeight - (window.innerHeight-y1))}
  if (document.layers) {document.layers["layer1"].top = window.pageYOffset + (window.innerHeight - (window.innerHeight-y1))}
  if (document.all) {document.all["layer1"].style.top = document.body.scrollTop + (document.body.clientHeight - (document.body.clientHeight-y1));}
  window.setTimeout("placeIt()", 10); 
  }
  
  // Use this function to retrieve a cookie
function getCookie(name) {
 var cname=name+"=";
 var dc=document.cookie;
  if(dc.length >0){
   begin=dc.indexOf(cname);
   if  (begin !=-1){
   begin += cname.length;
   end=dc.indexOf(";", begin);
   if (end == -1) end=dc.length;
 return unescape(dc.substring(begin,end));
}}}
 

// This function checks the state of the cookie and opens the layer/window if the values are null or later
function checkCookie(){
 if(getCookie("RFGsurvey")==null) {placeIt(), showIt();
 return null;
}}
 
// Function to actually open the survey and set the cookie accordingly
function makeRemote(){
remote=window.open("","remotewin","scrollbars=yes,toolbar=yes,menubar=yes,status=yes,resizable=yes,width=750,height=400");
remote.location.href="http://www.raddon.com/FS/nsurvey.aspx?surveyid=33441f9e7e84b9294b742de69c32b97";
if(remote.opener==null)remote.openr=window;
remote.opener.name="opener";
var exp=new Date();
exp.setTime(exp.getTime()+(1000*60*60*24*31));
setCookie("RFGsurvey", "done", exp);
hideIt();
}
 
// Function to disable popup for at least 1 month 
function toggleNo(){
var exp=new Date();
exp.setTime(exp.getTime()+(1000*60*60*24*31));
setCookie("RFGsurvey", "nothanks", exp);
hideIt();
}
 
// Function to ask later - Cookie expires in 1 day
function toggleLater(){
var exp=new Date();
exp.setTime(exp.getTime()+(1000*60*60*24));
setCookie("RFGsurvey", "later", exp);
hideIt();
}
 
// This function to saves the cookie and uses the parameters passed to it. The domain attribute must be changed to match the hosting domain or the cookie will not be set due to browser security reasons
function setCookie(name, value, expires) {
document.cookie=name+"="+escape(value)+ ";path=/" + ((expires==null)? "" : ";expires=" +expires.toGMTString()+ ";domain=ascendfcu.org");
}
// -->
