 	function editCompare(obj){
  		if($("span"+obj.name)==null){
  					tip=document.createElement("span");
  					tip.id="span"+obj.name;
  					obj.parentNode.appendChild(tip);
  				}else{
  					tip=$("span"+obj.name);
  				}
  		if(obj.checked){
  			major.addToCompareList(obj.name,function(data){
  				
  				if(data=="success")
  						$(tip).innerHTML="<img src='../images/check.gif'/>";
  					else if(data=="none"){
  						obj.checked="false";
  						$(tip).innerHTML = "<img src='../images/fail.gif'/>";
  					}else{
  						alert("请先登录系统");
  					}});
  		}else{
  			major.deleteFromCompareList(obj.name,function(data){
  			if(data=="success"){
  				$(tip).innerHTML = "<img src='../images/error.gif'/>";
  			}	
  			else 
  				$(tip).innerHTML = "";}
  			);
  		}
  	}
  	function hiddenOrShow(objId){
  		if($(objId).style.display == '')
  			$(objId).style.display = 'none';
  		else
  			$(objId).style.display = '';
	}
	 
	 //通用图片处理大小，按宽度等比例缩小,type：不写是按宽度，高度；1：宽度；2：高度
	function pic_resizer(picname, picwidth, picheight, type) {
		var pic_name = picname;
		var pic_width = picwidth;
		var pic_height = picheight;
		var vtype = null;
		if (type) {
			vtype = type;
		}
		var elpics = null;
		if (pic_name) {
			elpics = document.getElementsByName(pic_name);
		} else {
			elpics = document.getElementsByTagName("img");
		}
		for (var i = 0; i < elpics.length; i++) {
			elpics[i].onload = function () {
				if (vtype) {
					if (vtype == 1 && this.width > pic_width) {
						this.height = this.height * pic_width / this.width;
						this.width = pic_width;
						 
					}
					if (vtype == 2 && this.height > pic_height) {
						this.width = this.width * pic_height / this.height;
						this.height = pic_height;
						 
					}
				} else {
					if (this.width > pic_width || this.height > pic_height) {
						var rate1 = this.width / pic_width;
						var rate2 = this.height / pic_height;
						if (rate1 > rate2) {
							this.height = this.height * pic_width / this.width;
							this.width = pic_width;
							 
						} else {
							this.width = this.width * pic_height / this.height;
							this.height = pic_height;
							 
						}
					}
				}
			};
		}
	}


	//通用图片处理大小，用于单个图片处理，按宽度等比例缩小,type：不写是按宽度，高度；1：宽度；2：高度
	function pic_resizer_single(picname, picurl, picwidth, picheight, type) {
		var pic_name = picname;
		var pic_width = picwidth;
		var pic_height = picheight;
		var vtype = null;
		if (type) {
			vtype = type;
		}
		var elpics = null;
		elpics = document.getElementById(pic_name);
		
		elpics.onload = function () { 
			if (vtype) {
				if (vtype == 1 && this.width > pic_width) {
					this.height = this.height * pic_width / this.width;
					this.width = pic_width;
				}
				if (vtype == 2 && this.height > pic_height) {
					this.width = this.width * pic_height / this.height;
					this.height = pic_height;	 
				}
			} else {  
				if (this.width > pic_width || this.height > pic_height) { 
					var rate1 = this.width / pic_width;
					var rate2 = this.height / pic_height;
					if (rate1 > rate2) { 
						this.height = this.height * pic_width / this.width;
						this.width = pic_width;
					} else { 
						this.width = this.width * pic_height / this.height;
						this.height = pic_height;
					}
				}
			}
		};
		elpics.src = picurl;
  	}
var net = new Object();
net.READY_STATE_UNINITIALIZED = 0;
net.READY_STATE_LOADING = 1;
net.READY_STATE_LOADED = 2;
net.READY_STATE_INTERACTIVE = 3;
net.READY_STATE_COMPLETE = 4;
//多浏览器适应
net.ContentLoader = function (url, onload, onerror, method, params, contentType) {
	this.req = null;
	this.onload = onload;
	this.onerror = (onerror) ? onerror : this.defaultError;
	this.loadXMLDoc(url, method, params, contentType);
};
net.ContentLoader.prototype.loadXMLDoc = function (url, method, params, contentType) {
	if (!method) {
		method = "GET";
	}
	if (!contentType && method == "POST") {
		contentType = "application/x-www-form-urlencoded";
	}
	if (window.XMLHttpRequest) {
		this.req = new XMLHttpRequest();
	} else {
		if (window.ActiveXObject) {
			this.req = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	if (this.req) {
		try {
			var loader = this;
			this.req.onreadystatechange = function () {
				net.ContentLoader.onReadyState.call(loader);
			};
			this.req.open(method, url, true);
			if (contentType) {
				this.req.setRequestHeader("Content-Type", contentType);
			}
			this.req.send(params);
		}
		catch (err) {
			this.onerror.call(this);
		}
	}
};
net.ContentLoader.onReadyState = function () {
	var req = this.req;
	var ready = req.readyState;
	if (ready == net.READY_STATE_COMPLETE) {
		var httpStatus = req.status;
		if (httpStatus == 200 || httpStatus == 0) {
			this.onload.call(this);
		} else {
			this.onerror.call(this);
		}
	}
};
net.ContentLoader.prototype.defaultError = function () {
	alert("error fetching data!" + "\n\nreadyState:" + this.req.readyState + "\nstatus: " + this.req.status + "\nheaders: " + this.req.getAllResponseHeaders());
};
function onerrors() {
}
function joingroup(num){var url = '../group/join.action?g='+num;var loader1=new net.ContentLoader(url,joingroupb,onerrors,"POST",null);} 	
function joingroupb(){alert(this.req.responseText);}
/*检查输入字符串是否为空*/
function isEmpty(inputString) {/*字符串长度为0，则字符串为空*/if ((inputString == null) || (inputString.length == 0)) {return true;}if(inputString=='<br/>'){return true;}/*字符串中有一个不是空格，则字符串不为空*/for (i = 0; i < inputString.length; i++) {if (inputString.charAt(i) != " ") {return false;}}/*字符串中全是空格，则字符串是空*/return true;}
function checkclick(msg){if(confirm(msg)){event.returnValue=true;}else{event.returnValue=false;}}