//<script>

var menuArray = new Array();
var N4, N5, IE4, IE5;
var eventX;

function setGlobals(){
	N4=N5=IE4=IE5=false;
	if (document.getElementById){
		N5=true;
		IE5=true;
	}
	else if (document.all)
	{
		IE4=true;
	}
	else N4=true;

	if (N4) {var origWidth = window.innerWidth;var origHeight = window.innerHeight;window.onresize = reDo;}
}
function reDo() {if (window.innerWidth != origWidth || window.innerHeight != origHeight) location.reload();}

function menuObj(lay,nr){
	if(N4){
		this.lay = document.layers[lay];
		this.lay.parentNr = nr;
		this.lay.write = writeLay;
		this.lay.hide = hideLay;
		this.lay.show = showLay;
	}else{
		if(IE4)
			this.lay = document.all[lay];
		else
			this.lay = document.getElementById(lay);
		this.lay.parentNr = nr;
		this.lay.write = writeLayIE;
		this.lay.hide = hideLayIE;
		this.lay.show = showLayIE;
	}
	this.lay.onmouseover = menuLayOver;
	this.lay.onmouseout = menuLayOut;
}
function menuLayOver(){if(!N4) selVis("hidden");clipMenu(this.parentNr);hideAll();this.show();}
function menuLayOut(){this.hide();hideMarker();if(!N4) selVis("visible");}

function writeLay(txt){this.document.write(txt);this.document.close();}
function writeLayIE(txt){this.innerHTML = txt + '<div></div>';}
function hideLay(){this.visibility = "hide";}
function showLay(){this.visibility = "show";}
function hideLayIE(){this.style.visibility = "hidden";}
function showLayIE(){this.style.visibility = "visible";}

function selVis(vis){
	
}
function hideAll() {
	for(var i=0;i < menuArray.length;i++)
		menuArray[i].lay.hide();
}
function hideMenus(){hideAll();hideMarker();if(!N4) selVis("visible");}

function showMenu(e,nr){
	if(menuArray.length>0){ 
		if(!N4) selVis("hidden");
		clipMenu(nr);
		hideAll();
		menuArray[nr].lay.show();
		eventX=IE4? event.clientX : N4 ? e.x : e.clientX;
		menuArray[nr].lay.style.left = eventX+"px";
	}
}

function drawMenu(){
	setGlobals();
	var url = "http://hopeforaceh.worldharvest.cc";
	var menuTxt = [	
					[["WH&nbsp;Profile", url+"/wh-profile.php"],["Accomplishment&nbsp;2004", url+"/accomplishment.php"],["Core&nbsp;Value", url+"/corevalue.php"],["Senior&nbsp;Leadership", url+"/leader.php"],["References", url+"/reference.php"]],
					[["Tsunami&nbsp;Disaster&nbsp;Effects", url+"/aceh-disaster.php"],["Aceh&nbsp;Profile", url+"/aceh-profile.php"]],
					[["Tsunami&nbsp;Relief&nbsp;Overview", url+"/prg-overview.php"],["Long&nbsp;Term&nbsp;Planning", url+"/prg-longterm.php"],["CTC&nbsp;Objectives", url+"/ctc-objectives.php"],["CTC&nbsp;Activity", url+"/ctc-activity.php"],["CTC&nbsp;Impacts", url+"/ctc-impacts.php"],["CTC&nbsp;Budget", url+"/ctc-budget.php"]],
					[["Concert&nbsp;Info",url+"/events.php"],["Ford&nbsp;Amphitheatre","http://www.fordamphitheater.org/en/home/index.asp","target=_blank"],["Directions","http://www.fordamphitheater.org/en/info/directions.asp","target=_blank"],["Sidney&nbsp;Mohede",url+"/sidney-mohede.php"],["Harvest&nbsp;Praise&nbsp;Ministry",url+"/hpm.php"],["Frontline",url+"/frontline.php"],["FourWall",url+"/fourwall.php"]]
				];
	for(var i=0;i<menuTxt.length;i++){
		menuArray[i] = new menuObj('drop_down'+i,i);
		var mTxt = "";
		for(var n=0;n<menuTxt[i].length;n++){
			target = "";
			if(menuTxt[i][n][2]) { target = menuTxt[i][n][2]; }
			if(document.getElementById)
				mTxt += '<tr><td align=left height="15" width="107" bgcolor="#194582" onmouseover="lOver(this)" onmouseout="lOut(this)" ';
			else
				mTxt += '<tr><td align=left height="15" width="107" bgcolor="#194582" ';
			if(!N4) 
				mTxt += 'style="cursor:hand"';
			if (IE4){
				mTxt += 'onclick="goLink(\''+ menuTxt[i][n][1] +'\','+target+');return false"><span class="drop_down_text"><A href="'+menuTxt[i][n][1]+'" '+target+'><img src="blank.gif" width="7" border="0">'+menuTxt[i][n][0]+'<img src="blank.gif" width="7" border="0"></A></span></td></tr>';
			}
			else
				mTxt += 'onclick="goLink(\''+ menuTxt[i][n][1] +'\','+target+');return false"><span class="drop_down_text"><A href="'+menuTxt[i][n][1]+'" '+target+'>&nbsp;&nbsp;'+menuTxt[i][n][0]+'</A>&nbsp;&nbsp;</span></td></tr>';
		}
//		alert(mTxt);
		menuArray[i].lay.write('<table class="drop_down_table" cellspacing=0 border=0 width="107">'+mTxt+'</table>');
	}
}
function lOver(obj){
	if(!N4){ 
		obj.style.backgroundColor = "#B7CB36";
		if(obj.children)
			obj.children[0].children[0].style.color = "#FFFFFF";
	}
}
function lOut(obj){
	if(!N4){
		obj.style.backgroundColor = "#194582";
		if(obj.children)
			obj.children[0].children[0].style.color = "#FFFFFF";
	}
}

var menuclipArea = [[0,63],[62,116],[115,185],[184,270],[269,338],[337,409],[408,468]];

function clipMenu(indx){
	if(indx < menuclipArea.length){
		if(N4)
			var mLay = document.layers['guide'];
		else if(IE4)
			var mLay = document.all['guide'];
		else
			var mLay = document.getElementById('guide');
		mLay.setClip = N4?setClip:setClipIE;
		mLay.show = N4?showLay:showLayIE;
		mLay.setClip(menuclipArea[indx][0], 0, menuclipArea[indx][1], 20);
		mLay.show();
	}
}
function hideMarker(){
	if(N4)
		var mLay = document.layers['guide'];
	else if(IE4)
		var mLay = document.all['guide'];
	else
		var mLay = document.getElementById('guide');
	mLay.hide = N4?hideLay:hideLayIE;
	mLay.hide();
}
function setClip(x, y, x2, y2){
	this.clip.left = x;
	this.clip.top = y;
	this.clip.right = x2;
	this.clip.bottom = y2;
}
function setClipIE(x, y, x2, y2){
	this.style.clip = "rect("+y+" "+x2+" "+y2+" "+x+")";
}

function goLink(linkStr,target){
	if(target.length>0) { top.location.href = linkStr; }
	else { window.location = linkStr; }
}
function resetForm(lay, formName){
	if(document.layers)
		document.layers[lay].document.forms[formName].reset();
	else if(document.getElementById)
		document.getElementById(formName).reset();
	else
		document.forms[formName].reset();
}



var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}

