	function Item_Del() 
	{
		boxy = document.forms["my_form"].elements;
		max = boxy.length;
		count = 0;
		for (i=0; i<max; i++) 
		{
			if (boxy[i].checked && boxy[i].name == "checkbox_sel[]") 
			{
				count++;
			}
		}
		
		if (count > 0) 
		{
			if (confirm("To permanently delete selected items?")) 
			{
				return true;
			}
			else 
			{
				return false;
			}
		}
		else 
		{
			alert("No message selected.");
			return false;
		}
	}
	
	function askToDel() 
	{
		if (confirm("Do delete?")) 
		{
			return true;
		}
		else 
		{
			return false;
		}
	}
	
	function CheckAll()
	{
		for(var i = 0; i < document.forms["my_form"].elements.length; i++)
		{
			if(document.forms["my_form"].elements[i].name.substring(0,12) == "checkbox_sel") document.forms["my_form"].elements[i].checked = document.forms["my_form"].checkall.checked
		}
	}
	
	
	//*************************************************
	//	AJAX Functions
	
	var xmlHttp
	var checkbox_id
	
	function NotificationChange(str)
	{	
		xmlHttp=GetXmlHttpObject()
		checkbox_id=str

		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		} 
		var url="_AJAX_NotificationCheckBox.php"
		url=url+"?user_id="+str
		url=url+"&sid="+Math.random()
		xmlHttp.onreadystatechange=NotificationStateChanged
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	} 
	
	
	function NotificationStateChanged()
	{
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			document.getElementById(checkbox_id).checked=xmlHttp.responseText
			if(xmlHttp.responseText == true) alert("You will receive email notification on this user arrivals.")
			if(xmlHttp.responseText == false) alert("Email notification on this user arrivals was turned off.")
		}
	}
	
	
	function GetXmlHttpObject()
	{
		var xmlHttp=null;
		try
 		{
 			// Firefox, Opera 8.0+, Safari
 			xmlHttp=new XMLHttpRequest();
 		}
		catch (e)
 		{
 			// Internet Explorer
 			try
  		{
  			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  		}
  		catch (e)
  		{
  			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  		}
  	}
  	return xmlHttp;
  }
	