// JavaScript Document
function deleteItem(url)
{
	var x=confirm("Are you sure you want to delete the selected item?")
	if(x){window.document.location.href=url}
	return false
}
function setTR(trId,chkId)
{
	if(document.getElementById(chkId).checked) 	
		document.getElementById(chkId).checked = false
	else
		document.getElementById(chkId).checked = true	
}

function validateEmail(emailId)
{
	var emailFilter=/^.+@.+\..{2,3}$/
	var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
		
	var x = document.getElementById(emailId).value
		
	if(x == ""){		
		document.getElementById(emailId).focus()
		document.getElementById(emailId).style.borderColor = "#FF0000"
		document.getElementById(emailId).style.borderWidth = 1
		document.getElementById(emailId).select()
		return false
	}
	else if(!emailFilter.test(x)){
		alert("please enter a valid email address.\n")
		return false
	}	
	else if(x.match(illegalChars)){	
		alert("Email address contains illegal characters.\n")
		return false
	}
	return true
}

