/* SESSION EXPIRATION INFO */

/*function SessionExpiration()
{
    alert("Your session has expired. Please log in again.");
    window.location = mainurl;
}*/

/* debug top bar */
function DebugOpen()
{
    jQuery('#Debug').height('100px');
    jQuery('#Debug').width('100%');
}

function DebugClose()
{
    jQuery('#Debug').height('20px');
    jQuery('#Debug').width('20px');
}

function window_open(url, width, height)
{
    win = window.open(url, '', 'toolbar=0, width=' + width + ',height=' + height + ',left=10,top=10,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1');
}

function SelectAllCheckboxes(v)
{
    if(v == true)
    {
        jQuery(':input').attr('checked', true);
    }
    else
    {
        jQuery(':input').attr('checked', false);
    }
}

/* MUTLIACTION CONTROL */
function CheckMultiAction()
{
    var checked = 0;
    jQuery('#TicketList tr').each(function() {
        if(jQuery('input').is(':checked'))
        {
            checked++;
        }
    });

    if(checked == 0)
    {
        alert('Select tickets by checking checkboxes and choose action for them.');
        return false;
    }
    else
    {
        return true;
    }
}

/* IE HACK */
function HideMultiActionType()
{
    jQuery('MultiActionType').hide();
}

function ShowMultiActionType()
{
    jQuery('#MultiActionType').show();
}

/* http://www.quirksmode.org/js/mailcheck.html - checkMail function */

function checkMail(email)
{
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if (filter.test(email))
	{
            return true;
	}
	else
	{
            return false;
	} 
}

