// First looks for an existing cookie. If it exists, the user is redirected to 
// index2.php. Otherwise, a cookie is set.
// -- Chuck

function setfldbc() {
  var tmp = readCookie('fldbc');
  if(tmp==null) {
    createCookie('fldbc','Florida Online at Daytona State College',365);
  } else {
    window.location = '/index2.php';
  }
}

function setflget3() {
  var tmp = readCookie('flget3');
  if(tmp==null) {
    createCookie('flget3','Florida Online at Daytona State College',365);
    var so = new SWFObject('http://vc1.dbc.edu/flashcom/uploads/streams/_definst_/engage.swf','mpl','240','180','8');
    so.addVariable('width','240'); 
    so.addVariable('height','180'); 
    so.addVariable('file','http://vc1.dbc.edu/flashcom/uploads/streams/_definst_/engage.swf');
    so.addVariable('autostart','false');
    so.addVariable('showdigits','false');
    so.write('player');
  } else {
  }
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

