/**
 * @author Jandy,d_hades@hotmail.com
 * @date 2007/03/07
 */
var Class = {
	Create:function(){
		return function(){
			this.initialize.apply(this,arguments);
		}
	}
}
var Form = Class.Create();
	Form.prototype = {
		initialize:function(){
			
		},
		Get:function(id){
			return typeof(id)!="string"?id:document.getElementById(id);
		},
		MaxInput:function(objInID,intMaxLen,objOutID){
			var __maxLen = intMaxLen||100;			
			var __source = this.Get(objInID);
			var __total = __source.value.match(/[\w\u4e00-\u9fa5\-\.\W]/ig)||0;
			var __temp = __total.length||0;			
			if(__temp>__maxLen){
				__source.value = __source.value.substring(0, __maxLen);
				__temp = 0;
			}else{
				__temp = __maxLen - __temp;
			}
			if(objOutID)
				this.Get(objOutID).innerHTML = " [<small>" + __maxLen + " , <span>"+ __temp + "</span></small>]";
			return __temp;
		},
		strReplace:function(str,objOutID){
			var __temp = this.Get(objOutID).value;
			eval("__temp = __temp.replace(/("+str+")/ig,'');");
			this.Get(objOutID).value = __temp;
		},
		isEmpty:function(obj){
			var __elms = this.Get(obj);
			for(var i=0; i<__elms.length; i++)
			{
				if(""==__elms[i].value && "need"==__elms[i].ref)
				{
					__elms[i].style.border = "1px solid red";
					__elms[i].focus();
					return true;
				}
				__elms[i].removeAttribute("style");
			}
			return false;
		}
	}
var Net = Class.Create();
	Net.prototype = {
		initialize:function(){
			alert(document.domain)
		}
	}