﻿// ReformingWorship Javascripts

// Main Functions

function headInfo(){
    document.write("<div class=\"All\"><div class=\"Banner\"><p>&nbsp;</p></div><div class=\"Utility\">");
    siteWideNav();
    document.write("</div><div class=\"Main\"><div class=\"Body\">");
}
function footInfo(){
    document.write("</div><hr />");
    // document.write("<div class=\"Foot\">");
    // siteWideNav();
    // bottom();
    // document.write("</div>");
    document.write("<div class=\"Context\">");
    // fileInfo();
    // document.write("<hr />");
    validator();
    document.write("</div></div>");
}
function contextInfo(){
}

// Called (Subordinate) Functions

function siteWideNav(){
document.write("<ul><li><a href=\"index.html\">Home</a></li>" +
        "<li><a href=\"branding.html\">Branding Work</a></li>" +
        "<li><a href=\"work.html\">Portfolio</a></li>" +
        "<li><a href=\"history.html\">History</a></li>" +
        "<li><a href=\"links.html\">Links</a></li>" +
        "</ul><ul>" +
        "<li><a href=\"http://reformingworship.org\" title=\"Reforming Worship\">reformingworship.org</a></li>" +
        "</ul>");
}
function bottom(){
document.write("<p class=\"Links\">Return to the <a href=\"#\">top</a> of " +
        "the page by striking &ldquo;home&rdquo; on your keyboard.</p>");
}
function fileInfo(){
document.write("<p class=\"ContextualHelp\">Info Center:<br />This page was last updated: " + 
        document.lastModified + ".</p><p class=\"FileInfo\">Permalink to this <a title=\"" +
        document.location + "\" href=\"" + document.location + "\">page</a>.</p>");
}
function validator(){
	var currentURL = String(document.location);
	var searchTest = currentURL.search(/command\/customer/);
	if(currentURL.search(/main\/work/) < 0){
		document.write("<p class=\"ContextualHelp\">If this page doesn’t " +
			"validate as at least <a href=\"http://validator.w3.org/check?" +
			"uri=referer\"><acronym title=\"eXtensible HyperText Markup " +
			"Language\">xhtml</acronym> 1.0 transitional</a>, please <a " +
			"href=\"mailto:david@socklint.com\">let me know</a>.</p>");
	}else{
		document.write("<p>because of this page’s use of an image map, it " +
			"does not validate as xhtml 1.1. If you know how to fix this " +
			"problem, please <a href=\"mailto:david@socklint.com?" +
			"Subject=Image Map Problem on " + document.location + "\">let me " +
			"know</a>.</p>");
	}
}
/**
    function textAds(){
    var totAds = 6;
    var ad = rnd(1,totAds)
    if (ad==1) {
    strHref="/main/commentaries/gill/index.html";
    strTxt="View our Gill library.";
    }
    if (ad==2) {
    strHref="/main/scriptures/kingjamesbible/index.html";
    strTxt="Read our King James Bible.";
    }
    if (ad==3) {
    strHref="/main/church/langley/index.htm";
    strTxt="Listen to our audio sermons.";
    }
    if (ad==4) {
    strHref="/main/standards/home/index.html";
    strTxt="See our standards library.";
    }
    if (ad==5) {
    strHref="/main/scriptures/scottishpsalter/index.html";
    strTxt="Use the Scottish Psalter.";
    }
    if (ad==6) {
    strHref="/main/scriptures/kingjamesbible/audio.html";
    strTxt="Download and listen to our Free <acronym title=\"MPEG Layer-3\">MP3</acronym> King James Bible.";
    }
    document.write("<p class=\"TextAds\"><a href=\"" + strHref + "\">" + strTxt + "</a></p>");
    }
    function rnd(a,b){
     return a + Math.floor(Math.random()*(b-a+1));
    }
 */

