
if (!document.getElementById)
    document.getElementById = function() { return null; }

var ar1=new Array('ActSelfAccountsMenu','ActDoctorSoftwareMenu','ActInternetMenu','ActIslamicMenu','ActGlobalSpellCheckerMenu','ActGoogleTranslatorMenu','ActChildrenMenu','ActInfoSeriesMenu');
var ar2=new Array('ActQuranReciterMenu','ActMobileReciterMenu','ActDivineQuotesMenu','ActListMemoriserMenu');


//'var ar3=new Array('ActQuickLoginMenu','ActNetExpenseMenu');

//,'ActListMemoriserMenu' ActInternetMenu

function initializeMenu(menuId, actuatorId, blnclosed) {
    var menu = document.getElementById(menuId);
    var actuator = document.getElementById(actuatorId);

	//for(i = 0; i < document.all.length; i++){
	//   if (document.all(i).tagName=="TABLE") {	
	//	if (document.all(i).width==596) {
	//		document.all(i).style.display = 'none' ;
	//	}
        //   }
	//}


    if (menu == null || actuator == null)  return;
    	
    //if (window.opera) return; // I'm too tired


    if (blnclosed=="1") 
	{actuator.parentNode.style.backgroundImage = "url(http://www.shaplus.com/plus.gif)";
	menu.style.display = "none";
	}
    else
	{actuator.parentNode.style.backgroundImage = "url(http://www.shaplus.com/minus.gif)";
	menu.style.display = "block";
	}

    actuator.onclick = function() {
        var display = menu.style.display;
        this.parentNode.style.backgroundImage =
            (display == "block") ? "url(http://www.shaplus.com/plus.gif)" : "url(http://www.shaplus.com/minus.gif)";
        menu.style.display = (display == "block") ? "none" : "block"; 
    	  CloseSameLevelMenus(menu.id,ar1);
	      CloseSameLevelMenus(menu.id,ar2);
	 
	  return false;
    }

}



  function CloseMenu(menuid){
	var othermenu;
	othermenu = document.getElementById(menuid);
	othermenu.style.display= "none";
	othermenu.parentNode.style.backgroundImage ="url(http://www.shaplus.com/plus.gif)";

   }

   function CloseSameLevelMenus(menuid,arArray)
	{
	 //check if the menu is in each level array
	var i;
	var j;
	for (i=0; i<arArray.length ; i++)
		{
			if (arArray[i]==menuid) 
				{
					for(j=0;j<arArray.length;j++)
					{
						if (arArray[j]!=menuid) {
						CloseMenu(arArray[j]);}
					}
			 	}
		}

	 }


