﻿function bookmarksite() {
    var title = "Country Calling Codes";
    var url = window.location.protocol + "//" + window.location.host;
    var pathChunks = window.location.pathname.split("/");
    if (pathChunks.length > 2)
        url += "/" + pathChunks[1];
    if (window.sidebar) // firefox
        window.sidebar.addPanel(title, url, "");
    else if (window.opera && window.print) { // opera
        var elem = document.createElement('a');
        elem.setAttribute('href', url);
        elem.setAttribute('title', title);
        elem.setAttribute('rel', 'sidebar');
        elem.click();
    }
    else if (document.all)// ie
        window.external.AddFavorite(url, title);
}

function limitTextboxLength(textbox, maxLength) {
    try {
        if (textbox.value.length > (maxLength - 1))
            return false;
    }
    catch(e) {
    }
}
