//getElement by Id
getField=function(name){
	var target=new obj(name);
	return target;
}

obj=function(target){ 
	this.src = document.getElementById(target); 
}

obj.prototype.addEvent = function(el, evname, func) { //document, onxx, function
	if (el.attachEvent) { // IE
		el.attachEvent("on" + evname, func);
	} else if (el.addEventListener) { // Gecko / W3C
		el.addEventListener(evname, func, true);
	} else {
		el["on" + evname] = func;
	}
}
obj.prototype.setBorder=function(border){
	if(border==null || border=="undefined"){
		this.src.style.border = '1px solid #999999';
	}else{
		this.src.style.border = '1px solid '+border;
	}
}
obj.prototype.setBgColor=function(color){
	if(color==null || color=="undefined"){
		this.src.style.backgroundColor = '#FFFFFF';
	}else{
		this.src.style.backgroundColor = color;
	}
}
obj.prototype.setColor=function(color){
	if(color==null || color=="undefined"){
		this.src.style.color = 'black';
	}else{
		this.src.style.color = color;
	}
}
obj.prototype.getColor=function(){	return this.src.style.color; }
obj.prototype.getName=function(){	return this.src.name; }
obj.prototype.setHeight=function(height){ this.src.style.height = height; }
obj.prototype.setWidth=function(width){	this.src.style.width = width; }
obj.prototype.setLeft=function(left){ this.src.style.left = left; }
obj.prototype.setTop=function(top){ this.src.style.top = top; }
obj.prototype.setDisplay=function(){ this.src.style.display = "inline"; }
obj.prototype.setNone=function(){ this.src.style.display = "none"; }
obj.prototype.setValue=function(value){	this.src.value = value; }
obj.prototype.getValue=function(){ return this.src.value; }
obj.prototype.setInnerHTML=function(reply){	this.src.innerHTML = reply; }
obj.prototype.getInnerHTML=function(){	return this.src.innerHTML; }
obj.prototype.setVisible=function(){ this.src.style.visibility = "visible"; }
obj.prototype.setHidden=function(){	this.src.style.visibility = "hidden"; }
obj.prototype.setLoading=function(msg){
	switch(msg){
		case 1:	this.src.innerHTML = "<img src='../templates/default/images/portfolio/loading.gif' />";break;
		case 2:	this.src.innerHTML = "<img src='../templates/default/images/portfolio/loading.gif' /> Loading...... ";break;
	}
}
obj.prototype.setClass=function(className){	this.src.className = className; }
obj.prototype.setCursor=function(type){	this.src.style.cursor=type; }
obj.prototype.focus=function(){	this.src.focus(); }