function delConfirm()
{
	return window.confirm('Are you sure you want to delete this?');
}


function isVisible(id)
{
	return $('#' + id).is(':visible');
}

function isHidden(id)
{
	return $('#' + id).is(':hidden');
}


function inArray(needle,haystack)
{
	hayStack=hayStack.join("|||");
	return (hayStack.indexOf("|||" + needle + "|||") >=0);
}


//Capitalizes first letter of string
function ucFirst(string)
{
    return string.charAt(0).toUpperCase() + string.slice(1);
}

function replaceAll(find, replace, str) {
  return str.replace(new RegExp(find, 'g'), replace);
}

function trim(str, chars)
{
    if (! str)
        return str;
	return ltrim(rtrim(str, chars), chars);
}

function ltrim(str, chars)
{
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}

function rtrim(str, chars)
{
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}

function isset(field)
{
    return (typeof field != "undefined");
}

/**
 * Pass on the name of a group of radio options to this function, and get the value of the
 * selected radio option
 */
function getRadio(radioName)
{
    var selector = 'input[name="' + radioName +'"]:checked';
    return $(selector).val();
}
