// handle prop5 var -->
// Randy: Gives the string passed in spaces instead of '+' or '%20' -->
function SpaceReplacer2(str) {
	if (str.match("%20")) str = str.replace(/%20/, ' '); //Decoding cookie's ISO-Latin space value
	if (str.match("%27")) str = str.replace(/%27/, "'"); //Decoding cookie's ISO-Latin apostrophe value
	if (str.match("%2C")) str = str.replace(/%2C/, ','); //Decoding cookie's ISO-Latin comma value
	if (str.match("%2D")) str = str.replace(/%2D/, '-'); //Decoding cookie's ISO-Latin dash value
	if (str.match("%2E")) str = str.replace(/%2E/, '.'); //Decoding cookie's ISO-Latin period value
	if (str.match("%5F")) str = str.replace(/%5F/, '_'); //Decoding cookie's ISO-Latin undescore value
	 
	return str;
}
// Randy changed to javascript to get html pages to work correctly
function readcookie2(cname) {
   cname = cname.toUpperCase() + "=";
   var cookiearr = document.cookie.split(";");
   for(var i=0;i<cookiearr.length;i++) {
       c = cookiearr[i];
       while (c.charAt(0) == " ") c = c.substring(1, c.length);
       if (c.indexOf(cname) == 0) return c.substring(cname.length, c.length);
   }
   return null;
}

function getProp5() {
	username = readcookie2("user_name");
	if(username){
		username = SpaceReplacer2(username);
	} else {	
		insert_prop5 = "anonymous";
	}
	return insert_prop5;
}
// end handle prop5

// handle prop6
function getProp6() {
	var d=new Date()
	var weekday=new Array(7)
	weekday[0]="sunday"
	weekday[1]="monday"
	weekday[2]="tuesday"
	weekday[3]="wednesday"
	weekday[4]="thursday"
	weekday[5]="friday"
	weekday[6]="saturday"
	return weekday[d.getDay()];
}

function getProp7() {
	var currentTime = new Date()
	var hours = currentTime.getHours(); 
	if(hours > 11){
		type = "pm";
	} else {
		type = "am";
	}
	if (hours == 0){
		hours = 12;
	} else if (hours > 12){	
		hours = hours-12;
	}
	var myTime = hours + type;
	return myTime;
}