<!--弹出窗口
function OpenLargeWin(theUrl,winName)
{
	var l=(screen.width-800)/2;
	var t=(screen.height-600)/2;
	window.open(theUrl,winName,'height=600,width=800,left='+l+',top='+t+',toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
}

function OpenMidWin(theUrl,winName)
{
	window.open(theUrl,winName,'height=500,width=600,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
}

function OpenSubjectWin1(subjectId,subject,subjectType)
{
	url="../Bulletin/ColumnList.aspx?LanMuId="+subjectId+"&LanMuName="+subject+"&LanMuLeiBie="+subjectType;
	OpenLargeWin(url,'Subject');
}
//start add by 何立伟 for td4895 2010-11-17 
function OpenSubjectWinDepart(subjectId,subject,Catalog)
{
	url="../../Channel/Catalog.aspx?Catalog="+Catalog+"&CatalogId="+subjectId;
	parent.document.location.href=url;
	//OpenLargeWin(url,'Subject');
}
//end add by 何立伟 for td4895 2010-11-17 
function OpenSubjectWin(subjectId,subject,Catalog)
{
	url="../Channel/Catalog.aspx?Catalog="+Catalog+"&CatalogId="+subjectId;
	document.location.href=url;
	//OpenLargeWin(url,'Subject');
}

function OpenBizWin(flowId,flowName)
{
	var rtnStr = window.showModalDialog("../Bulletin/LinkQuest.htm?infoFlowId="+flowId+"&infoFlowName="+flowName,"",'dialogHeight:300px;dialogWidth:400px;');
	//window.open("../Bulletin/LinkQuest.htm?infoFlowId="+flowId+"&infoFlowName="+flowName,"",'height=500,width=600,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
	if(rtnStr){
		if(rtnStr=="isNone"){
			OpenLargeWin("../Bulletin/Businessview.aspx?infoFlowId="+flowId+"&infoFlowName="+flowName,'');
		}
		else if(rtnStr=="没有符合条件的审批流程"){Openoper(flowId,flowName);}
		else{
			var url="../Bulletin/Businessview.aspx?"+rtnStr;
			//url="../Bulletin/Businessview.aspx?infoFlowId="+flowId+"&infoFlowName="+flowName;
			OpenLargeWin(url,'');
		}
	}
}
function Openoper(flowId,flowName)
{
   OpenBizWin(flowId,flowName);
}
function OpenFaqWin(id)
{
	url="../FAQ/Faq.aspx?id="+id;
	OpenMidWin(url,'Faq');
}


function OpenBrdWin(infoId,type)
{
	var url="../Broadcast/broadcastview.aspx?InfoId="+infoId+"&type="+type;
	OpenMidWin(url,'Broadcast');
}
//-->

//审批事项查询
function Activate()
{
	if (document.all("ItemName").value == "请在此输入您要查询的事项关键字")
	{
		document.all("ItemName").value = "";
	}
}

function Blur()
{
	if (document.all("ItemName").value == "")
	{
		document.all("ItemName").value = "请在此输入您要查询的事项关键字";
	}
}

function KeyItemQuery()
{
	if (window.event.keyCode == 13)
	{
		ItemQuery();
	}
}

//快速通道
function Approve(catalog)
{
	if(catalog != "")
	{
		document.location = "../Channel/Catalog.aspx?Catalog=" + catalog;
	}
	else
	{
		document.location = "../Channel/ChannelAllList.aspx";
	}
}
//added by wangwei 2007-06-25
// 弹出设置日期对话框
function SetDateValue(obj)
{
	var vsRe = window.showModalDialog("../Resource/SetDateValue.aspx", "", "dialogWidth:400px;dialogHeight:250px");
	if(vsRe != null && vsRe != undefined)
	{
		document.all.item(obj).value = vsRe;
		document.all.item(obj + "View").innerHTML = vsRe;
		
		if(vsRe == "")
		{
			document.all.item(obj + "View").innerHTML = "(不限)";
		}
		document.all.item("btnSubmit").click();
	}
}
//end added by wangwei 2007-06-25
/************************************************
* 自定义页内编辑框start
*/
document.write('<div id="InsPopViewPageShade" style="display:none; z-index:10; position:absolute; width:expression(document.body.offsetWidth); height:expression(document.body.offsetHeight); left:0px;top:0px; FILTER:alpha(opacity=20);background-color:#000000"></div>');

// 隐藏编辑框
function HiddenInsPopView(InsPopView)
{
	document.all.item("InsPopViewPageShade").style.display = "none";
	var objView = document.all.item(InsPopView);
	objView.style.display = "none";
}

// 编辑
function EditInsPopView(InsPopView,PositionType)
{
	document.all.item("InsPopViewPageShade").style.display = "block";
	var objView = document.all.item(InsPopView);
	objView.style.display = 'block';
	var x = document.body.scrollLeft + event.clientX;
	var y = document.body.scrollTop + event.clientY;
	if(PositionType != undefined && PositionType == "Center")
	{
		objView.style.left = document.body.offsetWidth / 2 - objView.offsetWidth / 2;
//		objView.style.top = document.body.offsetHeight / 2 - objView.offsetHeight / 2;
objView.style.top = document.body.offsetHeight / 2 - objView.offsetHeight / 2;;//y- (objView.offsetHeight / 2)+50;//y / 2 - objView.offsetHeight / 2;
		if(y > document.body.offsetHeight - objView.offsetHeight)
	{	
		objView.style.top = y - objView.offsetHeight - 10;
	}
	else
	{			
		objView.style.top = y - 10;
	}	
		return;
	}
	
//	var x = document.body.scrollLeft + event.clientX;
//	var y = document.body.scrollTop + event.clientY;
	
	
	if(x > document.body.offsetWidth - objView.offsetWidth)
	{
		objView.style.left = x - objView.offsetWidth - 10;
	}
	else
	{
		objView.style.left = x + 10;
	}
	
	if(y > document.body.offsetHeight - objView.offsetHeight)
	{
		objView.style.top = y - objView.offsetHeight - 10;
	}
	else
	{
		objView.style.top = y + 10;
	}
}
/**
* 自定义页内编辑框end
***********************************************/
/*************************************************
 * 提示信息模块 Start
 **/
	// 输出提示信息
	document.write('<div id="tips" onclick="javascript:SetTipsDelay();" onmousemove="javascript:SetTipsDelay();" style="overflow: auto; font-size: 10pt; position: absolute; height: 10px; z-index: 100; left: 100px; top: 100px; visibility: hidden; border: 1px solid #000080; background-color: #FFFFEC; FILTER: progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color=#C0C0FF, Positive=true)"></div>');

	var tipsDelay = 0;  // 提示信息显示延迟（全局变量）

	// 设置时间延迟
	function SetTipsDelay()
	{
		tipsDelay = 10;
	}

	// 时间循环器
	function TimeCycle()
	{
		if(tipsDelay > 0)
		{
			tipsDelay = tipsDelay - 1;
		}
		setTimeout(TimeCycle,200);
	}

	TimeCycle();  // 页面载入时，触发时间循环

	// 页面鼠标移动时，总时间超时后，自动隐藏提示信息
	function document.onmousemove()
	{
		if(tipsDelay <= 0)
		{
			HiddenTips();
		}
	}

	// 页面单击时，隐藏提示信息
	function document.onclick()
	{
		if(tipsDelay <= 8)
		{
			HiddenTips();
		}
	}

	// 设置提示框大小及位置
	function ResetTips()
	{
		// 清空大小及位置数值
		tips.style.left = "";
		tips.style.top = "";
		tips.style.width = "";
		tips.style.height = "";
		
		var x = document.body.scrollLeft + event.clientX;
		var y = document.body.scrollTop + event.clientY;
		
		// 设置提示框大小
		if(x < document.body.offsetWidth / 2 && tips.offsetWidth > document.body.offsetWidth - x)
		{
			tips.style.width = document.body.offsetWidth - x;
		}
		else if(x > document.body.offsetWidth / 2 && tips.offsetWidth > x)
		{
			tips.style.width = x;
		}
		
		if(y < document.body.offsetHeight / 2 && tips.offsetHeight > document.body.offsetHeight - y)
		{
			tips.style.height = document.body.offsetHeight - y;
		}
		else if(y > document.body.offsetHeight / 2 && tips.offsetHeight > y)
		{
			tips.style.height = y;
		}
		
		// 设置提示框位置
		if(x > document.body.offsetWidth - tips.offsetWidth - 10)
		{
			tips.style.left = x - tips.offsetWidth - 10;
		}
		else
		{
			tips.style.left = x + 10;
		}
		
		if(y > document.body.offsetHeight - tips.offsetHeight - 10)
		{
			tips.style.top = y - tips.offsetHeight - 10;
		}
		else
		{
			tips.style.top = y + 10;
		}
		
		// 再次修正提示框大小
		if(tips.offsetLeft < 0)
		{
			tips.style.width = tips.offsetWidth + tips.offsetLeft;
			tips.style.left = 0;
		}
		if(tips.offsetLeft + tips.offsetWidth > document.body.offsetWidth)
		{
			tips.style.width = document.body.offsetWidth - tips.offsetLeft;
			tips.style.left = document.body.offsetWidth - tips.offsetWidth;
		}
		
		if(tips.offsetTop < 0)
		{
			tips.style.height = tips.offsetHeight + tips.offsetTop;
			tips.style.top = 0;
		}
		if(tips.offsetTop + tips.offsetHeight > document.body.offsetHeight)
		{
			tips.style.height = document.body.offsetHeight - tips.offsetTop;
			tips.style.top = document.body.offsetHeight - tips.offsetHeight;
		}
	}

	// 显示或隐藏提示信息
	function ShowTips(strTips)
	{
		if(tips.style.visibility == "hidden")
		{
			tips.innerHTML = strTips;
			
			SetTipsDelay();  // 设置延时
			ResetTips();  // 设置大小及位置
			tips.style.visibility = "visible";
		}
	}

	// 隐藏提示信息
	function HiddenTips()
	{
		tips.style.visibility = "hidden";
	}

	// 提示信息跟随鼠标移动
	function MoveTips()
	{
		if(tips.style.visibility == "visible")
		{
			SetTipsDelay();  // 设置延时
			ResetTips();  // 设置大小及位置
		}
	}

	// 显示固定提示信息
	function FixTips(strTips)
	{
		tips.innerHTML = strTips;
		
		SetTipsDelay();  // 设置延时
		ResetTips();  // 设置大小及位置
		
		tips.style.visibility = "visible";
	}

	// @@@@@@@@@@@@@ 旧接口兼容 start @@@@@@@@@@@@@@@
	function showtips(strTips)
	{
		if(strTips != undefined && strTips != "")
		{
			ShowTips(strTips);
		}
		else
		{
			HiddenTips();
		}
	}
	
	function movetips()
	{
		MoveTips();
	}
	
	function fixtips(strTips)
	{
		FixTips(strTips);
	}
	// @@@@@@@@@@@@@ 旧接口兼容  end  @@@@@@@@@@@@@@@

/**
 * 提示信息模块 End
 *************************************************/
 
// 去掉字符串前后空格
String.prototype.Trim = function()
{
    return this.replace(/(^\s*)|(\s*$)/g, "");
}
String.prototype.LTrim = function()
{
    return this.replace(/(^\s*)/g, "");
}
String.prototype.RTrim = function()
{
    return this.replace(/(\s*$)/g, "");
}
