function objSetupErrMsg() {
	this.NS4 = false;
	this.NS6 = false;
	this.IE4plus = false;
	if (document.layers){
	      //Netscape 4 specific code
	      this.pre = 'document.';
	      this.post = '';
		  this.NS4 = true;
	   }
	if (document.getElementById){
	      //Netscape 6 specific code
	      this.pre = 'document.getElementById("';
	      this.post = '").style';
		  this.NS4 = false;
		  this.NS6 = true;
	}
	if (document.all){
	      //IE4+ specific code
	      this.pre = 'document.all.';
	      this.post = '.style';
		  this.IE4plus = true;
	}
//	document.write(this.NS4);
//	document.write(this.NS6);
//	document.write(this.IE4plus);
	
	this.FindLayer = function(name, doc) {
		var i, layer;
	
	  	for (i = 0; i < doc.layers.length; i++) {
	  		layer = doc.layers[i];
		
		    if (layer.name == name) return layer;
			
	    	if (layer.document.layers.length > 0) {
	      		layer = findLayer(name, layer.document);
				if (layer != null) return layer;
    		}
	  	}
	
		return null;
	}


	this.WritetoLyr = function(id, message) {
		if (document.layers) {
			currLayer = this.FindLayer(id,document);
			if (currLayer!=null) {
				currLayer.document.write(message);
				currLayer.document.close();
			}
		} else if (document.all) {
			obj=eval("document.all."+id);
			obj.innerHTML=message;
		} else {
			document.getElementById(id).innerHTML = message;
		}
	}

	this.ChangeClass = function(id, strClass) {
		if (document.layers) {
			currLayer = this.FindLayer(id,document);
			if (currLayer!=null) {
				currLayer.document.className=strClass;
			}
		} else if (document.all) {
			eval("document.all."+id+".className='"+strClass+"'");
		} else {
			document.getElementById(id).setAttribute('class', strClass);
		}
	}
	
	this.CreateLabel = function(id, label) {
		document.write('<div id="err'+id+'" style="height=1px; display:inline;" class="error"><layer id="err'+id+'"><img src="/images/dot.gif" width="1" height="1" alt="" border="0"></layer></div>');
		document.write('<div id="lbl'+id+'" style="display:inline;" class="text"><layer id="lbl'+id+'">'+label+':</layer></div>&nbsp;');
	}
	
	this.ShowErrorMarker = function(id, marker) {
		this.WritetoLyr('err'+id,marker);
		this.ChangeClass('lbl'+id, "error");
	}

	this.RemoveErrorMarker = function(id) {
		this.WritetoLyr('err'+id,'<img src="/images/dot.gif" width="1" height="1" alt="" border="0">');
		this.ChangeClass('lbl'+id, "text");
	}
	this.ShowErrorMessage = function(message, height) {
		this.WritetoLyr('divError',message);
		if (document.layers) {
			errLayer = this.FindLayer("divError",document);
			errLayer.resizeTo(errLayer.clip.width, height);
//			formLayer = this.FindLayer("divForm",document);
//			formLayer.moveBy(0, height);
		}
	}
	this.RemoveErrorMessage = function(height) {
		this.WritetoLyr('divError','<img src="/images/dot.gif" width="1" height="1" alt="" border="0">');
		if (document.layers) {
			errLayer = this.FindLayer("divError",document);
			errLayer.resizeTo(errLayer.clip.width, 1);
//			formLayer = this.FindLayer("divForm",document);
//			formLayer.moveBy(0, height);
		}
	}
}

