
function displaystr(){
	var teambjid = document.getElementById("teambjid");
	teambjid.style.display = "block";
}

function hidestr(){
var teambjid = document.getElementById("teambjid");
	teambjid.style.display = "none";
}

function addbjcontent(teamdbid, proname){
	var teambjid = document.getElementById("teambjid");
	teambjid.style.display = "block";
	
	var mainTable = document.getElementById("listTable");
	
	var teamvalue = document.getElementsByName("teamdbid_teamdbid");

	if(teamvalue.length>=3){
		alert("最多只能比较3个团!");
		return false;
	}
	for (var i=0; i<teamvalue.length; i++) {
		if(teamvalue[i].value == teamdbid){
			alert("此团已添加，不能再次添加!");
			return false;
		}
	}

	var newRow = mainTable.insertRow(-1);	

	var col0 = newRow.insertCell(0); 
	var col1 = newRow.insertCell(1); 
	var col2 = newRow.insertCell(2); 

	col0.innerHTML="<input type='hidden' name='teamdbid_teamdbid' id='teamdbid"+teamdbid+"' value='"+teamdbid+"'>";
	col1.innerHTML="<div width='183' height='24' align='right'>"+proname+"</div>";
	col2.innerHTML="<a style='cursor:hpointer;' onclick=\"javascript:deletebjcontent('"+teamdbid+"',this)\"><img src= '/jsp/caissa/second/images/pop_2.jpg' width='15' height='15'/></a>";
	ISECProIssueInfoBs.insertBJTeam(teamdbid,proname);

}

function deletebjcontent(teamdbid,obj){

	var rownum = obj.parentElement.parentElement.rowIndex;
	var mainTable = document.getElementById("listTable");

	if(eval("document.forms[0].teamdbid"+ teamdbid).value == teamdbid){
		mainTable.deleteRow(rownum);
	}

	ISECProIssueInfoBs.deleteBJTeam(teamdbid);
}
function getCompareTeamids(){ //得到比较的团dbid,进入比较页面
	var teamvalue = document.getElementsByName("teamdbid_teamdbid");
	var ids="";
	if(teamvalue.length<=1){
		alert("请选择至少两条记录！");
	}else{
		for(var i=0;i<teamvalue.length;i++){
			ids+=teamvalue[i].value;
			if(i!=teamvalue.length-1){
				ids+=",";
			}
		}
		ISECProIssueInfoBs.clearSession();//清楚session中的值
		//form.action="SECProductAction.do?cmd=comparePro&ids="+ids+"&topmenu=3";
		//form.submit();
		window.parent.location.href="/SECProductAction.do?cmd=comparePro&ids="+ids+"&topmenu=3";
	}
}

