function LoadFlash(nome,largura,altura){document.write('<object type="application/x-shockwave-flash" data="'+nome+'" width="'+largura+'" height="'+altura+'">');document.write('<param name="movie" value="'+nome+'" />');document.write('<param name="quality" value="high" />');document.write('<param name="wmode" value="transparent" />');document.write('</object>');}

function Contador()
{}

Contador.prototype.contar = function(obj,maxlength,iniciar)
{
	if(!iniciar && document.getElementById('erro_'+obj.id)) document.getElementById('erro_'+obj.id).innerHTML = '';
	if(obj.value.length >= maxlength)
	{
		if(obj.value.length > maxlength)
		obj.value = obj.value.substr(0,maxlength);
		document.getElementById('span_counter_'+obj.id).style.color = '#CC2929';
		if(!iniciar && document.getElementById('erro_'+obj.id)) document.getElementById('erro_'+obj.id).innerHTML = 'Atenção ! Você atingiu o número máximo de '+maxlength+' caracteres permitidos para este campo!';
	}
	else document.getElementById('span_counter_'+obj.id).style.color = '';
	document.getElementById('counter_'+obj.id).innerHTML = obj.value.length;
}

Contador.prototype.iniciar = function(id,maxlength)
{
	if(document.getElementById(id))
	Contador.contar(document.getElementById(id),maxlength,true);
}

var Contador = new Contador();

