<!--

var adjuster_boolean=false

var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
var ns6=document.getElementById&&!document.all
var ns4=document.layers

function showmenu(e,which,event_id){

if (!document.all&&!document.getElementById&&!document.layers)
return

if(adjuster_boolean==false)
    {
              adjuster_x=0
              adjuster_y=0
    }
//alert(adjuster_x)

clearhidemenu()

menuobj=ie4? document.all.popmenu : ns6? document.getElementById("popmenu") : ns4? document.popmenu : ""
menuobj.thestyle=(ie4||ns6)? menuobj.style : menuobj

if (ie4||ns6)
menuobj.innerHTML=which
else{
menuobj.document.write('<layer name=gui bgColor=#E6E6E6 width=165 onmouseover="clearhidemenu()" onmouseout="hidemenu()">'+which+'</layer>')  // 
menuobj.document.close()
}





/*   COMMENT OUT ENTIRE OLD POSITIONING/CHECKOFF SYSTEM */

menuobj.contentwidth=(ie4||ns6)? menuobj.offsetWidth : menuobj.document.gui.document.width
menuobj.contentheight=(ie4||ns6)? menuobj.offsetHeight : menuobj.document.gui.document.height
eventX=ie4? event.clientX : ns6? e.clientX : e.x
eventY=ie4? event.clientY : ns6? e.clientY : e.y

//Find out how close the mouse is to the corner of the window
var rightedge=ie4? document.body.clientWidth-eventX : window.innerWidth-eventX
var bottomedge=ie4? document.body.clientHeight-eventY : window.innerHeight-eventY

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<menuobj.contentwidth)
//move the horizontal position of the menu to the left by it's width
menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX-menuobj.contentwidth+adjuster_x : ns6? window.pageXOffset+eventX-menuobj.contentwidth+adjuster_x : eventX-menuobj.contentwidth+adjuster_x

/*    COMMENT OUT THIS ELSE
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX-adjuster_x : ns6? window.pageXOffset+eventX : eventX


//same concept with the vertical position
if (bottomedge<menuobj.contentheight && dynamic_move_boolean!=true)
{
//return;
// ???????????????????? Changed on 08/25/04   menuobj.thestyle.top=ie4? document.body.scrollTop+eventY-menuobj.contentheight : 
// ???????????????????? Changed on 08/25/04   ns6? window.pageYOffset+eventY-menuobj.contentheight : eventY-menuobj.contentheight
menuobj.thestyle.top=ie4? document.body.scrollTop : ns6? window.pageYOffset : eventY
//menuobj.thestyle.left=0
//IMPORTANT:::::: PREVIOUS LINE ACCOMODATES MENUS THAT EXTEND BELOW THE
//BOTTOM OF THE PAGE:::: NETSCAPE WILL NOT AUTOMATICALLY LENGTHEN THE WINDOW.INNERhEIGHT
}

*/






/*    COMMENT OUT THIS ELSE
else
menuobj.thestyle.top=ie4? document.body.scrollTop+event.clientY-adjuster_y : ns6? window.pageYOffset+eventY-adjuster_y  : eventY-adjuster_y 

*/


menuobj.thestyle.visibility="visible"    
return false;

//document.getElementById('inner_window_title').style.backgroundColor="yellow"
adjuster_boolean=false

}  //close showmenu() function





function contains_ns6(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function hidemenu(){
if (window.menuobj)
 {
   menuobj.thestyle.visibility=(ie4||ns6)? "hidden" : "hide"
 }
//place_circle();
}

function dynamichide(e){
if (ie4&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hidemenu()
}

function delayhidemenu(){
//if (ie4||ns6||ns4)
delayhide=setTimeout("hidemenu()",900);
}

function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
if (window.replace_to)
clearTimeout(replace_to)
if (window.show_to)
clearTimeout(show_to)
}

function highlightmenu(e,state){
if (document.all)
source_el=event.srcElement
//alert(source_el);
else if (document.getElementById)
source_el=e.target
//alert(source_el);
if (source_el.className=="menuitems"){
source_el.id=(state=="on")? "mouseoverstyle" : ""
}
else{
while(source_el.id!="popmenu"){
//alert("Here");
source_el=document.getElementById? source_el.parentNode : source_el.parentElement
if (source_el.className=="menuitems"){
source_el.id=(state=="on")? "mouseoverstyle" : ""
}
}
}
}

if (ie4||ns6)
//document.onclick=hidemenu










//  BELOW CAN BE USED TO CREATE A 'DRAGABLE' POPUP WINDOW...

/*********************************************************/
function just_move_menu(e,which){

if (!document.all&&!document.getElementById&&!document.layers)
return

if(adjuster_boolean==false)
    {
              adjuster_x=0
              adjuster_y=0
    }
//alert(adjuster_x)

clearhidemenu()

menuobj=ie4? document.all.popmenu : ns6? document.getElementById("popmenu") : ns4? document.popmenu : ""
menuobj.thestyle=(ie4||ns6)? menuobj.style : menuobj

/*
if (ie4||ns6)
menuobj.innerHTML=which
else{
menuobj.document.write('<layer name=gui bgColor=#E6E6E6 width=165 onmouseover="clearhidemenu()" onmouseout="hidemenu()">'+which+'</layer>')  // 
menuobj.document.close()
}

menuobj.contentwidth=(ie4||ns6)? menuobj.offsetWidth : menuobj.document.gui.document.width
menuobj.contentheight=(ie4||ns6)? menuobj.offsetHeight : menuobj.document.gui.document.height
*/

eventX=ie4? event.clientX : ns6? e.clientX : e.x
eventY=ie4? event.clientY : ns6? e.clientY : e.y



//Find out how close the mouse is to the corner of the window
var rightedge=ie4? document.body.clientWidth-eventX : window.innerWidth-eventX
var bottomedge=ie4? document.body.clientHeight-eventY : window.innerHeight-eventY

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<menuobj.contentwidth)
//move the horizontal position of the menu to the left by it's width
menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX-menuobj.contentwidth+adjuster_x : ns6? window.pageXOffset+eventX-menuobj.contentwidth+adjuster_x : eventX-menuobj.contentwidth+adjuster_x
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX-adjuster_x : ns6? window.pageXOffset+eventX : eventX

//same concept with the vertical position
if (bottomedge<menuobj.contentheight && dynamic_move_boolean!=true)
{
//return;
// ???????????????????? Changed on 08/25/04   menuobj.thestyle.top=ie4? document.body.scrollTop+eventY-menuobj.contentheight : 
// ???????????????????? Changed on 08/25/04   ns6? window.pageYOffset+eventY-menuobj.contentheight : eventY-menuobj.contentheight
menuobj.thestyle.top=ie4? document.body.scrollTop : ns6? window.pageYOffset : eventY
menuobj.thestyle.left=0
//IMPORTANT:::::: PREVIOUS LINE ACCOMODATES MENUS THAT EXTEND BELOW THE
//BOTTOM OF THE PAGE:::: NETSCAPE WILL NOT AUTOMATICALLY LENGTHEN THE WINDOW.INNERhEIGHT
}
else
menuobj.thestyle.top=ie4? document.body.scrollTop+event.clientY-adjuster_y : ns6? window.pageYOffset+eventY-adjuster_y  : eventY-adjuster_y 
menuobj.thestyle.visibility="visible"    
return false   

//document.getElementById('inner_window_title').style.backgroundColor="yellow"
adjuster_boolean=false

}  //close just_move_menu() function

/**************************************************/





dynamic_move_boolean=false
//document.all.popmenu.onmousedown=seewhatkey;

function seewhatkey()
  {
    //var keyCode = window.event.keyCode ? window.event.keyCode : event.which ? event.which : event.charCode;
    //  which = String.fromCharCode(keyCode) //toLowerCase();
    //alert(which + "," + keyCode)
              
    //if(keyCode==120 || keyCode==88 && keyCode!=null)
    //    {
    //  alert(dynamic_move_boolean)
    //  alert(document.getElementById('link_hidemenu').focus())
                          
    document.getElementById('inner_window_title').onmousedown=""
    dynamic_move_boolean=(dynamic_move_boolean)?false:true

      if(dynamic_move_boolean==true && document.all.popmenu.style.visibility=="visible")
       { 
         with (document.getElementById('inner_window_title'))
           {
            // style.backgroundColor="yellow"
            // style.color="black"
           } 

         event_2=(ns6)?evnt:event;
         xmouse=event_2.x
         ymouse=event_2.y
         //alert(xmouse+","+ymouse)
         xpopmenu=document.all.popmenu.offsetLeft  //.style.left
         ypopmenu=document.all.popmenu.offsetTop  //style.posTop  //style.top  offsetTop
         //alert((xpopmenu+","+ypopmenu))
         //alert(Math.abs((xmouse-xpopmenu)))
         //alert(Math.abs((ymouse-ypopmenu))) 
         adjuster_x=Math.abs((xmouse-xpopmenu))
         adjuster_y=Math.abs((ymouse-ypopmenu))
         
          if(adjuster_x>190 || adjuster_y>100)
            {
              adjuster_x=50
              adjuster_y=20
              //document.all.popmenu.style.left=xmouse //offsetLeft=xmouse
              //document.all.popmenu.style.top=ymouse //offsetTop=ymouse
            }
                                                   
         //document.getElementById('inner_window_title').onmousedown=""  //seewhatkey;  //popmenu.onmouseup=seewhatkey;
         //document.all.inner_window_title.onmouseup="";
         document.onkeypress=seewhatkey;
         (ns6)?window.onMouseMove=dynamic_move:document.onmousemove=dynamic_move;
                                               
         //(ns6)?window.onMouseMove=Mouse:document.onmousemove=Mouse;
                                  //Mouse;
       }
     
     else if(dynamic_move_boolean==false && document.all.popmenu.style.visibility=="visible")
       {
         // alert(document.slideshow_form.search_string.isFocus())
         (ns6)?window.onMouseMove="":document.onmousemove="";
         document.onkeypress="";
         document.getElementById('inner_window_title').onmousedown=seewhatkey;
         document.getElementById('inner_window_title').onmouseup="";
         document.getElementById('inner_window_title').style.backgroundColor="blue"
         document.getElementById('inner_window_title').style.color="white"
       }
                                        
     else if(document.all.popmenu.style.visibility!="visible")
       {
         //alert(document.all.popmenu.style.visibility)
         document.onkeypress=""
         (ns6)?window.onMouseMove="":document.onmousemove="";
       }
     
     //alert(dynamic_move_boolean)
     //    }
               
  }  // close function




//window.onload = function()
//{

  //document.onkeypress=seewhatkey;  //handler;   //showKey;
  //document.onclick=seewhatkey;

//}

(ns6)?window.captureEvents(Event.MOUSEMOVE):0;


function Mouse(evnt)
    {
            // ymouse = (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY;
            // xmouse = (ns)?evnt.pageX+ClockFromMouseX:event.x+ClockFromMouseX;
             park_event_2=(ns6)?evnt:event;               
            
             dynamic_move(park_event_2,linkset_custom[0])
             //  alert(park_event_1)
            
    }







//(ns6)?window.onMouseMove=Mouse:document.onmousemove=Mouse;
//window.onMouseDown=dynamic_move_boolean=false

function dynamic_move(event_1,things_1)
   {
     document.getElementById('inner_window_title').style.backgroundColor="yellow"
     //window.onMouseDown=dynamic_move_boolean=false
    // document.onClick=alert(document.onClick)//dynamic_move_boolean=true         
   
    if(dynamic_move_boolean==true)
      {
        park_event_1=(ns6)?evnt:event;  //event_1 //event_1
        xmouse=event.x    //event_1.x
        ymouse=event.y     //event_1.y

        xpopmenu=document.all.popmenu.offsetLeft  //.style.left
        ypopmenu=document.all.popmenu.offsetTop  //style.posTop  //style.top  offsetTop

        adjuster_boolean=true
             
        park_things_1=linkset_custom[0]   //things_1;

        just_move_menu(park_event_1,park_things_1)   //showmenu 05/05/05
              
        document.getElementById('inner_window_title').onmouseup=seewhatkey;

          with (document.getElementById('inner_window_title'))
            {
              style.backgroundColor="yellow"
              style.color="black"
            } 

       //setTimeout('dynamic_move(park_event_1,park_things_1),50')
      }
   else
      {
        (ns6)?window.onMouseMove="":document.onmousemove="";
      }

    }  // close function





//-->










