var currentMenuImage = new String;
var in_what_is_apligraf_page = new RegExp(".*?what_is_apligraf\.html"),
    in_what_is_apligraf_path = new RegExp(".*?what_is_apligraf\\.*"),
    in_how_apligraf_works_page = new RegExp(".*?how_apligraf_works\.html"),
    in_how_works_path = new RegExp(".*?how_works\\.*"),
	in_the_science_behind_apligraf_page = new RegExp(".*?the_science_behind_apligraf\.html"),
	in_clinical_experience_page = new RegExp(".*?clinical_experience\.html"),
	in_how_is_apligraf_applied_page = new RegExp(".*?how_is_apligraf_applied\.html"),
	in_after_care_page = new RegExp(".*?after_care\.html"),
	in_safety_information_page = new RegExp(".*?safety_information\.html"),	
	in_which_wounds_page = new RegExp(".*?which_wounds\.html"),
    in_what_wounds_path = new RegExp(".*?what_wounds\\.*"),
	in_learn_about_diabetic_foot_sores_page = new RegExp(".*?learn_about_diabetic_foot_sores\.html"),
	in_learn_about_venous_leg_sores_page = new RegExp(".*?learn_about_venous_leg_sores\.html"),
	in_how_does_apligraf_compare_page = new RegExp(".*?how_does_apligraf_compare\.html"),
	in_find_apligraf_page = new RegExp(".*?find_apligraf\.html"),
    in_findapligraf_path = new RegExp(".*?findapligraf\\.*"),
	in_questions_page = new RegExp(".*?questions\.html"),
	in_form_how_to_find_page = new RegExp(".*?form_how_to_find\.html"),
	in_download_brochure_page = new RegExp(".*?download_brochure\.html"),
	in_insurance_coverage_page = new RegExp(".*?insurance_coverage\.html"),
	in_insurance_path = new RegExp(".*?insurance\\.*"),
	in_patient_assistance_program_page = new RegExp(".*?patient_assistance_program\.html"),
	in_wound_facts_page = new RegExp(".*?wound_facts\.html"),
	in_wound_path = new RegExp(".*?\/wound\/.*"),
	in_taking_care_page = new RegExp(".*?taking_care\.html"),
	in_hear_from_others_page = new RegExp(".*?hear_from_others\.html"),
	in_read_path = new RegExp(".*?\/read\/.*"),
	in_apligraf_user_stories_page = new RegExp(".*?apligraf_user_stories\.html"),
	in_form_share_your_story_page = new RegExp(".*?form_share_your_story\.html"),
	in_contact_path = new RegExp(".*?\/contact\/.*"),
	in_contact_us_page = new RegExp(".*?contact_us\.html"),
	in_form_signup_for_info_page = new RegExp(".*?form_signup_for_info\.html"),
	in_form_website_feedback_page = new RegExp(".*?form_website_feedback\.html"),
	in_support_path = new RegExp(".*?\/support\/.*"),
	in_support_and_resources_page = new RegExp(".*?support_and_resources\.html"),
	in_diabetes_links_page = new RegExp(".*?diabetes_links\.html"),
	in_venous_leg_links_page = new RegExp(".*?venous_leg_links\.html"),
	in_prescribing_info_page = new RegExp(".*?prescribing_info\.html"),
	in_faqs_page = new RegExp(".*?faqs\.html"),
	in_form_tell_a_friend_page = new RegExp(".*?form_tell_a_friend\.html")
    ;

function configureMenu(imageID,imagePath) {
	MM_swapImage(imageID,'',imagePath,1);
	currentMenuImage=imageID;
}

function prepareIt(){
 	var myHref = top.location.href;
	
	//These Menu Items  are always shown
	if (myHref.match(in_what_is_apligraf_page)) { configureMenu('Image411','/patient/images/drilldown/drilldown01_02_ro.gif'); }
	if (myHref.match(in_find_apligraf_page)) { configureMenu('Image421','/patient/images/drilldown/drilldown01_03_ro.gif'); }
	if (myHref.match(in_insurance_coverage_page)) { configureMenu('Image431','/patient/images/drilldown/drilldown01_04_ro.gif'); }
	if (myHref.match(in_wound_facts_page)) { configureMenu('Image441','/patient/images/drilldown/drilldown01_05_ro.gif'); }
	if (myHref.match(in_hear_from_others_page)) { configureMenu('Image451','/patient/images/drilldown/drilldown01_06_ro.gif'); }
	if (myHref.match(in_contact_us_page)) { configureMenu('Image461','/patient/images/drilldown/drilldown01_07_ro.gif'); }
	if (myHref.match(in_support_and_resources_page)) { configureMenu('Image471','/patient/images/drilldown/drilldown01_08_ro.gif'); }
	if (myHref.match(in_form_tell_a_friend_page)) { configureMenu('Image481','/patient/images/drilldown/drilldown01_09_ro.gif'); }	
	
	//End list of Menu Items that are always shown
	
	
	//The following items are only shown if we are in the "what_is_apligraf" path.
	if (myHref.match(in_what_is_apligraf_path)) {
		
		//"What wounds does appligraf treat" menu item is only shown if the path contains "what_is_apligraf"
		if (myHref.match(in_which_wounds_page)) {
						// if the "which_wounds.html" page is selected, then the menu image wil not be rolled-over;
						configureMenu('Image21','/patient/images/drilldown/drilldown02_01_ro.gif');
		} 
		document.getElementById('which_wounds').style.display='';
		
		//"How Apligraf Works" menu item is only shown if the path contains "what_is_apligraf"
		if (myHref.match(in_how_apligraf_works_page)) {
						// if the "which_wounds.html" page is selected, then the menu image wil not be rolled-over;
						configureMenu('Image22','/patient/images/drilldown/drilldown02_02_ro.gif');
		} 
		document.getElementById('how_works').style.display='';
		
		//"how_does_apligraf_compare" menu item is only shown if the path contains "what_is_apligraf"
		if (myHref.match(in_how_does_apligraf_compare_page)) {
						// if the "which_wounds.html" page is selected, then the menu image wil not be rolled-over;
						configureMenu('Image23','/patient/images/drilldown/drilldown02_03_ro.gif');
		} 
		document.getElementById('how_does_apligraf_compare').style.display=''; 
		
		
		//"How is appligraf Applied" menu item is only shown if the path contains "what_is_apligraf"
		if (myHref.match(in_how_is_apligraf_applied_page)) {
						configureMenu('Image24','/patient/images/drilldown/drilldown02_04_ro.gif');
		} 
		document.getElementById('how_is_apligraf_applied').style.display='';
		
   		//"After Care" menu item is only shown if the path contains "what_is_apligraf"
		if (myHref.match(in_after_care_page)) {
						configureMenu('Image25','/patient/images/drilldown/drilldown02_05_ro.gif');
		} 
		document.getElementById('after_care').style.display='';
		
  		//"Safety Information" menu item is only shown if the path contains "what_is_apligraf"
		if (myHref.match(in_safety_information_page)) {
						configureMenu('Image26','/patient/images/drilldown/drilldown02_06_ro.gif');
		} 
		document.getElementById('safety_information').style.display='';
		
		//The following menu items are only shown if we are in the "what_wound" path
		if (myHref.match(in_what_wounds_path)) {
			if (myHref.match(in_learn_about_diabetic_foot_sores_page)) {
							configureMenu('Image27','/patient/images/drilldown/drilldown02a_01_ro.gif');
			}
			document.getElementById('learn_about_diabetic_foot_sores').style.display='';
			
			if (myHref.match(in_learn_about_venous_leg_sores_page)) {
							configureMenu('Image28','/patient/images/drilldown/drilldown02a_02_ro.gif');
			}
			document.getElementById('learn_about_venous_leg_sores').style.display='';
		}

		//The following items are displayed if we are in the "how_works" path
		if (myHref.match(in_how_works_path)) {
			if (myHref.match(in_the_science_behind_apligraf_page)) {
							configureMenu('Image29','/patient/images/drilldown/drilldown02b_01_ro.gif');
			}
			document.getElementById('the_science_behind_apligraf').style.display='';
			
			if (myHref.match(in_clinical_experience_page)) {
							configureMenu('Image30','/patient/images/drilldown/drilldown02b_02_ro.gif');
			}
			document.getElementById('clinical_experience').style.display='';
		}

	}
	else {document.getElementById('which_wounds').style.display='none';}
	
	
	//The following items are only shown if we are in the "findapligraf" path.
	if (myHref.match(in_findapligraf_path)) {
		if (myHref.match(in_questions_page)) {
						configureMenu('Image31','/patient/images/drilldown/drilldown03_01_ro.gif');
		} 
		document.getElementById('questions').style.display='';
		
		if (myHref.match(in_form_how_to_find_page)) {
						configureMenu('Image32','/patient/images/drilldown/drilldown03_02_ro.gif');
		} 
		document.getElementById('form_how_to_find').style.display='';	
		
		if (myHref.match(in_download_brochure_page)) {
						configureMenu('Image33','/patient/images/drilldown/drilldown03_03_ro.gif');
		} 
		document.getElementById('download_brochure').style.display='';	
	} //End-if block for The following items are only shown if we are in the "findapligraf" path.
	
	//The following items are only shown if we are in the "insurance" path.
	if (myHref.match(in_insurance_path)) {
		if (myHref.match(in_patient_assistance_program_page)) {
						configureMenu('Image34','/patient/images/drilldown/drilldown04_01_ro.gif');
		} 
		document.getElementById('patient_assistance_program').style.display='';	
	} //End-if block for The following items are only shown if we are in the "insurance" path.
	
	//The following items are only shown if we are in the "wound" path. 
	if (myHref.match(in_wound_path)) {
		document.getElementById('wound_learn_about_diabetic_foot_sores').style.display='';	// This one when clicked resets the menu to the place above where it also apperas
		document.getElementById('wound_learn_about_venous_leg_sores').style.display='';	// This one when clicked resets the menu to the place above where it also apperas
		if (myHref.match(in_taking_care_page)) {
						configureMenu('Image37','/patient/images/drilldown/drilldown05_03_ro.gif');
		} document.getElementById('taking_care').style.display='';	
	} //End-if block for The following items are only shown if we are in the "wound" path.
	
	//The following items are only shown if we are in the "read" path.
	if (myHref.match(in_read_path)) {
		if (myHref.match(in_apligraf_user_stories_page)) {
						configureMenu('Image39','/patient/images/drilldown/drilldown06_01_ro.gif');
		} 
		document.getElementById('apligraf_user_stories').style.display='';
		if (myHref.match(in_form_share_your_story_page)) {
						configureMenu('Image40','/patient/images/drilldown/drilldown06_02_ro.gif');
		} 
		document.getElementById('form_share_your_story').style.display='';
		
	} //End-if block for The following items are only shown if we are in the "read" path.
	
	//The following items are only shown if we are in the "contact" path.
	if (myHref.match(in_contact_path)) {
		if (myHref.match(in_form_signup_for_info_page)) {
						configureMenu('Image49','/patient/images/drilldown/drilldown07_01_ro.gif');
		} 
		document.getElementById('form_signup_for_info').style.display='';
		if (myHref.match(in_form_website_feedback_page)) {
						configureMenu('Image50','/patient/images/drilldown/drilldown07_02_ro.gif');
		} 
		document.getElementById('form_website_feedback').style.display='';
		
	} //End-if block for The following items are only shown if we are in the "contact" path.
	
		//The following items are only shown if we are in the "support" path.
	if (myHref.match(in_support_path)) {
		if (myHref.match(in_diabetes_links_page)) {
						configureMenu('Image51','/patient/images/drilldown/drilldown08_01_ro.gif');
		} 
		document.getElementById('diabetes_links').style.display='';
		
		if (myHref.match(in_venous_leg_links_page)) {
						configureMenu('Image52','/patient/images/drilldown/drilldown08_02_ro.gif');
		} 
		document.getElementById('venous_leg_links').style.display='';
		
		if (myHref.match(in_prescribing_info_page)) {
						configureMenu('Image531','/patient/images/drilldown/drilldown08_02a_ro.gif');
		} 
		document.getElementById('prescribing_info').style.display='';
		
		document.getElementById('support_download_brochure').style.display='';
		
		if (myHref.match(in_faqs_page)) {
						configureMenu('Image54','/patient/images/drilldown/drilldown08_04_ro.gif');
		} 
		document.getElementById('faqs').style.display='';
		
		
	} //End-if block for The following items are only shown if we are in the "support" path.
	
}

