function StrCode(str){
	if(encodeURIComponent) return encodeURIComponent(str);
	if(escape) return escape(str);
}

function Trim(s){
	var m = s.match(/^\s*(\S+(\s+\S+)*)\s*$/);return (m == null)?"":m[1];
}

function gid(id){
	return document.getElementById?document.getElementById(id):null;
}
	
function gname(name){
	return document.getElementsByTagName?document.getElementsByTagName(name):new Array()
}


function Browser(){
	var ua, s, i;
	this.isIE = false;
	this.isNS = false;
	this.isOP = false;
	this.isSF = false;
	ua = navigator.userAgent.toLowerCase();
	s = "opera";
	if ((i = ua.indexOf(s)) >= 0){
	this.isOP = true;
	return;
	}
	s = "msie";
	if ((i = ua.indexOf(s)) >= 0) {
	this.isIE = true;
	return;
	}
	s = "netscape6/";
	if ((i = ua.indexOf(s)) >= 0) {
	this.isNS = true;
	return;
	}
	s = "gecko";
	if ((i = ua.indexOf(s)) >= 0) {
	this.isNS = true;
	return;
	}
	s = "safari";
	if ((i = ua.indexOf(s)) >= 0) {
	this.isSF = true;
	return;
	}
}

