﻿function Tools() {
}

Tools.getInstance = function() {
    if (Tools.instance == null) {
        Tools.instance = new Tools();
    }

    return Tools.instance;
}

Tools.prototype.bookmark = function() {
    try {
        if (document.all) {
            window.external.AddFavorite(window.location, document.title);
        } else {
            alert("Sorry. Netscape users will have to bookmark manually by pressing <Ctrl-D>");
        }
    } catch (e) {
    }
}


Tools.prototype.mailTo = function() {
	var mailBody;
	var subject;

    try {
        mailBody = "Hi, take a look at this interesting home page at www.sonlinc.com:\n\r" + location.href;
        subject = "Tip about an interesting home page at Sonlinc " //+ document.title

        location.href = 'mailto:?subject=' + escape(subject) + '&body=' + escape(mailBody);
    } catch(e) {
    }
}

Tools.prototype.showSearch = function(flag) {
    if (flag) {
        document.getElementById("searchExposed").style.display = "block";
        document.getElementById("search").style.display = "none";
    } else {
        document.getElementById("search").style.display = "block";
        document.getElementById("searchExposed").style.display = "none";
    }
}

