// JavaScript Document

function Utility(){
}

Utility.prototype.findObj=function(objID){
	var obj=false;
	if(document.all){
		obj=document.all(objID);
	}
	else{
		if(document.getElementById){
			obj=document.getElementById(objID);
		}
		else{
			if(document.layers){
				obj=document.layers[objID];
			}
		}
	}
	return obj;	
}

Utility.prototype.displayObj=function(obj,display){
	var obj=typeof(obj)=="object"?obj:this.findObj(obj);
	if (display){
		obj.style['display'] = "";
	}
	else{
		obj.style['display'] = "none";
	}
}

Utility.prototype.setObjClass=function(obj,sClass){
	var obj=typeof(obj)=="object"?obj:this.findObj(obj);
	obj.className=sClass;
}

Utility.prototype.getObjClass=function(obj){
	var obj=typeof(obj)=="object"?obj:this.findObj(obj);
	return obj.className;
}

Utility.prototype.setObjInnerHTML=function(obj,sHTML,append){
	var obj=typeof(obj)=="object"?obj:this.findObj(obj);
	obj.innerHTML=append?obj.innerHTML+sHTML:sHTML;
}

Utility.prototype.highlightObj=function(obj){
	var obj=typeof(obj)=="object"?obj:this.findObj(obj);
	obj.focus();
	obj.select();
}

Utility.prototype.setObjStyle=function(obj,style,styleValue){
	var obj=typeof(obj)=="object"?obj:this.findObj(obj);
	obj.style[style]=styleValue;
}

Utility.prototype.setObjValue=function(obj,val){
	var obj=typeof(obj)=="object"?obj:this.findObj(obj);
	obj.value=val;
}

Utility.prototype.isEmpty=function(obj){
	var obj=typeof(obj)=="object"?obj:this.findObj(obj);
	if(obj.value=="" || obj.value==null){
		return true;
	}
	return false;
}
Utility.prototype.isValueEqual=function(obj,arrValues){
	var obj=typeof(obj)=="object"?obj:this.findObj(obj);
	for (i=0;i<arrValues.length;i++){
		if(obj.value==arrValues[i]){
			return true;
		}
	}
	return false;
}
