function setCookie(c_name,value,exdays){
	var exdate=new Date();
	exdate.setDate(exdate.getDate() + exdays);
	var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
	document.cookie=c_name + "=" + c_value+";path=/";
}
		
function getCookie(c_name){
	var i,x,y,ARRcookies=document.cookie.split(";");
	// console.log(ARRcookies);
	for (i=0;i<ARRcookies.length;i++) {
		x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
		y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
		x=x.replace(/^\s+|\s+$/g,"");
		if (x==c_name){
			return unescape(y);
		}
	}
}
		
function checkCookie(){
	var ab_document_location = getCookie("ab_document_location");
	console.log(ab_document_location);
	var document_string = "";
	if (ab_document_location != null && ab_document_location != ""){
		
		document_string += 'Click <a target="_blank" href="';
		document_string += ab_document_location;
		document_string += '">here</a> to download the documents!';
		
		setCookie("ab_document_location","",1);	
	}else{
		// document_string += 'There are some technical difficulties. The forms will be emailed to you.<br /><br /> Sorry for the inconvenience.';
		document_string += 'Fill out a form to download these files.';
	}
	$(".rw_callout_txt_nopic").html(document_string);
}