
function ValidateEmail( email )
{
	pattern = /^[^()\x3c\x3e\x22@,;:\\.\[\]\x00-\x20\x7f-\xff]+(\.([^()\x22\x3c\x3e@,;:\\.\[\]\x00-\x20\x7f-\xff])+)*@[a-z0-9]+((\.|-)[a-z0-9]+)*\.[a-z][a-z]+$/i;
	return pattern.exec( email );
}

function _SetBoxes( targetForm, prefix, newValue )
{
	var itemCnt = targetForm.elements.length;
	var prfxLen = prefix.length;
	with( targetForm )
	{
		for( i = 0; i < itemCnt; i++ )
			if( elements[i].name.substring(0,prfxLen) == prefix ) elements[i].checked = newValue;
	}
	return true;
}

function CheckAllBoxes( targetForm, prefix )
{
	return _SetBoxes( targetForm, prefix, 'on' );
}

function UncheckAllBoxes( targetForm, prefix )
{
	return _SetBoxes( targetForm, prefix, '' );
}


function setListVars(targetForm, sortBy, sortOrder, showFrom) {
	with( targetForm ) {
		if( sortBy != '' )    sort_by.value = sortBy;
		if( sortOrder != '' ) sort_order.value = sortOrder;
		if( showFrom > -1 ) sort_order.show_from = showFrom;
		submit();
	}
}
