﻿function openWindow(url, width, height) {
     var x = parseInt(screen.width / 2.0) - (width / 2.0);
    var y = parseInt(screen.height / 2.0) - (height / 2.0);

    var win = window.open(url, "mcePopup", "top=" + y + ",left=" + x + ",scrollbars=1"  + ",dialog=yes,modal=yes,width=" + width + ",height=" + height + ",resizable=yes");
    eval('try { win.resizeTo(width, height); } catch(e) { }');
    win.focus();
}
/*
function openWindow(url, width, height, NewWin) {
    var x = parseInt(screen.width / 2.0) - (width / 2.0);
    var y = parseInt(screen.height / 2.0) - (height / 2.0);

    var win = window.open(url, NewWin, "top=" + y + ",left=" + x + ",scrollbars=1" + ",dialog=yes,modal=yes,width=" + width + ",height=" + height + ",resizable=yes");
    eval('try { win.resizeTo(width, height); } catch(e) { }');
    win.focus();
}
*/

function openWindow2(url, width, height) {
    var x = parseInt(screen.width / 2.0) - (width / 2.0);
    var y = parseInt(screen.height / 2.0) - (height / 2.0);

    var win = window.open(url, "msg", "top=" + y + ",left=" + x + ",scrollbars=1" + ",dialog=yes,modal=yes,width=" + width + ",height=" + height + ",resizable=yes");
    eval('try { win.resizeTo(width, height); } catch(e) { }');
    win.focus();
}

function openWindow3(url, width, height) {
    var x = parseInt(screen.width / 2.0) - (width / 2.0);
    var y = parseInt(screen.height / 2.0) - (height / 2.0);

    var win = window.open(url, "mcePopup999", "top=" + y + ",left=" + x + ",scrollbars=1" + ",dialog=yes,modal=yes,width=" + width + ",height=" + height + ",resizable=yes");
    eval('try { win.resizeTo(width, height); } catch(e) { }');
    win.focus();
}

function openChat() {
    var url = "/IM/chat.aspx"
    var width = 800;
    var height = 600;
    var x = parseInt(screen.width / 2.0) - (width / 2.0);
    var y = parseInt(screen.height / 2.0) - (height / 2.0);

    var win = window.open(url, "msgchat", "top=" + y + ",left=" + x + ",scrollbars=1" + ",dialog=yes,modal=yes,width=" + width + ",height=" + height + ",resizable=yes");
    eval('try { win.resizeTo(width, height); } catch(e) { }');
    win.focus();
}

function openpic(url, width, height) {
    var x = parseInt(screen.width / 2.0) - (width / 2.0);
    var y = parseInt(screen.height / 2.0) - (height / 2.0);

    var win = window.open(url, "myPic", "top=" + y + ",left=" + x + ",scrollbars=1" + ",dialog=yes,modal=yes,width=" + width + ",height=" + height + ",resizable=yes");
    eval('try { win.resizeTo(width, height); } catch(e) { }');
    win.focus();
}

function openmap(url, width, height) {
    var x = parseInt(screen.width / 2.0) - (width / 2.0);
    var y = parseInt(screen.height / 2.0) - (height / 2.0);

    var win = window.open(url, "myMap", "top=" + y + ",left=" + x + ",scrollbars=1" + ",dialog=yes,modal=yes,width=" + width + ",height=" + height + ",resizable=yes");
    eval('try { win.resizeTo(width, height); } catch(e) { }');
    win.focus();
}



function doReload() {
    alert('操作成功');
    try { 
        window.opener.DoSearch(); 
    }
    catch (e) { }
    window.close();


}


function checkAll(event) {
    var e = event ? event : window.event;
    var obj = e.target || e.srcElement;
    $(obj).parents('table:first')
              .find(':checkbox').filter(':enabled')
              .attr("checked", $(obj).attr("checked"));

}

 




   
