var IFrameObj; var IFrameDoc; function next(){ } function VisionServer(service,objectname,value) { var RootURL = "getdata/"; var URL = RootURL+service+"?"+objectname+"="+value; var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { eval(this.responseText); } }; xhttp.open("GET", URL, true); xhttp.send(); } var refreshtime = 4000; function processing(){ VisionServer("timer","pagerefresh","1"); setTimeout("processing()",refreshtime); } function startprocessing(time){ refreshtime=time; if (time) { VisionServer('onload','pageload','1'); setTimeout("processing()",2000); } } // typomatic functions var typon; var typtim; var typobj; var typmin = 0; var typmax = 100; var typstep = 1.0; var objname; function TypomatUP(){ if (parseInt(typobj.value)typmin) { typobj.value=(parseFloat(typobj.value)-typstep)+''; typtim=setTimeout("TypomatDN()",100); typon=1; } else typon=0; } function StartUP(object,max,step){ typobj=window.document.getElementById(object); if (typobj) { if (!typobj.disabled && parseInt(typobj.value)min) { typmin=min; typstep=step; typobj.value=(parseFloat(typobj.value)-typstep)+''; typtim=setTimeout("TypomatDN()",500); typon=1; } } } function TypomatUPA(){ if (typobj) { if (parseInt(typobj.value)typmin) { VisionServer('DOWN',objname,'-1'); typobj.value=(parseFloat(typobj.value)-typstep)+''; typtim=setTimeout("TypomatDNA()",250); typon=1; } else typon=0; } else { VisionServer('DOWN',objname,'-1'); typtim=setTimeout("TypomatDNA()",250); typon=1; } } function StartUPA(object,oname,max,step){ objname=oname; typobj=window.document.getElementById(object); if (typobj) { if (!typobj.disabled && parseInt(typobj.value)min) { typmin=min; typstep=step; typobj.value=(parseFloat(typobj.value)-typstep)+''; VisionServer('DOWN',objname,'-1'); typtim=setTimeout("TypomatDNA()",1000); typon=1; } } else { VisionServer('DOWN',objname,'-1'); typtim=setTimeout("TypomatDNA()",1000); typon=1; } } function StopUPDN(){ if (typon) { clearTimeout(typtim); typon=0; } } var buttonobj; function TypomatButton(){ VisionServer('PRESS',buttonobj,''); typtim=setTimeout("TypomatButton()",500); //250 typon=1; } function StartButton(object){ buttonobj=object; VisionServer('PRESS',buttonobj,''); typtim=setTimeout("TypomatButton()",750); //500 typon=1; } function StopButton(){ if (typon) { clearTimeout(typtim); typon=0; } } // frame fading function FadeOutFrame(wnd,obj,duration){ var step=10/duration, opacity=1, count=0; function next() { if (opacity>0) { count += 1; if (count==9) wnd.setAttribute("class",""); opacity -= step; if (opacity<0) opacity=0; obj.style.opacity=opacity; setTimeout(next,10); } else { obj.style.left=0; obj.style.top=0; obj.style.height=0; obj.src="empty.html"; wnd.style.left=0; wnd.style.top=0; obj.style.display='none'; } } next(); } function FadeInFrame(obj,duration){ var step=10/duration, opacity=0; function next() { if (opacity>=1) return; obj.style.opacity = opacity += step; setTimeout(next,10); } next(); obj.style.display='block'; } var actualsize,actualpos; function ScrollUpDownOut(wnd,obj,duration,downdir){ var aobj=obj, origheight=parseInt(obj.style.height), thestep=origheight/duration*10, theheight=origheight; function next() { if (theheight>0) { if (origheight==actualsize) theheight=actualsize-actualpos; else if (theheight>origheight-24) theheight-=1; else { if (theheight<4*thestep) { thestep*=0.5; if (thestep<1) thestep=1; }; theheight-=thestep; } if (theheight<0) theheight=0; aobj.style.height=theheight; if (downdir) aobj.style.marginTop=origheight-theheight else aobj.contentWindow.scrollTo(0,origheight-theheight); setTimeout(next,10); } else { aobj.style.left=0; aobj.style.top=0; aobj.style.height=0; aobj.src="empty.html"; wnd.style.left=0; wnd.style.top=0; aobj.style.display='none'; if (downdir) aobj.style.marginTop=0 else aobj.contentWindow.scrollTo(0,0); actualsize=0; actualpos=0; } } setTimeout(next,50); } function ScrollLeftRightOut(wnd,obj,duration,rightdir){ var aobj=obj, origwidth=parseInt(obj.style.width), thestep=origwidth/duration*10, thewidth=origwidth; function next() { if (thewidth>0) { if (origwidth==actualsize) thewidth=actualsize-actualpos; else if (thewidth>origwidth-24) thewidth-=1; else { if (thewidth<4*thestep) { thestep*=0.5; if (thestep<1) thestep=1; }; thewidth-=thestep; } if (thewidth<0) thewidth=0; aobj.style.width=thewidth; if (rightdir) aobj.style.marginLeft=origwidth-thewidth else aobj.contentWindow.scrollTo(origwidth-thewidth,0); setTimeout(next,10); } else { aobj.style.left=0; aobj.style.top=0; aobj.style.width=0; aobj.src="empty.html"; wnd.style.left=0; wnd.style.top=0; aobj.style.display='none'; if (rightdir) aobj.style.marginLeft=0 else aobj.contentWindow.scrollTo(0,0); actualsize=0; actualpos=0; } } setTimeout(next,50); } function ScrollUpDownIn(obj,duration,downdir){ var aobj=obj, origheight=parseInt(obj.style.height), thestep=origheight/duration*10, theheight=0; obj.style.height=0; if (downdir) obj.contentWindow.scrollTo(0,origheight) else obj.style.marginTop=origheight; function next() { if (theheightorigheight-4*thestep) { thestep*=0.5; if (thestep<1) thestep=1; }; theheight+=thestep; if (theheight>origheight) theheight=origheight; actualpos=theheight; aobj.style.height=theheight; if (downdir) aobj.contentWindow.scrollTo(0,origheight-theheight) else aobj.style.marginTop=origheight-theheight; setTimeout(next,10); } else { aobj.style.height=origheight; if (downdir) aobj.contentWindow.scrollTo(0,0) else aobj.style.marginTop=0; } } actualsize=origheight; actualpos=0; next(); obj.style.display='block'; obj.style.opacity=1; } function ScrollLeftRightIn(obj,duration,rightdir){ var aobj=obj, origwidth=parseInt(obj.style.width), thestep=origwidth/duration*10, thewidth=0; obj.style.width=0; if (rightdir) obj.contentWindow.scrollTo(origwidth,0) else obj.style.marginLeft=origwidth; function next() { if (thewidthorigwidth-4*thestep) { thestep*=0.5; if (thestep<1) thestep=1; }; thewidth+=thestep; if (thewidth>origwidth) thewidth=origwidth; actualpos=thewidth; aobj.style.width=thewidth; if (rightdir) aobj.contentWindow.scrollTo(origwidth-thewidth,0) else aobj.style.marginLeft=origwidth-thewidth; setTimeout(next,10); } else { aobj.style.width=origwidth; if (rightdir) aobj.contentWindow.scrollTo(0,0) else aobj.style.marginLeft=0; } } actualsize=origwidth; actualpos=0; next(); obj.style.display='block'; obj.style.opacity=1; } function showframe(obj,duration){ if (obj.src.search('popupfade')>0) FadeInFrame(obj,duration); else if (obj.src.search('popupfix')>0) FadeInFrame(obj,duration); else if (obj.src.search('popupdown')>0) ScrollUpDownIn(obj,duration,1); else if (obj.src.search('popupup')>0) ScrollUpDownIn(obj,duration,0); else if (obj.src.search('popupright')>0) ScrollLeftRightIn(obj,duration,1); else if (obj.src.search('popupleft')>0) ScrollLeftRightIn(obj,duration,0); else { obj.style.display='block'; obj.style.opacity=1; } }