

function rollover_obj()
{
	this.ready = false;
}

rollover_obj.prototype.init = function(v_onimage, v_offimage) {
	this.onimage = new Image();
	this.offimage = new Image();
	this.onimage.src = v_onimage;
	this.offimage.src = v_offimage;
	this.onimagesrc = v_onimage;
	this.offimagesrc = v_offimage;
	this.ready = true;
}

rollover_obj.prototype.turnOn = function(imgname)
{
	if (document.images && this.ready) {
		document[imgname].src = this.onimagesrc;
	}
}

rollover_obj.prototype.turnOff = function(imgname)
{
	if (document.images && this.ready) {
		document[imgname].src = this.offimagesrc;
	}
}

//'------------------------------------------------------------------------



function textswap_obj()
{
	this.texts = new Array();
	this.active = "";
}

textswap_obj.prototype.addText = function(id, v_active)
{
	if (v_active) this.active = id;
	this.texts[this.texts.length] = id;
}

textswap_obj.prototype.selectText = function(id)
{
	var d = document;
	var ns4 = document.layers?true:false;
	var ie = document.all?true:false;
	var dom = document.getElementById?true:false;

	//alert('ns4:' + ns4 + ' ie:' + ie + ' dom:' + dom);

	var p_active = dom ? d.getElementById(this.active) : (ie ? d.all[this.active] : d.layers[this.active]);
	var p_id = dom ? d.getElementById(id) : (ie ? d.all[id] : d.layers[id]);
	
	if (!p_id) return;
	//debug
	//alert('p_id pointer: ' + p_id + (p_id)?('   p_id name: ' + p_id.id):'');
	//alert('p_active pointer: ' + p_active + (p_active)?('   p_active name: ' + p_active.id):'');
	//debug

	if (this.active != "") {
		if (ns4) {
			//alert('there is an active layer pointer, making change ');
			//alert('p_active.visibility' + p_active.visibility);
			p_active.visibility = 'hide';
			//alert('p_active.visibility' + p_active.visibility);
			p_id.visibility = 'show';
		} else {
			p_active.style.visibility = 'hidden';
			p_id.style.visibility = 'visible';
		}
		this.active = id;
	} else {
		//alert('there is no active layer pointer, finding layer ');
		for (i = 0 ; i < this.texts.length ; i++) {
			//alert('checking ' + i + 'th text, which is equal to' + this.texts(i));
			if (this.texts(i) == id) {
				//alert('ith text is equal to this.texts(i), showing');
				if (ns4) {
					p_id.visibility = 'show';
				} else {
					p_id.style.visibility = 'visible';
				}
				this.active = id;
				break;
			} else {
				//alert('ith text is not equal to this.texts(i), hiding');
				if (ns4) {
					p_id.visibility = 'hide';
				} else {
					p_id.style.visibility = 'hidden';
				}
			}
		}
	}
}

