function $(id)
{
    if (typeof(id)!='string') return id;
	
    return document.getElementById
        ? document.getElementById(id) 
        : document.all ? document.all(id) : null;
}

function observeEvent(obj, evnt, fnc, capture)
{
    obj = $(obj);	
    if (obj.attachEvent) obj.attachEvent('on'+evnt, fnc);
    else if (obj.addEventListener) obj.addEventListener(evnt, fnc, capture);
}

function popup(URL,sType,sWidth,sHeight) {
    var sChoice="";
    if (sType=="minimal") sChoice="height="+sHeight+",width="+sWidth;
    if (sType=="scroll") sChoice="status,height="+sHeight+",width="+sWidth;
    if (sType=="flexible") sChoice="toolbar,scrollbars,resizable,height="+sHeight+",width="+sWidth;
    window.open(URL, 'newWin', sChoice);
}