var pathn = parent.location.pathname;
var menu = "";
if(pathn.indexOf('\\') != -1){
	div = "\\";
}else{
	div = "/";
}

function life_genhead(){
	if(pathn.indexOf(div + 'child' + div) != -1){	
		var fol  = "Child";
		var img = "../../../images/health_info/baby_icon.gif";		
		var dot = "o";		
		life_genchild(fol,img,dot);	
	}
	if(pathn.indexOf(div + 'woman' + div) != -1){
		var fol  = "Woman";
		var img = "../../../images/health_info/woman_icon.gif";
		var dot = "p";
		life_genwoman(fol,img,dot);	
	}	
}

function life_genchild(fol,img,dot){	
	if(pathn.indexOf(div + 'child_bfm') != -1){
		all_pages = new Array('_parenting','_newborn','_breastfeeding','_nutrition','_home','_oral','_smoking','_information','_child','_hearing');
		page_name = new Array('Parenting at early baby\'s life','Newborn care','Breastfeeding','Nutrition','Home safety','Oral Health','Smoking and health','Immunisation - Information for Parents','Child development','Hearing and vision');
		sel = "child_bfm";
		alt = "Infancy (Birth to First Month)";
	}

	if(pathn.indexOf(div + 'child_otm') != -1){
		all_pages = new Array('_parenting','_breastfeeding','_nutrition','_home','_oral','_quit','_information','_child','_hearing');
		page_name = new Array('Parenting','Breastfeeding','Nutrition','Home safety','Oral Health','Smoking and health','Immunisation - Information for Parents','Child development','Hearing and vision');
		sel = "child_otm";
		alt = "Infancy (One to Twelve Months)";
	}

	if(pathn.indexOf(div + 'child_oty') != -1){
		all_pages = new Array('_parenting','_breastfeeding','_nutrition','_home','_oral','_quit','_information','_child');
		page_name = new Array('Parenting','Breastfeeding','Nutrition','Home safety','Oral Health','Smoking and health','Immunisation - Information for Parents','Child development');
		sel = "child_oty";
		alt = "Toddlerhood (One to Three Years)";
	}

	if(pathn.indexOf(div + 'child_tsy') != -1){
		all_pages = new Array('_parenting','_nutrition','_home','_oral','_quit','_child','_vision');
		page_name = new Array('Parenting','Nutrition','Home safety','Oral Health','Smoking and health','Child development','Vision');
		sel = "child_tsy";
		alt = "Pre-school Age (Three to Six Years)";
	}

	count = all_pages.length;	
	for(i=0;i<count;i++){		
		if(pathn.indexOf(div + sel + all_pages[i]) != -1){
			menu += '<option value="'+sel + all_pages[i]+'.html" selected>'+ page_name[i] +'</option>';
			subalt = page_name[i];
		}else{
			menu += '<option value="'+sel + all_pages[i]+'.html">'+ page_name[i] +'</option>';		
		}		
	}
	
	life_gentable(fol,img,dot,alt,menu,subalt);
}


function life_genwoman(fol,img,dot){
	if(pathn.indexOf(div + 'woman_ayamw') != -1){
		all_pages = new Array('_sexual','_breast','_cervical','_family','_menstrual','_stress','_healthy','_exercise','_weight','_quit','_ure');
		page_name = new Array('Sexual health','Breast Awareness','Cervical screening','Family Planning and Infertility','Menstrual disorders','Stress and emotional problems','Healthy diet and nutrition','Exercise','Weight management','Smoking and health','Urethritis');
		//all_pages = new Array('_menstrual','_vulval','_sexual','_contrace','_termination','_safe','_breast','_cervical','_infertility','_stress','_healthy','_exercise','_weight','_quit');
		//page_name = new Array('Menstrual disorders','Vulval care and hygiene','Sexual health: Preparation for your sex life','Contraceptive methods','Termination of pregnancy','Safe sex - prevent sexually transmitted diseases','Breast awareness','Cervical cancer screening','Infertility','Stress and emotional problems','Healthy diet and nutrition','Exercise','Weight management','Smoking and health');
		sel = "woman_ayamw";
		alt = "Adolescence and Young Adulthood";
	}

	if(pathn.indexOf(div + 'woman_pwwp') != -1){
		all_pages = new Array('_sexual','_breast','_cervical','_family','_information','_minor','_nutritional','_oral','_quit','_miscarriage','_eap','_pcfp','_epp','_breastfeeding','_routine','_prenatal','_down','_thalassaemia','_hiv','_stress','_preparation','_pmd','_weight','_ure','_pelvic');
		page_name = new Array('Sexual health','Breast Awareness','Cervical screening','Family Planning','Information for pregnant women','Minor ailments in pregnancy and their management','Nutritional advice to pregnant and lactating mothers','Oral health','Quit smoking of pregnant women and second hand smoking','Miscarriage and management of miscarriage','Exercise in antenatal period','Postnatal care and family planning','Exercise in postnatal period','Breastfeeding','Routine blood test','Prenatal diagnostic screening: What do you know?','Down Syndrome screening','Thalassaemia screening','HIV Screening','Stress and emotional problems','Preparation for your newborn','Postnatal mood disorders','Weight management','Urethritis','Pelvic Floor Exercise');
		//all_pages = new Array('_sexual','_vulval','_contrace','_breast','_cervical','_information','_minor','_nutritional','_oral','_quit','_miscarriage','_eap','_pcfp','_epp','_breastfeeding','_routine','_prenatal','_down','_thalassaemia','_hiv','_stress','_preparation','_pmd','_weight');
		//page_name = new Array('Sexual health: From pregnancy to puerperium','Vulval care and hygiene','Contraceptive methods','Breast awareness','Cervical cancer screening','Information for pregnant women','Minor ailments in pregnancy and their management','Nutritional advice to pregnant and lactating mothers','Oral health','Quit smoking of pregnant women and second hand smoking','Miscarriage and management of miscarriage','Exercise in antenatal period','Postnatal care and family planning','Exercise in postnatal period','Breastfeeding','Routine blood test','Prenatal diagnostic screening: What do you know?','Down Syndrome screening','Thalassaemia screening','HIV Screening','Stress and emotional problems','Preparation for your newborn','Postnatal mood disorders','Weight management');
		sel = "woman_pwwp";
		alt = "Pregnancy and Puerperium";
	}

	if(pathn.indexOf(div + 'woman_wm') != -1){
		all_pages = new Array('_sexual','_breast','_cervical','_family','_menstrual','_stress','_healthy','_exercise','_weight','_osteoporosis','_quit','_ure','_pelvic','_menopause');
		page_name = new Array('Sexual health','Breast Awareness','Cervical screening','Family Planning','Menstrual disorders','Stress and emotional problems','Healthy diet and nutrition','Exercise','Weight management ','Osteoporosis','Smoking and health','Urethritis','Pelvic Floor Exercise','Menopause');
		//all_pages = new Array('_menstrual','_menopause','_sexual','_safe','_vulval','_contrace','_breast','_cervical','_stress','_healthy','_exercise','_weight','_osteoporosis','_quit');
		//page_name = new Array('Menstrual disorders','Menopause','Sexual health: Sex life in menopause','Safe sex - prevent sexually transmitted diseases','Vulval care and hygiene','Contraceptive methods','Breast awareness','Cervical cancer screening','Stress and emotional problems','Healthy diet and nutrition','Exercise','Weight management ','Osteoporosis','Smoking and health');
		sel = "woman_wm";
		alt = "Middle-age";
	}

	count = all_pages.length;
	for(i=0;i<count;i++){		
		if(pathn.indexOf(div + sel + all_pages[i]) != -1){
			menu += '<option value="'+sel + all_pages[i]+'.html" selected>'+ page_name[i] +'</option>';
			subalt = page_name[i];			
		}else{
			menu += '<option value="'+sel + all_pages[i]+'.html">'+ page_name[i] +'</option>';
		}		
	}

	life_gentable(fol,img,dot,alt,menu,subalt);
}



function life_gentable(fol,img,dot,alt,menu,subalt){
	
	if(fol == "Child"){		
		document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
        '<tr> '+
          '<td width="40"><img src="'+img+'"></td>'+
          '<td class="hd_'+fol+'">'+fol+' <br><span class="subhd_'+fol+'"> '+alt +'</span></td>'+
			'<form name="form1" method="post" action="">'+
			'<td align="right">'+
             ' <select name="menu1" onChange="MM_jumpMenu(\'parent\',this,0)" class="body">'
                +menu+
			'</select>'+         
          '</td>'+
			'</form>'+
        '</tr>');
		
	}else if(fol == "Woman"){
		
		document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
        '<tr> '+
          '<td width="40"><img src="'+img+'"></td>'+
          '<td class="hd_'+fol+'" width="480">'+fol+' <br><span class="subhd_'+fol+'">'+alt +'</span></td>'+			
			'<td align="right">&nbsp;</td>'+
			'</tr>'+			
			'<tr>'+
			'<form name="form1" method="post" action="">'+
				'<td colspan="3" align="right">'+
             ' <select name="menu1" onChange="MM_jumpMenu(\'parent\',this,0)" class="body">'
                +menu+
			'</select>'+         
          '</td>'+
		'</form>'+
        '</tr>');
		
	}
		
       document.write('<tr> '+ 
          '<td width="40">&nbsp;</td>'+ 
		  '<td colspan="2" class="subhd_'+fol+'"><br><img src="../../../images/general/hd_dot_'+dot+'.gif" width="21" height="21" align="absmiddle">'+subalt );
		
		if(vcdlink != ""){
			if(fol == "Child"){
				document.write(' <a href="'+vcdlink+'" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'vcd1\',\'\',\'../../../images/health_info/vcd_over.gif\',1)"><img src="../../../images/health_info/vcd.gif" border="0" alt="VCD" hspace="10" align="absmiddle" name="vcd1"></a>');
			}else if(fol == "Woman"){
				document.write(' <a href="'+vcdlink+'" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'vcd1\',\'\',\'../../../images/health_info/vcd_over2.gif\',1)"><img src="../../../images/health_info/vcd2.gif" border="0" alt="VCD" hspace="10" align="absmiddle" name="vcd1"></a>');
			}
		}


	   document.write('</td>'+ 
        '</tr>'+ 
		'<tr> '+ 
          '<td colspan="3" background="../../../images/general/dot_'+dot+'.gif"><img src="../../../images/general/spacer.gif" width="1" height="6"></td>'+ 
        '</tr>'+ 
      '</table>');	 		
}