var groupname;
var chkGroup;
function ManageLayer(id)
{	
	chkGroup = ClientIDPrefix + "CheckBox" + id;
	groupname = "Layer" + id;
	var strCurrentValue = document.all[ClientIDPrefix + "hdnLayers"].value;
	//var strPre = strTotal.substring(0,id)
	//var strPost = strTotal.substr(id + 1);
	//var CurrentValue;
	if(document.all[chkGroup].checked == true)
	{
					
		document.all[groupname].style.visibility = "visible";//.all["divLayers"].
		document.all[ClientIDPrefix + "hdnLayers"].value +=  id + "," ;		
	}
	else
	{
		document.all[groupname].style.visibility = "hidden";
		document.all[ClientIDPrefix + "hdnLayers"].value = strCurrentValue.replace(id + "," , "");		
	}
	
	//document.all["hdnLayers"].value = strPre + CurrentValue +  strPost 
}
