//  Takes a Unix timestamp and outputs user's local time
function OutputLocalTime (Timestamp, DateType, TimeType) {
		var Output = "";
		var DaysArray = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
		var MonthsArray = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
		var LocalDateObj = new Date(Timestamp * 1000);
		if (arguments.length < 2) {
			 DateType = "short";
		} 
		LocalYear = LocalDateObj.getYear();
		LocalMonthString = MonthsArray[LocalDateObj.getMonth()];
		LocalMonthNum = LocalDateObj.getMonth() + 1;
		LocalDayString = DaysArray[LocalDateObj.getDay()];
		LocalDate = LocalDateObj.getDate();
		LocalMilitaryHour = LocalDateObj.getHours();
		LocalHour = LocalMilitaryHour;
		LocalHalf = "AM";
		if (LocalHour > 11) {
			 LocalHalf = "PM";
		}
		if (LocalHour > 12) {
			 LocalHour = (LocalHour - 12);
		}
		if (LocalHour == 0) {
			 LocalHour = 12;
		}
		LocalMinutes = AddLeadingZero(LocalDateObj.getMinutes());
		LocalSeconds = AddLeadingZero(LocalDateObj.getSeconds());
		if (DateType == "short") {
			 Output += LocalMonthNum+"/"+LocalDate+"/"+LocalYear;
		} else if (DateType == "medium") {
			 Output += LocalMonthString+" "+LocalDate+", "+LocalYear;
		} else if (DateType == "long") {
			 Output += LocalDayString+", "+LocalMonthString+" "+LocalDate+" "+LocalYear;
		}
		if (arguments.length > 2) {
			 Output += " @ ";
			 if (TimeType == "standard") {
			 		Output += LocalHour+":"+LocalMinutes+" "+LocalHalf;
			 } else if (TimeType == "military") {
			 	  Output += LocalMilitaryHour+":"+LocalMinutes;
			 }
		}
		document.write(Output);
}

function AddLeadingZero (Number) {
				 if (Number < 10) {
				 		return "0" + Number;
				 } else {
				 	  return Number;
				 }
}
