function cookiesEnabled(){
	SetCookie ('test','testvalue',90,'/');
	if(GetCookie('test') != null) {
		return true;
	}else{
		return false;
	}
}

function GetCookie(NameOfCookie){
    if (document.cookie.length > 0) {              
    begin = document.cookie.indexOf(NameOfCookie+"=");       
    if (begin != -1) {           
      begin += NameOfCookie.length+1;       
      end = document.cookie.indexOf(";", begin);
      if (end == -1) end = document.cookie.length;
        return unescape(document.cookie.substring(begin, end));
    } 
  }
  return null;
}

function SetCookie (name, value, expiredays, path, domain, secure) {
var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
      document.cookie = name + "=" + escape(value) +
        ((expiredays) ? "; expires=" + ExpireDate.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");}

function delCookie (NameOfCookie) {
  if (GetCookie(NameOfCookie)) {
      SetCookie(NameOfCookie,'',-365,"/");
  }
}

function getInfo () {
	var theForms = document.getElementsByTagName("form");
	for(var i=0;i<theForms.length;i++){
		if (typeof theForms[i].fullname != "undefined"){
			try{if(GetCookie('BradName') != null) theForms[i].fullname.value = GetCookie('BradName');}catch(err){}
		}
		if (typeof theForms[i].fname != "undefined"){
			try{if(GetCookie('BradFirstName') != null) theForms[i].fname.value = GetCookie('BradFirstName');}catch(err){}
		}
		if (typeof theForms[i].lname != "undefined"){
			try{if(GetCookie('BradLastName') != null) theForms[i].lname.value = GetCookie('BradLastName');}catch(err){}
		}
		if (typeof theForms[i].title != "undefined"){
			try{if(GetCookie('BradTitle') != null) theForms[i].title.value = GetCookie('BradTitle');}catch(err){}
		}
		if (typeof theForms[i].email != "undefined"){
			if(GetCookie('BradEmail') != null) try{theForms[i].email.value = GetCookie('BradEmail');}catch(err){}
		}
		if (typeof theForms[i].company != "undefined"){
			if(GetCookie('BradFirm') != null) try{theForms[i].company.value = GetCookie('BradFirm');}catch(err){}
		}
		if (typeof theForms[i].street != "undefined"){
			if(GetCookie('BradAddress') != null) try{theForms[i].street.value = GetCookie('BradAddress');}catch(err){}
		}
		if (typeof theForms[i].city != "undefined"){
			if(GetCookie('BradCity') != null) try{theForms[i].city.value = GetCookie('BradCity');}catch(err){}
		}
		if (typeof theForms[i].state != "undefined"){
			if(GetCookie('BradState') != null) try{theForms[i].state.value = GetCookie('BradState');}catch(err){}
		}
		if (typeof theForms[i].zipcode != "undefined"){
			if(GetCookie('BradZip') != null) try{theForms[i].zipcode.value = GetCookie('BradZip');}catch(err){}
		}
		if (typeof theForms[i].phone != "undefined"){
			if(GetCookie('BradPhone') != null) try{theForms[i].phone.value = GetCookie('BradPhone');}catch(err){}
		}
	}
}

function setInfo(theForm) {
	if (typeof theForm.fullname != "undefined") SetCookie ('BradName',theForm.fullname.value,90,'/');
	if (typeof theForm.fname != "undefined") SetCookie ('BradFirstName',theForm.fname.value,90,'/');
	if (typeof theForm.lname != "undefined") SetCookie ('BradLastName',theForm.lname.value,90,'/');
	if (typeof theForm.title != "undefined") SetCookie ('BradTitle',theForm.title.value,90,'/');
	if (typeof theForm.email != "undefined") SetCookie ('BradEmail',theForm.email.value,90,'/');
	if (typeof theForm.company != "undefined") SetCookie ('BradFirm',theForm.company.value,90,'/');
	if (typeof theForm.street != "undefined") SetCookie ('BradAddress',theForm.street.value,90,'/');
	if (typeof theForm.city != "undefined") SetCookie ('BradCity',theForm.city.value,90,'/');
	if (typeof theForm.state != "undefined") SetCookie ('BradState',theForm.state.value,90,'/');
	if (typeof theForm.zipcode != "undefined") SetCookie ('BradZip',theForm.zipcode.value,90,'/');
	if (typeof theForm.phone != "undefined") SetCookie ('BradPhone',theForm.phone.value,90,'/');
}