function animateLink(strip, link, width, color)
{
	$(strip).morph('width:'+width+'px;'); 
	$(link).morph('color:'+color+';'); 
	return false;
}
function loadImage(__id)
{
	spImgContH = $('imageContainer').getHeight();
	spImgContW = $('imageContainer').getWidth();
	//$('imageContainer').style.width = spImgContW;
	//$('imageContainer').style.height = spImgContH;
	spImgVPos = (spImgContH - 32)/2;
	spImgHPos = (spImgContW - 32)/2;
	$('imageContainer').innerHTML = '<img id="spinner" src="../images/spinner2.gif" style="margin-top:' + spImgVPos + 'px; margin-left:' + spImgHPos + 'px; margin-right:' + spImgHPos + 'px" />';
	new Ajax.Request('../jax/loadImage.php', {postBody:'__id='+__id, onSuccess:imageReturned});
}
var newImage="";
var myImage="";
function imageReturned(response)
{
	newImage = eval(response.responseText);
	myImage = new Image;
	myImage.onload = imageLoaded;
	myImage.src = newImage.path;
}
function imageLoaded(){
	imgTop = (415 - myImage.height) / 2 + 80;
	var morphContainer = new Effect.Morph('imageContainer', {
		style : "width:"+myImage.width+"px; height:"+myImage.height+"px; top:"+imgTop+"px;",
		afterFinish:showImage
	});
	var morphSpinner = new Effect.Morph('spinner', {
		style : "margin-top:"+(myImage.height-32)/2+"px; margin-left:"+(myImage.width-32)/2+"px;"
	});
}
function showImage(){
	$('imageContainer').innerHTML = "<a href='javascript:loadImage(\"" + newImage.nextId + "\")'><img src='" + newImage.path + "' style='border:0px;' /></a>";
}

function getAbsoluteTop(objectId) 
{
	// Get an object top position from the upper left viewport corner
	// Tested with relative and nested objects
	o = document.getElementById(objectId);
	oTop = o.offsetTop;            // Get top position from the parent object
	while(o.offsetParent!=null) { // Parse the parent hierarchy up to the document element
		oParent = o.offsetParent;  // Get parent object reference
		oTop += oParent.offsetTop; // Add parent top position
		o = oParent;
	}
	// Return top position
	return oTop;
}
function getAbsoluteLeft(objectId) 
{
	// Get an object left position from the upper left viewport corner
	// Tested with relative and nested objects
	o = document.getElementById(objectId);
	oLeft = o.offsetLeft;            // Get left position from the parent object
	while(o.offsetParent!=null) {   // Parse the parent hierarchy up to the document element
		oParent = o.offsetParent;    // Get parent object reference
		oLeft += oParent.offsetLeft; // Add parent left position
		o = oParent;
	}
	// Return left postion
	return oLeft;
}
