function switchSysBar(){
	if (switchPoint.innerText==3){
		switchPoint.innerText=4
		document.all("frmTitle").style.display="none"
		top.content.cols="10,*"
	}
	else{
		switchPoint.innerText=3
		document.all("frmTitle").style.display=""
		top.content.cols="130,*"
	}
}

function expandTopFrame(){
	if (typeof(frmright)!="undefined"){
 		if (typeof(frmright.frmMain)!="undefined") {
				frmright.frmMain.rows="*,35"
		}
	}
}

function expandBottomFrame(){
	if (typeof(frmright)!="undefined"){
 		if (typeof(frmright.frmMain)!="undefined") {
				frmright.frmMain.rows="65,*"
		}
	}
}

function restoreSplit(){
	if (typeof(frmright)!="undefined"){
 		if (typeof(frmright.frmMain)!="undefined") {
				frmright.frmMain.rows="*,220"
		}
	}

}
function  menu(id)
{
	if (id.style.display=="none")
		{id.style.display="block";}
	else
		{id.style.display="none";}
}


var isDOM      = (typeof(document.getElementsByTagName) != 'undefined') ? 1 : 0;
var isIE4      = ((typeof(document.all) != 'undefined') && (parseInt(navigator.appVersion) >= 4)) ? 1 : 0;
var isNS4      = (typeof(document.layers) != 'undefined') ? 1 : 0;
var capable    = (isDOM || isIE4 || isNS4) ? 1 : 0;
    // Uggly fix for Konqueror and Opera that are not fully DOM compliant
if (capable && typeof(navigator.userAgent) != 'undefined') {
	var browserName = ' ' + navigator.userAgent.toLowerCase();
		if (browserName.indexOf('opera') > 0 || browserName.indexOf('konqueror') > 0) {
			capable = 0;
        }
}

function getImgName(imgSrc){
	var position=imgSrc.lastIndexOf('/');
	if(position==-1){
		return imgSrc;
	}
	var imgStr=imgSrc.substring(position+1,imgSrc.length);
	return imgStr;
}

var imgOpened    = new Image(20,20);
imgOpened.src='../images/openedfolder.gif';
var imgOpenedStr=getImgName(imgOpened.src);
var imgClosed    = new Image(20,20);
imgClosed.src='../images/closedfolder.gif';
var imgClosedStr=getImgName(imgClosed.src);
var imgTplus    = new Image(20,20);
imgTplus.src='../images/Tplus.gif';
var imgTplusStr=getImgName(imgTplus.src);
var imgTminus    = new Image(20,20);
imgTminus.src='../images/Tminus.gif';
var imgTminusStr=getImgName(imgTminus.src);
var imgLplus    = new Image(20,20);
imgLplus.src='../images/Lplus.gif';
var imgLplusStr=getImgName(imgLplus.src);
var imgLminus    = new Image(20,20);
imgLminus.src='../images/Lminus.gif';
var imgLminusStr=getImgName(imgLminus.src);
var imgTplus_1    = new Image(20,20);
imgTplus_1.src='../images/Tplus_1.gif';
var imgTplus_1Str=getImgName(imgTplus_1.src);
var imgTminus_1    = new Image(20,20);
imgTminus_1.src='../images/Tminus_1.gif';
var imgTminus_1Str=getImgName(imgTminus_1.src);
var imgTplus_2    = new Image(20,20);
imgTplus_2.src='../images/Tplus_2.gif';
var imgTplus_2Str=getImgName(imgTplus_2.src);
var imgTminus_2    = new Image(20,20);
imgTminus_2.src='../images/Tminus_2.gif';
var imgTminus_2Str=getImgName(imgTminus_2.src);

//	window.alert("isDOM="+isDOM);
//	window.alert("isIE4="+isIE4);
//	window.alert("isNS4="+isNS4);

//展开菜单
function expand(elementId,unexpand) {
	ElementChildId=elementId+"Child";
	var stateImage;
	var oImage;
	if (isDOM) {
	    var whichEl = document.getElementById(ElementChildId);
	    var whichIm = document.getElementById('Img'+elementId);
		stateImage = document.getElementById('stateImage' + elementId);
	    if (whichEl.style.display == 'none' && whichIm) {
	      whichEl.style.display  = 'block';
		  expandImg(stateImage,whichIm);
	    }
	    else if (unexpand) {
	      whichEl.style.display  = 'none';
		  shrinkImg(stateImage,whichIm);
	    }
	} // end of the DOM case
	else if (isIE4) {
	    var whichEl = document.all(ElementChildId);
	    var whichIm = document.images.item('Img'+elementId);
		stateImage = document.all("stateImage" + elementId);
	    if (whichEl.style.display == 'none') {
	      whichEl.style.display  = 'block';
		  expandImg(stateImage,whichIm);
	    }
	    else if (unexpand) {
	      whichEl.style.display  = 'none';
		  shrinkImg(stateImage,whichIm);
	    }
	} // end of the IE4 case
	else if (isNS4) {
	    var whichEl = document.layers[ElementChildId];
	    var whichIm = document.layers[elementId].document.images['Img'+elementId];
		stateImage = document.layers[elementId].document.images['stateImage' + elementId];
	    if (whichEl.visibility == 'hide') {
	      whichEl.visibility  = 'show';
		  expandImg(stateImage,whichIm);
	    }
	    else if (unexpand) {
	      whichEl.visibility  = 'hide';
		  shrinkImg(stateImage,whichIm);
	    }
	} // end of the NS4 case
}

function expandImg(stateImage,whichIm){
	  if(stateImage)
	  {
		var stateImgSrc=stateImage.src.toString();
		var whichImgSrc=whichIm.src.toString();
		var stateImgStr=getImgName(stateImgSrc);
		var whichImgStr=getImgName(whichImgSrc);
		if(stateImgStr==imgTplusStr){
			stateImage.src=imgTminus.src;
		}
		else if(stateImgStr==imgLplusStr){
			stateImage.src=imgLminus.src;
		}
		else if(stateImgStr==imgTplus_1Str){
			stateImage.src=imgTminus_1.src;
		}
		else{
			stateImage.src=imgTminus_2.src;
		}
		if(whichImgStr==imgClosedStr){
			whichIm.src=imgOpened.src;
		}
	  }
}

function shrinkImg(stateImage,whichIm){
	if(stateImage)
	{
		var stateImgSrc=stateImage.src.toString();
		var whichImgSrc=whichIm.src.toString();
		var stateImgStr=getImgName(stateImgSrc);
		var whichImgStr=getImgName(whichImgSrc);
		if(stateImgStr==imgTminusStr){
			stateImage.src=imgTplus.src;
		}
		else if(stateImgStr==imgLminusStr){
			stateImage.src=imgLplus.src;
		}
		else if(stateImgStr==imgTminus_1Str){
			stateImage.src=imgTplus_1.src;
		}
		else{
			stateImage.src=imgTplus_2.src;
		}
		if(whichImgStr==imgOpenedStr){
			whichIm.src=imgClosed.src;
		}
	}
}

//查找上级的div节点
function getSuperObj(obj,objTagName) //only work on IE
{
	var findObj=null;
	if(obj.parentElement.tagName== objTagName)
	{
		findObj=obj.parentElement;
		return findObj;
	}
	//如果找到了网页体没有找到要找的节点名称的话，返回一个null
	else if(obj.parentElement.tagName=="BODY")
	{
		return null;
	}
	else
	{
		findObj=getSuperObj(obj.parentElement,objTagName);
	}
	return findObj;
}

//判断一个复选框是否被选中,0为没有复选框，1为复选框选中，2为复选框没有选中
function JudgeCheck(obj) //only work on IE
{
	CheckChilds=obj.getElementsByTagName("input");
	if(CheckChilds.length==0)
	{
		return 0;
	}
	else
	{
		if(CheckChilds.item(0).checked==true) return 1;
		else return 2;
	}
}
//处理上级的复选框情况
function ProcessSurperCheck(obj,flag) //only work on IE
{

	objDiv=getSuperObj(obj,"DIV");
	if(objDiv!=null)
	{
		var SurPerCheck=null;
		for(i=0; i < objDiv.childNodes.length; i++)
		{
			if(objDiv.childNodes(i).tagName == "TABLE")
			{
				SurPerCheckChilds=objDiv.childNodes(i).getElementsByTagName("input");
				if(SurPerCheckChilds.length==1)
				{
					SurPerCheck=SurPerCheckChilds.item(0);
					SurPerCheck.checked=flag;
				}
				continue;
			}
			else (objDiv.childNodes(i).tagName == "DIV")
			{
				if(JudgeCheck(objDiv.childNodes(i))==1)
				{
					if(SurPerCheck!=null) SurPerCheck.checked=true;
					break;
				}
			}
		}
		if(objDiv.id != "folderTree")
		{
			ProcessSurperCheck(objDiv,flag);
		}
	}
}
//处理下级的复选框情况
function ProcessSubCheck(obj,flag) //only work on IE
{
	CheckChilds=obj.getElementsByTagName("input");
	for(var i=0;i<CheckChilds.length;i++)
	{
		CheckChilds.item(i).checked=flag;
	}
}

function checkSuperAndSub(obj,checkSuper,checkSub,id,superId){
	var flag=false;
	flag=obj.checked;
	if(isIE4){
	 	var parentObj=getSuperObj(obj,"DIV");
	 	if(parentObj!=null)
	 	{
			if(checkSuper){
		 		//开始处理上级选择框
		 		 ProcessSurperCheck(parentObj,flag);
			}
			if(checkSub){
		 		 //开始处理下级选择框
		 		 ProcessSubCheck(parentObj,flag);
			}
	 	}
	}
}

	if (capable) {
		with (document) {
    // Brian Birtles : This is not the ideal method of doing this
    // but under the 7th June '00 Mozilla build (and many before
    // it) Mozilla did not treat text between <style> tags as
    // style information unless it was written with the one call
    // to write().
		    if (isDOM) {
				var lstyle = '<style type="text\/css">'
                 + '<!--'
                 + 'div {color: #000000;}'
                 + '.parent { font-size: 12px; text-decoration:none; display: block}'
                 + '.child { font-size: 12px; text-decoration:none; display: none}'
                 + '.treeHref{ text-decoration: none; font-size: 12px;color: #000000;}'
                 + '.treeTD {PADDING-LEFT: 5px;FONT-SIZE: 12px;}'
                 + '\/\/-->'
                 + '<\/style>';
				write(lstyle);
			}
		    else {
		      writeln('<style type="text\/css">');
		      writeln('<!--');
		      writeln('div {color: #000000; }');
		      if (isIE4) {
		        writeln('.parent { font-size: 12px; text-decoration: none; display: block}');
		        writeln('.child { font-size: 12px; text-decoration: none; display: none}');
		        writeln('.treeHref{ text-decoration: none; font-size: 12px;color: #000000;}');
		        writeln('.treeTD {PADDING-LEFT: 5px;FONT-SIZE: 12px;}');
		      }
		      else {
		        writeln('.parent { font-size: 12px; text-decoration: none; position: absolute; visibility: hidden}');
		        writeln('.child { font-size: 12px; position: absolute; visibility: hidden}');
		        writeln('.treeHref{ text-decoration: none; font-size: 12px;color: #000000;}');
		        writeln('.treeTD {PADDING-LEFT: 5px;FONT-SIZE: 12px;}');
		      }
		      writeln('\/\/-->');
		      writeln('<\/style>');
		    }
		}
	}
	else {
	  with (document) {
	    writeln('<style type="text\/css">');
	    writeln('<!--');
	    writeln('div {color: #000000; }');
	    writeln('.parent { font-size: 12px;text-decoration: none}');
	    writeln('.child { font-size: 12px; text-decoration: none; display: none}');
		writeln('.treeHref{ text-decoration: none; font-size: 12px;color: #000000;}');
		writeln('.treeTD {PADDING-LEFT: 5px;FONT-SIZE: 12px;}');
	    writeln('\/\/-->');
	    writeln('<\/style>');
	  }
	}
	
function showtable(tableid)
{
whichtable=eval("table"+tableid);
if(whichtable.style.display=="none")
{eval("table"+tableid+".style.display=\"\";");}
else
{eval("table"+tableid+".style.display=\"none\";");}
}	

function expandImg2(stateImage,whichIm){
	  if(stateImage)
	  {
		var stateImgSrc=stateImage.src.toString();
		var whichImgSrc=whichIm.src.toString();
		var stateImgStr=getImgName(stateImgSrc);
		var whichImgStr=getImgName(whichImgSrc);
		if(stateImgStr==imgTplusStr){
			stateImage.src=imgTminus.src;
		}
		else if(stateImgStr==imgLplusStr){
			stateImage.src=imgLminus.src;
		}
		else if(stateImgStr==imgTplus_1Str){
			stateImage.src=imgTminus_1.src;
		}
		else{
			stateImage.src=imgTminus_2.src;
		}
		if(whichImgStr==imgClosedStr){
			whichIm.src=imgOpened.src;
		}
	  }
}
	// end of adding styles
