function initBody(){
	;
}

function exibeFlash(swf, width, height){
		monta_swf = "";
		monta_swf += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\""+ width +"\" height=\""+ height +"\" title=\"\">";
		monta_swf += "<param name=\"movie\" value=\""+ swf +"\" />";
		monta_swf += "<param name=\"quality\" value=\"high\" />";
		monta_swf += "<param name=\"menu\" value=\"0\" />";
		monta_swf += "<param name=\"wmode\" value=\"transparent\" />";
		monta_swf += "<embed src=\""+ swf +"\" quality=\"high\" wmode=\"transparent\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\""+ width +"\" height=\""+ height +"\"></embed>";
		monta_swf += "</object>";	
		document.write(monta_swf);
}
function closeFloater(div){
	document.getElementById(div).style["display"]="none";
}

/**
* Abre um popup (substitui abrirJanela())
* string url, endereço do popup
* int w, largura do popup
* int h, altura do popup
* string conf, configuração do popup: toolbar,location,status,menubar,scrollbars,resizable
* ex:  openPopup('http://www.mkx.com.br','mkx',300,400,'resizable,status');
*/
function openPopup(url,name,w,h,conf) {  
	var winl = (screen.width - w) / 2;
	var wint = ((screen.height - h) / 2);
	name=window.open(url,"_blank",'width='+w+',height='+h+',left='+winl+',top='+wint+','+conf);
	name.window.focus();
}

function abrirJanela(url,nome,w,h,conf) {  //abre uma janela  conf = toolbar,location,status,menubar,scrollbars,resizable
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	novajanela=window.open(url,nome,'width='+w+',height='+h+',left='+winl+',top='+wint+','+conf);
	//novajanela.resizeTo(w+10,h+80);
	novajanela.moveTo(winl,wint);
	novajanela.window.focus();
}

function verificarDados(campo,checkStr){ //verifica se os carecteres digitados no campo são válidos 
	checkOK = getChars(campo);
	if (checkStr.charCodeAt()==8) return (true); //Backspace
	if (checkStr.charCodeAt()==0) return (true); //  <- -> del
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++){
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
			break;
		if (j == checkOK.length){
			allValid = false;
			break;
		}
	}
	if (!allValid)
		return (false);
	else 
		return (true);
}//fim function verificarDados(campo,checkStr)
//############################################################################################################################
function getkey(e){ //retorna a tecla pressionada - Internet Explorer e Netscape
	if (window.event)
		key = window.event.keyCode;
	else
		key = e.which;
	return String.fromCharCode(key);
}//fim function getkey(e)
function getChars(campo){ //retorna os carecteres permitidos nos campos
   switch(campo){
	  case "endereco":  return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzÀÁÂÃÄÇÈÉÊËÌÍÎÏGÑÒÓÔÕÖÙÚÛÜIàáâãäçèéêëìíîïgñòóôõöùúûü0123456789ªº()'. -\t\r\n\f";
	  case "message":  return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzÀÁÂÃÄÇÈÉÊËÌÍÎÏGÑÒÓÔÕÖÙÚÛÜIàáâãäçèéêëìíîïgñòóôõöùúûü0123456789ªº^~()?!,;:@$%'. -\t\r\n\f";
      case "numero": return "0123456789\t\r\n\f";
      case "num": return "0123456789.";
      case "nome":  return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzÀÁÂÃÄÇÈÉÊËÌÍÎÏGÑÒÓÔÕÖÙÚÛÜIàáâãäçèéêëìíîïgñòóôõöùúûü. \t\r\n\f";
      case "email": return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-@\t\r\n\f"; 
	  case "nda": return "\t\r\n\f"; 
	}
}
//############################################################################################################################
function pularEdit(n,t,target, e) { //pula automaticamente para o proximo campo a ser preenchido
	//delay("checkKey","'"+window.event.keyCode+"'", 500);
	if (window.event)
		key = window.event.keyCode;
	else
		key = e.which;	
	if (n==t && key!=9 && key!=16){   //9= tab, 16 = shift 
		elementFocus(target);
	}
}
//############################################################################################################################
function elementFocus(element){ //seleciona o foco no elemento do form
	if ( element.type == "text" || element.type == "radio" ){
		element.select();	
		element.focus();	
	}
	if ( element.type == "select-one")
		element.focus();		
}//fim function elementFocus(element)
//############################################################################################################################
