function isDefined(variable){return eval("(typeof("+variable+') != "undefined");')}function getClosure(D,A,B){function C(){D[A](B)}return C}function isString(A){if(typeof (A)=="string"){return true}else{if(typeof arguments[0]=="object"){return(arguments[0].constructor.toString().match(/string/i)!=null)}}}function toLower(A){A=A.replace(/A/g,"a");A=A.replace(/B/g,"b");A=A.replace(/C/g,"c");A=A.replace(/D/g,"d");A=A.replace(/E/g,"e");A=A.replace(/F/g,"f");A=A.replace(/G/g,"g");A=A.replace(/H/g,"h");A=A.replace(/I/g,"i");A=A.replace(/J/g,"j");A=A.replace(/K/g,"k");A=A.replace(/L/g,"l");A=A.replace(/M/g,"m");A=A.replace(/N/g,"n");A=A.replace(/O/g,"o");A=A.replace(/P/g,"p");A=A.replace(/Q/g,"q");A=A.replace(/R/g,"r");A=A.replace(/S/g,"s");A=A.replace(/T/g,"t");A=A.replace(/U/g,"u");A=A.replace(/V/g,"v");A=A.replace(/W/g,"w");A=A.replace(/X/g,"x");A=A.replace(/Y/g,"y");A=A.replace(/Z/g,"z");return A}function toUpper(A){A=A.replace(/a/g,"A");A=A.replace(/b/g,"B");A=A.replace(/c/g,"C");A=A.replace(/d/g,"D");A=A.replace(/e/g,"E");A=A.replace(/f/g,"F");A=A.replace(/g/g,"G");A=A.replace(/h/g,"H");A=A.replace(/i/g,"I");A=A.replace(/j/g,"J");A=A.replace(/k/g,"K");A=A.replace(/l/g,"L");A=A.replace(/m/g,"M");A=A.replace(/n/g,"N");A=A.replace(/o/g,"O");A=A.replace(/p/g,"P");A=A.replace(/q/g,"Q");A=A.replace(/r/g,"R");A=A.replace(/s/g,"S");A=A.replace(/t/g,"T");A=A.replace(/u/g,"U");A=A.replace(/v/g,"V");A=A.replace(/w/g,"W");A=A.replace(/x/g,"X");A=A.replace(/y/g,"Y");A=A.replace(/z/g,"Z");return A}function getQuotatedString(A){if(A&&(A.search('"')==-1)){return'"'+A+'"'}else{return"'"+A+"'"}}function isArray(A){if(typeof (A)=="object"){return(A.constructor.toString().match(/array/i)!=null)}else{return false}}function inArray(B,C){for(var A=0;A<C.length;A++){if(C[A]==B){return true}}return false}function getArrayIndex(B,C){for(var A=0;A<C.length;A++){if(C[A]==B){return A}}}function arrayToString(F,C,E,D){var A="";if(E==undefined){E=false}if(C==undefined){C=""}if(D==undefined){D=false}if(D){A+="["}for(var B=0;B<F.length;B++){if(B>0){A+=C}if(isString(F[B])&&E){A+=getQuotatedString(F[B])}else{if(isArray(F[B])){A+=arrayToString(F[B],C,E,D)}else{A+=F[B]}}}if(D){A+="]"}return A}function addEvent(A,C,B){if(A.addEventListener){A.addEventListener(C,B,false);return true}else{if(A.attachEvent){return A.attachEvent("on"+C,B)}else{return false}}}function getElementById(E,C){if(!C){return document.getElementById(E)}if(typeof (C)=="string"){var A=document.getElementById(C)}else{var A=C}if(A.id==E){return A}var D=A.firstChild;while(D){if(D.id==E){return D}else{var B=getElementById(E,D);if(B){return B}}D=D.nextSibling}return undefined}function getElementAttribute(C,A){var F=C.outerHTML.substring(1,C.outerHTML.length-1);var D=F.split(" ");for(var B=0;B<D.length;B++){var E=D[B].split("=");if(E[0]==A){return E[1]}}}function isElementLoaded(A){if(A.offsetWidth>0&&A.offsetHeight>0){return true}else{if(A.width>0&&A.height>0){return true}else{return false}}}function swapImage(B,C){var A=C.substring(C.length-3,C.length);if(((A=="png")||(A=="PNG"))&&(typeof (swapPNG)!="undefined")){swapPNG(B,C)}else{B.src=C}}function getImageSrc(A){if(A.src){return A.src}else{return A.filters(0).src}}function getWindowWidth(){if(document.body.offsetWidth){return document.body.offsetWidth}else{return window.innerWidth}}function getWindowHeight(){if(document.body.offsetHeight){return document.body.offsetHeight}else{return window.innerHeight}}function setStatus(A){window.status=A}function clearStatus(){window.status=""}function setWindowLocation(A){window.top.location.href=A}function getWindowLocation(){return window.top.location.href}function getBaseLocation(B){var A=B.split("?");return A[0]}function openDialogBox(G,D,A){var F=(screen.width-D)/2;var E=(screen.height-A)/2;var C="resizeable=no, status=no, toolbar=no, menubar=no, location=no, scrollbars=no, directories=no, dialog=yes";var B=window.open(G,"_blank","width="+D+", height="+A+", top="+E+", left="+F+", "+C);if(window.focus){B.focus()}return B}function getCSSStyle(A){for(i=0;i<document.styleSheets.length;i++){if(document.styleSheets[i].rules){for(j=0;j<document.styleSheets[i].rules.length;j++){if(document.styleSheets[i].rules[j].selectorText==A){return document.styleSheets[i].rules[j].style}}}else{for(j=0;j<document.styleSheets[i].cssRules.length;j++){if(document.styleSheets[i].cssRules[j].selectorText==A){return document.styleSheets[i].cssRules[j].style}}}}}var agt=navigator.userAgent.toLowerCase();var appVer=navigator.appVersion.toLowerCase();var isMinor=parseFloat(appVer);var isMajor=parseInt(isMinor);var iePos=appVer.indexOf("msie");if(iePos!=-1){isMinor=parseFloat(appVer.substring(iePos+5,appVer.indexOf(";",iePos)));isMajor=parseInt(isMinor)}var isKonq=false;var kqPos=agt.indexOf("konqueror");if(kqPos!=-1){isKonq=true;isMinor=parseFloat(agt.substring(kqPos+10,agt.indexOf(";",kqPos)));isMajor=parseInt(isMinor)}var isOpera=(agt.indexOf("opera")!=-1);var isKhtml=(isSafari||isKonq);var isIe=((iePos!=-1)&&(!isOpera)&&(!isKhtml));var isIe6up=(isIe&&isMinor>=6);var isGecko=((!isKhtml)&&(navigator.product)&&(navigator.product.toLowerCase()=="gecko"))?true:false;var isSafari=((agt.indexOf("safari")!=-1)&&(agt.indexOf("mac")!=-1))?true:false;function createIEControl(C,E){var B=document.createElement("object");B.style.width=C.style.width;B.style.height=C.style.height;for(var D in E){B.setAttribute(D,E[D])}if(document.readyState=="complete"){if(C.parentNode){C.parentNode.replaceChild(B,C)}}else{var A=C;document.attachEvent("onreadystatechange",function(){if(document.readyState=="complete"){if(A.parentNode){A.parentNode.replaceChild(B,A)}}})}return B}function createMozillaControl(A,C){if(isSafari){return createSafariControl(A,C)}var D=document.createElement("embed");D.style.width=A.style.width;D.style.height=A.style.height;for(var B in C){D.setAttribute(B,C[B])}self.interval=window.setInterval(function(){if(isElementLoaded(A)){window.clearInterval(self.interval);if(A.parentNode){A.parentNode.replaceChild(D,A)}}},100);return D}function createSafariControl(A,D){var C="<embed";for(var B in D){C+=" "+B+'="'+D[B]+'"'}C+=">";A.innerHTML=C;return document[D.name]}var isWin=((agt.indexOf("win")!=-1)||(agt.indexOf("16bit")!=-1));var isMac=(agt.indexOf("mac")!=-1);if(!isWin&&!isMac){alert("Sorry - Hypercosm is only supported on Windows and the Macintosh");window.top.location="http://www.hypercosm.com/download/player/platform_error.html"}else{if(isIe6up){document.writeln('<script language="VBScript">');document.writeln("On Error Resume Next");document.writeln('Set theObject = CreateObject("HypercosmActivex.HyperX.1")');document.writeln("If IsObject(theObject) Then");document.writeln("hasHypercosm = true");document.writeln("Else");document.writeln("hasHypercosm = false");document.writeln("End If");document.writeln("<\/script>");if(!hasHypercosm){var button=confirm("The Hypercosm Player is needed to view this page.\nWould like to be redirected to the download page?");if(button==true){window.top.location="http://www.hypercosm.com/download/player/index.html"}}}else{if(isGecko||isSafari){hasHypercosm=false;for(i=0;i<navigator.plugins.length;i++){if(navigator.plugins[i].name.substring(0,9)=="Hypercosm"){hasHypercosm=true}}if(!hasHypercosm){var button=confirm("The Hypercosm 3D Player is needed to view this page.\nWould like to be redirected to the  Player's download page?");if(button==true){window.top.location="http://www.hypercosm.com/download/player/index.html"}}}else{window.top.location="http://www.hypercosm.com/download/player/browser_error.html"}}}var isIe=(navigator.appName=="Microsoft Internet Explorer");var ieVersion=parseFloat(navigator.appVersion.split("MSIE")[1]);var useCorrectedPNGFix=isIe&&(ieVersion>=5.5)&&(ieVersion<7);var correctingPNGImages=false;var correctedPNGImages=false;function correctPNG(D){if(!useCorrectedPNGFix){return }var G=D.src.toUpperCase();if(G.substring(G.length-3,G.length)=="PNG"){var E=(D.id)?"id='"+D.id+"' ":"";var H=(D.className)?"class='"+D.className+"' ":"";var C=(D.title)?"title='"+D.title+"' ":"title='"+D.alt+"' ";var F="display:inline-block;"+D.style.cssText;if(D.align=="left"){F="float:left;"+F}if(D.align=="right"){F="float:right;"+F}if(D.parentElement.href){F="cursor:hand;"+F}var A=D.width;var I=D.height;if(A==0){A=getElementAttribute(D,"width")}if(I==0){I=getElementAttribute(D,"height")}var B="<span "+E+H+C+' style="width:'+A+"px; height:"+I+"px;"+F+";filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+D.src+"', sizingMethod='image');\"></span>";D.outerHTML=B}}function correctPNGs(){if(!useCorrectedPNGFix){return }if(!correctingPNGImages){correctingPNGImages=true;for(var A=0;A<document.images.length;A++){correctPNG(document.images[A])}correctedPNGImages=true}}function swapPNG(A,B){if(useCorrectedPNGFix){A.filters(0).src=B}else{A.src=B}}var chars=new Array(" ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","","Ç","ü","é","â","ä","à","å","ç","ê","ë","è","ï","î","ì","Ä","Å","É","æ","Æ","ô","ö","ò","û","ù","ÿ","Ö","Ü","ø","£","Ø","×","ƒ","á","í","ó","ú","ñ","Ñ","ª","º","¿","®","¬","½","¼","¡","«","»","_","_","_","¦","¦","Á","Â","À","©","¦","¦","+","+","¢","¥","+","+","-","-","+","-","+","ã","Ã","+","+","-","-","¦","-","+","¤","ð","Ð","Ê","Ë","È","i","Í","Î","Ï","+","+","_","_","¦","Ì","_","Ó","ß","Ô","Ò","õ","Õ","µ","þ","Þ","Ú","Û","Ù","ý","Ý","¯","´","","±","_","¾","¶","§","÷","¸","°","¨","·","¹","³","²","_"," ");function charToByte(B){for(var A=0;A<chars.length;A++){if(B==chars[A]){return A+32}}return 0}function byteToChar(A){if(A<32||A>255){return" "}return chars[A-32]}function stringToUpper(A){if(A!=null){A=(A.charAt(0)).toUpperCase()+A.substring(1,A.length)}return A}function stringToLower(A){if(A!=null){A=(A.charAt(0)).toLowerCase()+A.substring(1,A.length)}return A}function RGBColor(C,B,A){if(isNaN(C)){C=0}if(isNaN(B)){B=0}if(isNaN(A)){A=0}this.red=C;this.green=B;this.blue=A;return this}RGBColor.prototype.matches=function(A){if(A){return((this.red==A.red)&&(this.green==A.green)&&(this.blue==A.blue))}else{return false}};RGBColor.prototype.duplicate=function(){return new RGBColor(this.red,this.green,this.blue)};RGBColor.prototype.toString=function(){return this.red.toString()+","+this.green.toString()+","+this.blue.toString()};RGBColor.prototype.toHex=function(){var C=Math.floor(this.red);var B=Math.floor(this.green);var A=Math.floor(this.blue);if(C<0||isNaN(C)){C=0}if(C>255){C=255}if(B<0||isNaN(B)){B=0}if(B>255){B=255}if(A<0||isNaN(A)){A=0}if(A>255){A=255}C=C.toString(16);B=B.toString(16);A=A.toString(16);if(C.length<2){C="0"+C}if(B.length<2){B="0"+B}if(A.length<2){A="0"+A}return C+B+A};var red=new RGBColor(255,0,0);var green=new RGBColor(0,255,0);var blue=new RGBColor(0,0,255);var cyan=new RGBColor(0,255,255);var magenta=new RGBColor(255,0,255);var yellow=new RGBColor(255,255,0);var orange=new RGBColor(255,127,0);var black=new RGBColor(0,0,0);var white=new RGBColor(255,255,255);var grey=new RGBColor(127,127,127);function colorToNamedColor(A){if(A.matches(red)){return"red"}else{if(A.matches(green)){return"green"}else{if(A.matches(blue)){return"blue"}else{if(A.matches(cyan)){return"cyan"}else{if(A.matches(magenta)){return"magenta"}else{if(A.matches(yellow)){return"yellow"}else{if(A.matches(orange)){return"orange"}else{if(A.matches(black)){return"black"}else{if(A.matches(white)){return"white"}else{if(A.matches(grey)){return"grey"}else{return null}}}}}}}}}}}function namedColorToColor(A){if(A=="red"){return red}else{if(A=="green"){return green}else{if(A=="blue"){return blue}else{if(A=="cyan"){return cyan}else{if(A=="magenta"){return magenta}else{if(A=="yellow"){return yellow}else{if(A=="orange"){return orange}else{if(A=="black"){return black}else{if(A=="white"){return white}else{if(A=="grey"){return grey}else{return null}}}}}}}}}}}function HCVector2(A,B){if(isNaN(A)){A=0}if(isNaN(B)){B=0}this.x=A;this.y=B;return this}HCVector2.prototype.equals=function(A){if(A){return((this.x==A.x)&&(this.y==A.y))}else{return false}};HCVector2.prototype.duplicate=function(){return new HCVector2(this.x,this.y)};HCVector2.prototype.toPrecision=function(A){return this.x.toPrecision(A)+","+this.y.toPrecision(A)};HCVector2.prototype.add=function(A){this.x=this.x+A.x;this.y=this.y+A.y};HCVector2.prototype.subtract=function(A){this.x=this.x-A.x;this.y=this.y-A.y};HCVector2.prototype.multiplyBy=function(A){this.x=this.x*A.x;this.y=this.y*A.y};HCVector2.prototype.divideBy=function(A){this.x=this.x/A.x;this.y=this.y/A.y};HCVector2.prototype.scaleBy=function(A){this.x=this.x*A;this.y=this.y*A};HCVector2.prototype.plus=function(B){var A=this.x+B.x;var C=this.y+B.y;return new HCVector2(A,C)};HCVector2.prototype.minus=function(B){var A=this.x-B.x;var C=this.y-B.y;return new HCVector2(A,C)};HCVector2.prototype.times=function(B){var A=this.x*B.x;var C=this.y*B.y;return new HCVector2(A,C)};HCVector2.prototype.dividedBy=function(B){var A=this.x/B.x;var C=this.y/B.y;return new HCVector2(A,C)};HCVector2.prototype.scaledBy=function(B){var A=this.x*B;var C=this.y*B;return new HCVector2(A,C)};HCVector2.prototype.dot=function(A){return(this.x*A.x)+(this.y*A.y)};function HCVector3(A,C,B){if(isNaN(A)){A=0}if(isNaN(C)){C=0}if(isNaN(B)){B=0}this.x=A;this.y=C;this.z=B;return this}HCVector3.prototype.equals=function(A){if(A){return((this.x==A.x)&&(this.y==A.y)&&(this.z==A.z))}else{return false}};HCVector3.prototype.duplicate=function(){return new HCVector3(this.x,this.y,this.z)};HCVector3.prototype.toPrecision=function(A){return this.x.toPrecision(A)+","+this.y.toPrecision(A)+","+this.z.toPrecision(A)};HCVector3.prototype.add=function(A){this.x=this.x+A.x;this.y=this.y+A.y;this.z=this.z+A.z};HCVector3.prototype.subtract=function(A){this.x=this.x-A.x;this.y=this.y-A.y;this.z=this.z-A.z};HCVector3.prototype.multiplyBy=function(A){this.x=this.x*A.x;this.y=this.y*A.y;this.z=this.z*A.z};HCVector3.prototype.divideBy=function(A){this.x=this.x/A.x;this.y=this.y/A.y;this.z=this.z/A.z};HCVector3.prototype.scaleBy=function(A){this.x=this.x*A;this.y=this.y*A;this.z=this.z*A};HCVector3.prototype.plus=function(B){var A=this.x+B.x;var D=this.y+B.y;var C=this.z+B.z;return new HCVector3(A,D,C)};HCVector3.prototype.minus=function(B){var A=this.x-B.x;var D=this.y-B.y;var C=this.z-B.z;return new HCVector3(A,D,C)};HCVector3.prototype.times=function(B){var A=this.x*B.x;var D=this.y*B.y;var C=this.z*B.z;return new HCVector3(A,D,C)};HCVector3.prototype.dividedBy=function(B){var A=this.x/B.x;var D=this.y/B.y;var C=this.z/B.z;return new HCVector3(A,D,C)};HCVector3.prototype.scaledBy=function(B){var A=this.x*B;var D=this.y*B;var C=this.z*B;return new HCVector3(A,D,C)};HCVector3.prototype.dot=function(A){return(this.x*A.x)+(this.y*A.y)+(this.z*A.z)};HCVector3.prototype.cross=function(B){var A=(this.y*B.z)-(this.z*B.y);var D=(this.z*B.x)-(this.x*B.z);var C=(this.x*B.y)-(this.y*B.x);return new HCVector3(A,D,C)};HCVector3.prototype.parallel=function(A){var B=A.dot(A);if(B!=0){return A.scaledBy(this.dot(A)/B)}else{return this}};HCVector3.prototype.perpendicular=function(A){return this.minus(this.parallel(A))};HCVector3.prototype.length=function(){return Math.sqrt(this.dot(this))};HCVector3.prototype.rotateBy=function(F,E){var C=E.length();if(C!=0){var B=this.perpendicular(E);var A=(E.cross(B)).scaledBy(1/C);var K=this.parallel(E);var J=Math.cos(F*Math.PI/180);var H=Math.sin(F*Math.PI/180);var G=B.scaledBy(J);var I=A.scaledBy(H);var D=(G.plus(I)).plus(K);this.x=D.x;this.y=D.y;this.z=D.z}};HCVector3.prototype.rotatedBy=function(E,D){var C=D.length();if(C!=0){var B=this.perpendicular(D);var A=(D.cross(B)).scaledBy(1/C);var J=this.parallel(D);var I=Math.cos(E*Math.PI/180);var G=Math.sin(E*Math.PI/180);var F=B.scaledBy(I);var H=A.scaledBy(G);return(F.plus(H)).plus(J)}else{return this}};function getQueryString(){return window.top.location.search.substring(1)}function addQueryString(B,A){if(B&&A&&(A!=undefined)){return B+"&"+A}else{if(B){return B}else{return A}}}function getQueryVariable(E,A){if(!E){return undefined}var C=E.split("&");for(var B=0;B<C.length;B++){var D=C[B].split("=");if(D[0]==A){return D[1]}}return undefined}function getQueryVariables(G,A){if(!G){return new Array()}var F=new Array();var D=G.split("&");var C=0;for(var B=0;B<D.length;B++){var E=D[B].split("=");if(E[0]==A){F[C]=E[1];C+=1}}return F}function stringToURL(B){var A=B;A=A.replace(/%/g,"%25");A=A.replace(/ /g,"%20");A=A.replace(/~/g,"%7E");A=A.replace(/`/g,"%60");A=A.replace(/!/g,"%33");A=A.replace(/@/g,"%40");A=A.replace(/#/g,"%23");A=A.replace(/\$/g,"%24");A=A.replace(/\^/g,"%5E");A=A.replace(/&/g,"%26");A=A.replace(/\*/g,"%2A");A=A.replace(/\(/g,"%28");A=A.replace(/\)/g,"%29");A=A.replace(/-/g,"%2D");A=A.replace(/\+/g,"%2B");A=A.replace(/=/g,"%3D");A=A.replace(/{/g,"%7B");A=A.replace(/}/g,"%7D");A=A.replace(/\[/g,"%5B");A=A.replace(/]/g,"%5D");A=A.replace(/\|/g,"%7C");A=A.replace(/\\/g,"%5C");A=A.replace(/:/g,"%3A");A=A.replace(/;/g,"%3B");A=A.replace(/"/g,"%22");A=A.replace(/'/g,"%27");A=A.replace(/</g,"%3C");A=A.replace(/>/g,"%3E");A=A.replace(/,/g,"%2C");A=A.replace(/\./g,"%2E");A=A.replace(/\?/g,"%3F");A=A.replace(/\//g,"%2F");return A}function stringsToURLs(A){var B=new Array(A.length);for(var C=0;C<A.length;C++){B[C]=stringToURL(A[C])}return B}function URLToString(A){var B=A;B=B.replace(/%20/g," ");B=B.replace(/%7E/g,"~");B=B.replace(/%60/g,"`");B=B.replace(/%33/g,"!");B=B.replace(/%40/g,"@");B=B.replace(/%23/g,"#");B=B.replace(/%24/g,"$");B=B.replace(/%5E/g,"^");B=B.replace(/%26/g,"&");B=B.replace(/%2A/g,"*");B=B.replace(/%28/g,"(");B=B.replace(/%29/g,")");B=B.replace(/%2D/g,"-");B=B.replace(/%2B/g,"+");B=B.replace(/%3D/g,"=");B=B.replace(/%7B/g,"{");B=B.replace(/%7D/g,"}");B=B.replace(/%5B/g,"[");B=B.replace(/%5D/g,"]");B=B.replace(/%7C/g,"|");B=B.replace(/%5C/g,"\\");B=B.replace(/%3A/g,":");B=B.replace(/%3B/g,";");B=B.replace(/%22/g,'"');B=B.replace(/%27/g,"'");B=B.replace(/%3C/g,"<");B=B.replace(/%3C/g,">");B=B.replace(/%2C/g,",");B=B.replace(/%2E/g,".");B=B.replace(/%3F/g,"?");B=B.replace(/%2F/g,"/");B=B.replace(/%25/g,"%");return B}function URLsToStrings(B){var A=new Array(B.length);for(var C=0;C<B.length;C++){A[C]=URLToString(B[C])}return A}function textToURL(C){if(typeof (C)=="string"){return stringToURL(C)}else{if(C.length==1){return stringToURL(C[0])}else{var A="";for(var B=0;B<C.length;B++){A+=stringToURL(C[B]);if(B<C.length-1){A+="%12"}}return A}}}function URLToText(A){var F=A.split("%");var E=new Array();var B=1;E[B-1]=F[0];for(var C=1;C<F.length;C++){var D="%"+F[C].substring(0,2);if(D=="%12"){B+=1;E[B-1]=F[C].substring(2,F[C].length)}else{E[B-1]+=URLToString(D)+F[C].substring(2,F[C].length)}}return E}function HCOverlay(A){this.visible=false;if(A!=null){this.__proto__=A;this.index=HCOverlay.overlays.length;HCOverlay.overlays[this.index]=this}}HCOverlay.prototype.duplicate=function(){return new HCOverlay(this.__proto__)};HCOverlay.reset=function(){HCOverlay.overlays=new Array()};HCOverlay.overlays=new Array();function HCColoredOverlay(B,A){HCOverlay.call(this,B);if(A){this.color=new RGBColor(A.red,A.green,A.blue)}return this}HCColoredOverlay.prototype.setColor=function(A){this.color=A};HCColoredOverlay.prototype.getColor=function(){return this.color};HCColoredOverlay.prototype.duplicate=function(){return new HCColoredOverlay(this.__proto__,this.color)};function HCMaterial(A){if(typeof (A)=="string"){this.color=white;this.textureName=A}else{this.color=A;this.textureName=undefined}return this}function HCMarker(A,C,B){if(!B){B=new RGBColor(255,255,255)}HCColoredOverlay.call(this,HCMarker.prototype,B);this.location=A;this.icon=C;return this}HCMarker.prototype=new HCColoredOverlay();HCMarker.prototype.duplicate=function(){return new HCMarker(this.location,this.icon,this.color)};function HCIcon(B,D,C,A){this.imageName=B;this.hAlignment=D;this.vAlignment=C;this.iconAnchor=A;return this}function HCLine(B,A){HCColoredOverlay.call(this,HCLine.prototype,A);this.vertices=B;return this}HCLine.prototype=new HCColoredOverlay();HCLine.prototype.duplicate=function(){return new HCLine(this.vertices,this.color)};function HCCurve(B,C,A){HCColoredOverlay.call(this,HCCurve.prototype,A);this.steps=B;this.vertices=C;return this}HCCurve.prototype=new HCColoredOverlay();HCCurve.prototype.duplicate=function(){return new HCCurve(this.steps,this.vertices,this.color)};function HCPolygon(A,B,C){HCOverlay.call(this,HCPolygon.prototype);this.vertices=A;this.material=B;this.texcoords=C;return this}HCPolygon.prototype=new HCOverlay();HCPolygon.prototype.duplicate=function(){return new HCPolygon(this.vertices,this.texcoords,this.material)};function HCText(G,A,F,E,D,C,B){HCColoredOverlay.call(this,HCText.prototype,D);this.text=G;this.location=A;this.hAlignment=F;this.vAlignment=E;this.font=C;this.attributes=B;return this}HCText.prototype=new HCColoredOverlay();HCText.prototype.duplicate=function(){return new HCText(this.text,this.location,this.hAlignment,this.vAlignment,this.color,this.font)};function HCLabel(D,C,A,B){HCColoredOverlay.call(this,HCLabel.prototype,B);this.text=D;this.anchorPoint=C;this.location=A;return this}HCLabel.prototype=new HCColoredOverlay();HCLabel.prototype.duplicate=function(){return new HCLabel(this.text,this.anchorPoint,this.location,this.color)};function component(A,B){if(!A){return this}if(typeof (A)=="string"){if(B){if(B.element){this.element=getElementById(A,B.element)}else{this.element=getElementById(A,B)}}else{this.element=document.getElementById(A)}}else{this.element=A}if(B&&B.addComponent){B.addComponent(this)}this.visible=(this.element!=undefined)&&(this.element.style.display!="none");return this}component.prototype.getTop=function(){var A=this;while(A.parent){A=A.parent}return A};component.prototype.getWidth=function(){if(this.element){if(this.element.offsetWidth!=0){return this.element.offsetWidth}else{if(this.element.width){return this.element.width}else{return this.element.getAttribute("width")}}}else{return 0}};component.prototype.getHeight=function(){if(this.element){if(this.element.offsetHeight!=0){return this.element.offsetHeight}else{if(this.element.height){return this.element.height}else{return this.element.getAttribute("height")}}}else{return 0}};component.prototype.getLeft=function(){var B=0;var A=this.element;if(A.offsetParent){do{B+=A.offsetLeft}while(A=A.offsetParent);return B}};component.prototype.getTop=function(){var B=0;var A=this.element;if(A.offsetParent){do{B+=A.offsetTop}while(A=A.offsetParent);return B}};component.prototype.setElement=function(A){if(this.element.parentNode){this.element.parentNode.replaceChild(A,this.element)}this.element=A};component.prototype.setVisible=function(A){this.visible=A;if(this.element){if(A){this.element.style.display="block"}else{this.element.style.display="none"}}};component.prototype.isVisible=function(){return this.visible&&(!this.parent||!this.parent.isVisible||this.parent.isVisible())};component.prototype.toggleVisible=function(){this.setVisible(!this.isVisible())};function componentGroup(B){this.components=new Array();if(B){for(var A=0;A<B.length;A++){this.addComponent(B[A])}}return this}componentGroup.prototype.addComponent=function(A){this.components[this.components.length]=A};componentGroup.prototype.getComponent=function(A){return this.components[A]};componentGroup.prototype.getComponents=function(){return this.components};componentGroup.prototype.call=function(A,C){for(var B=0;B<this.components.length;B++){if(this.components[B].__proto__==componentGroup.prototype){this.components[B].call(A,C)}else{if(this.components[B][A]){this.components[B][A](C)}}}};function container(A,C,B){component.call(this,A,B);this.componentGroup=new componentGroup(C);return this}container.prototype=new component();container.prototype.addComponent=function(A){this.componentGroup.addComponent(A);A.parent=this};container.prototype.getComponent=function(A){return this.componentGroup.getComponent(A)};container.prototype.getComponents=function(){return this.componentGroup.getComponents()};container.prototype.call=function(A,B){this.componentGroup.call(A,B)};function button(A,B){component.call(this,A,B);this.enabled=true;this.status="";if(this.element){this.imageSrc=getImageSrc(this.element)}this.setActivated(true);return this}button.prototype=new component();button.prototype.getHighlightedImageName=function(A){if(A==null){return null}prefix=A.substring(0,A.length-4);suffix=A.substring(A.length-4,A.length);return(prefix+"_highlighted"+suffix)};button.prototype.getPressedImageName=function(A){if(A==null){return null}prefix=A.substring(0,A.length-4);suffix=A.substring(A.length-4,A.length);return(prefix+"_pressed"+suffix)};button.prototype.getDisabledImageName=function(A){if(A==null){return null}prefix=A.substring(0,A.length-4);suffix=A.substring(A.length-4,A.length);return(prefix+"_disabled"+suffix)};button.prototype.setActivated=function(A){if(!this.element){return }if(A){this.element.onmouseover=getClosure(this,"onMouseOver");this.element.onmouseout=getClosure(this,"onMouseOut");this.element.onmousedown=getClosure(this,"onMouseDown");this.element.onmouseup=getClosure(this,"onMouseUp")}else{this.element.onmouseover=null;this.element.onmouseout=null;this.element.onmousedown=null;this.element.onmouseup=null}};button.prototype.setEnabled=function(A){this.enabled=A;if(!this.visible){return }this.setActivated(A);if(this.enabled){this.showUnhighlighted()}else{this.showDisabled()}};button.prototype.onClick=function(){if(this.onclick){this.onclick()}};button.prototype.showUnhighlighted=function(){swapImage(this.element,this.imageSrc)};button.prototype.showHighlighted=function(){swapImage(this.element,this.getHighlightedImageName(this.imageSrc))};button.prototype.showPressed=function(){swapImage(this.element,this.getPressedImageName(this.imageSrc))};button.prototype.onMouseOver=function(){setStatus(this.status);if(!this.visible||!this.enabled){return }this.showHighlighted()};button.prototype.onMouseOut=function(){clearStatus();if(!this.visible||!this.enabled){return }this.showUnhighlighted()};button.prototype.onMouseDown=function(){if(!this.visible||!this.enabled){return }this.showPressed()};button.prototype.onMouseUp=function(){this.onClick();if(!this.visible||!this.enabled){return }this.showHighlighted()};function toggleButton(A,B){button.call(this,A,B);this.selected=false;this.initiallySelected=false;return this}toggleButton.prototype=new button();toggleButton.prototype.onStart=function(){this.initiallySelected=this.selected};toggleButton.prototype.getSelectedImageName=function(A){if(A==null){return null}prefix=A.substring(0,A.length-4);suffix=A.substring(A.length-4,A.length);return(prefix+"_selected"+suffix)};toggleButton.prototype.getSelectedDisabledImageName=function(A){if(A==null){return null}prefix=A.substring(0,A.length-4);suffix=A.substring(A.length-4,A.length);return(prefix+"_selected_disabled"+suffix)};button.prototype.getSelectedElement=function(){var A=document.createElement("img");A.src=this.getSelectedImageName(this.imageSrc);A.onmouseup=getClosure(this,"onMouseUp");return A};button.prototype.getSelectedDisabledElement=function(){var A=document.createElement("img");A.src=this.getSelectedDisabledImageName(this.imageSrc);return A};toggleButton.prototype.select=function(){this.setSelected(true)};toggleButton.prototype.deselect=function(){this.setSelected(false)};toggleButton.prototype.toggle=function(){this.setSelected(!this.selected)};toggleButton.prototype.setSelected=function(A){if(A==this.selected){return }if(A){this.onSelect()}else{this.onDeselect()}};toggleButton.prototype.showSelected=function(){swapImage(this.element,this.getSelectedImageName(this.imageSrc))};toggleButton.prototype.showDisabled=function(){swapImage(this.element,this.getDisabledImageName(this.imageSrc))};toggleButton.prototype.showSelectedDisabled=function(){swapImage(this.element,this.getSelectedDisabledImageName(this.imageSrc))};toggleButton.prototype.setEnabled=function(A){this.enabled=A;if(!this.visible){return }if(this.enabled){if(this.selected){this.showSelected()}else{this.showUnhighlighted()}}else{if(this.selected){this.showSelectedDisabled()}else{this.showDisabled()}}};toggleButton.prototype.onSelect=function(){this.selected=true;if(!this.visible){return }if(this.enabled){this.showSelected()}else{this.showSelectedDisabled()}};toggleButton.prototype.onDeselect=function(){this.selected=false;if(!this.visible){return }if(this.enabled){this.showUnhighlighted()}else{this.showDisabled()}};toggleButton.prototype.onClick=function(){this.toggle()};toggleButton.prototype.onMouseOver=function(){setStatus(this.status);if(!this.visible||!this.enabled){return }if(!this.selected){this.showHighlighted()}};toggleButton.prototype.onMouseOut=function(){clearStatus();if(!this.visible||!this.enabled){return }if(!this.selected){this.showUnhighlighted()}};toggleButton.prototype.onMouseDown=function(){if(!this.visible||!this.enabled){return }if(!this.selected){this.showPressed()}};toggleButton.prototype.onMouseUp=function(){this.toggle();if(!this.visible||!this.enabled){return }if(!this.selected){this.showHighlighted()}};function radioButton(B,D,C,A){toggleButton.call(this,B,C);this.deselectable=(A==true);if(D){D.addComponent(this);this.group=D}return this}radioButton.prototype=new toggleButton();radioButton.prototype.onSelect=function(){if(this.group){if(this.group.selectedButton){if(this.group.selectedButton!=this){this.group.selectedButton.setSelected(false)}}}toggleButton.prototype.onSelect.call(this);if(this.group){this.group.selectedButton=this}};radioButton.prototype.onMouseUp=function(){if(!this.selected||this.deselectable){toggleButton.prototype.onMouseUp.call(this)}};function radioButtonGroup(A){componentGroup.call(this,A);return this}radioButtonGroup.prototype=new componentGroup();radioButtonGroup.prototype.reset=function(){this.selectedButton=null;for(var A=0;A<this.components.length;A++){toggleButton.prototype.setSelected.call(this.components[A],false)}};radioButtonGroup.prototype.setEnabled=function(A){for(var B=0;B<this.components.length;B++){this.components[B].setEnabled(A)}if(A&&this.selectedButton){toggleButton.prototype.setSelected.call(this.selectedButton,true)}};function menu(B,C){component.call(this,B,C);if(this.element){var A=this;this.element.onchange=function(){A.onChange()}}return this}menu.prototype=new component();menu.prototype.addItem=function(A,B){if(this.element!=null){this.element.options.length=this.element.options.length+1;this.element.options[this.element.options.length-1].text=A;this.element.options[this.element.options.length-1].value=B}};menu.prototype.getItems=function(){if(this.element!=null){return this.element.length}else{return null}};menu.prototype.getItemName=function(A){if(this.element!=null){if(this.element.options[A]){return this.element.options[A].text}}else{return null}};menu.prototype.getItemValue=function(A){if(this.element!=null){if(this.element.options[A]){return this.element.options[A].value}}else{return null}};menu.prototype.getItemIndex=function(A){for(var B=0;B<this.getItems();B++){if(this.getItemName(B)==A){return B}}};menu.prototype.setItemName=function(B,A){if(this.element!=null){if(this.element.options[B]){this.element.options[B].text=A}}};menu.prototype.setItemValue=function(A,B){if(this.element!=null){if(this.element.options[A]){this.element.options[A].value=B}}};menu.prototype.setSelectedIndex=function(A){if(this.element!=null){this.element.selectedIndex=A-1}else{return null}this.onChange()};menu.prototype.setSelectedName=function(A){this.setSelectedIndex(this.getItemIndex(A))};menu.prototype.getSelectedIndex=function(){if(this.element!=null){return this.element.selectedIndex}else{return null}};menu.prototype.getSelectedName=function(){if(this.element!=null){return this.getItemName(this.element.selectedIndex)}else{return null}};menu.prototype.getSelectedItem=function(){if(this.element!=null){return this.getItemValue(this.element.selectedIndex)}else{return null}};menu.prototype.onChange=function(){if(this.onchange){this.onchange()}};function slider(B,F,G,A,C,E){if(!B){return }component.call(this,B,C);if(F==undefined){F=0}if(G==undefined){G=1}if(E==undefined){E=F}this.minValue=F;this.maxValue=G;if(this.element.clientWidth>this.element.clientHeight){this.orientation="horizontal"}else{this.orientation="vertical"}this.handleElement=getElementById("handle",this.element);this.handleHotSpotElement=getElementById("hotSpot",this.handleElement);this.textFieldElement=getElementById(A);if(!this.handleHotSpotElement){this.handleHotSpotElement=this.handleElement}this.sliderHandleX=0;this.sliderHandleY=0;this.onmousemove=null;this.onmouseup=null;this.onchange=null;var D=this;if(this.visible){this.width=this.element.clientWidth;this.height=this.element.clientHeight;if(this.handleElement){this.handleElement.style.position="relative";this.handleElement.style.cursor="default";this.handleHotSpotElement.onmousedown=function(H){D.onMouseDown(H)};this.handleHotSpotElement.onmouseup=function(H){D.onMouseUp(H)}}if(this.textFieldElement){this.textFieldElement.onchange=function(H){D.setValue(parseInt(D.textFieldElement.value))}}}this.setValue(E);this.element.style.overflow="hidden";return this}slider.prototype=new component();slider.prototype.setValue=function(A){if(A<this.minValue){A=this.minValue}if(A>this.maxValue){A=this.maxValue}if(A!=this.value){this.value=A;this.positionHandle();this.onChange()}};slider.prototype.getValue=function(){return this.value};slider.prototype.positionHandle=function(){if(this.handleElement){if(this.orientation=="horizontal"){var A=this.element.clientWidth-this.handleElement.clientWidth;var B=(this.value-this.minValue)/(this.maxValue-this.minValue)*A;this.handleElement.style.left=B+"px";this.sliderHandleX=B}else{var C=this.element.clientHeight-this.handleElement.clientHeight;var B=(this.value-this.minValue)/(this.maxValue-this.minValue)*C;this.handleElement.style.top=B+"px";this.sliderHandleY=B}}};slider.prototype.onMouseDown=function(C){if(!this.visible){return }if(!C){C=window.event}this.mouseDownX=C.clientX;this.mouseDownY=C.clientY;var B=this;this.moveHandler=function(E){B.onMouseMove(E)};this.upHandler=function(E){B.onMouseUp(E)};if(document.addEventListener){document.addEventListener("mousemove",this.moveHandler,true);document.addEventListener("mouseup",this.upHandler,true)}else{if(document.attachEvent){this.handleElement.setCapture();this.handleElement.attachEvent("onmousemove",this.moveHandler);this.handleElement.attachEvent("onmouseup",this.upHandler);this.handleElement.attachEvent("onlosecapture",this.upHandler)}else{var A=document.onmousemove;var D=document.onmouseup;document.onmousemove=this.moveHandler;document.onmouseup=this.upHandler}}if(C.stopPropagation){C.stopPropagation()}else{C.cancelBubble=true}if(C.preventDefault){C.preventDefault()}else{C.returnValue=false}};slider.prototype.onMouseUp=function(A){if(!this.visible){return }if(!A){A=window.event}this.sliderHandleX+=A.clientX-this.mouseDownX;this.sliderHandleY+=this.mouseDownY-A.clientY;if(document.removeEventListener){if(this.upHandler){document.removeEventListener("mouseup",this.upHandler,true)}if(this.moveHandler){document.removeEventListener("mousemove",this.moveHandler,true)}}else{if(document.detachEvent){if(this.upHandler){this.handleElement.detachEvent("onlosecapture",this.upHandler);this.handleElement.detachEvent("onmouseup",this.upHandler)}if(this.moveHandler){this.handleElement.detachEvent("onmousemove",this.moveHandler)}this.handleElement.releaseCapture()}else{document.onmouseup=olduphandler;document.onmousemove=oldmovehandler}}if(this.onmouseup){this.onmouseup()}if(A.stopPropagation){A.stopPropagation()}else{A.cancelBubble=true}};slider.prototype.stringToValue=function(A){if(this.maxValue>1){return parseInt(A)}else{return parseFloat(A)}};slider.prototype.valueToString=function(A){if(this.maxValue>1){return this.value.toFixed(0)}else{return this.value.toPrecision(textFieldElement.getAttribute("maxlength"))}};slider.prototype.onMouseMove=function(F){if(!F){F=window.event}if(this.orientation=="horizontal"){var B=F.clientX-this.mouseDownX;var D=this.sliderHandleX+B;var E=this.element.offsetWidth-this.handleElement.clientWidth;if((D>=0)&&(D<=E)){this.value=this.minValue+(D/E)*(this.maxValue-this.minValue);this.handleElement.style.left=D+"px"}}else{var A=F.clientY-this.mouseDownY;var C=this.sliderHandleY-A;var G=this.element.offsetHeight-this.handleElement.clientHeight;if((C>=0)&&(C<=G)){this.value=this.minValue+(C/G)*(this.maxValue-this.minValue);this.handleElement.style.top=-C+"px"}}this.onChange();if(this.onmousemove){this.onmousemove()}if(F.stopPropagation){F.stopPropagation()}else{F.cancelBubble=true}};slider.prototype.onChange=function(A){if(this.textFieldElement){this.textFieldElement.value=this.valueToString(this.value)}if(this.onchange){this.onchange()}};slider.prototype.onResize=function(A){if(this.width!=this.element.clientWidth||this.height!=this.element.clientHeight){this.positionHandle();this.width=this.element.clientWidth;this.height=this.element.clientHeight}};function labelledSlider(B,D,E,A,C){if(!B){return }slider.call(this,B,D,E,A,C);this.handleLabelElement=getElementById("label",this.handleElement);this.handleLabelTextElement=getElementById("text",this.handleLabelElement);return this}labelledSlider.prototype=new slider();labelledSlider.prototype.getLabelText=function(A){return this.valueToString(A)};labelledSlider.prototype.onChange=function(A){if(this.handleLabelTextElement){this.handleLabelTextElement.innerHTML=this.getLabelText(this.value)}if(isIe&&this.handleLabelElement){this.handleLabelElement.style.position="absolute";this.handleLabelElement.style.right=(this.handleElement.clientWidth-this.handleLabelElement.clientWidth)/2;this.handleLabelElement.style.top=(this.handleElement.clientHeight-this.handleLabelElement.clientHeight)/2}slider.prototype.onChange.call(this,A)};function tabs(B,A,C){component.call(this,B,C);this.selectedTab=null;this.tabNames=new Array();this.tabVisibilities=new Array();this.minimumWidth=40;this.index=tabs.tabSets.length;tabs.tabSets[this.index]=this;if(this.element&&!tabs.images){tabs.images=new Array();tabs.images["selected left"]=new Image();tabs.images["selected left"].src=A+"tab-selected-left.png";tabs.images["selected middle"]=new Image();tabs.images["selected middle"].src=A+"tab-selected-middle.png";tabs.images["selected right"]=new Image();tabs.images["selected right"].src=A+"tab-selected-right.png";tabs.images["unselected left"]=new Image();tabs.images["unselected left"].src=A+"tab-unselected-left.png";tabs.images["unselected middle"]=new Image();tabs.images["unselected middle"].src=A+"tab-unselected-middle.png";tabs.images["unselected right"]=new Image();tabs.images["unselected right"].src=A+"tab-unselected-right.png";tabs.images.blank=new Image();tabs.images.blank.src=A+"tab-blank.gif"}return this}tabs.prototype=new component();tabs.prototype.addTab=function(A,B){this.tabNames[this.tabNames.length]=A;this.tabVisibilities[this.tabVisibilities.length]=(B!=false);this.update()};tabs.prototype.getTabs=function(){return this.tabNames.length};tabs.prototype.getTabName=function(A){return this.tabNames[A]};tabs.prototype.isTabVisible=function(A){return this.tabVisibilities[A]};tabs.prototype.setTab=function(A){this.selectedTab=A;this.update()};tabs.prototype.getTab=function(){return this.selectedTab};tabs.prototype.onClick=function(A){this.setTab(A)};tabs.prototype.update=function(){if(!this.element||(this.tabNames.length==0)){return }var B="";B+='<table border="0" cellpadding="0" cellspacing="0">';B+='<tr valign="bottom">';for(var A=0;A<this.tabNames.length;A++){if(this.tabVisibilities[A]){if(A==this.selectedTab){B+='<td><table style="cursor:default" border="0" cellpadding="0" cellspacing="0">';B+="<tr>";B+='<td><img src="'+tabs.images["selected left"].src+'"></td>';B+='<td background="'+tabs.images["selected middle"].src+'">&nbsp;</td>';B+='<td align="center" background="'+tabs.images["selected middle"].src+'" class="tab-selected" ';B+='onclick="tabs.tabSets['+this.index+"].onClick("+A+')">';B+=this.tabNames[A];B+="</td>";B+='<td background="'+tabs.images["selected middle"].src+'">&nbsp;</td>';B+='<td><img src="'+tabs.images["selected right"].src+'"></td>';B+="</tr>";B+="</table></td>"}else{B+='<td><table style="cursor:default" border="0" cellpadding="0" cellspacing="0">';B+="<tr>";B+='<td><img src="'+tabs.images["unselected left"].src+'"></td>';B+='<td background="'+tabs.images["unselected middle"].src+'">&nbsp;</td>';B+='<td align="center" background="'+tabs.images["unselected middle"].src+'" class="tab-unselected" ';B+='onclick="tabs.tabSets['+this.index+"].onClick("+A+')">';B+=this.tabNames[A];B+="</td>";B+='<td background="'+tabs.images["unselected middle"].src+'">&nbsp;</td>';B+='<td><img src="'+tabs.images["unselected right"].src+'"></td>';B+="</tr>";B+="</table></td>"}}}B+='<td width="100%" background="'+tabs.images.blank.src+'"></td>';B+="</tr>";B+="</table>";this.element.tabs=tabs;this.element.innerHTML=B};tabs.tabSets=new Array();function toolbar(A,C,B,D){container.call(this,A,C,B);if(isDefined(D)){this.handle=D}else{this.handle=getElementById("handle",this.element)}return this}toolbar.prototype=new container();toolbar.prototype.addControl=function(B){this.control=B;if(this.handle&&B){var A=this;this.handle.onclick=function(){A.setVisible(false)}}};toolbar.prototype.setVisible=function(A){component.prototype.setVisible.call(this,A);if(A){this.call("onShow")}this.parent.call("onResize");if(this.control){this.control.update()}};toolbar.prototype.onResize=function(A){this.call("onResize")};toolbar.prototype.onLoad=function(){this.componentGroup.call("onLoad")};toolbar.prototype.onStart=function(){this.componentGroup.call("onStart")};toolbar.prototype.onUnload=function(){this.componentGroup.call("onUnload")};toolbar.prototype.parseQueryString=function(A){for(i=0;i<this.componentGroup.components.length;i++){if(this.componentGroup.getComponent(i).parseQueryString){this.componentGroup.getComponent(i).parseQueryString(A)}}};toolbar.prototype.getQueryString=function(){var A=null;for(i=0;i<this.componentGroup.components.length;i++){if(this.componentGroup.getComponent(i).getQueryString){A=addQueryString(A,this.componentGroup.getComponent(i).getQueryString())}}return A};function toolbarButton(A,B){button.call(this,A,B);if(this.element){this.table=document.createElement("table");this.table.border=0;this.table.cellPadding=0;this.table.cellSpacing=0;this.row=this.table.insertRow(0);this.cell=this.row.insertCell(0);this.cell.style.padding=0;this.image=document.createElement("img");this.image.src=this.imageSrc;this.cell.appendChild(this.image);this.setElement(this.table);this.setActivated(true);if(isDefined("correctPNG")){correctPNG(this.image)}var C="../images/toolbars/buttons/";if(this.parent){if(this.parent.parent){if(this.parent.parent.path!=undefined){C=this.parent.parent.path+"images/toolbars/buttons/"}}}if(!toolbarButton.highlightedImage){toolbarButton.highlightedImage=new Image();toolbarButton.highlightedImage.src=C+"highlighted_button.gif"}if(!toolbarButton.pressedImage){toolbarButton.pressedImage=new Image();toolbarButton.pressedImage.src=C+"pressed_button.gif"}}return this}toolbarButton.prototype=new button();toolbarButton.prototype.showUnhighlighted=function(){if(!this.isVisible()){return }this.table.width=this.getWidth();this.table.height=this.getHeight();this.table.style.background="";this.cell.width=this.table.width;this.cell.height=this.table.height;this.image.src=this.imageSrc;this.image.style.position="static";this.image.style.clip="rect(auto auto auto auto)"};toolbarButton.prototype.showHighlighted=function(){if(!this.isVisible()){return }this.table.width=this.getWidth();this.table.height=this.getHeight();this.table.style.background="url("+toolbarButton.highlightedImage.src+")";this.cell.width=this.table.width;this.cell.height=this.table.height;this.image.src=this.imageSrc;this.image.style.position="static";this.image.style.clip="rect(auto auto auto auto)"};toolbarButton.prototype.showPressed=function(){if(!this.isVisible()){return }this.table.width=this.getWidth();this.table.height=this.getHeight();this.table.style.background="url("+toolbarButton.pressedImage.src+")";this.cell.width=this.table.width;this.cell.height=this.table.height;this.image.src=this.imageSrc;this.image.style.position="absolute";this.image.style.left=(this.getLeft()+1)+"px";this.image.style.top=(this.getTop()+1)+"px";this.image.style.clip="rect(auto "+(this.cell.width-1)+"px "+(this.cell.height-1)+"px auto)"};toolbarButton.prototype.showDisabled=function(){if(!this.isVisible()){return }this.table.width=this.getWidth();this.table.height=this.getHeight();this.table.style.background="";this.cell.width=this.table.width;this.cell.height=this.table.height;this.image.src=this.getDisabledImageName(this.imageSrc);this.image.style.position="static";this.image.style.clip="rect(auto auto auto auto)"};function toolbarToggleButton(A,B){toggleButton.call(this,A,B);if(this.element){this.table=document.createElement("table");this.table.border=0;this.table.cellPadding=0;this.table.cellSpacing=0;this.row=this.table.insertRow(0);this.cell=this.row.insertCell(0);this.cell.style.padding=0;this.image=document.createElement("img");this.image.src=this.imageSrc;this.cell.appendChild(this.image);this.setElement(this.table);this.setActivated(true);if(isDefined("correctPNG")){correctPNG(this.image)}var C="../images/toolbars/buttons/";if(this.parent){if(this.parent.parent){if(this.parent.parent.path!=undefined){C=this.parent.parent.path+"images/toolbars/buttons/"}}}if(!toolbarToggleButton.highlightedImage){toolbarToggleButton.highlightedImage=new Image();toolbarToggleButton.highlightedImage.src=C+"highlighted_button.gif"}if(!toolbarToggleButton.pressedImage){toolbarToggleButton.pressedImage=new Image();toolbarToggleButton.pressedImage.src=C+"pressed_button.gif"}if(!toolbarToggleButton.selectedImage){toolbarToggleButton.selectedImage=new Image();toolbarToggleButton.selectedImage.src=C+"selected_button.gif"}}return this}toolbarToggleButton.prototype=new toggleButton();toolbarToggleButton.prototype.showUnhighlighted=function(){if(!this.isVisible()){return }this.table.width=this.getWidth();this.table.height=this.getHeight();this.table.style.background="";this.cell.width=this.table.width;this.cell.height=this.table.height;this.image.src=this.imageSrc;this.image.style.position="static";this.image.style.clip="rect(auto auto auto auto)"};toolbarToggleButton.prototype.showHighlighted=function(){if(!this.isVisible()){return }this.table.width=this.getWidth();this.table.height=this.getHeight();this.table.style.background="url("+toolbarToggleButton.highlightedImage.src+")";this.cell.width=this.table.width;this.cell.height=this.table.height;this.image.src=this.imageSrc;this.image.style.position="static";this.image.style.clip="rect(auto auto auto auto)"};toolbarToggleButton.prototype.showPressed=function(){if(!this.isVisible()){return }this.table.width=this.getWidth();this.table.height=this.getHeight();this.table.style.background="url("+toolbarToggleButton.pressedImage.src+")";this.cell.width=this.table.width;this.cell.height=this.table.height;this.image.src=this.imageSrc;this.image.style.position="absolute";this.image.style.left=(this.getLeft()+1)+"px";this.image.style.top=(this.getTop()+1)+"px";this.image.style.clip="rect(auto "+(this.cell.width-1)+"px "+(this.cell.height-1)+"px auto)"};toolbarToggleButton.prototype.showSelected=function(){if(!this.isVisible()){return }this.table.width=this.getWidth();this.table.height=this.getHeight();this.table.style.background="url("+toolbarToggleButton.selectedImage.src+")";this.cell.width=this.table.width;this.cell.height=this.table.height;this.image.src=this.imageSrc;this.image.style.position="absolute";this.image.style.left=(this.getLeft()+1)+"px";this.image.style.top=(this.getTop()+1)+"px";this.image.style.clip="rect(auto "+(this.cell.width-1)+"px "+(this.cell.height-1)+"px auto)"};toolbarToggleButton.prototype.showDisabled=function(){if(!this.isVisible()){return }this.table.width=this.getWidth();this.table.height=this.getHeight();this.table.style.background="";this.cell.width=this.table.width;this.cell.height=this.table.height;this.image.src=this.getDisabledImageName(this.imageSrc);this.image.style.position="static";this.image.style.clip="rect(auto auto auto auto)"};toolbarToggleButton.prototype.showSelectedDisabled=function(){if(!this.isVisible()){return }this.table.width=this.getWidth();this.table.height=this.getHeight();this.table.style.background="url("+toolbarToggleButton.selectedImage.src+")";this.cell.width=this.table.width;this.cell.height=this.table.height;this.image.src=this.getDisabledImageName(this.imageSrc);this.image.style.position="absolute";this.image.style.left=(this.getLeft()+1)+"px";this.image.style.top=(this.getTop()+1)+"px";this.image.style.clip="rect(auto "+(this.cell.width-1)+"px "+(this.cell.height-1)+"px auto)"};toolbarToggleButton.prototype.onShow=function(){if(this.enabled){if(this.selected){this.showSelected()}else{this.showUnhighlighted()}}else{if(this.selected){this.showSelectedDisabled()}else{this.showDisabled()}}};toolbarToggleButton.prototype.onResize=function(){if(this.selected){if(this.enabled){this.showSelected()}else{this.showSelectedDisabled()}}};function toolbarRadioButton(C,B,D,A){radioButton.call(this,C,B,D,A);if(this.element){this.table=document.createElement("table");this.table.border=0;this.table.cellPadding=0;this.table.cellSpacing=0;this.row=this.table.insertRow(0);this.cell=this.row.insertCell(0);this.cell.style.padding=0;this.image=document.createElement("img");this.image.src=this.imageSrc;this.cell.appendChild(this.image);this.setElement(this.table);this.setActivated(true);if(isDefined("correctPNG")){correctPNG(this.image)}var E="../images/toolbars/buttons/";if(this.parent){if(this.parent.parent){if(this.parent.parent.path!=undefined){E=this.parent.parent.path+"images/toolbars/buttons/"}}}if(!toolbarRadioButton.highlightedImage){toolbarRadioButton.highlightedImage=new Image();toolbarRadioButton.highlightedImage.src=E+"highlighted_button.gif"}if(!toolbarRadioButton.pressedImage){toolbarRadioButton.pressedImage=new Image();toolbarRadioButton.pressedImage.src=E+"pressed_button.gif"}if(!toolbarRadioButton.selectedImage){toolbarRadioButton.selectedImage=new Image();toolbarRadioButton.selectedImage.src=E+"selected_button.gif"}}return this}toolbarRadioButton.prototype=new radioButton();toolbarRadioButton.prototype.showUnhighlighted=function(){if(!this.isVisible()){return }this.table.width=this.getWidth();this.table.height=this.getHeight();this.table.style.background="";this.cell.width=this.table.width;this.cell.height=this.table.height;this.image.src=this.imageSrc;this.image.style.position="static";this.image.style.clip="rect(auto auto auto auto)"};toolbarRadioButton.prototype.showHighlighted=function(){if(!this.isVisible()){return }this.table.width=this.getWidth();this.table.height=this.getHeight();this.table.style.background="url("+toolbarRadioButton.highlightedImage.src+")";this.cell.width=this.table.width;this.cell.height=this.table.height;this.image.src=this.imageSrc;this.image.style.position="static";this.image.style.clip="rect(auto auto auto auto)"};toolbarRadioButton.prototype.showPressed=function(){if(!this.isVisible()){return }this.table.width=this.getWidth();this.table.height=this.getHeight();this.table.style.background="url("+toolbarRadioButton.pressedImage.src+")";this.cell.width=this.table.width;this.cell.height=this.table.height;this.image.src=this.imageSrc;this.image.style.position="absolute";this.image.style.left=(this.getLeft()+1)+"px";this.image.style.top=(this.getTop()+1)+"px";this.image.style.clip="rect(auto "+(this.cell.width-1)+"px "+(this.cell.height-1)+"px auto)"};toolbarRadioButton.prototype.showSelected=function(){if(!this.isVisible()){return }this.table.width=this.getWidth();this.table.height=this.getHeight();this.table.style.background="url("+toolbarRadioButton.selectedImage.src+")";this.cell.width=this.table.width;this.cell.height=this.table.height;this.image.src=this.imageSrc;this.image.style.position="absolute";this.image.style.left=(this.getLeft()+1)+"px";this.image.style.top=(this.getTop()+1)+"px";this.image.style.clip="rect(auto "+(this.cell.width-1)+"px "+(this.cell.height-1)+"px auto)"};toolbarRadioButton.prototype.showDisabled=function(){if(!this.isVisible()){return }this.table.width=this.getWidth();this.table.height=this.getHeight();this.table.style.background="";this.cell.width=this.table.width;this.cell.height=this.table.height;this.image.src=this.getDisabledImageName(this.imageSrc);this.image.style.position="static";this.image.style.clip="rect(auto auto auto auto)"};toolbarRadioButton.prototype.showSelectedDisabled=function(){if(!this.isVisible()){return }this.table.width=this.getWidth();this.table.height=this.getHeight();this.table.style.background="url("+toolbarRadioButton.selectedImage.src+")";this.cell.width=this.table.width;this.cell.height=this.table.height;this.image.src=this.getDisabledImageName(this.imageSrc);this.image.style.position="absolute";this.image.style.left=(this.getLeft()+1)+"px";this.image.style.top=(this.getTop()+1)+"px";this.image.style.clip="rect(auto "+(this.cell.width-1)+"px "+(this.cell.height-1)+"px auto)"};toolbarRadioButton.prototype.onShow=function(){if(this.enabled){if(this.selected){this.showSelected()}else{this.showUnhighlighted()}}else{if(this.selected){this.showSelectedDisabled()}else{this.showDisabled()}}};toolbarRadioButton.prototype.onResize=function(){if(this.selected){if(this.enabled){this.showSelected()}else{this.showSelectedDisabled()}}};function undoButton(A,B){toolbarButton.call(this,A,B);this.status="Undo the previous operation.";this.helpMessage="This button undoes the previous operation.";this.overlay=null;return this}undoButton.prototype=new toolbarButton();undoButton.prototype.setOverlay=function(A){this.overlay=A};undoButton.prototype.onClick=function(){var A=this.overlay.duplicate();if(this.parent.parent.layersToolbar){var B=this.parent.parent.layersToolbar.getSelectedIndex()}else{var B=0}this.parent.parent.markUp.addOverlay(A,B);this.parent.parent.standardToolbar.redoButton.setOverlay(A);this.setOverlay(null);toolbarButton.prototype.onClick.call(this)};undoButton.prototype.onMouseUp=function(){toolbarButton.prototype.onMouseUp.call(this);this.setEnabled(false);this.parent.parent.standardToolbar.redoButton.setEnabled(true)};function redoButton(A,B){toolbarButton.call(this,A,B);this.status="Redo the previous operation.";this.helpMessage="This button redoes the previous operation.";this.overlay=null;return this}redoButton.prototype=new toolbarButton();redoButton.prototype.setOverlay=function(A){this.overlay=A};redoButton.prototype.onClick=function(){this.parent.parent.applet.removeOverlay(this.overlay);this.parent.parent.standardToolbar.undoButton.setOverlay(this.overlay);this.setOverlay(null);toolbarButton.prototype.onClick.call(this)};redoButton.prototype.onMouseUp=function(){toolbarButton.prototype.onMouseUp.call(this);this.setEnabled(false);this.parent.parent.standardToolbar.undoButton.setEnabled(true)};function selectButton(A,C,B){toolbarRadioButton.call(this,A,C,B);this.status="Selection Tool";this.helpMessage="This button is used to select an object in the scene.";this.overlay=null;return this}selectButton.prototype=new toolbarRadioButton();selectButton.prototype.setOverlay=function(A){if(this.overlay){if(this.overlay!=A){this.parent.parent.applet.deselectOverlay(this.overlay)}}if(A){this.parent.parent.applet.selectOverlay(A)}this.overlay=A};selectButton.prototype.onSelect=function(){this.parent.parent.applet.beginMessages();toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.setMouseMode("left","none",null);this.parent.parent.applet.setMouseMode("right","none",null);var A=this.parent.parent.applet;var B=function(D,C,E){if((D)&&A.parent.markUp.hasOverlay(D)){A.parent.standardToolbar.selectButton.setOverlay(D);A.parent.standardToolbar.eraseButton.setEnabled(true);if(A.parent.layersToolbar){A.parent.layersToolbar.setSelectedIndex(D.layer+1)}}else{A.parent.standardToolbar.selectButton.setOverlay(null);A.parent.standardToolbar.eraseButton.setEnabled(false)}};this.listener=HCEvent.addListener(this.parent.parent.applet,"mouseup",B);this.parent.parent.applet.endMessages()};selectButton.prototype.onDeselect=function(){toolbarRadioButton.prototype.onDeselect.call(this);this.parent.parent.applet.setMouseMode("left","none",null);HCEvent.removeListener(this.listener)};selectButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="select"){this.setSelected(true)}};selectButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=select"}return A};function eraseButton(A,B){toolbarButton.call(this,A,B);this.status="Erase markers and annotation";this.helpMessage="This button erases all markers and annotation in the scene.";return this}eraseButton.prototype=new toolbarButton();eraseButton.prototype.onLoad=function(){var B=46;var A=this;HCEvent.addListener(this.parent.parent.applet,"keydown",function(){A.onClick();A.setEnabled(false)},B)};eraseButton.prototype.onClick=function(){if(this.parent.parent.standardToolbar.selectButton.overlay){this.parent.parent.standardToolbar.undoButton.setOverlay(this.parent.parent.standardToolbar.selectButton.overlay);this.parent.parent.standardToolbar.undoButton.setEnabled(true);this.parent.parent.standardToolbar.redoButton.setEnabled(false);this.parent.parent.applet.removeOverlay(this.parent.parent.standardToolbar.selectButton.overlay);this.parent.parent.standardToolbar.selectButton.overlay=null}else{if(confirm("Click OK to delete all markers and annotation.")){this.parent.parent.markUp.clearOverlays()}}};eraseButton.prototype.onMouseUp=function(){toolbarButton.prototype.onMouseUp.call(this);this.setEnabled(false)};function standardToolbar(B,A,C){toolbar.call(this,B,null,C);this.undoButton=new undoButton("undoButton",this);this.redoButton=new redoButton("redoButton",this);this.selectButton=new selectButton("selectButton",A,this);this.eraseButton=new eraseButton("eraseButton",this);this.undoButton.setEnabled(false);this.redoButton.setEnabled(false);this.eraseButton.setEnabled(false);return this}standardToolbar.prototype=new toolbar();function renderingLevelMenu(A,B){menu.call(this,A,B);if(this.element){this.addItem("Smooth + Highlights",true);this.addItem("Wireframe",false);this.addItem("Facets + Highlights",true);this.addItem("Flat",false);this.addItem("Lit Wireframes",false);this.addItem("Transparent",false)}return this}renderingLevelMenu.prototype=new menu();renderingLevelMenu.prototype.onChange=function(){var A=renderingLevelMenu.renderingLevels[this.getSelectedIndex()];if(A!="transparent"){this.parent.parent.applet.beginMessages();this.parent.parent.applet.setRenderingLevel(A);this.parent.parent.applet.setTransparency("none");this.parent.parent.applet.endMessages()}else{this.parent.parent.applet.beginMessages();this.parent.parent.applet.setRenderingLevel("smooth_plus_highlights");this.parent.parent.applet.setTransparency("simple");this.parent.parent.applet.endMessages()}};renderingLevelMenu.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"rendering");if(A){this.setSelectedIndex(getArrayIndex(A,renderingLevelMenu.renderingLevels)+1)}};renderingLevelMenu.prototype.getQueryString=function(){var B=null;var A=this.getSelectedIndex();if(A>0){B="rendering="+renderingLevelMenu.renderingLevels[A]}return B};renderingLevelMenu.renderingLevels=["smooth_plus_highlights","wireframe","facets_plus_highlights","flat","lit_wireframes","transparent"];function renderingLevelButton(A,B){toolbarButton.call(this,A,B);this.status="Change the rendering level";this.helpMessage="This button changes the current rendering level.";return this}renderingLevelButton.prototype=new toolbarButton();renderingLevelButton.prototype.onClick=function(){var A=this.parent.renderingLevelMenu.getSelectedIndex()+1;if(A>=this.parent.renderingLevelMenu.getItems()){A=1}else{A++}this.parent.renderingLevelMenu.setSelectedIndex(A)};function edgedFacesButton(A,B){toolbarToggleButton.call(this,A,B);this.status="Show or hide edged faces";this.helpMessage="This button shows or hides edged faces.";return this}edgedFacesButton.prototype=new toolbarToggleButton();edgedFacesButton.prototype.onSelect=function(){this.parent.parent.applet.setEdgedFaces(true);toolbarToggleButton.prototype.onSelect.call(this)};edgedFacesButton.prototype.onDeselect=function(){this.parent.parent.applet.setEdgedFaces(false);toolbarToggleButton.prototype.onDeselect.call(this)};edgedFacesButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"edged_faces");if(A!=undefined){this.setSelected(A=="true")}};edgedFacesButton.prototype.getQueryString=function(){var A=null;if(this.selected!=this.initiallySelected){A="edged_faces="+this.selected}return A};function lightingButton(A,B){toolbarToggleButton.call(this,A,B);this.status="Change the lighting settings";this.helpMessage="This button changes the current lighting settings.";this.lightTint=white.duplicate();this.lightLevel=100;this.lightCoords="camera";this.altitude=0;this.azimuth=180;return this}lightingButton.prototype=new toolbarToggleButton();lightingButton.prototype.onStart=function(){this.initialLightTint=this.lightTint.duplicate();this.initialLightLevel=this.lightLevel;this.initialLightCoords=this.lightCoords;this.initialAltitude=this.altitude;this.initialAzimuth=this.azimuth};lightingButton.prototype.getLightDirection=function(C,A,B){if(C=="camera"){var D=new HCVector3(0,1,0);D.rotateBy(A,new HCVector3(1,0,0));D.rotateBy(B,new HCVector3(0,0,1))}else{var D=new HCVector3(0,0,1);D.rotateBy(A,new HCVector3(0,-1,0));D.rotateBy(B,new HCVector3(0,0,-1))}return D};lightingButton.prototype.setLighting=function(C,E,D,B,A){this.lightTint.red=C.red;this.lightTint.green=C.green;this.lightTint.blue=C.blue;this.lightLevel=E;this.lightCoords=D;this.azimuth=B;this.altitude=A};lightingButton.prototype.openLightingControl=function(){var B="windows/lighting_control.html";var A=getCSSStyle(".lighting_control");if(this.parent.parent.path){B=this.parent.parent.path+B}HCApplet.setCurrentApplet(this.parent.parent.applet);this.lightingControlWindow=openDialogBox(B,parseInt(A.width),parseInt(A.height))};lightingButton.prototype.onSelect=function(){toolbarToggleButton.prototype.onSelect.call(this);this.openLightingControl()};lightingButton.prototype.stringsToColor=function(B){if(B.length!=0){var E=B[B.length-1].split(",");if(E.length==1){return namedColorToColor(E[0])}else{var D=parseInt(E[0]);var C=parseInt(E[1]);var A=parseInt(E[2]);return new RGBColor(D,C,A)}}};lightingButton.prototype.colorToString=function(B){var A=colorToNamedColor(B);if(A){return A}else{return B.toString()}};lightingButton.prototype.parseQueryString=function(F){var B=getQueryVariables(F,"light_tint");if(B.length!=0){this.lightTint=this.stringsToColor(B)}var E=getQueryVariable(F,"light_level");if(E!=undefined){this.lightLevel=parseFloat(E)}var D=getQueryVariable(F,"light_coords");if(D!=undefined){this.lightCoords=D}var A=getQueryVariable(F,"altitude");if(A!=undefined){this.altitude=parseFloat(A)}var C=getQueryVariable(F,"azimuth");if(C!=undefined){this.azimuth=parseFloat(C)}if(B!=undefined){this.parent.parent.applet.setLightTint(this.lightTint)}if(E!=undefined){this.parent.parent.applet.setLightLevel(this.lightLevel/100)}if(D!=undefined){this.parent.parent.applet.setLightCoords(this.lightCoords)}if(D!=undefined||A!=undefined||C!=undefined){this.parent.parent.applet.setLightDirection(this.getLightDirection(this.lightCoords,this.altitude,this.azimuth))}};lightingButton.prototype.getQueryString=function(){var A=null;if(!this.lightTint.matches(this.initialLightTint)){A=addQueryString(A,"light_tint="+this.colorToString(this.lightTint))}if(this.lightLevel!=this.initialLightLevel){A=addQueryString(A,"light_level="+Math.round(this.lightLevel))}if(this.lightCoords!=this.initialLightCoords){A=addQueryString(A,"light_coords="+this.lightCoords)}if(this.altitude!=this.initialAltitude){A=addQueryString(A,"altitude="+Math.round(this.altitude))}if(this.azimuth!=this.initialAzimuth){A=addQueryString(A,"azimuth="+Math.round(this.azimuth))}return A};function detailButton(A,B){toolbarToggleButton.call(this,A,B);this.status="Change the level of detail settings";this.helpMessage="This button changes the current level of detail settings.";this.levelOfDetail=100;this.tessellation=100;return this}detailButton.prototype=new toolbarToggleButton();detailButton.prototype.openDetailControl=function(){var B="windows/detail_control.html";var A=getCSSStyle(".detail_control");if(this.parent.parent.path){B=this.parent.parent.path+B}HCApplet.setCurrentApplet(this.parent.parent.applet);this.detailControlWindow=openDialogBox(B,parseInt(A.width),parseInt(A.height))};detailButton.prototype.onSelect=function(){toolbarToggleButton.prototype.onSelect.call(this);this.openDetailControl()};function renderingToolbar(A,B){toolbar.call(this,A,null,B);this.renderingLevelMenu=new renderingLevelMenu("renderingLevelMenu",this);this.renderingLevelButton=new renderingLevelButton("renderingLevelButton",this);this.edgedFacesButton=new edgedFacesButton("edgedFacesButton",this);this.lightingButton=new lightingButton("lightingButton",this);this.detailButton=new detailButton("detailButton",this);return this}renderingToolbar.prototype=new toolbar();function viewsMenu(A,B){menu.call(this,A,B);return this}viewsMenu.prototype=new menu();viewsMenu.prototype.onChange=function(){var B=this.getSelectedIndex();if(B<this.parent.parent.applet.cameraNames.length){var C=1.5;this.parent.parent.applet.setCamera(B+1,C);this.parent.parent.navigationToolbar.viewToolbar.setVisible(false);this.parent.parent.navigationToolbar.cameraToolbar.setVisible(true);var A=this;window.updateView=function(){A.parent.parent.setView(A.getItemName(B))};this.timeout=window.setTimeout("window.updateView()",C*1000)}else{this.parent.parent.applet.setView(viewsMenu.views[this.getSelectedIndex()-this.parent.parent.applet.cameraNames.length]);this.parent.parent.navigationToolbar.viewToolbar.setVisible(true);this.parent.parent.navigationToolbar.cameraToolbar.setVisible(false);this.parent.parent.setView(this.getItemName(B))}};viewsMenu.prototype.onUnload=function(){if(this.timeout!=undefined){window.clearTimeout(this.timeout)}};viewsMenu.views=["perspective","user","front","back","top","bottom","left","right"];function viewsButton(A,B){toolbarButton.call(this,A,B);this.status="Reset the view";this.helpMessage="This button resets the current view.";return this}viewsButton.prototype=new toolbarButton();viewsButton.prototype.onClick=function(){var A=this.parent.viewsMenu.getSelectedIndex()+1;this.parent.viewsMenu.setSelectedIndex(A)};function viewsToolbar(A,B){toolbar.call(this,A,null,B);this.viewsMenu=new viewsMenu("viewsMenu",this);this.viewsButton=new viewsButton("viewsButton",this);return this}viewsToolbar.prototype=new toolbar();viewsToolbar.prototype.onLoad=function(){toolbar.prototype.onLoad.call(this);for(var A=0;A<=this.parent.applet.cameraNames.length-1;A++){this.viewsMenu.addItem(this.parent.applet.cameraNames[A],false)}this.viewsMenu.addItem("Perspective",true);this.viewsMenu.addItem("User",false);this.viewsMenu.addItem("Front",true);this.viewsMenu.addItem("Back",false);this.viewsMenu.addItem("Top",false);this.viewsMenu.addItem("Bottom",false);this.viewsMenu.addItem("Left",false);this.viewsMenu.addItem("Right",false)};viewsToolbar.prototype.parseQueryString=function(B){if(!B){return }var A=getQueryVariable(B,"view");if(A!=undefined){this.parent.applet.setView(A);this.viewsMenu.element.selectedIndex=getArrayIndex(A,viewsMenu.views)+this.parent.applet.cameraNames.length}};viewsToolbar.prototype.getQueryString=function(){var A=null;if(this.parent.applet.view!=undefined){if(this.parent.applet.view!="user"&&this.parent.applet.view!="perspective"){A="view="+this.parent.applet.view}}return A};function displayButton(A,B){toolbarToggleButton.call(this,A,B);this.status="Display";this.helpMessage="This button shows display options.";return this}displayButton.prototype=new toolbarRadioButton();displayButton.prototype.onLoad=function(){this.displayGeometry=this.parent.parent.applet.displayGeometry;this.displayCameras=this.parent.parent.applet.displayCameras;this.showGrid=this.parent.parent.applet.showGrid;this.showBackground=this.parent.parent.applet.showBackground;this.disableTextures=this.parent.parent.applet.disableTextures;this.displayWorldAxis=this.parent.parent.applet.displayWorldAxis};displayButton.prototype.onStart=function(){this.initialDisplayGeometry=this.displayGeometry;this.initialDisplayCameras=this.displayCameras;this.initialShowGrid=this.showGrid;this.initialShowBackground=this.showBackground;this.initialDisableTextures=this.disableTextures;this.initialDisplayWorldAxis=this.displayWorldAxis};displayButton.prototype.openDisplayWindow=function(){var B="windows/display_control.html";var A=getCSSStyle(".display_control");if(this.parent.parent.path){B=this.parent.parent.path+B}HCApplet.setCurrentApplet(this.parent.parent.applet);this.displayWindow=openDialogBox(B,parseInt(A.width),parseInt(A.height))};displayButton.prototype.onSelect=function(){toolbarToggleButton.prototype.onSelect.call(this);this.openDisplayWindow()};displayButton.prototype.parseQueryString=function(G){var B=getQueryVariable(G,"geometry");if(B!=undefined){this.displayGeometry=(B=="true");this.parent.parent.applet.setDisplayGeometry(this.displayGeometry)}var F=getQueryVariable(G,"cameras");if(F!=undefined){this.displayCameras=(F=="true");this.parent.parent.applet.setDisplayCameras(this.displayCameras)}var E=getQueryVariable(G,"grid");if(E!=undefined){this.showGrid=(E=="true");this.parent.parent.applet.setShowGrid(this.showGrid)}var A=getQueryVariable(G,"background");if(A!=undefined){this.showBackground=(A=="true");this.parent.parent.applet.setShowBackground(this.showBackground)}var C=getQueryVariable(G,"textures");if(C!=undefined){this.disableTextures=(C=="false");this.parent.parent.applet.setDisableTextures(this.disableTextures)}var D=getQueryVariable(G,"axis");if(D!=undefined){this.displayWorldAxis=(D=="true");this.parent.parent.applet.setDisplayWorldAxis(this.displayWorldAxis)}};displayButton.prototype.getQueryString=function(){var A=null;if(this.displayGeometry!=this.initialDisplayGeometry){A=addQueryString(A,"geometry="+this.displayGeometry)}if(this.displayCameras!=this.initialDisplayCameras){A=addQueryString(A,"cameras="+this.displayCameras)}if(this.showGrid!=this.initialShowGrid){A=addQueryString(A,"grid="+this.showGrid)}if(this.showBackground!=this.initialShowBackground){A=addQueryString(A,"background="+this.showBackground)}if(this.disableTextures!=this.initialDisableTextures){A=addQueryString(A,"textures="+!this.disableTextures)}if(this.displayWorldAxis!=this.initialDisplayWorldAxis){A=addQueryString(A,"axis="+this.displayWorldAxis)}return A};function tapeMeasureButton(B,A,C){toolbarRadioButton.call(this,B,A,C);this.status="Tape Measure";this.helpMessage="This button activates the tape measuring tool.";return this}tapeMeasureButton.prototype=new toolbarRadioButton();tapeMeasureButton.prototype.onLoad=function(){this.cursor=new HCIcon("tape_measure_cursor.png","left","bottom")};tapeMeasureButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.setMouseMode("left","tape_measure",this.cursor)};tapeMeasureButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="tape_measure"){this.setSelected(true)}};tapeMeasureButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=tape_measure"}return A};function helpersToolbar(B,A,C){toolbar.call(this,B,null,C);this.displayButton=new displayButton("displayButton",this);this.tapeMeasureButton=new tapeMeasureButton("tapeMeasureButton",A,this);return this}helpersToolbar.prototype=new toolbar();function toolsMenu(A,B){menu.call(this,A,B);this.visible=false;this.enabled=true;return this}toolsMenu.prototype=new menu();toolsMenu.prototype.addToolbar=function(B,D){if(this.element!=null){var A,C;if(!D){A="*"+B}else{A=B}if(D){C="visible"}else{C="invisible"}menu.prototype.addItem.call(this,A,C)}};toolsMenu.prototype.isToolbarVisible=function(A){return(this.getItemValue(A)=="visible")};toolsMenu.prototype.setToolbarVisible=function(B,C){if(C==this.isToolbarVisible(B)){return }if(C){this.setItemValue(B,"visible")}else{this.setItemValue(B,"invisible")}var A=this.getItemName(B);if(C){this.setItemName(B,A.substring(1,A.length))}else{this.setItemName(B,"*"+A)}};toolsMenu.prototype.toggleToolbarVisible=function(A){this.setToolbarVisible(A,!this.isToolbarVisible(A))};function toolsButton(A,B){toolbarButton.call(this,A,B);this.status="Toggle toolbar visibility";this.helpMessage="This button toggles the visibility of the selected toolbar.";return this}toolsButton.prototype=new toolbarButton();toolsButton.prototype.onClick=function(){this.parent.toggleToolbarVisible(this.parent.getSelectedToolbarIndex())};function toolsToolbar(A,B){toolbar.call(this,A,null,B);this.toolsButton=new toolsButton("toolsButton",this);this.toolsMenu=new toolsMenu("toolsMenu",this);this.toolbars=new Array();this.toolbarNames=new Array();this.toolbarQueryStrings=new Array();this.toolbarInitialVisibilities=new Array();return this}toolsToolbar.prototype=new toolbar();toolsToolbar.prototype.onLoad=function(){for(var A=0;A<this.toolbars.length;A++){this.toolbarInitialVisibilities[A]=this.toolbars[A].isVisible()}};toolsToolbar.prototype.addToolbar=function(B,A){if(B.addControl){B.addControl(this)}var C=toLower(A);C=C.replace(/ /g,"_");C+="_toolbar";this.toolbars[this.toolbars.length]=B;this.toolbarNames[this.toolbarNames.length]=A;this.toolbarQueryStrings[this.toolbarQueryStrings.length]=C;this.toolsMenu.addToolbar(A,B.isVisible())};toolsToolbar.prototype.getToolbarName=function(A){return this.toolbarNames[A]};toolsToolbar.prototype.getToolbarIndex=function(B){var A=0;while(A<this.toolbarNames.length){if(this.toolbarNames[A]==B){return A}else{A++}}return null};toolsToolbar.prototype.getToolbarByIndex=function(A){this.toolbars[A]};toolsToolbar.prototype.getToolbarByName=function(A){this.toolbars[this.getToolbarIndex(A)]};toolsToolbar.prototype.getSelectedToolbarIndex=function(){return this.toolsMenu.getSelectedIndex()};toolsToolbar.prototype.getSelectedToolbarName=function(){return this.toolsMenu.getSelectedName()};toolsToolbar.prototype.isToolbarVisible=function(A){return this.toolsMenu.isToolbarVisible(A)};toolsToolbar.prototype.setToolbarVisible=function(A,B){this.toolsMenu.setToolbarVisible(A,B);this.toolbars[A].setVisible(B)};toolsToolbar.prototype.toggleToolbarVisible=function(A){this.toolsMenu.toggleToolbarVisible(A);this.toolbars[A].toggleVisible()};toolsToolbar.prototype.update=function(){for(var A=0;A<this.toolbars.length;A++){this.toolsMenu.setToolbarVisible(A,this.toolbars[A].isVisible())}};toolsToolbar.prototype.parseQueryString=function(G){if(!G){return }var D=G.split("&");for(var B=0;B<D.length;B++){var F=D[B].split("=");var C=F[0];var E=(F[1]=="true");for(var A=0;A<this.toolbarQueryStrings.length;A++){if(C==this.toolbarQueryStrings[A]){this.toolbars[A].setVisible(E)}}}};toolsToolbar.prototype.getQueryString=function(){var C=null;for(var A=0;A<this.toolbars.length;A++){var B=this.toolbars[A].isVisible();if(B!=this.toolbarInitialVisibilities[A]){C=addQueryString(C,this.toolbarQueryStrings[A]+"="+B)}}return C};function mailButton(A,B){toolbarButton.call(this,A,B);this.status="Mail a link to this Page";this.helpMessage="This button mails a link to this page.";return this}mailButton.prototype=new toolbarButton();mailButton.prototype.onClick=function(){var A=getBaseLocation(getWindowLocation());A=A.replace(/ /g,"%20");A=A.replace(/%/g,"%25");var D=this.parent.parent.getQueryString();D=D.replace(/ /g,"%20");D=D.replace(/%/g,"%25");D=D.replace(/&/g,"%26");if(D&&(D!="")){A+="?"+D}var C="";var B="Link To 3D Hypercosm Model";window.open("mailto:"+C+"?subject="+B+"&body="+A)};function linkButton(A,B){toolbarButton.call(this,A,B);this.status="Link to this Page";this.helpMessage="This button links to this page.";return this}linkButton.prototype=new toolbarButton();linkButton.prototype.onClick=function(){this.parent.parent.setQueryString(this.parent.parent.getQueryString())};function internetToolbar(A,B){toolbar.call(this,A,null,B);this.mailButton=new mailButton("mailButton",this);this.linkButton=new linkButton("linkButton",this);return this}internetToolbar.prototype=new toolbar();function paintButton(A,C,B){toolbarRadioButton.call(this,A,C,B);this.status="Paint";this.helpMessage="This button sets the current color.";this.colorTile=getElementById("colorTile",B.element);return this}paintButton.prototype=new toolbarRadioButton();paintButton.prototype.onLoad=function(){this.cursor=new HCIcon("paint_cursor.png","center","middle")};paintButton.prototype.onStart=function(){this.setColor(this.parent.parent.markUp.getPaintColor())};paintButton.prototype.setColor=function(A){this.color=new RGBColor(A.red,A.green,A.blue);if(this.colorTile){var B=A.toHex();if(this.colorTile.style.setAttribute){this.colorTile.style.setAttribute("backgroundColor","#"+B)}else{this.colorTile.style.backgroundColor="#"+B}}this.parent.parent.markUp.setPaintColor(this.color)};paintButton.prototype.getColor=function(){return new RGBColor(this.color.red,this.color.green,this.color.blue)};paintButton.prototype.openColorChooser=function(){var B="windows/color_chooser.html";var A=getCSSStyle(".color_chooser");if(this.parent.parent.path){B=this.parent.parent.path+B}HCApplet.setCurrentApplet(this.parent.parent.applet);this.colorChooserWindow=openDialogBox(B,parseInt(A.width),parseInt(A.height))};paintButton.prototype.onSelect=function(){this.parent.parent.applet.beginMessages();toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.setMouseMode("left","none",this.cursor);this.parent.parent.applet.setMouseMode("right","none",null);var A=this.parent.parent.applet;var B=function(D,C,E){if(A.parent.markUp.hasOverlay(D)){D.setColor(A.parent.principalToolbar.paintButton.color);A.setOverlayColor(D,A.parent.principalToolbar.paintButton.color)}};this.listener=HCEvent.addListener(this.parent.parent.applet,"mouseup",B);this.parent.parent.applet.endMessages();if(this.parent.parent.loaded){this.openColorChooser()}};paintButton.prototype.onDeselect=function(){toolbarRadioButton.prototype.onDeselect.call(this);this.parent.parent.applet.setMouseMode("left","none",null);HCEvent.removeListener(this.listener)};paintButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="paint"){this.setSelected(true)}this.setColor(this.parent.parent.markUp.getPaintColor())};paintButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=paint"}return A};function eraserButton(A,C,B){toolbarRadioButton.call(this,A,C,B);this.status="Erase selected marker";this.helpMessage="This button erases a marker that is clicked on.";return this}eraserButton.prototype=new toolbarRadioButton();eraserButton.prototype.onLoad=function(){this.cursor=new HCIcon("eraser_cursor.png","center","middle")};eraserButton.prototype.onSelect=function(){this.parent.parent.applet.beginMessages();toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.setMouseMode("left","none",this.cursor);this.parent.parent.applet.setMouseMode("right","none",null);var A=this.parent.parent.applet;var B=function(D,C,E){if(D){A.parent.standardToolbar.undoButton.setOverlay(D);A.parent.standardToolbar.undoButton.setEnabled(true);A.parent.standardToolbar.redoButton.setEnabled(false);A.removeOverlay(D)}};this.listener=HCEvent.addListener(this.parent.parent.applet,"mouseup",B);this.parent.parent.applet.endMessages()};eraserButton.prototype.onDeselect=function(){toolbarRadioButton.prototype.onDeselect.call(this);this.parent.parent.applet.setMouseMode("left","none",null);HCEvent.removeListener(this.listener)};eraserButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="eraser"){this.setSelected(true)}};eraserButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=eraser"}return A};function principalToolbar(B,A,C){toolbar.call(this,B,null,C);this.paintButton=new paintButton("paintButton",A,this);this.eraserButton=new eraserButton("eraserButton",A,this);return this}principalToolbar.prototype=new toolbar();function lineButton(A,C,B){toolbarRadioButton.call(this,A,C,B);this.status="Draw straight lines";this.helpMessage="This button is used to draw straight lines.";return this}lineButton.prototype=new toolbarRadioButton();lineButton.prototype.onLoad=function(){this.cursor=new HCIcon("line_cursor.png","center","bottom")};lineButton.prototype.drawLine=function(B){if(B.length>=2){var A=this.parent.parent.markUp.getPaintColor();if(this.parent.parent.layersToolbar){var C=this.parent.parent.layersToolbar.getSelectedIndex();if(!this.parent.parent.layersToolbar.isLayerVisible(C)){C=0}}else{var C=0}this.parent.parent.markUp.addOverlay(new HCLine(B,A),C)}};lineButton.prototype.onSelect=function(){this.parent.parent.applet.beginMessages();toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.setMouseMode("left","draw_line",this.cursor,"HCApplet.getAppletById('"+this.parent.parent.applet.id+"').parent.markUpToolbar.lineButton.drawLine");this.parent.parent.applet.setMouseMode("right","none",null);this.parent.parent.applet.endMessages()};lineButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="line"){this.setSelected(true)}};lineButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=line"}return A};function freeHandButton(A,C,B){toolbarRadioButton.call(this,A,C,B);this.status="Draw freehand curves";this.helpMessage="This button is used to draw freehand curves.";return this}freeHandButton.prototype=new toolbarRadioButton();freeHandButton.prototype.onLoad=function(){this.cursor=new HCIcon("freehand_cursor.png","center","bottom")};freeHandButton.prototype.drawCurve=function(C){var B=5;if(C.length>2){var H=3;var F=2+Math.floor((C.length-2)/H);var G=new Array(F);G[0]=C[0];for(var E=1;E<C.length;E++){if((E%H)==0){G[E/H]=C[E]}}G[F-1]=C[C.length-1];var A=this.parent.parent.markUp.getPaintColor();if(this.parent.parent.layersToolbar){var D=this.parent.parent.layersToolbar.getSelectedIndex();if(!this.parent.parent.layersToolbar.isLayerVisible(D)){D=0}}else{var D=0}this.parent.parent.markUp.addOverlay(new HCCurve(B,G,A),D)}};freeHandButton.prototype.onSelect=function(){this.parent.parent.applet.beginMessages();toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.setMouseMode("left","freehand",this.cursor,"HCApplet.getAppletById('"+this.parent.parent.applet.id+"').parent.markUpToolbar.freeHandButton.drawCurve");this.parent.parent.applet.setMouseMode("right","none",null);this.parent.parent.applet.endMessages()};freeHandButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="freehand"){this.setSelected(true)}};freeHandButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=freehand"}return A};function markUpToolbar(B,A,C){toolbar.call(this,B,null,C);this.lineButton=new lineButton("lineButton",A,this);this.freeHandButton=new freeHandButton("freeHandButton",A,this);return this}markUpToolbar.prototype=new toolbar();function textButton(A,C,B){toolbarRadioButton.call(this,A,C,B);this.status="Create text";this.helpMessage="This button is used to create text annotations.";return this}textButton.prototype=new toolbarRadioButton();textButton.prototype.onLoad=function(){this.cursor=new HCIcon("text_cursor.png","right","bottom")};textButton.prototype.addText=function(C,D,B,A){if(B){this.addLeaderText(C,D,B,A)}else{this.addScreenText(C,D,A)}};textButton.prototype.addScreenText=function(D,A,B){if(this.parent.parent.layersToolbar){var C=this.parent.parent.layersToolbar.getSelectedIndex();if(!this.parent.parent.layersToolbar.isLayerVisible(C)){C=0}}else{var C=0}this.parent.parent.markUp.addOverlay(new HCText(D,A,"center","middle",B),C,"HCMarkUp.getMarkUpById('"+this.parent.parent.applet.id+"').changeText")};textButton.prototype.addLeaderText=function(D,E,C,A){if(this.parent.parent.layersToolbar){var B=this.parent.parent.layersToolbar.getSelectedIndex();if(!this.parent.parent.layersToolbar.isLayerVisible(B)){B=0}}else{var B=0}this.parent.parent.markUp.addOverlay(new HCLabel(D,E,C,A),B,"HCMarkUp.getMarkUpById('"+this.parent.parent.applet.id+"').changeText")};textButton.prototype.drawText=function(G,H,E){if(this.currentText){this.parent.parent.applet.deselectOverlay(this.currentText)}var B=this.parent.parent.markUp.getPaintColor();if(E){this.addLeaderText(G,H,E,B)}else{this.addScreenText(G,H,B)}if(this.parent.parent.standardToolbar.selectButton.overlay){this.parent.parent.applet.deselectOverlay(this.parent.parent.standardToolbar.selectButton.overlay)}var C=this.parent.parent.applet.getOverlay(HCOverlay.overlays.length-1);this.parent.parent.applet.beginMessages();this.parent.parent.applet.selectOverlay(C);this.parent.parent.applet.selectOverlay(C);this.parent.parent.applet.endMessages();this.currentText=C;this.parent.parent.standardToolbar.selectButton.overlay=C;this.parent.parent.applet.setMouseMode("left","none",null);var A=this;var D=this.parent.parent.applet;var F=function(J,I,K){if(A.currentText){D.deselectOverlay(A.currentText)}D.setMouseMode("left","place_text",A.cursor,"HCApplet.getAppletById('"+D.id+"').parent.annotationToolbar.textButton.drawText");HCEvent.removeListener(A.listener);A.listener=null};this.listener=HCEvent.addListener(this.parent.parent.applet,"mousedown",F)};textButton.prototype.onSelect=function(){this.parent.parent.applet.beginMessages();toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.setMouseMode("left","place_text",this.cursor,"HCApplet.getAppletById('"+this.parent.parent.applet.id+"').parent.annotationToolbar.textButton.drawText");this.parent.parent.applet.setMouseMode("right","none",null);this.parent.parent.applet.endMessages()};textButton.prototype.onDeselect=function(){toolbarRadioButton.prototype.onDeselect.call(this);if(this.currentText){this.parent.parent.applet.deselectOverlay(this.currentText)}this.parent.parent.applet.setMouseMode("left","none",null);if(this.listener){HCEvent.removeListener(this.listener);this.listener=null}};textButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="add_text"){this.setSelected(true)}};textButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=add_text"}return A};function addMarkerButton(A,C,B){toolbarRadioButton.call(this,A,C,B);this.status="Create marker";this.helpMessage="This button adds a marker.";return this}addMarkerButton.prototype=new toolbarRadioButton();addMarkerButton.prototype.onLoad=function(){this.cursor=new HCIcon("add_marker_cursor.png","center","middle",new HCVector2(-10,-10))};addMarkerButton.prototype.openAddHyperlinkWindow=function(){var B="windows/add_hyperlink.html";var A=getCSSStyle(".add_hyperlink");if(this.parent.parent.path){B=this.parent.parent.path+B}HCApplet.setCurrentApplet(this.parent.parent.applet);this.addHyperlinkWindow=openDialogBox(B,parseInt(A.width),parseInt(A.height))};addMarkerButton.prototype.onSelect=function(){this.parent.parent.applet.beginMessages();toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.setMouseMode("left","none",this.cursor);this.parent.parent.applet.setMouseMode("right","none",null);if(!this.parent.parent.markUp.icons.nextIcon){this.parent.parent.markUp.icons.toFirstIcon()}var A=this;var B=this.parent.parent.applet;var C=function(G,E,I){if((E!=null)&&(I=="left")){var F=B.parent.markUp.getPaintColor();var D=new HCMarker(E,B.parent.markUp.icons.getNextIcon(),F);if(B.parent.layersToolbar){var H=B.parent.layersToolbar.getSelectedIndex();if(!B.parent.layersToolbar.isLayerVisible(H)){H=0}}else{var H=0}B.parent.markUp.addOverlay(D,H);A.marker=D;A.openAddHyperlinkWindow()}};this.listener=HCEvent.addListener(this.parent.parent.applet,"mousedown",C);this.parent.parent.applet.endMessages()};addMarkerButton.prototype.onDeselect=function(){toolbarRadioButton.prototype.onDeselect.call(this);this.parent.parent.applet.setMouseMode("left","none",null);HCEvent.removeListener(this.listener)};addMarkerButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="add_marker"){this.setSelected(true)}};addMarkerButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=add_marker"}return A};function addStickyNoteButton(A,C,B){toolbarRadioButton.call(this,A,C,B);this.status="Create sticky note";this.helpMessage="This button adds a sticky note.";return this}addStickyNoteButton.prototype=new toolbarRadioButton();addStickyNoteButton.prototype.onLoad=function(){this.cursor=new HCIcon("add_sticky_note_cursor.png","center","middle");this.icon=this.cursor;var A=this;HCEvent.addListener(this.parent.parent.applet,"click",function(C,B){if(C&&(C.note!=undefined)&&!A.parent.parent.principalToolbar.eraserButton.selected){A.marker=C;A.openAddNoteWindow()}})};addStickyNoteButton.prototype.openAddNoteWindow=function(){var B="windows/edit_sticky_note.html";var A=getCSSStyle(".edit_sticky_note");if(this.parent.parent.path){B=this.parent.parent.path+B}HCApplet.setCurrentApplet(this.parent.parent.applet);this.addStickyNoteWindow=openDialogBox(B,parseInt(A.width),parseInt(A.height))};addStickyNoteButton.prototype.onSelect=function(){this.parent.parent.applet.beginMessages();toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.setMouseMode("left","none",this.cursor);this.parent.parent.applet.setMouseMode("right","none",null);var A=this;var B=this.parent.parent.applet;var C=function(F,E,H){if((E!=null)&&(H=="left")){var D=new HCMarker(E,A.icon);D.note="";if(B.parent.layersToolbar){var G=B.parent.layersToolbar.getSelectedIndex();if(!B.parent.layersToolbar.isLayerVisible(G)){G=0}}else{var G=0}B.parent.markUp.addOverlay(D,G);A.marker=D;A.openAddNoteWindow()}};this.listener=HCEvent.addListener(this.parent.parent.applet,"mousedown",C);this.parent.parent.applet.endMessages()};addStickyNoteButton.prototype.onDeselect=function(){toolbarRadioButton.prototype.onDeselect.call(this);this.parent.parent.applet.setMouseMode("left","none",null);HCEvent.removeListener(this.listener)};addStickyNoteButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="add_note"){this.setSelected(true)}};addStickyNoteButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=add_note"}return A};function annotationToolbar(B,A,C){toolbar.call(this,B,null,C);this.textButton=new textButton("textButton",A,this);this.addMarkerButton=new addMarkerButton("addMarkerButton",A,this);this.addStickyNoteButton=new addStickyNoteButton("addStickyNoteButton",A,this);return this}annotationToolbar.prototype=new toolbar();function collaborateButton(A,B){toolbarToggleButton.call(this,A,B);this.status="Collaborate";this.helpMessage="This button is used to collaborate with another person remotely over the Internet.";return this}collaborateButton.prototype=new toolbarToggleButton();collaborateButton.prototype.onSelect=function(){toolbarToggleButton.prototype.onSelect.call(this);this.parent.selectIPAddress()};collaborateButton.prototype.onDeselect=function(){toolbarToggleButton.prototype.onDeselect.call(this);this.parent.parent.applet.disconnect();this.parent.freeButton.setSelected(true);this.parent.freeButton.group.setEnabled(false)};function leadButton(A,C,B){toolbarRadioButton.call(this,A,C,B);this.status="Lead";this.helpMessage="This button is used to lead the other collaborator.";return this}leadButton.prototype=new toolbarRadioButton();leadButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.setCollaborationMode("lead")};function followButton(A,C,B){toolbarRadioButton.call(this,A,C,B);this.status="Follow";this.helpMessage="This button is used to follow the other collaborator.";return this}followButton.prototype=new toolbarRadioButton();followButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.setCollaborationMode("follow")};function freeButton(A,C,B){toolbarRadioButton.call(this,A,C,B);this.status="Disengage";this.helpMessage="This button is used to engage or disengage from collaboration.";return this}freeButton.prototype=new toolbarRadioButton();freeButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);if(this.parent){if(this.parent.parent){this.parent.parent.applet.setCollaborationMode("free")}}};function collaborationToolbar(A,B){toolbar.call(this,A,null,B);this.collaborateButton=new collaborateButton("collaborateButton",this);var C=new radioButtonGroup();this.freeButton=new freeButton("freeButton",C,this);this.leadButton=new leadButton("leadButton",C,this);this.followButton=new followButton("followButton",C,this);radioButton.prototype.setSelected(this.freeButton,true);C.setEnabled(false);return this}collaborationToolbar.prototype=new toolbar();collaborationToolbar.prototype.onLoad=function(){this.parent.applet.getAttribute("ip_address");this.setCollaboration("free");var A=this;this.parent.applet.setCallback("connection",function(B){A.setConnection(B)});this.parent.applet.setCallback("collaboration",function(B){A.setCollaboration(B)})};collaborationToolbar.prototype.onUnload=function(){if(this.timeout!=undefined){window.clearTimeout(this.timeout)}};collaborationToolbar.prototype.selectIPAddress=function(){var A=true;if(A){var C="windows/ip_address_chooser.html";var B=getCSSStyle(".ip_address_chooser");if(this.parent.path){C=this.parent.path+C}HCApplet.setCurrentApplet(this.parent.applet);this.IPAddressChooser=openDialogBox(C,parseInt(B.width),parseInt(B.height))}else{this.parent.applet.connect()}};collaborationToolbar.prototype.getLocalIPAddress=function(){return this.parent.applet.IPAddress};collaborationToolbar.prototype.setRemoteIPAddress=function(A){this.remoteIPAddress=A};collaborationToolbar.prototype.getRemoteIPAddress=function(){return this.remoteIPAddress};collaborationToolbar.prototype.setRemotePort=function(A){this.remotePort=A};collaborationToolbar.prototype.getRemotePort=function(){return this.remotePort};collaborationToolbar.prototype.dismissConnectionStatusWindow=function(){if(this.connectionStatusWindow){this.connectionStatusWindow.connectionStatus.collaborationToolbar=null;this.connectionStatusWindow.close();this.connectionStatusWindow=null}};collaborationToolbar.prototype.setConnection=function(A){if(A=="connected"){if(this.connectionStatusWindow){this.timeout=window.setTimeout("HCApplet.getAppletById('"+this.parent.applet.id+"').parent.collaborationToolbar.dismissConnectionStatusWindow()",100)}this.freeButton.group.setEnabled(enabled);this.setCollaboration("free")}else{if(A=="disconnected"){this.freeButton.setSelected(true);this.freeButton.group.setEnabled(false);this.collaborateButton.setSelected(false)}}};collaborationToolbar.prototype.setCollaboration=function(A){if(A=="free"){toolbarRadioButton.prototype.onSelect.call(this.freeButton)}else{if(A=="lead"){toolbarRadioButton.prototype.onSelect.call(this.leadButton)}else{if(A="follow"){toolbarRadioButton.prototype.onSelect.call(this.followButton)}}}};function zoomButton(B,A,C){toolbarRadioButton.call(this,B,A,C);this.status="Zoom";return this}zoomButton.prototype=new toolbarRadioButton();zoomButton.prototype.onLoad=function(){this.cursor=new HCIcon("zoom_cursor.png","center","middle")};zoomButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.parent.applet.setMouseMode("left","zoom",this.cursor);var A=this;this.listener=HCEvent.addListener(this.parent.parent.parent.applet,"mousedown",function(){A.parent.parent.parent.setView()})};zoomButton.prototype.onDeselect=function(){toolbarRadioButton.prototype.onDeselect.call(this);HCEvent.removeListener(this.listener)};zoomButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="zoom"){this.setSelected(true)}};zoomButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=zoom"}return A};function walkButton(B,A,C){toolbarRadioButton.call(this,B,A,C);this.status="Walk Through";return this}walkButton.prototype=new toolbarRadioButton();walkButton.prototype.onLoad=function(){this.cursor=new HCIcon("walk_cursor.png","center","middle")};walkButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.parent.applet.setMouseMode("left","walk",this.cursor);this.parent.parent.parent.applet.setMouseMode("right","look_around",this.parent.panViewButton.cursor);var A=this;this.listener=HCEvent.addListener(this.parent.parent.parent.applet,"mousedown",function(){A.parent.parent.parent.setView()})};walkButton.prototype.onDeselect=function(){toolbarRadioButton.prototype.onDeselect.call(this);this.parent.parent.parent.applet.setMouseMode("left","none",null);this.parent.parent.parent.applet.setMouseMode("right","none",null);HCEvent.removeListener(this.listener)};walkButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="walk"){this.setSelected(true)}};walkButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=walk"}return A};function zoomExtentsButton(A,B){toolbarButton.call(this,A,B);this.status="Zoom Extents";return this}zoomExtentsButton.prototype=new toolbarButton();zoomExtentsButton.prototype.onClick=function(){this.parent.parent.parent.applet.setView("auto")};function zoomRegionButton(B,A,C){toolbarRadioButton.call(this,B,A,C);this.status="Click and drag a region to zoom into";return this}zoomRegionButton.prototype=new toolbarRadioButton();zoomRegionButton.prototype.onLoad=function(){this.cursor=new HCIcon("zoom_region_cursor.png","center","middle",new HCVector2(-7,7))};zoomRegionButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.parent.applet.setMouseMode("left","zoom_region",this.cursor);var A=this;this.listener=HCEvent.addListener(this.parent.parent.parent.applet,"mousedown",function(){A.parent.parent.parent.setView()})};zoomRegionButton.prototype.onDeselect=function(){toolbarRadioButton.prototype.onDeselect.call(this);HCEvent.removeListener(this.listener)};zoomRegionButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="zoom_region"){this.setSelected(true)}};zoomRegionButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=zoom_region"}return A};function zoomFovButton(B,A,C){toolbarRadioButton.call(this,B,A,C);this.status="Click and drag a region to zoom into";return this}zoomFovButton.prototype=new toolbarRadioButton();zoomFovButton.prototype.onLoad=function(){this.cursor=new HCIcon("fov_cursor.png","center","middle")};zoomFovButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.parent.applet.setMouseMode("left","zoom_fov",this.cursor);var A=this;this.listener=HCEvent.addListener(this.parent.parent.parent.applet,"mousedown",function(){A.parent.parent.parent.setView()})};zoomFovButton.prototype.onDeselect=function(){toolbarRadioButton.prototype.onDeselect.call(this);HCEvent.removeListener(this.listener)};zoomFovButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="zoom_fov"){this.setSelected(true)}};zoomFovButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=zoom_fov"}return A};function panButton(B,A,C){toolbarRadioButton.call(this,B,A,C);this.status="Click and drag to pan a non-camera view";return this}panButton.prototype=new toolbarRadioButton();panButton.prototype.onLoad=function(){this.cursor=new HCIcon("truck_cursor.png","center","middle")};panButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.parent.applet.setMouseMode("left","pan",this.cursor);var A=this;this.listener=HCEvent.addListener(this.parent.parent.parent.applet,"mousedown",function(){A.parent.parent.parent.setView()})};panButton.prototype.onDeselect=function(){toolbarRadioButton.prototype.onDeselect.call(this);HCEvent.removeListener(this.listener)};panButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="pan"){this.setSelected(true)}};panButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=pan"}return A};function rotateButton(B,A,C){toolbarRadioButton.call(this,B,A,C);this.status="Click and drag to rotate the view";return this}rotateButton.prototype=new toolbarRadioButton();rotateButton.prototype.onLoad=function(){this.cursor=new HCIcon("rotate_cursor.png","center","middle")};rotateButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.parent.applet.setMouseMode("left","rotate",this.cursor);var A=this;this.listener=HCEvent.addListener(this.parent.parent.parent.applet,"mousedown",function(){A.parent.parent.parent.setView()})};rotateButton.prototype.onDeselect=function(){toolbarRadioButton.prototype.onDeselect.call(this);HCEvent.removeListener(this.listener)};rotateButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="rotate"){this.setSelected(true)}};rotateButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=rotate"}return A};function panViewButton(B,A,C){toolbarRadioButton.call(this,B,A,C);this.status="Click and drag to pan the view";return this}panViewButton.prototype=new toolbarRadioButton();panViewButton.prototype.onLoad=function(){this.cursor=new HCIcon("pan_cursor.png","center","middle")};panViewButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.parent.applet.setMouseMode("left","look_around",this.cursor);var A=this;this.listener=HCEvent.addListener(this.parent.parent.parent.applet,"mousedown",function(){A.parent.parent.parent.setView()})};panViewButton.prototype.onDeselect=function(){toolbarRadioButton.prototype.onDeselect.call(this);HCEvent.removeListener(this.listener)};panViewButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="pan_view"){this.setSelected(true)}};panViewButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=pan_view"}return A};function viewToolbar(B,A,C){toolbar.call(this,B,null,C);this.zoomButton=new zoomButton("zoomButton",A,this);this.walkButton=new walkButton("walkButton",A,this);this.zoomExtentsButton=new zoomExtentsButton("zoomExtentsButton",this);this.zoomRegionButton=new zoomRegionButton("zoomRegionButton",A,this);this.zoomFovButton=new zoomFovButton("zoomFovButton",A,this);this.panButton=new panButton("panButton",A,this);this.rotateButton=new rotateButton("rotateButton",A,this);this.panViewButton=new panViewButton("panViewButton",A,this);return this}viewToolbar.prototype=new toolbar();viewToolbar.prototype.setVisible=function(A){toolbar.prototype.setVisible.call(this,A);if(A&&this.parent.cameraToolbar){if(this.parent.cameraToolbar.dollyButton.selected){this.zoomButton.setSelected(true)}else{if(this.parent.cameraToolbar.perspectiveButton.selected){this.walkButton.setSelected(true)}else{if(this.parent.cameraToolbar.zoomRegionFovButton.selected){this.zoomRegionButton.setSelected(true)}else{if(this.parent.cameraToolbar.fieldOfViewButton.selected){this.zoomFovButton.setSelected(true)}else{if(this.parent.cameraToolbar.truckButton.selected){this.panButton.setSelected(true)}else{if(this.parent.cameraToolbar.orbitButton.selected){this.rotateButton.setSelected(true)}else{if(this.parent.cameraToolbar.panCameraButton.selected){this.panViewButton.setSelected(true)}}}}}}}}};function dollyButton(B,A,C){toolbarRadioButton.call(this,B,A,C);this.status="Click and drag to dolly the camera";return this}dollyButton.prototype=new toolbarRadioButton();dollyButton.prototype.onLoad=function(){this.cursor=new HCIcon("dolly_cursor.png","center","middle")};dollyButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.parent.applet.setMouseMode("left","zoom",this.cursor)};dollyButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="dolly"){this.setSelected(true)}};dollyButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=dolly"}return A};function perspectiveButton(B,A,C){toolbarRadioButton.call(this,B,A,C);this.status="Click and drag to adjust the camera perspective";return this}perspectiveButton.prototype=new toolbarRadioButton();perspectiveButton.prototype.onLoad=function(){this.cursor=new HCIcon("perspective_cursor.png","center","middle")};perspectiveButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.parent.applet.setMouseMode("left","zoom_perspective",this.cursor)};perspectiveButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="perspective"){this.setSelected(true)}};perspectiveButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=perspective"}return A};function rollButton(B,A,C){toolbarRadioButton.call(this,B,A,C);this.status="Click and drag to roll the camera";return this}rollButton.prototype=new toolbarRadioButton();rollButton.prototype.onLoad=function(){this.cursor=new HCIcon("roll_camera_cursor.png","center","middle")};rollButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.parent.applet.setMouseMode("left","roll",this.cursor)};rollButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="roll"){this.setSelected(true)}};rollButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=roll"}return A};function zoomRegionFovButton(B,A,C){toolbarRadioButton.call(this,B,A,C);this.status="Click and drag a region to zoom into";return this}zoomRegionFovButton.prototype=new toolbarRadioButton();zoomRegionFovButton.prototype.onLoad=function(){this.cursor=new HCIcon("zoom_region_cursor.png","center","middle",new HCVector2(-7,7))};zoomRegionFovButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.parent.applet.setMouseMode("left","zoom_region_fov",this.cursor)};zoomRegionFovButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="zoom_region_fov"){this.setSelected(true)}};zoomRegionFovButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=zoom_region_fov"}return A};function fieldOfViewButton(B,A,C){toolbarRadioButton.call(this,B,A,C);this.status="Click and drag to adjust the camera's field-of-view";return this}fieldOfViewButton.prototype=new toolbarRadioButton();fieldOfViewButton.prototype.onLoad=function(){this.cursor=new HCIcon("fov_cursor.png","center","middle")};fieldOfViewButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.parent.applet.setMouseMode("left","zoom_fov",this.cursor)};fieldOfViewButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="fov"){this.setSelected(true)}};fieldOfViewButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=fov"}return A};function truckButton(B,A,C){toolbarRadioButton.call(this,B,A,C);this.status="Click and drag to truck the camera";return this}truckButton.prototype=new toolbarRadioButton();truckButton.prototype.onLoad=function(){this.cursor=new HCIcon("truck_cursor.png","center","middle")};truckButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.parent.applet.setMouseMode("left","pan",this.cursor)};truckButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="truck"){this.setSelected(true)}};truckButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=truck"}return A};function orbitButton(B,A,C){toolbarRadioButton.call(this,B,A,C);this.status="Click and drag to orbit the camera";return this}orbitButton.prototype=new toolbarRadioButton();orbitButton.prototype.onLoad=function(){this.cursor=new HCIcon("orbit_cursor.png","center","middle")};orbitButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.parent.applet.setMouseMode("left","rotate",this.cursor)};orbitButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="orbit"){this.setSelected(true)}};orbitButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=orbit"}return A};function panCameraButton(B,A,C){toolbarRadioButton.call(this,B,A,C);this.status="Click and drag to pan the camera";return this}panCameraButton.prototype=new toolbarRadioButton();panCameraButton.prototype.onLoad=function(){this.cursor=new HCIcon("pan_cursor.png","center","middle")};panCameraButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.parent.applet.setMouseMode("left","look_around",this.cursor)};panCameraButton.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"mouse_mode");if(A=="pan_camera"){this.setSelected(true)}};panCameraButton.prototype.getQueryString=function(){var A=null;if(this.selected&&!this.initiallySelected){A="mouse_mode=pan_camera"}return A};function cameraToolbar(B,A,C){toolbar.call(this,B,null,C);this.dollyButton=new dollyButton("dollyButton",A,this);this.perspectiveButton=new perspectiveButton("perspectiveButton",A,this);this.rollButton=new rollButton("rollButton",A,this);this.zoomRegionFovButton=new zoomRegionFovButton("zoomRegionFovButton",A,this);this.fieldOfViewButton=new fieldOfViewButton("fieldOfViewButton",A,this);this.truckButton=new truckButton("truckButton",A,this);this.orbitButton=new orbitButton("orbitButton",A,this);this.panCameraButton=new panCameraButton("panButton",A,this);return this}cameraToolbar.prototype=new toolbar();cameraToolbar.prototype.setVisible=function(A){toolbar.prototype.setVisible.call(this,A);if(A&&this.parent.viewToolbar){if(this.parent.viewToolbar.zoomButton.selected){this.dollyButton.setSelected(true)}else{if(this.parent.viewToolbar.walkButton.selected){this.perspectiveButton.setSelected(true)}else{if(this.parent.viewToolbar.zoomRegionButton.selected){this.zoomRegionFovButton.setSelected(true)}else{if(this.parent.viewToolbar.zoomFovButton.selected){this.fieldOfViewButton.setSelected(true)}else{if(this.parent.viewToolbar.panButton.selected){this.truckButton.setSelected(true)}else{if(this.parent.viewToolbar.rotateButton.selected){this.orbitButton.setSelected(true)}else{if(this.parent.viewToolbar.panViewButton.selected){this.panCameraButton.setSelected(true)}}}}}}}}};function navigationToolbar(B,A,C){toolbar.call(this,B,null,C);this.viewToolbar=new viewToolbar("viewToolbar",A,this);this.cameraToolbar=new cameraToolbar("cameraToolbar",A,this);return this}navigationToolbar.prototype=new toolbar();navigationToolbar.prototype.onLoad=function(){toolbar.prototype.onLoad.call(this);if(this.parent.applet.cameraNames.length>0){this.viewToolbar.setVisible(false);this.cameraToolbar.setVisible(true)}else{this.viewToolbar.setVisible(true);this.cameraToolbar.setVisible(false)}};navigationToolbar.prototype.parseQueryString=function(A){this.viewToolbar.parseQueryString(A);this.cameraToolbar.parseQueryString(A)};navigationToolbar.prototype.getQueryString=function(){var A=null;A=addQueryString(A,this.viewToolbar.getQueryString());A=addQueryString(A,this.cameraToolbar.getQueryString());return A};function timeSlider(B){labelledSlider.call(this,"timeSlider",0,100,"timeSliderTextField",B);this.previousButton=new button("sliderHandlePreviousButton",this);this.nextButton=new button("sliderHandleNextButton",this);var A=this;this.previousButton.onclick=function(){A.setValue(A.getValue()-1)};this.nextButton.onclick=function(){A.setValue(A.getValue()+1)};return this}timeSlider.prototype=new labelledSlider();timeSlider.prototype.onLoad=function(){this.setValue(this.getValue())};timeSlider.prototype.getLabelText=function(B){var A="frames";if(this.parent.parent.applet){if(this.parent.parent.applet.timeDisplay!=undefined){A=this.parent.parent.applet.timeDisplay}}if(A!="seconds"){return this.valueToString(B)+" / 100"}else{var D=B/100*this.parent.parent.applet.endTime;var C=this.parent.parent.applet.endTime;return D.toFixed(2)+" / "+C.toFixed(2)}};timeSlider.prototype.update=function(){if(this.handleLabelTextElement){this.handleLabelTextElement.innerHTML=this.getLabelText(this.value)}};timeSlider.prototype.onMouseDown=function(A){slider.prototype.onMouseDown.call(this,A);this.parent.playButton.setSelected(false)};timeSlider.prototype.onChange=function(A){if(this.parent.parent.applet){var B=this.parent.parent.applet.endTime-this.parent.parent.applet.startTime;this.parent.parent.applet.setCurrentTime(this.parent.parent.applet.startTime+this.getValue()/100*B)}labelledSlider.prototype.onChange.call(this,A)};timeSlider.prototype.parseQueryString=function(B){var A=getQueryVariable(B,"time");if(A!=undefined){this.setValue(parseInt(A))}};timeSlider.prototype.getQueryString=function(){var A=Math.round(this.getValue());if(A>0){return"time="+A}};function startButton(A,B){toolbarButton.call(this,A,B);this.status="Go to Start";return this}startButton.prototype=new toolbarButton();startButton.prototype.onClick=function(){this.parent.timeSlider.setValue(0)};function previousButton(A,B){toolbarButton.call(this,A,B);this.status="Previous Frame";return this}previousButton.prototype=new toolbarButton();previousButton.prototype.onClick=function(){this.parent.timeSlider.setValue(this.parent.timeSlider.getValue()-1)};function playButton(A,B){toggleButton.call(this,A,B);this.status="Play Animation";return this}playButton.prototype=new toggleButton();playButton.prototype.onUnload=function(){if(this.timeout!=undefined){window.clearTimeout(this.timeout)}};playButton.prototype.onSelect=function(){radioButton.prototype.onSelect.call(this);var B=this;var A=33;var D=this.parent.parent.applet.endTime-this.parent.parent.applet.startTime;var C=A/1000/D*100;window.advanceTime=function(){if(B.parent.parent.applet.playbackDirection=="forward"){var E=parseFloat(B.parent.timeSlider.getValue())+C*Math.abs(B.parent.parent.applet.playbackSpeed)}else{if(B.parent.parent.applet.playbackDirection=="reverse"){var E=parseFloat(B.parent.timeSlider.getValue())-C*Math.abs(B.parent.parent.applet.playbackSpeed)}else{if(B.parent.parent.applet.playbackDirection=="ping_pong"){var E=parseFloat(B.parent.timeSlider.getValue())-C*B.parent.parent.applet.playbackSpeed}}}if(E>0&&E<100){B.parent.timeSlider.setValue(E);B.timeout=window.setTimeout("window.advanceTime()",A)}else{if(B.parent.parent.applet.looping){if(B.parent.parent.applet.playbackDirection=="forward"){B.parent.timeSlider.setValue(0)}else{if(B.parent.parent.applet.playbackDirection=="reverse"){B.parent.timeSlider.setValue(100)}else{if(B.parent.parent.applet.playbackDirection=="ping_pong"){B.parent.timeSlider.setValue(Math.min(Math.max(E,0),100));B.parent.parent.applet.playbackSpeed=-B.parent.parent.applet.playbackSpeed}}}B.timeout=window.setTimeout("window.advanceTime()",A)}else{B.parent.timeSlider.setValue(Math.min(Math.max(E,0),100));B.parent.playButton.setSelected(false)}}};B.timeout=window.setTimeout("window.advanceTime()",A)};playButton.prototype.onDeselect=function(){window.clearTimeout(this.timeout);toggleButton.prototype.onDeselect.call(this)};function nextButton(A,B){toolbarButton.call(this,A,B);this.status="Next Frame";return this}nextButton.prototype=new toolbarButton();nextButton.prototype.onClick=function(){this.parent.timeSlider.setValue(this.parent.timeSlider.getValue()+1)};function endButton(A,B){toolbarButton.call(this,A,B);this.status="Go to End";return this}endButton.prototype=new toolbarButton();endButton.prototype.onClick=function(){this.parent.timeSlider.setValue(100)};function timeConfigurationButton(A,B){toolbarToggleButton.call(this,A,B);this.status="Time Configuration";this.helpMessage="Time Configuration";return this}timeConfigurationButton.prototype=new toolbarToggleButton();timeConfigurationButton.prototype.openTimeConfigurationWindow=function(){var B="windows/time_configuration.html";var A=getCSSStyle(".time_configuration");if(this.parent.parent.path){B=this.parent.parent.path+B}HCApplet.setCurrentApplet(this.parent.parent.applet);this.timeConfigurationWindow=openDialogBox(B,parseInt(A.width),parseInt(A.height))};timeConfigurationButton.prototype.onSelect=function(){toolbarToggleButton.prototype.onSelect.call(this);this.openTimeConfigurationWindow()};function animationToolbar(A,B){toolbar.call(this,A,null,B,null);this.timeSlider=new timeSlider(this);this.startButton=new startButton("startButton",this);this.previousButton=new previousButton("previousButton",this);this.playButton=new playButton("playButton",this);this.nextButton=new nextButton("nextButton",this);this.endButton=new endButton("endButton",this);this.timeConfigurationButton=new timeConfigurationButton("timeConfigurationButton",this);return this}animationToolbar.prototype=new toolbar();function HCMarkUp(C,B,A){if(!C){return }this.applet=C;this.paintColor=B;this.initialPaintColor=B;this.icons=A;this.overlays=new Array();HCMarkUp.markUpIndices[C.id]=HCMarkUp.markUps.length;HCMarkUp.markUps[HCMarkUp.markUps.length]=this;HCEvent.addListener(this.applet,"click",function(E,D){if(E&&E.url){window.open(E.url)}});HCEvent.addListener(this.applet,"mouseover",function(E,D){if(E&&E.url){setStatus(E.url)}});HCEvent.addListener(this.applet,"mouseout",function(E,D){setStatus("")});return this}HCMarkUp.prototype.setPaintColor=function(A){this.paintColor=A;this.applet.setPaintColor(A)};HCMarkUp.prototype.getPaintColor=function(){return this.paintColor};HCMarkUp.prototype.addOverlay=function(A,B,C){this.overlays[this.overlays.length]=A;if(B){A.layer=B}this.applet.addOverlay(A,B+1,C)};HCMarkUp.prototype.removeOverlay=function(A){var B=0,C=false;while(B<this.overlays.length){if(this.overlays[B]==A){C=true}else{if(C){if(B<this.overlays.length-1){this.overlays[B-1]=this.overlays[B]}else{this.overlays[B]=null}}}B++}if(C){this.applet.removeOverlay(A)}};HCMarkUp.prototype.hasOverlay=function(A){var C=false;var B=0;while((B<this.overlays.length)&&!C){if(this.overlays[B]==A){C=true}B++}return C};HCMarkUp.prototype.clearOverlays=function(){this.overlays=new Array();this.applet.clearOverlays()};HCMarkUp.prototype.getOverlay=function(A){return this.overlays[A]};HCMarkUp.prototype.parsePaintColorQueryString=function(F){var B=getQueryVariables(F,"color");if(B.length!=0){var E=B[B.length-1].split(",");if(E.length==1){this.applet.setPaintColor(namedColorToColor(E[0]))}else{var D=parseInt(E[0]);var C=parseInt(E[1]);var A=parseInt(E[2]);this.applet.setPaintColor(new RGBColor(D,C,A))}}};HCMarkUp.prototype.parseMarkerQueryString=function(B){var L=getQueryVariables(B,"marker");if(L!=undefined){for(var E=0;E<L.length;E++){var G=L[E].split(",");var J=parseFloat(G[0]);var I=parseFloat(G[1]);var H=parseFloat(G[2]);var K=new HCVector3(J,I,H);if(G[3]){var F=parseInt(G[3])}else{var F=0}if(G[4]){var A=URLToString(G[4])}var C=this.applet.getPaintColor();var D=new HCMarker(K,this.icons.getNextIcon(),C);this.addOverlay(D,F);if(A){D.url=A}}}};HCMarkUp.prototype.parseNoteQueryString=function(A){var K=getQueryVariables(A,"note");if(K!=undefined){for(var C=0;C<K.length;C++){var F=K[C].split(",");var I=parseFloat(F[0]);var H=parseFloat(F[1]);var G=parseFloat(F[2]);var J=new HCVector3(I,H,G);if(F[4]){var E=URLToString(F[3])}else{var E=""}if(F[3]){var D=parseInt(F[4])}else{var D=0}var B=new HCMarker(J,this.applet.parent.annotationToolbar.addStickyNoteButton.icon);this.addOverlay(B,D);B.note=E}}};HCMarkUp.prototype.parseLineQueryString=function(A){var K=getQueryVariables(A,"line");if(K!=undefined){for(var C=0;C<K.length;C++){var H=K[C].split(",");var F=Math.floor(H.length/3);var E=new Array(F);for(var C=0;C<E.length;C++){var J=parseFloat(H[C*3]);var I=parseFloat(H[C*3+1]);var G=parseFloat(H[C*3+2]);E[C]=new HCVector3(J,I,G)}if(H[F*3]){var D=parseInt(H[F*3])}else{var D=0}var B=this.applet.getPaintColor();this.addOverlay(new HCLine(E,B),D)}}};HCMarkUp.prototype.parseCurveQueryString=function(A){var L=getQueryVariables(A,"curve");if(L!=undefined){for(var C=0;C<L.length;C++){var H=L[C].split(",");var F=Math.floor(H.length/3);var E=new Array(F);var J=5;for(var C=0;C<E.length;C++){var K=parseFloat(H[C*3]);var I=parseFloat(H[C*3+1]);var G=parseFloat(H[C*3+2]);E[C]=new HCVector3(K,I,G)}if(H[F*3]){var D=parseInt(H[F*3])}else{var D=0}var B=this.applet.getPaintColor();this.addOverlay(new HCCurve(J,E,B),D)}}};HCMarkUp.prototype.parseTextQueryString=function(A){var J=getQueryVariables(A,"text");if(J!=undefined){for(var C=0;C<J.length;C++){var E=J[C].split(",");var K=URLToText(E[0]);var H=parseFloat(E[1]);var G=parseFloat(E[2]);var F=parseFloat(E[3]);var I=new HCVector3(H,G,F);if(E[4]){var D=parseInt(E[4])}else{var D=0}var B=this.applet.getPaintColor();this.addOverlay(new HCText(K,I,B),D,"HCMarkUp.getMarkUpById('"+this.applet.id+"').changeText")}}};HCMarkUp.prototype.parseLabelQueryString=function(B){var N=getQueryVariables(B,"label");if(N!=undefined){for(var G=0;G<N.length;G++){var I=N[G].split(",");var O=URLToText(I[0]);var C=parseFloat(I[1]);var K=parseFloat(I[2]);var F=parseFloat(I[3]);var A=parseFloat(I[4]);var J=parseFloat(I[5]);var E=parseFloat(I[6]);var M=new HCVector3(C,K,F);var L=new HCVector3(A,J,E);if(I[7]){var H=parseInt(I[7])}else{var H=0}var D=this.applet.getPaintColor();this.addOverlay(new HCLabel(O,M,L,D),H,"HCMarkUp.getMarkUpById('"+this.applet.id+"').changeText")}}};HCMarkUp.prototype.changeText=function(A,B){this.applet.getOverlay(A-1).text=B};HCMarkUp.prototype.parseOverlayQueryString=function(C){var B=C.split("=");var A=B[0];if(A=="color"){this.parsePaintColorQueryString(C)}else{if(A=="marker"){this.parseMarkerQueryString(C)}else{if(A=="note"){this.parseNoteQueryString(C)}else{if(A=="line"){this.parseLineQueryString(C)}else{if(A=="curve"){this.parseCurveQueryString(C)}else{if(A=="text"){this.parseTextQueryString(C)}else{if(A=="label"){this.parseLabelQueryString(C)}}}}}}}};HCMarkUp.prototype.parseQueryString=function(C){this.icons.toFirstIcon();var B=C.split("&");for(var A=0;A<B.length;A++){this.parseOverlayQueryString(B[A])}this.setPaintColor(this.applet.getPaintColor())};HCMarkUp.prototype.getPaintColorQueryString=function(B){var A=colorToNamedColor(B);if(A){return"color="+A}else{return"color="+B.toString()}};HCMarkUp.prototype.getMarkerQueryString=function(A){var B="marker=";B+=A.location.toPrecision(4);if(A.layer){B+=","+A.layer}else{B+=",0"}if(A.url){B+=","+stringToURL(A.url)}return B};HCMarkUp.prototype.getNoteQueryString=function(A){var B="note=";B+=A.location.toPrecision(4);B+=","+stringToURL(A.note);if(A.layer){B+=","+A.layer}else{B+=",0"}return B};HCMarkUp.prototype.getLineQueryString=function(A){var D="line=";for(var B=0;B<A.vertices.length;B++){var C=A.vertices[B];D+=C.toPrecision(3);if(B<A.vertices.length-1){D+=","}}if(A.layer){D+=","+A.layer}return D};HCMarkUp.prototype.getCurveQueryString=function(C){var D="curve=";for(var A=0;A<C.vertices.length;A++){var B=C.vertices[A];D+=B.toPrecision(3);if(A<C.vertices.length-1){D+=","}}if(C.layer){D+=","+C.layer}return D};HCMarkUp.prototype.getTextQueryString=function(A){var B="text=";if(typeof (A.text)=="string"){B+=stringToURL(A.text)}else{if(typeof (A.text)=="object"){B+=textToURL(A.text)}}B+=","+A.location.toPrecision(4);if(A.layer){B+=","+A.layer}return B};HCMarkUp.prototype.getLabelQueryString=function(A){var B="label=";if(typeof (A.text)=="string"){B+=stringToURL(A.text)}else{if(typeof (A.text)=="object"){B+=textToURL(A.text)}}B+=","+A.anchorPoint.toPrecision(4);B+=","+A.location.toPrecision(4);if(A.layer){B+=","+A.layer}return B};HCMarkUp.prototype.getOverlayQueryString=function(A){if(A.__proto__==HCMarker.prototype&&(A.note!=undefined)){return this.getNoteQueryString(A)}else{if(A.__proto__==HCMarker.prototype){return this.getMarkerQueryString(A)}else{if(A.__proto__==HCLine.prototype){return this.getLineQueryString(A)}else{if(A.__proto__==HCCurve.prototype){return this.getCurveQueryString(A)}else{if(A.__proto__==HCText.prototype){return this.getTextQueryString(A)}else{if(A.__proto__==HCLabel.prototype){return this.getLabelQueryString(A)}else{return null}}}}}}};HCMarkUp.prototype.getQueryString=function(){var D=null;var A=this.initialPaintColor;if(this.overlays.length>0){for(var C=0;C<this.overlays.length;C++){var B=this.getOverlay(C);if(B&&B.visible){if(B.color){if(!B.color.matches(A)){D=addQueryString(D,this.getPaintColorQueryString(B.color));A=B.color}}D=addQueryString(D,this.getOverlayQueryString(B))}}}if(!this.paintColor.matches(A)){D=addQueryString(D,this.getPaintColorQueryString(this.paintColor))}return D};HCMarkUp.getMarkUpById=function(A){return this.getMarkUpByIndex(HCMarkUp.markUpIndices[A])};HCMarkUp.getMarkUpByIndex=function(A){return HCMarkUp.markUps[A]};HCMarkUp.markUps=new Array();HCMarkUp.markUpIndices=new Array();function HCAlphabetIcons(A,B){if(!A){A="marker"}if(!B){B=".png"}this.prefix=A;this.suffix=B;this.nextIcon=null;this.nextIconIndex=0;return this}HCAlphabetIcons.prototype.getNextAlphabeticalIcon=function(){var C=byteToChar(charToByte("A")+this.nextIconIndex%26);var A=this.prefix+C+this.suffix;var B=new HCIcon(A,"center","middle",new HCVector2(-10,-10));return B};HCAlphabetIcons.prototype.toFirstIcon=function(){this.nextIconIndex=0;this.nextIcon=this.getNextAlphabeticalIcon()};HCAlphabetIcons.prototype.getNextIcon=function(){var A=this.nextIcon;this.nextIconIndex++;this.nextIcon=this.getNextAlphabeticalIcon();return A};function HC3dsMaxCamera(A,D,C,B){if(B==undefined){B=false}this.eye=A;this.lookAt=D;this.fov=C;this.orthographic=B;return this}HC3dsMaxCamera.prototype.getView=function(){if(this.orthographic){return"user"}else{return"perspective"}};HC3dsMaxCamera.prototype.equals=function(A){if((this.eye&&!A.eye)||(!this.eye&&A.eye)){return false}else{if((this.lookAt&&!A.lookAt)||(!this.lookAt&&A.lookAt)){return false}else{return((this.eye.equals(A.eye))&&(this.lookAt.equals(A.lookAt))&&(this.fov==A.fov)&&(this.orthographic==A.orthographic))}}};HC3dsMaxCamera.prototype.duplicate=function(){return new HC3dsMaxCamera(this.eye,this.lookAt,this.fov,this.orthographic)};HC3dsMaxCamera.prototype.parseQueryString=function(A){var E=getQueryVariable(A,"eye");if(E!=undefined){var F=E.split(",");var I=parseFloat(F[0]);var H=parseFloat(F[1]);var G=parseFloat(F[2]);this.eye=new HCVector3(I,H,G)}var B=getQueryVariable(A,"lookat");if(B!=undefined){var F=B.split(",");var I=parseFloat(F[0]);var H=parseFloat(F[1]);var G=parseFloat(F[2]);this.lookAt=new HCVector3(I,H,G)}var D=getQueryVariable(A,"fov");if(D!=undefined){this.fov=parseFloat(D)}var C=getQueryVariable(A,"orthographic");if(C!=undefined){this.orthographic=(C=="true")}};HC3dsMaxCamera.prototype.getQueryString=function(){var A=null;if(this.eye){A=addQueryString(A,"eye="+this.eye.toPrecision(4))}if(this.lookAt){A=addQueryString(A,"lookat="+this.lookAt.toPrecision(4))}if(this.fov){A=addQueryString(A,"fov="+this.fov.toFixed(0))}if(this.orthographic!=undefined){A=addQueryString(A,"orthographic="+this.orthographic)}return A};function HCApplet(C,B,E,A,D){if(!C){return this}if(A==undefined){A=""}if(D==undefined){D=null}component.call(this,C,D);this.appletSrc=B;this.resources=E;this.commandLine=A;this.plugIn=null;this.index=HCApplet.applets.length;this.id="HCApplet"+this.index;this.commandLine="-id "+this.id+"; "+A;HCApplet.appletIndices[this.id]=HCApplet.applets.length;HCApplet.applets[HCApplet.applets.length]=this;HCApplet.setCurrentApplet(this);this.activate();return this}HCApplet.prototype=new component();HCApplet.prototype.activate=function(){function A(E){var C="";if(E){for(var D=0;D<E.length;D++){C+="'"+E[D]+"'";if(D<E.length){C+="; "}}}return C}if(navigator.appName=="Microsoft Internet Explorer"){var B=new Array();B.id=this.id;B.classid="clsid:34B8892A-9303-4893-9E12-1CEE6C3BF95D";B.AppletSrc=this.appletSrc;B.CommandLine=this.commandLine;B.Resources=A(this.resources);this.plugIn=createIEControl(this.element,B)}else{var B=new Array();B.name=this.id;B.type="application/x-hypercosm";B.width=this.element.style.width;B.height=this.element.style.height;B.appletsrc=this.appletSrc;B.commandline=this.commandLine;B.resources=A(this.resources);B.browser=navigator.userAgent;this.plugIn=createMozillaControl(this.element,B)}};HCApplet.prototype.onActivate=function(){if(this.onload){this.onload()}};HCApplet.prototype.isActivated=function(){return(this.plugIn!=null)};HCApplet.prototype.call=function(script){if(script){eval(script)}};HCApplet.getAppletById=function(A){return this.getAppletByIndex(HCApplet.appletIndices[A])};HCApplet.getAppletByIndex=function(A){return HCApplet.applets[A]};HCApplet.setCurrentApplet=function(A){HCApplet.currentApplet=A};HCApplet.getCurrentApplet=function(){return HCApplet.currentApplet};HCApplet.applets=new Array();HCApplet.appletIndices=new Array();function HCScriptableApplet(C,B,E,A,D){if(!C){return this}HCApplet.call(this,C,B,E,A,D);this.messages="";this.buffering=false;this.nestingLevel=0;this.enabled=true;this.verbose=false;this.debug=false;return this}HCScriptableApplet.prototype=new HCApplet();HCScriptableApplet.prototype.setEnabled=function(A){this.enabled=A};HCScriptableApplet.prototype.sendMessage=function(A){if(this.verbose){setStatus(A)}if(this.buffering){if(this.messageBuffer!=""){this.messageBuffer=this.messageBuffer+";"}this.messageBuffer=this.messageBuffer+A}else{if(this.debug){alert("sending message: "+A)}if(this.enabled&&this.isActivated()){this.plugIn.SendMessage(A)}}};HCScriptableApplet.prototype.beginMessages=function(){if(this.buffering){this.nestingLevel++}else{this.buffering=true;this.messageBuffer="";this.nestingLevel=0}};HCScriptableApplet.prototype.endMessages=function(){if(this.nestingLevel==0){if(this.messageBuffer!=""){if(this.debug){alert("sending message: "+this.messageBuffer)}if(this.enabled){this.plugIn.SendMessage(this.messageBuffer)}}this.buffering=false;this.messageBuffer=""}else{this.nestingLevel--}};function HCMarkUpApplet(C,B,E,A,D){if(!C){return this}HCScriptableApplet.call(this,C,B,E,A,D);this.paintColor=new RGBColor(0,0,0);return this}HCMarkUpApplet.prototype=new HCScriptableApplet();HCMarkUpApplet.prototype.onActivate=function(){HCOverlay.reset();if(isDefined("HCEvent")){HCEvent.reset()}this.icons=new Array();this.materials=new Array();this.overlays=new Array();HCScriptableApplet.prototype.onActivate.call(this)};HCMarkUpApplet.prototype.addMarker=function(A,B){var D="-add_marker";D+=" "+A.location.x+" "+A.location.y+" "+A.location.z;if(A.icon){var C=A.icon}else{if(!HCMarkUpApplet.defaultMarkerIcon){HCMarkUpApplet.defaultMarkerIcon=new HCIcon("marker.png","center","bottom")}var C=HCMarkUpApplet.defaultMarkerIcon}if(!C.loaded){this.loadIcon(C)}D+=" "+(C.index+1);if(B){D+=" "+B}this.sendMessage(D);A.visible=true};HCMarkUpApplet.prototype.addLine=function(A,C){var D="-add_line";for(var B=0;B<A.vertices.length;B++){D+=" "+A.vertices[B].x+" "+A.vertices[B].y+" "+A.vertices[B].z}if(C){D+=" "+C}this.sendMessage(D);A.visible=true};HCMarkUpApplet.prototype.addCurve=function(A,C){var D="-add_curve";D+=" "+A.steps;for(var B=0;B<A.vertices.length;B++){D+=" "+A.vertices[B].x+" "+A.vertices[B].y+" "+A.vertices[B].z}if(C){D+=" "+C}this.sendMessage(D);A.visible=true};HCMarkUpApplet.prototype.addPolygon=function(B,D){var E="-add_polygon";for(var C=0;C<B.vertices.length;C++){E+=" "+B.vertices[C].x+" "+B.vertices[C].y+" "+B.vertices[C].z}if(B.texcoords){E+=" texcoords";for(var C=0;C<B.vertices.length;C++){E+=" "+B.texcoords[C].x+" "+B.texcoords[C].y}}if(B.material){if(!B.material.loaded){this.loadMaterial(B.material)}var A=B.material.index+1}else{var A=0}E+=" "+A;if(D){E+=" "+D}this.sendMessage(E);B.visible=true};HCMarkUpApplet.prototype.addText=function(A,C,E){var D="-add_text";if(typeof (A.text)=="string"){D+=" "+getQuotatedString(A.text)}else{if(typeof (A.text)=="object"){for(var B=0;B<A.text.length;B++){D+=" "+getQuotatedString(A.text[B])}}}D+=" "+A.location.x+" "+A.location.y+" "+A.location.z;D+=" "+A.hAlignment+" "+A.vAlignment;if(C){D+=" "+C}else{if(E){D+=" "+0}}if(E){D+=" "+E}this.sendMessage(D);A.visible=true};HCMarkUpApplet.prototype.addLabel=function(A,C,E){var D="-add_label";if(typeof (A.text)=="string"){D+=" "+getQuotatedString(A.text)}else{if(typeof (A.text)=="object"){for(var B=0;B<A.text.length;B++){D+=" "+getQuotatedString(A.text[B])}}}D+=" "+A.anchorPoint.x+" "+A.anchorPoint.y+" "+A.anchorPoint.z;D+=" "+A.location.x+" "+A.location.y+" "+A.location.z;if(C){D+=" "+C}if(E){D+=" "+E}this.sendMessage(D);A.visible=true};HCMarkUpApplet.prototype.addOverlay=function(B,C,D){if(!this.isActivated()){return }var A=null;if(B.color){A=this.paintColor;this.setPaintColor(B.color)}this.overlays[B.index]=B;if(B.__proto__==HCMarker.prototype){this.addMarker(B,C)}else{if(B.__proto__==HCLine.prototype){this.addLine(B,C)}else{if(B.__proto__==HCCurve.prototype){this.addCurve(B,C)}else{if(B.__proto__==HCPolygon.prototype){this.addPolygon(B,C)}else{if(B.__proto__==HCText.prototype){this.addText(B,C,D)}else{if(B.__proto__==HCLabel.prototype){this.addLabel(B,C,D)}}}}}}if(B.color){this.setPaintColor(A)}};HCMarkUpApplet.prototype.addOverlays=function(C,B){if(!this.isActivated()){return }for(var A=0;A<C.length;A++){this.addOverlay(C[A],B)}};HCMarkUpApplet.prototype.removeOverlay=function(A){if(!this.isActivated()){return }this.overlays[A.index]=null;this.sendMessage("-remove_overlay "+(A.index+1));A.visible=false};HCMarkUpApplet.prototype.removeOverlays=function(B){if(!this.isActivated()){return }for(var A=0;A<B.length;A++){this.removeOverlay(B[A])}};HCMarkUpApplet.prototype.clearOverlays=function(){if(!this.isActivated()){return }this.overlays=new Array();this.sendMessage("-clear_overlays")};HCMarkUpApplet.prototype.getOverlay=function(A){return this.overlays[A]};HCMarkUpApplet.prototype.selectOverlay=function(A){if(!this.isActivated()){return }this.sendMessage("-select_overlay "+(A.index+1))};HCMarkUpApplet.prototype.deselectOverlay=function(A){if(!this.isActivated()){return }this.sendMessage("-deselect_overlay "+(A.index+1))};HCMarkUpApplet.prototype.setCursor=function(B){if(!this.isActivated()){return }var A=0;if(B){if(!B.loaded){this.loadIcon(B)}A=B.index+1}this.sendMessage("-set_cursor "+A)};HCMarkUpApplet.prototype.setPaintColor=function(A){if(!this.isActivated()){return }this.paintColor=new RGBColor(A.red,A.green,A.blue);this.sendMessage("-color "+Math.floor(A.red)+" "+Math.floor(A.green)+" "+Math.floor(A.blue))};HCMarkUpApplet.prototype.getPaintColor=function(){return new RGBColor(this.paintColor.red,this.paintColor.green,this.paintColor.blue)};HCMarkUpApplet.prototype.setOverlayColor=function(B,A){if(!this.isActivated()){return }this.sendMessage("-set_overlay_color "+(B.index+1)+" "+Math.floor(A.red)+" "+Math.floor(A.green)+" "+Math.floor(A.blue))};HCMarkUpApplet.prototype.setMaterial=function(A){if(!this.isActivated()){return }this.material=A;this.sendMessage("-material "+(A.index+1))};HCMarkUpApplet.prototype.getMaterial=function(){return this.material};HCMarkUpApplet.prototype.setOverlayMaterial=function(A,B){if(!this.isActivated()){return }this.sendMessage("-set_overlay_material "+(A.index+1)+" "+(B.index+1))};HCMarkUpApplet.prototype.setEventHandler=function(A){if(!this.isActivated()){return }this.sendMessage("-events "+A)};HCMarkUpApplet.prototype.loadIcon=function(B){if(B.loaded){return }B.index=this.icons.length;this.icons[B.index]=B;var A,C;if(B.iconAnchor!=null){A=B.iconAnchor.x;C=B.iconAnchor.y}else{A=0;C=0}this.sendMessage("-add_icon '"+B.imageName+"' "+B.hAlignment+" "+B.vAlignment+" "+A+" "+C);B.loaded=true};HCMarkUpApplet.prototype.loadMaterial=function(A){A.index=this.materials.length;this.materials[A.index]=A;var B="-add_material "+A.color.red+" "+A.color.green+" "+A.color.blue;if(A.textureName){B+=" "+A.textureName}this.sendMessage(B);A.loaded=true};function HC3dsMaxApplet(C,B,E,A,D){if(!C){return this}if(!A){A=""}if(A!=""){A+="; "}A+="-get "+arrayToString(HC3dsMaxApplet.attributes," ");HCMarkUpApplet.call(this,C,B,E,A,D);this.camera=new HC3dsMaxCamera();this.cameraNames=new Array();this.mouseMode=new Array();this.mouseListeners=new Array();this.connection="free";this.collaboration="disconnected";this.callbackArray=new Array();this.activated=false;return this}HC3dsMaxApplet.prototype=new HCMarkUpApplet();HC3dsMaxApplet.prototype.onActivate=function(){this.activated=true;HCMarkUpApplet.prototype.onActivate.call(this)};HC3dsMaxApplet.prototype.isActivated=function(){return this.activated};HC3dsMaxApplet.prototype.onUnload=function(){if(this.timeout!=undefined){window.clearTimeout(self.timeout)}};HC3dsMaxApplet.prototype.setCamera=function(B,C){if(typeof (B)=="number"){if(typeof (C)=="number"){this.sendMessage("-camera "+B+" "+C);var A=this;window.updateCamera=function(){A.timeout=undefined;A.getAttributes(["eye","lookat","fov","orthographic"])};this.timeout=window.setTimeout("window.updateCamera()",C*1000)}else{this.sendMessage("-camera "+B);this.getAttributes(["eye","lookat","fov","orthographic"])}return }if(B.eye){this.camera.eye=B.eye;this.view=undefined;this.sendMessage("-eye "+B.eye.x+" "+B.eye.y+" "+B.eye.z)}if(B.lookAt){this.camera.lookAt=B.lookAt;this.view=undefined;this.sendMessage("-lookat "+B.lookAt.x+" "+B.lookAt.y+" "+B.lookAt.z)}if(B.fov){this.camera.fov=B.fov;this.view=undefined;this.sendMessage("-fov "+B.fov)}if(B.orthographic!=undefined){this.camera.orthographic=B.orthographic;this.setAttribute("view",this.camera.getView());this.sendMessage("-view "+this.view);this.getAttributes(["eye","lookat","fov","orthographic"])}};HC3dsMaxApplet.prototype.setView=function(A){if(inArray(A,HC3dsMaxApplet.views)){this.sendMessage("-view "+A)}if(A!="auto"){this.setAttribute("view",A)}this.getAttributes(["eye","lookat","fov","orthographic"])};HC3dsMaxApplet.prototype.setCameraFromView=function(A){this.sendMessage("-set_camera_from_view "+A)};HC3dsMaxApplet.prototype.setRenderingLevel=function(A){if(A==this.renderingLevel||!inArray(A,HC3dsMaxApplet.renderingLevels)){return }this.renderingLevel=A;this.sendMessage("-rendering_level "+A)};HC3dsMaxApplet.prototype.setEdgedFaces=function(A){if(A==this.edgedFaces){return }this.edgedFaces=A;this.sendMessage("-edged_faces "+A)};HC3dsMaxApplet.prototype.setTransparency=function(A){if(A==this.transparency||!inArray(A,HC3dsMaxApplet.transparency)){return }this.transparency=A;this.sendMessage("-transparency "+A)};HC3dsMaxApplet.prototype.setDisableTextures=function(A){if(A==this.disableTextures){return }this.disableTextures=A;this.sendMessage("-disable_textures "+A)};HC3dsMaxApplet.prototype.setShowGrid=function(A){if(A==this.showGrid){return }this.showGrid=A;this.sendMessage("-show_grid "+A)};HC3dsMaxApplet.prototype.setShowBackground=function(A){if(A==this.showBackground){return }this.showBackground=A;this.sendMessage("-show_background "+A)};HC3dsMaxApplet.prototype.setBackground=function(A){if(A==this.background){return }this.background=A;this.sendMessage("-background "+A)};HC3dsMaxApplet.prototype.setUseEnvironmentBackground=function(A){if(A==this.useEnvironmentBackground){return }this.useEnvironmentBackground=A;this.sendMessage("-use_environment_background "+A)};HC3dsMaxApplet.prototype.setBackgroundColor=function(A){if(A==this.backgroundColor){return }this.backgroundColor=A;this.sendMessage("-background_color "+A.red+" "+A.green+" "+A.blue)};HC3dsMaxApplet.prototype.setEnvironmentBackground=function(A){if(A==this.environmentBackground){return }this.environmentBackground=A;this.sendMessage("-environment_background "+A)};HC3dsMaxApplet.prototype.setEnvironmentUseMap=function(A){if(A==this.environmentUseMap){return }this.environmentUseMap=A;this.sendMessage("-environment_use_map "+A)};HC3dsMaxApplet.prototype.setLevelOfDetail=function(A){if(A==this.levelOfDetail){return }this.levelOfDetail=A;this.sendMessage("-lod "+A.toFixed(3))};HC3dsMaxApplet.prototype.setTessellation=function(A){if(A==this.tessellation){return }this.tessellation=A;this.sendMessage("-tessellation "+A.toFixed(3))};HC3dsMaxApplet.prototype.setFacets=function(A){if(A==this.facets){return }this.facets=A;setStatus("-facets "+A);this.sendMessage("-facets "+A)};HC3dsMaxApplet.prototype.setDisplayWorldAxis=function(A){if(A==this.displayWorldAxis){return }this.displayWorldAxis=A;this.sendMessage("-display_world_axis "+A)};HC3dsMaxApplet.prototype.setDisplayGeometry=function(A){if(A==this.displayGeometry){return }this.displayGeometry=A;this.sendMessage("-display_geometry "+A)};HC3dsMaxApplet.prototype.setDisplayCameras=function(A){if(A==this.displayCameras){return }this.displayCameras=A;this.sendMessage("-display_cameras "+A)};HC3dsMaxApplet.prototype.setCurrentTime=function(A){if(A==this.currentTime){return }this.currentTime=A;this.sendMessage("-current_time "+A)};HC3dsMaxApplet.prototype.setShadows=function(A){if(A==this.shadows){return }this.shadows=A;this.sendMessage("-shadows "+A)};HC3dsMaxApplet.prototype.setLightCoords=function(A){if(A==this.lightCoords){return }this.lightCoords=A;if(A=="world"){this.sendMessage("-light_coords world")}else{if(A=="camera"){this.sendMessage("-light_coords camera")}}};HC3dsMaxApplet.prototype.setLightDirection=function(A){if(A.equals(this.lightDirection)){return }this.lightDirection=A;this.sendMessage("-light_direction "+A.x.toFixed(3)+" "+A.y.toFixed(3)+" "+A.z.toFixed(3))};HC3dsMaxApplet.prototype.setLightTint=function(A){this.lightTint=A;this.sendMessage("-light_tint "+A.red.toFixed(3)+" "+A.green.toFixed(3)+" "+A.blue.toFixed(3))};HC3dsMaxApplet.prototype.setLightLevel=function(A){if(A==this.lightLevel){return }this.lightLevel=A;this.sendMessage("-light_level "+A.toFixed(3))};HC3dsMaxApplet.prototype.setAmbient=function(A){if(A.matches(this.ambient)){return }this.ambient=A;this.sendMessage("-ambient "+A.red.toFixed(3)+" "+A.green.toFixed(3)+" "+A.blue.toFixed(3))};HC3dsMaxApplet.prototype.setMouseMode=function(C,F,D,E){this.mouseMode[C]=F;if(D){this.loadIcon(D)}if(D!=null){var B=D.index+1}else{var B=0}HCEvent.removeListener(this.mouseListeners[C]);this.mouseListeners[C]=null;if(inArray(F,HC3dsMaxApplet.mouseModes)){if(!E){this.sendMessage("-mouse_mode "+C+" "+F+" "+B)}else{this.sendMessage("-mouse_mode "+C+" "+F+" "+B+" "+E)}}if(C=="left"){this.setCursor(D)}var A=this;if(inArray(F,["rotate","pan","zoom","walk"])){this.mouseListeners[C]=HCEvent.addListener(this,"mouseup",function(){A.setAttribute("view",A.camera.getView());A.getAttributes(["eye","lookat"])},C)}else{if(F=="zoom_fov"){this.mouseListeners[C]=HCEvent.addListener(this,"mouseup",function(){A.setAttribute("view",A.camera.getView());A.getAttribute("fov")},C)}else{if(F=="look_around"){this.mouseListeners[C]=HCEvent.addListener(this,"mouseup",function(){A.setAttribute("view",A.camera.getView());A.getAttribute("lookat")},C)}else{if(F=="zoom_perspective"){this.mouseListeners[C]=HCEvent.addListener(this,"mouseup",function(){A.setAttribute("view",A.camera.getView());A.getAttributes(["eye","lookat","fov"])},C)}}}}};HC3dsMaxApplet.prototype.connect=function(C,A){var B="-connect";if(C!=undefined){B+=" "+C}if(A!=undefined){B+=" "+A}this.sendMessage(B)};HC3dsMaxApplet.prototype.setCollaborationMode=function(A){if(A=="lead"){this.sendMessage("-collaboration lead")}else{if(A=="follow"){this.sendMessage("-collaboration follow")}else{if(A=="free"){this.sendMessage("-collaboration free")}}}};HC3dsMaxApplet.prototype.disconnect=function(A){this.sendMessage("-disconnect")};HC3dsMaxApplet.prototype.setAttribute=function(A,B){if(A=="eye"){this.camera.eye=B}else{if(A=="lookat"){this.camera.lookAt=B}else{if(A=="fov"){this.camera.fov=B}else{if(A=="orthographic"){this.camera.orthographic=B}else{if(A=="view"){this.view=B}else{if(A=="cameras"){this.cameraNames=B}else{if(A=="display_geometry"){this.displayGeometry=B}else{if(A=="display_cameras"){this.displayCameras=B}else{if(A=="show_grid"){this.showGrid=B}else{if(A=="show_background"){this.showBackground=B}else{if(A=="disable_textures"){this.disableTextures=B}else{if(A=="display_world_axis"){this.displayWorldAxis=B}else{if(A=="time_display"){this.timeDisplay=B}else{if(A=="fps"){this.fps=B}else{if(A=="looping"){this.looping=B}else{if(A=="playback_speed"){this.playbackSpeed=B}else{if(A=="playback_direction"){this.playbackDirection=B}else{if(A=="start_time"){this.startTime=B}else{if(A=="end_time"){this.endTime=B}else{if(A=="current_time"){this.currentTime=B}else{if(A=="ip_address"){this.IPAddress=B}else{if(A=="connection"){this.connection=B}else{if(A=="collaboration"){this.collaboration=B}}}}}}}}}}}}}}}}}}}}}}}if(this.callbackArray[A]!=undefined){this.callbackArray[A](B)}};HC3dsMaxApplet.prototype.setCallback=function(A,B){this.callbackArray[A]=B};HC3dsMaxApplet.prototype.getAttribute=function(A){this.sendMessage("-get "+A)};HC3dsMaxApplet.prototype.getAttributes=function(C){var B="";for(var A=0;A<C.length;A++){if(A!=0){B+=" "}B+=C[A]}this.sendMessage("-get "+B)};HC3dsMaxApplet.mouseModes=["rotate","pan","zoom","roll","zoom_fov","zoom_perspective","zoom_region","zoom_region_fov","walk","slide","elevate","look_around","tape_measure","draw_line","freehand","place_text","none"];HC3dsMaxApplet.views=["perspective","user","front","back","top","bottom","left","right","auto"];HC3dsMaxApplet.renderingLevels=["smooth_plus_highlights","smooth","facets_plus_highlights","facets","flat","lit_wireframes","wireframe","bounding_box"];HC3dsMaxApplet.transparency=["simple","best","none"];HC3dsMaxApplet.cameraAttributes=["eye","lookat","fov","orthographic","view","cameras"];HC3dsMaxApplet.viewportAttributes=["display_geometry","display_cameras","show_grid","show_background","disable_textures","display_world_axis"];HC3dsMaxApplet.animationAttributes=["time_display","fps","looping","playback_speed","playback_direction","start_time","end_time","current_time"];HC3dsMaxApplet.attributes=HC3dsMaxApplet.cameraAttributes.concat(HC3dsMaxApplet.viewportAttributes.concat(HC3dsMaxApplet.animationAttributes));var HCEvent=function(){this.enabled=false;this.listeners=new Array();this.numListeners=new Array();this.listenerCount=0;this.listeners.mousedown=new Array();this.numListeners.mousedown=0;this.listeners.mouseup=new Array();this.numListeners.mouseup=0;this.listeners.mouseover=new Array();this.numListeners.mouseover=0;this.listeners.mouseout=new Array();this.numListeners.mouseout=0;this.listeners.keydown=new Array();this.numListeners.keydown=0;this.listeners.keyup=new Array();this.numListeners.keyup=0;return this}();HCEvent.handleEvent=function(B,E,G,I){var F=HCEvent.numListeners[B];var H=HCEvent.listeners[B];var C=false;if(G!=0){C=HCOverlay.overlays[G-1]}for(var D=0;D<F;D++){var A=H[D];if(A.button){if(E==A.button){A.handler(C,I,E)}}else{A.handler(C,I,E)}}};function HCListener(B,D,C,A){this.applet=B;this.kind=D;this.handler=C;this.button=A;return this}HCEvent.addListener=function(B,D,C,A){var E=new HCListener(B,D,C,A);this.listenerCount++;if(!this.enabled){B.setEventHandler("HCEvent.handleEvent");this.enabled=true}if(D=="click"){D="mouseup"}if(D=="keypress"){D="keydown"}HCEvent.listeners[D][HCEvent.numListeners[D]]=E;HCEvent.numListeners[D]=HCEvent.numListeners[D]+1;return E};HCEvent.removeListener=function(E){if(!E){return }var A=HCEvent.numListeners[E.kind];var C=HCEvent.listeners[E.kind];var B=0;var D=false;this.listenerCount--;if(listenerCount==0){E.applet.setEventHandler("");this.enabled=false}while(B<A){if(D){C[B-1]=C[B]}else{if(C[B]==E){D=true}}B++}if(D){HCEvent.numListeners[E.kind]=HCEvent.numListeners[E.kind]-1}};HCEvent.reset=function(){this.enabled=false;this.listeners=new Array();this.numListeners=new Array();this.listenerCount=0;this.listeners.mousedown=new Array();this.numListeners.mousedown=0;this.listeners.mouseup=new Array();this.numListeners.mouseup=0;this.listeners.mouseover=new Array();this.numListeners.mouseover=0;this.listeners.mouseout=new Array();this.numListeners.mouseout=0;this.listeners.keydown=new Array();this.numListeners.keydown=0;this.listeners.keyup=new Array();this.numListeners.keyup=0};function HC3dsMaxInterface(D,C,B,E){if(!D){return this}container.call(this,D);if(B==undefined){B=""}if(E==undefined){E=""}if(E&&(E[E.length-1]!="/")){E+="/"}if(B==""){B="-wait_for_messages"}else{B="-wait_for_messages; "+B}this.element=D;this.appletSrc=C;this.commandLine=B;this.path=E;this.windowBaseLocation=getBaseLocation(getWindowLocation());HC3dsMaxInterface.interfaceIndices[D]=HC3dsMaxInterface.interfaces.length;HC3dsMaxInterface.interfaces[HC3dsMaxInterface.interfaces.length]=this;var A=this;addEvent(window,"load",function(){A.applet=new HC3dsMaxApplet("applet",A.appletSrc,A.getResources(A.path+"applet/resources"),appletInterface.commandLine,A);A.applet.onload=function(){A.applet.beginMessages();A.onLoad();A.applet.endMessages()}});addEvent(window,"unload",function(){A.onUnload()});if(isIe){window.addEvent(window,"resize",function(){A.call("onResize")})}else{this.interval=window.setInterval(function(){var G=getWindowWidth();var F=getWindowHeight();if(G!=A.width||F!=A.height){A.call("onResize")}A.width=G;A.height=F},100)}return this}HC3dsMaxInterface.prototype=new container();HC3dsMaxInterface.prototype.onLoad=function(){if(this.loaded){return }this.componentGroup.call("onLoad");this.initialCamera=this.applet.camera.duplicate();this.onStart();if(this.onload){this.onload()}this.loaded=true};HC3dsMaxInterface.prototype.onStart=function(){this.componentGroup.call("onStart");var B=getQueryString();if(B){var A=getQueryVariable(B,"applet");if((A==undefined)||(parseInt(A)==this.applet.index)){this.parseQueryString(getQueryString())}}this.started=true};HC3dsMaxInterface.prototype.onUnload=function(){if(this.interval!=undefined){window.clearInterval(this.interval)}this.componentGroup.call("onUnload")};HC3dsMaxInterface.prototype.getResources=function(A){return["transparent0.png, "+A+"/transparency/transparent0.png","transparent10.png, "+A+"/transparency/transparent10.png","transparent20.png, "+A+"/transparency/transparent20.png","transparent30.png, "+A+"/transparency/transparent30.png","transparent40.png, "+A+"/transparency/transparent40.png","transparent50.png, "+A+"/transparency/transparent50.png","transparent60.png, "+A+"/transparency/transparent60.png","transparent70.png, "+A+"/transparency/transparent70.png","transparent80.png, "+A+"/transparency/transparent80.png","transparent90.png, "+A+"/transparency/transparent90.png","transparent100.png, "+A+"/transparency/transparent100.png"]};HC3dsMaxInterface.prototype.parseQueryString=function(C){if(!C){return }for(var A=0;A<this.componentGroup.components.length;A++){if(this.componentGroup.components[A].parseQueryString){this.componentGroup.components[A].parseQueryString(C)}}var B=new HC3dsMaxCamera();B.parseQueryString(C);this.applet.setCamera(B)};HC3dsMaxInterface.prototype.getQueryString=function(){var B=null;if(HCApplet.appletCount>1){B=addQueryString(B,"applet="+this.applet.index)}for(var A=0;A<this.componentGroup.components.length;A++){if(this.componentGroup.components[A].getQueryString){B=addQueryString(B,this.componentGroup.getComponent(A).getQueryString())}}if(this.applet.view=="user"||this.applet.view=="perspective"){if(!this.applet.camera.equals(this.initialCamera)){B=addQueryString(B,this.applet.camera.getQueryString())}}return B};HC3dsMaxInterface.prototype.setQueryString=function(A){if(A){setWindowLocation(this.windowBaseLocation+"?"+A)}else{setWindowLocation(this.windowBaseLocation)}};HC3dsMaxInterface.getInterfaceById=function(A){return this.getInterfaceByIndex(HC3dsMaxInterface.interfaceIndices[A])};HC3dsMaxInterface.getInterfaceByIndex=function(A){return HC3dsMaxInterface.interfaces[A]};HC3dsMaxInterface.interfaces=new Array();HC3dsMaxInterface.interfaceIndices=new Array();function HC3dsMaxStandardInterface(C,B,A,D){if(!C){return this}HC3dsMaxInterface.call(this,C,B,A,D);return this}HC3dsMaxStandardInterface.prototype=new HC3dsMaxInterface();HC3dsMaxStandardInterface.prototype.onLoad=function(){var A=new radioButtonGroup();this.standardToolbar=new standardToolbar("standardToolbar",A,this);this.toolsToolbar=new toolsToolbar("toolsToolbar",this);this.renderingToolbar=new renderingToolbar("renderingToolbar",this);this.viewsToolbar=new viewsToolbar("viewsToolbar",this);this.helpersToolbar=new helpersToolbar("helpersToolbar",A,this);this.internetToolbar=new internetToolbar("internetToolbar",this);this.principalToolbar=new principalToolbar("principalToolbar",A,this);this.markUpToolbar=new markUpToolbar("markUpToolbar",A,this);this.annotationToolbar=new annotationToolbar("annotationToolbar",A,this);this.collaborationToolbar=new collaborationToolbar("collaborationToolbar",this);this.animationToolbar=new animationToolbar("animationToolbar",this);this.navigationToolbar=new navigationToolbar("navigationToolbar",A,this);this.toolsToolbar.addToolbar(this.standardToolbar,"Standard");this.toolsToolbar.addToolbar(this.renderingToolbar,"Rendering");this.toolsToolbar.addToolbar(this.viewsToolbar,"Views");this.toolsToolbar.addToolbar(this.helpersToolbar,"Helpers");this.toolsToolbar.addToolbar(this.internetToolbar,"Internet");this.toolsToolbar.addToolbar(this.principalToolbar,"Principal");this.toolsToolbar.addToolbar(this.markUpToolbar,"MarkUp");this.toolsToolbar.addToolbar(this.annotationToolbar,"Annotation");this.toolsToolbar.addToolbar(this.collaborationToolbar,"Collaboration");this.toolsToolbar.addToolbar(this.animationToolbar,"Animation");this.toolsToolbar.addToolbar(this.navigationToolbar,"Navigation");this.markUp=new HCMarkUp(this.applet,new RGBColor(255,255,0),new HCAlphabetIcons());HC3dsMaxInterface.prototype.onLoad.call(this)};HC3dsMaxStandardInterface.prototype.onStart=function(){var B=17;var C=18;var A=this;this.controlKeyDown=false;this.altKeyDown=false;HCEvent.addListener(this.applet,"keydown",function(){A.controlKeyDown=true;A.update()},B);HCEvent.addListener(this.applet,"keyup",function(){A.controlKeyDown=false;A.update()},B);HCEvent.addListener(this.applet,"keydown",function(){A.altKeyDown=true;A.update()},C);HCEvent.addListener(this.applet,"keyup",function(){A.altKeyDown=false;A.update()},C);this.applet.setMouseMode("left","none");this.applet.setMouseMode("middle","pan",this.navigationToolbar.viewToolbar.panButton.cursor);this.applet.setMouseMode("right","none");if(this.navigationToolbar.viewToolbar.visible){this.navigationToolbar.viewToolbar.rotateButton.setSelected(true)}else{this.navigationToolbar.cameraToolbar.orbitButton.setSelected(true)}if(typeof (this.applet.view)=="number"&&this.applet.view!=0){this.setView(this.applet.cameraNames[this.applet.view-1])}else{this.setView()}HC3dsMaxInterface.prototype.onStart.call(this)};HC3dsMaxStandardInterface.prototype.getCursorResources=function(A){return["zoom_cursor.png, "+A+"/cursors/zoom_cursor.png","walk_cursor.png, "+A+"/cursors/walk_cursor.png","fov_cursor.png, "+A+"/cursors/fov_cursor.png","pan_cursor.png, "+A+"/cursors/pan_cursor.png","rotate_cursor.png, "+A+"/cursors/rotate_cursor.png","orbit_cursor.png, "+A+"/cursors/orbit_cursor.png","truck_cursor.png, "+A+"/cursors/truck_cursor.png","dolly_cursor.png, "+A+"/cursors/dolly_cursor.png","perspective_cursor.png, "+A+"/cursors/perspective_cursor.png","roll_camera_cursor.png, "+A+"/cursors/roll_camera_cursor.png","zoom_region_cursor.png, "+A+"/cursors/zoom_region_cursor.png","tape_measure_cursor.png, "+A+"/cursors/tape_measure_cursor.png","paint_cursor.png, "+A+"/cursors/paint_cursor.png","eraser_cursor.png, "+A+"/cursors/eraser_cursor.png","line_cursor.png, "+A+"/cursors/line_cursor.png","freehand_cursor.png, "+A+"/cursors/freehand_cursor.png","text_cursor.png, "+A+"/cursors/text_cursor.png","add_marker_cursor.png, "+A+"/cursors/add_marker_cursor.png","add_sticky_note_cursor.png, "+A+"/cursors/add_sticky_note_cursor.png"]};HC3dsMaxStandardInterface.prototype.getMarkerResources=function(A){return["marker.png, "+A+"/overlays/marker.png","markerA.png, "+A+"/overlays/markerA.png","markerB.png, "+A+"/overlays/markerB.png","markerC.png, "+A+"/overlays/markerC.png","markerD.png, "+A+"/overlays/markerD.png","markerE.png, "+A+"/overlays/markerE.png","markerF.png, "+A+"/overlays/markerF.png","markerG.png, "+A+"/overlays/markerG.png","markerH.png, "+A+"/overlays/markerH.png","markerI.png, "+A+"/overlays/markerI.png","markerJ.png, "+A+"/overlays/markerJ.png","markerK.png, "+A+"/overlays/markerK.png","markerL.png, "+A+"/overlays/markerL.png","markerM.png, "+A+"/overlays/markerM.png","markerN.png, "+A+"/overlays/markerN.png","markerO.png, "+A+"/overlays/markerO.png","markerP.png, "+A+"/overlays/markerP.png","markerQ.png, "+A+"/overlays/markerQ.png","markerR.png, "+A+"/overlays/markerR.png","markerS.png, "+A+"/overlays/markerS.png","markerT.png, "+A+"/overlays/markerT.png","markerU.png, "+A+"/overlays/markerU.png","markerV.png, "+A+"/overlays/markerV.png","markerW.png, "+A+"/overlays/markerW.png","markerX.png, "+A+"/overlays/markerX.png","markerY.png, "+A+"/overlays/markerY.png","markerZ.png, "+A+"/overlays/markerZ.png"]};HC3dsMaxStandardInterface.prototype.getResources=function(A){return HC3dsMaxInterface.prototype.getResources.call(this,A).concat(HC3dsMaxStandardInterface.prototype.getCursorResources.call(this,A).concat(HC3dsMaxStandardInterface.prototype.getMarkerResources.call(this,A)))};HC3dsMaxStandardInterface.prototype.update=function(){if(this.navigationToolbar.viewToolbar.visible){if(this.controlKeyDown&&this.altKeyDown){this.applet.setMouseMode("middle","zoom",this.navigationToolbar.viewToolbar.zoomButton.cursor)}else{if(this.altKeyDown){this.applet.setMouseMode("middle","rotate",this.navigationToolbar.viewToolbar.rotateButton.cursor)}else{this.applet.setMouseMode("middle","pan",this.navigationToolbar.viewToolbar.panButton.cursor)}}}else{if(this.controlKeyDown&&this.altKeyDown){this.applet.setMouseMode("middle","zoom",this.navigationToolbar.cameraToolbar.dollyButton.cursor)}else{if(this.altKeyDown){this.applet.setMouseMode("middle","rotate",this.navigationToolbar.cameraToolbar.orbitButton.cursor)}else{this.applet.setMouseMode("middle","pan",this.navigationToolbar.cameraToolbar.truckButton.cursor)}}}};HC3dsMaxStandardInterface.prototype.setView=function(A){if(this.viewDisplay){this.applet.removeOverlay(this.viewDisplay)}if(A==undefined){if(this.applet.camera.orthographic){A="User"}else{A="Perspective"}}this.viewDisplay=new HCText(A,HCVector3(-1,1,0),"left","top",new RGBColor(195,195,195));this.applet.addOverlay(this.viewDisplay)};HC3dsMaxStandardInterface.prototype.parseQueryString=function(A){this.markUp.parseQueryString(A);HC3dsMaxInterface.prototype.parseQueryString.call(this,A)};HC3dsMaxStandardInterface.prototype.getQueryString=function(){var A=HC3dsMaxInterface.prototype.getQueryString.call(this);return addQueryString(A,this.markUp.getQueryString())};