

// convert object name string or object reference
// into a valid object reference ready for style change
function getObject(obj) {
	var theObj;
	if (document.layers) {
		if (typeof obj == "string") {
			return document.layers[obj];
		} else {
			return obj;
		}
	}
	if (document.all) {
		if (typeof obj == "string") {
			return document.all(obj).style;
		} else {
			return obj.style;
		}
	}
	if (document.getElementById) {
		if (typeof obj == "string") {
			return document.getElementById(obj).style;
		} else {
			return obj.style;
		}
	}
	return null;
}


// position an object at a specific pixel coordinate
function shiftTo(obj, x, y) {
	var theObj = getObject(obj);
	if (theObj.moveTo) {
		theObj.moveTo(x,y);
	} else if (typeof theObj.left != "undefined") {
		theObj.left = x;
		theObj.top = y;
	}
}

function resizeTo( obj, x, y ) {
	var theObj = getObject(obj)
	if (theObj.resizeTo) {
		theObj.resizeTo(x, y);
	} else if (typeof theObj.width != "undefined") {
		theObj.width = x;
		theObj.height = y;
	}
}


// move an object by x and/or y pixels
function shiftBy(obj, deltaX, deltaY) {
	var theObj = getObject(obj)
	if (theObj.moveBy) {
		theObj.moveBy(deltaX, deltaY);
	} else if (typeof theObj.left != "undefined") {
		theObj.left = parseInt(theObj.left) + deltaX;
		theObj.top = parseInt(theObj.top) + deltaY;
	}
}



// set the visibility of an object to visible
function show(obj) {
	var theObj = getObject(obj)
	theObj.visibility = "visible";
/*	if( navigator.appVersion.indexOf("MSIE") == -1 ) {
		x = parseInt( theObj.width ) + 40;
		y = parseInt( theObj.height );
		resizeTo( obj, x, y );
	}*/
}
// set the visibility of an object to hidden
function hide(obj) {
	var theObj = getObject(obj)
	theObj.visibility = "hidden";
}

