// JavaScript Document\<script type="text/javascript">
function check(val,i)
{
	if(val != "false")
	{
		document.getElementById('check_option_'+i).value = 'false';
	}else{
		document.getElementById('check_option_'+i).value = 'true';
	}
		check_all(document.getElementById('check_option_'+i).value,i);
		return document.getElementById('check_option_'+i).value;
} 
	
function check_all(val,k)
{
	if(k == '1')
	{
		var user_name = document.getElementById('shared_user');
		if(val == 'true')
		{
			for (var i = gp_1_start-1; i < gp_1_end; i++) {
				user_name.options[i].selected = true;
			}
		}
		if(val == 'false')
		{
			for (var i = gp_1_start-1; i < gp_1_end; i++) {
				user_name.options[i].selected = false;
			}
		}
	}
	if(k == '2')
	{
		var user_name = document.getElementById('shared_user');
		if(val == 'true')
		{
 			for (var i = gp_2_start-1; i < gp_2_end; i++) {
				user_name.options[i].selected = true;
			}
		}
		if(val == 'false')
		{
			for (var i = gp_2_start-1; i < gp_2_end; i++) {
				user_name.options[i].selected = false;
			}
		}
	}
	if(k == '3')
	{
		var user_name = document.getElementById('shared_user');
		if(val == 'true')
		{
			for (var i = gp_3_start-1; i < gp_3_end; i++) {
				user_name.options[i].selected = true;
			}
		}
		if(val == 'false')
		{
			for (var i = gp_3_start-1; i < gp_3_end; i++) {
				user_name.options[i].selected = false;
			}
		}
	}
	if(k == '4')
	{
		var user_name = document.getElementById('shared_user');
		if(val == 'true')
		{
			for(var i = 0; i < user_name.length; i++){
			user_name.options[i].selected = true;
			}
		}
		if(val == 'false')
		{
			for(var i = 0; i < user_name.length; i++){
				user_name.options[i].selected = false;
			}
		}
	}	

}

function show_user()
{
	document.getElementById('group_of_in').style.display = 'none';
	document.getElementById('show_all_group').checked = false;
	var user_name = document.getElementById('shared_user_1');
		for(var i = 0; i < user_name.length; i++){
		user_name.options[i].selected = false;
		}
	document.getElementById('all_user_in').style.display = 'block';
}

function show_group()
{
	document.getElementById('all_user_in').style.display = 'none';
	document.getElementById('show_all_user').checked = false;
	document.getElementById('check_option_1').checked = false;
	document.getElementById('check_option_2').checked = false;
	document.getElementById('check_option_3').checked = false;
	document.getElementById('check_option_4').checked = false;
	document.getElementById('check_option_1').value = false;
	document.getElementById('check_option_2').value = false;
	document.getElementById('check_option_3').value = false;
	document.getElementById('check_option_4').value = false;
	var user_name = document.getElementById('shared_user');
		for(var i = 0; i < user_name.length; i++){
		user_name.options[i].selected = false;
		}
	document.getElementById('group_of_in').style.display = 'block';
}