﻿// ------------------------------------------------------------------------------- //
// ----- misc-funtions.js - Misc website javascript functions -------------------- //
// ------------------------------------------------------------------------------- //
// ------------------------------------------------------------------------------- //
// ----- Created on v.0.1, May 5 2010 - Scott LaCoste ---------------------------- //
// ----- Updated on v.0.2, May 6 2010 - Scott LaCoste ---------------------------- //
// ------------------------------------------------------------------------------- //
// ------------------------------------------------------------------------------- //
// ----- This function replaces the version info in the footers of hte pages ----- //
function GetCurrentVersion()
{
     var Version = "Version 2.0.20110228.001";
     return Version;
};
// ------------------------------------------------------------------------------- //
// ----- This function inserts the server path into various pages ---------------- // 
function GetCurrentPath() 
{
    var sitepath = "";
    return sitepath;
}
// ------------------------------------------------------------------------------- //
// ----- This function submits form results with a text link vs. a button -------- //
function onClickSubmit(formname, sitepath, controller, action) {
    if (sitepath != "") {
        document.forms[formname].action = sitepath + "/" + controller + "/" + action;
        document.forms[formname].submit();
        return true;
    } else {
        document.forms[formname].action = "/" + controller + "/" + action;
        document.forms[formname].submit();
        return true;
    }
};
// ------------------------------------------------------------------------------- //
// ----- This function prompts the user to confirm an items deletion ------------- //
function confirmDelete() {
    var agree = confirm("Are you sure you wish to delete this item?");
    if (agree)
        return true;
    else
        return false;
};
// ------------------------------------------------------------------------------- //
// ----- This function refreshes the page on a shorebase context change ---------- //
function RefreshPage() {
    $(document).ready(function() {
        location.reload();
    });
}
// ------------------------------------------------------------------------------- //
// ----- 
