// JavaScript Document

    //Função para não deixar inserir mais de um determinado N° de caracteres no textarea

function Caracteres(objeto){
    var limite = 300;
    var erro = "Você ultrapassou o limite de caracteres.";

    tamanho = objeto.value.length;
    if (tamanho>limite) {
 objeto.value = objeto.value.substring(0,limite);
 alert(erro);
    } else {
// document.getElementById('restantes').innerHTML = (limite-objeto.value.length);
    }
}

////////////////////////////////////////////////////////////////////////////////////////////////


<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->

var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}


////////////////////////////////////////////////////////////////////////////////////////////////

<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->

<!--Adicionar campo-->
function dropFile(btn){
	if(document.getElementById) {
		tr = btn;
		while (tr.tagName != 'TR') tr = tr.parentNode;
		tr.parentNode.removeChild(tr);
		checkForLast();
	}
}
function addFile(btn){
	if(document.getElementById) {
		tr = btn;
		while (tr.tagName != 'TR') tr = tr.parentNode;
		var idSuffix = Math.round(Math.random()*1000);
		var newTr = tr.parentNode.insertBefore(tr.cloneNode(true),tr.nextSibling);
		thisChilds = newTr.getElementsByTagName('td');
		for (var i = 0; i < thisChilds.length; i++){
			if (thisChilds[i].className == 'header') thisChilds[i].innerHTML = '';
			if (thisChilds[i].className == 'files') thisChilds[i].innerHTML = '<input size="32" name="foto[]" class="wideFile" type="file" value = "2">';
		}
		checkForLast();
	}
}
function checkForLast(){
	btns = document.getElementsByName('drop');
	for (i = 0; i < btns.length; i++){
		btns[i].disabled = (btns.length == 1) ? true : false;
	}
}
