// Global variables
var isNav, isIE
var coll = ""
var styleObj = ""
if(parseInt(navigator.appVersion) >= 4)
{
	if(navigator.appName == "Netscape")
	{
		isNav = true
	} else {
		isIE = true
		coll = "all."
		styleObj = ".style"
	}
}

// Convert object name string or object reference into a valid object reference
function getObject(obj) {
	var theObj
	if (typeof obj == "string") {
		theObj = eval("document." + coll + obj + styleObj)
	} else {
		theObj = obj
	}
	return theObj
}

// Positioning an object at a specific pixel coordinate
function shiftTo(obj, x, y) {
	//var theObj = getObject(obj)
	if (isNav) {
		obj.moveTo(x,y)
	} else {
		obj.pixelleft = x
		obj.pixelTop = y
	}
}

// Moving an object by x end/or y pixels
function shiftBy(obj, deltaX, deltaY) {
	//var theObj = getObject(obj)
	if (isNav) {
		obj.moveBy(deltaX, deltaY)
	} else {
		obj.pixelLeft += deltaX
		obj.pixelTop += deltaY
	}
}

// Setting the z-order of an object
function setZIndex(obj, zOrder) {
	//var theObj = getObject(obj)
	obj.zIndex = zOrder
}

// Setting the background color of an object
function setBGColor(obj, color) {
	//var theObj = getObject(obj)
	if (isNav) {
		obj.bgColor = color
	} else {
		obj.backgroundColor = color
	}
}

// Setting the visibillity of an object to visible
function show(obj) {
	//var theObj = getObject(obj)
	obj.visibility = "visible"
}

// Setting the visibillity of an object to visible
function hide(obj) {
	//var theObj = getObject(obj)
	obj.visibility = "hidden"
}

// Retrieving the x coordinate of a positionable object
function getObjectLeft(obj) {
	//var theObj = getObject(obj)	
	if (isNav) {
		return obj.left
	} else {
		return obj.pixelLeft
	}
}

// Retrieving the y coordinate of a positionable object
function getObjectTop(obj) {
	//var theObj = getObject(obj)	
	if (isNav) {
		return obj.top
	} else {
		return obj.pixelTop
	}
}

// Return height of object in pixels
function getObjectHeight(obj) {
	if (isNav) {
		return obj.clip.height
	} else {
		return obj.clientHeight
	}
}

// Return width of object in pixels
function getObjectWidth(obj) {
	if (isNav) {
		return obj.clip.width
	} else {
		return obj.clientWidth
	}
}

// Return the available content width space in browser window
function getInsideWindowWidth() {
	if (isNav) {
		return window.innerWidth
	} else {
		return document.body.clientWidth
	}
}

// Return the available content height space in browser window
function getInsideWindowHeight() {
	if (isNav) {
		return window.innerHeight
	} else {
		return document.body.clientHeight
	}
}

