if(id == null)
	var id = "";
	
if(level == null)
	var level = "";

var section = "";
var inSection = false;
var i=0;
var title = new Array;
title[0]="upper";
title[1]="image";
title[2]="في القرآن الكريم";
title[3]="في السنة";
title[4]="في الشعر العربي";
title[5]="مقالات";
title[6]="منتخبات";
title[7]="ما كتب فيهم";
title[8]="مكتبة أهل البيت (عليهم السلام)";
title[9]="مراكز ومؤسسات ومزارات";
title[10]="محاضرات";
title[11]="الشهيد جعفر الطيار وشهداء موقعة مؤتة";
title[12]="أبو طالب مؤمن قريش";
title[13]="أم البنين عليها السلام";
title[14]="lower";
title[15]="image";
title[16]="upper";
title[17]="الرئيسية";
title[18]="lower";


var link = new Array;
link[0]="images/menu-upper_off.gif";
link[1]="images/menu-interactive.gif";
link[2]="ahlulbait/ahlulbait/fe-qr/1.htm";
link[3]="ahlulbait/ahlulbait/fe-snna/index.htm";
link[4]="ahlulbait/ahlulbait/fe-shaer/1.htm";
link[5]="ahlulbait/ahlulbait/mkalat/index.htm";
link[6]="ahlulbait/ahlulbait/mntkbat/1.htm";
link[7]="ahlulbait/ahlulbait/ma-ktb/1.htm";
link[8]="ahlulbait/maktabha_ahlalbaet.htm";
link[9]="ahlulbait/ahlulbait/mrakz/1.htm";
link[10]="ahlulbait/ahlulbait/mohadrat/index.htm";
link[11]="ahlulbait/jaafar-t/index.htm";
link[12]="ahlulbait/ahlulbait/abo_taleb/fehres.htm";
link[13]="14masom/03/fe-stor/5/02/fhres.htm";

link[14]="images/menu-lower_off.gif";
link[15]="images/spacer.gif' width='6' height='6'";
link[16]="images/menu-upper_off.gif";
link[17]="index.html";
link[18]="images/menu-lower_off.gif";

function UL(){
var upper,lower,page;
for (var i=0 ; i<title.length ; i++)
  	if (link[i] == id)
		page=i;
for (var i=0 ; i<page ; i++)
  	if (title[i] == "upper")
		upper=i;
for (var i=(title.length-1) ; i>page ; i--)
  	if (title[i] == "lower")
		lower=i;
link[upper]="images/menu-upper_on.gif";
link[lower]="images/menu-lower_on.gif";
}

/*function schedule(url)
{
	document.open(url,"","width=600; height=500; scrollbars=1; resizable=1" );
}*/

function bodyHtml(){
var html = "<table class='menu' width='110' cellspacing='0' cellpadding='0' valign='top'>";
for (var i=0; i<title.length; i++){
	html += "<tr>";
	if (( title[i] == "image")||(title[i] == "upper")||(title[i] == "lower")){
		html += "<td style='border-top-style: solid; border-top-width: 1' bordercolor='#095a5d'>";
		html += "<img src='"+link[i]+"'>";}
	else if (title[i+1] == "start"){
		html += "<td class='TDM' style='border-top-style: solid; border-top-width: 1' bordercolor='#095a5d'>";
		html += "<a id="+link[i+1]+"H class='TDM' HREF="+link[i]+"><img id="+link[i+1]+"I src='images/menu-expand.gif' border=0 align=absMiddle>  ";
		html += unescape(title[i]);
		html += "</a>";}
	else if (id == link[i]){
		if (level==3)
		{
			html += "<td class='TDML' style='border-top-style: solid; border-top-width: 1' bordercolor='#095a5d'>";
			html += "<a class='TDML'HREF='/"+link[i]+"'>";
			html += unescape(title[i]);
			html += "</a>";
		}
		else
		{
			html += "<td class='TDML' style='border-top-style: solid; border-top-width: 1' bordercolor='#095a5d'>";
			html += "<p class='TDML'>"
			html += unescape(title[i]);
			html += "</p>";
		}
	}
	else if (link[i]== ""){
		html += "<td class='TDM' style='border-top-style: solid; border-top-width: 1' bordercolor='#095a5d'>";
		html += "<a class='TDM' HREF=# onclick=\"javaScript:window.open('/"+link[i]+"','','width=432,height=450,scrollbars=yes')\">";
		html += unescape(title[i]);
		html += "</a>";}
	else if (link[i]=="")
		{
			html += "<td class='TDM' style='border-top-style: solid; border-top-width: 1' bordercolor='#095a5d'>";
			html += "<a class='TDM' HREF='"+link[i]+"'>";
			html += unescape(title[i]);
			html += "</a>";
		}
	else {
		html += "<td class='TDM' style='border-top-style: solid; border-top-width: 1' bordercolor='#095a5d'>";
		html += "<a class='TDM' HREF='/"+link[i]+"'>";
		html += unescape(title[i]);
		html += "</a>";}
		
	html += "</td>";
	html += "</tr>";
	if (title[i+1] == "start"){
		if (inSection == false)
		section = link[i+1];
		html += "<tr id="+link[i+1]+" class='hide'><td>";
		html += "<table border='0' width=100% cellspacing='0' cellpadding='0'>";
		i+=2;
		while (title[i] != "end"){
			html += "<tr>";
			if (id == link[i]){
				inSection = true;
				html += "<td class='TDSML' style='border-top-style: solid; border-top-width: 1' bordercolor='#095a5d'>";
				if (level==3)
				{
					html += "<a class='TDSML' HREF='/"+link[i]+"'>";
					html += unescape(title[i]);
					html += "</a>";
				}
				else
				{
					html += "<p class='TDSML'>";
					html += unescape(title[i]);
					html += "</p>";
				}
				
				html += "</td>";}
			else{
				html += "<td class='TDSM' style='border-top-style: solid; border-top-width: 1' bordercolor='#095a5d'>";
				html += "<a class='TDSM' HREF='/"+link[i]+"'>";
				html += unescape(title[i]);
				html += "</a>";
				html += "</td>";
			}
			html += "</tr>";
			i++;}
		html += "</table></td></tr>";
	}
}
html += "</table>";
return html;
}

function sections(sectionName)
{
	sectionHeader = sectionName+"H";
	sectionImage = sectionName+"I";
	if (document.all[sectionName].className == "show")
	{
		document.all[sectionName].className = "hide";
		document.all[sectionHeader].className = "TDM";
		document.all[sectionImage].src='images/menu-expand.gif'
	}
	else
	{
		document.all[sectionName].className = "show";
		document.all[sectionHeader].className = "TDML";
		document.all[sectionImage].src='images/menu-expand-open.gif'
	}
}

function MenuHTML()
{
	var html="";

	if (id != "home")
	{
//		UL();
		html += "<MAP name=Map1><AREA href='/index.htm' shape=\"rect\" coords=\"30, 0, 95, 121\"></map>";
		html += "<img src='images/logo-top-right.gif' usemap=\"#Map1\" border='0'>";
		html += "<MAP name=Map2><AREA href='/index.htm' shape=\"rect\" coords=\"20, 0, 102, 20\"></map>";
		html += "<img src='images/logo-bottom-right.gif' usemap=\"#Map2\" border='0'>";
	}
	else
	{
		html += "<img src='images/logo-top-right.gif'>";
		html += "<img src='images/logo-bottom-right.gif'>";
	}
	//if (id == 'home')
	html += bodyHtml();
	html += "<br><img src='images/spacer.gif' width='8' height='20'>";
	return html ;
}

function all()
{
	var menuStr = MenuHTML() ;

	if(eval(document.all.menuArea))
		document.all.menuArea.innerHTML = menuStr ;

	if (inSection == true)
		sections(section);
}

function CheckIE()
{
	var ie4=0;ie5=0;
	if (document.all) {
		var MS=navigator.appVersion.indexOf("MSIE");
		window.isIE4 =(MS>0) && ((parseInt(navigator.appVersion.substring(MS+5,MS+6)) <= 4) && (navigator.appVersion.indexOf("MSIE"))>0);
		window.isIE5 =(MS>0) && ((parseInt(navigator.appVersion.substring(MS+5,MS+6)) > 4) && (navigator.appVersion.indexOf("MSIE"))>0);
		if (window.isIE4)
			return false;
		else if (window.isIE5)
			return true;
	}
}






all();