	var win;
	Ext.Win = function() {
	    var frameId = new Date().format('ymdgis');
	    return {
	        open: function(url, title, attr, closed) {
	            win = new Ext.Window({
	                id: attr.id,
	                layout: 'fit',
	                title: title,
	                width: attr.width,
	                height: attr.height + 40 > Ext.getBody().getViewSize().height ? Ext.getBody().getViewSize().height : attr.height + 40,
	                footer: false,
	                modal: attr.modal == 'no' ? false : true,
	                maximizable: attr.maximize == 'yes' ? true : false,
	                plain: true,
	                closable: attr.closable == 'no' ? false : true,
	                html: "<iframe name='iframe_9999' id='CWindow_Iframe_Content_" + frameId + "' style='overflow-x:hidden;' src='about:blank' frameborder='0' scrolling='" + (attr.scrollbars == 'no' ? 'no' : 'yes') + "' width='100%' height='100%'></iframe>",
	                buttons: [
							{
							    text: '关闭',
							    handler: function() {
							        Ext.WindowMgr.getActive().close();
							    }
							}
						],
	                listeners: {
	                    beforeclose: function(_panel) {
	                        //----------修改价格等级后回调更新团队编辑页(xuty2010/12/29)---begin---------------------------------
	                        if (typeof (attr.isSetPrice) != "undefined" && attr.isSetPrice == "yes") {
	                            var fr = parent.frames[2]
	                            if (/MSIE 6/.test(navigator.userAgent)) {
	                               fr = parent.frames[3];
	                            }
	                            if (fr && fr.ajaxPages) {
	                              fr.ajaxPages.setPrice();
	                            }
	                        }

	                        //------------------end------------------------------------------------------------------
	                        //---------------------对订单处理关闭窗口时候的事件处理---begin--------------
	                        if (typeof (attr.DealProcess) != "undefined" && attr.DealProcess == 0 && attr.intImgFlag != "undefined" && attr.intImgFlag != 1) {
	                            $.ajax
                                        ({
                                            url: "/ShareWeb/DealProcess.aspx?IntFlag=0&OrderId=" + attr.OrderId,
                                            cache: false,
                                            async: false,
                                            success: function(html) {
                                                var arrIsCheck = html.split(",");
                                                if (arrIsCheck == null || arrIsCheck.length != 2)
                                                    return;
                                                if (arrIsCheck[0] == "False")   //订单已经不存在,但这里不需要给出提示,不然删除无效订单的时候,这里也会出来提醒
                                                {
                                                    return;
                                                }
                                                if (arrIsCheck[1] == "False")   //订单未确认过
                                                {
                                                    if (confirm("您未对订单做任何操作,是否将该订单变为处理中? ")) {
                                                        $.ajax
                                                            ({
                                                                url: "/ShareWeb/DealProcess.aspx?IntFlag=1&OrderId=" + attr.OrderId,
                                                                cache: false,
                                                                success: function(html) {
                                                                    var arrProcess = html.split(",");
                                                                    if (arrProcess == null || arrProcess.length != 2)
                                                                        return;
                                                                    if (arrProcess[0] == "False") {
                                                                        alert("您操作的订单已经不存在!");
                                                                        return;
                                                                    }
                                                                    if (arrProcess[1] == "True") {
                                                                        alert("订单状态变成处理中！")
                                                                        if (typeof (parent.parent.ReloadPrent) != "undefined")
                                                                            parent.parent.ReloadPrent();
                                                                    }
                                                                }
                                                            });
                                                    }
                                                }
                                            }
                                        });


	                        }
	                        //-------------------对订单处理关闭窗口时候的事件处理---end--------------
	                        else if (typeof (attr.IsReloadParent) != "undefined" && attr.IsReloadParent != null && attr.IsReloadParent == true)   //要刷新父窗体
	                        {
	                            var parentCount = 1;
	                            var isReloadEventFun = false;   //判断是否调用函数进行重新刷新,默认为直接调用window的默认reload方法
	                            if (typeof (attr.IsReloadEventFun) != "undefined" && attr.IsReloadEventFun != null && (attr.IsReloadEventFun == false || attr.IsReloadEventFun == true)) {
	                                isReloadEventFun = attr.IsReloadEventFun;
	                            }

	                            //判断要刷新几层的父窗体,默认只刷新一层
	                            if (typeof (attr.ParentCount) != "undefined" && attr.ParentCount != null && attr.ParentCount != "") {
	                                parentCount = parseInt(attr.ParentCount);
	                            }


	                            var parentWin = null;
	                            for (var index = 0; index < parentCount; index++) {
	                                if (index == 0) {
	                                    if (isReloadEventFun && typeof (CloseWinReload) != "undefined") {
	                                        CloseWinReload();
	                                    }
	                                    else {
	                                        location.reload();
	                                    }
	                                }
	                                else if (index > 0) {
	                                    parentWin = parent;
	                                    if (isReloadEventFun && typeof (parentWin.CloseWinReload) != "undefined") {
	                                        parentWin.CloseWinReload();
	                                    }
	                                    else {
	                                        parentWin.location.reload();
	                                    }
	                                }
	                            }

	                        }
	                    }
	                }
	            });
	            if (attr.closebtn == 'no') {
	                win.buttons[0].hide();
	            }
	            win.show(attr.target);
	            win.mask.setSize(Ext.getBody().getViewSize().width, document.body.scrollHeight);
	            Ext.getDom("CWindow_Iframe_Content_" + frameId).contentWindow.document.write("<table width='100%' height='100%'><tr align='center' valign='middle'><td><strong><img style='display: block' src='/Images/loadingnew.gif' border='0' /><br />页面加载中,请稍后......</strong></td></tr></table>");
	            Ext.getDom("CWindow_Iframe_Content_" + frameId).src = url;
	            if (typeof (closed) == "function") {
	                win.on("close", closed);
	            }
	            win.on("close", function() {
	                //Ext.getDom("CWindow_Iframe_Content_"+frameId).src = 'about:blank';
	                Ext.get("CWindow_Iframe_Content_" + frameId).remove();
	                CollectGarbage();
	            });
	        },
	        close: function() {
	            Ext.WindowMgr.getActive().close();
	        }
	    }
	}
	
	function CWindow(url,title,attr){
		
	}
	
	Controls={};
	Controls.Dialog=function(url,title,attr){
		this.open=Ext.Win().open(url,title,attr);
	}
	function CollectGarbage(){
	
	}
