////////////////////////////////////////////////////
/*
*   Copyright By www.jspsoft.cn
*
*	版权所有   llc@jspsoft.cn
*   
*    2009-12-20
*
*/
////////////////////////////////////////////////////////////////////////////////////////
//系统常量定义
//提交处理url以及需要登录的登录页面url
var post_action_url="/pub/ajax/";
var input_login_url="/app/login_dlg.htm";
var SITE_NAME="";

//判断浏览器
var Browser = new Object();
Browser.isMozilla = (typeof document.implementation != 'undefined') && (typeof document.implementation.createDocument != 'undefined') && (typeof HTMLDocument!='undefined');
Browser.isIE = window.ActiveXObject ? true : false;
Browser.isFirefox = (navigator.userAgent.toLowerCase().indexOf("firefox")!=-1);
Browser.isOpera = (navigator.userAgent.toLowerCase().indexOf("opera")!=-1);
//entend Event Mod for FireFox
if(Browser.isFirefox)extendEventObject();


//document.write("<script language=\"VBScript\" type=\"text/vbscript\" src=\"/web/pwd.vbs\"></script>");

function extendEventObject() {
	Event.prototype.__defineGetter__("srcElement", function () {
		var node = this.target;
		while (node.nodeType != 1) node = node.parentNode;
		return node;
	});
	Event.prototype.__defineGetter__("fromElement", function () {
		var node;
		if (this.type == "mouseover")
			node = this.relatedTarget;
		else if (this.type == "mouseout")
			node = this.target;
		if (!node) return;
		while (node.nodeType != 1) node = node.parentNode;
		return node;
	});
	Event.prototype.__defineGetter__("toElement", function () {
		var node;
		if (this.type == "mouseout")
			node = this.relatedTarget;
		else if (this.type == "mouseover")
			node = this.target;
		if (!node) return;
		while (node.nodeType != 1) node = node.parentNode;
		return node;
	});
}
////////////////////////////////////////////////////////////////////////////////////////
//替换索引位置字符串
String.prototype.format=function(){if(arguments.length==0)return this;for(var s=this, i=0;i<arguments.length;i++)s=s.replace(new RegExp("\\$"+i+"\\$","g"), arguments[i]);return s;};
//判断邮件字符格式
String.prototype.isEmail=function(){vEMail=this;var regInvalid=/(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;var regValid=/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;return(!regInvalid.test(vEMail)&&regValid.test(vEMail));}
//判断字符串长度是否在指定长度范围内
String.prototype.isInRange=function(min_len11,max_len11){var str=this;if(str==null||str=="")return min_len11<0;return(str.length>=min_len11&&str.length<=max_len11);}
//escape编码
String.prototype.escape=function(){return escape(this);}
//unescape编码
String.prototype.unescape=function(){return unescape(this);}
//trim
String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,'');}
//trim
String.prototype.encode=function(){return this.replace(/(^\s*)|(\s*$)/g,'');}
//文本替换
String.prototype.replaceAll=function(searchArray,replaceArray){var replaced=this;for(var i=0;i<searchArray.length;i++){replaced=replaced.replace(searchArray[i],replaceArray[i]);}return replaced ;}
String.prototype.startsWith=function(A){return(this.substr(0,A.length)==A);};
String.prototype.endsWith=function(A,B){var C=this.length;var D=A.length;if(D>C)return false;if(B){var E=new RegExp(A+'$','i');return E.test(this);}else return(D==0||this.substr(C-D,D)==A);};
/*** 检查是否由数字组成 ***/
String.prototype.isDigit=function(){var s=this.trim();return(s.replace(/\d/g,"").length==0);} 
/*** 检查是否由数字字母和下划线组成 ***/ 
String.prototype.isAlpha=function(){return(this.replace(/\w/g,"").length==0);}
/*** 检查是否为数 ***/ 
String.prototype.isNumber=function(){var s=this.trim();return(s.search(/^[+-]?[0-9.]*$/)>=0);}
/*** 返回字节数 ***/ 
String.prototype.lenb=function(){return this.replace(/[^\x00-\xff]/g,"**").length;}
/*** 检查是否包含汉字 ***/ 
String.prototype.isInChinese=function(){return(this.length!=this.replace(/[^\x00-\xff]/g,"**").length);}
//属性继承
Object.prototype.extend=function(object){for(property in object){this[property]=object[property];}return this;}
//函数绑定
Function.prototype.bind=function(object){var method=this;return function(){method.apply(object, arguments);}}
//事件绑定
Function.prototype.bindAsEventListener=function(object){var method=this;return function(event){method.call(object, event||window.event);}}
if(!Array.prototype.push){
  Array.prototype.push=function(){
		var startLength=this.length;
		for(var i=0;i<arguments.length;i++)
      this[startLength+i]=arguments[i];
	  return this.length;
  }
}
if(!Function.prototype.apply){
	Function.prototype.apply=function(object, parameters){
		var parameterStrings=new Array();
		if(!object)    object=window;
		if(!parameters)parameters=new Array();

		for(var i=0;i<parameters.length;i++)parameterStrings[i]='x['+i+']';

		object.__apply__=this;
		var result=eval('obj.__apply__('+parameterStrings[i].join(', ')+')');
		object.__apply__=null;
		return result;
	}
}
/******************************时间格式******************************/
function testUrl(str){
	var illegalChar=/^(.*)['"‘“<>](.*)$/;
	if(illegalChar.test(str))return false;
	else return true;
}
//检查日期格式（xxxx-xx-xx）
function checkDateFormat(str){
	var format=/^\d{4}\-\d{2}\-\d{2}$/;
	if(format.test(str))return true;
	else return false;
}
//检查生日是否正确，应该小于今天
function checkBirthday(str){
	var today=new Date();
	var barray=str.split(new RegExp("-", "g"));
	var birthday=new Date(barray[0], barray[1] - 1 , barray[2]);
	if(parseInt(barray[0])<1900)return -1;
	if(birthday.getTime()>today.getTime())return 1;
	else if(birthday.getFullYear()<1900)return -1;
	else return 0;
}
//从html代码中提取文本
function extractHtmlText(content){
	var regstr=new String("<[^<>]*>"); 
	var reg1=new RegExp(regstr,"ig");			
	if(reg1.test(content))content=content.replace(reg1,"");
	regstr=new String("(&nbsp;)|(&lt;)|(&gt;)|(&amp;)|(&quot;)"); 
	reg1=new RegExp(regstr,"ig");	
	if(reg1.test(content))content=content.replace(reg1,"");
	return content;
}
function replaceLineBreak(str){
	return str.replace("\n", "<br>");
}
//显示格式：月:日 时:分
function getShortDateTime(str){
	var d=new Date(str);
	var monthInt=d.getMonth()+1;
	var month=monthInt.toString();
	if(month.length<2)month="0"+month;
	var day=d.getDate().toString();
	if(day.length<2)day="0"+day;
	var hour=d.getHours().toString();
	if(hour.length<2)hour="0"+hour;
	var minute=d.getMinutes().toString();
	if(minute.length<2)minute="0"+minute;
	return month+"月"+day+"日 "+hour+":"+minute;
}
//显示格式：年:月:日 时:分:秒
function getLongDateTime(str){
	var d=new Date(str);
	var year=d.getFullYear().toString();
	var monthInt=d.getMonth()+1;
	var month=monthInt.toString();
	if(month.length<2)month="0"+month;
	var day=d.getDate().toString();
	if(day.length<2)day="0"+day;
	var hour=d.getHours().toString();
	if(hour.length<2)hour="0"+hour;
	var minute=d.getMinutes().toString();
	if(minute.length<2)minute="0"+minute;
	var second=d.getSeconds().toString();
	if(second.length<2)second="0"+second;
	return year+"年"+month+"月"+day+"日 "+hour+":"+minute+":"+second;
}
//显示格式：年:月:日
function getLongDate(str){
	var d=new Date(str);
	var year=d.getFullYear().toString();
	var monthInt=d.getMonth()+1;
	var month=monthInt.toString();
	if(month.length<2)month="0"+month;
	var day=d.getDate().toString();
	if(day.length<2)day="0"+day;
	return year+"年"+month+"月"+day+"日";
}
//显示格式：年:月:日
function getMediumDate(str){
	var d=new Date(str);
	var year=d.getFullYear().toString();
	var monthInt=d.getMonth()+1;
	var month=monthInt.toString();
	if(month.length<2)month="0"+month;
	var day=d.getDate().toString();
	if(day.length<2)day="0"+day;
	return year+"-"+month+"-"+day;
}
//显示格式：月:日
function getShortDate(str){
	var d=new Date(str);
	var monthInt=d.getMonth()+1;
	var month=monthInt.toString();
	if(month.length<2)month="0"+month;
	var day=d.getDate().toString();
	if(day.length<2)day="0"+day;
	return month+"月"+day+"日";
}
//显示格式：时:分
function getShortTime(str){
	var d=new Date(str);
	var hour=d.getHours().toString();
	if(hour.length<2)hour="0"+hour;
	var minute=d.getMinutes().toString();
	if(minute.length<2)minute="0"+minute;
	return hour+":"+minute;
}
function appendCss(elem, newCss){
	$(elem).className+=" "+newCss;
}
////////////////////////////////////////////////////////////////////////////////
//导入进度条组件脚本
document.write("<script language=javascript src='/script/util/progress.js?rnd="+Math.random()+"'></script>");
function Vector(){
	this.data=new Array();
	this.size=function(){return this.data.length;};
	this.elements=function(){return this.data;};
	this.elementAt=function(idx){var _tmp=null;try{_tmp=this.data[idx];}catch(e){};return _tmp;};
	this.addElement=function(obj){try{this.data[this.data.length]=obj;this.elementHasAdded++;}catch(e){return null;}};
	this.removeElementAt=function(idx){var _tmp=new Array();if(idx<0||idx>this.size()-1)return;var _i=0;for(var i=0;i<this.data.length;i++)if(idx!=i)_tmp[_i++]=this.data[i];this.data=_tmp;};
	this.replaceElement=function(idx,obj){try{this.data[idx]=obj;}catch(e){}};
	this.clear=function(){this.data=new Array();};
	this.contains=function(obj){for(var i=0;i<this.data.length;i++)if(obj==this.data[i])return i;return -1;};
	this.elementHasAdded=0;
	this.lastElement=function(){var _tmp=null;try{if(this.data.length&&this.data.length>0)_tmp=this.data[this.data.length-1];}catch(e){};return _tmp;};
}
///////////////////////////////////
function Hashtable(){
	this._elements=new Vector();
	this._keys=new Vector();
	this.size=function(){return this._keys.size();};
	this.put=function(key1,element1){this._keys.addElement(key1);this._elements.addElement(element1);};
	this.get=function(key1){return this._elements.elementAt(this._keys.contains(key1));};
	this.remove=function(key1){var _pos=this._keys.contains(key1);if(_pos>-1){this._keys.removeElementAt(_pos);return this._elements.removeElementAt(_pos);}else return null;};
	this.removeAt=function(idx){this._keys.removeElementAt(idx);this._elements.removeElementAt(idx);};
	this.keyAt=function(idx){var _tmp=null;try{_tmp=this._keys.elementAt(idx);}catch(e){};return _tmp;};
	this.elementAt=function(idx){var _tmp=null;try{_tmp=this._elements.elementAt(idx);}catch(e){};return _tmp;};
	this.clear=function(){this._keys.clear();this._elements.clear();};
	this.replaceElement=function(idx,element1){var _tmp=null;try{_tmp=this._elements.replaceElement(idx,element1);}catch(e){};return _tmp;};
	this.containsKey=function(key1){return(this._keys.contains(key1)>-1);};
	this.contains=function(element1){return(this._elements.contains(element1)>-1);};
	this.elements=function(){return this._elements;};
	this.keys=function(){return this._keys;};
	this.lastKey=function(){return this._keys.lastElement();};
	this.lastElement=function(){return this._elements.lastElement();};
}
/////////////常用静态方法////////////////
function getDomDocumentPrefix(){
	if(getDomDocumentPrefix.prefix)return getDomDocumentPrefix.prefix;
	var prefixes=["MSXML2", "Microsoft", "MSXML", "MSXML3"];
	var o;
	for(var i=0;i<prefixes.length;i++){
		try{
			o=new ActiveXObject(prefixes[i] + ".DomDocument");
			return getDomDocumentPrefix.prefix=prefixes[i];
		}catch(ex){};
	}
	throw new Error("Could not find an installed XML parser");
}
function getXmlHttpPrefix() {
	if (getXmlHttpPrefix.prefix)return getXmlHttpPrefix.prefix;
	var prefixes=["MSXML2", "Microsoft", "MSXML", "MSXML3"];
	var o;
	for(var i=0;i<prefixes.length;i++){
		try {
			o=new ActiveXObject(prefixes[i] + ".XmlHttp");
			return getXmlHttpPrefix.prefix=prefixes[i];
		}catch(ex){};
	}
	throw new Error("Could not find an installed XML parser");
}
//////////////////////////
// XmlHttp factory
function XmlHttp() {}

XmlHttp.create=function(){
	try{
			return new ActiveXObject(getXmlHttpPrefix() + ".XmlHttp");
	}catch(ex){}
	throw new Error("Your browser does not support XmlHttp objects");
};
////////////////////////
// XmlDocument factory
function XmlDocument(){}
XmlDocument.create=function(){
	try {
		return new ActiveXObject(getDomDocumentPrefix() + ".DomDocument");
	}catch(ex){}
	throw new Error("Your browser does not support XmlDocument objects");
};
//get Xml Document from a XML Data Island
//or Load it directly
function getXmlDocument(o){
	if(typeof(o.XMLDocument) == "undefind"){
		var xml=XmlDocument.create();
		xml.async=false;
		xml.load(o.src);
		return xml;
	}else return o.XMLDocument;
}
//get Xml Document from a XML String
function getXmlDocumentFromString(_xmlstr1){
	if(_xmlstr1!=null){
		var xml=XmlDocument.create();
		xml.async=false;
		xml.loadXML(_xmlstr1);
		return xml;
	}else return null;
}
function getNodeValue(_node1,_xpath1,_defaultvalue){
	if(_node1!=null||_node1!=""){
		if(_xpath1!=null||_xpath1!=""){
			var tmp=_node1.selectSingleNode(_xpath1);
			if(tmp!=null)return tmp.text;
			else return _defaultvalue;
		}else return _node1.text;
	}else return _defaultvalue;
}
function getNodeAttribute(_node1,_xpath1,_defaultvalue){
	if(_node1!=null||_node1!=""){
		if(_xpath1!=null||_xpath1!=""){
			var tmp=_node1.selectSingleNode(_xpath1);
			if(tmp!=null)return tmp.text;
			else return _defaultvalue;
		}else return _node1.text;
	}else return _defaultvalue;
}
//根据元素ID获取对象和对象集合，此函数和切换tab函数相关
function $(elemid){
	if(typeof(elemid)=="string"){
		var elemobj=document.getElementById(elemid);//单个元素
		var elemobjs=document.all(elemid);//元素集合
		/*以下三行判断返回对象类型*/
		var _cnt__=0;
		for(var i=0;elemobjs&&i<elemobjs.length;i++){
			if(elemobjs[i].id&&elemobjs[i].id==elemid)_cnt__++;
		}
		if(_cnt__>1&&_cnt__==elemobjs.length)return elemobjs;
		return elemobj;
	}
	return elemid;
}
//切换Tab
function doSelectTab(tab_btnObj,tab_panel_id,show_tab_panel_index1){
	if(document.readyState!="complete")return setTimeout(function(){doSelectTab(tab_btnObj,tab_panel_id,show_tab_panel_index1);},200);
    if(!tab_btnObj||tab_btnObj.id=="current")return;
    var tab_btn_div_obj=tab_btnObj.parentElement.children;
	for(var i=0;tab_btn_div_obj&&tab_btn_div_obj.length&&i<tab_btn_div_obj.length;i++){
		if(tab_btn_div_obj[i].id){
			tab_btn_div_obj[i].removeAttribute("id");
			break;
		}
	}
	tab_btnObj.setAttribute("id","current");
    var TabPanelObjs=$(tab_panel_id);
	for(var i=0;TabPanelObjs&&TabPanelObjs.length&&i<TabPanelObjs.length;i++){
		TabPanelObjs[i].style.display=(parseInt(TabPanelObjs[i].tab_index)==show_tab_panel_index1?"block":"none");
	}
}
//代理函数
function proxy(){var __a=[];for(var i=0,l=arguments.length;i<l;i++){__a[i]=arguments[i];};var __func=__a[0];__a.shift();return function(){__func.apply(null,__a)};}
//得到元素绝对坐标
function getAbsolutePosition(element){var x=0;var y=0;do{x+=element.offsetLeft;y+=element.offsetTop;}while((element=element.offsetParent));var obj=new Object();obj.x=x-document.body.scrollLeft;obj.y=y-document.body.scrollTop;return obj;}
//得到元素绝对坐标
function getElementRect(element){if(!element)return null;var x1=0;var y1=0;var obj=new Object();obj.w=element.offsetWidth;obj.h=element.offsetHeight;do{x1+=element.offsetLeft;y1+=element.offsetTop;if(element.style.borderLeftWidth)x1+=parseInt(element.style.borderLeftWidth);if(element.style.borderTopWidth)y1+=parseInt(element.style.borderTopWidth);}while((element=element.offsetParent));obj.x=x1;obj.y=y1;return obj;}
//等比缩放图片
function resizeImage(ImgObj,max_width,max_height){if(!max_width)max_width=100;if(!max_height)max_height=max_width;size_scale=max_width/max_height;if(!ImgObj)return setTimeout(function(){resizeImage(ImgObj)},200);var buffer_image=new Image();buffer_image.src=ImgObj.src;if(buffer_image.width<1||buffer_image.height<1)return;if(buffer_image.width/buffer_image.height>size_scale){if(buffer_image.width>max_width){ImgObj.width=max_width;ImgObj.height=(buffer_image.height*max_width)/buffer_image.width;}}else{if(buffer_image.height>max_height){ImgObj.height=max_height;ImgObj.width=(buffer_image.width*max_height)/buffer_image.height;}}}
//超级文本替换
function replaceEx(str1,str2,str3){if(str1==null||str1=="")return "";var re=new RegExp(str2,"gi");return str1.replace(re,str3);}
///////////常规验证函数//////////////
//验证字段长度
function isInRange(str,min_len11,max_len11){
	if(str==null||str=="")return min_len11<0;
	return(str.length>=min_len11&&str.length<=max_len11);
}
/////////////////////////////////////////////////////////////////////////
//隐藏进度条快捷键
document.onkeydown=function(){if(event.keyCode==27)try{if(progressDisplay)progressDisplay.hide();}catch(exp1){}};
//刷新鼠标双击模块
//document.ondblclick=function(){refreshBlockByElement(event.srcElement);}//document.selection.clear();
//页面模块xml装载刷新
function XmlLoading(xmldoc){
	if(xmldoc==null||xmldoc.readyState!="complete")return;
	if(document.readyState!="complete")return setTimeout(function(){XmlLoading(xmldoc)},200);
	setTimeout(function(){
		try{
			var tmp=null;
			if(xmldoc.parseError.errorCode!=0)return;
			if((tmp=xmldoc.selectSingleNode('/root'))!=null){
				if(tmp.getAttribute('success')=="1"){
					 var divObj=document.all("block_div"+tmp.getAttribute("page_block_id"))
					 if(divObj)divObj.outerHTML=tmp.getAttribute("content");
					 return;
				}
			}
			return alert("服务器忙，获取数据失败，请手动刷新页面。");
		}catch(e){return alert("服务器忙，获取数据失败，请手动刷新页面。")};
	},500);
}
//刷新模块通过html元素对象
function refreshBlockByElement(evtObj){
	while(evtObj&&!evtObj.id&&!evtObj.id.indexOf("block_div")==0&&evtObj.tagName!="BODY"){
		evtObj=evtObj.parentElement;
		if(evtObj.id&&evtObj.id.indexOf("block_div")==0)return refreshBlock(evtObj.id.substring(9));
	}
}
//刷新模块
function refreshBlock(page_block_id11){//xml装载处理函数
   var divObj=document.all("block_div"+page_block_id11)
   if(!divObj)return;
   var newurl=replaceURLParameter(location.href,"load_block_id",page_block_id11);
   divObj.innerHTML="<xml onreadystatechange=\"XmlLoading(this);\" src=\""+newurl+"\" /><div style=\"padding:5 0 0 15;height:26;width:100%;overflow hidden;text-overflow: ellipsis;white-space:normal;font-size:9pt;word-wrap:break-word;border:1 #abc solid;background:#FFFAE6;\"><img src='/images/loading.gif' align=absmiddle>&nbsp;请稍候，正在刷新页面模块数据...</div>";
}
//替换URL参数
function replaceURLParameter(surl,param,value){
	var pos=surl.indexOf("?");
	if(pos==-1||pos==surl.length-1){
		if(param!=null){
			var atag="";
			if(surl.indexOf("#")>0){
				atag=surl.substring(surl.indexOf("#"));
				surl=surl.substring(pos+1,surl.indexOf("#"));
			}
			surl+="?"+param+"="+(value?value:"")+atag;
		}
		return surl;
	}
	var atag="";
	var sNewURL=surl.substring(0,pos)+"?";
	if(surl.indexOf("#")>0){
		atag=surl.substring(surl.indexOf("#"));
		surl=surl.substring(pos+1,surl.indexOf("#"));
	}else surl=surl.substring(pos+1);
	
	var aParam=surl.split("&");
	var bParamFound=false;
	var bFirstParam=true;
	for(var i=0;i<aParam.length;i++){
		if(aParam[i].length==0||aParam[i].indexOf("=")==-1)continue;
		else if(param==null)sNewURL+=(bFirstParam?"":"&")+aParam[i];
		else if(aParam[i].toUpperCase().indexOf(param.toUpperCase()+"=")==0){
			sNewURL+=(bFirstParam?"":"&")+param+"="+(value?value:"");
			bParamFound=true;
		}else sNewURL+=(bFirstParam?"":"&")+aParam[i];
		bFirstParam=false;
	}
	if(!bParamFound&&param)sNewURL+="&"+param+"="+(value?value:"");
	return sNewURL+atag;
}
/////AjAX通讯API//////////////////////////////////////////////////////////////////////////////////////////////////////
//进度条句柄
var progressDisplay=null;
//连接重试次数
var MAX_RETRY=3;

//得到XMLHTTP对象
function getXMLHttp(){
	var objXMLHttp=null;
	for(var ix=0;ix<MAX_RETRY&&objXMLHttp==null;ix++){
		if(window.XMLHttpRequest){
			objXMLHttp=new XMLHttpRequest();
			if(objXMLHttp.readyState == null){
				objXMLHttp.readyState=0;
				objXMLHttp.addEventListener("load", 
					function(){
						objXMLHttp.readyState=4;
						if(typeof(objXMLHttp.onreadystatechange)== "function"){
							objXMLHttp.onreadystatechange();
						} 
					}, 
					false
				);
			} 
			return objXMLHttp;
		}else{
			var MSXML=['MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP'];
			for(var n=0;n<MSXML.length;n ++){
				try{
					return objXMLHttp=new ActiveXObject(MSXML[n]);
				}catch(e){} 
			} 
			throw new Error("Your browser does not support xmlhttp objects");
		}
	}
}
//销毁关闭连接对象和进度条显示
function destroyComponent(xmlhttpObj){
	for(var i=0;i<MAX_RETRY&&xmlhttpObj!=null;i++){
		try{
			if(progressDisplay)progressDisplay.hide();
		}catch(exp1){}
		try{
			xmlhttpObj.abort();xmlhttpObj.readyState=0;
		}catch(exp2){}
		try{
			xmlhttpObj=null;
		}catch(exp3){}
		try{
			delete(xmlhttpObj);
		}catch(exp4){}
	}
}
//从表单对象包装字段提交对象
function getFormPostData(__form1_,extent_param_obj){
	var dataObj={};
	if(!__form1_)return dataObj;
	var formObj=$(__form1_);
	//设置action name
	dataObj.action=__form1_.action;
	//if(extent_param_obj){var fldname=null;for(fldname in extent_param_obj)eval("dataObj."+fldname+"=extent_param_obj[fldname];");}
	if(extent_param_obj)dataObj.extend(extent_param_obj);
	for(var n=0;formObj!=null&&n<formObj.elements.length;n++){
		if(formObj.elements[n].disabled)continue;
		var ename=formObj.elements[n].name;
		var evalue=formObj.elements[n].value;
		var eneed=(formObj.elements[n].notneed?0:1);
		if(ename==null||ename=="")continue;
		if(evalue==null)evalue="";
		eval("dataObj."+ename+"=evalue;");
	}
	//附加字段
	
	return dataObj;
}
//向服务器端发送Post数据
function postRequest(post_data,callbackfunction){
	if(!post_data)return;
	var postData="",response_js_string="";
	try{if(!progressDisplay)progressDisplay=new Progress("progressDisplay",50);}catch(exp1){};
	for(fldname in post_data){
		if(fldname==null||fldname==""||typeof(post_data[fldname])=="function")continue;//只能发送有效的字符串数据
		postData+=(postData==""?"":"&")+encodeURIComponent(fldname)+"="+escape(post_data[fldname]||post_data[fldname]==0?post_data[fldname]:"");
	}
	try{
		var xmlhttp=getXMLHttp();
		if(!xmlhttp)return alert("您的浏览器不支持 xmlhttp objects");
		xmlhttp.onreadystatechange=function(){
			if(xmlhttp.readyState!=4)return;
			try{
				if(xmlhttp.status==200){
					response_js_string=xmlhttp.responseText.unescape();
					if(callbackfunction!=null&&callbackfunction!=""&&response_js_string!=null&&response_js_string!=""){//回调参数值不为空并且返回值不为空
						if(typeof callbackfunction == "function"){//回调参数为函数对象，将返回值做为参数传入回调函数
							try{
								callbackfunction.call(callbackfunction,response_js_string);
							}catch(exp){
								eval("callbackfunction.call(callbackfunction,\""+response_js_string+"\");");
							}
						}else{//回调函数为字符串，构造函数对象执行
							eval(callbackfunction+"(\""+response_js_string+"\");");
						}
					}else if(response_js_string!=null&&response_js_string!=""&&response_js_string.indexOf("//Return Script")<=3)eval(response_js_string);//回调函数为脚本函数
					else if(response_js_string!=null&&response_js_string!="")alert("服务器返回：\n"+response_js_string);//返回值为字符串，回调函数为空
				}
			}catch(expt){}
			destroyComponent(xmlhttp);
		};
		xmlhttp.open("POST",post_action_url,true);
		xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		try{progressDisplay.show('正在装载数据，请稍候',true);}catch(exp){}
		xmlhttp.send(postData);
	}catch(getxmlhttperror){}
	return response_js_string;
}
/**
****集思鹏ajax提交回调函数****
必须实现以下方法进行登录UI和回调函数的连接
function LoginGUI(funObj){
	//var ret=window.showModalDialog("/hr/login_dlg.htm?rnd="+Math.random(),null, "dialogHeight:320px;dialogWidth:408px;center:Yes;help:No;resizable:No;status:No")
	//if(ret)funObj.userLogin(ret);
}
*/
function JSPSoftCallBack(){
	var LOGIN_MSG="<b>抱歉,登录失败！$0$</b><br>可能由于用户名，用户类型，密码输入错误，或验证码错误等原因导致您登录失败，请核对填写信息并再次登录重试。";
	this.login			=false;
	this.callback		=function(){};
	this.isLogin		=function(){return this.isLogin};
	this.setLogin		=function(){return(this.login=true);}
	this.sendLoginData	=function(){var funObj=this;postRequest({action:"islogin"},function(resData){funObj.checkLogin(resData,funObj)});};//发送数据提交请求前必须进行登录，自动弹出登录界面
	this.sendData		=function(){var funObj=this;funObj.callback.call(funObj,"");};//直接发送数据提交请求
	this.userLogin		=function(login_submit_data){funObj=this;if(login_submit_data)postRequest(login_submit_data,function(res11){if(res11!="OK")JSPSoftWindow.alert(LOGIN_MSG.format(res11),function(){setTimeout(function(){funObj.checkLogin.call(funObj,"false");},100);});else funObj.checkLogin.call(funObj,"true");});else LoginGUI(funObj);}//显示登录界面并集成登录验证和jscript函数回调
	this.checkLogin		=function(resData){if(resData=="true"&&this.setLogin())this.sendData();else this.userLogin(null);}////如果用户没有登录，则显示用户登录界面，获取用户登录数据并提交，登录成功则执行回调函数，登录失败重新登录。
}
/////Web窗口函数区////////////////////////////////////////////////////////////////////////////////////////////////
function fAddEvent(oTarget,sType,fHandler,bRemove){
	if(!oTarget)return;
	if(typeof(oTarget.attachEvent)!="undefined"){
		bRemove?oTarget.detachEvent(sType,fHandler):oTarget.attachEvent(sType,fHandler);
	}else if(typeof(oTarget.addEventListener)!="undefined"){
		bRemove?oTarget.removeEventListener(sType,fHandler,false):oTarget.addEventListener(sType,fHandler,true);
	}else oTarget[sType]=bRemove?null:fHandler;
}
function fRemoveEvent(oTarget,sType,fHandler){
	fAddEvent(oTarget,sType,fHandler,true);
}
function findContainer(elem,idd11){
	if(elem==null||elem.tagName=="BODY")return null;
	if(elem.id&&elem.id==idd11)return elem;
	return findContainer(elem.parentElement,idd11);
}

var JSPSoftWindow={
	maskFrame:null,
	SHADOW_TOP:5,
	SHADOW_LEFT:5,
	SHADOW_RIGHT:8,
	SHADOW_BOTTOM:9,
	TITLE_HEIGHT:25,
	MIN_WIDTH:140,
	MIN_HEIGHT:100,
	RESIZE_SCALE:7,
	windowsHashtable:new Hashtable(),
	autoid:0,
	current:null,
	dragging:false,
	startedDragging:false,
	dragEffect:null,
	create:function(){
		if(!JSPSoftWindow.maskLayer){
			fAddEvent(document.body,"onmouseup",function(){JSPSoftWindow.releaseCurrent();});
			fAddEvent(document.body,"onmousemove",function(){JSPSoftWindow.moveCurrent();});
			fAddEvent(document.body,"onload",function(){JSPSoftWindow.makeUnselectable(document.body);});
			fAddEvent(window,"onresize",function(){JSPSoftWindow.resizeMask();});
			fAddEvent(window,"onload",function(){JSPSoftWindow.resizeMask();});

			JSPSoftWindow.maskLayer=document.createElement("DIV");
			fAddEvent(JSPSoftWindow.maskLayer,"oncontextmenu",function(){return false;});
			JSPSoftWindow.maskLayer.style.cssText="position:absolute;top:0;left:0;background-color:#fff;filter:alpha(opacity=38);opacity:0.38;z-index:65534;overflow:hidden;display:none;border:0;";

			var frameObj=document.createElement("iframe");
			frameObj.id="shadowIframe";
			frameObj.style.filter="alpha(opacity=38)";
			frameObj.style.opacity="0.38";
			frameObj.style.position="absolute";
			frameObj.style.cssText="top:0;left:0;width:100%;height:100%;";
			JSPSoftWindow.maskLayer.appendChild(frameObj);
			document.body.insertBefore(JSPSoftWindow.maskLayer,document.body.firstChild);
		}
	},
	removeWindow:function(hwd11){
		JSPSoftWindow.windowsHashtable.remove(hwd11);
		var tmp=document.getElementById("windows");
		for(var i=0;tmp&&tmp.chihnaren&&i<tmp.children.length;i++){
			if(tmp.children[i].id==hwd11){
				//tmp.removeChild(tmp.children[i]);
				tmp.chinaren[i].outerHTML="";
				break;
			}
		}
	},
	createHandle:function(){
		return "window"+(JSPSoftWindow.autoid++);
	},
	dealEvent:function(winObj,evtObj){
		evtObj.call(winObj,'');
	},
	resizeMask:function(){
		if(!document.body)return;
		
		var show_count=0;
		for(var i=0;i<JSPSoftWindow.windowsHashtable.size();i++){
			if(JSPSoftWindow.windowsHashtable.elementAt(i).showing=="")show_count++;
		}
		JSPSoftWindow.maskLayer.style.display=(show_count>0?"":"none");
		if(show_count>0){
			JSPSoftWindow.maskLayer.style.width	=Math.max(parseInt(document.body.clientWidth),parseInt(document.body.scrollWidth)+parseInt(document.body.scrollLeft));
			JSPSoftWindow.maskLayer.style.height=Math.max(parseInt(document.body.clientHeight),parseInt(document.body.scrollHeight)+parseInt(document.body.scrollTop));
			if(shadowIframe){
				var tmp="<html><body onselectstart='return false;' oncontextmenu='return false' scroll=no bgcolor=#555555><div style='width:100%;height:1000%;'>&nbsp;</div></body></html>";
				var a=shadowIframe.document;
				a.open();
				a.write(tmp);
				a.close();
			}
		}
	},
	isMaskShowing:function(){
		var show_count=0;
		for(var i=0;i<JSPSoftWindow.windowsHashtable.size();i++){
			if(JSPSoftWindow.windowsHashtable.elementAt(i).showing=="")show_count++;
		}
		return show_count>0;
	},
	windowContainer:null,
	creatWindow:function(title1,x1,y1,w1,h1,content1){
		var hwnd=JSPSoftWindow.createHandle();
		var sw=new SubWindow(this,hwnd,title1?title1:hwnd,content1?content1:"",x1?x1:0,y1?y1:0,w1?w1:0,h1?h1:0);
		JSPSoftWindow.windowsHashtable.put(hwnd,sw);
		return sw;
	},
	getValue:function(v1,dv){
		return !v1||v1==null||v1==""?dv:v1;
	},
	alert:function(msg,callbackfunction){
		if(!document.body)return setTimeout(function(){JSPSoftWindow.create();JSPSoftWindow.alert(msg);},200);
		var winObj=JSPSoftWindow.creatWindow();
		$(winObj.hwd).style.zIndex=9999;
		winObj.setContent("<div style='height:100%;position:relative;'><table style='margin-top:-10' width='100%' height='100%' cellpadding=0 cellspacing=0><tr><td valign=middle style='padding:0 15 5 15;line-height:20px;'><img src='/images/alert.gif' align=absmiddle style='float:left;margin:0 8 8 0'>"+(msg==null?"":msg)+"</td></tr></table><div style='position:absolute;bottom:10;right:10' align=right><button class=btn id='"+winObj.hwd+"_button_ok'>确  定</button></div></div>");
		winObj.setTitle("信息提示 - "+SITE_NAME);
		winObj.setSize(400,200);
		winObj.setPosition((document.body.clientWidth-400)/2,document.body.scrollTop+((document.body.clientHeight-200)/2));
		winObj.setColor("white","#fff");
		winObj.setTitleBgcolor("#FF9A0B");
		winObj.eventClose=function(){if(callbackfunction)callbackfunction.call(callbackfunction,'');winObj.destory();};
		winObj.setTitleFgcolor("#fff");
		winObj.setBgcolor("#fff");
		winObj.setFgcolor("#000");
		
		winObj.show();
		winObj.focus();
		winObj.setModel(true);

		var btnobj=$(winObj.hwd+"_button_ok");
		btnobj.onclick=function(){winObj.eventClose();winObj.destory();}
	 	btnobj.focus();
	},
	newWindow:function(title,content,model,width1,height1){
		if(!document.body)return setTimeout(function(){JSPSoftWindow.create();JSPSoftWindow.newWindow(title,content,model);},200);

		var width1=parseInt(width1?width1:400);
		var height1=parseInt(height1?height1:200);

		var winObj=JSPSoftWindow.creatWindow();
		$(winObj.hwd).style.zIndex=9999;
		winObj.setTitle(title+" - "+SITE_NAME);
		winObj.setContent("<table cellpadding=0 cellspacing=0 width='100%' height='100%'><tr><td valign=top style='padding:5;line-height:22px;'>"+content+"</td></tr></table>");
		winObj.setSize(width1,height1);
		winObj.setPosition((document.body.clientWidth-width1)/2,document.body.scrollTop+((document.body.clientHeight-height1)/2));
		winObj.setColor("white","#fff");
		winObj.setTitleBgcolor("#FF9F0B");
		winObj.eventClose=function(){winObj.destory();};
		winObj.setTitleFgcolor("#fff");
		winObj.setBgcolor("#fff");
		winObj.setFgcolor("#000");
		
		winObj.show();
		winObj.focus();
		winObj.setModel(model);
		return winObj;
	},
	setCurrent:function(w){
		if(!w)return JSPSoftWindow.current=null;
		if(w != JSPSoftWindow.current){
			// unset old current
			if(JSPSoftWindow.current)JSPSoftWindow.current.className='window';
			// set current
			JSPSoftWindow.current=w;
			JSPSoftWindow.current.className='current window';
			// put current on top
			document.getElementById("windows").appendChild(JSPSoftWindow.current);
		}
		// init drag
		if(!event)return;
		var offsetX=event.clientX+document.body.scrollLeft - parseInt(w.currentStyle.left);
		var offsetY=event.clientY+document.body.scrollTop - parseInt(w.currentStyle.top);
		if(offsetY<JSPSoftWindow.TITLE_HEIGHT+JSPSoftWindow.SHADOW_TOP){//拖动
			JSPSoftWindow.dragging=true;
			JSPSoftWindow.dragEffect=function(){
							if(!w)return;
							 w.style.pixelLeft =event.clientX+document.body.scrollLeft - offsetX;
							 w.style.pixelTop=event.clientY+document.body.scrollTop - offsetY;
						 }
		 }else{//resize
			if(!w||!w.resizable)return;
			 var width=parseInt(w.currentStyle.width);
			 var resizeX=Math.abs(offsetX -(width - JSPSoftWindow.SHADOW_RIGHT))<JSPSoftWindow.RESIZE_SCALE;
			 var height=parseInt(w.currentStyle.height);
			 var resizeY=Math.abs(offsetY -(height - JSPSoftWindow.SHADOW_BOTTOM))<JSPSoftWindow.RESIZE_SCALE;
			 if(resizeX || resizeY){
				 JSPSoftWindow.dragging=true;
				 var offsetX=event.clientX - width;
				 var offsetY=event.clientY - height;

				 JSPSoftWindow.dragEffect=function(){
						  if(resizeX){
								var tmp=event.x - offsetX;
								w.style.pixelWidth=Math.max(JSPSoftWindow.MIN_WIDTH,tmp)-(Math.max(JSPSoftWindow.MIN_WIDTH,tmp)%2);
						  }
						  if(resizeY){
								var tmp=event.y - offsetY;
								w.style.pixelHeight=Math.max(JSPSoftWindow.MIN_HEIGHT,tmp)-(Math.max(JSPSoftWindow.MIN_HEIGHT,tmp)%2);
						}
				 }
			 }
		}
	},
	calcResize:function(w){
		if(!w||!w.resizable)return;
		var offsetX=event.clientX+document.body.scrollLeft - parseInt(w.currentStyle.left);
		var offsetY=event.clientY+document.body.scrollTop - parseInt(w.currentStyle.top);
		var width=parseInt(w.currentStyle.width);
		var height=parseInt(w.currentStyle.height);
		var resizeX=Math.abs(offsetX -(width - JSPSoftWindow.SHADOW_RIGHT))<JSPSoftWindow.RESIZE_SCALE&&offsetY>(JSPSoftWindow.TITLE_HEIGHT+JSPSoftWindow.SHADOW_TOP);
		var resizeY=Math.abs(offsetY -(height - JSPSoftWindow.SHADOW_BOTTOM))<JSPSoftWindow.RESIZE_SCALE;
		w.style.cursor=(resizeX||resizeY)?(resizeY?"S":"")+(resizeX?"E":"")+"-resize":"default";
	},
	moveCurrent:function(){
		if(!JSPSoftWindow.dragging||!JSPSoftWindow.current)return;
		if(event.button == 0){
			JSPSoftWindow.releaseCurrent();
			return;
		}
		if(!JSPSoftWindow.startedDragging){
			JSPSoftWindow.current.className='dragging current window';
			JSPSoftWindow.current.setCapture();
			JSPSoftWindow.startedDragging=true;
		}
		JSPSoftWindow.dragEffect();
	},
	releaseCurrent:function(){
		if(!JSPSoftWindow.current)return;
		JSPSoftWindow.current.className='current window';
		JSPSoftWindow.current.releaseCapture();
		JSPSoftWindow.dragging=false;
		JSPSoftWindow.startedDragging=false;
	},
	makeUnselectable:function(e){
		e.unselectable=true;
		if(e.className == 'content')return;
		for(var c=e.firstChild;c;c=c.nextSibling)if(c.nodeType == 1)JSPSoftWindow.makeUnselectable(c);
	}
}
////////////////////////////////////////////////
function SubWindow(winsetobj1,hwnd1,title1,content1,x1,y1,w1,h1,fcolor,bcolor,tfcolor,tbcolor,scrollcolor){
	w1=Math.max(JSPSoftWindow.MIN_WIDTH,w1?w1:0)-(Math.max(JSPSoftWindow.MIN_WIDTH,w1?w1:0)%2);
	h1=Math.max(JSPSoftWindow.MIN_WIDTH,h1?h1:0)-(Math.max(JSPSoftWindow.MIN_WIDTH,h1?h1:0)%2);

	this.width=w1;
	this.height=h1;

	content1=JSPSoftWindow.getValue(bcolor,"");

	this.hwd=hwnd1;
	this.title=title1;
	this.content=content1;
	this.bgcolor=JSPSoftWindow.getValue(bcolor,"#8868c8");
	this.fgcolor=JSPSoftWindow.getValue(fcolor,"white");
	this.tbgcolor=JSPSoftWindow.getValue(tbcolor,"#8969c9");
	this.tfgcolor=JSPSoftWindow.getValue(tfcolor,"white");
	this.scroll_color=JSPSoftWindow.getValue(scrollcolor,"#aaa");
	this.winobj=document.createElement("DIV");
	this.showing=false;
	this.winsetobj=winsetobj1;
	this.winsetobj.windowContainer=document.getElementById("windows");
	this.btn_close=false;
	this.btn_max=false;
	this.btn_min=false;
	this.model=false;
	this.appended=false;
	this.flashing=false;

	this.eventClose=function(){};
	this.eventMin=null;
	this.eventMax=null;
	this.eventOk=null;
	this.eventCancel=function(){};
	
	if(!this.winsetobj.windowContainer){
		this.winsetobj.windowContainer=document.createElement("DIV");
		this.winsetobj.windowContainer.id="windows";
		this.winsetobj.windowContainer.style.cssText="position:absolute;top:0;left:0;z-index:1000000";
		document.body.insertBefore(this.winsetobj.windowContainer,document.body.firstChild);
	};

	with(this.winobj){
		className="window";
		id=this.hwd;
		resizable=false;
		onmousedown=function(){JSPSoftWindow.setCurrent(this);};
		style.cssText='POSITION: absolute;display:none;color:'+this.fgcolor+';top:'+y1+';left:'+x1+';width:'+w1+';height:'+h1+';overflow:hidden;';
		onmousemove=function(){JSPSoftWindow.calcResize(this);};
	}
	this.createHtml=function(){
		var wincode='';
		//第一子元素
			wincode+='<DIV id='+this.hwd+'_shadow style="OVERFLOW: hidden;POSITION: absolute;TOP: 0px;left:0;width:100%;height:100%;">';//阴影
				// 顶边
				wincode+='<div style="position:absolute;HEIGHT:13px;top:0;left:13;width:100%;padding-right:13px"><DIV style="FONT-SIZE: 1px;FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/script/images/subwin/n.png\',sizingMethod=\'scale\');width:100%;HEIGHT:13px;margin-right:13;BACKGROUND-REPEAT: no-repeat;"></DIV></div>';//顶边
				//底边
				wincode+='<div style="position:absolute;HEIGHT:13px;bottom:0;left:13;width:100%;padding-right:13;"><DIV style="FONT-SIZE: 1px;FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/script/images/subwin/s.png\',sizingMethod=\'scale\');width:100%;HEIGHT:13px;margin-right:13;BACKGROUND-REPEAT: no-repeat;"></DIV></div>';//底边
				//左边
				wincode+='<div style="position:absolute;HEIGHT:100%;top:0;left:0;width:13;padding-top:13px;padding-bottom:13px;"><DIV style="FONT-SIZE: 1px;FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/script/images/subwin/w.png\',sizingMethod=\'scale\');WIDTH: 13px;HEIGHT:100%;BACKGROUND-REPEAT: no-repeat;"></DIV></div>';//左边
				//右边
				wincode+='<div style="position:absolute;HEIGHT:100%;top:0;right:0;width:13;padding-top:13px;padding-bottom:13px;"><DIV style="FONT-SIZE: 1px;FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/script/images/subwin/e.png\',sizingMethod=\'scale\');WIDTH: 13px;BACKGROUND-REPEAT: no-repeat;HEIGHT:100%;"></DIV></div>';//右边
				//左上角
				wincode+='<DIV style="FONT-SIZE: 1px;FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/script/images/subwin/nw.png\',sizingMethod=\'scale\');POSITION: absolute;height:13;width:13;top:0;left:0;BACKGROUND-REPEAT: no-repeat;"></DIV>';//左上角
				//右上角
				wincode+='<DIV style="FONT-SIZE: 1px;FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/script/images/subwin/ne.png\',sizingMethod=\'scale\');POSITION: absolute;height:13;width:13;top:0;right:0;BACKGROUND-REPEAT: no-repeat;"></DIV>';
				//左下角
				wincode+='<DIV style="FONT-SIZE: 1px;FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/script/images/subwin/sw.png\',sizingMethod=\'scale\');POSITION: absolute;height:13;width:13;bottom:0;left:0;BACKGROUND-REPEAT: no-repeat;"></DIV>';
				//右下角
				wincode+='<DIV style="FONT-SIZE: 1px;FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/script/images/subwin/se.png\',sizingMethod=\'scale\');POSITION: absolute;height:13;width:13;bottom:0;right:0;BACKGROUND-REPEAT: no-repeat;"></DIV>';
			wincode+='</DIV>';

			wincode+="<div style='position:absolute;top:"+(JSPSoftWindow.SHADOW_TOP)+";left:"+JSPSoftWindow.SHADOW_LEFT+";padding-right:"+JSPSoftWindow.SHADOW_RIGHT+"'>";//左上圆角
				wincode+='<div id='+this.hwd+'_title_circle style="overflow:hidden;position:absolute;background-color:'+this.tbgcolor+';left:3;top:0;width:4;height:1"></div>';
				wincode+='<div id='+this.hwd+'_title_circle  style="overflow:hidden;position:absolute;background-color:'+this.tbgcolor+';left:3;top:9;width:4;height:1"></div>';
				wincode+='<div id='+this.hwd+'_title_circle  style="overflow:hidden;position:absolute;background-color:'+this.tbgcolor+';left:1;top:1;width:8;height:2"></div>';
				wincode+='<div id='+this.hwd+'_title_circle  style="overflow:hidden;position:absolute;background-color:'+this.tbgcolor+';left:1;top:7;width:8;height:2"></div>';
				wincode+='<div id='+this.hwd+'_title_circle  style="overflow:hidden;position:absolute;background-color:'+this.tbgcolor+';left:0;top:3;width:10;height:4"></div>';
			wincode+="</div>";
			wincode+="<div style='position:absolute;top:"+(JSPSoftWindow.SHADOW_TOP)+";right:"+(JSPSoftWindow.SHADOW_RIGHT+10)+";'>";//右上圆角
				wincode+='<div id='+this.hwd+'_title_circle style="overflow:hidden;position:absolute;background-color:'+this.tbgcolor+';left:3;top:0;width:4;height:1"></div>';
				wincode+='<div id='+this.hwd+'_title_circle style="overflow:hidden;position:absolute;background-color:'+this.tbgcolor+';left:3;top:9;width:4;height:1"></div>';
				wincode+='<div id='+this.hwd+'_title_circle style="overflow:hidden;position:absolute;background-color:'+this.tbgcolor+';left:1;top:1;width:8;height:2"></div>';
				wincode+='<div id='+this.hwd+'_title_circle style="overflow:hidden;position:absolute;background-color:'+this.tbgcolor+';left:1;top:7;width:8;height:2"></div>';
				wincode+='<div id='+this.hwd+'_title_circle style="overflow:hidden;position:absolute;background-color:'+this.tbgcolor+';left:0;top:3;width:10;height:4"></div>';
			wincode+="</div>";

			wincode+="<div style='position:absolute;bottom:"+(JSPSoftWindow.SHADOW_BOTTOM+10)+";left:"+JSPSoftWindow.SHADOW_LEFT+";padding-right:"+JSPSoftWindow.SHADOW_RIGHT+"'>";//左下圆角
				wincode+='<div id='+this.hwd+'_bottom_circle style="overflow:hidden;position:absolute;background-color:'+this.bgcolor+';left:3;top:0;width:4;height:1"></div>';
				wincode+='<div id='+this.hwd+'_bottom_circle style="overflow:hidden;position:absolute;background-color:'+this.bgcolor+';left:3;top:9;width:4;height:1"></div>';
				wincode+='<div id='+this.hwd+'_bottom_circle style="overflow:hidden;position:absolute;background-color:'+this.bgcolor+';left:1;top:1;width:8;height:2"></div>';
				wincode+='<div id='+this.hwd+'_bottom_circle style="overflow:hidden;position:absolute;background-color:'+this.bgcolor+';left:1;top:7;width:8;height:2"></div>';
				wincode+='<div id='+this.hwd+'_bottom_circle style="overflow:hidden;position:absolute;background-color:'+this.bgcolor+';left:0;top:3;width:10;height:4"></div>';
			wincode+="</div>";
			wincode+="<div style='position:absolute;bottom:"+(JSPSoftWindow.SHADOW_BOTTOM+10)+";right:"+(JSPSoftWindow.SHADOW_RIGHT+10)+";'>";//右下圆角
				wincode+='<div id='+this.hwd+'_bottom_circle style="overflow:hidden;position:absolute;background-color:'+this.bgcolor+';left:3;top:0;width:4;height:1"></div>';
				wincode+='<div id='+this.hwd+'_bottom_circle style="overflow:hidden;position:absolute;background-color:'+this.bgcolor+';left:3;top:9;width:4;height:1"></div>';
				wincode+='<div id='+this.hwd+'_bottom_circle style="overflow:hidden;position:absolute;background-color:'+this.bgcolor+';left:1;top:1;width:8;height:2"></div>';
				wincode+='<div id='+this.hwd+'_bottom_circle style="overflow:hidden;position:absolute;background-color:'+this.bgcolor+';left:1;top:7;width:8;height:2"></div>';
				wincode+='<div id='+this.hwd+'_bottom_circle style="overflow:hidden;position:absolute;background-color:'+this.bgcolor+';left:0;top:3;width:10;height:4"></div>';
			wincode+="</div>";
	//顶部表格
			wincode+="<div style='position:absolute;top:"+(JSPSoftWindow.SHADOW_TOP)+";left:"+JSPSoftWindow.SHADOW_LEFT+";padding-right:"+JSPSoftWindow.SHADOW_RIGHT+";'>";
			wincode+="<table cellpadding=0 cellspacing=0 width='100%' height='100%'><tr><td width='5' height='5' valign=top align=left style='line-height:5px;font-size:5px;'>&nbsp</td><td width='100%' id="+this.hwd+"_title_middle style='line-height:5px;font-size:5px;background-color:"+this.tbgcolor+";'>&nbsp</td><td style='line-height:5px;font-size:5px;' width='5' height='5' valign=top align=right>&nbsp;</tr><tr><td colspan=3 height='"+(JSPSoftWindow.TITLE_HEIGHT-5)+"' valign=top><table id="+this.hwd+"_title_line cellpadding=0 cellspacing=0 width='100%' height='100%;' style='background-color:"+this.tbgcolor+";font-size:9pt;width:100%;color:"+this.tfgcolor+";table-layout:fixed;white-space: nowrap;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;'><tr><td valign=top style='padding-left:5px;width:80%'><img width=16 height=16 id="+this.hwd+"_icon src='/images/win.gif' nowrap=true align=absmiddle><span style='margin-left:3;padding-top:3;font-size:12px;font-weight:bold;cursor:default;' id="+this.hwd+"_title>"+title1+"</span></td><td align=right style='padding-right:5px;' valign=top><img src='/script/images/subwin/mini.gif' id="+this.hwd+"_button_min align=absmiddle style='cursor:hand;"+(!this.eventMin?"display:none;":"")+"'>&nbsp;<img id="+this.hwd+"_button_max src='/script/images/subwin/max.gif' align=absmiddle style='cursor:hand;"+(!this.eventMax?"display:none;":"")+"'>&nbsp;<img ondragstart='return false;' onmousedown='event.cancelBubble=true;return false;' id="+this.hwd+"_button_close src='/web/images/close0.gif' onmouseover='this.src=replaceEx(this.src,0,1);' onmouseout='this.src=replaceEx(this.src,1,0);' style='cursor:hand;"+(!this.eventClose?"display:none;":"")+"' align=absmiddle></td></tr></table></td></tr></table>";
			wincode+="</DIV>";
	//底部表格
			wincode+="<DIV style='position:absolute;height:5px;bottom:"+(JSPSoftWindow.SHADOW_BOTTOM)+";left:"+(JSPSoftWindow.SHADOW_LEFT+5)+";padding-right:"+(JSPSoftWindow.SHADOW_RIGHT+5)+";'><div id="+this.hwd+"_bottom style='background-color:"+this.bgcolor+";width:100%;height:5;'></div></div>";
	//虚线
			wincode+='<DIV style="POSITION:absolute;top:'+(JSPSoftWindow.SHADOW_TOP+JSPSoftWindow.TITLE_HEIGHT-1)+';left:'+JSPSoftWindow.SHADOW_LEFT+';padding-right:'+JSPSoftWindow.SHADOW_RIGHT+'"><div style="width:100%;height:1px;overflow:hidden;line-height:1px;FONT-SIZE: 1px;background-image:url(/script/images/subwin/header-delimiter.gif);BACKGROUND-REPEAT: repeat-x;"></DIV></div>';
	//内容
		wincode+=' <div style="position:absolute;height:100%;top:0;left:0;padding-left:'+JSPSoftWindow.SHADOW_LEFT+';padding-right:'+(JSPSoftWindow.SHADOW_RIGHT)+';padding-top:'+(JSPSoftWindow.SHADOW_TOP+JSPSoftWindow.TITLE_HEIGHT)+';padding-bottom:'+(JSPSoftWindow.SHADOW_BOTTOM+5)+';">';
			wincode+='<div id='+this.hwd+'_content_parent style="background-color:'+this.bgcolor+';height:100%;scrollbar-face-color: '+this.scroll_color+';scrollbar-shadow-color: '+this.bgcolor+';scrollbar-highlight-color: '+this.bgcolor+';scrollbar-3dlight-color: '+this.bgcolor+';scrollbar-darkshadow-color: '+this.bgcolor+';scrollbar-track-color: '+this.bgcolor+';scrollbar-arrow-color: '+this.bgcolor+';">';
			wincode+='<div style="width:100%;height:100%;overflow-x:hidden;overflow-y:auto;" id='+this.hwd+'_content>'+content1+'</div>';
			//wincode+='<div style="width:100%;height:100%;overflow-x:hidden;overflow-y:auto;" id='+this.hwd+'_content><iframe src="about:blank" name=frm'+this.hwd+'></iframe></div>';
			wincode+='</div>';
		wincode+='</div>';
			//resize
			wincode+='<DIV style="FONT-SIZE: 5px;line-height:5px;POSITION: absolute;height:5;width:5;bottom:'+(JSPSoftWindow.SHADOW_BOTTOM+4)+';right:'+(JSPSoftWindow.SHADOW_RIGHT+4)+';BACKGROUND-REPEAT: no-repeat;">';
			wincode+='<div id='+this.hwd+'_resize style="overflow:hidden;position:absolute;background-color:'+this.fgcolor+';left:0;top:4;width:1;height:1"></div>';
			wincode+='<div id='+this.hwd+'_resize style="overflow:hidden;position:absolute;background-color:'+this.fgcolor+';left:1;top:3;width:1;height:1"></div>';
			wincode+='<div id='+this.hwd+'_resize style="overflow:hidden;position:absolute;background-color:'+this.fgcolor+';left:2;top:2;width:1;height:1"></div>';
			wincode+='<div id='+this.hwd+'_resize style="overflow:hidden;position:absolute;background-color:'+this.fgcolor+';left:3;top:1;width:1;height:1"></div>';
			wincode+='<div id='+this.hwd+'_resize style="overflow:hidden;position:absolute;background-color:'+this.fgcolor+';left:4;top:0;width:1;height:1"></div>';
			wincode+='<div id='+this.hwd+'_resize style="overflow:hidden;position:absolute;background-color:'+this.fgcolor+';left:2;top:4;width:1;height:1"></div>';
			wincode+='<div id='+this.hwd+'_resize style="overflow:hidden;position:absolute;background-color:'+this.fgcolor+';left:3;top:3;width:1;height:1"></div>';
			wincode+='<div id='+this.hwd+'_resize style="overflow:hidden;position:absolute;background-color:'+this.fgcolor+';left:4;top:2;width:1;height:1"></div>';
			wincode+='<div id='+this.hwd+'_resize style="overflow:hidden;position:absolute;background-color:'+this.fgcolor+';left:4;top:4;width:1;height:1"></div>';
		return wincode;
	}
	this.winobj.oncontextmenu=function(){return false;}
	this.winobj.onselectstart=function(){if(event.srcElement.tagName!="INPUT")return false;};
	this.winobj.innerHTML=this.createHtml();
	//设置显示内容
	this.setContent=function(ct){$(this.hwd+"_content").innerHTML=JSPSoftWindow.getValue(ct,"");};
	//追加显示内容
	this.appendContent=function(ct){$(this.hwd+"_content").insertAdjacentHTML("beforeEnd",JSPSoftWindow.getValue(ct,""));};
	//装载Ajax xml内容
	this.loadAjaxXmlContent=function(url1){this.setContent("正在装载...");var xmlobj1=XmlDocument.create();xmlobj1.async=false;xmlobj1.load(url1);this.setContent(xmlobj1.selectSingleNode("root").getAttribute("content"));};
	//装载Ajax内容
	this.loadAjaxContent=function(url1){this.setContent("正在装载...");var xmlhttp=XmlHttp.create();xmlhttp.open("GET",url1,false);this.setContent(xmlhttp.ResponseText);};
	//追加Ajax xml内容
	this.appendAjaxXmlContent=function(url1){var xmlobj1=XmlDocument.create();xmlobj1.async=false;xmlobj1.load(url1);this.appendContent(xmlobj1.selectSingleNode("root").getAttribute("content"));}
	//添加到窗口容器
	this.winsetobj.windowContainer.appendChild(this.winobj);
	//设置标题栏闪动
	this.refreshTitle=function(time_value,refresh_count,color123){
		if(this.flashing)return;
		if(!this.old_title_color)this.old_title_color=this.tbgcolor;
		clearInterval(top.gCurrentDialogInterval);
		var swinobj=this;
		if(this.showed){
			var times=1;
			top.gCurrentDialogInterval=setInterval(function(){
				if(times%2)swinobj.setTitleBgcolor(color123);
				else swinobj.setTitleBgcolor(swinobj.old_title_color);
				if(times>=refresh_count||!swinobj.showed){
					clearInterval(top.gCurrentDialogInterval)
					swinobj.setTitleBgcolor(swinobj.old_title_color);
				}
				times ++;
			},time_value);
		}
	}
	this.appended=true;
	//显示窗口
	this.show=function(){
		this.showed=true;
		this.flashing=true;

		var winObj=this;
		if(!document.body||!JSPSoftWindow.maskLayer)return setTimeout(new function(){JSPSoftWindow.create();winObj.show();},200);
		if(this.eventMin){
			document.getElementById(this.hwd+'_button_min').style.display='';
			document.getElementById(this.hwd+'_button_min').onclick=function(){winObj.eventMin();}
		}
		if(this.eventMax){
			document.getElementById(this.hwd+'_button_max').style.display='';
			document.getElementById(this.hwd+'_button_max').onclick=function(){winObj.eventMax();}
		}
		if(this.eventClose){
			document.getElementById(this.hwd+'_button_close').style.display='';
			document.getElementById(this.hwd+'_button_close').onclick=function(){winObj.eventClose();winObj.destory();}
		}
		JSPSoftWindow.resizeMask();

		if(!this.appended){
			this.winsetobj.windowContainer.appendChild(this.winobj);
			this.appended=true;
		}
		if(!this.showing){
			this.winobj.style.display="";
			var times=1;
			var tmpobj=$(winObj.hwd);

			var flash_frame_count=3;
			clearInterval(top.gCurrentDialogInterval);
			top.gCurrentDialogInterval=setInterval(function(){
				var w11=(winObj.width*times)/flash_frame_count;
				var h11=(winObj.height*times)/flash_frame_count;
				tmpobj.style.top=document.body.scrollTop+(document.body.clientHeight-Math.max(JSPSoftWindow.MIN_WIDTH,h11))/2;
				tmpobj.style.left=(document.body.clientWidth-Math.max(JSPSoftWindow.MIN_WIDTH,w11))/2;
				tmpobj.style.pixelWidth=Math.max(JSPSoftWindow.MIN_WIDTH,w11);
				tmpobj.style.pixelHeight=Math.max(JSPSoftWindow.MIN_WIDTH,h11);
				if(times==flash_frame_count){
					clearInterval(top.gCurrentDialogInterval);
					winObj.flashing=false;
				}
				times++;
			},150/flash_frame_count);
		};
	};
	//销毁对象
	this.destory=function(){
		this.hide();
		var winObj=this;
		clearInterval(top.gCurrentDialogInterval);
		JSPSoftWindow.removeWindow(winObj.hwd);
		setTimeout(function(){for(var i=0;winObj!=null&&i<5;i++){try{winObj.winobj.outerHTML="";}catch(ex){};winObj=null;delete winObj;}},200);
	}
	//隐藏窗口
	this.hide=function(){
		document.body.onkeydown=function(){};
		if(!this.appended)return;
		this.showing=false;
		this.winobj.style.display='none';
		JSPSoftWindow.resizeMask();
	}
	this.dealModelEvent=function(winObj){
		try{
			if(event.keyCode==27)try{winObj.destory();JSPSoftWindow.resizeMask();}catch(exp1){}
			if(!winObj.flashing&&JSPSoftWindow.isMaskShowing()&&winObj.model&&!findContainer(event.srcElement,winObj.hwd)){
				winObj.refreshTitle(45,5,'#F4CD6A');
				event.cancelBubble=true;
				event.returnValue=false;
				return false;
			}
		}catch(ex){}
	}
	//设置窗口激活
	this.focus=function(){JSPSoftWindow.setCurrent(eval(this.hwd));};
	//模式方式显示
	this.setModel=function(true_or_false){
		this.model=true_or_false;
		//非闪烁，模式显示
		var winObj=this;
		if(winObj.model){
			document.body.onkeydown   =proxy(winObj.dealModelEvent,winObj);
			document.body.onmousedown =proxy(winObj.dealModelEvent,winObj);
		}
		if(shadowIframe&&shadowIframe.document&&shadowIframe.document.body)
			fAddEvent(shadowIframe.document.body,"onmousedown",function(){JSPSoftWindow.create();winObj.refreshTitle(45,5,'#F4CD6A');return false;},!winObj.model);
		else 
			setTimeout(new function(){JSPSoftWindow.create();winObj.setModel(true_or_false);},100);
	}
	this.setDisabled=function(dis1){this.winobj.disabled=dis1;};
	this.max=function(){this.winobj.style.cssText="left:0;top:0;width:"+500+";height="+500+";";};
	this.setIcon=function(imgsrc11){$(this.hwd+"_icon").src=imgsrc11;};
	this.setTitle=function(tit1){$(this.hwd+"_title").innerText=tit1;};
	this.setShadow=function(showit11){$(this.hwd+"_shadow").style.display=(showit11?"":"none");};
	this.setTitleBgcolor=function(tbcolor11){
			if(!this.winobj)return;
			this.tbgcolor=tbcolor11;
			//修改圆角
			var tmp=$(this.hwd+'_title_circle');
			if(!tmp)return;
			for(var i=0;i<tmp.length;i++)tmp[i].style.backgroundColor=this.tbgcolor;
			//修改中间背景
			if($(this.hwd+'_title_middle'))$(this.hwd+'_title_middle').style.backgroundColor=this.tbgcolor;
			//修改标题背景
			if($(this.hwd+'_title_line'))$(this.hwd+'_title_line').style.backgroundColor=this.tbgcolor;
		};
	this.setTitleFgcolor=function(tfcolor11){
			if(!this.winobj)return;
			this.tfgcolor=tfcolor11;
			//修改标题背景
			if($(this.hwd+'_title_line'))$(this.hwd+'_title_line').style.color=this.tfgcolor;
		};
	this.setBgcolor=function(bgcolor11){
			this.bgcolor=bgcolor11;
			//修改圆角
			var tmp=document.all(this.hwd+'_bottom_circle');
			for(var i=0;i<tmp.length;i++)tmp[i].style.backgroundColor=this.bgcolor;
			//修改中间背景
			$(this.hwd+'_bottom').style.backgroundColor=this.bgcolor;
			//修改标题背景
			tmp=$(this.hwd+'_content_parent');
			tmp.style.backgroundColor=this.bgcolor;
			//tmp.style.ScrollbarFaceColor: '+this.scroll_color+';
			tmp.style.scrollbarShadowColor=this.bgcolor;
			tmp.style.scrollbarHighlightColor=this.bgcolor;
			tmp.style.scrollbar3dLightColor=this.bgcolor;
			tmp.style.scrollbarDarkShadowColor=this.bgcolor;
			tmp.style.scrollbarTrackColor=this.bgcolor;
			tmp.style.scrollbarArrowColor=this.bgcolor;
		};
	this.setFgcolor=function(fgcolor11){
			this.fgcolor=fgcolor11;
			//修改标题背景
			$(this.hwd+'_content').style.color=this.fgcolor;
			//修改resize
			var tmp=document.all(this.hwd+'_resize');
			for(var i=0;i<tmp.length;i++)tmp[i].style.backgroundColor=this.bgcolor;
		};
	this.setColor=function(fgcolor11,bgcolor11){
		this.setFgcolor(fgcolor11);
		this.setBgcolor(bgcolor11);
		this.setTitleBgcolor(bgcolor11);
		this.setTitleFgcolor(fgcolor11);
	}
	this.setResize=function(true_or_false){this.winobj.resizable=true_or_false;}
	this.setSize=function(w11,h11){
			w11=Math.max(JSPSoftWindow.MIN_WIDTH,w11)-(Math.max(JSPSoftWindow.MIN_WIDTH,w11)%2);
			h11=Math.max(JSPSoftWindow.MIN_WIDTH,h11)-(Math.max(JSPSoftWindow.MIN_WIDTH,h11)%2);
			this.width=Math.max(JSPSoftWindow.MIN_WIDTH,w11);
			this.height=Math.max(JSPSoftWindow.MIN_WIDTH,h11);
			if(this.showing){
				var tmpobj=$(this.hwd);
				tmpobj.style.pixelWidth=Math.max(JSPSoftWindow.MIN_WIDTH,w11);
				tmpobj.style.pixelHeight=Math.max(JSPSoftWindow.MIN_WIDTH,h11);
			};
		};
	this.setPosition=function(x1,y1){
		var tmpobj=$(this.hwd);
		if(tmpobj){
			tmpobj.style.left=parseInt(x1);
			tmpobj.style.top=parseInt(y1);
		}
	};
}
fAddEvent(document,"onreadystatechange",function(){if(document.body&&!JSPSoftWindow.maskLayer)JSPSoftWindow.create();});
