﻿function GetTitle()
{
    if (document.title.length > 0)
    {
        return document.title;
    }
    else
    {
        return "";
    }
}

function SetFormAction(action)
{
    document.forms[0].action = action;
}

function ResetFormAction()
{
    document.forms[0].action = location.pathname + escape(location.search)
}

function GetKeyCode(e)
{
    var event = e ? e : window.event;

    return event.keyCode;
}

function ClickButton(e, buttonId)
{
    if (GetKeyCode(e) == 13)
    {
        if ($("#" + buttonId).length > 0)
        {
            $("#" + buttonId).click();
        }

        return false;
    }
}

function LogoMouseOver()
{
    if ($('#imgHome').length)
    {
        $('#imgHome').css('visibility', 'visible');
    }
    else if ($('#imgHomeSignedIn').length)
    {
        $('#imgHomeSignedIn').css('visibility', 'visible');
    }
    else if ($('#imgHomeNotSignedIn').length)
    {
        $('#imgHomeNotSignedIn').css('visibility', 'visible');
    }
}
function LogoMouseOut() 
{
    if ($('#imgHome').length)
    {
        $('#imgHome').css('visibility', 'hidden');
    }
    else if ($('#imgHomeSignedIn').length)
    {
        $('#imgHomeSignedIn').css('visibility', 'hidden');
    }
    else if ($('#imgHomeNotSignedIn').length)
    {
        $('#imgHomeNotSignedIn').css('visibility', 'hidden');
    }
}

function Expand(object)
{
	if ($('#' + object).css('display') == 'none')
	{
	    $('#' + object).show('blind', 'fast');
	}
	else
	{
	    $('#' + object).hide('blind', 'fast');
	}
}
function Contract(object)
{
    $('#' + object).hide('blind', 'fast');
}

function ImageButtonSearch_ClientClick()
{
    return (document.getElementById('TextBoxSearch').value.length > 0);
}
