function showCalendar(obj)
{
	var vdate =	window.showModalDialog("../../js/calendar.htm","Dialog Box Arguments # 2","dialogHeight: 280px; dialogWidth: 260px;  edge: Raised; center: Yes; help: No; resizable: Yes; status: No; scroll:No");
	if (vdate != null && vdate != "") obj.value = vdate;
}

function showCalendar2(obj, form)
{
	var vdate =	window.showModalDialog("../../js/calendar.htm","Dialog Box Arguments # 2","dialogHeight: 280px; dialogWidth: 260px;  edge: Raised; center: Yes; help: No; resizable: Yes; status: No; scroll:No");
	if (vdate != null && vdate != "") obj.value = vdate;
	form.submit();
}

var active = "#FFFFEC" ;

function MOver(obj)
{
	oldbg = obj.style.backgroundColor ;
	obj.style.backgroundColor = active;
	//obj.style.cursor = "hand";
	//alert(oldbg);
}
function MOut(obj)
{
	obj.style.backgroundColor = oldbg ;
}

function goPage(){

	if (document.pageNavi.pageId.value != "") {
		document.pageNavi.submit();
	}
}
function firstPage()
{
	document.pageNavi.pageId.value = 1;
	document.pageNavi.submit();
}

function nextPage()
{
	document.pageNavi.pageId.value = parseInt(document.pageNavi.pageId.value) + 1;
	document.pageNavi.submit();
}

function prePage()
{
	document.pageNavi.pageId.value = parseInt(document.pageNavi.pageId.value) - 1;
	document.pageNavi.submit();
}

function lastPage()
{
	document.pageNavi.pageId.value = document.pageNavi.maxpage.value ;
	document.pageNavi.submit();
}
function resetPage()
{
	document.pageNavi.totalRecord.value = -1;
	document.pageNavi.pageId.value = 1 ;
}
function tab(area,id) {
	//className分大小写的
	var tabArea=document.getElementById(area);
	var contents=tabArea.childNodes;

	for(i=0; i<contents.length; i++) {
		//alert(contents[i].tagName) ;
		if(contents[i].tagName=='UL' ){
			contents[i].style.display='none';
		}

		if (contents[i].tagName == "H3" || contents[i].tagName == "H5") {
			var c=contents[i].getElementsByTagName("a");
			for(j=0; j<c.length; j++) {
					c[j].className='tab';
			}
			c[id].className = "tabon" ;
			c[id].hideFocus = true;
		}

	}
		tabArea.getElementsByTagName('ul')[id].style.display='';
		//tabArea.getElementsByTagName('ul')[id].blur();
}


function tabs(area,id) {
	//className分大小写的
	var tabArea=document.getElementById(area);
	var contents=tabArea.childNodes;
	var k = -1 ;
	for(i=0; i<contents.length; i++) {

		if(contents[i].className=='tabDiv'){
			k++ ;
			if (k == id){
				contents[i].style.display='';
				//alert("show" + i)
			}else{
				contents[i].style.display='none';	
				//alert("hidde" + i)
			}
			contents[i].blur();
		}

		if (contents[i].tagName == "H3" || contents[i].tagName == "H5") {
			var c=contents[i].getElementsByTagName("a");
			for(j=0; j<c.length; j++) {
					c[j].className='tab';
			}
			c[id].className = "tabon" ;
			c[id].hideFocus = true;
		}

	}

		
}

function toggleGroup(groups,group, button) {
	var groupsE=document.getElementById(groups);
	if (groupsE.style.display=='' && groupsE.title == group){
		groupsE.style.display = 'none' ;
	}else{
		groupsE.style.display = '' ;
		var contents=groupsE.childNodes;
		for(var i=0; i<contents.length; i++) {
			if (contents[i].group == group || contents[i].group == "common"  ){
				contents[i].style.display='';
			}else{
				contents[i].style.display='none';
			}
		}
	}
	//处理切换按钮的显示
	if (button) {
		var buttonParent = button.parentElement ;
		var links=buttonParent.getElementsByTagName("a");
		for(var j=0; j<links.length; j++) {
			links[j].className='tab';
		}
		if (groupsE.style.display=='') {
			button.className = "tabon" ;
			button.hideFocus = true;
		}
	}
	groupsE.title = group ;
}

function toggleGroup2(groups,group, button) {
	var groupsE=document.getElementById(groups);
	if (groupsE.style.display=='' && groupsE.title == group){
		groupsE.style.display = 'none' ;
	}else{
		groupsE.style.display = '' ;
		var contents=groupsE.childNodes;
		for(var i=0; i<contents.length; i++) {
			if (contents[i].group == group || contents[i].group == "common"  ){
				contents[i].style.display='';
			}else{
				contents[i].style.display='none';
			}
		}
	}
	//处理切换按钮的显示
	if (button) {
		if (groupsE.style.display=='') {
			button.style.display = '' ;
		}else{
			button.style.display = 'none';
		}
	}
	groupsE.title = group ;
}

function showGroup(groups,group) {
	var groupsE=document.getElementById(groups);
		groupsE.style.display = '' ;
		var contents=groupsE.childNodes;
		for(var i=0; i<contents.length; i++) {
			if (contents[i].group == group || contents[i].group == "common"  ){
				contents[i].style.display='';
			}else{
				contents[i].style.display='none';
			}
		}

}

document.onkeydown=function() {
  if(event.keyCode==13 && event.srcElement.type!='textarea' && event.srcElement.type!='')
	 event.keyCode=9;
}

function switchDisplay(selectE, flag, target) {
	var targetE = document.getElementById(target);
	if (selectE.value == flag){
		targetE.style.display = '' ;
	}else{
		targetE.style.display = 'none' ;
	}
}


