function switchall(theElement) 
{
	var theForm = theElement.form;
	var i = 0;

	while(theForm[i].type == 'checkbox' && theForm[i].name != 'checkall') 
	{
		theForm[i].checked = theElement.checked;
		i++;
	}
}

var checkflag1234 = new Array(15);
checkflag1234[0] = 'false';
checkflag1234[1] = 'false';
checkflag1234[2] = 'false';
checkflag1234[3] = 'false';
checkflag1234[4] = 'false';
checkflag1234[5] = 'false';
checkflag1234[6] = 'false';
checkflag1234[7] = 'false';
checkflag1234[8] = 'false';
checkflag1234[9] = 'false';
checkflag1234[10] = 'false';
checkflag1234[11] = 'false';
checkflag1234[12] = 'false';
checkflag1234[13] = 'false';
checkflag1234[14] = 'false';

function checkall(formname, pos_from_start, pos_from_end, m)
{
	var t = document.forms[formname].length;
	var i = 0;
	
	//alert(pos_from_start + ' -> ' + pos_from_end + ' m = ' + m);
	
	if(checkflag1234[m] == 'false')
	{        
		for(i = pos_from_start; i < t - pos_from_end; i++)
		{
			document.forms[formname][i].checked = true;
		}
		checkflag1234[m] = 'true';
	}
	else
	{    
		for(i = pos_from_start; i < t - pos_from_end; i++)
		{
			document.forms[formname][i].checked = false;
		}
		checkflag1234[m] = 'false';
	}
		
	return false;
}

function checkblock(formname, pos_from_start, pos_to_fill, m)
{	
	var i = 0;
	
	//alert(pos_from_start + ' -> ' + pos_to_fill + ' m = ' + m);
	
	if(checkflag1234[m] == 'false')
	{        
		for(i = pos_from_start; i <= pos_to_fill; i++)
		{
			document.forms[formname][i].checked = true;
		}
		checkflag1234[m] = 'true';
	}
	else
	{    
		for(i = pos_from_start; i <= pos_to_fill; i++)
		{
			document.forms[formname][i].checked = false;
		}
		checkflag1234[m] = 'false';
	}
		
	return false;
}


function confirmbox(Question)
{
	return confirm(Question);
}
