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]="end";
title[6]=" ";
title[7]="start";
title[8]="      ";
title[9]="    ";
title[10]="   ";
title[11]="    ";
title[12]="   ";
title[13]="    ";
title[14]="         ";
title[15]="    ";
title[16]="   ";
title[17]="         ";
title[18]="  ";
title[19]="  ";
title[20]="     ";
title[21]="      ";
title[22]="end";
title[23]="    ";
title[24]=" ";
title[25]=" ܘ    ";
title[26]="   ";
title[27]="    ";
title[28]="  ";
title[29]=" ";
title[30]="   ";
title[31]="    ";
title[32]="  ";
title[33]="  ";
title[34]="lower";
title[35]="image";
title[36]="upper";
title[37]="image";
title[38]="   ܐ";
title[39]="       ";
title[40]="    ";
title[41]="   ";
title[42]="   ";
title[43]="  ";
title[44]="     ";
title[45]="   ܐ";
title[46]="  ";
title[47]="How to Read Farsi";
title[48]="lower";
title[49]="image";
title[50]="upper";
title[51]="image";
title[52]=" ";
title[53]="English";
title[54]="   ";
title[55]="lower";

var link = new Array;
link[0]="images/menu-upper_off.gif";
link[1]="images/titel_abwab.jpg";
link[2]="javascript:sections('s-shirazi')";
link[3]="s-shirazi";
link[4]="compilations/jar/jar.htm";
link[5]="";
link[6]="javascript:sections('compilations')";
link[7]="compilations";
link[8]="compilations/teatqs/teatqs.htm";
link[9]="compilations/patg/patg.htm";
link[10]="compilations/memoranda/memoranda.htm";
link[11]="compilations/tii/tii.htm";
link[12]="compilations/islamiceducation/islamiceducation.htm";
link[13]="compilations/jar/jar.htm";
link[14]="compilations/bam/bam.htm";
link[15]="compilations/isi/isi.htm";
link[16]="compilations/nirai/nirai.htm";
link[17]="compilations/administration/administration.htm";
link[18]="compilations/history/history.htm";
link[19]="compilations/economics/economics.htm";
link[20]="compilations/sociology/sociology.htm";
link[21]="compilations/lals/lals.htm";
link[22]="";
link[23]="index.html";
link[24]="rflo/rflo.php";
link[25]="lectures/lectures.php";
link[26]="autobiography/autobiography.php";
link[27]="roaa/roaa.php";
link[28]="news/news.php";
link[29]="monasabat/monasabat.php";
link[30]="links/links.php";
link[31]="album/album.php";
link[32]="ertehal/ertehal.php";
link[33]="publish/publish.php";
link[34]="images/menu-lower_off.gif";
link[35]="images/spacer.gif' width='6' height='6";
link[36]="images/menu-upper_off.gif";
link[37]="images/titel_khadamat.jpg";
link[38]="service/computer/computer.htm";
link[39]="service/connection/connection.php";
link[40]="service/maillist.php";
link[41]="";
link[42]="";
link[43]="service/search.php";
link[44]="cgi-bin/ugbcgi/ugb.cgi";
link[45]="service/web_help.htm";
link[46]="service/farsikeyboard.htm";
link[47]="service/how_to_read_farsi.htm";
link[48]="images/menu-lower_off.gif";
link[49]="images/spacer.gif' width='6' height='6";
link[50]="images/menu-upper_off.gif";
link[51]="images/titel_language.jpg";
link[52]="/www.alshirazi.com";
link[53]="/www.shirazi.org.uk";
link[54]="/www.almizan.com.pk";
link[55]="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/logo2.jpg' usemap=\"#Map2\" border='0'>";
                html += "<img src='images/logo1.jpg' usemap=\"#Map1\" border='0'>";
                html += "<img src='images/logo4.jpg' usemap=\"#Map3\" border='0'>";
                html += "<img src='images/logo3.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();
