﻿function ShowGoogleMap(pageID) {
    var iframe = document.getElementById("gmapIFrame");
    iframe.src = "/MapPage.aspx?pid=" + pageID;
    popupPAStatus.Show();
}

function KeyPressed() {
    if (window.event.keyCode == 13) {
        GetDirections();
        return false;
    }
}

var tday = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
var tmonth = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");

function GetClock() {
    d = new Date();
    nday = d.getDay();
    nmonth = d.getMonth();
    ndate = d.getDate();
    nyear = d.getYear();
    nhour = d.getHours();
    nmin = d.getMinutes();
    nsec = d.getSeconds();

    if (nyear < 1000) nyear = nyear + 1900;

    //            if (nhour == 0) { ap = " AM"; nhour = 12; }
    //            else if (nhour <= 11) { ap = " AM"; }
    //            else if (nhour == 12) { ap = " PM"; }
    //            else if (nhour >= 13) { ap = " PM"; nhour -= 12; }

    if (nmin <= 9) { nmin = "0" + nmin; }
    if (nsec <= 9) { nsec = "0" + nsec; }


    var ct = document.getElementById('clienttime');
    if (ct != null) {
        ct.innerHTML = "" + ndate + " " + tmonth[nmonth] + " " + " " + nyear + ", " + nhour + ":" + nmin + ":" + nsec + "" + ""
    }
}

function DownloadSecureFile(path) {
    if (window.showModalDialog) {
        window.showModalDialog(path, "SecureDownload", "dialogWidth:255px;dialogHeight:250px");
    } else {
        window.open(path, 'SecureDownload', 'height=255,width=250,toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no ,modal=yes');
    }
    //    var hid = document.getElementById('ctl00_ctl00_MainPanel_MainContentHolder_PageContent_ctrlDocLibrary_hidDownloadFile');
    //    hid.value = path;
    //    var btn = document.getElementById('ctl00_ctl00_MainPanel_MainContentHolder_PageContent_ctrlDocLibrary_btnSubmit');
    //    btn.click();
}
