
 //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
 //                                                                        
 //  This file was created by rjc from system/js/ii_search.js%
 //  on 2002/11/03 01:20:43.
 //                                                                        
 //    Copyright 1999-2002 Interactive Information Ltd, All Rights Reserved 
 //    http://information.overlaid.com
 //                                                                        
 //  It is almost certainly a bad idea to edit it.
 //  
 //  ------------------------------------------------------------------------
 //  
 //  Version:	2.3.0 for Map Weasel
 //  Features:	SELECT HSPOPUP HSSTATUS BEANINFO NS IE OPERA BRIGHTEN LABEL DATACOPYRIGHT
 //  Scales:	linear latlong
 //  Hotspots:	rect poly
 //  Markers:	circle cross image
 //  
 //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
var search_on_form_show="";var search_highlight_entry;var search_record_map;
var search_record_area;var search_last_form_url="";var search_form_frame_name="";
var search_form_name="";var search_form_params="";var search_map_data_scale=1;
var search_marker_class="result";var search_rectangle=null;function search_form_frame_is()
{alert("No search_form_frame_is()defined");return null;}function search_form_is_showing(url)
{search_last_form_url=url;if(search_on_form_show!=""){setTimeout(search_on_form_show,1);
search_on_form_show="";}}var search_form_showing_hook=search_form_is_showing;
function search_form_showing(){var search_form_frame=search_form_frame_is();
var t=search_form_frame!=null;t=t&&!search_form_frame.closed;
t=t&&search_form_frame.document!=null;t=t&&search_form_frame.document.forms[0]!=null;
t=t&&search_form_frame.is_search_form;return t;}function search_show_form(sub)
{if(sub!=null&&sub)search_on_form_show="search_form_submit();";
else search_on_form_show="";var search_form_frame=search_form_frame_is();
if(search_form_showing()){search_form_is_showing(search_last_form_url);
}else if(search_last_form_url!="" &&(search_form_frame.is_results||search_form_frame.is_email!=null))
{search_form_frame.history.go(search_last_form_url);}else {var myFormParams=search_form_params;
if(myFormParams){myFormParams+="&";}else{myFormParams+="?";}search_form_frame.location.href=search_form_name+myFormParams;
}}function search_form_submit(){var search_form_frame=search_form_frame_is();
if(search_form_showing()){the_easel.trace("Searching the Database");
if(search_highlight_entry!=null)search_highlight_entry(null);
if(search_record_map!=null)search_record_map(current_mapset,current_level,current_cx,current_cy);
var rect=easel_get_area();if(search_record_area)search_record_area(rect);
var x,y,w,h;x=Math.floor(selected_x/search_map_data_scale);y=Math.floor(selected_y/search_map_data_scale);
w=Math.floor(selected_w/search_map_data_scale);h=Math.floor(selected_h/search_map_data_scale);
if(search_form_frame.document.forms[0].AreaX!=null){search_form_frame.document.forms[0].AreaX.value=x;
search_form_frame.document.forms[0].AreaY.value=y;}if(search_form_frame.document.forms[0].AreaX2!=null)
{search_form_frame.document.forms[0].AreaX2.value=x+w;search_form_frame.document.forms[0].AreaY2.value=y+h;
}if(search_form_frame.document.forms[0].AreaCX!=null){search_form_frame.document.forms[0].AreaCX.value=x+w/2;
search_form_frame.document.forms[0].AreaCY.value=y+h/2;}if(search_form_frame.document.forms[0].AreaW!=null)
{search_form_frame.document.forms[0].AreaW.value=w;search_form_frame.document.forms[0].AreaH.value=h;
}if(search_form_frame.document.forms[0].AreaName!=null){search_form_frame.document.forms[0].AreaName.value= current_mapset.myname +" "+current_level.myname;
}search_rectangle=rect;if(search_form_frame.document.forms[0].onsubmit!=null)
search_form_frame.document.forms[0].onsubmit();search_form_frame.document.forms[0].submit();
}else {search_show_form(true);}}function search_do_search(){if(!easel_page_ok())
return;markers_remove_byclass(search_marker_class);return search_form_submit();
}function search_start_results(){the_easel.notrace();}function search_add_marker(name,cx,cy,type,size,width)
{cx=Math.floor(cx * search_map_data_scale);cy=Math.floor(cy * search_map_data_scale);
var mk=markers_add(name,search_marker_class,cx,cy,type,size,width);
markers_display(mk);return mk;}function search_highlight(id){
var mk=null;if(marker_named[search_marker_class]!=null)mk=marker_named[search_marker_class][id];
if(mk!=null){markers_highlight(mk);if(search_highlight_entry!=null)
search_highlight_entry(mk);}}function search_goto_map(){easel_remove_area();
if(search_highlight_entry!=null)search_highlight_entry(null);
markers_remove_byclass(search_marker_class);search_show_form(false);
}

