
//最大化Web窗口
function MaxWin()
{
	try
	{
		var b = true;
		//b = top.screenLeft == 0;
		//b = b && top.screen.availHeight - top.screenTop - top.body.offsetHeight - 20 == 0;
		if(!b)
		{
			var str  = '<object id="winMax" type="application/x-oleobject" classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">';
				str += '<param name="Command" value="Maximize"></object>';
			document.body.insertAdjacentHTML("beforeEnd", str);
			document.getElementById("winMax").Click();
		}
	}
	catch(e)
	{
		alert(e.description);
	}
}

//打开屏幕居中窗口
//target 目标框架: 
//_blank:新窗口、


//_self:自身窗口、


//_top:顶级框架显示，如果没有框架效果同_self、


//_parent:父框架显示，如果没有框架效果同_self
function NewCenterWin(url, target, width, height)
{
	var left = screen.width/2-width/2;
	var top = screen.height/2-height/2-35;
		
	//var newWin = window.open(url, target,
			//"channelmode=no, directories=no, fullscreen=no, height=" + height + ", left=" + left + ", location=no, menubar=no, resizable=yes, scrollbars=yes, status=yes, titlebar=no, toolbar=no, top=" + top + ", width=" + width);

    //newWin.focus();
    
    NewWin(url, target, width, height, top, left);
}

//功能同NewCenterWin,除了不允许postback。
function NewCenterWinNoPost(url, target, width, height)
{
	var left = screen.width/2-width/2;
	var top = screen.height/2-height/2-35;
		
	//var newWin = window.open(url, target,
			//"channelmode=no, directories=no, fullscreen=no, height=" + height + ", left=" + left + ", location=no, menubar=no, resizable=yes, scrollbars=yes, status=yes, titlebar=no, toolbar=no, top=" + top + ", width=" + width);

    //newWin.focus();
    
    NewWin(url, target, width, height, top, left);
    
    event.returnValue = false;//不允许postback
}


//打开新窗口


//target 目标框架: 
//_blank:新窗口、


//_self:自身窗口、


//_top:顶级框架显示，如果没有框架效果同_self、


//_parent:父框架显示，如果没有框架效果同_self
function NewWin(url, target, width, height, top, left)
{
	var newWin = window.open(url, target,
			"channelmode=no, directories=no, fullscreen=no, height=" + height + ", left=" + left + ", location=no, menubar=no, resizable=yes, scrollbars=yes, status=yes, titlebar=no, toolbar=no, top=" + top + ", width=" + width);

    newWin.focus();
}

//打开新窗口


//target 目标框架: 
//_blank:新窗口、


//_self:自身窗口、


//_top:顶级框架显示，如果没有框架效果同_self、


//_parent:父框架显示，如果没有框架效果同_self
function NewWebForm(url, target, width, height, top, left)
{
	var newWin = window.open(url, target,
			"channelmode=no, directories=no, fullscreen=no, height=" + height + ", left=" + left + ", location=no, menubar=no, resizable=yes, scrollbars=yes, status=yes, titlebar=no, toolbar=no, top=" + top + ", width=" + width);

    newWin.focus();
}


//选择页面中所有CheckBox，除指定id的checkbox外。


function selectAllCheckBox(foreclose)
{
	for(var i=0;i<document.Form1.elements.length;i++)
	{
		var e = document.Form1.elements[i];
		
		if(e.name != foreclose)
			e.checked = document.all[foreclose].checked;
	}
}

//打开模式对话框

function OpenModalDialog(url, args, hight, width)
{
	window.showModalDialog(url, args, "dialogHeight: " + hight + "px; dialogWidth: " + width + 
		"px; dialogTop: px; dialogLeft: px; edge: Raised; center: Yes; help: No; resizable: No; status: No;");
}

//menu选择时不执行postback。
function MenuSelectNone()
{
	return false;;
}

//改变背景色。


function changeBgColor(sender, color)
{
	sender.bgColor = color;
}

//不提示关闭窗口。

function CloseWin()
{
	window.opener=null;
	window.close();
	
	event.returnValue = false;//不允许postback
}

function CloseBaseWin()
{
	//关闭父页面
	window.opener.window.opener = null;
	window.opener.window.close();
	
	event.returnValue = false;//不允许postback
}


//提示关闭窗口
function CloseWebFrom()
{
	window.close();
}

//
function CheckIsNull(str)
{
    if(str=="")
        return true;
}
//重新置页面大小

function reSize(ix,iy)
{
	window.resizeTo(ix,iy);
}

function NewBigWin(url)
{
	var newWin = window.open(url, '_blank',
			"channelmode=no, directories=yes, fullscreen=no, height=600, left=50, location=yes, menubar=yes, resizable=yes, scrollbars=yes, status=yes, titlebar=yes, toolbar=yes, top=50, width=800");

    newWin.focus();
}

function HelpWin(url)
{
	var left = screen.width/2-200;
	var top = 50;
	var newWin = window.open(url, '_blank',
			"channelmode=no, directories=no, fullscreen=no, height=400, left="+left+", location=no, menubar=no, resizable=no, scrollbars=no, status=no, titlebar=no, toolbar=no,width=470,top="+top+"");

    newWin.focus();
}
//打开屏幕居中窗口
//target 目标框架: 
//_blank:新窗口、


//_self:自身窗口、


//_top:顶级框架显示，如果没有框架效果同_self、


//_parent:父框架显示，如果没有框架效果同_self
function NewPrintWin(url, target, width, height)
{
	var left = screen.width/2-width/2;
	var top = screen.height/2-height/2-35;
		
	var newWin = window.open(url, target,
			"channelmode=no, directories=yes, fullscreen=no, height=" + height + ", left=" + left + ", location=no, menubar=yes, resizable=yes, scrollbars=yes, status=yes, titlebar=yes, toolbar=yes, top=" + top + ", width=" + width);

    newWin.focus();
}
