// See ScriptHistory.txt for info

function open_centered_window (window_URL,window_width,window_height) {
    var window_left = (screen.availWidth / 2) - (window_width / 2)
    var window_top = (screen.availHeight / 2) - (window_height / 2)
    var window_dimensions = "height=" + window_height +
                            ",width=" + window_width +
                            ",left=" + window_left +
                            ",top=" + window_top
 
    window.open(window_URL,"",window_dimensions)                        
}

function open_centered_windowConTodo (window_URL,window_width,window_height) {
    var window_left = (screen.availWidth / 2) - (window_width / 2)
    var window_top = (screen.availHeight / 2) - (window_height / 2)
    var window_dimensions = "height=" + window_height +
                            ",width=" + window_width +
                            ",left=" + window_left +
                            ",top=" + window_top
 
    window.open(window_URL,"",window_dimensions + ",menubar,resizable,scrollbars,status,toolbar")                        
}


function disp_centered_image (window_URL,image_width, image_height,loc_flag,prefix_flag) {
    if (!image_height) {image_height=504}
    var image_URL='images/birds/'+window_URL
    if (loc_flag) {image_URL=window_URL}
    var window_width=image_width+18
    var window_height=image_height+32
    var scroll=""
    var max_height=screen.availHeight
    if (window_height > max_height) {
       max_height=max_height-30
       window_height=max_height-20
       window_width=window_width+20
       scroll=",scrollbars"
    }   
    var window_left = (screen.availWidth / 2) - (window_width / 2)
    var window_top = (max_height / 2) - (window_height / 2)
    var window_dimensions = "height=" + window_height +
                            ",width=" + window_width +
                            ",left=" + window_left +
                            ",top=" + window_top + scroll
                                                        
    var prefix="../../../"
    if  (prefix_flag) {
       switch(prefix_flag) {
          case 1 :
          prefix=""
          break
          case 2 :
          prefix="../"
          break
          case 3 :
          prefix="../../"
          break
       }
    }
    
    window.open(prefix+'Shared/DisplayLogImage.htm?'+image_URL+"?"+image_width+","+image_height,"",window_dimensions)   
                    
}

function bottom_top(anchor_name, frame_num) {
    // Get the URL of the other frame
    var frame_URL = parent.frames[frame_num].location.href
    // Check for the number sign (#)
    var number_sign_index = frame_URL.indexOf("#")
    if (number_sign_index != -1) {

        // If it's there, remove it
        frame_URL = frame_URL.substring(0, number_sign_index)        
    }

    // Navigate to the specified anchor
    parent.frames[frame_num].location = frame_URL + "#" + anchor_name
}

  
