﻿//=================================================================================================
//== Global Javascript Library 
//=================================================================================================
//== Author: Nick Koier 
//== Synopsis: Provides client-side functionality available to all the pages in the website
//=================================================================================================

var _rootURL = "http://www.bfcloans.com";
function fnClearLP(e)
{
    if(e.altKey)
        window.location.href = _rootURL + "/Default.aspx?ClearPad=true";
}  

function addBookmark(title, url)
{
    if (document.all)
        window.external.AddFavorite(url, title);
    else if (window.sidebar)
        window.sidebar.addPanel(title, url, "")
}


//= Adds "format" functionality identical to String.format() in .Net
String.prototype.format = function()
{
    var str = this;
    for(var i=0;i<arguments.length;i++)
    {
        var re = new RegExp('\\{' + (i) + '\\}','gm');
        str = str.replace(re, arguments[i]);
    } 
    return str;
}

