var myImage = new Image();
var divID = null;

function loadFailure()
{
    alert("'" + this.name + "' failed to load.");
    return true;
}

function getImgSize()
{
	//alert("'" + this.name + "' is " + this.width + " by " + this.height + " pixels in size.");
	document.getElementById(divID).style.left = (-1)*((this.width/2))+20+"px";
	document.getElementById(divID).style.top = (-1)*((this.height/2))-20+"px";
	//alert(document.getElementById(divID).style.left);
    return true;
}

function imageAdjust(src,id)
{
	this.divID = id;
	this.myImage.name = src;
	this.myImage.onload = this.getImgSize;
	this.myImage.onerror = this.loadFailure;
	this.myImage.src = src;
}