function popup(url, name, width, height) {
    if(!name)
        name = 'a_popup';
    //name = name + new Date().getTime();
    if(!width)
        width = screen.width / 2;
    if(!height)
        height = screen.height / 2;
    var winleft = (screen.width - width) / 2;
    var winUp = (screen.height - height) / 2;
    win = window.open(url, name,
                "height=" + height + ",width=" + width + ",status=0,resizable=1,scrollbars=1,toolbar=0,menubar=0,left=" + winleft +
            ",top=" + winUp);
    win.opener = self;
}

function dialog_close() {
    if(opener != null) {
        if(document.images)
            opener.location.replace(opener.location.href);
        else
            opener.location.href = opener.location.href;
    }
    window.close();
}

function getObj(name)
{
	if(document.getElementById)  {
		return document.getElementById(name);
	}
	else if(document.all) {
		return document.all[name];
	} else if (document.layers)  {
		return document.layers[name];
	}
}