
function dropdownPrep() {

var browser=navigator.userAgent;

	if (browser.indexOf("Safari")>0) {
		document.getElementById('dropdown_organization').style.top =  findPosY(document.getElementById('topnav_cell1')) + 21 + "px";
		document.getElementById('dropdown_clubhouses').style.top =  findPosY(document.getElementById('topnav_cell2')) + 21 + "px";
		document.getElementById('dropdown_donation').style.top =  findPosY(document.getElementById('topnav_cell4')) + 21 + "px";
//		document.getElementById('dropdown_programs').style.top =  findPosY(document.getElementById('topnav_cell3')) + 21 + "px";
	} else {
		document.getElementById('dropdown_organization').style.top =  findPosY(document.getElementById('topnav_cell1')) + 27 + "px";
		document.getElementById('dropdown_clubhouses').style.top =  findPosY(document.getElementById('topnav_cell2')) + 27 + "px";
		document.getElementById('dropdown_donation').style.top =  findPosY(document.getElementById('topnav_cell4')) + 27 + "px";
//		document.getElementById('dropdown_programs').style.top =  findPosY(document.getElementById('topnav_cell3')) + 27 + "px";
	}

}

//aDropDowns=new Array("dropdown_organization","dropdown_clubhouses","dropdown_programs", "dropdown_donation","dropdown_news");
aDropDowns=new Array("dropdown_organization","dropdown_clubhouses","dropdown_donation","dropdown_news");

function showDiv(sDivName) {
	if (sDivName!='') {
		for (i=0; i<aDropDowns.length; i++) {
			if (sDivName==aDropDowns[i]) {
				document.getElementById(aDropDowns[i]).style.display="block";	
				document.getElementById('off_top').style.display="block";
				document.getElementById('off_left').style.display="block";
				document.getElementById('off_right').style.display="block";
				document.getElementById('off_bottom').style.display="block";
				
			} else {
				document.getElementById(aDropDowns[i]).style.display="none";	
}
		}
	} else {
		for (i=0; i<aDropDowns.length; i++) {
			document.getElementById(aDropDowns[i]).style.display="none";	
			document.getElementById('off_top').style.display="none";
			document.getElementById('off_left').style.display="none";
			document.getElementById('off_right').style.display="none";
			document.getElementById('off_bottom').style.display="none";
			
		}
	}
}

function findPosX(obj) {
var curleft = 0;
if(obj.offsetParent)
	while(1)
	{
	  curleft += obj.offsetLeft;
	  if(!obj.offsetParent)
		break;
	  obj = obj.offsetParent;
	}
else if(obj.x)
	curleft += obj.x;
return curleft;
}

function findPosY(obj) {
var curtop = 0;
if(obj.offsetParent)
	while(1)
	{
	  curtop += obj.offsetTop;
	  if(!obj.offsetParent)
		break;
	  obj = obj.offsetParent;
	}
else if(obj.x)
	curtop += obj.x;
return curtop;
}
