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 k=d.height;if(a==0){a=getElementAttribute(d,"width")}if(k==0){k=getElementAttribute(d,"height")}var b="<span "+e+h+c+' style="width:'+a+"px; height:"+k+"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 m=this.parallel(e);var l=Math.cos(f*Math.PI/180);var h=Math.sin(f*Math.PI/180);var g=b.scaledBy(l);var k=a.scaledBy(h);var d=(g.plus(k)).plus(m);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 l=this.parallel(d);var k=Math.cos(e*Math.PI/180);var g=Math.sin(e*Math.PI/180);var f=b.scaledBy(k);var h=a.scaledBy(g);return(f.plus(h)).plus(l)}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 HCFont(b,d,c,a){if(c==undefined){c=false}if(a==undefined){a=false}this.name=b;this.size=d;this.bold=c;this.italic=a;return this}function map(){return this}map.prototype.getNumTiles=function(a){return Math.pow(2,a)};map.prototype.getX=function(a){a=180-a;while(a<0){a+=360}while(a>360){a-=360}return a/360};map.prototype.getY=function(c){if(c>90){c=c-180}if(c<-90){c=c+180}var a=c*Math.PI/180;var b=0.5*Math.log((1+Math.sin(a))/(1-Math.sin(a)));return((1-(b/Math.PI))/2)};map.prototype.getTileX=function(a,b){return Math.floor(this.getX(a)*this.getNumTiles(b))};map.prototype.getTileY=function(b,a){return Math.floor(this.getY(b)*this.getNumTiles(a))};map.prototype.getTileWidth=function(d,c,a){var b=Math.cos(d*Math.PI/180);if(a=="inches"){return 24901*5280*12*b/this.getNumTiles(c)}else{if(a=="feet"){return 24901*5280*b/this.getNumTiles(c)}else{if(a=="millimeters"){return 40075*1000*1000*b/this.getNumTiles(c)}else{if(a=="centimeters"){return 40075*1000*100*b/this.getNumTiles(c)}else{if(a=="meters"){return 40075*1000*b/this.getNumTiles(c)}}}}}};map.prototype.getTileHeight=function(d,c,a){var b=Math.cos(d*Math.PI/180);if(a=="inches"){return 24859*5280*12*b/this.getNumTiles(c)}else{if(a=="feet"){return 24859*5280*b/this.getNumTiles(c)}else{if(a=="millimeters"){return 40008*1000*1000*b/this.getNumTiles(c)}else{if(a=="centimeters"){return 40008*1000*100*b/this.getNumTiles(c)}else{if(a=="meters"){return 40008*1000*b/this.getNumTiles(c)}}}}}};function GMap(a,b){if(typeof(a)=="undefined"){a="http://mt.google.com"}if(typeof(b)=="undefined"){b=["http://kh0.google.com","http://kh1.google.com","http://kh2.google.com","http://kh3.google.com"]}this.mapTileServer=a;this.satelliteTileServers=b;this.mapTilePath="mt";this.satelliteTilePath="kh";this.mapVersion=undefined;this.satelliteVersion="17";this.hybridVersion="w2t.69";return this}GMap.prototype=new map();GMap.prototype.getNumTiles=function(a){return Math.pow(2,17-a)};GMap.prototype.getTileLocation=function(k,a,e){var m=this.getX(a);var l=1-this.getY(k);var b=0,g=1;var o=0,c=1;var n="t";for(var f=0;f<e;f++){var h=(b+g)/2;var d=(o+c)/2;if(l>d){o=d;if(m<h){n+="q";g=h}else{n+="r";b=h}}else{c=d;if(m<h){n+="t";g=h}else{n+="s";b=h}}}return n};GMap.prototype.getNeighborTileLocation=function(b,d){var c=b.substring(0,b.length-1);var a=b.charAt(b.length-1);if(d=="left"){if(a=="q"){c=this.getNeighborTileLocation(c,d);a="r"}else{if(a=="r"){a="q"}else{if(a=="s"){a="t"}else{if(a=="t"){c=this.getNeighborTileLocation(c,d);a="s"}}}}}else{if(d=="right"){if(a=="q"){a="r"}else{if(a=="r"){c=this.getNeighborTileLocation(c,d);a="q"}else{if(a=="s"){c=this.getNeighborTileLocation(c,d);a="t"}else{if(a=="t"){a="s"}}}}}else{if(d=="upper"){if(a=="q"){c=this.getNeighborTileLocation(c,d);a="t"}else{if(a=="r"){c=this.getNeighborTileLocation(c,d);a="s"}else{if(a=="s"){a="r"}else{if(a=="t"){a="q"}}}}}else{if(d=="lower"){if(a=="q"){a="t"}else{if(a=="r"){a="s"}else{if(a=="s"){c=this.getNeighborTileLocation(c,d);a="r"}else{if(a=="t"){c=this.getNeighborTileLocation(c,d);a="q"}}}}}else{if(d=="upper left"){if(a=="q"){c=this.getNeighborTileLocation(c,d);a="s"}else{if(a=="r"){c=this.getNeighborTileLocation(c,"upper");a="t"}else{if(a=="s"){a="q"}else{if(a=="t"){c=this.getNeighborTileLocation(c,"left");a="r"}}}}}else{if(d=="upper right"){if(a=="q"){c=this.getNeighborTileLocation(c,"upper");a="s"}else{if(a=="r"){c=this.getNeighborTileLocation(c,d);a="t"}else{if(a=="s"){c=this.getNeighborTileLocation(c,"right");a="q"}else{if(a=="t"){a="r"}}}}}else{if(d=="lower left"){if(a=="q"){c=this.getNeighborTileLocation(c,"left");a="s"}else{if(a=="r"){a="t"}else{if(a=="s"){c=this.getNeighborTileLocation(c,"lower");a="q"}else{if(a=="t"){c=this.getNeighborTileLocation(c,d);a="r"}}}}}else{if(d=="lower right"){if(a=="q"){a="s"}else{if(a=="r"){c=this.getNeighborTileLocation(c,"right");a="t"}else{if(a=="s"){c=this.getNeighborTileLocation(c,d);a="q"}else{if(a=="t"){c=this.getNeighborTileLocation(c,"lower");a="r"}}}}}}}}}}}}return c+a};GMap.prototype.getXYTileQueryString=function(b,a,d,c){if(b!="hybrid"){return"n=404&x="+a+"&y="+d+"&zoom="+c}else{return"n=404&v="+this.hybridVersion+"&hl=en&x="+a+"&y="+d+"&zoom="+c}};GMap.prototype.getXYTileURL=function(b,a,d,c){return this.mapTileServer+"/"+this.mapTilePath+"?"+this.getXYTileQueryString(b,a,d,c)};GMap.prototype.getTileURL=function(a,d,b,c){return this.getXYMapTileURL(a,this.getTileX(b,c),this.getTileY(d,c),c)};GMap.prototype.getSatelliteTileQueryString=function(a){return"n=404&v="+this.satelliteVersion+"&t="+a};GMap.prototype.getLocationSatelliteTileURL=function(a){return this.satelliteTileServers[Math.floor(Math.random()*this.satelliteTileServers.length)]+"/"+this.satelliteTilePath+"?"+this.getSatelliteTileQueryString(a)};GMap.prototype.getSatelliteTileURL=function(c,a,b){return this.getLocationSatelliteTileURL(this.getTileLocation(c,a,b))};GMap.prototype.getTiles=function(u,n,c,B,w,D,G,A,E){if(A==undefined){A=0}if(E==undefined){E=0}if(u=="map"||u=="satellite"||u=="hybrid"){var M=new Array();var J=0;var d=new HCVector3(0,0,1)}if(u=="map"||u=="hybrid"){var p=this.getTileX(w,D);var o=this.getTileY(B,D);var a=this.getTileWidth(B,D,G);var k=this.getTileHeight(B,D,G);var C=(this.getX(w)*this.getNumTiles(D))-p;var N=(this.getY(B)*this.getNumTiles(D))-o;var K=Math.floor((n-1)/2);var h=Math.floor((c-1)/2);var I=[new HCVector2(0,1),new HCVector2(0,0),new HCVector2(1,0),new HCVector2(1,1)];for(var g=0;g<n;g++){var l=(K-g+N)*k;for(var e=0;e<c;e++){var m=(-h+e-C)*a;var f=[new HCVector3(m,l,A),new HCVector3(m,l-k,A),new HCVector3(m+a,l-k,A),new HCVector3(m+a,l,A)];var F=this.getXYTileURL(u,p+e-h,o+g-K,D);var r=new HCMaterial(F);if(E!=0){for(var H=0;H<f.length;H++){f[H].rotateBy(E,d)}}M[J]=new HCPolygon(f,r,I);J++}}}if(u=="hybrid"){D=17-D}if(u=="satellite"||u=="hybrid"){var p=this.getTileX(w,17-D);var o=this.getTileY(B,17-D);var a=this.getTileWidth(B,17-D,G);var k=this.getTileHeight(B,17-D,G);var C=(this.getX(w)*this.getNumTiles(17-D))-p;var N=(this.getY(B)*this.getNumTiles(17-D))-o;var K=Math.floor((n-1)/2);var h=Math.floor((c-1)/2);var b=this.getTileLocation(B,w,D);for(var g=0;g<K;g++){b=this.getNeighborTileLocation(b,"upper")}for(var e=0;e<h;e++){b=this.getNeighborTileLocation(b,"left")}var I=[new HCVector2(0,1),new HCVector2(0,0),new HCVector2(1,0),new HCVector2(1,1)];var z=0,v=1;var q=b;for(var g=0;g<n;g++){var l=(K-g+N)*k;var L=q;for(var e=0;e<c;e++){var m=(-h+e-C)*a;var f=[new HCVector3(m,l,A),new HCVector3(m,l-k,A),new HCVector3(m+a,l-k,A),new HCVector3(m+a,l,A)];var F=this.getLocationSatelliteTileURL(L);var r=new HCMaterial(F);if(E!=0){for(var H=0;H<f.length;H++){f[H].rotateBy(E,d)}}M[J]=new HCPolygon(f,r,I);L=this.getNeighborTileLocation(L,"right");J++}q=this.getNeighborTileLocation(q,"lower")}}return M};function MSMap(b,c,a){if(typeof(b)=="undefined"){b="http://r3.ortho.tiles.virtualearth.net"}if(typeof(c)=="undefined"){c="http://a0.ortho.tiles.virtualearth.net"}if(typeof(a)=="undefined"){a="http://h1.ortho.tiles.virtualearth.net"}this.mapTileServer=b;this.satelliteTileServer=c;this.hybridTileServer=a;this.mapTilePath="tiles";this.satelliteTilePath="tiles";this.hybridTilePath="tiles";return this}MSMap.prototype=new map();MSMap.prototype.getTileLocation=function(k,a,e){var m=this.getX(a);var l=1-this.getY(k);var b=0,g=1;var o=0,c=1;var n="";for(var f=0;f<e;f++){var h=(b+g)/2;var d=(o+c)/2;if(l>d){o=d;if(m<h){n+="0";g=h}else{n+="1";b=h}}else{c=d;if(m<h){n+="2";g=h}else{n+="3";b=h}}}return n};MSMap.prototype.getNeighborTileLocation=function(b,d){var c=b.substring(0,b.length-1);var a=b.charAt(b.length-1);if(d=="left"){if(a=="0"){c=this.getNeighborTileLocation(c,d);a="1"}else{if(a=="1"){a="0"}else{if(a=="3"){a="2"}else{if(a=="2"){c=this.getNeighborTileLocation(c,d);a="3"}}}}}else{if(d=="right"){if(a=="0"){a="1"}else{if(a=="1"){c=this.getNeighborTileLocation(c,d);a="0"}else{if(a=="3"){c=this.getNeighborTileLocation(c,d);a="2"}else{if(a=="2"){a="3"}}}}}else{if(d=="upper"){if(a=="0"){c=this.getNeighborTileLocation(c,d);a="2"}else{if(a=="1"){c=this.getNeighborTileLocation(c,d);a="3"}else{if(a=="3"){a="1"}else{if(a=="2"){a="0"}}}}}else{if(d=="lower"){if(a=="0"){a="2"}else{if(a=="1"){a="3"}else{if(a=="3"){c=this.getNeighborTileLocation(c,d);a="1"}else{if(a=="2"){c=this.getNeighborTileLocation(c,d);a="0"}}}}}else{if(d=="upper left"){if(a=="0"){c=this.getNeighborTileLocation(c,d);a="3"}else{if(a=="1"){c=this.getNeighborTileLocation(c,"upper");a="2"}else{if(a=="3"){a="0"}else{if(a=="2"){c=this.getNeighborTileLocation(c,"left");a="1"}}}}}else{if(d=="upper right"){if(a=="0"){c=this.getNeighborTileLocation(c,"upper");a="3"}else{if(a=="1"){c=this.getNeighborTileLocation(c,d);a="2"}else{if(a=="3"){c=this.getNeighborTileLocation(c,"right");a="0"}else{if(a=="2"){a="1"}}}}}else{if(d=="lower left"){if(a=="0"){c=this.getNeighborTileLocation(c,"left");a="3"}else{if(a=="1"){a="2"}else{if(a=="3"){c=this.getNeighborTileLocation(c,"lower");a="0"}else{if(a=="2"){c=this.getNeighborTileLocation(c,d);a="1"}}}}}else{if(d=="lower right"){if(a=="0"){a="3"}else{if(a=="1"){c=this.getNeighborTileLocation(c,"right");a="2"}else{if(a=="3"){c=this.getNeighborTileLocation(c,d);a="0"}else{if(a=="2"){c=this.getNeighborTileLocation(c,"lower");a="1"}}}}}}}}}}}}return c+a};MSMap.prototype.getLocationTileURL=function(b,a){if(b=="map"||b=="roads"){return this.mapTileServer+"/"+this.mapTilePath+"/r"+a+".png?g=45"}else{if(b=="aerial"||b=="satellite"){return this.satelliteTileServer+"/"+this.satelliteTilePath+"/a"+a+".png?g=45"}else{return this.hybridTileServer+"/"+this.hybridTilePath+"/h"+a+".png?g=45"}}};MSMap.prototype.getTileURL=function(a,d,b,c){return this.getLocationTileURL(a,this.getTileLocation(d,b,c))};MSMap.prototype.getTiles=function(d,K,m,l,C,f,L,a,h){if(a==undefined){a=0}if(h==undefined){h=0}var N=this.getTileX(C,f);var M=this.getTileY(l,f);var D=this.getTileWidth(l,f,L);var b=this.getTileHeight(l,f,L);var E=(this.getX(C)*this.getNumTiles(f))-N;var F=(this.getY(l)*this.getNumTiles(f))-M;var B=Math.floor((K-1)/2);var g=Math.floor((m-1)/2);var q=new HCVector3(0,0,1);var o=this.getTileLocation(l,C,f);for(var n=0;n<B;n++){o=this.getNeighborTileLocation(o,"upper")}for(var A=0;A<g;A++){o=this.getNeighborTileLocation(o,"left")}var H=[new HCVector2(0,1),new HCVector2(0,0),new HCVector2(1,0),new HCVector2(1,1)];var v=new Array();var J=0;var k=0,u=1;var s=0,e=1;var p=o;for(var n=0;n<K;n++){var w=(B-n+F)*b;var t=p;for(var A=0;A<m;A++){var z=(-g+A-E)*D;var c=[new HCVector3(z,w,a),new HCVector3(z,w-b,a),new HCVector3(z+D,w-b,a),new HCVector3(z+D,w,a)];var r=this.getLocationTileURL(d,t);var G=new HCMaterial(r);if(h!=0){for(var I=0;I<c.length;I++){c[I].rotateBy(h,q)}}v[J]=new HCPolygon(c,G,H);t=this.getNeighborTileLocation(t,"right");J++}p=this.getNeighborTileLocation(p,"lower")}return v};function YMap(b,c,a){if(typeof(b)=="undefined"){b="http://us.maps1.yimg.com"}if(typeof(c)=="undefined"){c="http://us.maps3.yimg.com"}if(typeof(a)=="undefined"){a="http://us.maps3.yimg.com"}this.mapTileServer=b;this.satelliteTileServer=c;this.hybridTileServer=a;this.mapTilePath="us.tile.maps.yimg.com/tl";this.satelliteTilePath="aerial.maps.yimg.com/ximg";this.hybridTilePath="aerial.maps.yimg.com/tile";this.mapVersion="4.1";this.satelliteVersion="1.8";this.hybridVersion="2.5";return this}YMap.prototype=new map();YMap.prototype.getNumTiles=function(a){return Math.pow(2,18-a)};YMap.prototype.getTileX=function(a,b){return Math.floor(this.getX(a)*this.getNumTiles(b))};YMap.prototype.getTileY=function(b,a){return Math.floor((0.5-this.getY(b))*this.getNumTiles(a))};YMap.prototype.getXYTileQueryString=function(b,a,d,c){if(b=="map"||b=="roads"){return"v="+this.mapVersion+"&md=1&x="+a+"&y="+d+"&z="+c}else{if(b=="aerial"||b=="satellite"){return"v="+this.satelliteVersion+"&t=a&s=256&x="+a+"&y="+d+"&z="+c}else{return"v="+this.hybridVersion+"&t=h&x="+a+"&y="+d+"&z="+c}}};YMap.prototype.getXYTileURL=function(b,a,d,c){if(b=="map"||b=="roads"){return this.mapTileServer+"/"+this.mapTilePath+"?"+this.getXYTileQueryString(b,a,d,c)}else{if(b=="aerial"||b=="satellite"){return this.satelliteTileServer+"/"+this.satelliteTilePath+"?"+this.getXYTileQueryString(b,a,d,c)}else{return this.hybridTileServer+"/"+this.hybridTilePath+"?"+this.getXYTileQueryString(b,a,d,c)}}};YMap.prototype.getTileURL=function(a,d,b,c){return this.getLocationTileURL(a,this.getTileX(b,c),this.getTileY(d,c),c)};YMap.prototype.getTiles=function(r,n,c,u,s,w,B,t,z){if(t==undefined){t=0}if(z==undefined){z=0}var p=this.getTileX(s,w);var o=this.getTileY(u,w);var a=this.getTileWidth(u,w,B);var k=this.getTileHeight(u,w,B);var v=(this.getX(s)*this.getNumTiles(w))-p;var K=o-((0.5-this.getY(u))*this.getNumTiles(w))+1;var F=Math.floor((n-1)/2);var h=Math.floor((c-1)/2);var d=new HCVector3(0,0,1);var G=0,I=1;var J=0,b=1;var D=[new HCVector2(G,b),new HCVector2(G,J),new HCVector2(I,J),new HCVector2(I,b)];var H=new Array();var E=0;for(var g=0;g<n;g++){var l=(F-g+K)*k;for(var e=0;e<c;e++){var m=(-h+e-v)*a;var f=[new HCVector3(m,l,t),new HCVector3(m,l-k,t),new HCVector3(m+a,l-k,t),new HCVector3(m+a,l,t)];var A=this.getXYTileURL(r,p+e-h,o-g+F,w);var q=new HCMaterial(A);if(z!=0){for(var C=0;C<f.length;C++){f[C].rotateBy(z,d)}}H[E]=new HCPolygon(f,q,D);E++}}return H};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)+1)};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 toggleMenu(a,b){menu.call(this,a,b);return this}toggleMenu.prototype=new menu();toggleMenu.prototype.addItem=function(a,b){if(this.element==null){return}if(b){var c="*"+a}else{var c=a}menu.prototype.addItem.call(this,c,b)};toggleMenu.prototype.isItemSelected=function(a){return(this.getItemValue(a)=="true")};toggleMenu.prototype.setItemSelected=function(b,c){if(c==this.isItemSelected(b)){return}this.setItemValue(b,c);var a=this.getItemName(b);if(!c){this.setItemName(b,a.substring(1,a.length))}else{this.setItemName(b,"*"+a)}};toggleMenu.prototype.toggleItemSelected=function(a){this.setItemSelected(a,!this.isItemSelected(a))};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!=undefined){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);if(this.element!=undefined){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&&(this.element!=undefined)){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 tabs(b,a,c){component.call(this,b,c);this.selectedTab=null;this.tabNames=new Array();this.tabVisibilities=new Array();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.addTabs=function(c,a){for(var b=0;b<c.length;b++){this.tabNames[this.tabNames.length]=c[b];this.tabVisibilities[this.tabVisibilities.length]=((a==undefined)||(a[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.createSelectedTab=function(b,g){var d=document.createElement("table");d.border=0;d.cellPadding=0;d.cellSpacing=0;d.style.cursor="default";var f=d.insertRow(0);var a,e,c=0;a=f.insertCell(c++);e=document.createElement("img");e.src=tabs.images["selected left"].src;a.appendChild(e);a=f.insertCell(c++);a.setAttribute("background",tabs.images["selected middle"].src);a.appendChild(document.createTextNode("\u00A0"));a=f.insertCell(c++);a.setAttribute("background",tabs.images["selected middle"].src);a.appendChild(document.createTextNode(b));a.className="tab-selected";a.onclick=g;a=f.insertCell(c++);a.setAttribute("background",tabs.images["selected middle"].src);a.appendChild(document.createTextNode("\u00A0"));a=f.insertCell(c++);e=document.createElement("img");e.src=tabs.images["selected right"].src;a.appendChild(e);return d};tabs.prototype.createUnselectedTab=function(b,g){var d=document.createElement("table");d.border=0;d.cellPadding=0;d.cellSpacing=0;d.style.cursor="default";var f=d.insertRow(0);var a,e,c=0;a=f.insertCell(c++);e=document.createElement("img");e.src=tabs.images["unselected left"].src;a.appendChild(e);a=f.insertCell(c++);a.setAttribute("background",tabs.images["unselected middle"].src);a.appendChild(document.createTextNode("\u00A0"));a=f.insertCell(c++);a.setAttribute("background",tabs.images["unselected middle"].src);a.appendChild(document.createTextNode(b));a.className="tab-unselected";a.onclick=g;a=f.insertCell(c++);a.setAttribute("background",tabs.images["unselected middle"].src);a.appendChild(document.createTextNode("\u00A0"));a=f.insertCell(c++);e=document.createElement("img");e.src=tabs.images["unselected right"].src;a.appendChild(e);return d};tabs.prototype.createTabs=function(e){if(e.length==0){return}var f=document.createElement("table");f.border=0;f.width="100%";f.cellPadding=0;f.cellSpacing=0;var g=f.insertRow(0);g.align="left";g.vAlign="bottom";for(var c=0;c<e.length;c++){if(this.tabVisibilities[c]){var b=this;if(c==this.selectedTab-1){var d=this.createSelectedTab(e[c],getClosure(this,"onClick",(c+1)))}else{var d=this.createUnselectedTab(e[c],getClosure(this,"onClick",(c+1)))}var a=g.insertCell(c);a.style.padding=0;a.appendChild(d)}}var a=g.insertCell(e.length);a.width="100%";a.height=tabs.images.blank.height;a.style.padding=0;a.setAttribute("background",tabs.images.blank.src);return f};tabs.prototype.update=function(){if(!this.element||(this.tabNames.length==0)){return}else{this.setElement(this.createTabs(this.tabNames))}};function toolbar(a,c,b){container.call(this,a,c,b);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("onMove");if(this.control){this.control.update()}};toolbar.prototype.onMove=function(a){this.call("onMove")};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,d){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"}}if(d==undefined){d=true}this.showHelp=d;this.helpMessage="";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)"};toolbarButton.prototype.onMouseOver=function(){if(this.showHelp){if(this.parent){if(this.parent.parent){if(this.parent.parent.standardToolbar){if(this.parent.parent.standardToolbar.helpButton){if(this.parent.parent.standardToolbar.helpButton.selected){return}}}}}}button.prototype.onMouseOver.call(this)};toolbarButton.prototype.onMouseOut=function(){if(this.showHelp){if(this.parent){if(this.parent.parent){if(this.parent.parent.standardToolbar){if(this.parent.parent.standardToolbar.helpButton){if(this.parent.parent.standardToolbar.helpButton.selected){return}}}}}}button.prototype.onMouseOut.call(this)};toolbarButton.prototype.onMouseDown=function(){if(this.showHelp){if(this.parent){if(this.parent.parent){if(this.parent.parent.standardToolbar){if(this.parent.parent.standardToolbar.helpButton){if(this.parent.parent.standardToolbar.helpButton.selected){this.parent.parent.standardToolbar.helpButton.showHelpMessage(this.helpMessage);return}}}}}}button.prototype.onMouseDown.call(this)};toolbarButton.prototype.onMouseUp=function(){if(this.showHelp){if(this.parent){if(this.parent.parent){if(this.parent.parent.standardToolbar){if(this.parent.parent.standardToolbar.helpButton){if(this.parent.parent.standardToolbar.helpButton.selected){return}}}}}}button.prototype.onMouseUp.call(this)};function toolbarToggleButton(a,b,d){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"}}if(d==undefined){d=true}this.showHelp=d;this.helpMessage="";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.onMove=function(){if(this.selected){if(this.enabled){this.showSelected()}else{this.showSelectedDisabled()}}};toolbarToggleButton.prototype.onSelect=function(){toggleButton.prototype.onSelect.call(this)};toolbarToggleButton.prototype.onDeselect=function(){toggleButton.prototype.onDeselect.call(this)};toolbarToggleButton.prototype.onMouseOver=function(){if(this.showHelp){if(this.parent){if(this.parent.parent){if(this.parent.parent.standardToolbar){if(this.parent.parent.standardToolbar.helpButton){if(this.parent.parent.standardToolbar.helpButton.selected){return}}}}}}toggleButton.prototype.onMouseOver.call(this)};toolbarToggleButton.prototype.onMouseOut=function(){if(this.showHelp){if(this.parent){if(this.parent.parent){if(this.parent.parent.standardToolbar){if(this.parent.parent.standardToolbar.helpButton){if(this.parent.parent.standardToolbar.helpButton.selected){return}}}}}}toggleButton.prototype.onMouseOut.call(this)};toolbarToggleButton.prototype.onMouseDown=function(){if(this.showHelp){if(this.parent){if(this.parent.parent){if(this.parent.parent.standardToolbar){if(this.parent.parent.standardToolbar.helpButton){if(this.parent.parent.standardToolbar.helpButton.selected){this.parent.parent.standardToolbar.helpButton.showHelpMessage(this.helpMessage);return}}}}}}toggleButton.prototype.onMouseDown.call(this)};toolbarToggleButton.prototype.onMouseUp=function(){if(this.showHelp){if(this.parent){if(this.parent.parent){if(this.parent.parent.standardToolbar){if(this.parent.parent.standardToolbar.helpButton){if(this.parent.parent.standardToolbar.helpButton.selected){return}}}}}}toggleButton.prototype.onMouseUp.call(this)};function toolbarRadioButton(c,b,d,a,f){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"}}if(f==undefined){f=true}this.showHelp=f;this.helpMessage="";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.onMove=function(){if(this.selected){if(this.enabled){this.showSelected()}else{this.showSelectedDisabled()}}};toolbarRadioButton.prototype.onMouseOver=function(){if(this.showHelp){if(this.parent){if(this.parent.parent){if(this.parent.parent.standardToolbar){if(this.parent.parent.standardToolbar.helpButton){if(this.parent.parent.standardToolbar.helpButton.selected){return}}}}}}radioButton.prototype.onMouseOver.call(this)};toolbarRadioButton.prototype.onMouseOut=function(){if(this.showHelp){if(this.parent){if(this.parent.parent){if(this.parent.parent.standardToolbar){if(this.parent.parent.standardToolbar.helpButton){if(this.parent.parent.standardToolbar.helpButton.selected){return}}}}}}radioButton.prototype.onMouseOut.call(this)};toolbarRadioButton.prototype.onMouseDown=function(){if(this.showHelp){if(this.parent){if(this.parent.parent){if(this.parent.parent.standardToolbar){if(this.parent.parent.standardToolbar.helpButton){if(this.parent.parent.standardToolbar.helpButton.selected){this.parent.parent.standardToolbar.helpButton.showHelpMessage(this.helpMessage);return}}}}}}radioButton.prototype.onMouseDown.call(this)};toolbarRadioButton.prototype.onMouseUp=function(){if(this.showHelp){if(this.parent){if(this.parent.parent){if(this.parent.parent.standardToolbar){if(this.parent.parent.standardToolbar.helpButton){if(this.parent.parent.standardToolbar.helpButton.selected){return}}}}}}radioButton.prototype.onMouseUp.call(this)};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();if(d&&(d!="")){d=d.replace(/ /g,"%20");d=d.replace(/%/g,"%25");d=d.replace(/&/g,"%26");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 printButton(a,b){toolbarButton.call(this,a,b);this.status="Print the active document";this.helpMessage="This button prints the active document.";return this}printButton.prototype=new toolbarButton();printButton.prototype.onClick=function(){printPage()};function modelInfoButton(a,b){toolbarButton.call(this,a,b);this.status="Display Model Info Display Properties";this.helpMessage="This button shows information about the model.";return this}modelInfoButton.prototype=new toolbarButton();modelInfoButton.prototype.showModelInfo=function(){alert("This model was created using SketchUp 3D design software from\nGoogle (www.sketchup.com) and converted into a web page using\nHypercosm Teleporter software from Hypercosm (www.hypercosm.com).")};modelInfoButton.prototype.onClick=function(){this.showModelInfo()};function helpButton(a,b){toolbarToggleButton.call(this,a,b,false);this.status="Display help for clicked on buttons";return this}helpButton.prototype=new toolbarToggleButton();helpButton.prototype.showHelpMessage=function(a){alert(a);this.setSelected(false)};helpButton.prototype.onSelect=function(){toolbarToggleButton.prototype.onSelect.call(this);setStatus("Select a button on which to get help.")};helpButton.prototype.onDeselect=function(){toolbarToggleButton.prototype.onDeselect.call(this);clearStatus()};helpButton.prototype.onMouseOver=function(){if(this.selected){return}toolbarToggleButton.prototype.onMouseOver.call(this)};helpButton.prototype.onMouseOut=function(){if(this.selected){return}toolbarToggleButton.prototype.onMouseOut.call(this)};helpButton.prototype.onMouseDown=function(){toolbarToggleButton.prototype.onMouseDown.call(this)};helpButton.prototype.onMouseUp=function(){toolbarToggleButton.prototype.onMouseUp.call(this)};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.principalToolbar.selectButton.overlay){this.parent.parent.standardToolbar.undoButton.setOverlay(this.parent.parent.principalToolbar.selectButton.overlay);this.parent.parent.standardToolbar.undoButton.setEnabled(true);this.parent.parent.standardToolbar.redoButton.setEnabled(false);this.parent.parent.applet.removeOverlay(this.parent.parent.principalToolbar.selectButton.overlay);this.parent.parent.principalToolbar.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 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 standardToolbar(a,b){toolbar.call(this,a,null,b);this.modelInfoButton=new modelInfoButton("modelInfoButton",this);this.helpButton=new helpButton("helpButton",this);this.eraseButton=new eraseButton("eraseButton",this);this.undoButton=new undoButton("undoButton",this);this.redoButton=new redoButton("redoButton",this);this.eraseButton.setEnabled(false);this.undoButton.setEnabled(false);this.redoButton.setEnabled(false);return this}standardToolbar.prototype=new toolbar();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 toggleMenu("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.addItem(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.getSelectedToolbarIndex=function(){return this.toolsMenu.getSelectedIndex()};toolsToolbar.prototype.isToolbarVisible=function(a){return !this.toolsMenu.isToolbarVisible(a)};toolsToolbar.prototype.setToolbarVisible=function(a,b){this.toolsMenu.setItemSelected(a,!b);this.toolbars[a].setVisible(b)};toolsToolbar.prototype.toggleToolbarVisible=function(a){this.toolsMenu.toggleItemSelected(a);this.toolbars[a].toggleVisible()};toolsToolbar.prototype.update=function(){for(var a=0;a<this.toolbars.length;a++){this.toolsMenu.setItemSelected(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 isoButton(a,b){toolbarButton.call(this,a,b);this.status="Iso View";this.helpMessage="This button sets the current view to the isometric view.";return this}isoButton.prototype=new toolbarButton();isoButton.prototype.onClick=function(){this.parent.parent.applet.setView("iso");if(this.parent.parent.cameraToolbar){if(this.parent.parent.cameraToolbar.previousButton){if(this.parent.parent.cameraToolbar.previousButton!=null){this.parent.parent.cameraToolbar.previousButton.setEnabled(true)}}}};function topButton(a,b){toolbarButton.call(this,a,b);this.status="Top View";this.helpMessage="This button sets the current view to the top view.";return this}topButton.prototype=new toolbarButton();topButton.prototype.onClick=function(){this.parent.parent.applet.setView("top");if(this.parent.parent.cameraToolbar){if(this.parent.parent.cameraToolbar.previousButton){if(this.parent.parent.cameraToolbar.previousButton!=null){this.parent.parent.cameraToolbar.previousButton.setEnabled(true)}}}};function frontButton(a,b){toolbarButton.call(this,a,b);this.status="Front View";this.helpMessage="This button sets the current view to the front view.";return this}frontButton.prototype=new toolbarButton();frontButton.prototype.onClick=function(){this.parent.parent.applet.setView("front");if(this.parent.parent.cameraToolbar){if(this.parent.parent.cameraToolbar.previousButton){if(this.parent.parent.cameraToolbar.previousButton!=null){this.parent.parent.cameraToolbar.previousButton.setEnabled(true)}}}};function rightButton(a,b){toolbarButton.call(this,a,b);this.status="Right View";this.helpMessage="This button sets the current view to the right view.";return this}rightButton.prototype=new toolbarButton();rightButton.prototype.onClick=function(){this.parent.parent.applet.setView("right");if(this.parent.parent.cameraToolbar){if(this.parent.parent.cameraToolbar.previousButton){if(this.parent.parent.cameraToolbar.previousButton!=null){this.parent.parent.cameraToolbar.previousButton.setEnabled(true)}}}};function backButton(a,b){toolbarButton.call(this,a,b);this.status="Back View";this.helpMessage="This button sets the current view to the back view.";return this}backButton.prototype=new toolbarButton();backButton.prototype.onClick=function(){this.parent.parent.applet.setView("back");if(this.parent.parent.cameraToolbar){if(this.parent.parent.cameraToolbar.previousButton){if(this.parent.parent.cameraToolbar.previousButton!=null){this.parent.parent.cameraToolbar.previousButton.setEnabled(true)}}}};function leftButton(a,b){toolbarButton.call(this,a,b);this.status="Left View";this.helpMessage="This button sets the current view to the left view.";return this}leftButton.prototype=new toolbarButton();leftButton.prototype.onClick=function(){this.parent.parent.applet.setView("left");if(this.parent.parent.cameraToolbar){if(this.parent.parent.cameraToolbar.previousButton){if(this.parent.parent.cameraToolbar.previousButton!=null){this.parent.parent.cameraToolbar.previousButton.setEnabled(true)}}}};function viewsToolbar(a,b){toolbar.call(this,a,null,b);this.isoButton=new isoButton("isoButton",this);this.topButton=new topButton("topButton",this);this.frontButton=new frontButton("frontButton",this);this.rightButton=new rightButton("rightButton",this);this.backButton=new backButton("backButton",this);this.leftButton=new leftButton("leftButton",this);return this}viewsToolbar.prototype=new toolbar();viewsToolbar.prototype.parseQueryString=function(b){if(!b){return}var a=getQueryVariable(b,"view");this.parent.applet.setView(a)};viewsToolbar.prototype.getQueryString=function(){var a=null;if(this.parent.applet.view!=undefined){if(this.parent.applet.view!=this.parent.applet.getPageName()){a="view="+this.parent.applet.view}}return a};function layersButton(a,b){toolbarButton.call(this,a,b);this.status="Toggle layer visibility";this.helpMessage="This button toggles the visibility of the selected layer.";return this}layersButton.prototype=new toolbarButton();layersButton.prototype.onClick=function(){this.parent.toggleLayerVisible(this.parent.getSelectedIndex())};function layersToolbar(a,b){toolbar.call(this,a,null,b);this.layersButton=new layersButton("layersButton",this);this.layersMenu=new toggleMenu("layersMenu",this);return this}layersToolbar.prototype=new toolbar();layersToolbar.prototype.onLoad=function(){toolbar.prototype.onLoad.call(this);for(var c=1;c<this.parent.applet.layerNames.length;c++){var b=this.parent.applet.layerNames[c];if((b.charAt(0)!="(")||(b.charAt(b.length-1)!=")")){this.layersMenu.addItem(b,!this.parent.applet.layerVisibility[c])}}var a=this;var d=function(f){for(var e=0;e<a.initialLayerVisibility.length;e++){a.layersMenu.setItemSelected(e,!f[e])}};this.parent.applet.setCallback("layer_visibility",d);this.initialLayerVisibility=new Array();for(c=0;c<this.parent.applet.layerNames.length;c++){this.initialLayerVisibility[c]=this.parent.applet.layerVisibility[c]}};layersToolbar.prototype.addLayer=function(a,b){this.layersMenu.addLayer(a,!b)};layersToolbar.prototype.setSelectedIndex=function(a){this.layersMenu.setSelectedIndex(a)};layersToolbar.prototype.getSelectedIndex=function(){return this.layersMenu.getSelectedIndex()};layersToolbar.prototype.isLayerVisible=function(a){return !this.layersMenu.isItemSelected(a)};layersToolbar.prototype.setLayerVisible=function(a,b){this.layersMenu.setItemSelected(a,!b);this.parent.applet.setLayerVisible(a,b)};layersToolbar.prototype.toggleLayerVisible=function(a){this.layersMenu.toggleItemSelected(a);this.parent.applet.toggleLayerVisible(a)};layersToolbar.prototype.parseQueryString=function(c){if(!c){return}for(var a=0;a<this.parent.applet.layerNames.length;a++){var b=getQueryVariable(c,"layer"+a);if(b!=undefined){this.parent.applet.setLayerVisible(a,(b=="true"))}}this.parent.applet.getAttribute("layer_visibility")};layersToolbar.prototype.getQueryString=function(){var b=null;for(var a=0;a<this.initialLayerVisibility.length;a++){if(this.parent.applet.layerVisibility[a]!=this.initialLayerVisibility[a]){b=addQueryString(b,"layer"+a+"="+this.parent.applet.layerVisibility[a])}}return b};function xRayButton(a,b){toolbarToggleButton.call(this,a,b);this.status="Display the sketch in X-Ray mode";this.helpMessage="This button sets the rendering style to X-Ray mode.";return this}xRayButton.prototype=new toolbarToggleButton();xRayButton.prototype.onLoad=function(){toolbarToggleButton.prototype.setSelected.call(this,this.parent.parent.applet.xRayMode);var a=this;this.parent.parent.applet.setCallback("x_ray",function(b){a.setSelected(b)})};xRayButton.prototype.onSelect=function(){this.parent.parent.applet.setXRayMode(true);toolbarToggleButton.prototype.onSelect.call(this)};xRayButton.prototype.onDeselect=function(){this.parent.parent.applet.setXRayMode(false);toolbarToggleButton.prototype.onDeselect.call(this)};xRayButton.prototype.parseQueryString=function(b){var a=getQueryVariable(b,"x_ray");if(a!=undefined){this.setSelected(a=="true")}};xRayButton.prototype.getQueryString=function(){var a=null;if(this.selected!=this.initiallySelected){a="x_ray="+this.selected}return a};function cartoonButton(a,b){toolbarToggleButton.call(this,a,b);this.status="Display the sketch in cartoon mode";this.helpMessage="This button sets the rendering style to cartoon mode.";return this}cartoonButton.prototype=new toolbarToggleButton();cartoonButton.prototype.onSelect=function(){toolbarToggleButton.prototype.onSelect.call(this);if(this.parent.parent.shadowsToolbar){if(this.parent.parent.shadowsToolbar.sunButton){this.parent.parent.shadowsToolbar.sunButton.setSelected(false)}if(this.parent.parent.shadowsToolbar.shadowsButton){this.parent.parent.shadowsToolbar.shadowsButton.setSelected(false)}}this.parent.parent.applet.beginMessages();this.parent.parent.applet.setBrightness(0);this.parent.parent.applet.setAmbient(new RGBColor(1,1,1));this.parent.parent.applet.endMessages()};cartoonButton.prototype.onDeselect=function(){toolbarToggleButton.prototype.onDeselect.call(this);this.parent.parent.applet.beginMessages();this.parent.parent.applet.setBrightness(1);this.parent.parent.applet.setAmbient(new RGBColor(0.35,0.35,0.35));this.parent.parent.applet.endMessages()};cartoonButton.prototype.parseQueryString=function(b){var a=getQueryVariable(b,"cartoon");if(a!=undefined){this.setSelected(a=="true")}};cartoonButton.prototype.getQueryString=function(){var a=null;if(this.selected){a="cartoon=true"}return a};function wireframeButton(a,c,b){toolbarRadioButton.call(this,a,c,b);this.status="Display the sketch in wireframe mode";this.helpMessage="This button sets the rendering style to wireframe mode.";return this}wireframeButton.prototype=new toolbarRadioButton();wireframeButton.prototype.onLoad=function(){if(this.parent.parent.applet.displayMode=="wireframe"){toolbarRadioButton.prototype.onSelect.call(this)}};wireframeButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.setDisplayMode("wireframe")};wireframeButton.prototype.parseQueryString=function(b){var a=getQueryVariable(b,"display_mode");if(a=="wireframe"){this.setSelected(true)}};wireframeButton.prototype.getQueryString=function(){var a=null;if(this.selected&&!this.initiallySelected){a="display_mode=wireframe"}return a};function hiddenLineButton(a,c,b){toolbarRadioButton.call(this,a,c,b);this.status="Display the sketch in hidden line mode";this.helpMessage="This button sets the rendering style to hidden line mode.";return this}hiddenLineButton.prototype=new toolbarRadioButton();hiddenLineButton.prototype.onLoad=function(){if(this.parent.parent.applet.displayMode=="hidden_line"){toolbarRadioButton.prototype.onSelect.call(this)}};hiddenLineButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.setDisplayMode("hidden_line")};hiddenLineButton.prototype.parseQueryString=function(b){var a=getQueryVariable(b,"display_mode");if(a=="hidden_line"){this.setSelected(true)}};hiddenLineButton.prototype.getQueryString=function(){var a=null;if(this.selected&&!this.initiallySelected){a="display_mode=hidden_line"}return a};function monochromeButton(a,c,b){toolbarRadioButton.call(this,a,c,b);this.status="Display the sketch in monochrome mode";this.helpMessage="This button sets the rendering style to monochrome mode.";return this}monochromeButton.prototype=new toolbarRadioButton();monochromeButton.prototype.onLoad=function(){if(this.parent.parent.applet.displayMode=="monochrome"){toolbarRadioButton.prototype.onSelect.call(this)}};monochromeButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.setDisplayMode("monochrome")};monochromeButton.prototype.parseQueryString=function(b){var a=getQueryVariable(b,"display_mode");if(a=="monochrome"){this.setSelected(true)}};monochromeButton.prototype.getQueryString=function(){var a=null;if(this.selected&&!this.initiallySelected){a="display_mode=monochrome"}return a};function shadedButton(a,c,b){toolbarRadioButton.call(this,a,c,b);this.status="Display the sketch in shaded mode";this.helpMessage="This button sets the rendering style to shaded mode.";return this}shadedButton.prototype=new toolbarRadioButton();shadedButton.prototype.onLoad=function(){if((this.parent.parent.applet.displayMode=="shaded")&&(!this.parent.parent.applet.texture)){toolbarRadioButton.prototype.onSelect.call(this)}};shadedButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.setDisplayMode("shaded");this.parent.parent.applet.setTexture(false)};shadedButton.prototype.parseQueryString=function(b){var a=getQueryVariable(b,"display_mode");if(a=="shaded"){this.setSelected(true)}};shadedButton.prototype.getQueryString=function(){var a=null;if(this.selected&&!this.initiallySelected){a="display_mode=shaded"}return a};function shadedTexturedButton(a,c,b){toolbarRadioButton.call(this,a,c,b);this.status="Display the sketch in shaded mode with textures";this.helpMessage="This button sets the rendering style to shaded with textures mode.";return this}shadedTexturedButton.prototype=new toolbarRadioButton();shadedTexturedButton.prototype.onLoad=function(){if((this.parent.parent.applet.displayMode=="shaded")&&(this.parent.parent.applet.texture)){toolbarRadioButton.prototype.onSelect.call(this)}};shadedTexturedButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.setDisplayMode("shaded");this.parent.parent.applet.setTexture(true)};shadedTexturedButton.prototype.parseQueryString=function(b){var a=getQueryVariable(b,"display_mode");if(a=="shaded_with_textures"){this.setSelected(true)}};shadedTexturedButton.prototype.getQueryString=function(){var a=null;if(this.selected&&!this.initiallySelected){a="display_mode=shaded_with_textures"}return a};function displayModeToolbar(a,b){toolbar.call(this,a,null,b);this.xRayButton=new xRayButton("xRayButton",this);this.cartoonButton=new cartoonButton("cartoonButton",this);var c=new radioButtonGroup();this.wireframeButton=new wireframeButton("wireframeButton",c,this);this.hiddenLineButton=new hiddenLineButton("hiddenLineButton",c,this);this.monochromeButton=new monochromeButton("monochromeButton",c,this);this.shadedButton=new shadedButton("shadedButton",c,this);this.shadedTexturedButton=new shadedTexturedButton("shadedTexturedButton",c,this);return this}displayModeToolbar.prototype=new toolbar();displayModeToolbar.prototype.onLoad=function(){toolbar.prototype.onLoad.call(this);var a=this;this.parent.applet.setCallback("display_mode",function(b){a.setDisplayMode(b)});this.parent.applet.setCallback("texture",function(b){a.setTexture(b)})};displayModeToolbar.prototype.setDisplayMode=function(a){if(a=="wireframe"){this.wireframeButton.setSelected(true)}else{if(a=="hidden_line"){this.hiddenLineButton.setSelected(true)}else{if(a=="monochrome"){this.monochromeButton.setSelected(true)}else{if(a=="shaded"){if(!this.parent.applet.texture){this.shadedButton.setSelected(true)}else{this.shadedTexturedButton.setSelected(true)}}}}}};displayModeToolbar.prototype.setTexture=function(a){if(a&&this.shadedButton.selected){this.shadedTexturedButton.setSelected(true)}else{if(!a&&this.shadedTexturedButton.selected){this.shadedButton.setSelected(true)}}};function edgesButton(a,b){toolbarToggleButton.call(this,a,b);this.status="Display the sketch with edges";this.helpMessage="This button toggles the display of edges.";return this}edgesButton.prototype=new toolbarToggleButton();edgesButton.prototype.onLoad=function(){toolbarToggleButton.prototype.setSelected.call(this,this.parent.parent.applet.showEdges);var a=this;this.parent.parent.applet.setCallback("edges",function(b){a.setSelected(b)})};edgesButton.prototype.onSelect=function(){this.parent.parent.applet.setShowEdges(true);toolbarToggleButton.prototype.onSelect.call(this)};edgesButton.prototype.onDeselect=function(){this.parent.parent.applet.setShowEdges(false);toolbarToggleButton.prototype.onDeselect.call(this)};edgesButton.prototype.parseQueryString=function(b){var a=getQueryVariable(b,"edges");if(a!=undefined){this.setSelected(a=="true")}};edgesButton.prototype.getQueryString=function(){var a=null;if(this.selected!=this.initiallySelected){a="edges="+this.selected}return a};function profileEdgesButton(a,b){toolbarToggleButton.call(this,a,b);this.status="Display the sketch with profile edges";this.helpMessage="This button toggles the display of profile edges.";return this}profileEdgesButton.prototype=new toolbarToggleButton();profileEdgesButton.prototype.onLoad=function(){toolbarToggleButton.prototype.setSelected.call(this,this.parent.parent.applet.showProfileEdges);var a=this;this.parent.parent.applet.setCallback("profile_edges",function(b){a.setSelected(b)})};profileEdgesButton.prototype.onSelect=function(){this.parent.parent.applet.setShowProfileEdges(true);toolbarToggleButton.prototype.onSelect.call(this)};profileEdgesButton.prototype.onDeselect=function(){this.parent.parent.applet.setShowProfileEdges(false);toolbarToggleButton.prototype.onDeselect.call(this)};profileEdgesButton.prototype.parseQueryString=function(b){var a=getQueryVariable(b,"profile_edges");if(a!=undefined){this.setSelected(a=="true")}};profileEdgesButton.prototype.getQueryString=function(){var a=null;if(this.selected!=this.initiallySelected){a="profile_edges="+this.selected}return a};function edgesToolbar(a,b){toolbar.call(this,a,null,b);this.edgesButton=new edgesButton("edgesButton",this);this.profileEdgesButton=new profileEdgesButton("profileEdgesButton",this);return this}edgesToolbar.prototype=new toolbar();function sunButton(a,b){toolbarToggleButton.call(this,a,b);this.status="Use Sun For Shading";this.helpMessage="This button toggles the use of the sun for shading.";return this}sunButton.prototype=new toolbarToggleButton();sunButton.prototype.onLoad=function(){toolbarToggleButton.prototype.setSelected.call(this,false)};sunButton.prototype.onSelect=function(){this.parent.parent.applet.beginMessages();this.parent.parent.applet.setLightCoords("world");this.parent.parent.applet.setLightDirection(this.parent.getLightDirection(this.parent.getAltitude(),this.parent.getAzimuth()));this.parent.parent.applet.endMessages();if(this.parent.parent.displayModeToolbar){if(this.parent.parent.displayModeToolbar.cartoonButton){this.parent.parent.displayModeToolbar.cartoonButton.setSelected(false)}}toolbarToggleButton.prototype.onSelect.call(this)};sunButton.prototype.onDeselect=function(){this.parent.parent.applet.beginMessages();this.parent.parent.applet.setLightCoords("camera");this.parent.parent.applet.setLightDirection(new HCVector3(0,-1,0));this.parent.parent.applet.endMessages();toolbarToggleButton.prototype.onDeselect.call(this)};sunButton.prototype.parseQueryString=function(b){var a=getQueryVariable(b,"use_sun");if(a!=undefined){this.setSelected(a=="true")}};sunButton.prototype.getQueryString=function(){var a=null;if(this.selected!=this.initiallySelected){a="use_sun="+this.selected}return a};function shadowsButton(a,b){toolbarToggleButton.call(this,a,b);this.status="Toggle shadow display";this.helpMessage="This button toggles the display of shadows on and off.";return this}shadowsButton.prototype=new toolbarToggleButton();shadowsButton.prototype.onLoad=function(){toolbarToggleButton.prototype.setSelected.call(this,this.parent.parent.applet.shadows)};shadowsButton.prototype.onSelect=function(){if(this.parent.parent.displayModeToolbar){if(this.parent.parent.displayModeToolbar.cartoonButton){this.parent.parent.displayModeToolbar.cartoonButton.setSelected(false)}}this.parent.parent.applet.setShadows(true);toolbarToggleButton.prototype.onSelect.call(this)};shadowsButton.prototype.onDeselect=function(){this.parent.parent.applet.setShadows(false);toolbarToggleButton.prototype.onDeselect.call(this)};shadowsButton.prototype.parseQueryString=function(b){var a=getQueryVariable(b,"shadows");if(a!=undefined){this.setSelected(a=="true")}};shadowsButton.prototype.getQueryString=function(){var a=null;if(this.selected){a="shadows=true"}return a};function shadowsToolbar(b,c){toolbar.call(this,b,null,c);this.sunButton=new sunButton("sunButton",this);this.shadowsButton=new shadowsButton("shadowsButton",this);this.azimuthSlider=new slider("azimuthSlider",0,360,null,this);this.altitudeSlider=new slider("altitudeSlider",0,180,null,this);this.altitude=0;this.azimuth=0;var a=this;function d(){if(a.sunButton.selected){var e=a.altitudeSlider.getValue();var g=a.azimuthSlider.getValue();var h=(Math.abs(e-a.altitude)>5);var f=(Math.abs(g-a.azimuth)>5);if(h||f){if(a.sunButton.selected){a.parent.applet.setLightDirection(a.getLightDirection(e,g))}a.altitude=e;a.azimuth=g}}}this.azimuthSlider.onmousemove=d;this.altitudeSlider.onmousemove=d;return this}shadowsToolbar.prototype=new toolbar();shadowsToolbar.prototype.onStart=function(){this.initialAltitude=0;this.initialAzimuth=0};shadowsToolbar.prototype.setLightAngles=function(a,b){this.altitudeSlider.setValue(a);this.azimuthSlider.setValue(b);this.parent.applet.setLightDirection(this.getLightDirection(a,b))};shadowsToolbar.prototype.getAltitude=function(){return this.altitude};shadowsToolbar.prototype.getAzimuth=function(){return this.azimuth};shadowsToolbar.prototype.getLightDirection=function(a,b){var c=new HCVector3(1,0,0);c.rotateBy(a,new HCVector3(0,-1,0));c.rotateBy(b,new HCVector3(0,0,1));return c};shadowsToolbar.prototype.parseQueryString=function(c){if(!c){return}this.parent.applet.beginMessages();toolbar.prototype.parseQueryString.call(this,c);var a=getQueryVariable(c,"altitude");if(a!=undefined){this.altitude=parseFloat(a);this.altitudeSlider.setValue(this.altitude)}var b=getQueryVariable(c,"azimuth");if(b!=undefined){this.azimuth=parseFloat(b);this.azimuthSlider.setValue(this.azimuth)}if(this.sunButton.selected){this.parent.applet.setLightDirection(this.getLightDirection(this.altitude,this.azimuth))}this.parent.applet.endMessages()};shadowsToolbar.prototype.getQueryString=function(){var c=toolbar.prototype.getQueryString.call(this);var b=Math.floor(this.getAzimuth());if(b!=this.initialAzimuth){c=addQueryString(c,"azimuth="+b)}var a=Math.floor(this.getAltitude());if(a!=this.initialAltitude){c=addQueryString(c,"altitude="+a)}return c};function mapsButton(a,b){toolbarToggleButton.call(this,a,b);this.status="Toggle map visibility";this.helpMessage="This button toggles the visibility of the selected map.";return this}mapsButton.prototype=new toolbarToggleButton();mapsButton.prototype.onSelect=function(){this.parent.setSelected(this.parent.mapsMenu.getSelectedIndex(),true);toolbarToggleButton.prototype.onSelect.call(this)};mapsButton.prototype.onDeselect=function(){this.parent.setSelected(this.parent.mapsMenu.getSelectedIndex(),false);toolbarToggleButton.prototype.onDeselect.call(this)};function mapsToolbar(b,c){toolbar.call(this,b,null,c);this.mapsButton=new mapsButton("mapsButton",this);this.mapsMenu=new menu("mapsMenu",this);var a=this;this.mapsMenu.onchange=function(){if(a.mapsButton.selected){a.setSelected(a.mapsMenu.getSelectedIndex(),true)}};this.maps=new Array();this.mapNames=new Array();this.mapTiles=new Array();this.mapLayers=new Array();this.font=new HCFont("Arial",9);this.rows=8;this.columns=8;this.zoomLevel=17;return this}mapsToolbar.prototype=new toolbar();mapsToolbar.prototype.addMap=function(a){this.mapNames[this.mapNames.length]=a;this.mapLayers[this.mapLayers.length]=this.parent.applet.getLayers();this.mapsMenu.addItem(a,false);this.parent.applet.addLayer(a,false)};mapsToolbar.prototype.loadMap=function(d){var c=this.getIndex(d);var a=0;if(this.maps[c]){return}if(d=="Google Maps"){this.maps[c]=new GMap();this.mapTiles[d]=this.maps[c].getTiles("map",this.rows,this.columns,this.parent.applet.latitude,-this.parent.applet.longitude,17-this.zoomLevel,"inches",a,-this.parent.applet.angle);this.parent.applet.addOverlays(this.mapTiles[d],this.mapLayers[c]+1)}else{if(d=="Google Maps (Satellite)"){this.maps[c]=new GMap();this.mapTiles[d]=this.maps[c].getTiles("satellite",this.rows,this.columns,this.parent.applet.latitude,-this.parent.applet.longitude,this.zoomLevel,"inches",a,-this.parent.applet.angle);this.parent.applet.addOverlays(this.mapTiles[d],this.mapLayers[c]+1)}else{if(d=="Google Maps (Hybrid)"){this.maps[c]=new GMap();this.mapTiles[d]=this.maps[c].getTiles("hybrid",this.rows,this.columns,this.parent.applet.latitude,-this.parent.applet.longitude,17-this.zoomLevel,"inches",a,-this.parent.applet.angle);this.parent.applet.addOverlays(this.mapTiles[d],this.mapLayers[c]+1)}else{if(d=="Microsoft VE (Roads)"){this.maps[c]=new MSMap();this.mapTiles[d]=this.maps[c].getTiles("roads",this.rows,this.columns,this.parent.applet.latitude,-this.parent.applet.longitude,this.zoomLevel,"inches",a,-this.parent.applet.angle);this.parent.applet.addOverlays(this.mapTiles[d],this.mapLayers[c]+1)}else{if(d=="Microsoft VE (Aerial)"){this.maps[c]=new MSMap();this.mapTiles[d]=this.maps[c].getTiles("aerial",this.rows,this.columns,this.parent.applet.latitude,-this.parent.applet.longitude,this.zoomLevel,"inches",a,-this.parent.applet.angle);this.parent.applet.addOverlays(this.mapTiles[d],this.mapLayers[c]+1)}else{if(d=="Microsoft VE (Hybrid)"){this.maps[c]=new MSMap();this.mapTiles[d]=this.maps[c].getTiles("hybrid",this.rows,this.columns,this.parent.applet.latitude,-this.parent.applet.longitude,this.zoomLevel,"inches",a,-this.parent.applet.angle);this.parent.applet.addOverlays(this.mapTiles[d],this.mapLayers[c]+1)}else{if(d=="Yahoo Maps"){this.maps[c]=new YMap();this.mapTiles[d]=this.maps[c].getTiles("map",this.rows,this.columns,this.parent.applet.latitude,-this.parent.applet.longitude,18-this.zoomLevel,"inches",a,-this.parent.applet.angle);this.parent.applet.addOverlays(this.mapTiles[d],this.mapLayers[c]+1)}else{if(d=="Yahoo Maps (Satellite)"){this.maps[c]=new YMap();this.mapTiles[d]=this.maps[c].getTiles("satellite",this.rows,this.columns,this.parent.applet.latitude,-this.parent.applet.longitude,18-this.zoomLevel,"inches",a,-this.parent.applet.angle);this.parent.applet.addOverlays(this.mapTiles[d],this.mapLayers[c]+1)}else{if(d=="Yahoo Maps (Hybrid)"){this.maps[c]=new YMap();if(!this.mapTiles["Yahoo Maps (Satellite)"]){this.mapTiles["Yahoo Maps (Satellite)"]=this.maps[c].getTiles("satellite",this.rows,this.columns,this.parent.applet.latitude,-this.parent.applet.longitude,18-this.zoomLevel,"inches",a,-this.parent.applet.angle)}this.mapTiles[d]=this.maps[c].getTiles("hybrid",this.rows,this.columns,this.parent.applet.latitude,-this.parent.applet.longitude,18-this.zoomLevel,"inches",a,-this.parent.applet.angle);this.parent.applet.addOverlays(this.mapTiles["Yahoo Maps (Satellite)"],this.mapLayers[c]+1);this.parent.applet.addOverlays(this.mapTiles[d],this.mapLayers[c]+1)}}}}}}}}}if(d=="Google Maps"||d=="Google Maps (Satellite)"||d=="Google Maps (Hybrid)"){var b="Map Data Courtesy of Google, NAVTEQ, MapLink / Tele Atlas"}else{if(d=="Yahoo Maps"||d=="Yahoo Maps (Satellite)"||d=="Yahoo Maps (Hybrid)"){var b="Map Data Courtesy of Yahoo, NAVTEQ"}else{if(d=="Microsoft VE (Roads)"||d=="Microsoft VE (Aerial)"||d=="Microsoft VE (Hybrid)"){var b="Map Data Courtesy of Microsoft, NAVTEQ"}}}if(b){this.textDisplay=new HCText(b,HCVector3(0,-0.95,0),"center","middle",white,this.font,["shadowed"]);this.parent.applet.addOverlay(this.textDisplay,this.mapLayers[c]+1)}};mapsToolbar.prototype.getName=function(a){return this.mapNames[a]};mapsToolbar.prototype.getIndex=function(b){var a=0;while(a<this.mapNames.length){if(this.mapNames[a]==b){return a}else{a++}}return null};mapsToolbar.prototype.getSelectedIndex=function(){return this.mapsMenu.getSelectedIndex()};mapsToolbar.prototype.getSelectedName=function(){return this.mapsMenu.getSelectedName()};mapsToolbar.prototype.isSelected=function(a){return this.mapsMenu.isSelected(a)};mapsToolbar.prototype.isNameSelected=function(a){return this.isSelected(this.getIndex(a))};mapsToolbar.prototype.setSelected=function(a,c){if(c){for(var b=0;b<this.mapsMenu.getItems();b++){if(b!=a){this.setSelected(b,false)}}this.loadMap(this.mapNames[a]);this.mapIndex=a}else{if(a==this.mapIndex){this.mapIndex=undefined}}this.parent.applet.setLayerVisible(this.mapLayers[a],c)};mapsToolbar.prototype.setNameSelected=function(a,b){this.setSelected(this.getIndex(a),b)};mapsToolbar.prototype.toggleSelected=function(a){this.setSelected(a,!this.isSelected(a))};mapsToolbar.prototype.toggleNameSelected=function(a){this.toggleSelected(this.getIndex(a))};mapsToolbar.prototype.getQueryName=function(a){if(a=="Google Maps"){return"google_maps"}else{if(a=="Google Maps (Satellite)"){return"google_satellite"}else{if(a=="Google Maps (Hybrid)"){return"google_hybrid"}else{if(a=="Microsoft VE (Roads)"){return"ms_ve"}else{if(a=="Microsoft VE (Aerial)"){return"ms_ve_aerial"}else{if(a=="Microsoft VE (Hybrid)"){return"ms_ve_hybrid"}else{if(a=="Yahoo Maps"){return"yahoo_maps"}else{if(a=="Yahoo Maps (Satellite)"){return"yahoo_satellite"}else{if(a=="Yahoo Maps (Hybrid)"){return"yahoo_hybrid"}}}}}}}}}};mapsToolbar.prototype.parseQueryString=function(c){var b=getQueryVariable(c,"map");if(b!=undefined){for(var a=0;a<this.mapNames.length;a++){if(this.getQueryName(this.mapNames[a])==b){this.mapsMenu.setSelectedIndex(a+1);this.mapsButton.setSelected(true);return}}}};mapsToolbar.prototype.getQueryString=function(){if(this.mapsButton.selected){return"map="+this.getQueryName(this.mapNames[this.getSelectedIndex()])}else{return""}};function pageTabs(b,e,d,c){if(e){var a=e+"/images/tabs/"}else{var a="images/tabs/"}tabs.call(this,b,a,c);this.pageSoundNames=d;return this}pageTabs.prototype=new tabs();pageTabs.prototype.onLoad=function(){if(this.parent.applet.pageNames&&this.parent.applet.pageNames.length>0){this.addTabs(this.parent.applet.pageNames);tabs.prototype.setTab.call(this,1)}if(this.pageSoundNames){for(var b=1;b<=this.pageSoundNames.length;b++){this.parent.applet.loadSound(this.pageSoundNames[b-1])}}var a=this;this.parent.applet.setCallback("page",function(c){a.onPageChange(c)})};pageTabs.prototype.onPageChange=function(a){this.parent.applet.getAttributes(HCSketchUpApplet.pageAttributeNames);if(this.pageSoundNames){var b=this.pageSoundNames[a-1];if(b&&(b!="")){this.parent.applet.playSound(b)}}};pageTabs.prototype.onUnload=function(){if(this.timeout!=undefined){window.clearTimeout(this.timeout)}};pageTabs.prototype.getPages=function(){return this.getTabs()};pageTabs.prototype.getPageName=function(a){return this.getTabName(a)};pageTabs.prototype.getPage=function(){return this.getTab()};pageTabs.prototype.setPage=function(b,a){tabs.prototype.setTab.call(this,b);this.parent.applet.setPage(b,a);this.parent.applet.getAttribute("page")};pageTabs.prototype.onClick=function(a){if(this.parent.slideShow){this.parent.slideShow.cancel()}if(this.parent.walkThroughToolbar){this.parent.walkThroughToolbar.slideShowButton.setSelected(false)}this.setPage(a,this.parent.applet.transitionTime);if(this.parent.perspectiveToolbar){this.parent.perspectiveToolbar.setEnabled(false);var b=this.parent.perspectiveToolbar;this.timeout=window.setTimeout(function(){b.setEnabled(true)},this.parent.applet.transitionTime*1000)}};pageTabs.prototype.isLastPage=function(){return(this.getPage()==this.getPages())};pageTabs.prototype.getNextPage=function(){if(!this.isLastPage()){return this.getPage()+1}else{return 1}};pageTabs.prototype.parseQueryString=function(b){var a=getQueryVariable(b,"page");if(a!=undefined){this.setPage(parseInt(a),0)}};pageTabs.prototype.getQueryString=function(){var a=this.getPage();if(a>1){return"page="+a}};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.onLoad=function(){this.cursor=new HCIcon("select_cursor.png","right","top");this.parent.parent.applet.loadIcon(this.cursor)};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",this.cursor);var a=this.parent.parent.applet;var b=function(d,c,e){if((d)&&a.parent.markUp.hasOverlay(d)){a.parent.principalToolbar.selectButton.setOverlay(d);a.parent.standardToolbar.eraseButton.setEnabled(true);if(a.parent.layersToolbar){a.parent.layersToolbar.setSelectedIndex(d.layer+1)}}else{a.parent.principalToolbar.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 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","right","bottom");this.parent.parent.applet.loadIcon(this.cursor)};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);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");this.parent.parent.applet.loadIcon(this.cursor)};eraserButton.prototype.onSelect=function(){this.parent.parent.applet.beginMessages();toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.setMouseMode("left","none",this.cursor);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.selectButton=new selectButton("selectButton",a,this);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","right","bottom");this.parent.parent.applet.loadIcon(this.cursor)};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","right","bottom");this.parent.parent.applet.loadIcon(this.cursor)};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");this.parent.parent.applet.loadIcon(this.cursor)};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,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(f,g,d){if(this.currentText){this.parent.parent.applet.deselectOverlay(this.currentText)}var a=this.parent.parent.markUp.getPaintColor();if(d){this.addLeaderText(f,g,d,a)}else{this.addScreenText(f,g,a)}if(this.parent.parent.principalToolbar.selectButton.overlay){this.parent.parent.applet.deselectOverlay(this.parent.parent.principalToolbar.selectButton.overlay)}var b=this.parent.parent.applet.getOverlay(HCOverlay.overlays.length-1);this.parent.parent.applet.beginMessages();this.parent.parent.applet.selectOverlay(b);this.parent.parent.applet.selectOverlay(b);this.parent.parent.applet.endMessages();this.currentText=b;this.parent.parent.principalToolbar.selectButton.overlay=b;this.parent.parent.applet.setMouseMode("left","none",null);var c=this.parent.parent.applet;var e=function(k,h,l){if(c.parent.annotationToolbar.textButton.currentText){c.deselectOverlay(c.parent.annotationToolbar.textButton.currentText)}c.setMouseMode("left","place_text",c.parent.annotationToolbar.textButton.cursor,"HCApplet.getAppletById('"+c.id+"').parent.annotationToolbar.textButton.drawText");HCEvent.removeListener(c.parent.annotationToolbar.textButton.listener);c.parent.annotationToolbar.textButton.listener=null};this.listener=HCEvent.addListener(this.parent.parent.applet,"mousedown",e)};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","bottom");this.parent.parent.applet.loadIcon(this.cursor)};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);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,k){if((e!=null)&&(k=="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.parent.parent.applet.loadIcon(this.cursor);this.icon=this.cursor;var a=this;HCEvent.addListener(this.parent.parent.applet,"click",function(c,b){if(c&&(c.note!=undefined)){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);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 tapeMeasureButton(a,c,b){toolbarRadioButton.call(this,a,c,b);this.status="Measure distances and create construction lines";this.helpMessage="This button is used to measure distances and create construction lines.";return this}tapeMeasureButton.prototype=new toolbarRadioButton();tapeMeasureButton.prototype.onLoad=function(){this.cursor=new HCIcon("tape_measure_cursor.png","right","bottom");this.parent.parent.applet.loadIcon(this.cursor)};tapeMeasureButton.prototype.onSelect=function(){this.parent.parent.applet.beginMessages();toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.setMouseMode("left","tape_measure",this.cursor);this.parent.parent.applet.endMessages()};tapeMeasureButton.prototype.onDeselect=function(){toolbarRadioButton.prototype.onDeselect.call(this);this.parent.parent.applet.setMouseMode("left","none",null)};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 axesButton(a,b){toolbarToggleButton.call(this,a,b);this.status="Toggle axes display";this.helpMessage="This button toggles the display of axes on and off.";return this}axesButton.prototype=new toolbarToggleButton();axesButton.prototype.onLoad=function(){toolbarToggleButton.prototype.setSelected.call(this,this.parent.parent.applet.showAxes);var a=this;this.parent.parent.applet.setCallback("axes",function(b){a.setSelected(b)})};axesButton.prototype.onSelect=function(){this.parent.parent.applet.setAxes(true);toolbarToggleButton.prototype.onSelect.call(this)};axesButton.prototype.onDeselect=function(){this.parent.parent.applet.setAxes(false);toolbarToggleButton.prototype.onDeselect.call(this)};axesButton.prototype.parseQueryString=function(b){var a=getQueryVariable(b,"axes");if(a!=undefined){this.setSelected(a=="true")}};axesButton.prototype.getQueryString=function(){var a=null;if(this.selected){a="axes=true"}return a};function constructionToolbar(b,a,c){toolbar.call(this,b,null,c);this.tapeMeasureButton=new tapeMeasureButton("tapeMeasureButton",a,this);this.axesButton=new axesButton("axesButton",this);return this}constructionToolbar.prototype=new toolbar();function orbitButton(a,c,b){toolbarRadioButton.call(this,a,c,b);this.status="Orbit";this.helpMessage="This button sets the mouse mode to orbit mode.";return this}orbitButton.prototype=new toolbarRadioButton();orbitButton.prototype.onLoad=function(){this.cursor=new HCIcon("orbit_cursor.png","center","middle");this.parent.parent.applet.loadIcon(this.cursor)};orbitButton.prototype.onSelect=function(){this.parent.parent.applet.beginMessages();toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.setMouseMode("left","orbit",this.cursor);if(this.parent.parent.cameraToolbar){if(this.parent.parent.cameraToolbar.previousButton){this.parent.parent.cameraToolbar.previousButton.setEnabled(false);var b=this.parent.parent.cameraToolbar.previousButton;var a=function(f,e,g){b.setEnabled(true)};this.mouseDownListener=HCEvent.addListener(this.parent.parent.applet,"mousedown",a)}}var d=16;var c=this;this.shiftKeyDownListener=HCEvent.addListener(this,"keydown",function(){c.parent.parent.applet.setMouseMode("left","pan",c.parent.panButton.cursor)},d);this.shiftKeyUpListener=HCEvent.addListener(this,"keyup",function(){c.parent.parent.applet.setMouseMode("left","orbit",c.cursor)},d);this.parent.parent.applet.endMessages()};orbitButton.prototype.onDeselect=function(){toolbarRadioButton.prototype.onDeselect.call(this);HCEvent.removeListener(this.mouseDownListener);HCEvent.removeListener(this.shiftKeyDownListener);HCEvent.removeListener(this.shiftKeyUpListener);if(this.parent.parent.cameraToolbar){if(this.parent.parent.cameraToolbar.previousButton){this.parent.parent.cameraToolbar.previousButton.setEnabled(true)}}};orbitButton.prototype.onMouseDown=function(){setStatus("Drag to orbit. Shift = Pan");toolbarRadioButton.prototype.onMouseDown.call(this)};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 panButton(a,c,b){toolbarRadioButton.call(this,a,c,b);this.status="Moves the camera viewpoint while maintaining view direction";this.helpMessage="This button sets the mouse mode to pan mode.";return this}panButton.prototype=new toolbarRadioButton();panButton.prototype.onLoad=function(){this.cursor=new HCIcon("pan_cursor.png","center","middle");this.parent.parent.applet.loadIcon(this.cursor)};panButton.prototype.onSelect=function(){this.parent.parent.applet.beginMessages();toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.setMouseMode("left","pan",this.cursor);if(this.parent.parent.cameraToolbar){if(this.parent.parent.cameraToolbar.previousButton){this.parent.parent.cameraToolbar.previousButton.setEnabled(false);var b=this.parent.parent.cameraToolbar.previousButton;var a=function(d,c,e){b.setEnabled(true)};this.mouseDownListener=HCEvent.addListener(this.parent.parent.applet,"mousedown",a)}}setStatus("Drag in direction to pan");this.parent.parent.applet.endMessages()};panButton.prototype.onDeselect=function(){toolbarRadioButton.prototype.onDeselect.call(this);HCEvent.removeListener(this.mouseDownListener);if(this.parent.parent.cameraToolbar){if(this.parent.parent.cameraToolbar.previousButton){this.parent.parent.cameraToolbar.previousButton.setEnabled(true)}}};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 zoomButton(a,c,b){toolbarRadioButton.call(this,a,c,b);this.status="Zoom";this.helpMessage="This button sets the mouse mode to zoom mode.";return this}zoomButton.prototype=new toolbarRadioButton();zoomButton.prototype.onLoad=function(){this.cursor=new HCIcon("zoom_cursor.png","center","middle");this.parent.parent.applet.loadIcon(this.cursor)};zoomButton.prototype.onSelect=function(){this.parent.parent.applet.beginMessages();toolbarRadioButton.prototype.onSelect.call(this);if(this.parent.parent.applet.camera.perspective){this.parent.parent.applet.setMouseMode("left","zoom",this.cursor)}else{this.parent.parent.applet.setMouseMode("left","zoom_fov",this.cursor)}if(this.parent.parent.cameraToolbar){if(this.parent.parent.cameraToolbar.previousButton){this.parent.parent.cameraToolbar.previousButton.setEnabled(false);var b=this.parent.parent.cameraToolbar.previousButton;var a=function(f,e,g){b.setEnabled(true)};this.mouseDownListener=HCEvent.addListener(this.parent.parent.applet,"mousedown",a)}}var d=16;var c=this;this.shiftKeyDownListener=HCEvent.addListener(this,"keydown",function(){c.parent.parent.applet.setMouseMode("left","zoom_fov",c.cursor)},d);this.shiftKeyUpListener=HCEvent.addListener(this,"keyup",function(){c.parent.parent.applet.setMouseMode("left","zoom",c.cursor)},d);this.parent.parent.applet.endMessages()};zoomButton.prototype.onDeselect=function(){HCEvent.removeListener(this.mouseDownListener);HCEvent.removeListener(this.shiftKeyDownListener);HCEvent.removeListener(this.shiftKeyUpListener);if(this.parent.parent.cameraToolbar){if(this.parent.parent.cameraToolbar.previousButton){this.parent.parent.cameraToolbar.previousButton.setEnabled(true)}}toolbarRadioButton.prototype.onDeselect.call(this)};zoomButton.prototype.onMouseDown=function(){setStatus("Drag cursor to zoom. Up is in, down is out. Shift to change Field of View.");toolbarRadioButton.prototype.onMouseDown.call(this)};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 zoomWindowButton(a,c,b){toolbarRadioButton.call(this,a,c,b);this.status="Zoom Window";this.helpMessage="This button sets the mouse mode to zoom window mode.";return this}zoomWindowButton.prototype=new toolbarRadioButton();zoomWindowButton.prototype.onLoad=function(){this.cursor=new HCIcon("zoom_window_cursor.png","center","middle");this.parent.parent.applet.loadIcon(this.cursor)};zoomWindowButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);if(this.parent.parent.cameraToolbar){if(this.parent.parent.cameraToolbar.previousButton){if(this.parent.parent.cameraToolbar.previousButton!=null){this.parent.parent.cameraToolbar.previousButton.setEnabled(true)}}}if(this.parent.parent.applet.camera.perspective){this.parent.parent.applet.setMouseMode("left","zoom_window",this.cursor)}else{this.parent.parent.applet.setMouseMode("left","zoom_window_fov",this.cursor)}var a=this;var b=function(d,c){a.setSelected(false)};this.mouseUpListener=HCEvent.addListener(this.parent.parent.applet,"mouseup",b)};zoomWindowButton.prototype.onDeselect=function(){toolbarRadioButton.prototype.onDeselect.call(this);this.parent.parent.applet.setMouseMode("left","none",null);HCEvent.removeListener(this.mouseUpListener)};zoomWindowButton.prototype.parseQueryString=function(b){var a=getQueryVariable(b,"mouse_mode");if(a=="zoom_window"){this.setSelected(true)}};zoomWindowButton.prototype.getQueryString=function(){var a=null;if(this.selected&&!this.initiallySelected){a="mouse_mode=zoom_window"}return a};function zoomExtentsButton(a,b){toolbarButton.call(this,a,b);this.status="Zoom to extents";this.helpMessage="This button zooms the view to fit the extents of the window.";return this}zoomExtentsButton.prototype=new toolbarButton();zoomExtentsButton.prototype.onClick=function(){this.parent.parent.applet.setView("auto");if(this.parent.parent.cameraToolbar){if(this.parent.parent.cameraToolbar.previousButton){if(this.parent.parent.cameraToolbar.previousButton!=null){this.parent.parent.cameraToolbar.previousButton.setEnabled(true)}}}};function previousButton(a,b){toolbarButton.call(this,a,b);this.status="Restore last viewing orientation";this.helpMessage="This button restores the last viewing orientation.";this.loaded=false;return this}previousButton.prototype=new toolbarButton();previousButton.prototype.onLoad=function(){if(!this.loaded){this.setEnabled(false)}};previousButton.prototype.onClick=function(){this.parent.parent.applet.setView("previous")};function cameraToolbar(b,a,c){toolbar.call(this,b,null,c);this.orbitButton=new orbitButton("orbitButton",a,this);this.panButton=new panButton("panButton",a,this);this.zoomButton=new zoomButton("zoomButton",a,this);this.zoomWindowButton=new zoomWindowButton("zoomWindowButton",a,this);this.zoomExtentsButton=new zoomExtentsButton("zoomExtentsButton",this);this.previousButton=new previousButton("previousButton",this);return this}cameraToolbar.prototype=new toolbar();function positionCameraButton(a,c,b){toolbarRadioButton.call(this,a,c,b);this.status="Sets the camera position and direction";this.helpMessage="This button sets the camera position and direction.";return this}positionCameraButton.prototype=new toolbarRadioButton();positionCameraButton.prototype.onLoad=function(){this.cursor=new HCIcon("position_camera_cursor.png","center","middle");this.parent.parent.applet.loadIcon(this.cursor)};positionCameraButton.prototype.onSelect=function(){this.parent.parent.applet.beginMessages();toolbarRadioButton.prototype.onSelect.call(this);if(this.parent.parent.cameraToolbar){if(this.parent.parent.cameraToolbar.previousButton){if(this.parent.parent.cameraToolbar.previousButton!=null){this.parent.parent.cameraToolbar.previousButton.setEnabled(true)}}}this.parent.parent.applet.setMouseMode("left","position_camera",this.cursor);var a=this.parent.parent.applet;var b=function(d,c){a.parent.walkThroughToolbar.lookAroundButton.setSelected(true)};this.listener=HCEvent.addListener(this.parent.parent.applet,"mouseup",b);this.parent.parent.applet.endMessages()};positionCameraButton.prototype.onDeselect=function(){toolbarRadioButton.prototype.onDeselect.call(this);this.parent.parent.applet.setMouseMode("left","none",null);HCEvent.removeListener(this.listener)};positionCameraButton.prototype.parseQueryString=function(b){var a=getQueryVariable(b,"mouse_mode");if(a=="position_camera"){this.setSelected(true)}};positionCameraButton.prototype.getQueryString=function(){var a=null;if(this.selected&&!this.initiallySelected){a="mouse_mode=position_camera"}return a};function walkButton(a,c,b){toolbarRadioButton.call(this,a,c,b);this.status="Walk with the camera";this.helpMessage="This button sets the mouse mode to walk mode.";return this}walkButton.prototype=new toolbarRadioButton();walkButton.prototype.onLoad=function(){this.cursor=new HCIcon("walk_cursor.png","center","middle");this.parent.parent.applet.loadIcon(this.cursor)};walkButton.prototype.onSelect=function(){this.parent.parent.applet.beginMessages();toolbarRadioButton.prototype.onSelect.call(this);if(this.parent.parent.cameraToolbar){if(this.parent.parent.cameraToolbar.previousButton){if(this.parent.parent.cameraToolbar.previousButton!=null){this.parent.parent.cameraToolbar.previousButton.setEnabled(true)}}}this.parent.parent.applet.setMouseMode("left","walk",this.cursor);this.parent.parent.applet.setMouseMode("middle","look_around",this.parent.parent.walkThroughToolbar.lookAroundButton.cursor);var c=17;var b=16;var d=18;var a=this;this.controlKeyDownListener=HCEvent.addListener(this,"keydown",function(){a.parent.parent.applet.setMouseMode("left","run",a.cursor)},c);this.controlKeyUpListener=HCEvent.addListener(this,"keyup",function(){a.parent.parent.applet.setMouseMode("left","walk",a.cursor)},c);this.shiftKeyDownListener=HCEvent.addListener(this,"keydown",function(){a.parent.parent.applet.setMouseMode("left","move",a.cursor)},b);this.controlKeyUpListener=HCEvent.addListener(this,"keyup",function(){a.parent.parent.applet.setMouseMode("left","walk",a.cursor)},b);this.altKeyDownListener=HCEvent.addListener(this,"keydown",function(){a.parent.parent.applet.setCollisionDetection(false)},d);this.altKeyUpListener=HCEvent.addListener(this,"keyup",function(){a.parent.parent.applet.setCollisionDetection(true)},d);this.parent.parent.applet.endMessages()};walkButton.prototype.onDeselect=function(){this.parent.parent.applet.setMouseMode("middle","orbit",this.parent.parent.cameraToolbar.orbitButton.cursor);HCEvent.removeListener(this.controlKeyDownListener);HCEvent.removeListener(this.controlKeyUpListener);HCEvent.removeListener(this.shiftKeyDownListener);HCEvent.removeListener(this.shiftKeyUpListener);HCEvent.removeListener(this.altKeyDownListener);HCEvent.removeListener(this.altKeyUpListener);toolbarRadioButton.prototype.onDeselect.call(this)};walkButton.prototype.onMouseDown=function(){setStatus("Click and drag to walk. Ctrl = run, Shift = move vertically or sideways, Alt = disable collision detection");toolbarRadioButton.prototype.onMouseDown.call(this)};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 lookAroundButton(a,c,b){toolbarRadioButton.call(this,a,c,b);this.status="Pivots the camera view around a stationary point";this.helpMessage="This button sets the mouse mode to look around mode.";return this}lookAroundButton.prototype=new toolbarRadioButton();lookAroundButton.prototype.onLoad=function(){this.cursor=new HCIcon("look_around_cursor.png","center","middle");this.parent.parent.applet.loadIcon(this.cursor)};lookAroundButton.prototype.onSelect=function(){this.parent.parent.applet.beginMessages();toolbarRadioButton.prototype.onSelect.call(this);if(this.parent.parent.cameraToolbar){if(this.parent.parent.cameraToolbar.previousButton){if(this.parent.parent.cameraToolbar.previousButton!=null){this.parent.parent.cameraToolbar.previousButton.setEnabled(true)}}}this.parent.parent.applet.setMouseMode("left","look_around",this.cursor);this.parent.parent.applet.endMessages()};lookAroundButton.prototype.parseQueryString=function(b){var a=getQueryVariable(b,"mouse_mode");if(a=="look_around"){this.setSelected(true)}};lookAroundButton.prototype.getQueryString=function(){var a=null;if(this.selected&&!this.initiallySelected){a="mouse_mode=look_around"}return a};function slideButton(a,c,b){toolbarRadioButton.call(this,a,c,b);this.status="Slide the camera parallel to the ground plane";this.helpMessage="This button sets the mouse mode to slide mode.";return this}slideButton.prototype=new toolbarRadioButton();slideButton.prototype.onLoad=function(){this.cursor=new HCIcon("slide_cursor.png","center","middle");this.parent.parent.applet.loadIcon(this.cursor)};slideButton.prototype.onSelect=function(){this.parent.parent.applet.beginMessages();toolbarRadioButton.prototype.onSelect.call(this);if(this.parent.parent.cameraToolbar){if(this.parent.parent.cameraToolbar.previousButton){if(this.parent.parent.cameraToolbar.previousButton!=null){this.parent.parent.cameraToolbar.previousButton.setEnabled(true)}}}this.parent.parent.applet.setMouseMode("left","slide",this.cursor);this.parent.parent.applet.setMouseMode("middle","look_around",this.parent.lookAroundButton.cursor);var b=16;var a=this;this.shiftKeyDownListener=HCEvent.addListener(this,"keydown",function(){a.parent.parent.applet.setMouseMode("left","elevate",a.parent.elevateButton.cursor)},b);this.shiftKeyUpListener=HCEvent.addListener(this,"keyup",function(){a.parent.parent.applet.setMouseMode("left","slide",a.cursor)},b);this.parent.parent.applet.endMessages()};slideButton.prototype.onDeselect=function(){this.parent.parent.applet.setMouseMode("middle","orbit",this.parent.parent.cameraToolbar.orbitButton.cursor);HCEvent.removeListener(this.shiftKeyDownListener);HCEvent.removeListener(this.shiftKeyUpListener);toolbarRadioButton.prototype.onDeselect.call(this)};slideButton.prototype.onMouseDown=function(){setStatus("Click and drag to slide, Shift = elevate");toolbarRadioButton.prototype.onMouseDown.call(this)};slideButton.prototype.parseQueryString=function(b){var a=getQueryVariable(b,"mouse_mode");if(a=="slide"){this.setSelected(true)}};slideButton.prototype.getQueryString=function(){var a=null;if(this.selected&&!this.initiallySelected){a="mouse_mode=slide"}return a};function elevateButton(a,c,b){toolbarRadioButton.call(this,a,c,b);this.status="Elevate the camera perpendicular to the ground plane";this.helpMessage="This button sets the mouse mode to elevate mode.";return this}elevateButton.prototype=new toolbarRadioButton();elevateButton.prototype.onLoad=function(){this.cursor=new HCIcon("elevate_cursor.png","center","middle");this.parent.parent.applet.loadIcon(this.cursor)};elevateButton.prototype.onSelect=function(){this.parent.parent.applet.beginMessages();toolbarRadioButton.prototype.onSelect.call(this);if(this.parent.parent.cameraToolbar){if(this.parent.parent.cameraToolbar.previousButton){if(this.parent.parent.cameraToolbar.previousButton!=null){this.parent.parent.cameraToolbar.previousButton.setEnabled(true)}}}this.parent.parent.applet.setMouseMode("left","elevate",this.cursor);this.parent.parent.applet.setMouseMode("middle","look_around",this.parent.lookAroundButton.cursor);var b=16;var a=this;this.shiftKeyDownListener=HCEvent.addListener(this,"keydown",function(){a.parent.parent.applet.setMouseMode("left","slide",a.parent.slideButton.cursor)},b);this.shiftKeyUpListener=HCEvent.addListener(this,"keyup",function(){a.parent.parent.applet.setMouseMode("left","elevate",a.cursor)},b);this.parent.parent.applet.endMessages()};elevateButton.prototype.onDeselect=function(){this.parent.parent.applet.setMouseMode("middle","orbit",this.parent.parent.cameraToolbar.orbitButton.cursor);HCEvent.removeListener(this.shiftKeyDownListener);HCEvent.removeListener(this.shiftKeyUpListener);toolbarRadioButton.prototype.onDeselect.call(this)};elevateButton.prototype.onMouseDown=function(){setStatus("Click and drag to elevate, Shift = slide");toolbarRadioButton.prototype.onMouseDown.call(this)};elevateButton.prototype.parseQueryString=function(b){var a=getQueryVariable(b,"mouse_mode");if(a=="elevate"){this.setSelected(true)}};elevateButton.prototype.getQueryString=function(){var a=null;if(this.selected&&!this.initiallySelected){a="mouse_mode=elevate"}return a};function slideShow(a){this.parent=a;this.paused=false;this.interfaceChange=null;this.pageChange=null;return this}slideShow.prototype.onUnload=function(){if(this.pageChange!=undefined){window.clearTimeout(this.pageChange)}};slideShow.prototype.cancel=function(){if(this.interfaceChange!=null){window.clearTimeout(this.interfaceChange);this.interfaceChange=null}if(this.pageChange!=null){window.clearTimeout(this.pageChange);this.pageChange=null}};slideShow.prototype.play=function(a){this.paused=false;this.cancel();if(!this.parent.parent.parent.applet.loopSlideShow&&this.parent.parent.parent.pageToolbar.isLastPage()){this.parent.parent.parent.walkThroughToolbar.slideShowButton.setSelected(false);return}if(this.parent.parent.parent.perspectiveToolbar){this.parent.parent.parent.perspectiveToolbar.setEnabled(false)}a=this.parent.parent.parent.pageToolbar.getNextPage();this.parent.parent.parent.pageToolbar.setPage(a);var b=(this.parent.parent.parent.applet.slideTime+this.parent.parent.parent.applet.transitionTime)*1000;this.pageChange=window.setTimeout("HCApplet.getAppletById('"+this.parent.parent.parent.applet.id+"').parent.walkThroughToolbar.slideShowButton.slideShow.play()",b)};slideShow.prototype.pause=function(){this.cancel();this.paused=true;this.parent.parent.parent.applet.stopZoom();if(this.parent.parent.parent.perspectiveToolbar){this.parent.parent.parent.perspectiveToolbar.setEnabled(true)}};function slideShowButton(a,c,b){toolbarRadioButton.call(this,a,c,b,true);this.status="Show tour guide slide show";this.helpMessage="This button toggles the tour guide slide show.";this.slideShow=new slideShow(this);return this}slideShowButton.prototype=new toolbarRadioButton();slideShowButton.prototype.onLoad=function(){this.setEnabled(this.parent.parent.applet.pageNames.length>1)};slideShowButton.prototype.onUnload=function(){this.slideShow.onUnload()};slideShowButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.setMouseMode("left","none",null);this.slideShow.play(this.parent.parent.pageToolbar.getPage())};slideShowButton.prototype.onDeselect=function(){toolbarRadioButton.prototype.onDeselect.call(this);this.slideShow.pause()};slideShowButton.prototype.parseQueryString=function(b){var a=getQueryVariable(b,"slide_show");if(a!=undefined){this.setSelected(a=="true")}};slideShowButton.prototype.getQueryString=function(){var a=null;if(this.selected&&!this.initiallySelected){a="slide_show="+this.selected}return a};function walkThroughToolbar(b,a,d,c){toolbar.call(this,b,null,c);this.walkButton=new walkButton("walkButton",a,this);this.lookAroundButton=new lookAroundButton("lookAroundButton",a,this);this.positionCameraButton=new positionCameraButton("positionCameraButton",a,this);this.slideButton=new slideButton("slideButton",a,this);this.elevateButton=new elevateButton("elevateButton",a,this);if(d){this.slideShowButton=new popupSlideShowButton("slideShowButton",a,this,true)}else{this.slideShowButton=new slideShowButton("slideShowButton",a,this,true)}this.slideShowButton.setEnabled(false);return this}walkThroughToolbar.prototype=new toolbar();function orthographicButton(a,c,b){toolbarRadioButton.call(this,a,c,b);this.status="Display the sketch without perspepctive";this.helpMessage="This button disables perspective display.";return this}orthographicButton.prototype=new toolbarRadioButton();orthographicButton.prototype.onLoad=function(){if(!this.parent.parent.applet.camera.perspective){toolbarRadioButton.prototype.onSelect.call(this)}};orthographicButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.camera.perspective=false;this.parent.parent.applet.setCamera(this.parent.parent.applet.camera);if(this.parent.parent.cameraToolbar){if(this.parent.parent.cameraToolbar.zoomButton.selected){this.parent.parent.applet.setMouseMode("left","zoom_fov",this.parent.parent.cameraToolbar.zoomButton.cursor)}if(this.parent.parent.cameraToolbar.zoomWindowButton.selected){this.parent.parent.applet.setMouseMode("left","zoom_window_fov",this.parent.parent.cameraToolbar.zoomWindowButton.cursor)}}};function perspectiveButton(a,c,b){toolbarRadioButton.call(this,a,c,b);this.status="Display the sketch with perspective";this.helpMessage="This button enables perspective display.";return this}perspectiveButton.prototype=new toolbarRadioButton();perspectiveButton.prototype.onLoad=function(){if(this.parent.parent.applet.camera.perspective){toolbarRadioButton.prototype.onSelect.call(this)}};perspectiveButton.prototype.onSelect=function(){toolbarRadioButton.prototype.onSelect.call(this);this.parent.parent.applet.camera.perspective=true;this.parent.parent.applet.setCamera(this.parent.parent.applet.camera);if(this.parent.parent.cameraToolbar){if(this.parent.parent.cameraToolbar.zoomButton.selected){this.parent.parent.applet.setMouseMode("left","zoom",this.parent.parent.cameraToolbar.zoomButton.cursor)}if(this.parent.parent.cameraToolbar.zoomWindowButton.selected){this.parent.parent.applet.setMouseMode("left","zoom_window",this.parent.parent.cameraToolbar.zoomWindowButton.cursor)}}};function perspectiveToolbar(a,b){toolbar.call(this,a,null,b);var c=new radioButtonGroup();this.orthographicButton=new orthographicButton("orthographicButton",c,this);this.perspectiveButton=new perspectiveButton("perspectiveButton",c,this);return this}perspectiveToolbar.prototype=new toolbar();perspectiveToolbar.prototype.onLoad=function(){toolbar.prototype.onLoad.call(this);var a=this;this.parent.applet.setCallback("perspective",function(b){a.setPerspective(b)})};perspectiveToolbar.prototype.setPerspective=function(a){if(a){this.perspectiveButton.setSelected(true)}else{this.orthographicButton.setSelected(true)}};perspectiveToolbar.prototype.setEnabled=function(a){this.perspectiveButton.group.setEnabled(a)};function sectionPlanesButton(a,b){toolbarToggleButton.call(this,a,b);this.status="Toggle section planes display on and off";this.helpMessage="This button toggles the display of section planes.";return this}sectionPlanesButton.prototype=new toolbarToggleButton();sectionPlanesButton.prototype.onLoad=function(){toolbarToggleButton.prototype.setSelected.call(this,this.parent.parent.applet.sectionPlanes);var a=this;this.parent.parent.applet.setCallback("section_planes",function(b){a.setSelected(b)})};sectionPlanesButton.prototype.onSelect=function(){this.parent.parent.applet.setSectionPlanes(true);toolbarToggleButton.prototype.onSelect.call(this)};sectionPlanesButton.prototype.onDeselect=function(){this.parent.parent.applet.setSectionPlanes(false);toolbarToggleButton.prototype.onDeselect.call(this)};sectionPlanesButton.prototype.parseQueryString=function(b){var a=getQueryVariable(b,"section_planes");if(a!=undefined){this.setSelected(a=="true")}};sectionPlanesButton.prototype.getQueryString=function(){var a=null;if(this.selected!=this.initiallySelected){a="section_planes=true"}return a};function sectionCutsButton(a,b){toolbarToggleButton.call(this,a,b);this.status="Toggle section cuts display on and off";this.helpMessage="This button toggles the display of section cuts.";return this}sectionCutsButton.prototype=new toolbarToggleButton();sectionCutsButton.prototype.onLoad=function(){toolbarToggleButton.prototype.setSelected.call(this,this.parent.parent.applet.sectionCuts);var a=this;this.parent.parent.applet.setCallback("section_cuts",function(b){a.setSelected(b)})};sectionCutsButton.prototype.onSelect=function(){this.parent.parent.applet.setSectionCuts(true);toolbarToggleButton.prototype.onSelect.call(this)};sectionCutsButton.prototype.onDeselect=function(){this.parent.parent.applet.setSectionCuts(false);toolbarToggleButton.prototype.onDeselect.call(this)};sectionCutsButton.prototype.parseQueryString=function(b){var a=getQueryVariable(b,"section_cuts");if(a!=undefined){this.setSelected(a=="true")}};sectionCutsButton.prototype.getQueryString=function(){var a=null;if(this.selected!=this.initiallySelected){a="section_cuts=true"}return a};function sectionPlanesToolbar(a,b){toolbar.call(this,a,null,b);this.sectionPlanesButton=new sectionPlanesButton("sectionPlanesButton",this);this.sectionCutsButton=new sectionCutsButton("sectionCutsButton",this);return this}sectionPlanesToolbar.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.connectionInfo.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 HCSketchUpCamera(a,d,b,c){this.eye=a;this.lookAt=d;this.fov=b;this.perspective=c;return this}HCSketchUpCamera.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.perspective==a.perspective))}}};HCSketchUpCamera.prototype.duplicate=function(){return new HCSketchUpCamera(this.eye,this.lookAt,this.fov,this.perspective)};HCSketchUpCamera.prototype.parseQueryString=function(a){var e=getQueryVariable(a,"eye");if(e!=undefined){var f=e.split(",");var k=parseFloat(f[0]);var h=parseFloat(f[1]);var g=parseFloat(f[2]);this.eye=new HCVector3(k,h,g)}var b=getQueryVariable(a,"lookat");if(b!=undefined){var f=b.split(",");var k=parseFloat(f[0]);var h=parseFloat(f[1]);var g=parseFloat(f[2]);this.lookAt=new HCVector3(k,h,g)}var d=getQueryVariable(a,"fov");if(d!=undefined){this.fov=parseFloat(d)}var c=getQueryVariable(a,"perspective");if(c!=undefined){this.perspective=(c=="true")}};HCSketchUpCamera.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.perspective!=undefined){a=addQueryString(a,"perspective="+this.perspective)}return a};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 n=getQueryVariables(b,"marker");if(n!=undefined){for(var e=0;e<n.length;e++){var g=n[e].split(",");var l=parseFloat(g[0]);var k=parseFloat(g[1]);var h=parseFloat(g[2]);var m=new HCVector3(l,k,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(m,this.icons.getNextIcon(),c);this.addOverlay(d,f);if(a){d.url=a}}}};HCMarkUp.prototype.parseNoteQueryString=function(a){var m=getQueryVariables(a,"note");if(m!=undefined){for(var c=0;c<m.length;c++){var f=m[c].split(",");var k=parseFloat(f[0]);var h=parseFloat(f[1]);var g=parseFloat(f[2]);var l=new HCVector3(k,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(l,this.applet.parent.annotationToolbar.addStickyNoteButton.icon);this.addOverlay(b,d);b.note=e}}};HCMarkUp.prototype.parseLineQueryString=function(a){var m=getQueryVariables(a,"line");if(m!=undefined){for(var c=0;c<m.length;c++){var h=m[c].split(",");var f=Math.floor(h.length/3);var e=new Array(f);for(var c=0;c<e.length;c++){var l=parseFloat(h[c*3]);var k=parseFloat(h[c*3+1]);var g=parseFloat(h[c*3+2]);e[c]=new HCVector3(l,k,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 n=getQueryVariables(a,"curve");if(n!=undefined){for(var c=0;c<n.length;c++){var h=n[c].split(",");var f=Math.floor(h.length/3);var e=new Array(f);var l=5;for(var c=0;c<e.length;c++){var m=parseFloat(h[c*3]);var k=parseFloat(h[c*3+1]);var g=parseFloat(h[c*3+2]);e[c]=new HCVector3(m,k,g)}if(h[f*3]){var d=parseInt(h[f*3])}else{var d=0}var b=this.applet.getPaintColor();this.addOverlay(new HCCurve(l,e,b),d)}}};HCMarkUp.prototype.parseTextQueryString=function(a){var l=getQueryVariables(a,"text");if(l!=undefined){for(var c=0;c<l.length;c++){var e=l[c].split(",");var m=URLToText(e[0]);var h=parseFloat(e[1]);var g=parseFloat(e[2]);var f=parseFloat(e[3]);var k=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(m,k,b),d,"HCMarkUp.getMarkUpById('"+this.applet.id+"').changeText")}}};HCMarkUp.prototype.parseLabelQueryString=function(b){var p=getQueryVariables(b,"label");if(p!=undefined){for(var g=0;g<p.length;g++){var k=p[g].split(",");var q=URLToText(k[0]);var c=parseFloat(k[1]);var m=parseFloat(k[2]);var f=parseFloat(k[3]);var a=parseFloat(k[4]);var l=parseFloat(k[5]);var e=parseFloat(k[6]);var o=new HCVector3(c,m,f);var n=new HCVector3(a,l,e);if(k[7]){var h=parseInt(k[7])}else{var h=0}var d=this.applet.getPaintColor();this.addOverlay(new HCLabel(q,o,n,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","bottom");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 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.fonts=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(b,d,f){var e="-add_text";if(typeof(b.text)=="string"){e+=" "+getQuotatedString(b.text)}else{if(typeof(b.text)=="object"){for(var c=0;c<b.text.length;c++){e+=" "+getQuotatedString(b.text[c])}}}e+=" "+b.location.x+" "+b.location.y+" "+b.location.z;e+=" "+b.hAlignment+" "+b.vAlignment;if(b.font){if(!b.font.loaded){this.loadFont(b.font)}var a=b.font.index+1}else{var a=0}e+=" "+a;if(d){e+=" "+d}else{if(f||b.attributes!=undefined){e+=" "+0}}if(f||b.attributes!=undefined){e+=" "+f}if(b.attributes!=undefined){for(var c=0;c<b.attributes.length;c++){e+=" "+b.attributes[c]}}this.sendMessage(e);b.visible=true};HCMarkUpApplet.prototype.addLabel=function(b,d,f){var e="-add_label";if(typeof(b.text)=="string"){e+=" "+getQuotatedString(b.text)}else{if(typeof(b.text)=="object"){for(var c=0;c<b.text.length;c++){e+=" "+getQuotatedString(b.text[c])}}}e+=" "+b.anchorPoint.x+" "+b.anchorPoint.y+" "+b.anchorPoint.z;e+=" "+b.location.x+" "+b.location.y+" "+b.location.z;if(b.font){if(!b.font.loaded){this.loadFont(b.font)}var a=b.font.index+1}else{var a=0}e+=" "+a;if(d){e+=" "+d}else{if(f||b.attributes!=undefined){e+=" "+0}}if(f||b.attributes!=undefined){e+=" "+f}if(b.attributes!=undefined){for(var c=0;c<b.attributes.length;c++){e+=" "+b.attributes[c]}}this.sendMessage(e);b.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.loadFont=function(a){if(a.loaded){return}a.index=this.fonts.length;this.fonts[a.index]=a;this.sendMessage("-add_font '"+a.name+"' "+a.size+" "+a.bold+" "+a.italic);a.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 HCSketchUpApplet(c,b,e,a,d){if(!c){return this}this.camera=new HCSketchUpCamera();this.pageNames=new Array();this.pageIndex=0;this.layerNames=new Array();this.layerVisibility=new Array();this.transitionTime=1.5;this.slideTime=1;this.numSectionPlanes=0;this.sectionPlaneOrigins=new Array();this.sectionPlaneNormals=new Array();this.mouseModes=new Array();this.mouseListeners=new Array();this.connection="free";this.collaboration="disconnected";this.callbacks=new Array();if(a){a+="; "}a+="-get "+arrayToString(HCSketchUpApplet.attributeNames," ");HCMarkUpApplet.call(this,c,b,e,a,d);return this}HCSketchUpApplet.prototype=new HCMarkUpApplet();HCSketchUpApplet.prototype.setCamera=function(a){if(a.eye){this.camera.eye=a.eye;this.view=undefined;this.sendMessage("-eye "+a.eye.x+" "+a.eye.y+" "+a.eye.z)}if(a.lookAt){this.camera.lookAt=a.lookAt;this.view=undefined;this.sendMessage("-lookat "+a.lookAt.x+" "+a.lookAt.y+" "+a.lookAt.z)}if(a.fov){this.camera.fov=a.fov;this.view=undefined;this.sendMessage("-fov "+a.fov)}if(a.perspective!=undefined){this.camera.perspective=a.perspective;this.view=undefined;this.sendMessage("-perspective "+a.perspective);this.getAttributes(["eye","lookat","fov","perspective"])}};HCSketchUpApplet.prototype.setView=function(a){if(!inArray(a,HCSketchUpApplet.views)){return}if(!inArray(a,["iso","previous","auto"])){this.view=a}else{this.view=undefined}this.sendMessage("-view "+a+" 0");this.getAttributes(["eye","lookat","fov"])};HCSketchUpApplet.prototype.setDisplayMode=function(a){if(a==this.displayMode||!inArray(a,HCSketchUpApplet.displayModes)){return}this.displayMode=a;this.sendMessage("-display_mode "+a)};HCSketchUpApplet.prototype.setTexture=function(a){if(a==this.texture){return}this.texture=a;this.sendMessage("-texture "+a)};HCSketchUpApplet.prototype.setXRayMode=function(a){if(a==this.xRayMode){return}this.xRayMode=a;this.sendMessage("-x_ray "+a)};HCSketchUpApplet.prototype.setShowEdges=function(a){if(a==this.showEdges){return}this.showEdges=a;this.sendMessage("-edges "+a)};HCSketchUpApplet.prototype.setShowProfileEdges=function(a){if(a==this.showProfileEdges){return}this.showProfileEdges=a;this.sendMessage("-profile_edges "+a)};HCSketchUpApplet.prototype.setSilhouetteWidth=function(a){if(a==this.silhouetteWidth){return}this.sendMessage("-silhouette_width "+a)};HCSketchUpApplet.prototype.setAntialiasing=function(a){if(a==this.antialiasing){return}this.antialiasing=a;this.sendMessage("-antialiasing "+a)};HCSketchUpApplet.prototype.setAxes=function(a){if(a==this.showAxes){return}this.showAxes=a;this.sendMessage("-axes "+a)};HCSketchUpApplet.prototype.setSectionPlanes=function(a){if(a==this.sectionPlanes){return}this.sectionPlanes=a;this.sendMessage("-section_planes "+a)};HCSketchUpApplet.prototype.setSectionCuts=function(a){if(a==this.sectionCuts){return}this.sectionCuts=a;this.sendMessage("-section_cuts "+a)};HCSketchUpApplet.prototype.setPage=function(b,a){if(a==undefined){a=this.transitionTime}this.sendMessage("-page "+b+" "+a);this.zoomTimeout=setTimeout("HCApplet.getAppletById('"+this.parent.applet.id+"').setView('"+this.pageNames[b-1]+"')",a*1000)};HCSketchUpApplet.prototype.getPageIndex=function(){return this.pageIndex};HCSketchUpApplet.prototype.getPageName=function(a){return this.pageNames[a-1]};HCSketchUpApplet.prototype.setLayerVisible=function(a,b){this.layerVisibility[a]=b;if(b){b="visible"}else{b="invisible"}this.sendMessage("-layer "+(a+1)+" "+b)};HCSketchUpApplet.prototype.toggleLayerVisible=function(a){this.layerVisibility[a]=!this.layerVisibility[a];this.setLayerVisible(a,this.layerVisibility[a])};HCSketchUpApplet.prototype.getLayerIndex=function(a){for(var b=0;b<this.layerNames.length;b++){if(this.layerNames[b]==a){return b}}return undefined};HCSketchUpApplet.prototype.addLayer=function(a,c){var b=this.layerNames.length;this.layerNames[b]=a;this.layerVisibility[b]=c;this.sendMessage("-layer "+(b+1)+" "+c)};HCSketchUpApplet.prototype.getLayers=function(){return this.layerNames.length};HCSketchUpApplet.prototype.setTransitionTime=function(a){this.transitionTime=a};HCSketchUpApplet.prototype.setSlideTime=function(a){this.slideTime=a};HCSketchUpApplet.prototype.stopZoom=function(){this.sendMessage("-stop");window.clearTimeout(this.zoomTimeout);this.view=undefined;this.getAttributes(["eye","lookat","fov"])};HCSketchUpApplet.prototype.addSectionPlane=function(a,b){this.sectionPlaneOrigins[this.numSectionPlanes]=a;this.sectionPlaneNormals[this.numSectionPlanes]=b;this.numSectionPlanes++;this.sendMessage("-add_section_plane "+a.x+" "+a.y+" "+a.z+" "+b.x+" "+b.y+" "+b.z)};HCSketchUpApplet.prototype.setBackgroundColor=function(a){if(a.matches(this.backgroundColor)){return}this.backgroundColor=a;this.sendMessage("-background_color "+Math.floor(a.red)+" "+Math.floor(a.green)+" "+Math.floor(a.blue))};HCSketchUpApplet.prototype.setConstructionColor=function(a){if(a.matches(this.constructionColor)){return}this.constructionColor=a;this.sendMessage("-construction_color "+Math.floor(a.red)+" "+Math.floor(a.green)+" "+Math.floor(a.blue))};HCSketchUpApplet.prototype.setFaceBackColor=function(a){if(a.matches(this.faceBackColor)){return}this.faceBackColor=a;this.sendMessage("-face_back_color "+Math.floor(a.red)+" "+Math.floor(a.green)+" "+Math.floor(a.blue))};HCSketchUpApplet.prototype.setFaceFrontColor=function(a){if(a.matches(this.faceFrontColor)){return}this.faceFrontColor=a;this.sendMessage("-face_front_color "+Math.floor(a.red)+" "+Math.floor(a.green)+" "+Math.floor(a.blue))};HCSketchUpApplet.prototype.setHighlightColor=function(a){if(a.matches(this.highlightColor)){return}this.highlightColor=a;this.sendMessage("-highlight_color "+Math.floor(a.red)+" "+Math.floor(a.green)+" "+Math.floor(a.blue))};HCSketchUpApplet.prototype.setLockedColor=function(a){if(a.matches(this.lockedColor)){return}this.lockedColor=a;this.sendMessage("-locked_color "+Math.floor(a.red)+" "+Math.floor(a.green)+" "+Math.floor(a.blue))};HCSketchUpApplet.prototype.setShadows=function(a){if(a==this.shadows){return}this.shadows=a;this.sendMessage("-shadows "+a)};HCSketchUpApplet.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")}}};HCSketchUpApplet.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))};HCSketchUpApplet.prototype.setLightColor=function(a){if(a.matches(this.lightColor)){return}this.lightColor=a;this.sendMessage("-light_color "+a.red.toFixed(3)+" "+a.green.toFixed(3)+" "+a.blue.toFixed(3))};HCSketchUpApplet.prototype.setBrightness=function(a){if(a==this.brightness){return}this.brightness=a;this.sendMessage("-brightness "+a.toFixed(3))};HCSketchUpApplet.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))};HCSketchUpApplet.prototype.setMouseMode=function(c,f,d,e){this.mouseModes[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,HCSketchUpApplet.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,["orbit","pan","zoom","walk","run","move","slide","elevate"])){this.mouseListeners[c]=HCEvent.addListener(this,"mouseup",function(){a.setView(undefined);a.getAttributes(["eye","lookat"])},c)}else{if(f=="zoom_fov"){this.mouseListeners[c]=HCEvent.addListener(this,"mouseup",function(){a.setView(undefined);a.getAttribute("fov")},c)}else{if(f=="look_around"){this.mouseListeners[c]=HCEvent.addListener(this,"mouseup",function(){a.setView(undefined);a.getAttribute("lookat")},c)}}}};HCSketchUpApplet.prototype.setCollisionDetection=function(a){if(a==this.collisionDetection){return}this.collisionDetection=a;this.sendMessage("-collision_detection "+a)};HCSketchUpApplet.prototype.loadSound=function(a){if(a&&a!=undefined&&a!=""){this.sendMessage("-load_sound "+a)}};HCSketchUpApplet.prototype.playSound=function(a){if(a&&a!=undefined&&a!=""){this.sendMessage("-play_sound "+a)}};HCSketchUpApplet.prototype.connect=function(c,a){var b="-connect";if(c!=undefined){b+=" "+c}if(a!=undefined){b+=" "+a}this.sendMessage(b)};HCSketchUpApplet.prototype.setCollaborationMode=function(a){if(inArray(a,["lead","follow","free"])){this.sendMessage("-collaboration "+a)}};HCSketchUpApplet.prototype.disconnect=function(a){this.sendMessage("-disconnect")};HCSketchUpApplet.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=="perspective"){this.camera.perspective=b}else{if(a=="view"){this.view=b}else{if(a=="display_mode"){this.displayMode=b}else{if(a=="texture"){this.texture=b}else{if(a=="x_ray"){this.xRayMode=b}else{if(a=="edges"){this.showEdges=b}else{if(a=="profile_edges"){this.showProfileEdges=b}else{if(a=="silhouette_width"){this.silhouetteWidth=b}else{if(a=="axes"){this.showAxes=b}else{if(a=="section_planes"){this.sectionPlanes=b}else{if(a=="section_cuts"){this.sectionCuts=b}else{if(a=="antialiasing"){this.antialising=b}else{if(a=="pages"){this.pageNames=URLsToStrings(b)}else{if(a=="page"){this.pageIndex=b}else{if(a=="layers"){this.layerNames=URLsToStrings(b)}else{if(a=="layer_visibility"){this.layerVisibility=b}else{if(a=="transition_time"){this.transitionTime=b}else{if(a=="slide_time"){this.slideTime=b}else{if(a=="loop_slide_show"){this.loopSlideShow=b}else{if(a=="units"){this.units=b}else{if(a=="shadows"){this.shadows=b}else{if(a=="light_direction"){this.lightDirection=b}else{if(a=="light_coords"){this.lightCoords=b}else{if(a=="light_color"){this.lightColor=b}else{if(a=="brightness"){this.brightness=b}else{if(a=="ambient"){this.ambient=b}else{if(a=="city"){this.city=b}else{if(a=="country"){this.country=b}else{if(a=="latitude"){this.latitude=b}else{if(a=="longitude"){this.longitude=b}else{if(a=="angle"){this.angle=b}else{if(a=="time_zone_offset"){this.timeZoneOffset=b}else{if(a=="background_color"){this.backgroundColor=b}else{if(a=="construction_color"){this.constructionColor=b}else{if(a=="face_back_color"){this.faceBackColor=b}else{if(a=="face_front_color"){this.faceFrontColor=b}else{if(a=="highlight_color"){this.highlightColor=b}else{if(a=="locked_color"){this.lockedColor=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.callbacks[a]!=undefined){this.callbacks[a](b)}};HCSketchUpApplet.prototype.setCallback=function(a,b){this.callbacks[a]=b};HCSketchUpApplet.prototype.getAttribute=function(a){this.sendMessage("-get "+a)};HCSketchUpApplet.prototype.getAttributes=function(c){var a="";for(var b=0;b<c.length;b++){if(b!=0){a+=" "}a+=c[b]}this.sendMessage("-get "+a)};HCSketchUpApplet.mouseModes=["draw_line","freehand","tape_measure","place_text","orbit","pan","zoom","zoom_fov","zoom_window","zoom_window_fov","walk","run","move","look_around","position_camera","slide","elevate","none"];HCSketchUpApplet.views=["iso","top","front","right","back","left","previous","auto"];HCSketchUpApplet.displayModes=["wireframe","hidden_line","monochrome","shaded"];HCSketchUpApplet.attributeNames=["eye","lookat","fov","perspective","view","texture","display_mode","x_ray","edges","profile_edges","silhouette_width","axes","section_planes","section_cuts","antialiasing","pages","page","layers","layer_visibility","transition_time","slide_time","loop_slide_show","units","shadows","light_direction","light_coords","light_color","brightness","ambient","city","country","latitude","longitude","angle","offset","background_color","construction_color","face_back_color","face_front_color","highlight_color","locked_color"];HCSketchUpApplet.pageAttributeNames=["eye","lookat","fov","perspective","view","texture","display_mode","x_ray","edges","profile_edges","silhouette_width","axes","section_planes","section_cuts","antialiasing","layer_visibility","shadows","light_direction","light_coords","light_color","brightness","ambient",];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,k){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,k,e)}}else{a.handler(c,k,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 HCSketchUpInterface(d,c,b,e,f){if(!d){return this}container.call(this,d);if(b==undefined){b=""}if(e==undefined){e=null}if(f==undefined){f=""}if(f&&(f[f.length-1]!="/")){f+="/"}if(b==""){b="-wait_for_messages"}else{b="-wait_for_messages; "+b}this.element=d;this.appletSrc=c;this.commandLine=b;this.pageSoundNames=e;this.path=f;this.windowBaseLocation=getBaseLocation(getWindowLocation());HCSketchUpInterface.interfaceIndices[d]=HCSketchUpInterface.interfaces.length;HCSketchUpInterface.interfaces[HCSketchUpInterface.interfaces.length]=this;var a=this;addEvent(window,"load",function(){a.applet=new HCSketchUpApplet("applet",a.appletSrc,a.getResources(a.path+"applet/resources"),a.commandLine,a);a.applet.onload=function(){a.applet.beginMessages();a.onLoad();a.applet.endMessages()}});addEvent(window,"unload",function(){a.onUnload()});return this}HCSketchUpInterface.prototype=new container();HCSketchUpInterface.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"]};HCSketchUpInterface.prototype.onLoad=function(){if(this.loaded){return}this.applet.setMouseMode("left","none");this.applet.setMouseMode("middle","none");this.applet.setMouseMode("right","none");this.componentGroup.call("onLoad");if(this.onload){this.onload()}this.onStart();this.loaded=true};HCSketchUpInterface.prototype.onStart=function(){this.initialCamera=this.applet.camera.duplicate();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};HCSketchUpInterface.prototype.onUnload=function(){if(this.timeout!=undefined){window.clearTimeout(this.timeout)}this.componentGroup.call("onUnload")};HCSketchUpInterface.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 HCSketchUpCamera();b.parseQueryString(c);this.applet.setCamera(b)};HCSketchUpInterface.prototype.getQueryString=function(){var b=null;if(HCApplet.applets.length>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==undefined){if(!this.applet.camera.equals(this.initialCamera)){b=addQueryString(b,this.applet.camera.getQueryString())}}return b};HCSketchUpInterface.prototype.setQueryString=function(a){if(a){setWindowLocation(this.windowBaseLocation+"?"+a)}else{setWindowLocation(this.windowBaseLocation)}};HCSketchUpInterface.getInterfaceById=function(a){return this.getInterfaceByIndex(HCSketchUpInterface.interfaceIndices[a])};HCSketchUpInterface.getInterfaceByIndex=function(a){return HCSketchUpInterface.interfaces[a]};HCSketchUpInterface.interfaces=new Array();HCSketchUpInterface.interfaceIndices=new Array();function HCSketchUpStandardWithMapsInterface(d,c,a,e,f){if(!d){return this}HCSketchUpInterface.call(this,d,c,a,e,f);var b=new radioButtonGroup();this.internetToolbar=new internetToolbar("internetToolbar",this);this.standardToolbar=new standardToolbar("standardToolbar",this);this.pageToolbar=new pageTabs("pageTabs",this.path,this.pageSoundNames,this);this.layersToolbar=new layersToolbar("layersToolbar",this);this.viewsToolbar=new viewsToolbar("viewsToolbar",this);this.displayModeToolbar=new displayModeToolbar("displayModeToolbar",this);this.edgesToolbar=new edgesToolbar("edgesToolbar",this);this.shadowsToolbar=new shadowsToolbar("shadowsToolbar",this);this.mapsToolbar=new mapsToolbar("mapsToolbar",this);this.principalToolbar=new principalToolbar("principalToolbar",b,this);this.markUpToolbar=new markUpToolbar("markUpToolbar",b,this);this.annotationToolbar=new annotationToolbar("annotationToolbar",b,this);this.constructionToolbar=new constructionToolbar("constructionToolbar",b,this);this.cameraToolbar=new cameraToolbar("cameraToolbar",b,this);this.walkThroughToolbar=new walkThroughToolbar("walkThroughToolbar",b,false,this);this.perspectiveToolbar=new perspectiveToolbar("perspectiveToolbar",this);this.sectionPlanesToolbar=new sectionPlanesToolbar("sectionPlanesToolbar",this);this.collaborationToolbar=new collaborationToolbar("collaborationToolbar",this);this.toolsToolbar=new toolsToolbar("toolsToolbar",this);this.toolsToolbar.addToolbar(this.internetToolbar,"Internet");this.toolsToolbar.addToolbar(this.standardToolbar,"Standard");this.toolsToolbar.addToolbar(this.toolsToolbar,"Tools");this.toolsToolbar.addToolbar(this.viewsToolbar,"Views");this.toolsToolbar.addToolbar(this.layersToolbar,"Layers");this.toolsToolbar.addToolbar(this.displayModeToolbar,"Display Mode");this.toolsToolbar.addToolbar(this.edgesToolbar,"Edges");this.toolsToolbar.addToolbar(this.shadowsToolbar,"Lighting");this.toolsToolbar.addToolbar(this.mapsToolbar,"Maps");this.toolsToolbar.addToolbar(this.pageToolbar,"Pages");this.toolsToolbar.addToolbar(this.principalToolbar,"Principal");this.toolsToolbar.addToolbar(this.markUpToolbar,"MarkUp");this.toolsToolbar.addToolbar(this.annotationToolbar,"Annotation");this.toolsToolbar.addToolbar(this.constructionToolbar,"Construction");this.toolsToolbar.addToolbar(this.cameraToolbar,"Camera");this.toolsToolbar.addToolbar(this.walkThroughToolbar,"Walkthrough");this.toolsToolbar.addToolbar(this.perspectiveToolbar,"Perspective");this.toolsToolbar.addToolbar(this.sectionPlanesToolbar,"Section Planes");this.toolsToolbar.addToolbar(this.collaborationToolbar,"Collaboration");return this}HCSketchUpStandardWithMapsInterface.prototype=new HCSketchUpInterface();HCSketchUpStandardWithMapsInterface.prototype.getCursorResources=function(a){return["select_cursor.png, "+a+"/cursors/select_cursor.png","eraser_cursor.png, "+a+"/cursors/eraser_cursor.png","paint_cursor.png, "+a+"/cursors/paint_cursor.png","line_cursor.png, "+a+"/cursors/line_cursor.png","freehand_cursor.png, "+a+"/cursors/freehand_cursor.png","tape_measure_cursor.png, "+a+"/cursors/tape_measure_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","orbit_cursor.png, "+a+"/cursors/orbit_cursor.png","pan_cursor.png, "+a+"/cursors/pan_cursor.png","zoom_cursor.png, "+a+"/cursors/zoom_cursor.png","zoom_window_cursor.png, "+a+"/cursors/zoom_window_cursor.png","position_camera_cursor.png, "+a+"/cursors/position_camera_cursor.png","walk_cursor.png, "+a+"/cursors/walk_cursor.png","look_around_cursor.png, "+a+"/cursors/look_around_cursor.png","slide_cursor.png, "+a+"/cursors/slide_cursor.png","elevate_cursor.png, "+a+"/cursors/elevate_cursor.png"]};HCSketchUpStandardWithMapsInterface.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"]};HCSketchUpStandardWithMapsInterface.prototype.getResources=function(a){return HCSketchUpInterface.prototype.getResources.call(this,a).concat(HCSketchUpStandardWithMapsInterface.prototype.getCursorResources.call(this,a).concat(HCSketchUpStandardWithMapsInterface.prototype.getMarkerResources.call(this,a)))};HCSketchUpStandardWithMapsInterface.prototype.onLoad=function(){this.markUp=new HCMarkUp(this.applet,new RGBColor(255,0,0),new HCAlphabetIcons());HCSketchUpInterface.prototype.onLoad.call(this)};HCSketchUpStandardWithMapsInterface.prototype.onStart=function(){this.applet.setMouseMode("middle","orbit",this.cameraToolbar.orbitButton.cursor);this.cameraToolbar.orbitButton.setSelected(true);HCSketchUpInterface.prototype.onStart.call(this)};HCSketchUpStandardWithMapsInterface.prototype.parseSectionPlanesQueryString=function(a){var k=getQueryVariables(a,"section_plane");if(k!=undefined){for(var b=0;b<k.length;b++){var e=k[b].split(",");var g,f,d;g=parseFloat(e[0]);f=parseFloat(e[1]);d=parseFloat(e[2]);var h=new HCVector3(g,f,d);g=parseFloat(e[3]);f=parseFloat(e[4]);d=parseFloat(e[5]);var c=new HCVector3(g,f,d);this.applet.addSectionPlane(h,c)}}};HCSketchUpStandardWithMapsInterface.prototype.parseQueryString=function(a){this.markUp.parseQueryString(a);this.parseSectionPlanesQueryString(a);HCSketchUpInterface.prototype.parseQueryString.call(this,a)};HCSketchUpStandardWithMapsInterface.prototype.getQueryString=function(){var a=HCSketchUpInterface.prototype.getQueryString.call(this);return addQueryString(a,this.markUp.getQueryString())};