
 //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
 //                                                                        
 //  This file was created by rjc from system/js/ii_hotspots.js%
 //  on 2003/11/11 10:37:25.
 //                                                                        
 //    Copyright 1999-2003 Interactive Information Ltd, All Rights Reserved 
 //    http://information.overlaid.com
 //                                                                        
 //  It is almost certainly a bad idea to edit it.
 //  
 //  ------------------------------------------------------------------------
 //  
 //  Version:	2.3.1 for Grange Scrapbook
 //  Features:	VZERO HSPOPUP DATACOPYRIGHT LABEL LINEAR MAPPING
 //  Scales:	linear
 //  Hotspots:	rect poly circle
 //  Markers:	cross image paintable
 //  
 //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
var all_hotspots=[];var hotspot_named=[];var hotspot_for=[];function MapHotspot(name,klass,type,scale,shape)
{this.name=name;this.klass=klass;this.value=klass+"_"+name;this.type=type;
this.scale=scale;this.shape=shape;this.popup='';this.status='';
this.onSelect='';}function hotspots_add(name,klass,type,scale,shape)
{if(hotspot_named[klass]!=null){if(hotspot_named[klass][name]!=null)
{return null;}}else hotspot_named[klass]=[];var h=new MapHotspot(name,klass,type,scale,shape);
h.enabled=true;hotspot_named[klass][name]=h;hotspot_named[h.value]=h;
h.i=all_hotspots.length;all_hotspots[h.i]=h;return h;}function hotspots_hotspot_named(klass,name)
{var hs;if(klass=="static"){var spot=the_easel.getHotspot(name);
hs=hotspots_hotspot_displayed(spot);}else {if(hotspot_named[klass]==null)
return null;hs=hotspot_named[klass][name];}return hs;}function hotspots_hotspot_displayed(javahs)
{var hs=hotspot_for[javahs.getValue()+""];if(hs==null){hs=new MapHotspot(javahs.getValue()+"","static");
hs.spot=javahs;}return hs;}function hotspots_remove(hs){hotspot_named[hs.klass][hs.name]=null;
if(hs.spot!=null)the_easel.removeHotspot(hs.spot);var i;for(i=hs.i;i<all_hotspots.length-1;i++)
{all_hotspots[i]=all_hotspots[i+1];all_hotspots[i].i=i;}all_hotspots.length=all_hotspots.length-1;
}function hotspots_remove_byclass(klass){var i;for(i=0;i<all_hotspots.length;)
{var hs=all_hotspots[i];if(hs.klass==klass)hotspots_remove(hs);
else i++;}}function hotspots_activate(){the_easel.removeJsHotspots();
hotspot_for=[];var i;for(i=0;i<all_hotspots.length;i++){var hs=all_hotspots[i];
hs.spot=the_easel.addHotspot(hs.type,hs.shape,hs.scale,hs.value,
hs.popup,hs.status);hs.spot.setEnabled(hs.enabled?1:0);hs.sysid=hs.spot.sysid;
if(hs.visible!=null)hs.spot.visible=hs.visible;hotspot_for[hs.value]=hs;
}the_easel.makeHotspots();}function hotspots_deactivate(hs){if(hs.spot!=null)
the_easel.removeHotspot(hs);}function hotspots_enable(hs,onoff)
{var spot=hs.spot;hs.enabled=onoff;if(spot!=null)spot.setEnabled(onoff?1:0);
}function hotspots_set_visible(hs,onoff){var spot=hs.spot;hs.visible=onoff;
if(spot!=null)spot.visible=onoff;}function hotspots_set_popup(hs,p)
{hs.popup=p;}function hotspots_set_status(hs,s){hs.status=s;}
function hotspots_select(hs,val){the_easel.selectHotspot(hs.spot,hs.sysid,val);
}function hotspots_toggle(hs){the_easel.selectHotspot(hs.spot,hs.sysid,hs.spot.getSelected()+""-0==0);
}function hotspots_selected(hs){return hs.spot!=null&&(hs.spot.getSelected()+""-0!=0);
}function hotspots_zoom_to(hs){var r=hs.spot.getBounds();r=the_easel.screenRectToWorld(r);
var cx=Math.floor(r.x+r.width/2.0+0.5);var cy=Math.floor(r.y+r.height/2.0+0.5);
var w=Math.abs(r.width);var h=Math.abs(r.height);maps_goto(cx,cy,w,h);
}function hotspots_inside(hs,x,y,w,h){alert(x+","+y+","+w+","+h);
alert("inside "+hs.spot.inside_world(x,y,w,h));return hs.spot!=null&& hs.spot.inside_world(x,y,w,h);
}function hotspots_overlaps(hs,x,y,w,h){return hs.spot!=null&& hs.spot.overlaps_world(x,y,w,h);
}
