﻿
function trim(str) 
{
    str = str.replace(/^\s+/, '');
    for (var i = str.length - 1; i > 0; i--) 
    {
        if (/\S/.test(str.charAt(i))) 
        {
	        str = str.substring(0, i + 1);
	        break;
        }
    }
    return str;
};

function default_value(content)
{
    if (trim(content.value) == content.defaultValue)
    {
        content.value = '';
    }
};

function new_value(content)
{
    if (trim(content.value) == '')
    {
        content.value = content.defaultValue;
    }	
};

function OnModalOkay()
{
    window.location = '/Default.aspx';
};

function HideTooltip()
{     
    var tooltip = $find("UserSelectionToolTip");
    if (tooltip) 
        tooltip.hide();
}

function CloseObject(obj) {
    var itemToClose = document.getElementById(obj);
    $("#" + itemToClose).hide();
}

