//------------------------------------------------------------------------------------------------------------
//following 2 function performed for control panel. to change tr color 
	function changeColor(value)
	{
		document.getElementById(value).className="trChangeBackgroundColor";
	}
	//------------------------------------------------------------------------------------------------------------
	function defualtColor(value)
	{
		document.getElementById(value).className="trDefualtBackgroundColor";
	}
//------------------------------------------------------------------------------------------------------------
//following function performed for control panel file name is user_authorities.php work show hide table and change arrows
	function makeActive(id,arrow_s)
	{
		if (document.getElementById)
		{
			if(document.getElementById(id).style.display == 'none')
			{
			document.getElementById(arrow_s).src = "img/caret-t.gif";
			document.getElementById(id).style.display = 'block';
			} 
			else 
			{
				document.getElementById(arrow_s).src = "img/caret-d.gif";
				document.getElementById(id).style.display = 'none';
			}
		}
	}
//------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------
//following function use for control panel for sub group combo hide and show
	function showhide(id)
	{
		if(document.getElementById(id))
		{
			if(document.getElementById(id).style.display == 'none')
			{
				document.getElementById(id).style.display = 'block';
			}
			else
			{
				document.getElementById(id).style.display = 'none';
			}
		}
	}
//------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------
//when user delete any row
	function delete_row(next_url)
	{
		if(confirm("Are you sure want to delete") == true)
		{
			location.href=next_url;
		}
	}
	
	function delete_yesno()
	{
		return confirm("Are you sure want to delete?");
	}

	function block_yesno()
	{
		return confirm("Are you sure want to block?");
	}

	function enable_yesno()
	{
		return confirm("Are you sure want to enable?");
	}

//------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------	
	function chkAllList($id,$val)
	{
		var $table = document.getElementById($id);
		var $cell = $table.getElementsByTagName("input");
		for($i=0;$i < $cell.length;$i++)
		{
			if($val == true)
			$cell[$i].checked=true;
			else
			$cell[$i].checked=false;
		}
	}
//------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------
	function url($filename)
	{
		window.location.href = $filename;	
	}
//------------------------------------------------------------------------------------------------------------
	function isNumber(value)
	{
		var value = value;
		if(value.length < 1) { return 0; }
		var anum=/(^\d+$)|(^\d+\.\d+$)/
	
		if(value.match(anum))
		{
			return 1;
		}
		else
		{
			return 0;
		}	
	}
	
	function setParentLocation($id)
	{
		this.parent.location.href = $id;
	}
	
	/*
	function setIFrameFile($frame_id,$filename)
	{
		document.getElementById($frame_id).src = $filename;
	}
	*/
	
	function setIFrameFileAdmin($frame_id,$filename,$id)
	{
		if($id > 0)
			document.getElementById($frame_id).src = $filename;
	}

	function ChangeFrameLinkColor(idd)
	{
		var $table = document.getElementById("links");
		var $cell = $table.getElementsByTagName("a");
		for($i=0;$i < $cell.length;$i++)
		{
			if($cell[$i].id == idd)
				document.getElementById($cell[$i].id).className="LinkBlackBold";
			else
				document.getElementById($cell[$i].id).className="LinkBlue";
		}
	}
