﻿function ShowPanel(panelId, panelTitle, isModal, width, height) {
    var panel = Ext.get(panelId);
    if (panel) {
        var window = new Ext.Window({
            closeAction: 'hide',
            contentEl: panelId,
            height: height,
            modal: isModal,
            title: panelTitle,
            width: width
        });
        
        panel.show();
        window.show();
    }
}

function IsValidEmail(email) {
    var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
    return reg.test(email);
}

function getObjectById( id ) {
    if (document.getElementById)
        var returnVar = document.getElementById(id);
    else if (document.all)
        var returnVar = document.all[id];
    else if (document.layers)
        var returnVar = document.layers[id];
    return returnVar;
}