readCookie();

function readCookie() {

	var the_cookie = document.cookie;
	the_cookie = unescape(the_cookie);
	the_cookie_split = the_cookie.split(";");
		
	for (loop=0; loop<the_cookie_split.length; loop++) {
		var part_of_split = the_cookie_split[loop];
		var find_last = part_of_split.indexOf("last_visit");
		if (find_last!=-1) {
			break;
		}
	} // for
	var date_split = part_of_split.split("=");
	var last = date_split[1];
	var last_split = last.split(",");
		
	last_year=last_split[0];
	last_month=last_split[1];
	last_day=last_split[2];
	//var last_month_plus_one = parseInt(last_month) +1;

 		var currentTime = new Date();
 		var year = currentTime.getFullYear();
    		var month = currentTime.getMonth();
     		var day = currentTime.getDate();

		if (year==last_year && month==last_month && day==last_day){
			document.write("Today was your first visit here. Welcome! (Or you cleared you cookies recently)");
		} else {
			document.write("the last day you visited was: "+monName[parseInt(last_month)]+" "+last_day+", "+last_year)


		}

} // readcookie()

