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= \n"; for (j=1;j<=207;j++) w=w+""; } if (i=='2') { w="A= \n"; } /*function print_ZNAVAL() { var i,d; d=document; d.writeln('"); }*/ //==================================================================================== function point_it(event){ w=173; h=114; yy=event.offsetY?(event.offsetY):event.pageY-document.getElementById("cross").offsetTop-4; if (isFox) { xx=event.pageX-getBodyScrollLeft()-20; //alert(getDocumentWidth()+" "+x+" "+getDocumentHeight()+" "+getClientHeight()); } else { xx=event.offsetX?(event.offsetX):event.pageX-document.getElementById("cross").offsetLeft; xx=xx-14; } if (xx<0) xx=0; if (xx>w) x=w; //alert(parseInt(getDocumentWidth()*x/w)+" "+parseInt(getDocumentHeight()*y/h-getClientHeight()/2)); //scrollTo(parseInt(getDocumentWidth()*x/w),parseInt(getDocumentHeight()*y/h-getClientHeight()/2)); x=parseInt(getDocumentWidth()*xx/w); y=parseInt(getDocumentHeight()*(1-xx/w)-getClientHeight()); Last_x=x; Last_y=y; scrollTo(x,y); } function findAndShow(){ nucleus=118; z=document.S1.Z.value; for (i=0;inucleus)) { alert("Wrong Z value!"); return; } if ((a=="")||(isNaN(a))||(a<0)||(a>NMax+nucleus)) { alert("Wrong A value!"); return; } scrollTo(parseInt(getDocumentWidth()*a/(1*nucleus+NMax)-getClientWidth()/2),parseInt(getDocumentHeight()*(1-z/nucleus)-getClientHeight()/2)); document.S1.q.value=CE[z]+a; document.S1.submit(); } //==================================================================================== function ff(z,a) { /* obj=document.getElementById("showHint"); w="
"; w=w+z+","+a; w=w+"
"; obj.innerHTML=w; obj.style.top=Mouse_y+"px"; obj.style.left=Mouse_x+"px"; obj.style.visibility="visible";*/ // Создать URL для подключения DrawHint_x=Mouse_x; DrawHint_y=Mouse_y; var url = "getShortInfo.php?z="+z+"&a="+a; // Открыть соединение с сервером xmlHttp.open("GET", url, true); // Установить функцию для сервера, которая выполнится после его ответа xmlHttp.onreadystatechange = ss; // SПередать запрос xmlHttp.send(null); } function ss() { if (xmlHttp.readyState == 4) { obj2=document.getElementById("Hint"); obj2.innerHTML=xmlHttp.responseText; obj2.style.top=Mouse_y+10+"px"; s1=1*getBodyScrollLeft()+getClientWidth(); s2=1*Mouse_x+300; //alert(s1+" "+s2); if (s1>s2) obj2.style.left=Mouse_x+5+"px"; else obj2.style.left=Mouse_x-305+"px"; if ((Math.abs(DrawHint_x-Mouse_x)<20)&&(Math.abs(DrawHint_y-Mouse_y)<20)) obj2.style.visibility="visible"; } else gg(); } function gg() { obj2=document.getElementById("Hint"); obj2.innerHTML=""; obj2.style.visibility="hidden"; } function defPosition(event) { var x = y = 0; if (document.attachEvent != null) { // Internet Explorer & Opera x = window.event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft); y = window.event.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); } else if (!document.attachEvent && document.addEventListener) { // Gecko x = event.clientX + window.scrollX; y = event.clientY + window.scrollY; } else { // Do nothing } return {x:x, y:y}; } document.onmousemove = function(event) { var event = event || window.event; Mouse_x=defPosition(event).x; Mouse_y=defPosition(event).y; } //--------------------------------------------------------------------------- MMM= {mouseState:false}; //--------------------------------------------------------------------------- function move_levels(e) { if (MMM.mouseState) myLevels.continueZoom(e.offsetX,e.offsetY); } //--------------------------------------------------------------------------- function down_levels(e) { MMM.mouseState=true; myLevels.startZoom(e.offsetX,e.offsetY); } //--------------------------------------------------------------------------- function up_levels(e) { if (MMM.mouseState) { MMM.mouseState=false; myLevels.endZoom(e.offsetX,e.offsetY); } } //--------------------------------------------------------------------------- function menu_levels(key,options) { if (key=="PNG") { var canvas=document.getElementById("ID_CANVAS_LEVELS"); str=canvas.toDataURL("image/png").replace("data:image/png;base64,",""); $.post("../save/save.php",{ body: str,filename:"chart.png",code:"base64"}) .done(function(data){ window.open("../save/load.php/chart.png?filename=chart.png&extension=bbb","ourPicture"); }); } else if (key=="SVG") { } else if (key=="TEXT") { //alert(1); //str=myLevels.getAllData(true,false,"\t",4,false); str=myLevels.getData(); //alert(str); $.post("../save/save.php",{ body: str,filename:"reaction.dat"}) .done(function(data){ window.open("../save/load.php/reaction.dat?filename=reaction.dat&extension=bbb","ourPicture"); }); } else if (key=="show_all") { myLevels.drawAll(); } else if (key=="show_first") { myLevels.drawFirst10(); } else if (key=="restore_previous") { myLevels.restorePreviousScale(); } else if (key=="restore_previous") { myLevels.restorePreviousScale(); } } //--------------------------------------------------------------------------- function menu_chdistr(key,options) { if (key=="PNG") { var canvas = document.getElementById("ID_CANVAS_CHDISTR"); str = canvas.toDataURL("image/png").replace("data:image/png;base64,",""); $.post("../save/save.php",{ body: str,filename:"chdistr.png",code:"base64"}) .done(function(data){ window.open("../save/load.php/chdistr.png?filename=chdistr.png&extension=bbb","ourPicture"); }); } else if (key=="TEXT") { var id,ir,NR,r,dr=0.1,Xmin = 1.e-6,Xmax = 0.0, cf = new CommonFun(), nuc = new NucleusName(); for(id=0;id