
function showBlock(blockId, show)
{
	block = document.getElementById(blockId);
	if (block != null)
	{
		if (show)
			block.style.display = 'block';
		else
			block.style.display = 'none';
	}
}

function showTable(tableId, show)
{
	table = document.getElementById(tableId);
	if (table != null)
	{
		if (show)
			table.style.display = 'table';
		else
			table.style.display = 'none';
	}
}

function setInputValue(inputId, value)
{
	input = document.getElementById(inputId);
	input.value = value;
}

function publish(table, id, value)
{
	document.location.href=path+"&task=publish&id="+id+"&table="+table+"&publish="+value;
}

function preloadImages(arrImages, loadImages)
{
	imagesLoaded = new Array();
	
	if(loadImages)
	{
		for (i=0; i<arrImages.length; i++)
		{
			imagesLoaded[i] = new Image();
			imagesLoaded[i].src = arrImages[i];
		}
	}
	
	loaded = true;
	for (i=0; i < imagesLoaded.length; i++)
		if (!imagesLoaded[i].complete)
		{
			loaded = false;
			break;			
		}
	if (!loaded)
		setTimeout('preloadImages(arrImages, false)',1000);					
}
