﻿function popupWindow(evt, url, popupId, params)
{
    var wnd;
    wnd = window.open(url, popupId, params);
    wnd.focus();
    return false;
}

function showHelp(e, msg)
{   
    var html = '<div id="showCFHelp"></div>';
    $("body").append(html);
    
    var pos = $(e).position();
    var posx, posy; 
    
    posx = pos.left + $(e).outerWidth(true);
    posy = pos.top + $(e).outerHeight(true);
     
    var w, h; // width/height of help  
         
    $("#showCFHelp").html('<span>' + msg + '</span>');
    
    w = $("#showCFHelp").outerWidth(true);
    h = $("#showCFHelp").outerHeight(true);
    
    if ((posx + w) > $(window).width())
    {
        posx = posx - w;
        posx = posx - 15;
    }
    
    if ((posy + h) > $(window).height())
    {
        posy = posy - h;
    } 
    
    $("#showCFHelp").css("top",  posy + 'px').css("left", posx + 'px').css("z-index", "99999");
    $("#showCFHelp").css("visibility", "visible");
}

function hideHelp()
{
    $("#showCFHelp").remove();   
}
