String.prototype.DBC2SBC = function() {
	var result='';
	for(di=0;di<this.length;di++){
		var str1 = this.charCodeAt(di);
		if(str1>65248){
			result += String.fromCharCode(this.charCodeAt(di)-65248);
		} else {
			result += this.substr(di,1);
		}
	}
	return result;
}
String.prototype.Trim = function(){
    return this.replace(/(^\s*)|(\s*$)/g, "").DBC2SBC();
}
String.prototype.LTrim = function(){
    return this.replace(/(^\s*)/g, "").DBC2SBC();
}
String.prototype.Rtrim = function(){
    return this.replace(/(\s*$)/g, "").DBC2SBC();
}
String.prototype.Left = function(len){
	return ((len>0)?this.substr(0,len):this.substr(0,this.length+len));
}
String.prototype.Len=function(){
	return this.replace(/[^\x00-\xff]/g,"**").length;
}
function $(name){
	return document.getElementById(name);
}

var cfocus = function(o,st,is){
	o.className = (st)?o.className+' f':o.className.Left(-2);
	if(is)cfocus(o.parentNode,st);
}
var _obj = document.getElementsByTagName("A");
for(i=0;i<_obj.length;i++){
	_obj[i].onfocus=function(){
		this.blur();
	}
}
var _obj = document.getElementsByTagName("INPUT");
for(i=0;i<_obj.length;i++){
	var _type = _obj[i].getAttribute("TYPE");
	_type = _type.toLowerCase();
	if(_type=="image"){
		_obj[i].onfocus=function(){
			this.blur();
		}
	} else if ((_type=="text"||_type=="password")&&_obj[i].readOnly==false&&_obj[i].disabled==false&&_obj[i].getAttribute("name")!="q"){
		_obj[i].onfocus=function(){cfocus(this,true);};
		_obj[i].onblur=function(){cfocus(this,false);}
	}
}
var _obj = document.getElementsByTagName("TEXTAREA");
for(i=0;i<_obj.length;i++){
	if (_obj[i].readOnly==false&&_obj[i].disabled==false){
		_obj[i].onfocus=function(){cfocus(this,true);};
		_obj[i].onblur=function(){cfocus(this,false);}
	}
}