function getRefName() {
	
	var cookies = document.cookie;
	
	if(cookies.indexOf('lcol')!= -1) {
	
		//This entire if statement was blank once
		var date = new Date();
		date.setTime(date.getTime()+(7*24*60*60*1000));
		var expires = '; expires='+date.toGMTString();
		document.cookie = 'lcol=' + document.referrer + '; expires=' + date + '; path=/'
		}
	
	else {
	
		var date = new Date();
		date.setTime(date.getTime()+(7*24*60*60*1000));
		var expires = '; expires='+date.toGMTString();
		document.cookie = 'lcol=' + document.referrer + '; expires=' + date + '; path=/'
		}
		
	
	}
	
function goTrack() {

	newRef = document.referrer;
	testCookie('lcol');
	cookiePath = cookieRef + ' --> ' + newRef;
			
	var date = new Date();
	date.setTime(date.getTime()+(7*24*60*60*1000));
	var expires = '; expires='+date.toGMTString();
	document.cookie = 'lcol=' + cookiePath + '; expires=' + date + '; path=/'
	
	
	}
	
	
	
/* This is the old function readCookie(cookieName) {
	
 var theCookie=""+document.cookie;
 var ind=theCookie.indexOf(cookieName);
 if (ind==-1 || cookieName=="") return ""; 
 var ind1=theCookie.indexOf(';',ind);
 if (ind1==-1) ind1=theCookie.length;
 cookieRef = theCookie.substring(ind+cookieName.length+1,ind1);
 inputRef = document.webnewaccount.refpage;
 inputRef.value = cookieRef;
 alert(cookieRef);
 
 //refInput = document.getElementById('refHolder');
 //refOne = document.createElement('input');
 //refOne.setAttribute('type', 'hidden');
 //refOne.setAttribute('value', 'test');
 //refInput.appendChild(refOne);
} */

function testCookie(cookieName) {
	
var theCookie=""+document.cookie;
 var ind=theCookie.indexOf(cookieName);
 if (ind==-1 || cookieName=="") return ""; 
 var ind1=theCookie.indexOf(';',ind);
 if (ind1==-1) ind1=theCookie.length;
 cookieRef = theCookie.substring(ind+cookieName.length+1,ind1);
 //inputRef = document.webnewaccount.refpage;
 //inputRef = document.getElementById('refpage');
 //inputRef.value = cookieRef;
 
 return(cookieRef);
 
}	

function readCookie(cookieName) {
	
var theCookie=""+document.cookie;
 var ind=theCookie.indexOf(cookieName);
 if (ind==-1 || cookieName=="") return ""; 
 var ind1=theCookie.indexOf(';',ind);
 if (ind1==-1) ind1=theCookie.length;
 cookieRef = theCookie.substring(ind+cookieName.length+1,ind1);
 inputRef = document.signup.refpage;
 inputRef.value = cookieRef;
 

 
}

	

