﻿
//新开窗口---------------------------------------------------------------------------------------------
var oWin = null;
function JsOpenwindow(width,height,Url)
{
	var left = screen.width/2 - width/2;
	var top  = screen.height/2 - height/2;	 
	oWin = window.open(Url,null,"width="+width+",height="+height+",left="+left+",top="+top+"\",scrollbars=Yes,resizable=Yes");
	oWin.focus();
	return oWin;
}
//模式窗口
function JsShowModalDialog(width,height,Url)
{	
	var sFeatures="dialogHeight: " + height + "px; width: " + width + "px; center: Yes; help:No; resizable:No; status:Yes;";
	var rtnValue = window.showModalDialog(Url,null,sFeatures);
	return rtnValue;
}

////是否删除
//function isDelete()
//{	
//	if(window.confirm("是否确认删除"))
//	{
//		if(document.all("txtAction")!=null)
//			document.all("txtAction").value = "del"				
//		document.forms[0].submit();
//	}
//}
//是否删除
function ConfirmDelete()
{	
	if(window.confirm("是否确认删除"))
	{
		if(document.all("txtAction")!=null)
			document.all("txtAction").value = "del"				
		document.forms[0].submit();
	}
}
//是否删除
function isDeleteWithKey(key)
{
	if(window.confirm("是否确认删除"))
	{
		if(document.all("txtAction")!=null)
			document.all("txtAction").value="del";
			
		if(document.all("txtkey")!=null)
			document.all("txtkey").value = key;		
		document.forms[0].submit();
	}
}


//重写是否删除
//重写方法有问题
function isDeleteByOpen(DelURL)
{
	if(window.confirm("是否确认删除"))
	{
		JsOpenwindow(100,100,DelURL);
	}
}


//搜索
function MySearch(url)
{
	
	if(document.all("tbSearch").style.display=="none")
		document.all("tbSearch").style.display = "";
	else
	{
		document.all("tbSearch").style.display = "none";
		location.href = url;
	}
}

//搜索Action
function SearchAction()
{
	if(document.all("txtAction")!=null)
		document.all("txtAction").value = "search"	
	document.forms[0].submit();
}

///帮助信息展示------------------------
function MyHelpMessageShow()
{
	var mes = document.all("tabMessage");
	if(mes.className=="Message")
		mes.className = "Message2";
	else
		mes.className = "Message";
}

///控制显示
function ControlDis(objID)
{
	var objDis = document.all(objID);
	if(objDis.style.display=="none")
		objDis.style.display = "";
	else
		objDis.style.display = "none";
	
}


//四舍五入
//myFloat是要进行四舍五入的数字，mfNumber代表要取舍的位数
function floatRound(myFloat,mfNumber)
{
    var cutNumber = Math.pow(10,mfNumber-1);
    return Math.round(myFloat * cutNumber)/cutNumber;
}

//操作跳转--------------------------
function GotoOP(url)
{
	if(url!="0")
		location.href = url;
}

function JsSort(url,sortby)
{
	var newurl = url.replace("&Sortby=" + sortby,"");
	newurl = newurl + "?&Sortby=" + sortby;
	location.href = newurl;
}

