// this must be an absolute link to this section!
var SiteRootFolder = "http://www.aap.org/sections/ypn/yp"; // aap production server
// var SiteRootFolder = "http://dev1.aap.org/sections/ypn/yp"; // aap development server
// var SiteRootFolder = "/aap_r/yp"; // eo server

var RowNum = 0;
var SubRowNum = 0;

var StaticNavMenu = '';
var SubMenuYOffset = "-19px"; 
var MenuYOffset = "0px";
/*
var StaticNavMenu = '<img width="599" height="26" src="'+SiteRootFolder+'/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;

MenuTabHeight = 36;
FullMenuWidth = 765;

IsAolMac = false;

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
	MenuWidth = 120; //124
	Menu = StartMenu('Whats New', 107, MenuTabHeight, '/whats_new/index.html', (MenuWidth+3), 1);
//Menu += MenuRow('Call for Nominations to the Pedialink Editorial Board','/whats_new/08pedialinkcall.pdf', '');
//Menu += MenuRow('Economic Loan Deferment - 20/220 Pathway','/whats_new/index.html', '');
	//Menu += MenuRow('Young Physicians Guide','http://www.aap.org/moc/memberships/section/youngphys/ypguide.htm', '');
	//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','http://aap.grassroots.com/fdatobacco/', '');
	//Menu += MenuRow('New Section Leadership','/aap_yp/contact.html', '');
	//Menu += MenuRow('YPConnection','/ypconnectionhome.html', '');
	Menu += EndMenu();
//function StartMenu(in_MenuName, in_Width, in_Height, in_Link, in_MenuRowWidth, in_LeftOffset)

	//Menu += MenuRow('Pediatric Essay Contest', '/whats_new/ethicsessaycontestflyer2007.pdf', '');


	// AAP/YP Section 
	MenuWidth = 100;
	SubMenuWidth = 130;
	Menu += StartMenu('AAP_YP', 81, MenuTabHeight, '/aap_yp/', (MenuWidth+3));

	
		
	SubMenu = StartSubMenu(SubMenuWidth+34, MenuWidth);
	SubMenu += SubMenuRow('Goals &amp; Objectives', '/aap_yp/');
	SubMenu += SubMenuRow('SOYP Newsletters', '/aap_yp/newsletters.html');
	SubMenu += SubMenuRow('Contact Your Section\'s Leaders', '/aap_yp/contact.html');
	SubMenu += SubMenuRow('Listserv', '/aap_yp/listserv.html');
	SubMenu += SubMenuRow('Section Benefits', '/aap_yp/yp_benefits.html');
	SubMenu += SubMenuRow('Join the SOYP', '/aap_yp/join.html');
	SubMenu += EndSubMenu();
	Menu += MenuRow('About the SOYP', '/aap_yp/aap_profile.html', SubMenu);
	
	
	SubMenu = StartSubMenu(SubMenuWidth, MenuWidth);
	SubMenu += SubMenuRow('YP Guide to the AAP', '/aap_yp/aap_ypguide.html', '');
	SubMenu += SubMenuRow('AAP Structure', '/aap_yp/aap_structure.html', '');
	SubMenu += SubMenuRow('AAP Fact Sheet', '/aap_yp/aap_fact_sheet.html', '');
	SubMenu += SubMenuRow('How to Contact the AAP', 'http://www.aap.org/visit/contact.htm', '');
	SubMenu += SubMenuRow('AAP Strategic Plan', '/aap_yp/aap_strategic_plan.html', '');
	SubMenu += SubMenuRow('AAP Benefits', '/aap_yp/aap_benefits.html', '');
	SubMenu += EndSubMenu();

	Menu += MenuRow('About the AAP', '/aap_yp/aap_profile.html', SubMenu);
	
	Menu += EndMenu();
	

	// Getting Involved
	Menu += StartMenu('Getting Involved', 86, MenuTabHeight, '/getting_involved/', 187);

	Menu += MenuRow('YPConnection', '/ypconnectionhome.html', '');
	Menu += MenuRow('AAP Sections &amp; Councils', '/getting_involved/', '');
	Menu += MenuRow('AAP Committees', '/getting_involved/aap_committees.html', '');
	Menu += MenuRow('Your AAP Chapter', '/getting_involved/aap_chapter.html', '');
	Menu += MenuRow('PREP', '/getting_involved/prep.html', '');
	Menu += MenuRow('Grand Rounds Contributing Author', '/getting_involved/grand_rounds.html', '');
	Menu += MenuRow('YP Section Executive Committee Positions', '/getting_involved/positions.html', '');
	Menu += MenuRow('AMA/YP Section', '/getting_involved/ama_yp_section.html', '');
	Menu += MenuRow('Section Nominating Committee', '/getting_involved/nom_committee.html', '');

	Menu += EndMenu();
	


	// Education
	Menu += StartMenu('Education', 93, MenuTabHeight, '/education/', 173);

	Menu += MenuRow('Pedialink', '/education/', '');
	Menu += MenuRow('Other AAP CME (via Pedialink)', '/education/aap_cme.html', '');
	Menu += MenuRow('National Conference & Exhibition', '/education/nce.html', '');
	Menu += MenuRow('GME/Workforce', '/education/gme_workforce.html', '');
	Menu += MenuRow('PMCP', '/education/pmcp.html', '');
	Menu += MenuRow('Media Training', '/education/media_training.html', '');
	Menu += MenuRow('eQIPP', '/education/eqipp.html', '');
	Menu += MenuRow('Proposal Writing', '/education/proposal_writing.html', '');
	Menu += MenuRow('Pediatrics in Review', '/education/peds_review.html', '');
	Menu += MenuRow('Mentor Education Model', '/education/mentor_model.html', '');


	Menu += EndMenu();

	// Work/Life Balance
	MenuWidth = 126;
	Menu += StartMenu('Work/Life Balance', 94, MenuTabHeight, '/work_life_balance/', 180);

	Menu += MenuRow('Your Well-Being', '/work_life_balance/', '');
	Menu += MenuRow('Part-Time Employment Resources', '/work_life_balance/part_time_employ.html', '');
	Menu += MenuRow('Women in Pediatrics', '/work_life_balance/wip.html', '');
	
	Menu += EndMenu();

	// Practice Management
	MenuWidth = 137;
	Menu += StartMenu('Practice Management', 114, MenuTabHeight, '/practice_management/', 170);
	
	Menu += MenuRow('Practice Management Online', '/practice_management/', '');
	Menu += MenuRow('Medical Liability', '/practice_management/med_liability.html', '');
	Menu += MenuRow('Policy Statements and Pediatric Guidelines', '/practice_management/policy.html', '');
	Menu += MenuRow('Coding for Pediatrics', '/practice_management/coding.html', '');
	Menu += MenuRow('Quality Improvement', '/practice_management/quality.html', '');
	
	Menu += EndMenu();

	// Child Advocacy
	MenuWidth = 94;
	SubMenuWidth = 120;
	Menu += StartMenu('Child Advocacy', 89, MenuTabHeight, '/child_advocacy/', 180);

	Menu += MenuRow('CATCH Grants', '/child_advocacy/', '');
	Menu += MenuRow('Child Advocacy State by State', '/child_advocacy/state.html', '');
	Menu += MenuRow('Medical Home Training', '/child_advocacy/medhome_training.html', '');
	Menu += MenuRow('Federal Advocacy Action Network (FAAN)', '/child_advocacy/faan.html', '');
	Menu += MenuRow('Legislative Action Center', '/child_advocacy/leg_center.html', '');
	Menu += MenuRow('Parent Resources', '/child_advocacy/parent_resources.html', '');
	Menu += MenuRow('Access of Children to Healthcare', '/child_advocacy/access_hlthcare.html', '');
	Menu += MenuRow('Child Health Measurement Project', '/child_advocacy/chmp.html', '');
	Menu += MenuRow('Immunization Hot Topics', '/child_advocacy/immunization.html', '');
	Menu += MenuRow('Patient Safety', '/child_advocacy/patient_safety.html', '');
	Menu += MenuRow('10 Tips for Child Advocates', '/child_advocacy/10tips.html', '');

	
	Menu += EndMenu();

	// Other Resources
	MenuWidth = 94;
	SubMenuWidth = 120;
	Menu += StartMenu('Other Resources', 97, MenuTabHeight, '/other_resources/', 160, -62);
Menu += MenuRow('Relocating?', '/relocating/', '');
	Menu += MenuRow('Pediatric Research in Office Settings (PROS)', '/other_resources/', '');
	Menu += MenuRow('Other Section/Council Websites', '/other_resources/other_sections.html', '');
	Menu += MenuRow('AAP Staff Listing', '/other_resources/aap_staff.html', '');
	Menu += MenuRow('Update your Member Information On-Line', '/other_resources/update_member_info.html', '');
	Menu += MenuRow('Get Your Free aap.net email address', '/other_resources/aap_email.html', '');
	Menu += MenuRow('PedJobs', '/other_resources/pedjobs.html', '');
	Menu += MenuRow('YP Guide for AAP Chapters', '/other_resources/chapter_yp_guide.html', '');
	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:#e5f1ff;
	this.subs_container_styles = "background-color:#e5f1ff;border-style:solid; border-color: #b7cbdf; 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:#e5f1ff; color:#59799d; 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:#095EB4;font-weight:;text-decoration:;"
	this.subs_item_active_styles = "background-color:#095EB4; color:#FAF4E5; font-weight:; text-decoration:;"


}

} // end if IsAolMac
