
			WebBaseDirectory = "/mainportal/";

			function clickMenuButton(NumIn)
			{
				var TempIMGName = "";
				//alert("You clicked "+NumIn);
		
				switch (NumIn)
				{
					case 1:top.location.href="/";break;
					case 2:top.location.href=(WebBaseDirectory+"php/purpose.php");break;
					case 3:top.location.href=(WebBaseDirectory+"php/professional.php");break;
					case 4:top.location.href=(WebBaseDirectory+"php/portals.php");break;
					case 5:top.location.href=(WebBaseDirectory+"php/blog.php");break;
					case 6:top.location.href=(WebBaseDirectory+"php/links.php");break;
					case 7:top.location.href=(WebBaseDirectory+"php/search.php");break;
					default:top.location.href="#";break;
				}
			
			}//clickMenuButton


			function changeImageOfMenuButton(NumIN,OptionIN)
			{
				var TempIMGName = "";
			
				TempIMGName = "b_menu_"+NumIN;	
				
				if((OptionIN==1)||(OptionIN=="1")||(OptionIN=="yes")||(OptionIN=="a"))	changeImage(TempIMGName,(WebBaseDirectory+"images/"+TempIMGName+"_a.gif")); 
				else changeImage(TempIMGName,(WebBaseDirectory+"images/"+TempIMGName+".gif"));
				
			}//changeImageMenuButton


			function overMenuButton(NumIN)
			{
				var TempIMGName = "";
			
				//alert("Track this bug?");
				changeImageOfMenuButton(NumIN,1);
				closeDropflap();
				//openDropflap(NumIN);
				
			}//overMenuButton

			function outMenuButton(NumIN)
			{
				changeImageOfMenuButton(NumIN,0);
				closeDropflap();

			}//outMenuButton
			
			
			function openDropflap(NumIN)
			{
				var LinkOUT = new Array();
				var LinkTextOUT = new Array();
		
				hideDiv("dropflap");	
				
				//alert("Drop IT!");
				if(NumIN==2)
				{
					LinkOUT[0] = (WebBaseDirectory+"php/purpose.php");
					LinkTextOUT[0] = "An Explanation";
					LinkOUT[1] = (WebBaseDirectory+"php/objectives.php");
					LinkTextOUT[1] = "Objectives";
				}
				else if(NumIN==3)
				{
					LinkOUT[0] = (WebBaseDirectory+"php/professional.php");
					LinkTextOUT[0] = "Professional";
					LinkOUT[1] = (WebBaseDirectory+"php/objectives.php");
					LinkTextOUT[1] = "Objectives";
				}	
				else if(NumIN==4)
				{
					LinkOUT[0] = (WebBaseDirectory+"php/portals.php");
					LinkTextOUT[0] = "The Portals";
					LinkOUT[1] = "/artwork/";
					LinkTextOUT[1] = "Artwork";
					LinkOUT[2] = "/programs/";
					LinkTextOUT[2] = "Programming";
					LinkOUT[3] = "/music/";
					LinkTextOUT[3] = "Music";
				}
				else if(NumIN==5) //BLOGS
				{
					LinkOUT[0] = (WebBaseDirectory+"php/blog.php");
					LinkTextOUT[0] = "The Blog";
					//LinkOUT[1] = (WebBaseDirectory+"php/blog.php?thread=glen");
					//LinkTextOUT[1] = "GLEN'S BLOG";
					//LinkOUT[2] = (WebBaseDirectory+"php/blog.php?thread=guest");
					//LinkTextOUT[2] = "GUEST'S BLOG";
				}
				else if(NumIN==6)
				{
					LinkOUT[0] = (WebBaseDirectory+"php/links.php");
					LinkTextOUT[0] = "The Links";	
					LinkOUT[1] = "http://www.adeptsites.com";
					LinkTextOUT[1] = "AdeptSites";	
					LinkOUT[2] = "http://ghbarratt.deviantart.com";
					LinkTextOUT[2] = "Deviant Aart";	
					LinkOUT[3] = "http://www.facebook.com/ghbarratt";
					LinkTextOUT[3] = "Facebook";
				}
				else 
				{
					LinkOUT[0] = "#";
					LinkTextOUT[0] = "PROBLEM";	
				}
				if((NumIN>1)&&(NumIN<7)&&(NumIN!=5))
				{
			
					ContentOUT = "<table width='121' cellspacing='0' cellpadding='0' border='0'>";
					ContentOUT = ContentOUT+"<tr><td colspan='3'><img src='/images/spacer.gif' width='15' height='33' onMouseOver='closeDropflap()' alt='' /><a href='javascript:clickMenuButton("+NumIN+")'><img src='/images/spacer.gif' width='91' height='33' alt='' onMouseOver='changeImageOfMenuButton("+(NumIN)+",1)' onMouseOut='changeImageOfMenuButton("+(NumIN)+",0)' /></a><img src='/images/spacer.gif' width='15' height='33' onMouseOver='closeDropflap()' alt='' /><br/></td></tr>";
					ContentOUT = ContentOUT+"<tr><td width='15' onMouseOver='closeDropflap()'><img src='/images/spacer.gif' width='15' alt='' /><br/><";
					ContentOUT = ContentOUT+"/td><td class='dropflapTD' style='background-color: #dddddd; border-left: solid 1px black; border-right: solid 1px black;'>";
					ContentOUT = ContentOUT+"<img src='/images/spacer.gif' width='89' height='1' alt='' /><br/>";
					
					//This may look funny but it is a good idea to check validation while changing this next part
					//For some reason this needs to be written like this or the validator goes crazy!	
					
					
					i=0;
					while(LinkOUT[i])
					{					
						ContentOUT = ContentOUT+"<a href='";
						ContentOUT = ContentOUT+LinkOUT[i];
						ContentOUT = ContentOUT+"' class='dropflapLink'>";
						ContentOUT = ContentOUT+LinkTextOUT[i]+"<";
						ContentOUT = ContentOUT+"/a><br/>";
						
						i++;
					}
					
					ContentOUT = ContentOUT+"<";
					ContentOUT = ContentOUT+"/td><td width='15' onMouseOver='closeDropflap()'><img src='/images/spacer.gif' width='15' alt='' /><br/><";				
					ContentOUT = ContentOUT+"/td><";
					ContentOUT = ContentOUT+"/tr><";
					ContentOUT = ContentOUT+"tr><";
					ContentOUT = ContentOUT+"td width='15' onMouseOver='closeDropflap()'><img src='/images/spacer.gif' width='15' alt='' /><br/><";
					ContentOUT = ContentOUT+"/td><";
					ContentOUT = ContentOUT+"td><a href='javascript:closeDropflap()'><img src='"+WebBaseDirectory+"images/b_menu_dropflap_out.gif' border='0' alt='' /><";
					ContentOUT = ContentOUT+"/a><br/><";	
					ContentOUT = ContentOUT+"/td><";
					ContentOUT = ContentOUT+"td width='15' onMouseOver='closeDropflap()'><img src='/images/spacer.gif' width='15' alt='' /><br/><";
					ContentOUT = ContentOUT+"/td><";
					ContentOUT = ContentOUT+"/tr><";
					ContentOUT = ContentOUT+"tr><";
					ContentOUT = ContentOUT+"td colspan='3' ><img src='/images/spacer.gif' width='121' height='15' onMouseOver='closeDropflap()' alt='' /><br/><";
					ContentOUT = ContentOUT+"/td><";
					ContentOUT = ContentOUT+"/tr><";
					ContentOUT = ContentOUT+"/table>";
					
					setDropflapContent(ContentOUT);
					
					positionDropflap(NumIN);
					//alert('right before show');
					showDiv('dropflap');	
					//alert('right after show');
				}
				else closeDropflap();
				

			}//openDropFlap
			
			
			function closeDropflap()
			{
					hideDiv('dropflap');		
			}//closeDropflap

			function hideDiv(IDIN)
			{
				if(document.getElementById)
				{
					// this is the way the standards work
					if(document.getElementById(IDIN))document.getElementById(IDIN).style.visibility = "hidden";
				}
				else if(document.all)
				{
					// this is the way old msie versions work
					if(document.getElementById(IDIN))document.all[IDIN].style.display = "block";
				}
				//alert("Did it hide?");
			}//hideDiv

			function showDiv(IDIN)
			{
				if(document.getElementById)
				{
					// this is the way the standards work
					document.getElementById(IDIN).style.visibility = "visible";
				}
				else if(document.all)
				{
					// this is the way old msie versions work
					document.all[IDIN].style.display = "";
				}
				//alert("Did it hide?");
			}//hideDiv

			//Some very special code for the menu
			function setDropflapContent(ContentIN)
			{
				
				//alert("Fooba");
				document.getElementById('dropflap').innerHTML = ContentIN;
				//alert("Fooba1");
			}//setDropflapContent
			
			function positionDropflap(NumIN)
			{
				var XPosition = 0;
				var MenuWidth = (91*7 + 5*6);
				var TempImageName="b_menu_"+NumIN;
				var TempX = 0;
				
				TempX= getImageLeftPosition(TempImageName);
				if(TempX != -1)
				{
					XPosition=TempX;
					//alert("Xposition "+XPosition);	
				}
				else 
				{
					if(MF)XIN-=9;
					XPosition = (getWindowWidth()-MenuWidth)/2+96*(NumIN-1);
				}
				
				//alert("Window Width "+getWindowWidth());
				//alert("Menu button "+NumIN+" should go to "+XPosition);
		
				XPosition-=15;
				
				setDivX("dropflap",XPosition);
			}//positionDropflap
			
			function setDivX(IDIN, XIN)
			{
					
				//alert("XIN "+XIN);
				if(document.getElementById)
				{
					var PixelString = ""+parseInt(XIN)+"px";	
					document.getElementById(IDIN).style.left = PixelString;
					//alert("Made it in here! "+IDIN+" = "+document.getElementById(IDIN).style.left);
				}
			}//setDivX

			function getImageLeftPosition(ImageNameIN)
			{
				var obj = document.images[ImageNameIN];
				var CurrentX = 0;
				
				if(!document.images[ImageNameIN])
				{ 
					alert("Did not find image named "+ImageNameIN);
					return -1;
				}
					
				if (obj.offsetParent)
				{
					while (obj.offsetParent)
					{
						CurrentX += obj.offsetLeft
						obj = obj.offsetParent;
					}
				}
				else if (obj.x) CurrentX += obj.x;
				return CurrentX;
			}//getImageLeftPosition

			function getWindowWidth() 
			{
				var MyWidth=0, MyHeight=0;
				
				if(typeof(window.innerWidth)=='number') 
				{
					//Non-IE
					MyWidth = window.innerWidth;
					MyHeight = window.innerHeight;
				} 
					else if(document.documentElement &&(document.documentElement.clientWidth || document.documentElement.clientHeight))
				{
					//IE 6+ in 'standards compliant mode'
					MyWidth = document.documentElement.clientWidth;
					MyHeight = document.documentElement.clientHeight;
				} 
				else if(document.body &&(document.body.clientWidth || document.body.clientHeight)) 
				{
					//IE 4 compatible
					MyWidth = document.body.clientWidth;
					MyHeight = document.body.clientHeight;
				}
				
				//window.alert( 'Width = ' + myWidth );
				
				return MyWidth;
			}//getWindowWidth

			//End of the "special" javascript
			
			//Use this if you think that the javascript is corrupt
			//testMess();
			if(window.onresize)window.onresize=closeDropflap();
