//set to expire on December 31, 2050 at 11:59:59
var expiration = new Date();
expiration.setTime(67*365*24*60*60*1000);

//find out if this is the users first visit
var FIRST_TIME = false;
if (getCookie('CF_first_time') == null) {FIRST_TIME=true;}

var SKIP=getCookie('CF_skip');

if ((SKIP!='true')&&(!ispopup)) {
	popUp=window.open('tri-flash.html','mywin','width=660,height=480,top=100,left=50,menubar=0,toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=1');
}


//reset()
function reset() { //to reset the cookie during testing
	setCookie('CF_skip', "false", expiration, '/')
	setCookie('CF_first_time', null , expiration, '/')
	FIRST_TIME=true;
}


function setCookie(name, value, expires, path) {
	document.cookie = name + "=" + escape(value) + 
	((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
	((path == null) ? "" : "; path=" + path);
}

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));
    } 
  }
  return null;
}

function adminProcess(){
	e=window.document.config;
	SKIP = e.skip.checked;
	setCookie('CF_skip', e.skip.checked, expiration, '/')
	setCookie('CF_first_time', "no" , expiration, '/')
	FIRST_TIME=false;
	if (SKIP) {
		alert("You will not see this intro the next time you visit.");
	}
}
