// ———————————	DATE AND TIME

DateBoxFormat = "<div class=\"DateBox2\"><div class=\"DateBox3\">[MM]</div><div class=\"DateBox4\" style=\"padding-left: [ML]px\">[DD]</div></div>"
today = new Date(); TimeHrs = today.getHours(); TimeMin = today.getMinutes();
DateMth = today.getMonth()+1; DateDate = today.getDate(); DateYear = today.getYear(); DateDy = today.getDay();

if (TimeHrs > 12) { TimeHrs = TimeHrs - 12;
	if (TimeHrs == 12) { AmPm = "am"; } else { AmPm = "pm"; }
} else { if (TimeHrs == 12) { AmPm = "pm"; } else { AmPm = "am"; } }

if (TimeMin < 10) { TimeMin = "0" + TimeMin; }

DateMonth = [0,"January","February","March","April","May","June","July","August","September","October","November","December"];
DateDay = ["Sunday, ","Monday, ","Tuesday, ","Wednesday, ","Thursday, ","Friday, ","Saturday, "];
Brsr = navigator.appName;
if (Brsr=="Netscape") { if (DateYear < 99) { DateYear = DateYear + 2000; } else { DateYear = DateYear + 1900; } }

function CopyRtYr() { document.getElementById("CopyYr").innerHTML = DateYear; }

function TheDate() {
//	document.write(DateDay[DateDy] + DateMonth[DateMth] + DateDate + ", " + DateYear);

	DateBx = DateBoxFormat;
	MarginLt = ["",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
	if (DateDate < 10) { DateDate = "0" + DateDate; }

	if (navigator.appName.search(/explorer/i) != -1) {
		MarginLt = ["",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; }

	Re = /\[MM\]/; DateBx = DateBx.replace(Re, DateMonth[DateMth]);
	Re = /\[DD\]/; DateBx = DateBx.replace(Re, DateDate);
	Re = /\[ML\]/; DateBx = DateBx.replace(Re, MarginLt[DateDate]);

	document.getElementById("InDate").innerHTML = DateBx;
}

function InsertGenData() { CopyRtYr(); TheDate(); PutTop(); }


// ———————————	TOP LINK

function PutTop() { document.getElementById("InTop").innerHTML = "<div class=\"ToTopDiv\"></div><div class=\"ToTopLnk\" " +
	"onMouseOver=\"TOP(this)\" onMouseOut=\"TOP2(this)\" title=\"Go to top of page\" onClick=\"GoTop()\"><span class=\"ToTop\">Top</span></div>"; }
function TOP(a) { if (a.style) { a.style.cursor = "pointer"; a.style.backgroundColor = "#ddd"; } window.status = "Go to top of page"; return true; }
function TOP2(a) { if (a.style) { a.style.backgroundColor = "#fff"; } window.status = ""; return true; }
function GoTop() { window.scrollTo(0,0); }


// ———————————	DETAIL NOTES POPUP

NumDet = 1; Wide = 300; ContentType = "text"; t = 0;
DetailPopUp = "DetailNote1"; flag = 0;	//	t = setTimeout("EraseNotice()",100000);
function Notice() {
	if (flag == 0) { EraseNotice(); }

	if (navigator.appName.search(/explorer/i) != -1 || navigator.appVersion.search(/5.0/) != -1) {
		xCoord = document.body.scrollLeft; yCoord = document.body.scrollTop;
	} else { xCoord = self.pageXOffset; yCoord = self.pageYOffset; }

	DetailPopUp = "DetailNote" + NumDet; ClosePopUp = "CloseIt" + NumDet;
	xCoord = xCoord + (400 - Math.round(Wide/2));
	if (xCoord < 0) { xCoord = 0; }

	box = document.getElementById(DetailPopUp); box.style.left = xCoord; box.style.top = yCoord + 100;
	box.style.width = Wide; box.style.visibility = "visible"; box2 = document.getElementById(ClosePopUp);

	if (navigator.appName.search(/explorer/i) != -1 && ContentType == "image") { box2.style.width = Wide;
	} else { box2.style.width = Wide - 6; }

	t = setTimeout("Notice()",10); flag = 1;
}

function EraseNotice() {
	if (t != 0) { clearTimeout(t); }
	box = document.getElementById(DetailPopUp); box.style.visibility = "hidden";
}


// ———————————	GOOGLE ADSENSE CODE

function GglAds(ggl) { document.write("<script type=\"text/JavaScript\" src=\"/common/ggl/ggl.", ggl, ".js\"></script>"); }

function GglAds2() {
	if (location.href.search(/^http\:\/\/chrisdunmire/) == -1) {
		document.write("<script type=\"text/javascript\" ",
		"src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"></script>");
	} else {
		TPval = Math.round(google_ad_height/2 - 16); if (TPval < 0) { TPval = 0; }
		document.write("<div style=\"width: ", google_ad_width, "; height: ", google_ad_height,
		"; background-color: #fed; border: 1px solid #dcb; text-align: center\">",
		"<div style=\"position: relative; top: ", TPval, "\">", google_ad_width, "&#215;", google_ad_height, "<br />Google AdSense</div></div>");
	}
}


// ———————————	FACEBOOK "LIKE" ICON

function SiteWideFunction() {
	a = location.href; a = a.replace(/\//g, "%2F"); a = a.replace(/:/g, "%3A");

	document.write("<div style=\"padding: 15px 0 0 0\">",
	"<iframe src=\"http://www.facebook.com/plugins/like.php?href=", a, "&amp;layout=standard&amp;",
	"show_faces=false&amp;width=170&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=45\" ",
	"scrolling=\"no\" frameborder=\"0\" style=\"overflow: hidden; width: 170px; ",
	"height: 45px\" allowTransparency=\"true\"></iframe></div>");
}


// ———————————	BLOG DATE DIVIDER FORMAT, PLACE BLOG DIVIDER

BlogDateFormat = "<div class=\"BlgDots\">&#149;<span class=\"BlgDotGap\"></span>&#149; &#149; &#149; &#149; &#149; &#149; " +
"&#149; &#149; &#149; &#149; &#149; &#149; &#149; &#149; &#149; &#149; &#149; &#149; &#149;</div>" +
"<div class=\"BlgDots2\">&#149;<span class=\"BlgDotGap\"></span>&#149; &#149; &#149; &#149; &#149; &#149; " +
"&#149; &#149; &#149; &#149; &#149; &#149; &#149; &#149; &#149; &#149; &#149; &#149; &#149;</div><div class=\"BlgDateShad\"></div>" +
"<div class=\"BlgDate\"><div class=\"BlgDate2\">[MM] &#146;[YY]</div><div class=\"BlgDate3\" style=\"margin-left: [ML]px\">[DD]</div></div>"

function BlogDateDiv(m,d,y) {
	BlgDiv = BlogDateFormat;
	BlgMonth = [0,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
	MarginLt = ["",-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6]; dd = d;
	if (d < 10) { d = "0" + d; }

	if (navigator.appName.search(/explorer/i) != -1) {
		MarginLt = ["",-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2]; }

	Re = /\[MM\]/; BlgDiv = BlgDiv.replace(Re, BlgMonth[m]);
	Re = /\[DD\]/; BlgDiv = BlgDiv.replace(Re, d);
	Re = /\[YY\]/; BlgDiv = BlgDiv.replace(Re, y);
	Re = /\[ML\]/; BlgDiv = BlgDiv.replace(Re, MarginLt[dd]);

	document.write(BlgDiv);
}


