var debugMode=true;
var menu=new Array();
//main
menu[menu.length]='Chabad in Africa';
menu[menu.length]='Jewish Resources';
menu[menu.length]='Adult Education';
menu[menu.length]='Children Education';
menu[menu.length]='Photo Gallery';
menu[menu.length]='Travel Advisory';

//chabad in africa
menu[0]=new Array(
				  {title:'About Us', 						link:'/695540'},
				  {title:'Testimonial', 					link:'/695859'}
				  );

//Jewish Resources
menu[1]=new Array(
				  {title:'Weekly services', 				link:'/695860'}, 
				  {title:'Shabbat timetable', 				link:'/695861'},
				  {title:'The Jewish Women', 				link:'/TheJewishWoman/default.asp'},
				  {title:'Holidays', 						link:'/holidays/default.asp'},
				  {title:'The Rebbe', 						link:'/695862'}
				  )

//Adult Education
menu[2]=new Array(
				  {title:'Adult Classes', 					link:'/695889'}, 
				  {title:'Daily study', 					link:'/dailystudy'}, 
				  {title:'Magazine', 						link:'/magazine'}, 
				  {title:'Weekly Publications', 			link:'/695890'}
				  )

//Children Education
menu[3]=new Array(
				  {title:'Kids Classes', 					link:'/695891'}, 
				  {title:'KidsZone Chabad.org', 			link:'/kids/itchekadoozy/default.asp'}, 
				  {title:'Bar Mitsva lessons', 				link:'/695892'}, 
				  {title:'Bar Mitsva Experience', 			link:'/695893'}
				  )

//Photo Gallery
menu[4]=new Array(
				  {title:'All Galleries',					link:'/695894'}
				  )

//Travel Advisory
menu[5]=new Array(
				  {title:'Kosher in Africa',				link:'/695895'},
				  {title:'Hotel Accommodation',				link:'javascript:alert(\'Coming soon!\');'},
				  {title:'Traveling to RDC',				link:'/695896'},
				  {title:'Chabad centers',					link:'/centers/default.asp?AID=6268'}
				  )

//ne pas toucher
function showMenu(menuID, imgObj) {
	var menuHTML='<table border="0" cellspacing="0" cellpadding="0" width="152" onmouseover="stayMenu();" onmouseout="hideMenu();"><tr><td background="/images/templates/jewish_africa/fond_menu_bg.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="1%"><img src="/images/templates/jewish_africa/spacer.gif" width="17" height="1" /></td><td width="99%" align="center">'
	menuHTML+='<table cellpadding=0 cellspacing=0 border=0 width=100%><tr><td height="10"></td></tr>';
	
	for(var i=0; i<menu[menuID].length; i++){
		menuHTML+='<tr><td align="left"><a class="menulnk" '+(menu[menuID][i].target?'target="'+menu[menuID][i].target+'"':'')+' href="'+menu[menuID][i].link+'">'+menu[menuID][i].title+'</a></td></tr>'
		if(i+1<menu[menuID].length){menuHTML+='<tr><td height="10"></td></tr>'};
		};
	
	menuHTML+='</table>'
	menuHTML+='</td><td width="1%"><img src="/images/templates/jewish_africa/spacer.gif" width="17" height="1" /></td></tr></table></td></tr><tr><td><img src="/images/templates/jewish_africa/fond_menu_bottom.gif" width="152" height="16" /></td></tr></table>';
		
	if(!document.getElementById('menu_tbl')){
		var newDiv=document.createElement('div');
		newDiv.style.position='absolute';
		newDiv.id='menu_tbl';
		document.body.appendChild(newDiv);
		}
		
	var menuTbl=obj('menu_tbl');
	menuTbl.innerHTML=menuHTML;
	menuTbl.style.top=getOffset(imgObj, 'offsetTop')+(32)+'px';
	menuTbl.style.left=getOffset(imgObj, 'offsetLeft')+(menuID==0 ? 4 : (menuID==5 ? 3 : 2))+'px';
	menuTbl.style.display='';
	stayMenu();
	}
	
var fwHideMenuTimer; 
function debug(msg){if(debugMode){alert(msg)}}
function hideMenu(menuID, obj) {
	FW_startTimeout('fwDoHide()');
	}
function stayMenu(){
	document.getElementById('menu_tbl').style.display=''; if (fwHideMenuTimer){clearTimeout(fwHideMenuTimer); fwHideMenuTimer = null; fwDHFlag = false};
	}
function FW_startTimeout(execS){fwStart = new Date(); fwDHFlag = true; fwHideMenuTimer = setTimeout(execS, 500);}
function fwDoHide(){
	if (!fwDHFlag) return;
	var elapsed = new Date() - fwStart;
	if (elapsed < 500) {fwHideMenuTimer = setTimeout("fwDoHide()", 600-elapsed);return;};
	fwDHFlag = false;
	document.getElementById('menu_tbl').style.display='none';
	}		
function writeFooter() {
	document.write('<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"><tr><td align="center" valign="middle"><span class="bottom"><a href="Contact.html" class="bottom">Contact</a> | <a href="Links.html" class="bottom">Links to Jewish Sites</a> | <a href="http://www.jewishafrica.com/calendar/default.asp?AID=6224" target="_blank" class="bottom">Jewish Calendar</a> | <a href="http://www.jewishafrica.org" target="_blank" class="bottom">jewishafrica.org</a></span><br /><span class="bottom"><strong>Chabad Lubavitch of Central Africa</strong> <span style="font-family:tahoma;">&#8226;</span> 251 Avenue Lukusa <span style="font-family:tahoma;">&#8226;</span> Kinshasa &#8226; Democratic Republic of the Congo <span style="font-family:tahoma;">&#8226;</span> 243-81-811-2737 </span></td></tr></table>');
	}
var httpResponse='';
function sendPage(pg, frmVals) {
	try{
		var http=document.all ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
		if(!frmVals||document.all) {http.open("GET", pg+(!frmVals?'':'&'+frmVals), false); http.send(null);}
		else {
			http.open("POST", pg, false);
			http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;");
			http.send(frmVals);
			}
		if (http.status == 200) {httpResponse=http.responseText; return true;}
			else{
				var regexp = /<li>Error Type:<br>\r\n(.*)<br>\r\n<\/li>/;
				var match = regexp.exec(http.responseText);
				if (match != null) {
					//alert( 'Error:\n\n'+ (match[1].replace(/<br?\/?>/g, '\n').replace(/<?\/b?\/?>/g, '')) )
					}
					else{
					//alert('Error in page!')
					}
				return false;
				}
		}
	catch(e){return false;}
	}
