// JavaScript Document
function getAnchorPosition(anchorname) {
	// This function will return an Object with x and y properties
	var useWindow=false;
	var coordinates=new Object();
	var x=0,y=0;
	// Browser capability sniffing
	var use_gebi=false, use_css=false, use_layers=false;
	if (document.getElementById) { use_gebi=true; }
	else if (document.all) { use_css=true; }
	else if (document.layers) { use_layers=true; }
	// Logic to find position
 	if (use_gebi && document.all) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_gebi) {
		var o=document.getElementById(anchorname);
		x=AnchorPosition_getPageOffsetLeft(o);
		y=AnchorPosition_getPageOffsetTop(o);
		}
 	else if (use_css) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_layers) {
		var found=0;
		for (var i=0; i<document.anchors.length; i++) {
			if (document.anchors[i].name==anchorname) { found=1; break; }
			}
		if (found==0) {
			coordinates.x=0; coordinates.y=0; return coordinates;
			}
		x=document.anchors[i].x;
		y=document.anchors[i].y;
		}
	else {
		coordinates.x=0; coordinates.y=0; return coordinates;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}
// Functions for IE to get position of an object
function AnchorPosition_getPageOffsetLeft (el) {
	var ol=el.offsetLeft;
	while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
	return ol;
	}
function AnchorPosition_getWindowOffsetLeft (el) {
	return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;
	}	
function AnchorPosition_getPageOffsetTop (el) {
	var ot=el.offsetTop;
	while((el=el.offsetParent) != null) { ot += el.offsetTop; }
	return ot;
	}
function AnchorPosition_getWindowOffsetTop (el) {
	return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;
	}

var isNS = navigator.appName.indexOf("Netscape")  != -1
var isIE = navigator.appName.indexOf("Microsoft") != -1
var smalldiv = 0;

function show(whichdiv) {
  	//if (isNS) document.layers[whichdiv].visibility = "show";
  	//if (isIE) 
	//document.all[whichdiv].style.visibility = "visible";
	
	var obj = getAnchorPosition('thoption');
	//document.getElementById(whichdiv).setAttribute('style',"visibility:visible; position:absolute; top:"+obj.x+"; left:"+(obj.y + 15));
	if(isIE){
		document.getElementById(whichdiv).style.posLeft = obj.x;
		document.getElementById(whichdiv).style.posTop = obj.y +15;
	}
	else {
		document.getElementById(whichdiv).style.left = obj.x;
		document.getElementById(whichdiv).style.top = obj.y +15;
		
	} 
	document.getElementById(whichdiv).style.visibility = "visible";
}

function hide(whichdiv) {
	//if (isNS) document.layers[whichdiv].visibility = "hide";
 	//if (isIE) 
	//document.all[whichdiv].style.visibility = "hidden";	
	document.getElementById(whichdiv).style.visibility = "hidden";
}
function bgcoloron(cell) {
cell.style.backgroundColor='#0033FF';
cell.className="navmenu";
}
function bgcoloroff(cell) {
cell.style.backgroundColor='#FFFFFF'
cell.className="";
}
document.write('<div id="buildings" title="buildings" style="visibility:hidden; position:absolute; top:0; left:0" onMouseOver="show(this.id); " onMouseOut="hide(this.id);">');
document.write('<table bgcolor="#CCCCCC" class="dropdownTableCell">');
document.write('	<tr> ');
document.write('      <td bordercolor="#000000"><p><font color="#000000">Small Buildings:</font><br>');
document.write('          &nbsp;&nbsp;&nbsp;&nbsp;<a class="LinkNav" href="storages.php?type=1">Barns</a><br>');
document.write('          &nbsp;&nbsp;&nbsp;&nbsp;<a class="LinkNav" href="storages.php?type=2">Chalets</a><br>');
document.write('          &nbsp;&nbsp;&nbsp;&nbsp;<a class="LinkNav" href="storages.php?type=3">Gables</a><br>');
document.write('          &nbsp;&nbsp;&nbsp;&nbsp;<a class="LinkNav" href="storages.php?type=4">Classics</a><br>');
document.write('          &nbsp;&nbsp;&nbsp;&nbsp;<a align="left" href="smallbuildings.html" class="LinkNav">All Small</a><br>');
document.write('		  <font color="#000000">Large Buildings:</font><br>');
document.write('          &nbsp;&nbsp;&nbsp;&nbsp;<a class="LinkNav" href="garages.html">Garages</a><br>');
document.write('          &nbsp;&nbsp;&nbsp;&nbsp;<a class="LinkNav" href="garages.html">Houses</a><br>');
document.write('		  &nbsp;&nbsp;&nbsp;&nbsp;<a align="left" href="garages.html" class="LinkNav">All Large</a><br>');
document.write('        </p></td>');
document.write('    </tr>');
document.write('</table>');
document.write('</div>');