//action:统一界面触发事件 
//author:gbw
function getHelp()
{
	var targetVal = document.all.helpTab.style.display;
	if(targetVal == "none")
	{
		document.all.helpTab.style.display = "";
	}
	else if(targetVal == "")
	{
		document.all.helpTab.style.display = "none";
	}
}

function add()
{	
	var targeturl = document.forms[0];
	targeturl.method.value = "addItem";
	targeturl.submit();
}

function edit()
{	
	var targeturl = document.forms[0];
	if(targeturl[targeturl.idName.value].value=='' || targeturl[targeturl.idName.value].value == "0")
	{
		alert("请选择一条记录！");
		return false;
	}
	targeturl.method.value="edit";	
	targeturl.submit();
}

function del()
{	
	var targeturl = document.forms[0];
	if(targeturl[targeturl.idName.value].value=='' || targeturl[targeturl.idName.value].value == "0")
	{
		alert("请选择一条记录！");
		return false;
	}
	if( confirm("确认删除吗？") )
	{
		targeturl.method.value = "delete";	
		targeturl.submit();
	}
}

function revert()
{	
	var targeturl = document.forms[0];
	if( targeturl[targeturl.idName.value].value == "0" )
	{
		alert("请选择一条记录！");
		return false;
	}
	if( confirm("确认还原吗？") )
	{
		targeturl.method.value = "revert";	
		targeturl.submit();
	}
}

function deploy()
{	
	var targeturl = document.forms[0];
	if( confirm("确认部署吗？") )
	{
		targeturl.method.value = "deploy";	
		targeturl.submit();
	}
}

function show()
{
	var targeturl = document.forms[0];
	if(targeturl[targeturl.idName.value].value=='' || targeturl[targeturl.idName.value].value == "0")
	{
		alert("请选择一条记录！");
		return false;
	}
	targeturl.method.value = "show";
	targeturl.submit();
}
function selected(obj)
{
	//alert(1);
	var targeturl = document.forms[0];
	targeturl[targeturl.idName.value].value = obj.cells[0].innerText;
}

function cancel(key)
{
	var targeturl = document.forms[0];
	if (document.all.pendFlag != undefined){
		if (document.all.pendFlag.value == "1"){
			parent.parent.frames[2].location="base/body_content_page.jsp?jspUrl=null";
			if (key == undefined) parent.parent.frames[2].location="base/body_content_page.jsp?jspUrl=null";
			else parent.parent.frames[2].location=key + "base/body_content_page.jsp?jspUrl=null";
		}
		else{
			window.location=targeturl.action+"?method=list&menuFormId="+targeturl.menuFormId.value;
		}
	}
	else{
		window.location=targeturl.action+"?method=list&menuFormId="+targeturl.menuFormId.value;
	}
}

function issue()
{
	var targeturl = document.forms[0];
	targeturl.method.value="issue";
	targeturl.submit();
}

function updateissue()
{
	var targeturl = document.forms[0];
	targeturl.method.value="updateissue";
	targeturl.submit();
}
function selected_1(){
	var targeturl = document.forms[0];
	targeturl.selectedIds.value="";
	for(var i=0;i<targeturl.Selections.length;i++){
		if(targeturl.Selections[i].checked==true)
		targeturl.selectedIds.value +=targeturl.Selections[i].value+",";
	}
}

function onCheck(obj)
{
	if ( !obj.checked )
		{
			obj.checked = "";
			obj.value = "N";
		}
	else
		{
			obj.checked = "checked";
			obj.value= "Y";
		}
}
function openMainPageUrl(url)
{
	//alert(url);
	var txt = "menubar=no,location=no,scrollbars=no,resizable=no,left=10,top=20,center=0,width='+(screen.width-30)+',height='+(screen.height-70)"
	window.open(url,'Folder',txt);
}
function vehAudit()
{	
	var targeturl = document.forms[0];
	if( targeturl[targeturl.idName.value].value == "0" )
	{
		alert("请选择一条记录！");
		return false;
	}
	targeturl.method.value="vehAudit";	
	targeturl.submit();
}

function vehReturn()
{	
	var targeturl = document.forms[0];
	if( targeturl[targeturl.idName.value].value == "0" )
	{
		alert("请选择一条记录！");
		return false;
	}
	targeturl.method.value="vehReturn";	
	targeturl.submit();
}

function exportExcell()
{	
	var targeturl = document.forms[0];
	targeturl.method.value="exportExcell";	
	targeturl.submit();
}

function goCancel(path)
{
	window.location=path+"/common/cancel_info_form.jsp";
}
