// JavaScript Document
function get(eid)
{
	var d = document;
	var r = d.getElementById(eid);
	return r;
}

function popImg(open, iref)
{
	if (open)
	{
		// top for popup image 10 pixels
		// below corresponding thumb
		var top = (10 +
		iref.offsetHeight +
		iref.offsetTop) +
		'px';
		// left for popup image is aligned
		// with left of thumbnail
		var left = iref.offsetLeft + 'px';
		// use same source file for popup
		// as thumbnail
		var img = '<img src="' +
		iref.src + '" border="2"/>';
		var d = document;
		// if popup hasn't yet been added,
		// create and append to body
		if (null == get('popImg')) 
		{
			var pop = d.createElement('DIV');
			pop.id = 'popImg';
			pop.style.position = 'absolute';
			d.body.appendChild(pop);
		}
		// get reference to popup image
		// container div
		var pop = get('popImg');
		// set image element into div
		pop.innerHTML = img;
		// position relative to thumbnail
		pop.style.top = top;
		pop.style.left = left;
		// show the div and its image
		pop.style.display = 'block';
	}
	else 
	{
		// since request was for close,
		// (open==false), hide the div -
		// don't destroy it, since it can
		// be recycled cheaper
		var pop = get('popImg');
		pop.style.display = 'none';
	}
}


// funciton to display the floor plan window
function wopen(url, name, w, h)
{
	w += 32;
	h += 96;
	 var win = window.open(url,
	  name,
	  'width=' + w + ', height=' + h + ', ' +
	  'location=no, menubar=no, ' +
	  'status=no, toolbar=no, scrollbars=yes, resizable=yes');
	win.resizeTo(w, h);
	win.focus();
}

