﻿// JScript File

function defaultButton(e, buttonid){ 
    var evt = e ? e : window.event;
    var bt = document.getElementById(buttonid);

    if (bt){ 
      if (evt.keyCode == 13){ 
            bt.click(); 
            return false; 
      } 
    } 
}

function CenterPopup(location, window_name, toolbar, locationbar, directoriesbar, statusbar, menubar, scrollbars, resizable, iwidth, iheight)
{
    if (document.all)
    {
        var xMax = screen.width, yMax = screen.height
    }
    else if (document.layers)
    {
        var xMax = window.outerWidth, yMax = window.outerHeight
    }
    else
    {
        var xMax = 640, yMax=480;
    }
    
    if (xMax < iwidth)
    {
        iwidth = xMax, iheight = yMax
    }
    
    var xOffset = (xMax - iwidth)/2, yOffset = (yMax - iheight - 75)/2;
    var options = ''
    if (toolbar == 'yes')
    {
        var options = 'toolbar=yes'
    }
    else
    {
        options = 'toolbar=no'
    }
    
    if (locationbar == 'yes')
    {
        options = options+', location=yes'
    }
    else
    {
        options = options+', location=no'
    }
    if (directoriesbar == 'yes')
    {
        options = options+', directories=yes'
    }
    else
    {
        options = options+', directories=no'
    }
    if (statusbar == 'yes')
    {
        options = options+', status=yes'
    }
    else
    {
        options = options+', status=no'
    }
    if (menubar == 'yes')
    {
        options = options+', menubar=yes'
    }
    else
    {
        options = options+', menubar=no'
    }
    if (scrollbars == 'yes')
    {
        options = options+', scrollbars=yes'
    }
    else
    {
        options = options+', scrollbars=no'
    }
    if (resizable == 'yes')
    {
        options = options+', resizable=yes'
    }
    else
    {
        var options = options+', resizable=no'
    }
    
    newwin=window.open(location, window_name, options+', width='+iwidth+', height='+iheight+', screenX='+xOffset+', screenY='+yOffset+', top='+yOffset+', left='+xOffset);
    newwin.focus();
}


function setfocus(element) { 
    //myObj=document.forms[0].getElementByID(element)
   document.forms[0].element.focus();
    //myObj.focus();    
} 





