function win(path,target)
    {
    var wdth=arguments[2]||'600';   
    var hght=arguments[3]||'500';
    var mnbr=arguments[4]||'no';
    var rszbl=arguments[5]||'yes';
    var stts=arguments[6]||'no';
    var lctn=arguments[7]||'no';
    var tlbr=arguments[8]||'no';
    var scrllbrs=arguments[9]||'yes';
    var wintitle=arguments[10]||'';
    var newwin=window.open(path,
                            target,
                            'width='+wdth+','+
                            'height='+hght+','+
                            'menubar='+mnbr+','+
                            'resizable='+rszbl+','+
                            'status='+stts+','+
                            'location='+lctn+','+
                            'toolbar='+tlbr+','+
                            'scrollbars='+scrllbrs+'');
    }
    
function getobject(id)
    {
    if (document.getElementById(id))
        return document.getElementById(id);
    else if (document.all(id))
        return document.all(id);
    }
    
    var clicked=false;
    var expanded=false;

function expcoll(childid)
    {
    var child=getobject(childid);
    if(expanded&&childid!=expanded)
        {
        expcoll(expanded);
        return;
        }
    clicked=(child.style.visibility=='hidden')?false:true;
    expanded=clicked?false:childid;
    clicked?void(0):window.focus();
    document.body.onclick=clicked?null:function(){body_onclick(childid);};
    window.onblur=clicked?null:function(){body_onclick(childid);};
        child.filters[0].Motion=clicked?'reverse':'forward';
    child.filters[0].Apply();
    child.style.visibility=clicked?'hidden':'visible';
    child.filters[0].Play();
    }
    
function body_onclick(obj)
    {
    var child=getobject(obj);
    if(child!=event.srcElement&&clicked)
        expcoll(obj);
    clicked=true;
    }

function hilite(obj)
    {
    obj.className="over";
    }
        
function lolite(obj,defaultstyle)
    {
    obj.className=defaultstyle;
    }
    
function draw_select_control(id,control_name,width,arr_values)
    {
    var values=arr_values;
    var div_width=width;
    var button_width=17;
    var margin=1;
    var control_width=div_width-margin-button_width;
    div_height='auto';
    var html=
        '<input id="'+control_name+'" type="hidden" value="" name="'+control_name+'">'+
        '<input unselectable="on" id="view'+control_name+'" type="text" readonly="on" value="'+values[id][1]+'" style="width:'+control_width+'px; margin-right:'+margin+'px" onclick="expcoll(\'div'+control_name+'\')">'+
        '<input unselectable="on" type="button" class="ctrl" value="" hidefocus="true" style="width:'+button_width+'px" onclick="expcoll(\'div'+control_name+'\')">'+
        '<br/><div id="div'+control_name+'" class="ctrl" style="width:'+div_width+'px;height:'+div_height+';visibility:hidden;">'+
            '<table class="ctrl" cellspacing="0" cellpadding="0" border="0" width="100%">';
    for(var i=0;i<values.length;i++)
        {
        style=(i%2==0)?'even':'odd';
        html+=
                '<tr class="'+style+'" onmouseover="hilite(this)" onmouseout="lolite(this,\''+style+'\')">'+
                    '<td class="ctrl" unselectable="on" width="100%" onclick="'+control_name+'.value=\''+values[i][0]+'\';view'+control_name+'.value=\''+values[i][1]+'\';expcoll(\'div'+control_name+'\')">'+
                        values[i][1]+
                '</td></tr>';
        }           
    html+='</table></div>';
    return html;
    }
