	function insereFlash(caminho,div,largura,altura,largura_min){
			var so = new SWFObject(caminho,"flash",largura,altura, '8');
			so.addParam('menu', 'false');
			so.addParam('scale', 'noscale');
			so.addParam('salign', 'lt'); 
			so.addParam('wmode', 'transparent');         
			/*if( so.write(div) )
			{
				var forcesize = new SWFForceSize(so,largura_min,altura);
			}*/
              so.write(div);			
	}
	
function number_format( number, decimals, dec_point, thousands_sep ) {
    var i, j, kw, kd, km;

    // input sanitation & defaults
    if( isNaN(decimals = Math.abs(decimals)) ){
        decimals = 2;
    }
    if( dec_point == undefined ){
        dec_point = ",";
    }
    if( thousands_sep == undefined ){
        thousands_sep = ".";
    }

    i = parseInt(number = (+number || 0).toFixed(decimals)) + "";

    if( (j = i.length) > 3 ){
        j = j % 3;
    } else{
        j = 0;
    }

    km = (j ? i.substr(0, j) + thousands_sep : "");
    kw = i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + thousands_sep);
    //kd = (decimals ? dec_point + Math.abs(number - i).toFixed(decimals).slice(2) : "");
    kd = (decimals ? dec_point + Math.abs(number - i).toFixed(decimals).replace(/-/, 0).slice(2) : "");


    return km + kw + kd;
}

function url_decode(str)
        {
         var n, strCode, strDecode = "";

         for (n = 0; n < str.length; n++)
             {
              if (str.charAt(n) == "%")
                 {
                  strCode = str.charAt(n + 1) + str.charAt(n + 2);
                  strDecode += String.fromCharCode(parseInt(strCode, 16));
                  n += 2;
                 } else {
                  strDecode += str.charAt(n);
                 }
             }

         return strDecode;
        }

function AddOpcao(combo, valor, strDescricao, defaultSelected, selected)
        {
         var novaOpcao=new Option(strDescricao, valor, defaultSelected, selected);
         combo.options[combo.length]=novaOpcao;
        }

function DelOpcao(combo)
        {
         for (i=combo.length - 1;i>=0;i--)
              combo.remove(i);
        }

function trata_campo(campo,digitos)
	     {
          var i;
	      i = 0;
	      while (i < campo.value.length)
		        {
		         if (digitos.indexOf(campo.value.substring(i,i+1)) == -1)
                    {
			         campo.value = campo.value.substring(0,i) + campo.value.substring(i+1);
                    } else {
			         i++;
                    }
		        }
	     }
function Trim(str){return str.replace(/^\s+|\s+$/g,"");}

 


