/***************************************************************************************
 * Copyright (c) 2001-2004, NeoGrid Informática.  Todos os direitos reservados. 
 *
 * Os Programas desta Aplicação (que incluem tanto o software quanto a sua documentação) 
 * contém informações proprietárias da NeoGrid Informática; eles são licenciados de acordo 
 * com um contrato de licença contendo restrições de uso e confidencialidade, e são também 
 * protegidos pela Lei 9609/98 e 9610/98, respectivamente Lei do  Software  e  Lei  dos 
 * Direitos Autorais. Engenharia reversa, descompilação e desmontagem dos programas  são 
 * proibidos. Nenhuma parte destes  programas pode ser  reproduzida  ou  transmitida  de 
 * nenhuma forma e por nenhum meio, eletrônico ou mecânico,  por  motivo  algum,  sem  a 
 * permissão escrita da NeoGrid Informática.
 **************************************************************************************/
var NG_VERSION = "$PRODUCTVERSION$2.00$COMPONENTVERSION$0001$";
function showFileSize(){
	var size = calculateFileSizeHTML();
	var imglength = calculateFileSizeImages();
  var total = calculateFileSize();
  var whitestring = "";
  if (total > -1){
	 writestring = 'File size HTML: \t' + formatKbSize(size);
	 writestring += '\nFile size images: \t' + formatKbSize(imglength);
	 writestring += '\nTotal file size: \t' + formatKbSize(total);
	}//if
	return writestring;
}

function formatKbSize(_value){
  return formatDouble(_value/1024,2)+" Kb";
}

function calculateFileSize()
{
	if (!fileSizeSupported) return -1;
	var size = calculateFileSizeHTML();
	var imglength = calculateFileSizeImages();
	var total = size + imglength;	
	return total;
}

function calculateFileSizeImages(){
	if (!fileSizeSupported) return -1;
	
	var y = document.images;
	var imglength = 0;
	for (i=0;i<y.length;i++)
	{
		imglength += (y[i].fileSize)*1;
	}//for
  return imglength;
}

function calculateFileSizeHTML(){
  if (!fileSizeSupported) return -1;
  var size = (document.fileSize)*1;
  return size;
}

function fileSizeSupported(){
  return (document.fileSize)?true:false;
}


