// ----------------------------------------------------------------
function hsrc_init() {
  if (!document.getElementById) return
  var imgOriginSrc;
  var imgTemp = new Array();
  var imgarr = document.getElementsByTagName('img');
  for (var i = 0; i < imgarr.length; i++) {
    if (imgarr[i].getAttribute('hsrc')) {
        imgTemp[i] = new Image();
        imgTemp[i].src = imgarr[i].getAttribute('hsrc');
        imgarr[i].onmouseover = function() {
            imgOriginSrc = this.getAttribute('src');
            this.setAttribute('src',this.getAttribute('hsrc'))
        }
        imgarr[i].onmouseout = function() {
            this.setAttribute('src',imgOriginSrc)
        }
    }
  }
}

// ----------------------------------------------------------------
function alteraEstadoImagem( imagem ) {
	try
	{
		if ( parseInt(imagem) > 50 )
		{
			return;
		}

		var old_name = document.images["i" + imagem].src;
		var new_name = new Image();
		document.images["i" + imagem].src = old_name.replace(".gif", "-down.gif");
	}
	catch (e)
	{
	}
}

// ----------------------------------------------------------------
function execPesquisa() {
	var tf = document.forms["pesquisa"];
	if ( tf == null )
	{
		return;
	}

	var tc = tf.texto.value;
	if ( tc == null )
	{
		return;
	}

	if ( tc == "")
	{
		try
		{
			alert("Deve inserir o termo a pesquisar.");
			tc.focus();
		}
		catch (e)
		{

		}
	} else {
		tf.submit();
	}
}
function maxlength(element, maxvalue)  {

var q = eval("document.pooh."+element+".value.length");
     var r = q - maxvalue;
     var msg = "Sorry, you have input "+q+" characters into the "+
       "text area box you just completed. It can return no more than "+
       maxvalue+" characters to be processed. Please abbreviate "+
       "your text by at least "+r+" characters";
	  alert("Passou" +q);
     if (q > maxvalue) alert(msg);
}
