﻿//打开新窗口函数
function Openwin(url, height, width)
{
    var left, top;
    left = eval(screen.width-width)/2;
    top = eval(screen.height-height)/2;
    
    window.open(url, 'mywin', 'top=' + top + ', left=' + left + ', height=' + height + ', width=' + width + ',scrollbars=yes');
}

// 设置父框架页面高度
function parentHigh()
{
	if(self!=top)
	{
		var i = document.body.scrollHeight;
		var di = 500;
		if(i > di)
		{
			parent.document.all.Main.style.height=i;
		}
		else
		{
			parent.document.all.Main.style.height=di;
		}
	}
}
// 设置父框架页面高度
function parent_High()
{
	if(self!=top)
	{
		var i = document.body.scrollHeight;
		var di = 500;
		if(i > di)
		{
			parent.document.all.Main.style.height=i;
			top.document.all.Main.style.height=i+30;
		}
		else
		{
			parent.document.all.Main.style.height=di;
		}
	}
}
// 设置父框架页面高度
function ParentHigh()
{
	if(self!=top)
	{
		var i = document.body.scrollHeight;
		var di = 500;
		if(i > di)
		{
			parent.document.all.Main.style.height=i;
		}
		else
		{
			parent.document.all.Main.style.height=di;
		}
	}
}
// 设置父框架页面高度
function Parent_High()
{
	if(self!=top)
	{
		var i = document.body.scrollHeight;
		var di = 450;
		if(i > di)
		{
			top.document.all.Main01.style.height=i;
		}
		else
		{
			top.document.all.Main01.style.height=di;
		}
	}
}
// 转到指定页
function GoPage(LPage)
{
	location.href=LPage;
}

// 关闭窗口
function WClose()
{
	window.close();
}

function CheckedAll()
		{
		    var obj = document.all.tags("INPUT");
			for(i=0;i<obj.length;i++)
			{

    			if(obj[i].type=="checkbox" && obj[i].id.indexOf("myCheck") > -1)
				{
				    obj[i].checked = true;				
   				}
			}
			document.all.Head.onclick=CheckAll;
		}
		
		function CheckAll()
		{
			var obj = document.all.tags("INPUT");
			for(i=0;i<obj.length;i++)
			{
    			if(obj[i].type=="checkbox" && obj[i].id.indexOf("myCheck") > -1)
				{
					obj[i].checked = false;
   				}
			}
			document.all.Head.onclick=CheckedAll;
		}
		
		function ShowModalDialog_ReloadCtl(pagename,title,width,height,ctl)
{
		var robj = window.showModalDialog(pagename,title,"dialogHeight: "+ height +"px; dialogWidth: "+ width +"px;status:yes;scroll:no;")
		if(robj!=null && robj.type=='ok')
		{					
			document.all[ctl].click();
		}
}

function ShowModalDialog_Reload_scroll(pagename,title,width,height)
{
	var robj = window.showModalDialog(pagename,title,"dialogHeight: "+ height +"px; dialogWidth: "+ width +"px;status:yes;scroll:yes;")
	if(robj!=null && robj.type=='ok')
	{					
		document.all.EButton_Reload.click();
	}
}
function ShowModalDialog_Reload(pagename,title,width,height)
{
		var robj = window.showModalDialog(pagename,title,"dialogHeight: "+ height +"px; dialogWidth: "+ width +"px;status:yes;scroll:no;")
		if(robj!=null && robj.type=='ok')
		{					
			document.all.EButton_Reload.click();
		}
}
function ShowModalDialog(pagename,title,width,height)
{
		window.showModalDialog(pagename,title,"dialogHeight: "+ height +"px; dialogWidth: "+ width +"px;status:yes;scroll:no;")
}