// Menu toggle script based on the script in 'Javascript for the WWW' by Negrino & Smith
//  call toggleMenu() with the name of the menu to open
	lastMenu=false
	//checking to see if the sliding menus will work - stdBrowser will be used in the script that writes the menu
	if(document.getElementById && navigator.appName != "Opera"){
		stdBrowser=true
	 }
	 else {
	 	stdBrowser=false
	  }
	//for window resize bug in netscape 4
	if (document.layers){
		oW=window.innerWidth
		oH=window.innerHeight
	}
	//begin function
		function toggleMenu(currMenu) {
			if (document.getElementById) {
				thisMenu = document.getElementById(currMenu).style
				thisMenuCarrot=eval("document."+currMenu+"carrot")
				if (thisMenu.display == "block") {
					thisMenu.display = "none"
					thisMenuCarrot.src='../nav/carrotClosed.gif'
					if (lastMenu==currMenu){
					lastMenu=false
					}
				}
				else {
					thisMenu.display = "block"
					thisMenuCarrot.src="../nav/carrotOpen.gif"
					if (lastMenu!=false){
					document.getElementById(lastMenu).style.display = "none"
					eval("document."+lastMenu+"carrot.src='../nav/carrotClosed.gif'")
					}
					lastMenu=currMenu
				}
				return false
			}
			else {
				return true
			}
		}

// Write the menu into the html page.
//  call writeMenu(menuNumber,isCGI) 
//  menuName is  'menu1' etc (the menu that should be open in non-standard browsers)
//  isCGI will be false in all pages except when called from the CGI script 
function writeMenu(menuName,isCGI){
	clientPath="../client/"
	candidatePath="../candidate/"
	companyPath="../company/"
	if ((menuName=="menu1")&& !isCGI){
		clientPath=""
	}
	else if ((menuName=="menu2") && !isCGI){
		candidatePath=""
	}
	else if ((menuName=="menu3"||menuName=="menu4") && !isCGI){
		companyPath=""
	}
	//check if old browser that doesn't support hiding text
	 (stdBrowser) ? menuClass=' class="menu"' : menuClass=""
	//Begin writing menu
	//  for quotes within quotes use \'
	document.write('<DIV class="navlinks">')
	document.write('		<A href="'+clientPath+'index.html" onclick="return toggleMenu(\'menu1\')"><IMG src="../gifs/carrotClosed.gif" width="15" height="20" border="0" name="menu1carrot"></A><A href="'+clientPath+'index.html" title="For Clients"><IMG src="../gifs/forClientsBar.gif" width="150" height="20" border="0" alt="For Clients"></A> <BR>')
	if (stdBrowser || menuName=="menu1"){
	//this is pop-out "menu1"
	document.write('	<SPAN'+menuClass+' id="menu1"><IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+clientPath+'index.html" class="navlinks">Our Services</A><BR>')
	document.write('		<IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+clientPath+'candidates.html" class="navlinks">Find a Household Professional</A><BR>')
	document.write('		<IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+clientPath+'requestHelp.html" class="navlinks">Talk To Us About Finding A Household Professional</A><BR>')
	document.write('		<IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+clientPath+'commonQuestions.html" class="navlinks">Common Questions</A><BR>')
	document.write('		<IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+clientPath+'client-quotes.html" class="navlinks">Client Testimonials</A><BR>')
	document.write('		<IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+clientPath+'resources.html" class="navlinks">Helpful Resources</A><BR>')
	document.write('	<IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="http://tandcr.com/blog" class="navlinks">Town & Country Blog</A><BR>')
	document.write('	<IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+clientPath+'newsletter.html" class="navlinks">Newsletter</A><BR>')
	document.write('		<IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+clientPath+'workshops.html" class="navlinks">Events</A><BR>')
	document.write('	</SPAN><BR>')
	}
	document.write('	<A href="'+candidatePath+'index.html" onclick="return toggleMenu(\'menu2\')"><IMG src="../gifs/carrotClosed.gif" width="15" height="20" border="0" name="menu2carrot"></A><A href="'+candidatePath+'index.html" title="For Job Seekers"><IMG src="../gifs/forJobSeekersBar.gif" width="150" height="20" border="0" alt="For Job Seekers"></A><BR>')
	if (stdBrowser || menuName=="menu2"){
	//this is pop-out "menu2"
	document.write('	<SPAN'+menuClass+' id="menu2"><IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+candidatePath+'index.html" class="navlinks">Our Services</A><BR>')
	document.write('	<IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+candidatePath+'browse.html" class="navlinks">Find A Great Job</A><BR>')
	document.write('		<IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+candidatePath+'apply.html" class="navlinks">Talk to Us About Finding A Great Job</A><BR>')
	document.write('	<IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+candidatePath+'commonQuestions.html" class="navlinks">Common Questions</A><BR>')
	document.write('	<IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+candidatePath+'candidate-quotes.html" class="navlinks">Candidate Testimonials</A><BR>')
	document.write('		<IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+candidatePath+'resources.html" class="navlinks">Helpful Resources</A><BR>')
	document.write('		<IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+candidatePath+'events.html" class="navlinks">Events</A><BR>')
	document.write('		<IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+candidatePath+'cand.newsletter.html" class="navlinks">Newsletter</A><BR>')
	document.write('		</SPAN><BR>')
	}
	document.write('	<A href="'+companyPath+'about-us.html" onclick="return toggleMenu(\'menu3\')"><IMG src="../gifs/carrotClosed.gif" width="15" height="20" border="0" name="menu3carrot"></A><A href="'+companyPath+'about-us.html" title="About Us"><IMG src="../gifs/aboutUsBar.gif" width="150" height="20" border="0" alt="About Us"></A><BR>')
	if (stdBrowser || menuName=="menu3"){
	//this is pop-out "menu3"
	document.write('	<SPAN'+menuClass+' id="menu3">')
	document.write('		<IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+companyPath+'about-us.html" class="navlinks">About Us</A><BR>')
	document.write('		<IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+companyPath+'ourTeam.html" class="navlinks">Our Team</A><BR>')
	document.write('	<IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+companyPath+'partnerships.html" class="navlinks">Partnerships</A><BR>')
	document.write('		<IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+companyPath+'press.html" class="navlinks">Recent Press</A><BR>')
	document.write('		<IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+companyPath+'privacyPolicy.html" class="navlinks">Privacy Policy</A><BR>')
	document.write('	</SPAN><BR>')
	}
	document.write('	<A href="'+companyPath+'contactUs.html" onclick="return toggleMenu(\'menu4\')"><IMG src="../gifs/carrotClosed.gif" width="15" height="20" border="0" name="menu4carrot"></A><A href="'+companyPath+'contactUs.html" title="Contact Us"><IMG src="../gifs/contactUsBar.gif" width="150" height="20" border="0" alt="Contact Us"></A><BR>')
	if (stdBrowser || menuName=="menu4"){
	//this is pop-out "menu4"
	document.write('	<SPAN'+menuClass+' id="menu4"><IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+companyPath+'contactUs.html" class="navlinks">Contact Us</A><BR>')
	document.write('		<IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+companyPath+'nanny-palo-alto.html" class="navlinks">Palo Alto</A><BR>')
	document.write('		<IMG src="../gifs/blueStarBulletClear.gif" width="15" height="10" border="0"><A href="'+companyPath+'nanny-san-francisco.html" class="navlinks">San Francisco</A></SPAN><BR>')
	}
	document.write('</DIV>')
}

	
// netscape 4 resize bug workaround from JS for WWW book
function resizeFix() {
	if (document.layers) {
		if (window.innerWidth != oW || window.innerHeight != oH) {
			window.location.reload()
		}
	}
}