var ToolBar_Supported = false;
var Frame_Supported   = false;
var URLNum = 0;

window.moveTo(0,0)
window.resizeTo(screen.Width,screen.Height)


if (navigator.userAgent.indexOf("MSIE")    != -1 && 
	navigator.userAgent.indexOf("Windows") != -1 && 
	navigator.appVersion.substring(0,1) > 3)
{
	ToolBar_Supported = true;
}



    
if (ToolBar_Supported)
{
	
	var newLineChar = String.fromCharCode(10);
	var char34 = String.fromCharCode(34);
	var LastMSMenu = "";
	var CurICPMenu = "";
	var IsMSMenu = false;
	var IsMenuDropDown = true;
	var HTMLStr;
	var x = 0;
	var y = 0;
	var x2 = 0;
	var y2 = 0;
	var MSMenuWidth;
	var ToolbarMenu;
	var ToolbarBGColor;
	var ToolbarLoaded = false;
	var aDefMSColor  = new Array(3);
	var aDefICPColor = new Array(3);
	var aCurMSColor  = new Array(3);
	var aCurICPColor = new Array(3);
	var MSFont;
	var ICPFont;
	var MaxMenu = 30;
	var TotalMenu = 0;
	var arrMenuInfo = new Array(MaxMenu);
        var arrURL      = new Array(MaxMenu);
        var URLNum ;
        var MenuHeight=0;
        var MenuItems=0;

	
	// Output style sheet and toolbar ID
	document.write("<SPAN ID='StartMenu' STYLE='display:none;'></SPAN>");

	// Build toolbar template
	HTMLStr ="<DIV ID='idToolbar'     STYLE='background-color:white;width:100%'>" +
		"<DIV ID='TopImage' STYLE='position:relative;height:40;width:100%'>" +
		"<table width='100%'><tr><td ><img border='0' src='images/animation1.gif' width='100%' height='60' alt='Ancient Egypt Corner'></td>" +
		"<td width='60%' height='60'><img border='0' src='images/Topbanner.gif' width='100%' height='60' alt='EgyptianSam.com was established and created by Samir Hassan Ali '></td>" +
		"<td ><img border='0' src='images/Animation2.gif' width='100%' height='60' alt='Modern Egypt Corner'></td></tr></table></DIV>" +
		"<DIV ID='MenuBar' STYLE='position:relative;height:20;width:100%'>" +
		"<DIV ID='idICPMenuPane' STYLE='position:absolute;top:0;left:0;height:20;background-color:black;' NOWRAP><!--ICP_MENU_TITLES--></DIV>" +
		"</DIV>" +
		"</DIV>" +

		"<SCRIPT TYPE='text/javascript'>" + 
		"   var ToolbarMenu = StartMenu;" + 
		"</SCRIPT>" + 
		"<DIV WIDTH=100%>";


	// Intialize global variables
	ToolbarBGColor	= "white";	
	// toolbar background color
	MSFont  = "xx-small Verdana";
	ICPFont = "bold xx-small Verdana";
	
	
	aDefICPColor[0]	= aCurICPColor[0] = "Darkblue";	// bgcolor;
	aDefICPColor[1] = aCurICPColor[1] = "white";	// text font color
	aDefICPColor[2] = aCurICPColor[2] = "Yellow";		// mouseover font color
}


function drawToolbar()
{
	HTMLStr += "</DIV>";
	document.write(HTMLStr);
	ToolbarLoaded = true;

	

	idToolbar.style.backgroundColor     = ToolbarBGColor;
	//idMSMenuPane.style.backgroundColor  = aDefMSColor[0];
	idICPMenuPane.style.backgroundColor = aDefICPColor[0];
	//resizeToolbar();

	for (i = 0; i < TotalMenu; i++) 
	{
		thisMenu = document.all(arrMenuInfo[i].IDStr);
		if (thisMenu != null)
		{
			if (arrMenuInfo[i].IDStr == LastMSMenu && arrMenuInfo[i].type == "R")
			{
				//Last MSMenu has to be absolute width
				arrMenuInfo[i].type = "A";
				arrMenuInfo[i].unit = 60;
			}
			if (arrMenuInfo[i].type == "A")
				thisMenu.style.width = arrMenuInfo[i].unit;
			else 
				thisMenu.style.width = Math.round(arrMenuInfo[i].width * arrMenuInfo[i].unit) + 'em';
		}
	}
}









function setSubMenuWidth(MenuIDStr, WidthType, WidthUnit)
{
	var fFound = false;
	if (TotalMenu == MaxMenu)
	{
		alert("Unable to process menu. Maximum of " + MaxMenu + " reached.");
		return;
	}
	
	for (i = 0; i < TotalMenu; i++)
		if (arrMenuInfo[i].IDStr == MenuIDStr)
		{
			fFound = true;
			break;
		}

	if (!fFound)
	{
		arrMenuInfo[i] = new menuInfo(MenuIDStr);
		TotalMenu += 1;
	}

	if (!fFound && WidthType.toUpperCase().indexOf("DEFAULT") != -1)
	{
		arrMenuInfo[i].type = "A";
//The following set the drop down list width	
	arrMenuInfo[i].unit = 120;
	}
	else
	{
		arrMenuInfo[i].type = (WidthType.toUpperCase().indexOf("ABSOLUTE") != -1)? "A" : "R";
		arrMenuInfo[i].unit = WidthUnit ;
	}
}

// This function creates a menuInfo object instance.
function menuInfo(MenuIDStr)
{
	this.IDStr = MenuIDStr;
	this.type  = "";
	this.unit  = 0;
	this.width = 0;
	this.count = 0;
}

function updateSubMenuWidth(MenuIDStr)
{
	for (i = 0; i < TotalMenu; i++)
		if (arrMenuInfo[i].IDStr == MenuIDStr)
		{
			if (arrMenuInfo[i].width < MenuIDStr.length) 
				arrMenuInfo[i].width = MenuIDStr.length;
			arrMenuInfo[i].count = arrMenuInfo[i].count + 1;

			break;
		}
}

function AddMenuHeader(MenuIDStr, MenuDisplayStr, MenuHelpStr, MenuURLStr)
{ 	

	tempID = "ICP_" + MenuIDStr;

	addMenu(tempID, MenuDisplayStr, MenuHelpStr, MenuURLStr, true); 
   //  MenuItems=0
}



function addMenu(MenuIDStr, MenuDisplayStr, MenuHelpStr, MenuURLStr, bICPMenu)
{
	cFont   = bICPMenu? ICPFont : MSFont;
	cColor0 = bICPMenu? aDefICPColor[0] : aDefMSColor[0];
	cColor1 = bICPMenu? aDefICPColor[1] : aDefMSColor[1];
	cColor2 = bICPMenu? aDefICPColor[2] : aDefMSColor[2];
	tagStr  = bICPMenu? "<!--ICP_MENU_TITLES-->" : "<!--MS_MENU_TITLES-->";
        arrURL[URLNum] = MenuURLStr;

	MenuStr = newLineChar;
	if (bICPMenu == false && LastMSMenu != "")
		MenuStr += "<SPAN STYLE='font:" + cFont + ";color:" + cColor1 + "'></SPAN>"; 
	MenuStr += "<A  TITLE='" + MenuHelpStr + "'" +
			   "   ID='AM_" + MenuIDStr + "'" +
  "   STYLE='text-decoration:none;cursor:hand;font:" + cFont + ";background-color:" + cColor0 + ";color:" + cColor1 + ";'";
	if (MenuURLStr != "")
	{
		if (bICPMenu)
			MenuStr += " HREF='" + formatURL(MenuURLStr, ("ICP_" + MenuDisplayStr)) + "'";
		else
			MenuStr += " HREF='" + formatURL(MenuURLStr, ("MS_" + MenuDisplayStr)) + "'";
	}
	else
         	MenuStr +=  " HREF='' onclick='window.event.returnValue=false;'";
	MenuStr += " onmouseout="  + char34 + "mouseMenu('out' ,'" + MenuIDStr + "','" + MenuDisplayStr + "',''," + URLNum + "); hideMenu();" + char34 + 
				" onmouseover=" + char34 + "mouseMenu('over','" + MenuIDStr + "','" + MenuDisplayStr + addMenu.arguments.length + "',''," + URLNum + "); doMenu('" + MenuIDStr + "');" + char34 + ">" +
				"&nbsp;" + MenuDisplayStr + "&nbsp;</a>";

URLNum++; 
	if (bICPMenu)
	MenuStr += "<SPAN STYLE='font:" + cFont + ";color:" + cColor1 + "'>&nbsp;//</SPAN>";
        MenuStr += tagStr 
	
	HTMLStr = HTMLStr.replace(tagStr, MenuStr);	
	setSubMenuWidth(MenuIDStr,"default",0);
}

function addICPSubMenu(MenuIDStr, SubMenuStr, SubMenuURLStr, InfoStr)
{	

	tempID =  "ICP_" + MenuIDStr  ;
//MenuItems ++;
//AddMenuItem(tempID,SubMenuStr,SubMenuURLStr,"",InfoStr,true); 
AddMenuItem(tempID,SubMenuStr,SubMenuURLStr,InfoStr,true); 

}




function AddMenuItem(MenuIDStr, SubMenuStr, SubMenuURLStr,InfoStr, bICPMenu)
{
	cFont   = bICPMenu? ICPFont : MSFont;
	cColor0 = bICPMenu? aDefICPColor[0] : aDefMSColor[0];
	cColor1 = bICPMenu? aDefICPColor[1] : aDefMSColor[1];
	cColor2 = bICPMenu? aDefICPColor[2] : aDefMSColor[2];
	
	var MenuPos = MenuIDStr.toUpperCase().indexOf("MENU");
	if (MenuPos == -1) { MenuPos = MenuIDStr.length; }
	InstrumentStr = MenuIDStr.substring(0 , MenuPos) + "//" + SubMenuStr;
        URLStr        = formatURL(SubMenuURLStr, InstrumentStr);
	var LookUpTag  = "<!--" + MenuIDStr + "-->";
	var sPos = HTMLStr.indexOf(LookUpTag);
        arrURL[URLNum] = SubMenuURLStr
               
	if (sPos <= 0)
	{
// To change the top point of the drop down list, replace both 43 below with the value you require
		HTMLStr += newLineChar + newLineChar +
			"<SPAN ID='" + MenuIDStr + "'" +
			" STYLE='display:none;position:absolute;width:100;background-color:" +
                        cColor0 + ";padding-top:0;padding-left:0;padding-bottom:20;z-index:1;'" +
				" onmouseout='hideMenu();'>";
		if (Frame_Supported == false || bICPMenu == false)
			HTMLStr += "<HR  STYLE='position:absolute;left:0;top:0;color:" + cColor1 + "' SIZE=1>";
		HTMLStr +=  "<img border='0' src='images/pyramids.jpg' >"  +
                            "<DIV STYLE='position:relative;left:0;top:8;'>";
	}
	if (SubMenuURLStr.toLowerCase().substr(0,4) == "http")
        {
	   if (SubMenuStr.substr(0,1) == "*")
           {
		TempStr = newLineChar + 
				"<A ID='AS_" + MenuIDStr + "' Target='_Top'" +
				"   STYLE='text-decoration:none;cursor:hand;font:" + cFont + ";color:" + cColor1 + "'" +
		  " HREF='" + URLStr + 	"' onmouseout="  + char34 + "mouseMenu('out' ,'" + MenuIDStr +  "','" + SubMenuStr.substr(1, SubMenuStr.length) + "','" + InfoStr + "'," + URLNum + ");" + char34 + 
		                " onmouseover=" + char34 + "mouseMenu('over','" + MenuIDStr +  "','" + SubMenuStr + "','" + InfoStr + "'," + URLNum + ");" + char34 + ">" +
				"&nbsp;" + SubMenuStr.substr(1, SubMenuStr.length)  +  "<img border='0' src='images/New.gif'></A> <BR>" + LookUpTag;
            }
            else
           if (SubMenuStr.substr(0,1) == "#")
           {
		TempStr = newLineChar + 
				"<A ID='AS_" + MenuIDStr + "' Target='_Top'" +
				"   STYLE='text-decoration:none;cursor:hand;font:" + cFont + ";color:" + cColor1 + "'" +
		  " HREF='" + URLStr + 	"' onmouseout="  + char34 + "mouseMenu('out' ,'" + MenuIDStr +  "','" + SubMenuStr.substr(1, SubMenuStr.length) + "','" + InfoStr + "'," + URLNum + ");" + char34 + 
		                " onmouseover=" + char34 + "mouseMenu('over','" + MenuIDStr +  "','" + SubMenuStr + "','" + InfoStr + "'," + URLNum + ");" + char34 + ">" +
				"&nbsp;" + SubMenuStr.substr(1, SubMenuStr.length)  +  "<img border='0' src='images/Extra.gif'></A> <BR>" + LookUpTag;
            }
            else
            {
              TempStr = newLineChar + 
				"<A ID='AS_" + MenuIDStr + "' Target='_Top'" +
				"   STYLE='text-decoration:none;cursor:hand;font:" + cFont + ";color:" + cColor1 + "'" +
		  " HREF='" + URLStr + 	"' onmouseout="  + char34 + "mouseMenu('out' ,'" + MenuIDStr +  "','" + SubMenuStr + "','" + InfoStr + "'," + URLNum + ");" + char34 + 
		                " onmouseover=" + char34 + "mouseMenu('over','" + MenuIDStr +  "','" + SubMenuStr + "','" + InfoStr + "'," + URLNum + ");" + char34 + ">" +
				"&nbsp;" + SubMenuStr  +  "</A> <BR>" + LookUpTag;
             }
        }
        else if (SubMenuURLStr.length ==0 || SubMenuURLStr.substr(0,1) == " ")
              TempStr = "&nbsp;<b><font color='#FFFFFF' face='verdana' size='1'>" + SubMenuStr + "</font></B><BR>" + LookUpTag;
        else
        {
      	   if (SubMenuStr.substr(0,1) == "*")
           {

		TempStr = newLineChar + 
			"<A ID='AS_" + MenuIDStr + "'" +
			"   STYLE='text-decoration:none;cursor:hand;font:" + cFont + ";color:" + cColor1 + "'" +
			" HREF='" + URLStr + 	"' onmouseout="  + char34 + "mouseMenu('out' ,'" + MenuIDStr +  "','" + SubMenuStr.substr(1, SubMenuStr.length) + "','" + InfoStr + "'," + URLNum + ");" + char34 + 
		        " onmouseover=" + char34 + "mouseMenu('over','" + MenuIDStr +  "','" + SubMenuStr + "','" + InfoStr + "'," + URLNum + ");" + char34 + ">" +
			"&nbsp;" + SubMenuStr.substr(1, SubMenuStr.length)  +  "<img border='0' src='images/New.gif'></A> <BR>" + LookUpTag;
            }
	    else
      	   if (SubMenuStr.substr(0,1) == "#")
           {

		TempStr = newLineChar + 
			"<A ID='AS_" + MenuIDStr + "'" +
			"   STYLE='text-decoration:none;cursor:hand;font:" + cFont + ";color:" + cColor1 + "'" +
			" HREF='" + URLStr + 	"' onmouseout="  + char34 + "mouseMenu('out' ,'" + MenuIDStr +  "','" + SubMenuStr.substr(1, SubMenuStr.length) + "','" + InfoStr + "'," + URLNum + ");" + char34 + 
		        " onmouseover=" + char34 + "mouseMenu('over','" + MenuIDStr +  "','" + SubMenuStr + "','" + InfoStr + "'," + URLNum + ");" + char34 + ">" +
			"&nbsp;" + SubMenuStr.substr(1, SubMenuStr.length)  +  "<img border='0' src='images/Extra.gif'></A> <BR>" + LookUpTag;
            }
            else
            {
		TempStr = newLineChar + 
			"<A ID='AS_" + MenuIDStr + "'" +
			"   STYLE='text-decoration:none;cursor:hand;font:" + cFont + ";color:" + cColor1 + "'" +
			" HREF='" + URLStr + 	"' onmouseout="  + char34 + "mouseMenu('out' ,'" + MenuIDStr +  "','" + SubMenuStr + "','" + InfoStr + "'," + URLNum + ");" + char34 + 
		        " onmouseover=" + char34 + "mouseMenu('over','" + MenuIDStr +  "','" + SubMenuStr + "','" + InfoStr + "'," + URLNum + ");" + char34 + ">" +
			"&nbsp;" + SubMenuStr  +  "</A> <BR>" + LookUpTag;
             }
          }

URLNum++; 
    //   }
   //    else
//	TempStr = newLineChar +"&nbsp;" + SubMenuStr + "<BR>" + LookUpTag;
	//window.setTimeout("showMenu()", 2);     
    if (MenuItems>0)
       MenuHeight = (MenuItems * 30) 
 
	if (sPos <= 0)
	{		
		var StrSpanID ="Ext_" + MenuIDStr 
		var StrSpan = "<SPAN ID='" + StrSpanID + "'></SPAN></DIV></SPAN>" 
		HTMLStr += TempStr + StrSpan
               
        }
	else
		HTMLStr = HTMLStr.replace(LookUpTag, TempStr);	

	updateSubMenuWidth(MenuIDStr);	

}

function addICPSubMenuLine(MenuIDStr)
{	
	tempID = "ICP_" + MenuIDStr;
	AddMenuItemLine(tempID,true);
	//if (ToolbarMenu != null) 
	  // MenuHeight = parseInt(ToolbarMenu.offsetHeight) 

}


function AddMenuItemLine(MenuIDStr, bICPMenu)
{
	var LookUpTag = "<!--" + MenuIDStr + "-->";
	var sPos = HTMLStr.indexOf(LookUpTag);
	if (sPos > 0)
	{
		cColor  = bICPMenu? aDefICPColor[1] : aDefMSColor[1];
		TempStr = newLineChar + "<HR STYLE='color:" + cColor + "' SIZE=1>" + LookUpTag;
		HTMLStr = HTMLStr.replace(LookUpTag, TempStr);
	}
}

function mouseMenu(id, MenuIDStr, MenuName, InfoStr, CurNum) 
{

if (MenuName.substring(0,1)!=" ")
{

	IsMSMenu   = (MenuIDStr.toUpperCase().indexOf("MS_") != -1);
	IsMouseout = (id.toUpperCase().indexOf("OUT") != -1);
       
	if (IsMouseout) 
	{
		color = IsMSMenu? aDefMSColor[1] : aDefICPColor[1];
		if (MenuIDStr == CurICPMenu && aCurICPColor[1] != "") 
			color = aCurICPColor[1];
		for (var i=0; i<10000 ; i++);


	}
	else
	{
		color = IsMSMenu? aDefMSColor[2] : aDefICPColor[2];
		if (MenuIDStr == CurICPMenu && aCurICPColor[2] != "") 
			color = aCurICPColor[2];

              if (MenuIDStr!="")
	      {
		var CurrentURL 
		CurrentURL = arrURL[CurNum]
	       var SpanStr ="<table border='1' cellpadding='0' cellspacing='0' width='100%' bordercolor='#009FEC' top='" + MenuHeight + "' Height=20>" +
              					     "<tr> <td width='100%' bgcolor='#CCFFFF'><font color='#0000FF'>" + InfoStr + "</font></td></tr></table>"
	        if (MenuIDStr=="ICP_Entertainment")
                   Ext_ICP_Entertainment.innerHTML = SpanStr
		else if (MenuIDStr=="ICP_Knowledge")
                      Ext_ICP_Knowledge.innerHTML = SpanStr
                else if (MenuIDStr=="ICP_Travel")
                      Ext_ICP_Travel.innerHTML = SpanStr
               	else  if (MenuIDStr=="ICP_Information")
                      Ext_ICP_Information.innerHTML = SpanStr
                else  if (MenuIDStr=="ICP_Occations")
                      Ext_ICP_Occasions.innerHTML = SpanStr
                else  if (MenuIDStr=="ICP_International")
                      Ext_ICP_International.innerHTML = SpanStr
                else  if (MenuIDStr=="ICP_Contact")
                      Ext_ICP_Contact.innerHTML = SpanStr
                else  if (MenuIDStr=="ICP_Sites")
                      Ext_ICP_Sites.innerHTML = SpanStr

    }

	}
	window.event.srcElement.style.color = color;
 for (var i=0; i<10000 ; i++);

}
}

function doMenu(MenuIDStr) 
{
	var thisMenu = document.all(MenuIDStr);
	if (ToolbarMenu == null || thisMenu == null || thisMenu == ToolbarMenu) 
	{
		window.event.cancelBubble = true;
		return false;
	}
	// Reset dropdown menu
	window.event.cancelBubble = true;
	ToolbarMenu.style.display = "none";
	showElement("SELECT");
	showElement("OBJECT");
	ToolbarMenu = thisMenu;
	IsMSMenu = (MenuIDStr.toUpperCase().indexOf("MS_") != -1);

	// Set dropdown menu display position
	x  = window.event.srcElement.offsetLeft +
	 	 window.event.srcElement.offsetParent.offsetLeft;
	if (MenuIDStr == LastMSMenu) 
		x += (window.event.srcElement.offsetWidth - thisMenu.style.posWidth);
	x2 = x + window.event.srcElement.offsetWidth;
        y = MenuBar.offsetHeight
	thisMenu.style.top  = y;
	thisMenu.style.left = x;
	thisMenu.style.clip = "rect(0 0 0 0)";
	thisMenu.style.display = "block";

	// delay 2 millsecond to allow the value of ToolbarMenu.offsetHeight be set
	window.setTimeout("showMenu()", 2);
 	return true;
}

function showMenu() 
{
	if (ToolbarMenu != null) 
	{ 

		IsMenuDropDown = (Frame_Supported && IsMSMenu == false)? false : true;
		if (IsMenuDropDown == false)
		{
			y = (y - ToolbarMenu.offsetHeight - MenuBar.offsetHeight);
			if (y < 0) y = 0;
			ToolbarMenu.style.top = y;
		}
		y2 = y + ToolbarMenu.offsetHeight;


		ToolbarMenu.style.clip = "rect(auto auto auto auto)";
		hideElement("SELECT");
		hideElement("OBJECT");
		hideElement("IFRAME");  
              for (var i=0; i<10000 ; i++);


	}
}

function hideMenu()
{
	if (ToolbarMenu != null && ToolbarMenu != StartMenu) 
	{
		// Don't hide the menu if the mouse move between the menu and submenus
		cY = event.clientY + document.body.scrollTop;
		if ( (event.clientX >= (x+5) && event.clientX <= x2) &&
			 ((IsMenuDropDown == true  && cY > (y-10) && cY <= y2)      ||
			  (IsMenuDropDown == false && cY >= y     && cY <= (y2+10)) ))
		{
			window.event.cancelBubble = true;
			return; 
		}

		ToolbarMenu.style.display = "none";
		ToolbarMenu = StartMenu;
		window.event.cancelBubble = true;

		showElement("SELECT");
		showElement("OBJECT");
		showElement("IFRAME"); //FRANKLO
	}
for (var t=0; t<1000; t++);
}

function hideElement(elmID)
{
	for (i = 0; i < document.all.tags(elmID).length; i++)
	{
		obj = document.all.tags(elmID)[i];
		if (! obj || ! obj.offsetParent)
			continue;

		// Find the element's offsetTop and offsetLeft relative to the BODY tag.
		objLeft   = obj.offsetLeft;
		objTop    = obj.offsetTop;
		objParent = obj.offsetParent;
		while (objParent.tagName.toUpperCase() != "BODY")
		{
			objLeft  += objParent.offsetLeft;
			objTop   += objParent.offsetTop;
			objParent = objParent.offsetParent;
		}
		// Adjust the element's offsetTop relative to the dropdown menu
		objTop = objTop - y;
		if (x > (objLeft + obj.offsetWidth) || objLeft > (x + ToolbarMenu.offsetWidth))
			;
		else if (objTop > ToolbarMenu.offsetHeight)
			;
		else if (IsMSMenu && (y + ToolbarMenu.offsetHeight) <= 80)
			;
		else
			obj.style.visibility = "hidden";
	}
}

function showElement(elmID)
{
	for (i = 0; i < document.all.tags(elmID).length; i++)
	{
		obj = document.all.tags(elmID)[i];
		if (! obj || ! obj.offsetParent)
			continue;
		obj.style.visibility = "";
	}
}

function formatURL(URLStr, InstrumentStr)
{
	var tempStr = URLStr;

	if (URLStr != "" )
	{
		var ParamPos1 = URLStr.indexOf("?");
		var ParamPos2 = URLStr.lastIndexOf("?");
		var ParamPos3 = URLStr.toLowerCase().indexOf("target=");
		var ParamPos4 = URLStr.indexOf("#");
		var Bookmark  = "";
		var URL = URLStr;
		if (URLStr.toLowerCase().substr(0,4) == "http")
                {
			if (ParamPos4 >= 0)
			{
		 	URL = URLStr.substr(0, ParamPos4);
			Bookmark = URLStr.substr(ParamPos4);
			}
		
		if (ParamPos1 == -1)
			tempStr = "?MSCOMTB=";
		else if (ParamPos1 == ParamPos2 && ParamPos3 == -1)	
			tempStr = "&MSCOMTB=";
		else if (ParamPos1 == ParamPos2 && ParamPos3 != -1)	
			tempStr = "?MSCOMTB=";
		else if (ParamPos1 < ParamPos2)
			tempStr = "&MSCOMTB=";
		tempStr = URL + tempStr + InstrumentStr.replace(" ","%20") + Bookmark;
              }
	      else
	      tempStr = URLStr		//.substr(0,ParamPos1)
             
	}
        arrURL[URLNum] = tempStr.substr(0,tempStr.indexOf('.htm')+4)

	return tempStr;
}


function setToolbarBGColor(color)
{	
	ToolbarBGColor = color;
	if (ToolbarLoaded == true)
		idToolbar.style.backgroundColor = ToolbarBGColor;
}	



//#################################################################
//MenuItems

var ToolBar_Supported = ToolBar_Supported ;
if (ToolBar_Supported != null && ToolBar_Supported == true)
{
	
        Frame_Supported = false
	// Customize toolbar background color
	setToolbarBGColor("Darkblue");

	
	//***** Add ICP menus *****
// (Top.htm) page's script was designed to be used through web pages and not run on its own
// as all pages use this page as the top banner

// If web site moved or transferred, all links need to reflect the new site's location

// To disable any title below from being a link, preceed it with a space or leave the link empty
// To mark an entry as being new, preceed it with an astrix (*)
// To add the word (Extra) to the menu item, preceed the menu item title with (#).
// To add text to the menu items you are adding, add the following to the display section above:
// else  if (MenuIDStr=="ICP_Contact")
//        Ext_ICP_Contact.innerHTML = SpanStr
// Replacing the menu item title (ex:  Contact --> Information )


	//Home
	MenuItems=0	
	AddMenuHeader("HomeMenu", "Home", "","index.htm");
        
		
	//Entertainment
        MenuItems=6	
	AddMenuHeader("Entertainment", "Entertainment", "","");
	addICPSubMenu("Entertainment"," Entertainment","","");
	addICPSubMenu("Entertainment","Games","Games_page.htm","Check out and Play games");
	addICPSubMenu("Entertainment","Kids","Kids_page.htm","Just for kids... A corner full of education and entartainment");
	addICPSubMenu("Entertainment","Live TV","http://www.intertent.com/aldd.htm","Watch live Arabic TV or listen to your favourite radio station" );
	addICPSubMenu("Entertainment","#Music","Srv_Music.htm","Listen to and download Arabic music");
//      addICPSubMenu("Entertainment","Jokes","Jokes_page.htm","Forget your stress and have a look at the latest jokes");
	addICPSubMenu("Entertainment","Video","Video_page.htm","Watch and download Arabic videoes");

	//Knowledge
        MenuItems=7
	AddMenuHeader("Knowledge", "Knowledge", "","");
	addICPSubMenu("Knowledge"," Knowledge","","");
	addICPSubMenu("Knowledge","#Art","Art_page.htm","Interested in Egyption art? here is a collection of both Egyptian & non-Egyptian prints");	
	addICPSubMenu("Knowledge","#Books","Books.htm","Have a look at this great selection of books that cover every subject");
	addICPSubMenu("Knowledge","#Computer","it_page.htm","Information Technology under your finger tip");	
	addICPSubMenu("Knowledge","Cooking","Food_page.htm","Indulge yourself with a new recipe from Egypt and Arab countries");
	addICPSubMenu("Knowledge","#Family","Family_page.htm","Parents source of services and knowledge");	
        addICPSubMenu("Knowledge","#Education","Education_page.htm","Check out the many opportunities in education and career.");	
	addICPSubMenu("Knowledge","Sport","http://www.egyptflowers.net/Sport/index.htm","Who is the cup winner .. Check for yourself");
        addICPSubMenu("Knowledge","*Health","Health_page.htm","Check out your medical concern and access the latest reports.");	
	
	//Activities
        MenuItems=6
	AddMenuHeader("Activities", "Activities", "","");
	addICPSubMenu("Activities"," Travel","","");
	addICPSubMenu("Activities","*... Red Sea","Srv_Travel.htm","Interesetd in Scob Diving, Golf or exploring the many beautiful coral reef .. Enter here for the many services and clubs");
	addICPSubMenu("Activities","... Destinations","http://english.planetarabia.com/channels/tr/destinations.cfm","Travelling abroad..check out your destination here");
	addICPSubMenu("Activities","... Reservations","http://english.planetarabia.com/channels/tr/reservations.cfm","Travelling to Egypt..Book your ticket, hotel, car and others here");

//	addICPSubMenu("Activities","... From Egypt","Holiday_page.htm","Travelling from Egypt..This is for you");
//	addICPSubMenu("Activities","... in Egypt","http://www.touregypt.net/aetbi/members.htm","Travelling within Egypt .. Check time table and routes");
//	addICPSubMenu("Activities","... To Egypt","Travel_Page.htm","Dream of Travelling to Egypt .. You have achieved have of it !! Now check what else you need to know" );	
//	addICPSubMenu("Activities","... Experiences","Holiday_Page.htm","Check out this comments and experiences from someone already been to Egypt");
	addICPSubMenu("Activities", " Occasions", "","");
//	addICPSubMenu("Activities","*...Valentine","Valentine.htm","Do not miss your chance of showing your feeling at Valentine Day!!");
	addICPSubMenu("Activities","...Send a card","http://english.planetarabia.com/ecards/","Send a friend or relative an Egyptian card");
	addICPSubMenu("Activities","...Send flowers","Flowers.htm","Send flowers to your love one or family");
	addICPSubMenu("Activities","Shopping","Srv_Shopping.htm","Want to shop from the comfort of your seat .. Enter here");
	addICPSubMenu("Activities","Estate","http://www.arabrealestate.com/","Want to Buy, Sellor rent .. Enter this way");
	addICPSubMenu("Activities","*Mother Corner","Reward_moms.htm","Every mother's concern, dream and comfort can be answered here");

	
	//Information
        MenuItems=11
	AddMenuHeader("Information", "Information", "","");
	addICPSubMenu("Information"," Information","","");
	addICPSubMenu("Information","News","http://www.ahram-eg.com/Weekly/2000/508/egypt.htm","Read the latest news and articles from Egyptian newspapers");
	addICPSubMenu("Information","*Live News","http://english.planetarabia.com/news/newshome.cfm","Access the latest news and articles around the World");
        addICPSubMenu("Information"," Events","","");
	addICPSubMenu("Information","... in Egypt","Events_page.htm","Current events in Egypt");
	addICPSubMenu("Information","... Worldwide","http://english.planetarabia.com/events/","Current events around the world");
	addICPSubMenu("Information","Directory","http://www.egyptyellowpages.com.eg/","Egyptian Yellow Pages .. Search for any businesses in Egypt");
	addICPSubMenu("Information","#Internet","it_page.htm","Have an exciting experience around the Egyptian & worldwide Internet");
	addICPSubMenu("Information","Horoscope","http://english.planetarabia.com/horoscopes/","Worried about your future, try your horoscope");
	addICPSubMenu("Information","Weather","Srv_Weather.htm","Check today^s Temperature and Weather in Egypt and around the world" );
	addICPSubMenu("Information","Time difference","http://times.clari.net.au/","Check Current Time in Egypt and around the world" );

/*
	//Occasions
        MenuItems=4
	AddMenuHeader("Occasions", "Occasions", "","");
	addICPSubMenu("Occasions"," Occasions","","");
	addICPSubMenu("Occasions","Send flowers","http://www.egyptflowers.net","Send flowers to your love one or family");
	addICPSubMenu("Occasions","Send a card","http://english.planetarabia.com/ecards/","Send a friend or relative an Egyptian card");
	addICPSubMenu("Occasions","Ramadan","http://english.planetarabia.com/channels/ramadan.cfm","Send a friend or relative an Egyptian card");
*/

	//International
        MenuItems=4
	AddMenuHeader("International", "Countries", "","");
	addICPSubMenu("International"," Countries","","");
	addICPSubMenu("International","#... Egypt","CountriesE_page.htm","Tour Egypt in style");
	addICPSubMenu("International","... Arab","http://i-cias.com/i-e.o/2b.htm","Get Arabic Information ");
	addICPSubMenu("International","... World","http://www.wtgonline.com/navigate/world.asp","Get information from around the world");

	//Future
        MenuItems=13
	AddMenuHeader("Future", "Coming soon", "","");
	addICPSubMenu("Future"," Visitor","","");
	addICPSubMenu("Future"," .. Contacts","","");
	addICPSubMenu("Future"," .. Comments","","");
	addICPSubMenu("Future"," .. Experiences","","");
	addICPSubMenu("Future"," Egyptian","","");
	addICPSubMenu("Future"," .. Media","","");
	addICPSubMenu("Future"," .. Shopping","","");
	addICPSubMenu("Future"," .. Industry","","");
	addICPSubMenu("Future"," .. Technology","","");
//	addICPSubMenu("Future"," .. Red Sea Diving","","");
//	addICPSubMenu("Future"," .. Golf in Egypt","","");
	addICPSubMenu("Future"," News Letters","","");
	addICPSubMenu("Future"," View in Arabic","","");
	addICPSubMenu("Future"," Web service","","");
//	addICPSubMenu("Future"," Education service","","");
//	addICPSubMenu("Future"," Travel service","","");
//	addICPSubMenu("Future"," Art","","");
	addICPSubMenu("Future"," Jokes","","");

	//Contacts
        MenuItems=7
	AddMenuHeader("Contact", "Site Info", "","");
	addICPSubMenu("Contact"," Site Info","","");
	addICPSubMenu("Contact","Contact us","Contact_page.htm","");
//	addICPSubMenu("Contact","Vote for us","Vote_page.htm","");
	addICPSubMenu("Contact","Link to us","Link_to_egyptiansam.htm","Interested in exchanging links or linking to our site, more help is in hand here");
//	addICPSubMenu("Contact","FeedBack","Feedback_page.htm","");
	addICPSubMenu("Contact"," Guest Book","","");
	addICPSubMenu("Contact",".......Sign","http://www.TheGuestBook.com/egbook/276450.gbook","Sign my guest book, as your critic is appreciated ");
	addICPSubMenu("Contact",".......View","http://www.TheGuestBook.com/vgbook/276450.gbook","View my guest book, see what others have said about my site");
	addICPSubMenu("Contact","Bookmark this site","javascript:addbookmark()","");

//Sites
 	MenuItems=13
	AddMenuHeader("Sites", "Other Sites", "","");
	addICPSubMenu("Sites", " Other Sites", "","");
	addICPSubMenu("Sites"," Travel","","");
	addICPSubMenu("Sites","*... Holidays","http://samcom.traverustravel.com/index.asp","Book holiday package");
	addICPSubMenu("Sites"," ... Flights","http://samcom.traverustravel.com/index.asp","Book flights");
	addICPSubMenu("Sites"," ... Cruises","http://viralurl.com/samcom/travel","Book cruises");
	addICPSubMenu("Sites"," Earn Income","","");
	addICPSubMenu("Sites","*... Home Based","http://www.samcomtravel.net","Earn extra income");
	addICPSubMenu("Sites"," ... Free Websites","http://www.samcoms.com","Get your own website free");
	addICPSubMenu("Sites"," ... Affiliate","http://www.ebaysecret.co.uk","Earn extra income as an affiliate");
	addICPSubMenu("Sites"," Ebooks","","");
	addICPSubMenu("Sites","* ... Membership Club","http://www.ebook-cave.com","Large knowledge base of ebooks");
	addICPSubMenu("Sites"," ... Store","","");
	addICPSubMenu("Sites"," ... Re-Sell Rights","","");

//Search
        MenuItems=0
	AddMenuHeader("Search", "Search", "","Search_page.htm");



}

function addbookmark()
{
var bookmarkurl="http://www.egyptiansam.net"
var bookmarktitle ="EgyptianSam"
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}



