// this must be an absolute link to this section!
var SiteRootFolder = "http://www.aap.org/sections/ypn/r"; // aap production server
// var SiteRootFolder = "http://dev1.aap.org/sections/ypn/r"; // aap development server
// var SiteRootFolder = "/aap_r/r"; // eo server

var RowNum = 0;
var SubRowNum = 0;


var SubMenuYOffset = "-19px"; 
var MenuYOffset = "0px";

var StaticNavMenu = '';
/*'<img width="599" height="26" src="/shared/spacer.gif" border="0" usemap="#NavMenuMap">'+
    '<map name="NavMenuMap" id="Map"><area shape="rect" coords="-4,-1,78,34" href="/about/" />'+
    '<area shape="rect" coords="79,0,145,50" href="/services/" />'+
    '<area shape="rect" coords="147,1,233,86" href="/general/" />'+
    '<area shape="rect" coords="235,0,322,62" href="/employment" />'+
    '<area shape="rect" coords="325,1,455,54" href="/programs/" />'+
    '<area shape="rect" coords="457,1,512,31" href="/events/" />'+
    '<area shape="rect" coords="515,1,616,38" href="/contact/" /></map>';
*/

// Preload hover images
window.onload = function() {  
	Image1 = new Image();
	Image2 = new Image();
	Image1.src = SiteRootFolder+"/shared/left_menu/bullet_top_over.gif";
	Image2.src = SiteRootFolder+"/shared/left_menu/bullet_bottom_over.gif";
}

//
// Menu functions
//
function MenuRow(in_Title, in_Link, in_MenuRowPopup, in_LinkExternalTarget)
{
	// in_LinkExternalTarget is optional
	LinkTarget = "";
	if (typeof in_LinkExternalTarget != "undefined")
		if (in_LinkExternalTarget)
			LinkTarget = " target='_blank' ";

	var Style = '';
	RowNum++;

	if (RowNum % 2)
		Style = 'TopMenuSub1';
	else
		Style = 'TopMenuSub2';

	if ((in_Link.search(/http:/i) != -1) || (in_Link.search(/https:/i) != -1))
		Link = in_Link;
	else
		Link = SiteRootFolder+in_Link;	

	return '	<li><a class="'+Style+'" href="'+Link+'" '+LinkTarget+'>'+in_Title+'</a>'+in_MenuRowPopup+'</li>';
}

function StartMenu(in_MenuName, in_Width, in_Height, in_Link, in_MenuRowWidth, in_LeftOffset)
{
	// in_LeftOffset is optional
	if (typeof in_LeftOffset == "undefined")
		in_LeftOffset = "0";
	RowNum = 0;

	if ((in_Link.search(/http:/i) != -1) || (in_Link.search(/https:/i) != -1))
        Link = in_Link;
    else
        Link = SiteRootFolder+in_Link;

	return 	'<li style="width:'+in_Width+'px;"><a href="'+Link+'">'
		+'<img src="'+SiteRootFolder+'/shared/spacer.gif" width="'+(in_Width-40)+'" height="'+in_Height+'" border="0" ></a>'
	+'<div><div style="width:'+in_MenuRowWidth+'px;top:'+MenuYOffset+';left:'+in_LeftOffset+'px;"><ul style="">';
}

function EndMenu()
{	
	return '</ul></div></div></li>';
}

function StartMenuNoRows(in_MenuName, in_Width, in_Height, in_Link, in_MenuRowWidth)
{
	RowNum = 0;

	if ((in_Link.search(/http:/i) != -1) || (in_Link.search(/https:/i) != -1))
        Link = in_Link;
    else
        Link = SiteRootFolder+in_Link;

	return 	'<li style="width:'+in_Width+'px;"><a href="'+Link+'">'
		+'<img src="'+SiteRootFolder+'/shared/spacer.gif" width="'+(in_Width-40)+'" height="'+in_Height+'" border="0" ></a></li>';
}

// Submenu functions
function SubMenuRow(in_Title, in_Link, in_MenuRowPopup, in_LinkExternalTarget)
{
	// in_LinkExternalTarget is optional
	LinkTarget = "";
	if (typeof in_LinkExternalTarget != "undefined")
		if (in_LinkExternalTarget)
			LinkTarget = " target='_blank' ";

	var Style = '';
	SubRowNum++;

	if (typeof in_MenuRowPopup == "undefined")
		in_MenuRowPopup = '';
		
	if (SubRowNum % 2)
		Style = 'TopMenuSub1';
	else
		Style = 'TopMenuSub2';

	if ((in_Link.search(/http:/i) != -1) || (in_Link.search(/https:/i) != -1))
        Link = in_Link;
    else
        Link = SiteRootFolder+in_Link;

	return '<li ><a class="'+Style+'" href="'+Link+'" '+LinkTarget+'>'+in_Title+'</a>'+in_MenuRowPopup+'</li>';
}
function StartSubMenu(in_Width, in_LeftOffset, in_YOffset)
{
	// in_LeftOffset is optional
	if (typeof in_YOffset == "undefined")
		in_YOffset = SubMenuYOffset;
	else
		in_YOffset = in_YOffset + "px";

	SubRowNum = 0;
	return '<div><div style="width:'+in_Width+'px;top:'+in_YOffset+';left:'+in_LeftOffset+'px;"><ul style="">';
}
function EndSubMenu()
{
	return '</ul></div></div>';
}

//
// Display popup menu if not AOL Mac
//
IsAolMac = false;
Browser = navigator.userAgent;
if ((Browser.indexOf("Macintosh") != -1) && (Browser.indexOf("AOL") != -1))
	IsAolMac = true;
IsAolMac = false;

MenuTabHeight = 36;
FullMenuWidth = 765;
	
if (IsAolMac)
{	
	document.write(StaticNavMenu);
}
else
{

	//background-image:url(mainnav.gif);
	document.write('<div><div><div style="display:none;width:'+ FullMenuWidth +';padding:0;margin:0;border:0;"><ul id="imenus0" style="width:'+ FullMenuWidth +'px">');

	// What's New
	Menu = StartMenu('Whats New', 101, MenuTabHeight, '/whats_new/', 169, 1);
//function StartMenu(in_MenuName, in_Width, in_Height, in_Link, in_MenuRowWidth, in_LeftOffset)
//Menu += MenuRow('Economic Loan Deferment - 20/220 Pathway', '/whats_new/index.html', '');
//Menu += MenuRow('Leadership Opportunities for Residents', '/resident/leader_opps.html', '');
//Menu += MenuRow('International Elective Award', '/funding_awards/intertravelgrant-form.html', '');
//Menu += MenuRow('New Product Offered to All Residents', '/whats_new/index.html', '');
//Menu += MenuRow('Residents Respond about Their Adolescent Training', '/whats_new/index.html', '');
//Menu += MenuRow('Starting in Practice Handbook: Getting Started', 'http://practice.aap.org/specialfeatures/startinginpractice.aspx', '');
//Menu += MenuRow('FDA tobacco bill resident advocacy', '/whats_new/index.html', '');
//Menu += MenuRow('Med-Peds Newsletter', '/MPStudentNewsletterApril2008.doc', '');
	Menu += EndMenu();

	// AAP Resident Section
	SubMenuWidth = 130;
	Menu += StartMenu('Resident Section', 112, MenuTabHeight, '/resident/', 176);

	Menu += MenuRow('Introduction', '/resident/index.html', '');
	Menu += MenuRow('Letter From Chair ', '/index.html', '');
	Menu += MenuRow('Current SOMSRFT Section Leaders', '/resident/section_leaders.html', '');
	Menu += MenuRow('Current SOMSRFT Section Liaisons', '/resident/section_liaisons.html', '');
	Menu += MenuRow('Open Leadership Opportunities', '/resident/leader_opps.html', '');
	Menu += MenuRow('Resident District Web Pages', '/resident/district_webpages.html', '');
	Menu += MenuRow('Program Delegate Information', '/resident/delegate_info.html', '');
	Menu += MenuRow('Section Policy Involvement', '/resident/policy_involvement.html', '');
	Menu += MenuRow('Chief Resident Resources', '/resident/chief_listserv.html', '');
	Menu += MenuRow('Residents as Teachers/Leaders', '/resident/resident_teachers.html', '');
	Menu += MenuRow('Leadership Resources', '/resident/leadership_resources.html', '');
		
	Menu += EndMenu();
	

	// Newsletters
	Menu += StartMenu('Newsletters', 101, MenuTabHeight, '/newsletters/', 187);

	Menu += MenuRow('Resident Report', '/newsletters/', '');
	Menu += MenuRow('Resident District Newsletters', '/newsletters/district_newsletters.html', '');
	Menu += MenuRow('Young Physician Section Newsletter', '/../yp/aap_yp/newsletters.html', '');
	Menu += MenuRow('Community Pediatrics Training Initiative Newsletter', 'http://www.aap.org/commpeds/CPTI/newsletter.htm', '');

	Menu += EndMenu();
	


	// Funding and awards
	Menu += StartMenu('Funding_Awards', 91, MenuTabHeight, '/funding_awards/', 192);

	Menu += MenuRow('Summary of Funding and Awards', '/funding_awards/', '');
	Menu += MenuRow('NCE Program Delegate Award', '/funding_awards/nce.html', '');
	Menu += MenuRow('International Elective Award', '/funding_awards/international_travel.html', '');
	Menu += MenuRow('CATCH Grants', '/funding_awards/catch.html', '');
	Menu += MenuRow('Resident Research Grants', '/funding_awards/research_grants.html', '');
	Menu += MenuRow('Residency Scholarships', '/funding_awards/res_scholarships.html', '');
	Menu += MenuRow('Anne E. Dyson Child Advocacy Award', '/funding_awards/anne_dyson.html', '');
	Menu += MenuRow('Clinical Case Presentations', '/funding_awards/clinical_case_pres.html', '');
		Menu += MenuRow('Legislative Conference Scholarships', '/funding_awards/leg_conf_scholarships.html', '');
	Menu += MenuRow('Resident Initiative Fund', '/funding_awards/res_initiative.html', '');
	


	Menu += EndMenu();

	// Meetings & Events
	Menu += StartMenuNoRows('Meetings & Events', 87, MenuTabHeight, '/meetings_events/', 180);
	//Menu += EndMenu();

	// Advocacy
	MenuWidth = 154;
	SubMenuWidth = 164;
	Menu += StartMenu('Advocacy', 85, MenuTabHeight, '/advocacy/', (MenuWidth+3));

	
		
	SubMenu = StartSubMenu(SubMenuWidth, MenuWidth);
	SubMenu += SubMenuRow('AAP & SOMSRFT Advocacy', '/advocacy/');
	SubMenu += SubMenuRow('International Travel Grants', '/funding_awards/international_travel.html');
	SubMenu += SubMenuRow('State and Chapter Advocacy', '/advocacy/advocacy_resources.html');
	SubMenu += SubMenuRow('Department of Federal Affairs Overview', '/advocacy/dept_federal_affairs.html');
	SubMenu += SubMenuRow('Private Payer Advocacy', '/advocacy/private_pay.html');
	SubMenu += EndSubMenu();
	Menu += MenuRow('Getting Involved', '/advocacy/', SubMenu);
	
	
	SubMenu = StartSubMenu(SubMenuWidth, MenuWidth);
	SubMenu += SubMenuRow('Starting an Advocacy Project', '/advocacy/advocacy_project.html', '');
	SubMenu += SubMenuRow('Talking with Your Legislator', '/advocacy/talk_legislator.html', '');
	SubMenu += SubMenuRow('How Does a Bill Become Law?', '/advocacy/bill_law.html', '');
	SubMenu += SubMenuRow('IRB: What, When, and Where', '/advocacy/irb.html', '');
	SubMenu += EndSubMenu();

	Menu += MenuRow('The Basics - Getting Started', '/advocacy/advocacy_project.html', SubMenu);
	
	SubMenu = StartSubMenu(SubMenuWidth, MenuWidth);
	SubMenu += SubMenuRow('Child Advocate in 5 Minutes', '/advocacy/become_child_advocate.html', '');
	SubMenu += SubMenuRow('Voter Registration', '/advocacy/voter_registration.html', '');
	SubMenu += SubMenuRow('Washington Intern Elective', '/advocacy/wash_intern.html', '');
	SubMenu += SubMenuRow('Additional Opportunities', '/advocacy/additional_opps.html', '');
	SubMenu += SubMenuRow('Additional Resources', '/advocacy/additional_resources.html', '');
	SubMenu += EndSubMenu();

	Menu += MenuRow('Advocacy Resources', '/advocacy/become_child_advocate.html', SubMenu);
	
		Menu += EndMenu();

	// Education
	MenuWidth = 94;
	SubMenuWidth = 120;
	Menu += StartMenu('Education', 89, MenuTabHeight, '/education/', 177);

	Menu += MenuRow('National Conference & Exhibition (NCE)', '/education/', '');
	Menu += MenuRow('Residency Requirements', '/education/res_requirements.html', '');
	Menu += MenuRow('Educational Resources', '/education/resources.html', '');
	
	
	Menu += EndMenu();

	// Life after residency
	MenuWidth = 94;
	SubMenuWidth = 120;
	Menu += StartMenu('Life After Training', 94, MenuTabHeight, '/life_after/', 132, -36);
	Menu += MenuRow('AAP After Residency', '/life_after/aap_afterresidency.html', '');

	Menu += MenuRow('Section on Young Physicians', 'http://www.aap.org/ypn/yp/aap_yp/yp_benefits.html', '');
	Menu += MenuRow('Career Management', '/life_after/', '');
	Menu += MenuRow('Pediatric Fellowships', '/life_after/ped_fellowships.html', '');
	Menu += MenuRow('Special Interest Careers in Pediatrics', '/life_after/alt_careers.html', '');
	Menu += MenuRow('Starting in Practice', '/life_after/starting_practice.html', '');
	Menu += MenuRow('Financial Planning', '/life_after/fin_planning.html', '');
	Menu += MenuRow('Work/Life Balance', '/life_after/worklifebalance.html', '');
	Menu += MenuRow('AAP Section Websites', '/life_after/section_homepages.html', '');
	Menu += MenuRow('AAP Chapter Websites', '/life_after/chapter_webpages.html', '');
	Menu += MenuRow('PedsJobs', 'http://www.pedjobs.org/', '');
	Menu += EndMenu();

document.write(Menu+'</ul><div style="clear:left;"></div></div></div></div>');

/*

     Tips & Tricks

       1: Adjust the "function menudata0()" numeric id in the statement below to match the numeric id of
        the id='imenus0' statement within the menu structure and links secion above. The numbers must 
        match for the menu to work, multiple menus may be used on a single page by adding new sections 
        with new id's.

       2: To specifically define settings for an individual item or container, apply classes or inline styles
        directly to the UL and A tags in the HTML tags which define your menus structure and links above.

       3: Use the parameter options below to define borders and padding. Borders and padding specified
        within the menus HTML structure may cause positioning and actual sizing to be offset a bit in
        some browsers.
 
*/




/*-------------------------------------------------
************* Parameter Settings ******************
---------------------------------------------------*/


function imenus_data0(){


	this.enable_visual_design_mode = false			//turns the visual design pad option on or off
	this.main_is_horizontal = true
	this.menu_showhide_delay = 220;//180


  /*---------------------------------------------
  Expand Icon Images
  ---------------------------------------------*/

	this.main_expand_image = ""
	this.main_expand_image_hover = ""
	this.main_expand_image_width = ""
	this.main_expand_image_height = ""
	this.main_expand_image_offx = ""
	this.main_expand_image_offy = ""

	this.sub_expand_image = SiteRootFolder+"/shared/arrow_sub.gif"
	this.sub_expand_image_hover = SiteRootFolder+"/shared/arrow_sub.gif"
	this.sub_expand_image_width = "10"
	this.sub_expand_image_height = "13"
	this.sub_expand_image_offx = "0"
	this.sub_expand_image_offy = "0"



  /*---------------------------------------------
  Global Menu Styles
  ---------------------------------------------*/

	//Main Menu
//background-color:#06437d; 
	this.main_container_styles = "border-style:solid; border-color:#769bba; border-width:1px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; "
	this.main_item_styles = "background-color:; background-image:; color:#e6e6e6; text-align:center; font-family:Arial; font-size:12px; font-weight:bold; text-decoration:none; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; border-style:none; border-color:#000000; border-width:0px;"
	this.main_item_hover_styles = "color:#FAF4E5; "
	this.main_item_active_styles = ""



	//Sub Menu
//background-color:#F6F0D4;
	this.subs_container_styles = "background-color:#F6F0D4;border-style:solid; border-color: #E2CD98; border-width:1px 1px 1px 1px; padding-top:0px; padding-right:0px; padding-bottom:6px; padding-left:0px; margin-left:1px;"
	this.subs_item_styles = "background-color:#F6F0D4; color:#937353; text-align:left; font-family:arial; font-size:10px; font-weight:normal; text-decoration:none; padding-top:3px; padding-right:1px; padding-bottom:3px; padding-left:7px; margin:0"
	this.subs_item_hover_styles = "background-color:#7d5e00;font-weight:;text-decoration:;"
	this.subs_item_active_styles = "background-color:#7d5e00; color:#FAF4E5; font-weight:; text-decoration:;"




}

} // end if IsAolMac
