A=new Array();M=new Array();MM=new String("");
var ELEM,k=0,NMax;
var RES;
var Mouse_x,Mouse_y,Last_x,Last_y;
var DrawHint_x,DrawHint_y;
//==============================================================
// Определяем браузер
//==============================================================
var isOpera, isIE, isNav, isFox, isOther = false;
if (navigator.userAgent.indexOf("Opera")!=-1) {
isOpera = true;
} else if (navigator.userAgent.indexOf("Firefox")!=-1) {
isFox = true;
} else if (navigator.appName == "Microsoft Internet Explorer") {
isIE = true;
} else if (navigator.appName == "Netscape") {
isNav = true;
} else {
isOther = true;
}
//==========================================================================
/* Создание нового объекта XMLHttpRequest для общения с Web-сервером */
//==========================================================================
var xmlHttp = false;
var browser = navigator.appName;
if (browser == "Microsoft Internet Explorer") xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
else xmlHttp = new XMLHttpRequest();
//==============================================================
function autoRePositon() {
x=getBodyScrollLeft()/(getDocumentWidth()-getClientWidth());
y=getBodyScrollTop()/(getDocumentHeight()-getClientHeight());
if (Math.abs(Last_x-x)>Math.abs(Last_y-y)) {
if (Math.abs(x-(1-y))>0.15)
scrollTo(getBodyScrollLeft(),parseInt((getDocumentHeight()-getClientHeight())*(1-x)));
}
else {
if (Math.abs(x-(1-y))>0.15)
scrollTo(parseInt(getDocumentWidth()*(1-y)),getBodyScrollTop());
}
Last_x=x;
Last_y=y;
//alert(getDocumentWidth()+" "+getClientWidth()+" "+getDocumentHeight()+" "+getClientHeight()+" "+x+" "+y+" "+getBodyScrollLeft()+" "+parseInt((getDocumentHeight()-getClientHeight())*(1-x)));
}
function getClientWidth() {
//return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
return document.documentElement.clientWidth;
}
function getClientHeight() {
//return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
return document.documentElement.clientHeight;
}
function getBodyScrollTop() {
return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
}
function getBodyScrollLeft() {
return self.pageXOffset || (document.documentElement && document.documentElement.scrollLeft) || (document.body && document.body.scrollLeft);
}
//Размер документа по вертикали
function getDocumentHeight() {
r=document.body.offsetHeight;
if (document.body.scrollHeight > r) r=document.body.scrollHeight;
if (document.documentElement.scrollHeight>r) r=document.documentElement.scrollHeight;
return(r);
//return (document.body.scrollHeight > document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight;
}
//Размер документа по горизонтали
function getDocumentWidth() {
r=document.body.offsetWidth;
if (document.body.scrollWidth > r) r=document.body.scrollWidth;
if (document.documentElement.scrollWidth>r) r=document.documentElement.scrollWidth;
return(r);
//return (document.body.scrollWidth > document.body.offsetWidth)?document.body.scrollWidth:document.body.offsetWidth;
}
function getClientCenterX() {
return parseInt(getClientWidth()/2)+getBodyScrollLeft();
}
function getClientCenterY() {
return parseInt(getClientHeight()/2)+getBodyScrollTop();
}
/*function partmap_za(b,e) {
res="";
for (i=b;i>=e;i--) {
res=res+"
";
if (isNaN(A[i])) { N=0; MMl=0; }
else {
N=1*A[i]; MM=M[i]; MMl=MM.length/2;
if (N>0) res=res+" | ";
for (j=N;j";
k=j;
ELEM=CE[i]+k;
res=res+""+""+k+""+CE[i]+"
";
}
}
res=res+" | "+"
";
}
return(res);
}
function partmap_zn(b,e) {
res="";
for (i=b;i>=e;i--) {
res=res+"";
if (isNaN(A[i])) { N=0; MMl=0; }
else {
N=1*A[i]-i; MM=M[i]; MMl=MM.length/2;
if (N>0) res=res+" | \n";
for (j=N;j";
k=i+j;
ELEM=CE[i]+k;
res=res+""+k+""+CE[i]+"
\n";
}
}
res=res+" |
\n";
}
return(res);
}*/
//====================================================================================
// Systematics
//====================================================================================
function clear_all(i) {
c=document.f;
c.NUC.selectedIndex=0;
c.A.selectedIndex=0;
c.SPIN.selectedIndex=0;
c.NUM.selectedIndex=0;
}
function ch_nuc() {
c=document.f;
if (c.SYST[0].checked==1) {
if ((c.NUC.selectedIndex==0)||(c.NUC.selectedIndex==1)) { c.NUC.selectedIndex=1; c.A.selectedIndex=1; }
else { if (1*c.A.selectedIndex<-1+c.NUC.selectedIndex) c.A.selectedIndex=2*c.NUC.selectedIndex-2; }
}
else { if (c.NUC.selectedIndex>0) c.NUC.selectedIndex=0; }
}
function ch_a() {
c=document.f;
if (c.SYST[0].checked==1) {
if (c.A.selectedIndex==0) { c.A.selectedIndex=1; c.NUC.selectedIndex=1; }
else { if (1*c.A.selectedIndex<-1+c.NUC.selectedIndex) c.NUC.selectedIndex=1+Math.ceil(0.5*c.A.selectedIndex); }
}
else { if (c.A.selectedIndex>0) c.A.selectedIndex=0; }
}
function ch_spin() {
c=document.f;
if (c.SYST[3].checked==1) { if (c.SPIN.selectedIndex==0) c.SPIN.selectedIndex=1; }
else { if (c.SPIN.selectedIndex>0) c.SPIN.selectedIndex=0; }
}
function ch_num() {
c=document.f;
if (c.SYST[3].checked==1) { if (c.NUM.selectedIndex==0) c.NUM.selectedIndex=1; }
else { if (c.NUM.selectedIndex>0) c.NUM.selectedIndex=0; }
}
function ch_isotopes() {
ch_ZNA();
ch_znaval();
}
function ch_znaval() {
c=document.f;
if (c.ISOTOPES.selectedIndex==3) c.ZNAVAL.selectedIndex=0;
else {
if (c.ZNAVAL.selectedIndex==0) c.ZNAVAL.selectedIndex=1;
if (c.ISOTOPES.selectedIndex==0) { if (1*c.ZNAVAL.selectedIndex>136) c.ZNAVAL.selectedIndex=136; }
else if (c.ISOTOPES.selectedIndex==1) { if (1*c.ZNAVAL.selectedIndex>208) c.ZNAVAL.selectedIndex=208; }
else if (c.ISOTOPES.selectedIndex==2) { if (1*c.ZNAVAL.selectedIndex>339) c.ZNAVAL.selectedIndex=339; }
}
}
function ch_submit() {
c=document.f;
k=c.ISOTOPES.selectedIndex;
RES=false;
if (k==0) { if (1+c.ZNAVAL.selectedIndex<=1*c.NUC.selectedIndex) { alert("Check nucleus, please!"); return; } }
if (k==1) { if (1+c.ZNAVAL.selectedIndex<=1*c.A.selectedIndex-c.NUC.selectedIndex) { alert("Check nucleus, please!"); return; } }
if (k==2) { if (1+c.ZNAVAL.selectedIndex<=1*c.A.selectedIndex) { alert("Check nucleus, please!"); return; } }
RES=true;
}
function ch_ZNA() {
c=document.f;
i=c.ISOTOPES.selectedIndex;
//k=c.ZNAVAL.selectedIndex;
obj=document.getElementById("ZNA");
w="";
if (i=='0') {
w="Z=