if(!Prototype.Browser.IE){
	alert("请使用Internet Explorer 浏览器!");
}
var buffalo=new Buffalo(endPoint+"/bsteel");
var alert_t=true;
function myloading(state){
	if(state){
		window.status="加载中...";
	}else{
		window.status="加载完成";
	}
}
buffalo.events["onLoading"]=myloading;
function myException(fault){
	if(fault.code=="com.bsteel.system.exception.RequiredLoginException"){
		if(alert_t){
			alert_t=false;
			alert("请先登录！");
			window.location.href=endPoint;
		}
	}
}
buffalo.events["onException"]=myException;

function myError(state){
	if(state){
		window.status="页面错误...";
	}else{
		window.status="页面错误..";
	}
}
buffalo.events["onError"]=myException;

function myTimeout(state){
	if(state){
		window.status="页面超时...";
	}else{
		window.status="页面超时..";
	}
}
buffalo.events["onTimeout"]=myTimeout;
function getAbsoluteHeight(ob){
	return ob.offsetHeight
}
function getAbsoluteWidth(ob){
	return ob.offsetWidth
}
function getAbsoluteLeft(ob){
	var s_el=0;
	el=ob;
	while(el){
		s_el=s_el+el.offsetLeft;
		el=el.offsetParent;
	}
	;
	return s_el
}
function getAbsoluteTop(ob){
	var s_el=0;
	el=ob;
	while(el){
		s_el=s_el+el.offsetTop;
		el=el.offsetParent;
	}
	;
	return s_el
}
function $N(){
	return document.getElementsByName(arguments[0]);
}
function $T(){ // $T('input','box')
	if(arguments.length==1){
		return document.getElementsByTagName(arguments[0]);
	}else if(arguments.length==2){
		if(typeof(arguments[1])=="object"){
			return arguments[1].getElementsByTagName(arguments[0]);
		}else{
			return $(arguments[1]).getElementsByTagName(arguments[0]);
		}
	}
}
/**
 * 在html指定的元素上加两个事件:onmouseover和onmouseout;
 * 另外一个要显示的内容放在div中,此div的id为:事件元素的ID+"_title";
 * <a href="javascript:void;" id="testid${i}" onmouseover="sWindow(this);" onmouseout="CloseDiv();">鼠标移到我身上</a>
 * <div id="testid${i}_title" style="display:none;"></div>
 * @type {}
 */
var sWindowPup=null;
function showWzmsDiv(obj,gg,wzstr1,wzstr2){
	var str="<table><tr><td><b>规&nbsp;&nbsp;&nbsp;</b>&nbsp;<b>格:</b></td><td>"+gg+"</td></tr>"
						+"<tr><td><b>质量等级:</b></td><td>"+wzstr1+"</td></tr>"
						+"<tr><td><b>执行标准:</b></td><td>"+wzstr2+"</td></tr>"
						+"</table>";
	sWindow(obj,str,'200px')
}

function showhzDiv(obj,str){
	sWindow(obj,str,'300px')
}

function sWindow(obj,str,widthstr){
	this.sWindowPup=$("s_window_pup");
	if(this.oProgressLayer==null){
		var el=document.createElement('DIV');
		el.setAttribute("id","s_window_pup");
		with (el.style){
			width=widthstr;
			height='100px';
			position='absolute';
			left=getAbsoluteLeft(obj) + getAbsoluteWidth(obj);
			top=getAbsoluteHeight(obj)+ getAbsoluteTop(obj);
			backgroundColor='#ffff99';//'buttonFace';
			borderLeft='solid 1px silver';
			borderTop='solid 1px silver';
			borderRight='solid 1px gray';
			borderBottom='solid 1px gray';
			fontWeight='600';
			fontSize='13px';
			opacity='0.5';
			filter='alpha(opacity=100)';
			zIndex='299999';
			color='#000000';			
		}
		el.innerHTML=str;
		document.body.appendChild(el);
		this.sWindowPup=el;
	}else{
		this.sWindowPup.style.display="block";
	}
}
function CloseDiv(){
	if(sWindowPup){
		sWindowPup.style.display="none";
		sWindowPup.removeNode(true);
		sWindowPup=null;
	}
}
function doSelectAll(str,obj){
	$A($N(str)).each(function(node){
		if(obj.checked){
			node.checked=true;
		}else{
			node.checked=false;
		}
	});
}
function doUnSelectAll(str){
	$A($N(str)).each(function(node){
		if(node.checked){
			node.checked=false;
		}else{
			node.checked=true;
		}
	});
}
function doMsg(){
	$("msg").style.cssText="color:red;font-size:8pt";
	window.setTimeout('$("msg").style.cssText="display:none"',3000);
}
function RTrim(_str){
	var whitespace=new String(" \t\n\r");
	var s=new String(_str);
	if(whitespace.indexOf(s.charAt(s.length-1))!=-1){
		var i=s.length-1;
		while(i>=0&&whitespace.indexOf(s.charAt(i))!=-1){
			i--;
		}
		s=s.substring(0,i+1);
	}
	return s.toString();
}
/*******************************************************************************
 * // 设置网页上所有元素为不可响应事件，以及设置鼠标光标为wait
 ******************************************************************************/
function SetBusy(){
	$A($N('button_name')).each(function(node){
		try{
			node.style.oldCursor=node.style.cursor;
			node.style.cursor='wait';			
		}catch(e){
		}
		node.disabled=true;
	});
}
/*******************************************************************************
 * // 恢复网页上所有元素可以响应事件，以及设置鼠标光标默认光标
 ******************************************************************************/
function ReleaseBusy(){
	$A($N('button_name')).each(function(node){
		node.disabled=false;
		try{
			node.style.cursor="pointer";
		}catch(e){
		}
	});
}
var oProgressLayer=null;
/*******************************************************************************
 * // 关闭“正在处理"对话框
 ******************************************************************************/
function HideProgressInfo(t){
	if(oProgressLayer){
		if(t){
			//ReleaseBusy();
		}
		oProgressLayer.style.display="none";
		oProgressLayer=null;
	}
}
/*******************************************************************************
 * // 显示“正在处理”对话框 进度条样式
 ******************************************************************************/
function ShowProgressInfo(message,t){
	if(t){
		//SetBusy();
	}
	HideProgressInfo(true);
	this.oProgressLayer=$("jyzx_loading");
	if(this.oProgressLayer==null){
		var el=document.createElement('DIV');
		el.setAttribute("id","jyzx_loading");
		with (el.style){
			width='180px';
			height='50px';
			position='absolute';
			left=(document.body.clientWidth-180)>>1;
			top=(document.body.clientHeight-50)>>1;
			backgroundColor='buttonFace';
			borderLeft='solid 1px silver';
			borderTop='solid 1px silver';
			borderRight='solid 1px gray';
			borderBottom='solid 1px gray';
			fontWeight='700';
			fontSize='13px';
			zIndex='1999';
		}
		el.innerHTML='<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%"><tr><td align="center" valign="middle">'
				+'<img src="/webdocs/images/20071116214333291.gif" width="32" height="32" /></td>'
				+'<td><font size="2">'
				+message
				+'</font></td></tr></table>';
		document.body.appendChild(el);
		this.oProgressLayer=el;
	}else{
		this.oProgressLayer.style.display="block";
	}
}
function ms_dispnav(){
	if(arguments.length<2) return;
	var tell=arguments[0];
	for(var i=1;i<arguments.length;i++){
		var nav=document.getElementById(arguments[i]+"_nav");
		var content=document.getElementById(arguments[i]+"_content");
		if(!nav|!content) continue;
		if(tell==i){
			nav.className=i==arguments.length-1?"active end":"active";
			content.style.display="";
		}else{
			nav.className=i==arguments.length-1?"normal end":"normal";
			content.style.display="none";
		}
	}
}