/*
DIREKTE PUBLISERING BEHANDLING AV CHECKBOKSER.
Denne funksjonen går igjennom alle valgte annonser og artikler og utfører gitt action på disse.
*/
function submitChecked(Action, table, form) 
{ 
	if(table.all('chkSelect')!=null)
	{
		var idString=''; 
		if(table.all('chkSelect').length == null)
		{
			if(table.all('chkSelect').checked)
			{
				idString += table.all('chkSelect').value; 
			}
		}
		else
		{
			var i; 
			for(i = 0; i < table.all('chkSelect').length;i++)
			{
				if(table.all('chkSelect')(i).checked)
				{
					idString += table.all('chkSelect')(i).value; 
					idString += ','
				}
			}
		}
		form.action.value = Action; 
		form.ArtIdArray.value = idString; 
		
		//Hvis vi skal slette gir vi først en advarsel
		if(Action == 'Del')
		{
			if(idString != '')
			{
				if(confirm('Dette vil slette ALLE VALGTE artikler og annonser med følgende id permanent!\n' + idString))
				{
					form.submit();
				}
			}
		}
		else
		{		
			form.submit();
		}
	}
}

function checkAll(checked, table)
{
	var i; 
	for(i = 0; i < table.all('chkSelect').length;i++)
	{
		table.all('chkSelect')(i).checked = checked
	}
} 



		