﻿$(document).ready(function()
{
    if ($('.round').length > 0)
        $('.round').corner('10px');

    $('p.icons a').hover(
		function() { $(this).addClass('ui-state-hover'); },
		function() { $(this).removeClass('ui-state-hover'); }
		);

    if (window.fnPageLoaded)
        fnPageLoaded();

    if (window.fnScriptFileInitialize)
        fnScriptFileInitialize();
});

function fnSetClass(el, className)
{
    $(el).attr('class', className);
}

function fnOpenWindow(url, width, height)
{
    window.open(url, null, "top=45,left=5,width=" + width + ",height=" + height + ",toolbar=no,location=no,scrollbars=yes,resizable=yes");
    return false;
}

function fnRefresh(val)
{
    if (arguments.length == 1)
    {
        var hidden = document.getElementById('bnRefreshValue');
        hidden.value = val;
    }

    var bn = document.getElementById(_pageContentId + '_bnRefresh');
    if (bn)
        bn.click();
}

function fnBubble(el, id)
{
    var pos = $(el).position();
    $container = $('#' + id);
    $container.css({ top: pos.top + $(el).height(), left: pos.left })
                .show();

    var handle = this;
    $container.bind('click', function(event)
    {
        $container.fadeOut();
    });

    return false;
}

function fnShowMessage(id, msg, timer)
{
    var $el = $('#' + id);
    if (msg.length > 0)
        $el.html(msg);
    $el.show();

    setTimeout(
        function()
        {
            $el.fadeOut();
        }, timer);
}
