﻿function StartUp()
{
    ResizeContent();
}

function submitenter(myfield,e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;

if (keycode == 13)
   {
   myfield.form.submit();
   return false;
   }
else
   return true;
}

function ResizeContent()
{
   
    var y; 
    if (self.innerHeight) // all except Explorer
    {
        y = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode
    {
    	
        y = document.documentElement.clientHeight;
    }
    else if (document.body) // other Explorers
    {
    	
        y = document.body.clientHeight;
    }

    if (y > 100)
    {
        if (document.getElementById("DivContent2"))
        {
            document.getElementById("DivContent2").style.height = y - 64;
        }
        else
        {
            document.getElementById("DivContent").style.height = y - 40;
        }
        if (document.getElementById("WebFrame"))
        {
            document.getElementById("WebFrame").style.height = y - 60;
        }
    }
}

function NewWin(url, winName, w, h)
{
    //alert(SelectedNode.ID + "=" + SelectedNode.Text);
    w = w + 20;
    var x = screen.width;
    var y = screen.height;
    var left = (x / 2) - (w / 2);
    var top = (y / 2) - (h / 2);
    
    var options = "toolbar=0,location=0,directories=0,status=1,scrollbars=1,menubar=0,resizable=1,width=" + w + ",height=" + h + ",top=" + top + ",left=" + left
    if (winName == null)
        winName = "_blank";
    
    var NewWindow = window.open(url, winName, options, true);
    if (NewWindow)
    {
        NewWindow.focus();
    }
}

function CloseWindow()
{
    this.focus();
    self.opener = this;
    self.close();
}

function OpenToolWin(url, w, h)
{
    //alert(SelectedNode.ID + "=" + SelectedNode.Text);
    w = w + 20;
    var i = 0;
    var x = screen.width;
    var y = screen.height;
    var left = (x / 2) - (w / 2);
    var top = (y / 2) - (h / 2);
    
    var options = "toolbar=0,location=0,directories=0,status=1,scrollbars=1,menubar=1,resizable=1, width=" + w + ",height=" + h + ",top=" + top + ",left=" + left 
    
    
    var NewWindow = window.open(url, "NewWindow", options, true);
    if (NewWindow)
    {
        NewWindow.focus();
    }
}

    function PrintNewWin(url, w, h)
    {
       
        w = w + 20;
        var x = screen.width;
        var y = screen.height;
        var left = 0//(x / 2) - (w / 2);
        var top =0 //(y / 2) - (h / 2);
        
        var options = "toolbar=1,location=top,directories=0,status=1,scrollbars=1,menubar=1,resizable=1,width=" + w + ",height=" + h + ",top=" + top + ",left=" + left
        
        
        var NewWindow = window.open(url, "NewWindow", options, true);
        if (NewWindow)
        {
            NewWindow.focus();
           
        }
    }




