function lcolor()
{
if (parent.dst.document.gp.ink0.value != "") document.gp.reset();

if (navigator.appName=="Microsoft Internet Explorer")
{

var c="white";

with(parent.dst.document.all.gp)
{
di0.style.backgroundColor=c;
di1.style.backgroundColor=c;
di2.style.backgroundColor=c;
di3.style.backgroundColor=c;
di4.style.backgroundColor=c;
di5.style.backgroundColor=c;
di6.style.backgroundColor=c;
di7.style.backgroundColor=c;
di8.style.backgroundColor=c;
di9.style.backgroundColor=c;
di10.style.backgroundColor=c;

bu0.style.backgroundColor=c;
bu1.style.backgroundColor=c;
bu2.style.backgroundColor=c;
bu3.style.backgroundColor=c;
bu4.style.backgroundColor=c;
bu5.style.backgroundColor=c;
bu6.style.backgroundColor=c;
bu7.style.backgroundColor=c;
bu8.style.backgroundColor=c;
bu9.style.backgroundColor=c;
bu10.style.backgroundColor=c;

gx0.style.backgroundColor=c;
gx1.style.backgroundColor=c;
gx2.style.backgroundColor=c;
gx3.style.backgroundColor=c;
gx4.style.backgroundColor=c;
gx5.style.backgroundColor=c;
gx6.style.backgroundColor=c;
gx7.style.backgroundColor=c;
gx8.style.backgroundColor=c;
gx9.style.backgroundColor=c;
gx10.style.backgroundColor=c;
}
}
}

function color(m)
{
var c=0;
if (m>=24) c="#7891FF";
if (m<24 && m>=23) c="#8791F0";
if (m<23 && m>=22) c="#9691E1";
if (m<22 && m>=21) c="#A591D2";
if (m<21 && m>=20) c="#B491C3";
if (m<20 && m>=19) c="#C391B4";
if (m<19 && m>=18) c="#D291A5";
if (m<18 && m>=17) c="#E19196";
if (m<17 && m>=16) c="#F09187";
if (m<16 && m>=15) c="#FF9178";
if (m="") c="white";
return c;
}

function rechne(y)
{
if (y.value=="")
{
alert('Sie haben keine Bezeichnung für die Galaxie eingegeben.');
return;
}

for (i=0; i < parent.datenframe.x.length; ++i)
{
if (parent.datenframe.x[i][0]==y.value)
{
n=parent.datenframe.x[i][1];
t=parent.datenframe.x[i][2];
lD25=parent.datenframe.x[i][3];
lR25=parent.datenframe.x[i][4];
lAe=parent.datenframe.x[i][5];
me=parent.datenframe.x[i][6];
bh=parent.datenframe.x[i][7];
se=parent.datenframe.x[i][8];
break
}
else
if (i==parent.datenframe.x.length-1)
{
alert('Keine Galaxie mit dieser Bezeichnung im gewählten Katalogdatensatz.');
return;
}
}

b1=Math.pow(100,.2);

d25=Math.pow(10,lD25) / 10;
ink= d25 / 20;
//rh=.163 * d25;
d25k=Math.round(d25 / Math.pow(10,lR25) * 10) / 10;
la=(Math.round((Math.pow(10,lD25) / 10) * 10)) / 10;
lDe=Math.pow(10,(lAe - .26 * Math.pow(lR25,2))) / 10;
mue=me - 1.3 * Math.pow(lR25,2) + 8.89;

if(se==1) x=4.652;
if(se==2) x=2.871;
if(se==4) x=1.393;

sie=mue + x;

bh=bh+"";
la=la+"";
d25k=d25k+"";
if (bh.indexOf(".")==-1) bh = bh + ".0";
if (la.indexOf(".")==0) la = "0" + la;
if (la.indexOf(".")==-1) la = la + ".0";
if (d25k.indexOf(".")==0) d25k = "0" + d25k;
if (d25k.indexOf(".")==-1) d25k = d25k + ".0";

with(parent.dst.document.gp)
{
name.value=n;
typ.value=t;
lachs.value=la;
kachs.value=d25k;
bhell.value=bh;
}

if ((t.indexOf("d")!=-1)||(t.indexOf("m")!=-1)||(t.indexOf("I")!=-1))
{
dzent=22.8;
drest=2.2;
}
else
{
dzent=20.6;
drest=4.4;
}

for(i=1; i <= 10; i++)
{
if(i==1)
{
hilf1a=ink / 10;
//if(t=="E") {mda=""} else mda=Math.round((21.65 + hilf1a / rh) * 10) / 10;
if(t=="E") {mda=""} else mda=Math.round((dzent + drest * hilf1a / (d25 / 2)) * 10) / 10;
m=mda; cda=color(m);
mba=Math.round((sie + 8.3268 * (Math.pow(hilf1a / (lDe / 2), (1 / se)) - 1)) * 10) / 10;
m=mba; cba=color(m);
if(mda=="") {hilf2=0} else hilf2=Math.pow(b1,-mda);
mta=hilf2 + Math.pow(b1,-mba);
mta=(Math.round(-2.5 * (Math.log(mta) / Math.log(10)) * 10)) / 10;
m=mta; cta=color(m);
mba=mba+"";
mta=mta+"";
if (mba.substr(2,1)!="." && mba != "") mba = mba + ".0";
if (mta.substr(2,1)!="." && mta != "") mta = mta + ".0";
}
hilf0=ink * i;
hilf1=Math.round(ink * i * 10) / 10;
//if(t=="E") {md=""} else md=Math.round((21.65 + hilf0 / rh) * 10) / 10;
if(t=="E") {md=""} else md=Math.round((dzent + drest * hilf0 / (d25 / 2)) * 10) / 10;
m=md; cd=color(m);
mb=Math.round((sie + 8.3268 * (Math.pow(hilf0 / (lDe / 2), (1 / se)) - 1)) * 10) / 10;
m=mb; cb=color(m);
if(md=="") {hilf2=0} else hilf2=Math.pow(b1,-md);
mt=hilf2 + Math.pow(b1,-mb);
mt=(Math.round(-2.5 * (Math.log(mt) / Math.log(10)) * 10)) / 10;
m=mt; ct=color(m);
md=md+"";
mb=mb+"";
mt=mt+"";
hilf1=hilf1+"";
if (md.substr(2,1)!="." && md!="") md = md + ".0";
if (mb.substr(2,1)!="." && mb!="") mb = mb + ".0";
if (mt.substr(2,1)!="." && mt!="") mt = mt + ".0";
if (hilf1.indexOf(".")==0) hilf1 = "0" + hilf1;
if (hilf1.indexOf(".")==-1) hilf1 = hilf1 + ".0";

if(i==1)
{
i0=Math.round(hilf1a * 100) / 100;
i0=i0+"";
if (i0.indexOf(".")==0) i0 = "0" + i0;
md0=mda; cd0=cda;
mb0=mba; cb0=cba;
mt0=mta; ct0=cta
i1=hilf1;
md1=md; cd1=cd;
mb1=mb; cb1=cb;
mt1=mt; ct1=ct;
}
if(i==2) {i2=hilf1; md2=md; cd2=cd; mb2=mb; cb2=cb; mt2=mt; ct2=ct}
if(i==3) {i3=hilf1; md3=md; cd3=cd; mb3=mb; cb3=cb; mt3=mt; ct3=ct}
if(i==4) {i4=hilf1; md4=md; cd4=cd; mb4=mb; cb4=cb; mt4=mt; ct4=ct}
if(i==5) {i5=hilf1; md5=md; cd5=cd; mb5=mb; cb5=cb; mt5=mt; ct5=ct}
if(i==6) {i6=hilf1; md6=md; cd6=cd; mb6=mb; cb6=cb; mt6=mt; ct6=ct}
if(i==7) {i7=hilf1; md7=md; cd7=cd; mb7=mb; cb7=cb; mt7=mt; ct7=ct}
if(i==8) {i8=hilf1; md8=md; cd8=cd; mb8=mb; cb8=cb; mt8=mt; ct8=ct}
if(i==9) {i9=hilf1; md9=md; cd9=cd; mb9=mb; cb9=cb; mt9=mt; ct9=ct}
if(i==10) {i10=hilf1; md10=md; cd10=cd; mb10=mb; cb10=cb; mt10=mt; ct10=ct}
}

with(parent.dst.document.gp)
{
ink0.value=i0;
ink1.value=i1;
ink2.value=i2;
ink3.value=i3;
ink4.value=i4;
ink5.value=i5;
ink6.value=i6;
ink7.value=i7;
ink8.value=i8;
ink9.value=i9;
ink10.value=i10;

di0.value=md0;
di1.value=md1;
di2.value=md2;
di3.value=md3;
di4.value=md4;
di5.value=md5;
di6.value=md6;
di7.value=md7;
di8.value=md8;
di9.value=md9;
di10.value=md10;

bu0.value=mb0;
bu1.value=mb1;
bu2.value=mb2;
bu3.value=mb3;
bu4.value=mb4;
bu5.value=mb5;
bu6.value=mb6;
bu7.value=mb7;
bu8.value=mb8;
bu9.value=mb9;
bu10.value=mb10;

gx0.value=mt0;
gx1.value=mt1;
gx2.value=mt2;
gx3.value=mt3;
gx4.value=mt4;
gx5.value=mt5;
gx6.value=mt6;
gx7.value=mt7;
gx8.value=mt8;
gx9.value=mt9;
gx10.value=mt10;
}

if (navigator.appName=="Microsoft Internet Explorer")

with(parent.dst.document.all.gp)
{
di0.style.backgroundColor=cd0;
di1.style.backgroundColor=cd1;
di2.style.backgroundColor=cd2;
di3.style.backgroundColor=cd3;
di4.style.backgroundColor=cd4;
di5.style.backgroundColor=cd5;
di6.style.backgroundColor=cd6;
di7.style.backgroundColor=cd7;
di8.style.backgroundColor=cd8;
di9.style.backgroundColor=cd9;
di10.style.backgroundColor=cd10;

bu0.style.backgroundColor=cb0;
bu1.style.backgroundColor=cb1;
bu2.style.backgroundColor=cb2;
bu3.style.backgroundColor=cb3;
bu4.style.backgroundColor=cb4;
bu5.style.backgroundColor=cb5;
bu6.style.backgroundColor=cb6;
bu7.style.backgroundColor=cb7;
bu8.style.backgroundColor=cb8;
bu9.style.backgroundColor=cb9;
bu10.style.backgroundColor=cb10;

gx0.style.backgroundColor=ct0;
gx1.style.backgroundColor=ct1;
gx2.style.backgroundColor=ct2;
gx3.style.backgroundColor=ct3;
gx4.style.backgroundColor=ct4;
gx5.style.backgroundColor=ct5;
gx6.style.backgroundColor=ct6;
gx7.style.backgroundColor=ct7;
gx8.style.backgroundColor=ct8;
gx9.style.backgroundColor=ct9;
gx10.style.backgroundColor=ct10;
}
}