//Copyright - 2000-2009 Alfredo J G A Borba. Todos os Direitos Reservados


//Inicialização de objeto de formatação
function inicializar() {
	alterFormat(document.config, document.config.ativa_format);
}
//Fim de Inicialização de Objeto de Formatação


//Verificação de Campos
var campovalor=""
var campid=""
var conv=0
var campnome
function verifcampo(camp){
	if (!obj_format_loaded) {
		camp.value = "";
		alert ("Página Carregando...\n\nAguardar o carregamento total da página e tentar novamente");
		return;
	}
	campnome=camp.name;
	var camptipo=campnome.slice(0,1);
	conv=0;
	if (camptipo=="d"){	
		var verifid=campnome.slice(2,3);
		if (isNaN(verifid)){
			campid=campnome.slice(1,2);
		}
		else {	campid=campnome.slice(1,3);}
		
		campovalor = obj_format.setValue(camp.value, true);
		camp.value = obj_format.getValueFormat();
		
		n=document.veloc.elements.length

		for (i=0; i < n; i++){
			if (document.veloc.elements[i].type=="text" && document.veloc.elements[i].value!="" && document.veloc.elements[i].name!=campnome){
			document.veloc.elements[i].value=""}	
		}
	}
	else {
	alert ("Esse é um campo calculado, não pode se editado.");
	camp.value="";
	}
}
//Fim da Verificação de Campos


//Construção da Matriz de Dados
var arr=24
var fc = new Array(arr);
for (i=0; i < arr; i++) {   
fc[i] = new Array(arr)   
}

fc[0][0]="1"; fc[0][1]="3.6"; fc[0][2]="2.2369362920544024"; fc[0][3]="1.943844492440605"; fc[0][4]="3.280839895013123"; fc[0][5]="60"; fc[0][6]="3600"; fc[0][7]="100"; fc[0][8]="6000"; fc[0][9]="360000"; fc[0][10]="0.001"; fc[0][11]="0.060"; fc[0][12]="0.0006213711922373339"; fc[0][13]="0.03728227153424004"; fc[0][14]="196.85039370078738"; fc[0][15]="11811.023622047252"; fc[0][16]="39.37007874015748"; fc[0][17]="2362.2047244094506"; fc[0][18]="141732.28346456704"; fc[0][19]="1.0936132983377078"; fc[0][20]="65.61679790026247"; fc[0][21]="3937.0078740157482"; fc[0][22]="0.0030165912518853696"; fc[0][23]="0.0029120559114735006";

fc[1][0]="0.277777777777778"; fc[1][1]="1"; fc[1][2]="0.6213711922373323"; fc[1][3]="0.5399568034557222"; fc[1][4]="0.9113444152814205"; fc[1][5]="16.66666666666667"; fc[1][6]="1000"; fc[1][7]="27.7777777777778"; fc[1][8]="1666.666666666667"; fc[1][9]="100000"; fc[1][10]="0.000277777777777778"; fc[1][11]="0.01666666666666667"; fc[1][12]="0.0001726031089548145"; fc[1][13]="0.010356186537288871"; fc[1][14]="54.680664916885235"; fc[1][15]="3280.839895013117"; fc[1][16]="10.936132983377048"; fc[1][17]="656.1679790026234"; fc[1][18]="39370.078740157405"; fc[1][19]="0.30378147176047354"; fc[1][20]="18.226888305628414"; fc[1][21]="1093.613298337705"; fc[1][22]="0.0008379420144126004"; fc[1][23]="0.000808904419853748"; 

fc[2][0]="0.44704"; fc[2][1]="1.609344"; fc[2][2]="1"; fc[2][3]="0.868976241900648"; fc[2][4]="1.4666666666666667"; fc[2][5]="26.8224"; fc[2][6]="1609.344"; fc[2][7]="44.704"; fc[2][8]="2682.24"; fc[2][9]="160934.4"; fc[2][10]="0.00044704"; fc[2][11]="0.0268224"; fc[2][12]="0.0002777777777777778"; fc[2][13]="0.016666666666666667"; fc[2][14]="88"; fc[2][15]="5280"; fc[2][16]="17.6"; fc[2][17]="1056"; fc[2][18]="63360"; fc[2][19]="0.4888888888888889"; fc[2][20]="29.33333333333333"; fc[2][21]="1760"; fc[2][22]="0.0013485369532428355"; fc[2][23]="0.0013018054746651137"; 

fc[3][0]="0.5144444444444444"; fc[3][1]="1.852"; fc[3][2]="1.1507794480235424"; fc[3][3]="1"; fc[3][4]="1.6878098571011952"; fc[3][5]="30.866666666666667"; fc[3][6]="1852"; fc[3][7]="51.44444444444444"; fc[3][8]="3086.666666666667"; fc[3][9]="185200"; fc[3][10]="0.0005144444444444444"; fc[3][11]="0.03086666666666667"; fc[3][12]="0.0003196609577843173"; fc[3][13]="0.01917965746705904"; fc[3][14]="101.26859142607171"; fc[3][15]="6076.115485564308"; fc[3][16]="20.253718285214347"; fc[3][17]="1215.2230971128615"; fc[3][18]="72913.3858267717"; fc[3][19]="0.5626032857003985"; fc[3][20]="33.75619714202391"; fc[3][21]="2025.3718285214347"; fc[3][22]="0.00155186861069214"; fc[3][23]="0.001498090985569145"; 

fc[4][0]="0.3048"; fc[4][1]="1.09728"; fc[4][2]="0.681818181818182"; fc[4][3]="0.5924838012958965"; fc[4][4]="1"; fc[4][5]="18.288"; fc[4][6]="1097.28"; fc[4][7]="30.48"; fc[4][8]="1828.8"; fc[4][9]="109728"; fc[4][10]="0.0003048"; fc[4][11]="0.018288"; fc[4][12]="0.0001893939393939394"; fc[4][13]="0.011363636363636364"; fc[4][14]="60"; fc[4][15]="3600"; fc[4][16]="12"; fc[4][17]="720"; fc[4][18]="43200"; fc[4][19]="0.33333333333333333"; fc[4][20]="20"; fc[4][21]="1200"; fc[4][22]="0.0009194570135746607"; fc[4][23]="0.000887594641817123"; 

fc[5][0]="0.0166666666666667"; fc[5][1]="0.060"; fc[5][2]="0.037282271534240116"; fc[5][3]="0.032397408207343485"; fc[5][4]="0.054680664916885495"; fc[5][5]="1"; fc[5][6]="60"; fc[5][7]="1.66666666666667"; fc[5][8]="100"; fc[5][9]="6000"; fc[5][10]="0.0000166666666666667"; fc[5][11]="0.001"; fc[5][12]="0.00001035618653728892"; fc[5][13]="0.0006213711922373353"; fc[5][14]="3.2808398950131296"; fc[5][15]="196.85039370078795"; fc[5][16]="0.656167979002626"; fc[5][17]="39.37007874015759"; fc[5][18]="2362.2047244094556"; fc[5][19]="0.018226888305628502"; fc[5][20]="1.09361329833771"; fc[5][21]="65.61679790026261"; fc[5][22]="0.000050276520864756265"; fc[5][23]="0.00004853426519122511";

fc[6][0]="0.000277777777777778"; fc[6][1]="0.001"; fc[6][2]="0.0006213711922373345"; fc[6][3]="0.000539956803455724"; fc[6][4]="0.0009113444152814237"; fc[6][5]="0.01666666666666667"; fc[6][6]="1"; fc[6][7]="0.0277777777777778"; fc[6][8]="1.666666666666667"; fc[6][9]="100"; fc[6][10]="2.77777777777778e-7"; fc[6][11]="0.00001666666666666667"; fc[6][12]="1.726031089548151e-7"; fc[6][13]="0.000010356186537288908"; fc[6][14]="0.054680664916885426"; fc[6][15]="3.2808398950131283"; fc[6][16]="0.010936132983377087"; fc[6][17]="0.6561679790026257"; fc[6][18]="39.37007874015754"; fc[6][19]="0.00030378147176047463"; fc[6][20]="0.018226888305628477"; fc[6][21]="1.0936132983377087"; fc[6][22]="8.379420144126033e-7"; fc[6][23]="8.089044198537508e-7"; 

fc[7][0]="0.01"; fc[7][1]="0.036"; fc[7][2]="0.022369362920544026"; fc[7][3]="0.01943844492440605"; fc[7][4]="0.03280839895013123"; fc[7][5]="0.6"; fc[7][6]="36"; fc[7][7]="1"; fc[7][8]="60"; fc[7][9]="3600"; fc[7][10]="0.00001"; fc[7][11]="0.0006"; fc[7][12]="0.000006213711922373339"; fc[7][13]="0.0003728227153424004"; fc[7][14]="1.9685039370078738"; fc[7][15]="118.11023622047253"; fc[7][16]="0.3937007874015748"; fc[7][17]="23.622047244094506"; fc[7][18]="1417.3228346456703"; fc[7][19]="0.010936132983377079"; fc[7][20]="0.6561679790026247"; fc[7][21]="39.37007874015748"; fc[7][22]="0.000030165912518853696"; fc[7][23]="0.000029120559114735006";

fc[8][0]="0.000166666666666667"; fc[8][1]="0.00060"; fc[8][2]="0.0003728227153424012"; fc[8][3]="0.00032397408207343484"; fc[8][4]="0.000546806649168855"; fc[8][5]="0.01"; fc[8][6]="0.60"; fc[8][7]="0.0166666666666667"; fc[8][8]="1"; fc[8][9]="60"; fc[8][10]="1.66666666666667e-7"; fc[8][11]="0.00001"; fc[8][12]="1.035618653728892e-7"; fc[8][13]="0.000006213711922373353"; fc[8][14]="0.032808398950131296"; fc[8][15]="1.9685039370078796"; fc[8][16]="0.0065616797900262605"; fc[8][17]="0.39370078740157593"; fc[8][18]="23.622047244094556"; fc[8][19]="0.00018226888305628502"; fc[8][20]="0.010936132983377101"; fc[8][21]="0.656167979002626"; fc[8][22]="5.027652086475627e-7"; fc[8][23]="4.853426519122512e-7"; 
 
fc[9][0]="0.00000277777777777778"; fc[9][1]="0.00001"; fc[9][2]="0.000006213711922373345"; fc[9][3]="0.000005399568034557241"; fc[9][4]="0.000009113444152814237"; fc[9][5]="0.0001666666666666667"; fc[9][6]="0.01"; fc[9][7]="0.000277777777777778"; fc[9][8]="0.01666666666666667"; fc[9][9]="1"; fc[9][10]="2.77777777777778e-9"; fc[9][11]="1.666666666666667e-7"; fc[9][12]="1.7260310895481511e-9"; fc[9][13]="1.0356186537288909e-7"; fc[9][14]="0.0005468066491688542"; fc[9][15]="0.03280839895013128"; fc[9][16]="0.00010936132983377087"; fc[9][17]="0.006561679790026257"; fc[9][18]="0.39370078740157543"; fc[9][19]="0.0000030378147176047462"; fc[9][20]="0.00018226888305628477"; fc[9][21]="0.010936132983377087"; fc[9][22]="8.379420144126034e-9"; fc[9][23]="8.089044198537508e-9"; 

fc[10][0]="1000"; fc[10][1]="3600"; fc[10][2]="2236.9362920544026"; fc[10][3]="1943.844492440605"; fc[10][4]="3280.839895013123"; fc[10][5]="60000"; fc[10][6]="3600000"; fc[10][7]="100000"; fc[10][8]="6000000"; fc[10][9]="360000000"; fc[10][10]="1"; fc[10][11]="60"; fc[10][12]="0.621371192237334"; fc[10][13]="37.28227153424004"; fc[10][14]="196850.3937007874"; fc[10][15]="11811023.622047253"; fc[10][16]="39370.07874015748"; fc[10][17]="2362204.724409451"; fc[10][18]="141732283.46456704"; fc[10][19]="1093.6132983377078"; fc[10][20]="65616.79790026246"; fc[10][21]="3937007.874015748"; fc[10][22]="3.0165912518853694"; fc[10][23]="2.9120559114735007";

fc[11][0]="16.6666666666667"; fc[11][1]="60"; fc[11][2]="37.28227153424012"; fc[11][3]="32.39740820734348"; fc[11][4]="54.68066491688549"; fc[11][5]="1000"; fc[11][6]="60000"; fc[11][7]="1666.66666666667"; fc[11][8]="100000"; fc[11][9]="6000000"; fc[11][10]="0.0166666666666667"; fc[11][11]="1"; fc[11][12]="0.01035618653728892"; fc[11][13]="0.6213711922373353"; fc[11][14]="3280.8398950131295"; fc[11][15]="196850.39370078794"; fc[11][16]="656.167979002626"; fc[11][17]="39370.07874015759"; fc[11][18]="2362204.7244094554"; fc[11][19]="18.2268883056285"; fc[11][20]="1093.61329833771"; fc[11][21]="65616.7979002626"; fc[11][22]="0.05027652086475626"; fc[11][23]="0.048534265191225105"; 

fc[12][0]="1609.344"; fc[12][1]="5793.6384"; fc[12][2]="3600"; fc[12][3]="3128.3144708423333"; fc[12][4]="5280"; fc[12][5]="96560.64"; fc[12][6]="5793638.4"; fc[12][7]="160934.4"; fc[12][8]="9656064"; fc[12][9]="579363840"; fc[12][10]="1.609344"; fc[12][11]="96.56064"; fc[12][12]="1"; fc[12][13]="60"; fc[12][14]="316800"; fc[12][15]="19008000"; fc[12][16]="63360"; fc[12][17]="3801600"; fc[12][18]="228096000"; fc[12][19]="1760"; fc[12][20]="105600"; fc[12][21]="6336000"; fc[12][22]="4.8547330316742085"; fc[12][23]="4.686499708794409"; 

fc[13][0]="26.8224"; fc[13][1]="96.56064"; fc[13][2]="60"; fc[13][3]="52.13857451403888"; fc[13][4]="88"; fc[13][5]="1609.344"; fc[13][6]="96560.64"; fc[13][7]="2682.24"; fc[13][8]="160934.4"; fc[13][9]="9656064"; fc[13][10]="0.0268224"; fc[13][11]="1.609344"; fc[13][12]="0.016666666666666667"; fc[13][13]="1"; fc[13][14]="5280"; fc[13][15]="316800"; fc[13][16]="1056"; fc[13][17]="63360"; fc[13][18]="3801600"; fc[13][19]="29.333333333333333"; fc[13][20]="1760"; fc[13][21]="105600"; fc[13][22]="0.08091221719457013"; fc[13][23]="0.07810832847990681"; 

fc[14][0]="0.00508"; fc[14][1]="0.018288"; fc[14][2]="0.011363636363636364"; fc[14][3]="0.009874730021598275"; fc[14][4]="0.016666666666666667"; fc[14][5]="0.3048"; fc[14][6]="18.288"; fc[14][7]="0.508"; fc[14][8]="30.48"; fc[14][9]="1828.8"; fc[14][10]="0.00000508"; fc[14][11]="0.0003048"; fc[14][12]="0.0000031565656565656566"; fc[14][13]="0.0001893939393939394"; fc[14][14]="1"; fc[14][15]="60"; fc[14][16]="0.2"; fc[14][17]="12"; fc[14][18]="720"; fc[14][19]="0.005555555555555556"; fc[14][20]="0.3333333333333333"; fc[14][21]="20"; fc[14][22]="0.00001532428355957768"; fc[14][23]="0.000014793244030285384"; 

fc[15][0]="0.0000846666666666667"; fc[15][1]="0.0003048"; fc[15][2]="0.0001893939393939394"; fc[15][3]="0.00016457883369330463"; fc[15][4]="0.0002777777777777778"; fc[15][5]="0.00508"; fc[15][6]="0.3048"; fc[15][7]="0.00846666666666667"; fc[15][8]="0.508"; fc[15][9]="30.48"; fc[15][10]="8.46666666666667e-8"; fc[15][11]="0.00000508"; fc[15][12]="5.2609427609427624e-8"; fc[15][13]="0.00000315656565656566"; fc[15][14]="0.01666666666666667"; fc[15][15]="1"; fc[15][16]="0.00333333333333333"; fc[15][17]="0.2"; fc[15][18]="12"; fc[15][19]="0.00009259259259259263"; fc[15][20]="0.005555555555555556"; fc[15][21]="0.333333333333333"; fc[15][22]="2.554047259929614e-7"; fc[15][23]="2.4655406717142314e-7"; 
 
fc[16][0]="0.0254"; fc[16][1]="0.09144"; fc[16][2]="0.05681818181818182"; fc[16][3]="0.049373650107991364"; fc[16][4]="0.0833333333333333"; fc[16][5]="1.524"; fc[16][6]="91.44"; fc[16][7]="2.54"; fc[16][8]="152.4"; fc[16][9]="9144"; fc[16][10]="0.0000254"; fc[16][11]="0.001524"; fc[16][12]="0.00001578282828282828"; fc[16][13]="0.000946969696969697"; fc[16][14]="5"; fc[16][15]="300"; fc[16][16]="1"; fc[16][17]="60"; fc[16][18]="3600"; fc[16][19]="0.027777777777777778"; fc[16][20]="1.6666666666666667"; fc[16][21]="100"; fc[16][22]="0.00007662141779788839"; fc[16][23]="0.00007396622015142692"; 

fc[17][0]="0.000423333333333333"; fc[17][1]="0.001524"; fc[17][2]="0.000946969696969697"; fc[17][3]="0.0008228941684665222"; fc[17][4]="0.001388888888888889"; fc[17][5]="0.0254"; fc[17][6]="1.524"; fc[17][7]="0.0423333333333333"; fc[17][8]="2.54"; fc[17][9]="152.4"; fc[17][10]="4.23333333333333e-7"; fc[17][11]="0.0000254"; fc[17][12]="2.630471380471378e-7"; fc[17][13]="0.0000157828282828283"; fc[17][14]="0.0833333333333333"; fc[17][15]="5"; fc[17][16]="0.01666666666666667"; fc[17][17]="1"; fc[17][18]="60"; fc[17][19]="0.00046296296296296265"; fc[17][20]="0.02777777777777778"; fc[17][21]="1.666666666666667"; fc[17][22]="0.0000012770236299648055"; fc[17][23]="0.0000012327703358571142"; 

fc[18][0]="0.00000705555555555556"; fc[18][1]="0.0000254"; fc[18][2]="0.00001578282828282828"; fc[18][3]="0.00001371490280777539"; fc[18][4]="0.00002314814814814816"; fc[18][5]="0.000423333333333333"; fc[18][6]="0.0254"; fc[18][7]="0.000705555555555556"; fc[18][8]="0.0423333333333333"; fc[18][9]="2.54"; fc[18][10]="7.05555555555556e-9"; fc[18][11]="4.23333333333333e-7"; fc[18][12]="4.384118967452303e-9"; fc[18][13]="2.6304713804713824e-7"; fc[18][14]="0.001388888888888889"; fc[18][15]="0.083333333333333"; fc[18][16]="0.0002777777777777778"; fc[18][17]="0.01666666666666667"; fc[18][18]="1"; fc[18][19]="0.000007716049382716054"; fc[18][20]="0.00046296296296296325"; fc[18][21]="0.02777777777777778"; fc[18][22]="2.1283727166080122e-8"; fc[18][23]="2.0546172264285267e-8"; 

fc[19][0]="0.9144"; fc[19][1]="3.29184"; fc[19][2]="2.0454545454545454"; fc[19][3]="1.7774514038876891"; fc[19][4]="3"; fc[19][5]="54.864"; fc[19][6]="3291.84"; fc[19][7]="91.44"; fc[19][8]="5486.4"; fc[19][9]="329184"; fc[19][10]="0.0009144"; fc[19][11]="0.054864"; fc[19][12]="0.0005681818181818182"; fc[19][13]="0.03409090909090909"; fc[19][14]="180"; fc[19][15]="10800"; fc[19][16]="36"; fc[19][17]="2160"; fc[19][18]="129600"; fc[19][19]="1"; fc[19][20]="60"; fc[19][21]="3600"; fc[19][22]="0.002758371040723982"; fc[19][23]="0.002662783925451369";

fc[20][0]="0.01524"; fc[20][1]="0.054864"; fc[20][2]="0.03409090909090909"; fc[20][3]="0.02962419006479482"; fc[20][4]="0.05"; fc[20][5]="0.9144"; fc[20][6]="54.864"; fc[20][7]="1.524"; fc[20][8]="91.44"; fc[20][9]="5486.4"; fc[20][10]="0.00001524"; fc[20][11]="0.0009144"; fc[20][12]="0.00000946969696969697"; fc[20][13]="0.000568181818181818"; fc[20][14]="3"; fc[20][15]="180"; fc[20][16]="0.6"; fc[20][17]="36"; fc[20][18]="2160"; fc[20][19]="0.016666666666666667"; fc[20][20]="1"; fc[20][21]="60"; fc[20][22]="0.000045972850678733035"; fc[20][23]="0.00004437973209085615"; 

fc[21][0]="0.000254"; fc[21][1]="0.0009144"; fc[21][2]="0.000568181818181818"; fc[21][3]="0.0004937365010799137"; fc[21][4]="0.0008333333333333333"; fc[21][5]="0.01524"; fc[21][6]="0.9144"; fc[21][7]="0.0254"; fc[21][8]="1.524"; fc[21][9]="91.44"; fc[21][10]="2.54e-7"; fc[21][11]="0.00001524"; fc[21][12]="1.578282828282828e-7"; fc[21][13]="0.00000946969696969697"; fc[21][14]="0.05"; fc[21][15]="3"; fc[21][16]="0.01"; fc[21][17]="0.60"; fc[21][18]="36"; fc[21][19]="0.0002777777777777778"; fc[21][20]="0.016666666666666667"; fc[21][21]="1"; fc[21][22]="7.662141779788838e-7"; fc[21][23]="7.396622015142692e-7"; 

fc[22][0]="331.5"; fc[22][1]="1193.4"; fc[22][2]="741.5443808160344"; fc[22][3]="644.3844492440605"; fc[22][4]="1087.5984251968502"; fc[22][5]="19890"; fc[22][6]="1193400"; fc[22][7]="33150"; fc[22][8]="1989000"; fc[22][9]="119340000"; fc[22][10]="0.3315"; fc[22][11]="19.89"; fc[22][12]="0.2059845502266762"; fc[22][13]="12.359073013600573"; fc[22][14]="65255.90551181102"; fc[22][15]="3915354.3307086644"; fc[22][16]="13051.181102362205"; fc[22][17]="783070.8661417329"; fc[22][18]="46984251.968503974"; fc[22][19]="362.5328083989501"; fc[22][20]="21751.96850393701"; fc[22][21]="1305118.1102362205"; fc[22][22]="1"; fc[22][23]="0.9653465346534654"; 

fc[23][0]="343.4"; fc[23][1]="1236.24"; fc[23][2]="768.1639226914817"; fc[23][3]="667.5161987041038"; fc[23][4]="1126.6404199475064"; fc[23][5]="20604"; fc[23][6]="1236240"; fc[23][7]="34340"; fc[23][8]="2060400"; fc[23][9]="123624000"; fc[23][10]="0.3434"; fc[23][11]="20.604"; fc[23][12]="0.21337886741430045"; fc[23][13]="12.802732044858029"; fc[23][14]="67598.42519685038"; fc[23][15]="4055905.5118110264"; fc[23][16]="13519.685039370078"; fc[23][17]="811181.1023622053"; fc[23][18]="48670866.14173232"; fc[23][19]="375.54680664916884"; fc[23][20]="22532.808398950132"; fc[23][21]="1351968.5039370078"; fc[23][22]="1.0358974358974357"; fc[23][23]="1";
//Fim da Construção da Matriz de Dados


//Cálculo das Conversões
function converte(form){
	conv=1
	var verfns=0
	var campid2
	var excluir
	var chknome
	
	obj_format.setFormat(decSep, milSep, tipo, cdec, prec, estExp);
	
	n=form.elements.length;
	if (campid!="" && !isNaN(campovalor) && loaded!=true){
		document.config.dec.style.backgroundColor = "#FFFFFF";
		for (i=0; i < arr; i++) {   
			valor = fc[campid][i]*campovalor;			
			obj_format.setValue(valor, false);

			for (j=0; j < n; j++){
				var nome=form.elements[j].name;
				var camptipo2=nome.slice(0,1);
				
				var verifid2=nome.slice(2,3);
				if (isNaN(verifid2)){
					campid2=nome.slice(1,2);
				}
				else {	campid2=nome.slice(1,3);}
				
				chknome="e"+i
				excluir=form.elements[chknome].checked				

				if (camptipo2=="p" && campid2==i && campid2!=campid && excluir!=true){
					form.elements[j].value = obj_format.getValueFormat();
					if (form.elements[j].value==0) {
						form.elements[j].style.backgroundColor = "#FFFF00";
						document.config.dec.style.backgroundColor = "#FFFF00";
					}
					else {
						form.elements[j].style.backgroundColor = "#FFFFFF";				
					}
					break;
				}
				if (camptipo2=="p" && campid2==campid){
					form.elements[j].value="-------------";
					form.elements[j].style.backgroundColor = "#FFFFFF";
				}
			}
		}
		verfns=Math.round(1000000000000000*Math.tan(campovalor))/1000000000000000
		if (verfns==0.142465824387511){
		alert("1126185415.2151821")
		}
		
		if (tipo!=3){
			obj_format.setValue(campovalor, false);
			form.elements[campnome].value = obj_format.getValueFormat();
		}
	}
}
//Fim do Cálculo das Conversões


//Exclui Resultado
function exclui(exc){
	var excid
	var excnome=exc.name
	var excstatus=exc.checked
	
	if (excstatus==true){
		
		var verifid3=excnome.slice(2,3);
		if (isNaN(verifid3)){
			excid=excnome.slice(1,2);
		}
		else {	excid=excnome.slice(1,3);}

		n=document.veloc.elements.length
		
		for (i=0; i < n; i++){
		
			var valor3=document.veloc.elements[i].value
			var nome3=document.veloc.elements[i].name;
			var camptipo3=nome3.slice(0,1);
			
			var verifid3=nome3.slice(2,3);
			if (isNaN(verifid3)){
				campid3=nome3.slice(1,2);
			}
			else {	campid3=nome3.slice(1,3);}		
		
			if (camptipo3=="p" && campid3==excid){
			document.veloc.elements[i].value=""}	
		}
	}
}
//Fim Exclui Resultado


//Zera valor de Variáveis
function limpa(form){
	campovalor=""
	campid=""
	conv=0
	document.config.dec.style.backgroundColor = "#FFFFFF";
	for (var i=0; i < document.veloc.elements.length; i++){
		if (document.veloc.elements[i].type=="text"){
			form.elements[i].style.backgroundColor = "#FFFFFF";
		}	
	}
}
//Fim de Zera valor de Variáveis


//Transfere para Memoria
function Transfere(form) {
	if (parent.frames[0].name!="iframewebcalc") {
		var cpresult;
		var opmemo = 0;
		
		for (var i = 0; i < form.opcaomemo.length; i++) {
			if (form.opcaomemo[i].checked) {
				opmemo = form.opcaomemo[i].value;
				break
			}
		}
		
		cpresult = eval("form.p"+opmemo+".value");	
		var resultmemo = obj_format.setValue(cpresult, false);
		
		if (!isNaN(resultmemo) && cpresult!="") {
			var memonr = form.memonr.options[form.memonr.selectedIndex].value;
			var operacao = form.operacao.options[form.operacao.selectedIndex].value;		
			var valormemo = eval("parent.frames['frame_menu'].document.memo.memotemp"+memonr+".value");
			var Mat_desc = ["m/s", "km/h", "mi/h", "nó", "ft/s", "m/min", "m/h", "cm/s", "cm/min", "cm/h", "km/s", "km/min", "mi/s", "mi/min", "ft/min", "ft/h", "in/s", "in/min", "in/h", "yd/s", "yd/min", "yd/h", "Mach (0 oC)", "Mach (20 oC)"];
			var descricao = eval("Mat_desc["+opmemo+"]");		
	
			valormemo = parseFloat(valormemo);
			if (isNaN(valormemo)) {valormemo=0;}
				
			switch (operacao) {
				case "1" :
	eval("parent.frames['frame_menu'].document.memo.memotemp"+memonr+".value = resultmemo");			
	eval("parent.frames['frame_menu'].document.memo.memodesc"+memonr+".value = descricao");
	if (is.ie4) {parent.frames["frame_menu"].document.images["memoled"].src = "imagens/ledmemo2.gif";}			
				break;
				case "2" :
	eval("parent.frames['frame_menu'].document.memo.memotemp"+memonr+".value = valormemo+resultmemo");
	eval("parent.frames['frame_menu'].document.memo.memodesc"+memonr+".value = 'Soma'");
	if (is.ie4) {parent.frames["frame_menu"].document.images["memoled"].src = "imagens/ledmemo2.gif";}
				break;
				case "3" :
	eval("parent.frames['frame_menu'].document.memo.memotemp"+memonr+".value = valormemo-resultmemo");
	eval("parent.frames['frame_menu'].document.memo.memodesc"+memonr+".value = 'Subtração'");
	if (is.ie4) {parent.frames["frame_menu"].document.images["memoled"].src = "imagens/ledmemo2.gif";}
				break;
				case "4" :
	eval("parent.frames['frame_menu'].document.memo.memotemp"+memonr+".value = valormemo*resultmemo");
	eval("parent.frames['frame_menu'].document.memo.memodesc"+memonr+".value = 'Multiplicação'");
	if (is.ie4) {parent.frames["frame_menu"].document.images["memoled"].src = "imagens/ledmemo2.gif";}
				break;
				case "5" :
	eval("parent.frames['frame_menu'].document.memo.memotemp"+memonr+".value = valormemo/resultmemo");
	eval("parent.frames['frame_menu'].document.memo.memodesc"+memonr+".value = 'Divisão'");
	if (is.ie4) {parent.frames["frame_menu"].document.images["memoled"].src = "imagens/ledmemo2.gif";}
				break;
			}
		}
		else {alert("Não existe resultado a transferir.")}
	}
	else {alert("Esta operação não pode ser executada nesta janela.\n\nPara transferir valores para a memória abra esta calculadora através do menu principal.")}
}
//Fim de Transfere para Memoria


//Impressão dos Resultados
function JanelaImp(form) {	
	if (parent.frames[0].name!="iframewebcalc") {
		if (!isNaN(campovalor) && conv==1) {
				
			winimp = window.open("velocidade_imp.html","janela_imp","toolbar=0,location=no,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,width=500,height=400,left=50,top=30");	
			winimp.focus();
		}
		else {alert("Não existem valores a imprimir. Clique no botão 'Limpar', refaça o cálculo e tente novamente.")}
	}
		else {alert("Esta operação não pode ser executada nesta janela.\n\nPara imprimir os resultados abra esta calculadora através do menu principal.")}
}
//Fim de Impressão dos Resultados
