<!--
nextfield = "CodProd"; 
netscape = "";
ver = navigator.appVersion; len = ver.length;
for(iln = 0; iln < len; iln++) if (ver.charAt(iln) == "(") break;
netscape = (ver.charAt(iln+1).toUpperCase() != "C");


function autotab(original,destination){
  if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
  destination.focus()
}

function keyDown(DnEvents) { 
  k = (netscape) ? DnEvents.which : window.event.keyCode;
  if (k == 13) { 
    if (nextfield == 'done') return true; 
    else {
      eval('document.pedido.' + nextfield + '.focus()');
      return false;
    }
  }
}

document.onkeydown = keyDown; 
if (netscape) document.captureEvents(Event.KEYDOWN|Event.KEYUP);

function placeFocus() {
  if (document.forms.length > 0) {
    var field = document.forms[0];
    for (i = 0; i < field.length; i++) {
      if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
        document.forms[0].elements[i].focus();
        break;
      }
    }
  }
//  MM_timelinePlay('Timeline1')
}
VerifiqueTAB=true;


function putFocus(formInst, elementInst) { 
	if (document.forms.length > 0) { 
		document.forms[formInst].elements[elementInst].focus(); 
	} 
} 

function Mostra(quem, tammax) {
	if ( (quem.value.length == tammax) && (VerifiqueTAB) ) {
		var i=0,j=0, indice=-1;
		for (i=0; i<document.forms.length; i++) {
			for (j=0; j<document.forms[i].elements.length; j++) {
				if (document.forms[i].elements[j].name == quem.name) {
					indice=i;
					break;
				}
			}
			if (indice != -1)
		    break;
		}
		for (i=0; i<=document.forms[indice].elements.length; i++) {
			if (document.forms[indice].elements[i].name == quem.name) {
				while ( (document.forms[indice].elements[(i+1)].type == "hidden") &&
						(i < document.forms[indice].elements.length) ) {
							i++;
				}
				document.forms[indice].elements[(i+1)].focus();
				VerifiqueTAB=false;
				break;
			}
		}
	}
}
function PararTAB(quem) 
{ 
   VerifiqueTAB=false; 
} 
function ChecarTAB() 
{ 
   VerifiqueTAB=true; 
} 
function Range(v,p1,p2)
{
   if (v>=p1 && v<=p2)
   {
      return true;
   }
   else 
   {
      return false;
   }
}
function FechaJanela(url)
{
   window.close(url);
}
function MM_openBrWindow(theURL,winName,features) 
{
  window.open(theURL,winName,features);
}

function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=no';
if (! window.focus)return true;
var href;
if (typeof(mypage) == 'string')
   href=mypage;
else
   href=mypage.href;
window.open(href,myname,settings);

return false;
}

function small_window(myurl) {
    var newWindow
		if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
      if (document.layers)
      	var xMax = window.outerWidth, yMax = 	window.outerHeight;
      else
        var xMax = 800, yMax=600;
	    var xOffset = (xMax - 700)/2, yOffset = 	(yMax - 600)/2;

		newWindow = window.open(myurl, 'Add_from_Src_to_Dest','width=700,height=500,screenX='+xOffset+', screenY='+yOffset+',top='+yOffset+',  left='+xOffset+'');
}
function addToParentList(sourceList) {
  destinationList = window.document.forms[0].parentList;
  for(var count = destinationList.options.length - 1; count >= 0; count--) {
    destinationList.options[count] = null;
  }
  for(var i = 0; i < sourceList.options.length; i++) {
    if (sourceList.options[i] != null)
    destinationList.options[i] = new Option(sourceList.options[i].text, sourceList.options[i].value );
  }
}
function addList(mau){
  document.pedido.lista.value = mau;
}
function selectList(sourceList) {
  sourceList = window.document.forms[0].parentList;
  for(var i = 0; i < sourceList.options.length; i++) {
    if (sourceList.options[i] != null)
    sourceList.options[i].selected = true;
  }
  return true;
}
function deleteSelectedItemsFromList(sourceList) {
  var maxCnt = sourceList.options.length;
  for(var i = maxCnt - 1; i >= 0; i--) {
    if ((sourceList.options[i] != null) && (sourceList.options[i].selected == true)) {
      sourceList.options[i] = null;
    }
  }
}

// -->