/**
 * Basic browser sniffing
 */
var opera5 = (navigator.userAgent.indexOf("Opera 5")!=-1) 
	||(navigator.userAgent.indexOf("Opera/5")!=-1);
var opera6 = (navigator.userAgent.indexOf("Opera 6")!=-1) 
	||(navigator.userAgent.indexOf("Opera/6")!=-1);
var agent = navigator.userAgent.toLowerCase();
if (agent.indexOf("mac")!= -1) var mac = true;
if (agent.indexOf("msie") != -1) var ie = true;
var mac_ie = mac && ie;

/**
 * Get a reference to an object with the id
 * passed
 */
function ftnGetObject(id) {
	return document.getElementById(id);
}

/**
 * Gets the current location of the object passed,
 * as an array containing the x,y coordinates
 */
function ftnGetObjectPosition(object) {
	var x = 0;
	var y = 0;
	if (object.offsetParent) {
		x = object.offsetLeft
		y = object.offsetTop
		while (object = object.offsetParent) {
			x += object.offsetLeft
			y += object.offsetTop
		}
	}
	return [x,y];
}

function ftnGetObjectHeight(object) {
	if (opera5) { 
		height = object.style.pixelHeight;
	} else {
		height = object.offsetHeight;
	}
	return height;
}

function ftnGetObjectWidth(object) {
	if (opera5) {
		width = object.style.pixelWidth;
	} else {
		width = object.offsetWidth;
	}
	return width;
}

function ftnSetObjectHeight(object) {
	if (opera5) { 
		object.style.pixelHeight = height;
	} else {
		object.offsetHeight = height;
	}
	return height;
}

function ftnSetObjectWidth(object) {
	if (opera5) {
		object.style.pixelWidth = width;
	} else {
		object.offsetWidth = width;
	}
	return width;
}

function ftnMoveObject(object, x, y) {
	objStyle = object.style;
	if (opera5) {
		objStyle.pixelTop = y;
			objStyle.pixelLeft = x;
	} else {
		objStyle.top = y + 'px';
			objStyle.left = x + 'px';
	}	
}

function ftnChangeImgSrc(strImageId,strImageSrc) {
	objImage = ftnGetObject(strImageId);
	objImage.src = strImageSrc;
}
