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]="start";
title[4]="التفسير وعلوم القرآن";
title[5]="السياسة والدولة";
title[6]="الادعية";
title[7]="التاريخ";
title[8]="اصول الفقه";
title[9]="الكلام والفلسفة والمنطق";
title[10]="علوم اللغة والأدب";
title[11]="end";
title[12]="الامام الراحل";
title[13]="start";
title[14]="التفسير وعلوم القرآن";
title[15]="الحديث الشريف";
title[16]="الادعية";
title[17]="التاريخ";
title[18]="المذكرات";
title[19]="العقائد الاسلامية";
title[20]="الثقافة الاسلامية";
title[21]="اصول الفقه";
title[22]="الفقه والأحكام";
title[23]="الأخلاق والسلوك";
title[24]="الحوزات العلمية";
title[25]="الأديان";
title[26]="الإدارة";
title[27]="الكلام والفلسفة";
title[28]="الحقوق والقانون";
title[29]="السياسة والدولة";
title[30]="الإقتصاد";
title[31]="الإجتماع";
title[32]="علوم اللغة والأدب";
title[33]="العلوم الاخرى";
title[34]="الفهرس العام";
title[35]="end";
title[36]="الشهيد الشيرازي";
title[37]="start";
title[38]="موسوعة الكلمة";
title[39]="اللغة والادب والشعر";
title[40]="التفسير وعلوم القرآن";
title[41]="الثقافة الاسلامية";
title[42]="end";
title[43]="upper";
title[44]="image";
title[45]="السيد مجتبى الشيرازي";
title[46]="السيد رضا الشيرازي";
title[47]="السيد مرتضى الشيرازي";
title[48]="السيد جعفر الشيرازي";
title[49]="lower";
title[50]="image";
title[51]="upper";
title[52]="الصفحة الرئيسية";
title[53]="الإستفتاءات";
title[54]="المكتبة الصوتية";
title[55]="السيرة الذاتية";
title[56]="رؤى وافكار";
title[57]="مجلة الكلمة الطيبة";
title[58]="ارتباطات";
title[59]="المكتبة المصورة";
title[60]="شبكة المستقبل";
title[61]="lower";
title[62]="image";
title[63]="upper";
title[64]="image";
title[65]="احداث واخبار";
title[66]="حول العالم";
title[67]="صحافة";
title[68]="اصدارات عالمية";
title[69]="lower";
title[70]="image";
title[71]="upper";
title[72]="image";
title[73]="البريد الألكتروني";
title[74]="الإشتراك";
title[75]="ادعو صديقك";
title[76]="ارسل بطاقة";
title[77]="بحث";
title[78]="سجل الزوار";
title[79]="لوحة المفاتيح العربية";
title[80]="Read Arabic";
title[81]="lower";
title[82]="image";
title[83]="upper";
title[84]="image";
title[85]="فارسى";
title[86]="English";
title[87]="أردو";
title[88]="lower";

var link = new Array;
link[0]="images/menu-upper_off.gif";
link[1]="images/titel_abwab.gif";
link[2]="javascript:sections('comp_sadikshirazi')";
link[3]="comp_sadikshirazi";
link[4]="compilations/s_shirazi/teatqs/teatqs.htm";
link[5]="compilations/s_shirazi/patg/patg.htm";
link[6]="compilations/s_shirazi/invocations/invocations.htm";
link[7]="compilations/s_shirazi/history/history.htm";
link[8]="compilations/s_shirazi/poj/poj.htm";
link[9]="compilations/s_shirazi/kf/kf.htm";
link[10]="compilations/s_shirazi/lals/lals.htm";
link[11]="";
link[12]="javascript:sections('comp_imamshirazi')";
link[13]="comp_imamshirazi";
link[14]="compilations/teatqs/teatqs.htm";
link[15]="compilations/alhadith/alhadith.htm";
link[16]="compilations/invocations/invocations.htm";
link[17]="compilations/history/history.htm";
link[18]="compilations/memoranda/memoranda.htm";
link[19]="compilations/tii/tii.htm";
link[20]="compilations/islamiceducation/islamiceducation.htm";
link[21]="compilations/poj/poj.htm";
link[22]="compilations/jar/jar.htm";
link[23]="compilations/bam/bam.htm";
link[24]="compilations/isi/isi.htm";
link[25]="compilations/nirai/nirai.htm";
link[26]="compilations/administration/administration.htm";
link[27]="compilations/kf/kf.htm";
link[28]="compilations/hk/hk.htm";
link[29]="compilations/patg/patg.htm";
link[30]="compilations/economics/economics.htm";
link[31]="compilations/sociology/sociology.htm";
link[32]="compilations/lals/lals.htm";
link[33]="compilations/tos/tos.htm";
link[34]="compilations/all.htm";
link[35]="";
link[36]="javascript:sections('comp_shahidshirazi')";
link[37]="comp_shahidshirazi";
link[38]="compilations/library/h_shirazi/mk/mk.htm";
link[39]="compilations/library/h_shirazi/lalsp/lalsp.htm";
link[40]="compilations/library/h_shirazi/teatqs/teatqs.htm";
link[41]="compilations/library/h_shirazi/islamiceducation/islamiceducation.htm";
link[42]="";
link[43]="images/menu-lower_off.gif";
link[44]="images/menu-upper_off.gif";
link[45]="compilations/library/mj_shirazi/mj_shirazi.htm";
link[46]="compilations/library/r_shirazi/r_shirazi.htm";
link[47]="compilations/library/mr_shirazi/mr_shirazi.htm";
link[48]="compilations/library/j_shirazi/j_shirazi.htm";
link[49]="images/menu-lower_off.gif";
link[50]="images/spacer.gif' width='6' height='6";
link[51]="images/menu-upper_off.gif";
link[52]="index.htm";
link[53]="rflo/rflo.htm";
link[54]="lectures/lectures.htm";
link[55]="autobiography/autobiography.htm";
link[56]="roaa/roaa.htm";
link[57]="kalemaeh/kalemaeh.htm";
link[58]="links/links.htm";
link[59]="album/album.htm";
link[60]="/almostaqbal.com";
link[61]="images/menu-lower_off.gif";
link[62]="images/spacer.gif' width='6' height='6";
link[63]="images/menu-upper_off.gif";
link[64]="images/titel_ubb.gif";
link[65]="news/news.htm";
link[66]="world/news.htm";
link[67]="world/article.htm";
link[68]="world/book.htm";
link[69]="images/menu-lower_off.gif";
link[70]="images/spacer.gif' width='6' height='6";
link[71]="images/menu-upper_off.gif";
link[72]="images/titel_khadamat.gif";
link[73]="service/connection/connection.htm";
link[74]="service/maillist.htm";
link[75]="cgi-bin/birdcast/birdcast.cgi";
link[76]="service/postcards/cardcenter.html";
link[77]="service/g_serch.htm";
link[78]="cgi-bin/ugbcgi/ugb.cgi";
link[79]="service/Arabic Keyboard.htm";
link[80]="service/How to read Arabic.htm";
link[81]="images/menu-lower_off.gif";
link[82]="images/spacer.gif' width='6' height='6";
link[83]="images/menu-upper_off.gif";
link[84]="images/titel_language.gif";
link[85]="/alshirazi.org";
link[86]="/www.shirazi.org.uk";
link[87]="/www.almizan.com.pk";
link[88]="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='#003D73'>";
		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='#0035D5'>";
		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='#0035D5'>";
			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='#0035D5'>";
			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='#0035D5'>";
		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='#0035D5'>";
			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='#0035D5'>";
		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='#0035D5'>";
				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='#0035D5'>";
				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=\"0, 0, 0, 0\"></map>";
                html += "<img src='images/logo_02.jpg' usemap=\"#Map2\" border='0'>";
                html += "<img src='images/logo_01.jpg' usemap=\"#Map1\" border='0'>";
                html += "<img src='images/logo_04.jpg' usemap=\"#Map3\" border='0'>";
                html += "<img src='images/logo_03.jpg' usemap=\"#Map4\" border='0'>";
	}
        else
	{
		
	}
	//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();
