//Pop-it menu- By Dynamic Drive//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com//This credit MUST stay intact for use// Modified by Ray Dickman :: October 2003	var sub_menu=new Array()	//SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT	// about pace	sub_menu[0] ='<a href="about_logo.html" onMouseOver="img_toggle( \'about_logo\', \'on\' )" onMouseOut="img_toggle( \'about_logo\', \'off\' )"><img src="images/about_logo_off.gif" width="152" height="25" alt="About our Logo" name="about_logo" border="0"></a><br />';	sub_menu[0] +='<a href="partners.html" onMouseOver="img_toggle( \'partners\', \'on\' )" onMouseOut="img_toggle( \'partners\', \'off\' )"><img src="images/partners_off.gif" width="152" height="19" alt="Partners" name="partners" border="0"></a><br />';	sub_menu[0] +='<a href="how_we_work.html" onMouseOver="img_toggle( \'how_we_work\', \'on\' )" onMouseOut="img_toggle( \'how_we_work\', \'off\' )"><img src="images/how_we_work_off.gif" width="152" height="19" alt="How we work" name="how_we_work" border="0"></a><br />';	sub_menu[0] +='<a href="pace_assoc.html" onMouseOver="img_toggle( \'pace_assoc\', \'on\' )" onMouseOut="img_toggle( \'pace_assoc\', \'off\' )"><img src="images/pace_assoc_off.gif" width="152" height="22" alt="Pace Associtates" name="pace_assoc" border="0"></a>';			// define which browser version we have	// global definitions	var ieX = document.all&&navigator.userAgent.indexOf("Opera")==-1;	var nn6 = document.getElementById&&!document.all;	var nn4 = document.layers;	// This is the displayMenu(e, sub_category) function	// This function will display the menu to the screen	function displayMenu(e,sub_category, my_top, my_left){		if(!document.all && !document.getElementById && !document.layers){			return;		}				clearhideMenu();				// find out which dom we will be using		domMenu = (ieX)? document.all.cascade_menu : (nn6)? document.getElementById("cascade_menu") : (nn4)? document.cascade_menu : "";				domMenu.domStyle = (ieX || nn6)? domMenu.style : domMenu;		if(ieX||nn6){			domMenu.innerHTML = sub_category;		} else{			domMenu.document.write('<layer name="gui" bgColor="#E6E6E6" width="165" onmouseover="clearhideMenu();" 	onmouseout="hideMenu();">'+sub_category+'</layer>');			domMenu.document.close();		}		domMenu.contentwidth = (ieX||nn6)? domMenu.offsetWidth  : domMenu.document.gui.document.width;		domMenu.contentheight= (ieX||nn6)? domMenu.offsetHeight : domMenu.document.gui.document.height;		(eventX=ieX)? event.clientX : (nn6)? e.clientX : e.x;		(eventY=ieX)? event.clientY : (nn6)? e.clientY : e.y;		//Find out how close the mouse is to the corner of the window		var rightedge=ieX? document.body.clientWidth-eventX : window.innerWidth-eventX;		var bottomedge=ieX? document.body.clientHeight-eventY : window.innerHeight-eventY;		//if the horizontal distance isn't enough to accomodate the width of the context menu		if (rightedge<domMenu.contentwidth)			//move the horizontal position of the menu to the left by it's width			domMenu.domStyle.left=ieX? document.body.scrollLeft+eventX-domMenu.contentwidth : nn6? 	window.pageXOffset+eventX-domMenu.contentwidth : eventX-domMenu.contentwidth;		else			//position the horizontal position of the menu where the mouse was clicked			domMenu.domStyle.left=ieX? document.body.scrollLeft+eventX : nn6? window.pageXOffset+eventX : eventX;		//same concept with the vertical position		if (bottomedge<domMenu.contentheight)			domMenu.domStyle.top=ieX? document.body.scrollTop+eventY-domMenu.contentheight : nn6? 	window.pageYOffset+eventY-domMenu.contentheight : eventY-domMenu.contentheight;		else			domMenu.domStyle.top=ieX? document.body.scrollTop+event.clientY : nn6? window.pageYOffset+eventY : eventY;			domMenu.domStyle.top = my_top;		domMenu.domStyle.left = my_left;		domMenu.domStyle.visibility="visible";				if(nn6){			domMenu.domStyle.top = my_top-8;			domMenu.domStyle.left = my_left-3;		}				return false	} // end of displayMenu(event, sub_categoryMenuToShow)	function contains_nn6(a, b) {		//Determines if 1 element in contained in another- by Brainjar.com		while (b.parentNode)			if ((b = b.parentNode) == a)			return true;			return false;	} // end of contains_nn6()	function hideMenu(){		if(window.domMenu){			domMenu.domStyle.visibility=(ieX || nn6)? "hidden" : "hide";		}	} // end of hideMenu		function dynamichide(e){		if(ieX&&!domMenu.contains(e.toElement)){			hideMenu();		} else if(nn6&&e.currentTarget!= e.relatedTarget&& !contains_nn6(e.currentTarget, e.relatedTarget)){			hideMenu();		}	} // end of dynamichide(event)	function delayhideMenu(){		if(ieX||nn6||nn4){			delayhide=setTimeout("hideMenu()",500);		}	} // end of delayhideMenu()	function clearhideMenu(){		if(window.delayhide){		 	// if we are still moused over the menu, cancel the hidemenu			clearTimeout(delayhide);		}	} // end of clearhideMenu()	function highlightmenu(e,state){		if(document.all)   			source_el=event.srcElement		else if (document.getElementById)		   source_el=e.target		if (source_el.className=="menuitems"){		   source_el.id=(state=="on")? "mouseoverstyle" : ""		} else {		   while(source_el.id!="cascade_menu"){		  	source_el=document.getElementById? source_el.parentNode : source_el.parentElement			if (source_el.className=="menuitems"){			   source_el.id=(state=="on")? "mouseoverstyle" : ""			}		   }		}	} // end of highlightmenu() function		if (ieX || nn6)		document.onclick=hideMenu;
