﻿function StartPage() {
    window.defaultStatus='Welcome to the Truro Council on Aging';
}
function SendMail(name, subject){
    document.location.href='mailto:'+name+'@truro-ma.gov?subject='+subject;
}
function FooterWrite(){
var today_date = new Date();
var year = today_date.getFullYear();
var last_change_length = document.lastModified.length;
var last_change = document.lastModified.substr(0, last_change_length -3);
var cText='<hr size="2" color="#000FF" width="95%" /><p class="Footer">Questions, Comments or Suggestions: <a href="mailto:coa@truro-ma.gov?subject=Comment from Web Site: ">webmaster</a><br />Copyright&copy; ' + year +' Truro Council on Aging - All Rights Reserved<br />Last Page Update: ' + last_change + '</p>';
document.write(cText);
}
function PDFOpen(Location, GoogleAnPath){
//OpenPDFs in new window and count them
	w=window.open(Location,'FromTruro', 'resizable=1, scrollbars=1, height=768,width=800');
	pageTracker._trackPageview('/Documents/' + GoogleAnPath);
	w.focus();
}

function Popup(Url, Features, Replace){
    window.open(Url,'random', Features);
    return;
}
// Open file in Window, but skip select option
function OpenChoice(FiletoOpen, LogEntry) {
    if (FiletoOpen != '') {
        pageTracker._trackPageview(LogEntry);
        if (FiletoOpen.indexOf("http") >= 0) {
            window.open(FiletoOpen);
        }
        else {
            location.href = FiletoOpen;
        }
    }
}
//Open NameURL in new window if not on our site
function OpenDoc(NameURL){
    if (NameURL != ''){
        if((NameURL.indexOf("http") >= 0) ||
        (NameURL.indexOf(".pdf")) >= 0){
            window.open(NameURL);
            }
        else{
            location.href=NameURL
            }
        }
}