﻿function PostBackWithLoading(Target)
{
    showPopWin('loading.html', 320, 100, null);
    __doPostBack(Target,"");
}
function ShowPopupWindow(URL, Parameters, Properties)
{
    if (Parameters != null && Parameters != '')
        URL = URL + '?' + Parameters;
    var hwn = window.open(URL, "", Properties);
    hwn.focus();
}
function ShowPopupWindowCenter(URL, Parameters, Properties, Height, Width)
{
    var left = (screen.width/2)-(Width/2);
    var top = (screen.height/2)-(Height/2);

    if (Properties != '') Properties += ',';
    Properties += 'menubar=0,statusbar=0,scrollbars=0,addressbar=0,left='+left+',top='+top+',height='+Height+',width='+Width;
    
    if (Parameters != null && Parameters != '')
        URL = URL + '?' + Parameters;
    
    var hwn = window.open(URL, "", Properties);
    hwn.focus();
}
function ShowPopupDailog(URL, Parameters, Properties)
{
    if (Parameters != null && Parameters != '')
        URL = URL + '?' + Parameters;
    window.showModalDialog(URL, "", Properties);
}
function doClick(buttonName,e)
{
    var key;
    if(window.event)
      key = window.event.keyCode;   //IE
    else
      key = e.which;                //firefox
    if (key == 13)
    {
        //Get the button the user wants to have clicked
        var btn = document.getElementById(buttonName);
        if (btn != null)
        { //If we find the button click it
            btn.click();
            event.keyCode = 0
        }
    }
}
