﻿//Usage example
//this.TextBox("ContactDetailPhone").Title("My title message").Attr("onmouseover", "showTooltip(this.id)").Attr("onfocus", "showTooltip(this.id)")
function showTooltip(elementID) {
    $(document).ready(function() {
        $("#" + elementID).tooltip({
            // place tooltip on the right edge     
            position: "center right",
            // a little tweaking of the position     
            offset: [-2, 10],
            // use the built-in fadeIn/fadeOut effect     
            effect: "fade",
            // use this single tooltip element
            tip: '.tooltip',
            //show on click and remove on blur
            events: { input: 'focus, blur' }
        });
        //get rid of the title so it won't pop up on first mouseover
        document.getElementById(elementID).title = "";
    });
}
