// JScript 文件
//打开窗口的集合
var openerList  = new Array();
function ShowDialog(title,url,width,height,top,left)
{

    var clone = new Array();
    for(var i =0;i<openerList.length;i++){
        var win = openerList[i];
        if(win!=null && !win.closed){
            clone.push(win);
        }
    }
    openerList = clone;
    for(var i =0;i<openerList.length;i++){
        var win = openerList[i];
        if(win.name == title){
            win.close();
            break;
        }
    }
    width = width == null?600:width;
    height = height == null?600:height;
    
     top = ($(window).height()-height)/2; //获得窗口的垂直位置;
     left = ($(window).width()-width)/2; //获得窗口的水平位置;

    //
    var opener = window.open(url, title,'width='+width+' , height='+height+', top='+top+', left='+left+', toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, status=no');


    openerList.push(opener);
    return opener; 
}
