function reloadImg()
{
    uniq = new Date();
    uniq = "?"+uniq.getTime();
    newImage = document.all.imgToLoad.src;
    index = newImage.indexOf("?", 0);
    if (index > 0)
    {
        newImage = newImage.substr(0, index);
    }
    document.all.imgToLoad.src = newImage+uniq;
}

function getUrl(url)
{
	uniq = new Date();
	uniq = "?"+uniq.getTime();
	var url=url
	var url2="imagemapcreator.asp"
	var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	xmlhttp.Open("GET", url, false);
	xmlhttp.Send(null);
	xmlhttp.Open("GET", url2+uniq, false);
	xmlhttp.Send(null);
	im1.outerHTML=xmlhttp.responseText;
	reloadImg()
}

function getImageMap()
{
	uniq = new Date();
	uniq = "?"+uniq.getTime();
	var url2="imagemapcreator.asp"
	var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	xmlhttp.Open("GET", url2+uniq, false);
	xmlhttp.Send(null);
	im1.outerHTML=xmlhttp.responseText;
}

function refreshMap()
{
	uniq = new Date();
	uniq = "?"+uniq.getTime();
	var url2="imagemapcreator.asp"
	var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	xmlhttp.Open("GET", url2+uniq, false);
	xmlhttp.Send(null);
	im1.outerHTML=xmlhttp.responseText;
	reloadImg()
}
function getRealLeft(id) {
var el = document.all ? document.all(id) :
document.getElementById ? document.getElementById(id) : null;
xPos = el.offsetLeft;
tempEl = el.offsetParent;
while (tempEl != null) {
xPos += tempEl.offsetLeft;
tempEl = tempEl.offsetParent;
}
//alert('left:'+xPos);
return xPos;
}

function getRealTop(id) {
var el = document.all ? document.all(id) :
document.getElementById ? document.getElementById(id) : null;
yPos = el.offsetTop;
tempEl = el.offsetParent;
while (tempEl != null) {
yPos += tempEl.offsetTop;
tempEl = tempEl.offsetParent;
}
//alert('top:'+yPos);
return yPos;
}

function initialMapHeight() {
return document.body.offsetHeight - 66 - 170; //assume for login
}

function initialMapWidth() {
return document.body.offsetWidth - 140 - 170; //assume for login
}

function mapHeight(id) {
return document.body.offsetHeight-getRealTop(id) - 170; //adjust for bottom area
}

function mapWidth(id) {
return document.body.offsetWidth-getRealLeft(id) - 170; //adjust for right area
}
