function Property(name,type){
	var argc = Property.arguments.length;
	var argv = Property.arguments;
	
	if(name.length < 1) return null;
	if(type.length < 1) return null;
	this.name = name;
	this.type = type;
	this.isAttribute = (argc > 2) ? getBooleanValue(argv[2]) : false;
	this.value = null;
	
	this.setValuesDOM = function(values){
		if(typeof(values) == "string"){
			this.valuesDOM = values.split(",");
		}else if(typeof(values) == "object"){
			this.valuesDOM = values;
		}else{
			this.valuesDOM = new Array("","");
		}
		return this.valuesDOM;
	}
	
	this.setValuesNS = function(values){
		if(typeof(values) == "string"){
			this.valuesNS = values.split(",");
		}else if(typeof(values) == "object"){
			this.valuesNS = values;
		}else{
			this.valuesNS = new Array("","");
		}
		return this.valuesNS;
	}
	this.valuesDOM = (argc > 3) ? this.setValuesDOM(argv[3]) : new Array("","");
	this.valuesNS = (argc > 4) ? this.setValuesNS(argv[4]) : new Array("","");
	
	this.setValue = function(obj,value){
		var argc = this.setValue.arguments.length;
		var argv = this.setValue.arguments;
		
		absolute = (argc > 2) ? getBooleanValue(argv[2]) : true;
		
		if(absolute){
			if(value == null) value = this.value;
		}else{
			if(value == null){
				if(this.type == "int") value = 0;
				else if(this.type == "string") value = "";
				else if(this.type == "color") value = "";
				else if(this.type == "boolean") value = false;
				else value = "";
			}
		}
		
		if(DOM || MS){
			if(typeof(value) == "boolean"){
				if(value) value = this.valuesDOM[1];
				else value = this.valuesDOM[0];
			}
			if(this.type == "int"){
				if(isNaN(value)){
					if(absolute) value = this.getValue();
					else value = 0;
				}
				if(isNaN(value)) return false;
				if(absolute){
					this.value = parseInt(value);
				}else{
					this.value = parseInt(this.value) + parseInt(value);
				}
				if(this.isAttribute){
					if(obj) eval("obj."+this.name+" = "+this.value+";");
				}else{
					if(obj) eval("obj.style."+this.name+" = "+this.value+";");
				}
			}else if(this.type == "string"){
				if(absolute){
					this.value = ""+value;
				}else{
					this.value = this.value + "" + value;
				}
				if(this.isAttribute){
					if(obj) eval("obj."+this.name+" = '"+this.value+"';");
				}else{
					if(obj) eval("obj.style."+this.name+" = '"+this.value+"';");
				}
			}else if(this.type == "color"){
				if(value.indexOf("#") != 0) value = "#"+value;
				if(value.length != 7) return false;
				this.value = ""+value;
				if(this.isAttribute){
					if(obj) eval("obj."+this.name+" = '"+this.value+"';");
				}else{
					if(obj) eval("obj.style."+this.name+" = '"+this.value+"';");
				}
			}else if(this.type == "boolean"){
				value = getBooleanValue(value);
				this.value = value;
				if(this.isAttribute){
					if(obj) eval("obj."+this.name+" = "+this.value+";");
				}else{
					if(obj) eval("obj.style."+this.name+" = "+this.value+";");
				}
			}else{
				this.value = ""+value;
				if(this.isAttribute){
					if(obj) eval("obj."+this.name+" = '"+this.value+"';");
				}else{
					if(obj) eval("obj.style."+this.name+" = '"+this.value+"';");
				}
			}
		}else if(NS){
			if(typeof(value) == "boolean"){
				if(value) value = this.valuesNS[1];
				else value = this.valuesNS[0];
			}
			if(this.type == "int"){
				if(isNaN(value)){
					if(absolute) value = this.getValue();
					else value = 0;
				}
				if(isNaN(value)) return false;
				if(absolute){
					this.value = parseInt(value);
				}else{
					this.value = parseInt(this.value) + parseInt(value);
				}
				if(obj) eval("obj."+this.name+" = "+this.value+";");
			}else if(this.type == "string"){
				if(absolute){
					this.value = ""+value;
				}else{
					this.value = this.value + "" + value;
				}
				if(obj) eval("obj."+this.name+" = '"+this.value+"';");
			}else if(this.type == "color"){
				if(value.indexOf("#") != 0) value = "#"+value;
				if(value.length != 7) return false;
				this.value = ""+value;
				if(obj) eval("obj."+this.name+" = '"+this.value+"';");
			}else if(this.type == "boolean"){
				value = getBooleanValue(value);
				this.value = value;
				if(obj) eval("obj."+this.name+" = "+this.value+";");
			}else{
				this.value = ""+value;
				if(obj) eval("obj."+this.name+" = '"+this.value+"';");
			}
		}
		return true;
	}
	
	this.attachValue = function(name){
		if(typeof(name) == "string" && name.length > 0){
			obj = getElem("id",name,null);
		}else obj = name;
		if(obj){
			if(DOM || MS){
				if(this.isAttribute) value = eval("obj."+this.name);
				else value = eval("obj.style."+this.name);
			}else if(NS){
				value = eval("obj."+this.name);
			}
			if(this.type == "int"){
				var px = value.indexOf("px");
				var pz = value.indexOf("%");
				if(px >= 0) value = value.substr(0,px);
				if(pz >= 0) value = value.substr(0,pz);
			}
			this.value = value;
		}
		return this.value;
	}
	
	this.getValue = function(){
		return this.value;
	}
	
	this.toString = function(){
		var str = "";
		if(this.isAttribute) str = ""+this.name+"=\""+this.getValue()+"\"";
		else str = ""+this.name+":"+this.getValue()+";";
		return str;
	}
}
