JXG.debug=function(){},JXG.GeonextReader={changeOriginIds:function(e,t){return"gOOe0"==t||"gXOe0"==t||"gYOe0"==t||"gXLe0"==t||"gYLe0"==t?e.id+t:t},gEBTN:function(e,t,n,i){var r;return JXG.exists(e||!e.getElementsByTagName)?(JXG.exists(i)||(i=!0),n=n||0,r=e.getElementsByTagName(t),r.length>0&&(r=r[n],i&&r.firstChild&&(r=r.firstChild.data)),r):""},colorProperties:function(e,t){var n,i=this.gEBTN(t,"color",0,!1);return n=JXG.rgba2rgbo(this.gEBTN(i,"stroke")),e.strokeColor=n[0],e.strokeOpacity=n[1],n=JXG.rgba2rgbo(this.gEBTN(i,"lighting")),e.highlightStrokeColor=n[0],e.highlightStrokeOpacity=n[1],n=JXG.rgba2rgbo(this.gEBTN(i,"fill")),e.fillColor=n[0],e.fillOpacity=n[1],e.highlightFillColor=e.fillColor,e.highlightFillOpacity=e.fillOpacity,e.labelColor=JXG.rgba2rgbo(this.gEBTN(i,"label"))[0],e.colorDraft=JXG.rgba2rgbo(this.gEBTN(i,"draft"))[0],0==JXG.rgba2rgbo(this.gEBTN(i,"label"))[1]&&(e.withLabel=!1),e.colorStroke=e.strokeColor,e.colorFill=e.fillColor,e.colorLabel=e.labelColor,e},firstLevelProperties:function(e,t){if(!JXG.exists(t)||!JXG.exists(t.childNodes))return e;var n,i,r=t.childNodes;for(n=0;r.length>n;n++)JXG.exists(r[n].firstChild)&&"data"!==r[n].nodeName&&"straight"!==r[n].nodeName&&(i=r[n].nodeName,e[i]=r[n].firstChild.data);return e},defProperties:function(e,t){return 3==t.nodeType||8==t.nodeType?null:(e.ident=t.nodeName,e.name="text"==e.ident||"intersection"==e.ident||"composition"==e.ident?"":this.gEBTN(t,"name"),e.id=this.gEBTN(t,"id"),e)},visualProperties:function(e,t){return e.visible=JXG.str2Bool(this.gEBTN(t,"visible")),e.trace=JXG.str2Bool(this.gEBTN(t,"trace")),e},transformProperties:function(e,t){var n=["cross","cross","cross","circle","circle","circle","circle","square","square","square","plus","plus","plus"],i=[2,3,4,1,2,3,4,2,3,4,2,3,4];return e.strokeWidth=e.strokewidth,e.face=n[parseInt(e.style,10)]||"cross",e.size=i[parseInt(e.style,10)]||3,e.straightFirst=JXG.str2Bool(e.straightFirst),e.straightLast=JXG.str2Bool(e.straightLast),e.visible=JXG.str2Bool(e.visible),e.draft=JXG.str2Bool(e.draft),e.trace=JXG.str2Bool(e.trace),"point"===t&&(e.fillColor=e.strokeColor,e.highlightFillColor=e.highlightStrokeColor,e.fillOpacity=e.strokeOpacity,e.highlightFillOpacity=e.highlightStrokeOpacity),delete e.label,delete e.color,e},readNodes:function(e,t,n,i){var r,o,a=this.gEBTN(t,n,0,!1).childNodes;for(o=0;a.length>o;o++)null!=a[o].firstChild&&(r=null!=i?i+JXG.capitalize(a[o].nodeName):a[o].nodeName,e[r]=a[o].firstChild.data);return e},subtreeToString:function(e){try{return(new XMLSerializer).serializeToString(e)}catch(t){return e.xml}},readImage:function(e){var t="",n=e;if(null!=n)for(t=n.data;null!=n.nextSibling;)n=n.nextSibling,t+=n.data;return t},parseImage:function(e,t,n,i,r,o,a,s){var l,c,u,d,h;if(null==t)return null;if(null!=t.getElementsByTagName("src")[0])l="src";else{if(null==t.getElementsByTagName("image")[0])return null;l="image"}return d=this.readImage(this.gEBTN(t,l,0,!1).firstChild),""!=d?(d="data:image/png;base64,"+d,"src"==l?(i=this.gEBTN(t,"x"),r=this.gEBTN(t,"y"),o=this.gEBTN(t,"width"),a=this.gEBTN(t,"height"),u=e.create("image",[d,[i,r],[o,a]],{anchor:s,layer:n})):(h=new Image,h.src=d,c=s.id+"_image",h.onload=function(){var t,l,u,h,p,f,g=this.width,m=this.height;s.elementClass==JXG.OBJECT_CLASS_LINE?(t=function(){return s.point1.X()},u=function(){return s.point1.Dist(s.point2)},h=function(){return u()*m/g},l=function(){return s.point1.Y()-.5*h()},p=e.create("image",[d,[t,l],[u,h]],{layer:n,id:c,anchor:s}),f=e.create("transform",[function(){return Math.atan2(s.point2.Y()-s.point1.Y(),s.point2.X()-s.point1.X())},s.point1],{type:"rotate"}),f.bindTo(p),s.image=p):s.elementClass==JXG.OBJECT_CLASS_POINT?(u=function(){return g/e.unitX},h=function(){return m/e.unitY},t=function(){return s.X()-.5*u()},l=function(){return s.Y()-.5*h()},p=e.create("image",[d,[t,l],[u,h]],{layer:n,id:c,anchor:s}),e.renderer.hide(s.label.content),s.image=p):s.elementClass==JXG.OBJECT_CLASS_CIRCLE?(u=function(){return 2*s.Radius()},h=function(){return u()*m/g},t=function(){return s.center.X()-.5*u()},l=function(){return s.center.Y()-.5*h()},p=e.create("image",[d,[t,l],[u,h]],{layer:n,id:c,anchor:s}),s.image=p):(p=e.create("image",[d,[i,r],[o,a]],{layer:n,id:c,anchor:s}),s.image=p)},u)):void 0},readConditions:function(e){var t,n,i,r="";if(JXG.exists(e))for(t=0;e.getElementsByTagName("data").length>t;t++)i=e.getElementsByTagName("data")[t],n=this.subtreeToString(i),r+=n;return r},printDebugMessage:function(e,t,n,i){JXG.debug("* "+i+": "+n+" "+t.name+" "+t.id+"
\n")},readGeonext:function(e,t){var n,i,r,o,a,s,l,c="true",u=this;for(t.options.layer.sector=t.options.layer.angle,t.options.layer.circle=t.options.layer.angle,a=this.gEBTN(e,"board",0,!1),s=this.readConditions(a.getElementsByTagName("conditions")[0]),n=this.gEBTN(a,"coordinates",0,!1),l=this.gEBTN(n,"origin",0,!1),t.origin={usrCoords:[1,0,0],scrCoords:[1,parseFloat(this.gEBTN(l,"x")),parseFloat(this.gEBTN(l,"y"))]},l=this.gEBTN(n,"zoom",0,!1),t.zoomX=parseFloat(this.gEBTN(l,"x")),t.zoomY=parseFloat(this.gEBTN(l,"y")),l=this.gEBTN(n,"unit",0,!1),t.unitX=parseFloat(this.gEBTN(l,"x")),t.unitY=parseFloat(this.gEBTN(l,"y")),t.options.takeSizeFromFile&&t.resizeContainer(this.gEBTN(a,"width"),this.gEBTN(a,"height")),parseFloat(t.options.text.fontSize)>0||(t.options.text.fontSize=12),t.geonextCompatibilityMode=!0,delete JXG.JSXGraph.boards[t.id],t.id=this.gEBTN(a,"id"),JXG.JSXGraph.boards[t.id]=t,t.initGeonextBoard(),t.renderer.enhancedRendering=!0,this.parseImage(t,this.gEBTN(a,"file",0,!1),t.options.layer.image),t.options.point.snapToGrid=this.gEBTN(this.gEBTN(a,"coordinates",0,!1),"snap")==c,t.options.point.snapToGrid&&this.gEBTN(this.gEBTN(a,"grid",1,!1),"pointsnap")==c&&(t.options.point.snapToGrid=!1),n=this.gEBTN(a,"grid",1,!1),l=this.gEBTN(n,"x"),l&&(t.options.grid.gridX=1/parseFloat(l),t.options.point.snapSizeX=parseFloat(l)),l=this.gEBTN(n,"y"),l&&(t.options.grid.gridY=1/parseFloat(l),t.options.point.snapSizeY=parseFloat(l)),t.options.grid.gridDash=JXG.str2Bool(this.gEBTN(n,"dash")),l=JXG.rgba2rgbo(this.gEBTN(n,"color")),t.options.grid.gridColor=l[0],t.options.grid.gridOpacity=l[1],n=this.gEBTN(a,"coordinates",0,!1),this.gEBTN(n,"grid")==c&&t.create("grid",[]),this.gEBTN(n,"coord")==c&&(t.options.axis.ticks.majorHeight=10,t.options.axis.ticks.minorHeight=4,t.create("axis",[[0,0],[1,0]]),t.create("axis",[[0,0],[0,1]])),t.containerObj.style.backgroundColor=JXG.rgba2rgbo(this.gEBTN(this.gEBTN(a,"background",0,!1),"color"))[0],i=e.getElementsByTagName("elements")[0].childNodes,r=0;i.length>r;r++)(function(e){var r,a,s,l,c,d,h,p,f,g={};if(o=i[e],g=u.defProperties(g,o),JXG.exists(g)){switch(u.printDebugMessage("debug",g,o.nodeName.toLowerCase,"READ:"),o.nodeName.toLowerCase()){case"point":g=u.colorProperties(g,o),g=u.visualProperties(g,o),g=u.firstLevelProperties(g,o),g=u.readNodes(g,o,"data"),g.fixed=JXG.str2Bool(u.gEBTN(o,"fix")),g=u.transformProperties(g,"point"),d=t.create("point",[parseFloat(g.x),parseFloat(g.y)],g),c=u.parseImage(t,o,t.options.layer.image,0,0,0,0,d),u.printDebugMessage("debug",g,o.nodeName,"OK");break;case"line":g=u.colorProperties(g,o),g=u.visualProperties(g,o),g=u.firstLevelProperties(g,o),g=u.readNodes(g,o,"data"),g=u.readNodes(g,o,"straight","straight"),g=u.transformProperties(g),g.first=u.changeOriginIds(t,g.first),g.last=u.changeOriginIds(t,g.last),a=t.create("line",[g.first,g.last],g),u.parseImage(t,o,t.options.layer.image,0,0,0,0,a),u.printDebugMessage("debug",g,o.nodeName,"OK");break;case"circle":g=u.colorProperties(g,o),g=u.visualProperties(g,o),g=u.firstLevelProperties(g,o),f=u.gEBTN(o,"data",0,!1),g.center=u.changeOriginIds(t,u.gEBTN(f,"midpoint")),f.getElementsByTagName("radius").length>0?g.radius=u.changeOriginIds(t,u.gEBTN(f,"radius")):f.getElementsByTagName("radiusvalue").length>0&&(g.radius=u.gEBTN(f,"radiusvalue")),g=u.transformProperties(g),s=t.create("circle",[g.center,g.radius],g),u.parseImage(t,o,t.options.layer.image,0,0,0,0,s),u.printDebugMessage("debug",g,o.nodeName,"OK");break;case"slider":g=u.colorProperties(g,o),g=u.visualProperties(g,o),g=u.firstLevelProperties(g,o),g=u.readNodes(g,o,"data"),g.fixed=JXG.str2Bool(u.gEBTN(o,"fix")),g=u.readNodes(g,o,"animate","animate"),g=u.transformProperties(g,"point");try{g.parent=u.changeOriginIds(t,g.parent),d=t.create("glider",[parseFloat(g.x),parseFloat(g.y),g.parent],g),d.onPolygon=JXG.exists(g.onpolygon)&&JXG.str2Bool(g.onpolygon),u.parseImage(t,o,t.options.layer.point,0,0,0,0,d),u.printDebugMessage("debug",g,o.nodeName,"OK")}catch(m){JXG.debug("* Err: Slider "+g.name+" "+g.id+": "+g.parent+"
\n")}break;case"cas":g=u.colorProperties(g,o),g=u.visualProperties(g,o),g=u.firstLevelProperties(g,o),g.fixed=JXG.str2Bool(o.getElementsByTagName("fix")[0].firstChild.data),g=u.readNodes(g,o,"data"),g=u.transformProperties(g,"point"),g.x=JXG.GeonextParser.geonext2JS(g.x,t),g.x=Function("return "+g.x+";"),g.y=JXG.GeonextParser.geonext2JS(g.y,t),g.y=Function("return "+g.y+";"),d=t.create("point",[g.x,g.y],g),u.parseImage(t,o,t.options.layer.point,0,0,0,0,d),u.printDebugMessage("debug",g,o.nodeName,"OK");break;case"intersection":g=u.readNodes(g,o,"data"),n=o.getElementsByTagName("first")[1],g.outFirst={},g.outFirst=u.colorProperties(g.outFirst,n),g.outFirst=u.visualProperties(g.outFirst,n),g.outFirst=u.firstLevelProperties(g.outFirst,n),g.outFirst.fixed=JXG.str2Bool(n.getElementsByTagName("fix")[0].firstChild.data),g.outFirst=u.transformProperties(g.outFirst,"point"),g.first=u.changeOriginIds(t,g.first),g.last=u.changeOriginIds(t,g.last),JXG.getReference(t,g.first).elementClass==JXG.OBJECT_CLASS_LINE&&JXG.getReference(t,g.last).elementClass==JXG.OBJECT_CLASS_LINE?(h=t.create("intersection",[t.objects[g.first],t.objects[g.last],0],g.outFirst),"false"==g.outFirst.visible&&h.hideElement()):(n=o.getElementsByTagName("last")[1],JXG.exists(n)&&(g.outLast={},g.outLast=u.colorProperties(g.outLast,n),g.outLast=u.visualProperties(g.outLast,n),g.outLast=u.firstLevelProperties(g.outLast,n),g.outLast.fixed=JXG.str2Bool(n.getElementsByTagName("fix")[0].firstChild.data),g.outLast=u.transformProperties(g.outLast,"point"),h=t.create("intersection",[t.objects[g.first],t.objects[g.last],0],g.outFirst),h=t.create("intersection",[t.objects[g.first],t.objects[g.last],1],g.outLast))),u.printDebugMessage("debug",g,o.nodeName,"OK");break;case"composition":for(g=u.readNodes(g,o,"data"),g=u.firstLevelProperties(g,o),g.defEl=[],l=0,n=o.getElementsByTagName("data")[0].getElementsByTagName("input"),r=0;n.length>r;r++)g.defEl[r]=n[r].firstChild.data,l=r+1;switch(n=o.getElementsByTagName("output")[0],g.out={},g.out=u.colorProperties(g.out,n),g.out=u.visualProperties(g.out,n),g.out=u.firstLevelProperties(g.out,n),g.out=u.transformProperties(g.out),g.defEl[0]=u.changeOriginIds(t,g.defEl[0]),g.defEl[1]=u.changeOriginIds(t,g.defEl[1]),g.defEl[2]=u.changeOriginIds(t,g.defEl[2]),g.type){case"210070":g.out.fixed=u.gEBTN(n,"fix"),n=o.getElementsByTagName("output")[1],g.outPoint={},g.outPoint=u.defProperties(g.outPoint,n),g.outPoint=u.colorProperties(g.outPoint,n),g.outPoint=u.visualProperties(g.outPoint,n),g.outPoint=u.firstLevelProperties(g.outPoint,n),g.outPoint=u.transformProperties(g.outPoint),g.out.point=g.outPoint,t.create("arrowparallel",[g.defEl[1],g.defEl[0]],g.out);break;case"210080":g.out.straightFirst=!1,t.create("bisector",[g.defEl[0],g.defEl[1],g.defEl[2]],g.out);break;case"210090":n=o.getElementsByTagName("output")[1],g.outCircle={},g.outCircle=u.defProperties(g.outCircle,n),g.outCircle=u.colorProperties(g.outCircle,n),g.outCircle=u.visualProperties(g.outCircle,n),g.outCircle=u.firstLevelProperties(g.outCircle,n),g.outCircle=u.transformProperties(g.outCircle),g.outCircle.point=g.out,t.create("circumcircle",[g.defEl[0],g.defEl[1],g.defEl[2]],g.outCircle);break;case"210100":t.create("circumcenter",[g.defEl[0],g.defEl[1],g.defEl[2]],g.out);break;case"210110":t.create("midpoint",g.defEl.slice(0,l),g.out);break;case"210120":t.create("reflection",[g.defEl[1],g.defEl[0]],g.out);break;case"210125":t.create("mirrorpoint",[g.defEl[0],g.defEl[1]],g.out);break;case"210130":t.create("normal",[g.defEl[1],g.defEl[0]],g.out);break;case"210140":d=t.create("parallelpoint",[g.defEl[1],g.defEl[0]],{withLabel:!1,visible:!1,name:"",fixed:!0}),c=t.create("parallel",[g.defEl[1],g.defEl[0]],g.out),c.parallelpoint=d;break;case"210150":t.create("parallelpoint",g.defEl.slice(0,l),g.out);break;case"210160":g.out.fixed=u.gEBTN(n,"fix"),n=o.getElementsByTagName("output")[1],g.outLine={},g.outLine=u.defProperties(g.outLine,n),g.outLine=u.colorProperties(g.outLine,n),g.outLine=u.visualProperties(g.outLine,n),g.outLine=u.firstLevelProperties(g.outLine,n),g.outLine=u.readNodes(g.outLine,n,"straight","straight"),g.outLine=u.transformProperties(g.outLine),g.outLine.point=g.out,t.create("perpendicularsegment",[g.defEl[1],g.defEl[0]],g.outLine);break;case"210170":t.create("perpendicularpoint",[g.defEl[1],g.defEl[0]],g.out);break;case"210180":throw Error("JSXGraph: Element ROTATION not yet implemented.");case"210190":for(g.out=u.defProperties(g.out,n),g.out.firstArrow=JXG.str2Bool(u.gEBTN(n,"firstarrow")),g.out.lastArrow=JXG.str2Bool(u.gEBTN(n,"lastarrow")),r=0;4>r;r++)n=o.getElementsByTagName("output")[r],g.out=u.defProperties(g.out,n),g.out=u.colorProperties(g.out,n),g.out=u.visualProperties(g.out,n),g.out=u.firstLevelProperties(g.out,n),g.out=u.transformProperties(g.out),0==r?c=t.create("sector",g.defEl,g.out):1==r?d=t.create("point",[function(){var e=JXG.getRef(t,g.defEl[1]),n=JXG.getRef(t,g.defEl[2]);return e.X()+(n.X()-e.X())*c.Radius/e.Dist(n)},function(){var e=JXG.getRef(t,g.defEl[1]),n=JXG.getRef(t,g.defEl[2]);return e.Y()+(n.Y()-e.Y())*c.Radius/e.Dist(n)}],g.out):2==r?c=t.create("segment",[g.defEl[1],g.defEl[0]],g.out):3==r&&(c=t.create("segment",[g.defEl[1],d],g.out));break;default:throw Error("JSXGraph: GEONExT-Element "+g.type+" not implemented.")}u.printDebugMessage("debug",g,o.nodeName,"OK");break;case"polygon":g=u.colorProperties(g,o),g=u.firstLevelProperties(g,o);var v=[];for(r=0;o.getElementsByTagName("data")[0].getElementsByTagName("vertex").length-1>r;r++)v[r]=o.getElementsByTagName("data")[0].getElementsByTagName("vertex")[r].firstChild.data,v[r]=u.changeOriginIds(t,v[r]);for(g.border=[],g.borders={ids:[]},r=0;o.getElementsByTagName("border").length>r;r++)g.border[r]={},n=o.getElementsByTagName("border")[r],g.border[r].id=n.getElementsByTagName("id")[0].firstChild.data,g.borders.ids.push(g.border[r].id),g.border[r].name=n.getElementsByTagName("name")[0].firstChild.data,g.border[r].straightFirst=JXG.str2Bool(n.getElementsByTagName("straight")[0].getElementsByTagName("first")[0].firstChild.data),g.border[r].straightLast=JXG.str2Bool(n.getElementsByTagName("straight")[0].getElementsByTagName("last")[0].firstChild.data),g.border[r].strokeWidth=n.getElementsByTagName("strokewidth")[0].firstChild.data,g.border[r].dash=JXG.str2Bool(n.getElementsByTagName("dash")[0].firstChild.data),g.border[r].visible=JXG.str2Bool(n.getElementsByTagName("visible")[0].firstChild.data),g.border[r].draft=JXG.str2Bool(n.getElementsByTagName("draft")[0].firstChild.data),g.border[r].trace=JXG.str2Bool(n.getElementsByTagName("trace")[0].firstChild.data),n=o.getElementsByTagName("border")[r].getElementsByTagName("color")[0],p=JXG.rgba2rgbo(n.getElementsByTagName("stroke")[0].firstChild.data),g.border[r].strokeColor=p[0],g.border[r].strokeOpacity=p[1],p=JXG.rgba2rgbo(n.getElementsByTagName("lighting")[0].firstChild.data),g.border[r].highlightStrokeColor=p[0],g.border[r].highlightStrokeOpacity=p[1],p=JXG.rgba2rgbo(n.getElementsByTagName("fill")[0].firstChild.data),g.border[r].fillColor=p[0],g.border[r].fillOpacity=p[1],g.border[r].highlightFillColor=g.border[r].fillColor,g.border[r].highlightFillOpacity=g.border[r].fillOpacity,g.border[r].labelColor=n.getElementsByTagName("label")[0].firstChild.data,g.border[r].colorDraft=n.getElementsByTagName("draft")[0].firstChild.data;for(g=u.transformProperties(g),d=t.create("polygon",v,g),r=0;d.borders.length>r;r++)d.borders[r].setProperty(g.border[r]);u.printDebugMessage("debug",g,o.nodeName,"OK");break;case"graph":g=u.colorProperties(g,o),g=u.firstLevelProperties(g,o),g.funct=o.getElementsByTagName("data")[0].getElementsByTagName("function")[0].firstChild.data,g.funct=JXG.GeonextParser.geonext2JS(g.funct,t),g.funct=Function("x","return "+g.funct+";"),s=t.create("curve",["x",g.funct],{id:g.id,name:g.name,strokeColor:g.strokeColor,strokeWidth:g.strokeWidth,fillColor:"none",highlightFillColor:"none",highlightStrokeColor:g.highlightStrokeColor,visible:JXG.str2Bool(g.visible)}),u.printDebugMessage("debug",g,o.nodeName,"OK");break;case"arrow":g=u.colorProperties(g,o),g=u.visualProperties(g,o),g=u.firstLevelProperties(g,o),g=u.readNodes(g,o,"data"),g=u.readNodes(g,o,"straight","straight"),g=u.transformProperties(g),g.first=u.changeOriginIds(t,g.first),g.last=u.changeOriginIds(t,g.last),a=t.create("arrow",[g.first,g.last],g),u.printDebugMessage("debug",a,o.nodeName,"OK");break;case"arc":g=u.colorProperties(g,o),g=u.visualProperties(g,o),g=u.firstLevelProperties(g,o),g=u.readNodes(g,o,"data"),g.firstArrow=JXG.str2Bool(o.getElementsByTagName("lastarrow")[0].firstChild.data),g.lastArrow=JXG.str2Bool(o.getElementsByTagName("firstarrow")[0].firstChild.data),g=u.transformProperties(g),g.center=u.changeOriginIds(t,g.midpoint),g.angle=u.changeOriginIds(t,g.angle),g.radius=u.changeOriginIds(t,g.radius),s=t.create("arc",[g.center,g.radius,g.angle],g),u.printDebugMessage("debug",s,o.nodeName,"OK");break;case"angle":g=u.colorProperties(g,o),g=u.visualProperties(g,o),g=u.firstLevelProperties(g,o),g=u.readNodes(g,o,"data"),g=u.transformProperties(g),f=g.name;try{g.name=o.getElementsByTagName("text")[0].firstChild.data}catch(m){g.name=""}s=t.create("angle",[g.first,g.middle,g.last],g),s.setProperty({name:f}),u.printDebugMessage("debug",g,o.nodeName,"OK");break;case"text":if(g.id.match(/oldVersion/))break;g=u.colorProperties(g,o),g=u.visualProperties(g,o),g=u.firstLevelProperties(g,o),g=u.readNodes(g,o,"data"),g.mpStr=u.subtreeToString(o.getElementsByTagName("data")[0].getElementsByTagName("mp")[0]),g.mpStr=g.mpStr.replace(/<\/?mp>/g,""),g.fixed=!1;try{o.getElementsByTagName("data")[0].getElementsByTagName("parent")[0].firstChild&&(g.parent=o.getElementsByTagName("data")[0].getElementsByTagName("parent")[0].firstChild.data,g.fixed=!0)}catch(m){}g.condition=o.getElementsByTagName("condition")[0].firstChild.data,g.content=o.getElementsByTagName("content")[0].firstChild.data,g.fix=o.getElementsByTagName("fix")[0].firstChild.data,g.autodigits=o.getElementsByTagName("digits")[0].firstChild.data,g.parent=u.changeOriginIds(t,g.parent),s=t.create("text",[g.x,g.y,g.mpStr],{anchor:g.parent,id:g.id,name:g.name,digits:g.autodigits,isLabel:!1,strokeColor:g.colorLabel,fixed:g.fixed,visible:JXG.str2Bool(g.visible)});break;case"parametercurve":g=u.colorProperties(g,o),g=u.visualProperties(g,o),g=u.firstLevelProperties(g,o),g=u.transformProperties(g),g.functionx=o.getElementsByTagName("functionx")[0].firstChild.data,g.functiony=o.getElementsByTagName("functiony")[0].firstChild.data,g.min=o.getElementsByTagName("min")[0].firstChild.data,g.max=o.getElementsByTagName("max")[0].firstChild.data,g.fillColor="none",g.highlightFillColor="none",t.create("curve",[Function("t","return "+JXG.GeonextParser.geonext2JS(g.functionx,t)+";"),Function("t","return "+JXG.GeonextParser.geonext2JS(g.functiony,t)+";"),Function("return "+JXG.GeonextParser.geonext2JS(g.min,t)+";"),Function("return "+JXG.GeonextParser.geonext2JS(g.max,t)+";")],g),u.printDebugMessage("debug",g,o.nodeName,"OK");break;case"tracecurve":g.tracepoint=o.getElementsByTagName("tracepoint")[0].firstChild.data,g.traceslider=o.getElementsByTagName("traceslider")[0].firstChild.data,t.create("tracecurve",[g.traceslider,g.tracepoint],g),u.printDebugMessage("debug",g,o.nodeName,"OK");break;case"group":for(g=u.colorProperties(g,o),g=u.firstLevelProperties(g,o),g.members=[],r=0;o.getElementsByTagName("data")[0].getElementsByTagName("member").length>r;r++)g.members[r]=o.getElementsByTagName("data")[0].getElementsByTagName("member")[r].firstChild.data,g.members[r]=u.changeOriginIds(t,g.members[r]);s=new JXG.Group(t,g.id,g.name,g.members),u.printDebugMessage("debug",g,o.nodeName,"OK");break;default:JXG.debug("* Err: "+o.nodeName+" not yet implemented
\n")}delete g}})(r);t.addConditions(s)},decodeString:function(e){var t;return 0>e.indexOf("")?(t=new JXG.Util.Unzip(JXG.Util.Base64.decodeAsArray(e)).unzip(),""==t?e:t):e},prepareString:function(e){try{0>e.indexOf("GEONEXT")&&(e=this.decodeString(e)[0][0]),e=this.fixXML(e)}catch(t){e=""}return e},fixXML:function(e){var t=["active","angle","animate","animated","arc","area","arrow","author","autodigits","axis","back","background","board","border","bottom","buttonsize","cas","circle","color","comment","composition","condition","conditions","content","continuous","control","coord","coordinates","cross","cs","dash","data","description","digits","direction","draft","editable","elements","event","file","fill","first","firstarrow","fix","fontsize","free","full","function","functionx","functiony","GEONEXT","graph","grid","group","height","id","image","info","information","input","intersection","item","jsf","label","last","lastarrow","left","lefttoolbar","lighting","line","loop","max","maximized","member","middle","midpoint","min","modifier","modus","mp","mpx","multi","name","onpolygon","order","origin","output","overline","parametercurve","parent","point","pointsnap","polygon","position","radius","radiusnum","radiusvalue","right","section","selectedlefttoolbar","showconstruction","showcoord","showinfo","showunit","showx","showy","size","slider","snap","speed","src","start","stop","straight","stroke","strokewidth","style","term","text","top","trace","tracecurve","tracepoint","traceslider","type","unit","value","VERSION","vertex","viewport","visible","width","wot","x","xooy","xval","y","yval","zoom"],n=t.join("|"),i="<(/?("+n+"))>",r=RegExp(i,"g");return e=JXG.escapeHTML(e),e=e.replace(r,"<$1>"),e=e.replace(/(.*)(.*<\/content>)/g,"$1<arc>$2"),e=e.replace(/(.*)(.*<\/mpx>)/g,"$1<arc>$2"),e=e.replace(/(.*)(.*<\/mpx>)/g,"$1<arc>$2")}};