function getRecommendationString(name,percentile,age, dobd, dobm, doby, height, weight, target_url, mode) {

	// recommendation string output mode
	// 0 - no text
	// 1 - recommendation string only
	// 2 - percentile results only
	// 3 - percentile results + buffer page links
	// 4 - buffer page links only

	var recommend = "00000";
	
	var r1 = "0";	// Similac<sup>&reg;</sup> Follow on
	var r2 = "0";	// gain
	var r3 = "0";	// pediasure
	var r4 = "0";	// isomil follow up
	var r5 = "0";	// grow
	
	var hl = "<b>";
	var endhl = "</b>";
	name = trimString(name);

	// percentile - above:2  below:-1
	var p_text = "";
	if (percentile == 2) { p_text = "above"; }
	else if (percentile == -1) { p_text = "below"; }
	
	//  old text disabled for now
	//	var text1 = "<br />"+ name +" is now "+ hl + p_text + endhl + " the 50th percentile for his/her age group. <br /><br />";



	// ----------------------------------------
	// evaluate cases
	var case1 = false;
	var case2 = false;
	var case3 = false;
	var case4 = false;
	var case5 = false;
	var case6 = false;
	var case7 = false;
	
	if (age < 6) {
		// For < 6 months age group
		case1 = true;
	}
	else if (age >= 6 && age <= 12) {
		// For > 6 months, < 1 year age group
		// Above and below 50th percentile
		
		// set recommendation
		r1 = "1";
		
		case2 = true;
	}
	else if (age > 12 && age < 36 && percentile == 2) {
		// For > 1 year, < 3 years age group
		// Above 50th percentile	

		// set recommendation
		r2 = "1";
		
		case3 = true;
	}
	else if (age > 12 && age < 36 && percentile == -1) {
		// For > 1 year, < 3 years age group
		// Below 50th percentile	
		
		// set recommendation
		r3 = "1";
		
		case4 = true;
	}
	else if (age >= 36 && percentile == 2) {
		// For > 3 years age group
		// Above 50th percentile	
		
		// set recommendation
		r5 = "1";
		
		case5 = true;
	}
	else if (age >= 36 && percentile == -1) {
		// For > 3 years age group
		// Below 50th percentile	
		
		// set recommendation
		r3 = "1";
		
		case6 = true;
	}
	
	
	if (age >= 12) {
				
		// set recommendation
		r4 = "1";
		
		case7 = true;
	}
	
	recommend = r1 + r2 + r3 + r4 + r5;

	// ----------------------------------------



	// ----------------------------------------
	// finally, process text	
	var text2 ="";
	if (case1) {
		// For < 6 months age group

		if (mode != 4) {
			text2 = 
			"<br />"+ name +" is now "+ hl + p_text + endhl + " the 50th percentile for the less than 6 months age group.<br />";
		}
		
		if (mode == 2) {
			text2 += 
			"<br />Your child is now less than 6 months old.<br /><br />" +
			"Breast milk is best for babies. The WHO recommends that babies be exclusively breastfed for the first 6 months of life." +
			"<br /><br />";
		}		
	}
	else if (case2) {
		// For > 6 months, < 1 year age group
		// Above and below 50th percentile
		
		if (mode != 4) {
			text2 =
			"<br />"+ name +" is now "+ hl + p_text + endhl + " the 50th percentile for the above 6 months to 1 year age group.<br /><br />" +
			//"<----- copy here ----->" +
			//"<br /><br />";
			"";
		}
		
		if (mode == 3 || mode == 4) {
			text2 += displayBufferPageLinks(1, recommend);
		}
	}
	else if (case3) {
		// For > 1 year, < 3 years age group
		// Above 50th percentile
		
		if (mode != 4) {	
			text2 = 
			"<br />"+ name +" is now "+ hl + p_text + endhl + " the 50th percentile for the 1 to 3 years age group.<br /><br />" +
			//"<----- copy here ----->" +
			//"<br /><br />";
			"";
		}

		if (mode == 3 || mode == 4) {				
			text2 += displayBufferPageLinks(3, recommend);
		}
	}
	else if (case4) {
		// For > 1 year, < 3 years age group
		// Below 50th percentile
		
		if (mode != 4) {	
			text2 = 
			"<br />"+ name +" is now "+ hl + p_text + endhl + " the 50th percentile for the 1 to 3 years age group.<br /><br />" +
			//"<----- copy here ----->" +
			//"<br /><br />";
			"";
		}

		if (mode == 3 || mode == 4) {		
			text2 += displayBufferPageLinks(2, recommend);
		}
	}
	else if (case5) {
		// For > 3 years age group
		// Above 50th percentile
		
		if (mode != 4) {	
			text2 = 
			"<br />"+ name +" is now "+ hl + p_text + endhl + " the 50th percentile for the above 3 years age group.<br /><br />" +
			//"<----- copy here ----->" +
			//"<br /><br />";
			"";
		}
		
		if (mode == 3 || mode == 4) {		
			text2 += displayBufferPageLinks(4, recommend);
		}
	}
	else if (case6) {
		// For > 3 years age group
		// Below 50th percentile
		
		if (mode != 4) {	
			text2 = 
			"<br />"+ name +" is now "+ hl + p_text + endhl + " the 50th percentile for the above 3 years age group.<br /><br />" +
			//"<----- copy here ----->" +
			//"<br /><br />";
			"";
		}

		if (mode == 3 || mode == 4) {		
			text2 += displayBufferPageLinks(2, recommend);
		}
	}
	
	
	if (case7) {
		// disable isomil text because of buffer page implementation
		//text2 += 
		//"In addition, if "+name+" is currently affected by diarrhoea, lactose-intolerance or allergies to cow's milk, " +
		//"Abbott recommends <b>Isomil Follow-Up</b>.<br /><br />" +
		//"A special formula made from high quality soy beans, <b>Isomil Follow-Up</b> is a rich source of carbohydrates, " +
		//"proteins, calcium and other nutrients that replenishes the lost nutrition your child needs for healthy development."
		//;
	}
	// ----------------------------------------


	
	// disable sample query string because of buffer page implementation
	// text2 += "<p>You can request for a free sample by clicking <a href='"+ buildQueryString(target_url,recommend,name,dobd,dobm,doby,height,weight) +"'>here</a>.";
	
	
	// output according to modes
	var final_string = "";
	
	if (mode == 4) {
		// 4 - buffer page links only
		// processed above
		final_string = text2;
	}
	else if (mode == 3) {
		// 3 - percentile results + buffer page links
		// processed above
		final_string = text2;
	}
	else if (mode == 2) {
		// 2 - percentile results only
		// processed above
		final_string = text2;
	}
	else if (mode == 1) {
		// 1 - recommendation string only
		final_string = recommend;
	}
	else if (mode ==0) {
		// 0 - no text
		// no nothing
	}
	
	return final_string;
}

function displayBufferPageLinks(condition, recommend) {
	var links = "";

	if (condition == 1) {
		// 6mths to 1yr (below and above 50th percentile)
		// Similac<sup>&reg;</sup> FO story, managing childhood diarrhoea story
		
		links +=
		"<table border=0 cellspacing=0 cellpadding=3>" +
		"<tr>" +
		//"<td><img src='images/results_graphic.jpg' width=100 height=100 border=1></td>" +
		"<td>To find out more about the nutrients required for a healthy baby, click <a href='ft_gat_feat_similac.asp' class='links' target='_parent'>here" +
		"<img src='images/gat_go_button.gif' hspace=2 align=middle border=0></a>" + 
		"<br /><br />" + 
		"Acute diarrhoea is one of the most common gastrointestinal disorders in children. To find out more, click <a href='ft_gat_diarrhoea_mgmt.asp' class='links' target='_parent'>here" +
		"<img src='images/gat_go_button.gif' hspace=2 align=middle border=0></a>" + 
		"</td></tr>" +

		//"<tr>" +
		//"<td><img src='images/diarrhoea_link.gif' width=50 height=50 border=1></td>" +
		//"<td>And if the effects of diarrhoea are sapping your child of valuable nutrition, find out more about great means of replenishment <a href='ft_gat_diarrhoea_mgmt.asp?recommend="+recommend+"' class='links'>here</a>.</td>" +
		//"</tr>" +
		"</table>"
		;
	}
	else if (condition == 2) {
		// 1yr to 3yr (below 50th percentile)
		// above 3yr (below 50th percentile)
		// picky eating story, joy of soy story
		
		links +=
		"<table border=0 cellspacing=0 cellpadding=3>" +
		"<tr>" +
		//"<td><img src='images/results_graphic.jpg' width=100 height=100 border=1></td>" +
		"<td>Don't assume picky eating is just a phase, your child may not be getting all the nutrients necessary for growth. To find out more, click <a href='ft_gat_pickyeating.asp' class='links' target='_parent'>here" +
		"<img src='images/gat_go_button.gif' hspace=2 align=middle border=0></a>" + 
		"<br /><br />" + 
		"Could your child be allergic to cow's milk? To find out more, click  <a href='ft_gat_joyofsoy.asp' class='links' target='_parent'>here" +
		"<img src='images/gat_go_button.gif' hspace=2 align=middle border=0></a>" + 
		"</tr>" +

		//"<tr>" +
		//"<td><img src='images/joyofsoy_link.gif' width=50 height=50 border=1></td>" +
		//"<td>Or if your child  suffers from milk intolerance for various reasons , find out more about  an alternative  great-tasting  nutritional option  <a href='ft_gat_joyofsoy.asp?recommend="+recommend+"' class='links'>here</a>.</td>" +
		//"</tr>" +
		"</table>"
		;
	}
	else if (condition == 3) {
		// 1yr to 3yr (above 50th percentile)
		// brain growth spurt story, managing childhood diarrhoea story

		links +=
		"<table border=0 cellspacing=0 cellpadding=3>" +
		"<tr>" +
		//"<td><img src='images/results_graphic.jpg' width=100 height=100 border=1></td>" +
		"<td>The brain growth spurt is the fastest stage of brain growth. It starts during pregnancy and ends when your child is between 2 to 3. To find out more, click <a href='ft_gat_braingrowthspurt.asp' class='links' target='_parent'>here" +
		"<img src='images/gat_go_button.gif' hspace=2 align=middle border=0></a>" + 
		"<br /><br />" + 
		"Acute diarrhoea is one of the most common gastrointestinal disorders in children. To find out more, click <a href='ft_gat_diarrhoea_mgmt.asp' class='links' target='_parent'>here" +
		"<img src='images/gat_go_button.gif' hspace=2 align=middle border=0></a>" + 
		"</td></tr>" +

		//"<tr>" +
		//"<td><img src='images/diarrhoea_link.gif' width=50 height=50 border=1></td>" +
		//"<td>Or if the effects of diarrhoea are sapping your child of valuable nutrition, find out more about great means of replenishment <a href='ft_gat_diarrhoea_mgmt.asp?recommend="+recommend+"' class='links'>here</a>.</td>" +
		//"</tr>" +
		"</table>"
		;
	}
	else if (condition == 4) {
		// above 3yr (above 50th percentile)
		// memory game story, managing childhood diarrhoea story

		links +=
		"<table border=0 cellspacing=0 cellpadding=3>" +
		"<tr>" +
		//"<td><img src='images/results_graphic.jpg' width=100 height=100 border=1></td>" +
		"<td>For some simple games to improve your child's memory, click <a href='ft_gat_memorygames.asp' class='links' target='_parent'>here" + 
		"<img src='images/gat_go_button.gif' hspace=2 align=middle border=0></a>" + 
		"<br /><br />" + 
		"Acute diarrhoea is one of the most common gastrointestinal disorders in children. To find out more, click <a href='ft_gat_diarrhoea_mgmt.asp' class='links' target='_parent'>here" +
		"<img src='images/gat_go_button.gif' hspace=2 align=middle border=0></a>" + 
		"</td></tr>" +

		//"<tr>" +
		//"<td><img src='images/diarrhoea_link.gif' width=50 height=50 border=1></td>" +
		//"<td> And if the effects of diarrhoea are sapping your child of valuable nutrition, find out more about great means of replenishment <a href='ft_gat_diarrhoea_mgmt.asp?recommend="+recommend+"' class='links'>here</a>.</td>" +
		//"</tr>" +
		"</table>"
		;
	}
	
	return links;
}

function buildQueryString(target_url,recommend_str, name, dobd, dobm, doby, height, weight) {
	var q_string = target_url;
	
	q_string += ("?name="+name+"&");

	q_string += ("dobd="+dobd+"&");
	q_string += ("dobm="+dobm+"&");
	q_string += ("doby="+doby+"&");
	
	q_string += ("height="+height+"&");
	q_string += ("weight="+weight+"&");
	
	q_string += ("recommend="+recommend_str);

	return q_string;
}

function capitalizeFirstLetter(obj) {
	val = obj.value;
    newVal = '';
    val = val.split(' ');
    for(var c=0; c < val.length; c++) {
    	newVal += val[c].substring(0,1).toUpperCase() + val[c].substring(1,val[c].length) + ' ';
    }
    obj.value = newVal;
}

function trimString (str) {
  str = this != window? this : str;
  return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}
/*function getRecommendationString(name,percentile,age, dob, height, weight, target_url, mode) {

	// recommendation string output mode
	// 0 - no text
	// 1 - recommendation string only
	// 2 - percentile results only
	// 3 - percentile results + buffer page links
	// 4 - buffer page links only

	var recommend = "00000";
	
	var r1 = "0";	// Similac<sup>&reg;</sup> Follow on
	var r2 = "0";	// gain
	var r3 = "0";	// pediasure
	var r4 = "0";	// isomil follow up
	var r5 = "0";	// grow
	
	var hl = "<b>";
	var endhl = "</b>";
	name = trimString(name);

	// percentile - above:2  below:-1
	var p_text = "";
	if (percentile == 2) { p_text = "above"; }
	else if (percentile == -1) { p_text = "below"; }
	
	//  old text disabled for now
	//	var text1 = "<br />"+ name +" is now "+ hl + p_text + endhl + " the 50th percentile for his/her age group. <br /><br />";



	// ----------------------------------------
	// evaluate cases
	var case1 = false;
	var case2 = false;
	var case3 = false;
	var case4 = false;
	var case5 = false;
	var case6 = false;
	var case7 = false;
	
	if (age < 6) {
		// For < 6 months age group
		case1 = true;
	}
	else if (age >= 6 && age <= 12) {
		// For > 6 months, < 1 year age group
		// Above and below 50th percentile
		
		// set recommendation
		r1 = "1";
		
		case2 = true;
	}
	else if (age > 12 && age < 36 && percentile == 2) {
		// For > 1 year, < 3 years age group
		// Above 50th percentile	

		// set recommendation
		r2 = "1";
		
		case3 = true;
	}
	else if (age > 12 && age < 36 && percentile == -1) {
		// For > 1 year, < 3 years age group
		// Below 50th percentile	
		
		// set recommendation
		r3 = "1";
		
		case4 = true;
	}
	else if (age >= 36 && percentile == 2) {
		// For > 3 years age group
		// Above 50th percentile	
		
		// set recommendation
		r5 = "1";
		
		case5 = true;
	}
	else if (age >= 36 && percentile == -1) {
		// For > 3 years age group
		// Below 50th percentile	
		
		// set recommendation
		r3 = "1";
		
		case6 = true;
	}
	
	
	if (age >= 6) {
				
		// set recommendation
		r4 = "1";
		
		case7 = true;
	}
	
	recommend = r1 + r2 + r3 + r4 + r5;

	// ----------------------------------------



	// ----------------------------------------
	// finally, process text	
	var text2 ="";
	if (case1) {
		// For < 6 months age group

		if (mode != 4) {
			text2 = 
			"<br />"+ name +" is now "+ hl + p_text + endhl + " the 50th percentile for the less than 6 months age group.<br />";
		}
		
		if (mode == 2) {
			text2 += 
			"<br />Your child is now less than 6 months old.<br /><br />" +
			"Breast milk is best for babies. The WHO recommends that babies be exclusively breastfed for the first 6 months of life." +
			"<br /><br />";
		}		
	}
	else if (case2) {
		// For > 6 months, < 1 year age group
		// Above and below 50th percentile
		
		if (mode != 4) {
			text2 =
			"<br />"+ name +" is now "+ hl + p_text + endhl + " the 50th percentile for the above 6 months to 1 year age group.<br /><br />" +
			//"<----- copy here ----->" +
			//"<br /><br />";
			"";
		}
		
		if (mode == 3 || mode == 4) {
			text2 += displayBufferPageLinks(1, recommend);
		}
	}
	else if (case3) {
		// For > 1 year, < 3 years age group
		// Above 50th percentile
		
		if (mode != 4) {	
			text2 = 
			"<br />"+ name +" is now "+ hl + p_text + endhl + " the 50th percentile for the 1 to 3 years age group.<br /><br />" +
			//"<----- copy here ----->" +
			//"<br /><br />";
			"";
		}

		if (mode == 3 || mode == 4) {				
			text2 += displayBufferPageLinks(3, recommend);
		}
	}
	else if (case4) {
		// For > 1 year, < 3 years age group
		// Below 50th percentile
		
		if (mode != 4) {	
			text2 = 
			"<br />"+ name +" is now "+ hl + p_text + endhl + " the 50th percentile for the 1 to 3 years age group.<br /><br />" +
			//"<----- copy here ----->" +
			//"<br /><br />";
			"";
		}

		if (mode == 3 || mode == 4) {		
			text2 += displayBufferPageLinks(2, recommend);
		}
	}
	else if (case5) {
		// For > 3 years age group
		// Above 50th percentile
		
		if (mode != 4) {	
			text2 = 
			"<br />"+ name +" is now "+ hl + p_text + endhl + " the 50th percentile for the above 3 years age group.<br /><br />" +
			//"<----- copy here ----->" +
			//"<br /><br />";
			"";
		}
		
		if (mode == 3 || mode == 4) {		
			text2 += displayBufferPageLinks(4, recommend);
		}
	}
	else if (case6) {
		// For > 3 years age group
		// Below 50th percentile
		
		if (mode != 4) {	
			text2 = 
			"<br />"+ name +" is now "+ hl + p_text + endhl + " the 50th percentile for the above 3 years age group.<br /><br />" +
			//"<----- copy here ----->" +
			//"<br /><br />";
			"";
		}

		if (mode == 3 || mode == 4) {		
			text2 += displayBufferPageLinks(2, recommend);
		}
	}
	
	
	if (case7) {
		// disable isomil text because of buffer page implementation
		//text2 += 
		//"In addition, if "+name+" is currently affected by diarrhoea, lactose-intolerance or allergies to cow's milk, " +
		//"Abbott recommends <b>Isomil Follow-Up</b>.<br /><br />" +
		//"A special formula made from high quality soy beans, <b>Isomil Follow-Up</b> is a rich source of carbohydrates, " +
		//"proteins, calcium and other nutrients that replenishes the lost nutrition your child needs for healthy development."
		//;
	}
	// ----------------------------------------


	
	// disable sample query string because of buffer page implementation
	// text2 += "<p>You can request for a free sample by clicking <a href='"+ buildQueryString(target_url,recommend,name,dobd,dobm,doby,height,weight) +"'>here</a>.";
	
	
	// output according to modes
	var final_string = "";
	
	if (mode == 4) {
		// 4 - buffer page links only
		// processed above
		final_string = text2;
	}
	else if (mode == 3) {
		// 3 - percentile results + buffer page links
		// processed above
		final_string = text2;
	}
	else if (mode == 2) {
		// 2 - percentile results only
		// processed above
		final_string = text2;
	}
	else if (mode == 1) {
		// 1 - recommendation string only
		final_string = recommend;
	}
	else if (mode ==0) {
		// 0 - no text
		// no nothing
	}
	
	return final_string;
}

function displayBufferPageLinks(condition, recommend) {
	var links = "";

	if (condition == 1) {
		// 6mths to 1yr (below and above 50th percentile)
		// Similac<sup>&reg;</sup> FO story, managing childhood diarrhoea story
		
		links +=
		"<table border=0 cellspacing=0 cellpadding=3>" +
		"<tr>" +
		//"<td><img src='images/results_graphic.jpg' width=100 height=100 border=1></td>" +
		"<td>To find out more about the nutrients required for a healthy baby, click <a href='ft_gat_feat_similac.asp' class='links' target='_parent'>here" +
		"<img src='images/gat_go_button.gif' hspace=2 align=middle border=0></a>" + 
		"<br /><br />" + 
		"Acute diarrhoea is one of the most common gastrointestinal disorders in children. To find out more, click <a href='ft_gat_diarrhoea_mgmt.asp' class='links' target='_parent'>here" +
		"<img src='images/gat_go_button.gif' hspace=2 align=middle border=0></a>" + 
		"</td></tr>" +

		//"<tr>" +
		//"<td><img src='images/diarrhoea_link.gif' width=50 height=50 border=1></td>" +
		//"<td>And if the effects of diarrhoea are sapping your child of valuable nutrition, find out more about great means of replenishment <a href='ft_gat_diarrhoea_mgmt.asp?recommend="+recommend+"' class='links'>here</a>.</td>" +
		//"</tr>" +
		"</table>"
		;
	}
	else if (condition == 2) {
		// 1yr to 3yr (below 50th percentile)
		// above 3yr (below 50th percentile)
		// picky eating story, joy of soy story
		
		links +=
		"<table border=0 cellspacing=0 cellpadding=3>" +
		"<tr>" +
		//"<td><img src='images/results_graphic.jpg' width=100 height=100 border=1></td>" +
		"<td>Don't assume picky eating is just a phase, your child may not be getting all the nutrients necessary for growth. To find out more, click <a href='ft_gat_pickyeating.asp' class='links' target='_parent'>here" +
		"<img src='images/gat_go_button.gif' hspace=2 align=middle border=0></a>" + 
		"<br /><br />" + 
		"Could your child be allergic to cow's milk? To find out more, click  <a href='ft_gat_joyofsoy.asp' class='links' target='_parent'>here" +
		"<img src='images/gat_go_button.gif' hspace=2 align=middle border=0></a>" + 
		"</tr>" +

		//"<tr>" +
		//"<td><img src='images/joyofsoy_link.gif' width=50 height=50 border=1></td>" +
		//"<td>Or if your child  suffers from milk intolerance for various reasons , find out more about  an alternative  great-tasting  nutritional option  <a href='ft_gat_joyofsoy.asp?recommend="+recommend+"' class='links'>here</a>.</td>" +
		//"</tr>" +
		"</table>"
		;
	}
	else if (condition == 3) {
		// 1yr to 3yr (above 50th percentile)
		// brain growth spurt story, managing childhood diarrhoea story

		links +=
		"<table border=0 cellspacing=0 cellpadding=3>" +
		"<tr>" +
		//"<td><img src='images/results_graphic.jpg' width=100 height=100 border=1></td>" +
		"<td>The brain growth spurt is the fastest stage of brain growth. It starts during pregnancy and ends when your child is between 2 to 3. To find out more, click <a href='ft_gat_braingrowthspurt.asp' class='links' target='_parent'>here" +
		"<img src='images/gat_go_button.gif' hspace=2 align=middle border=0></a>" + 
		"<br /><br />" + 
		"Acute diarrhoea is one of the most common gastrointestinal disorders in children. To find out more, click <a href='ft_gat_diarrhoea_mgmt.asp' class='links' target='_parent'>here" +
		"<img src='images/gat_go_button.gif' hspace=2 align=middle border=0></a>" + 
		"</td></tr>" +

		//"<tr>" +
		//"<td><img src='images/diarrhoea_link.gif' width=50 height=50 border=1></td>" +
		//"<td>Or if the effects of diarrhoea are sapping your child of valuable nutrition, find out more about great means of replenishment <a href='ft_gat_diarrhoea_mgmt.asp?recommend="+recommend+"' class='links'>here</a>.</td>" +
		//"</tr>" +
		"</table>"
		;
	}
	else if (condition == 4) {
		// above 3yr (above 50th percentile)
		// memory game story, managing childhood diarrhoea story

		links +=
		"<table border=0 cellspacing=0 cellpadding=3>" +
		"<tr>" +
		//"<td><img src='images/results_graphic.jpg' width=100 height=100 border=1></td>" +
		"<td>For some simple games to improve your child's memory, click <a href='ft_gat_memorygames.asp' class='links' target='_parent'>here" + 
		"<img src='images/gat_go_button.gif' hspace=2 align=middle border=0></a>" + 
		"<br /><br />" + 
		"Acute diarrhoea is one of the most common gastrointestinal disorders in children. To find out more, click <a href='ft_gat_diarrhoea_mgmt.asp' class='links' target='_parent'>here" +
		"<img src='images/gat_go_button.gif' hspace=2 align=middle border=0></a>" + 
		"</td></tr>" +

		//"<tr>" +
		//"<td><img src='images/diarrhoea_link.gif' width=50 height=50 border=1></td>" +
		//"<td> And if the effects of diarrhoea are sapping your child of valuable nutrition, find out more about great means of replenishment <a href='ft_gat_diarrhoea_mgmt.asp?recommend="+recommend+"' class='links'>here</a>.</td>" +
		//"</tr>" +
		"</table>"
		;
	}
	
	return links;
}

function buildQueryString(target_url,recommend_str, name, dob, height, weight) {
	var q_string = target_url;
	
	q_string += ("?name="+name+"&");

	q_string += ("dob="+dob+"&");
	
	q_string += ("height="+height+"&");
	q_string += ("weight="+weight+"&");
	
	q_string += ("recommend="+recommend_str);

	return q_string;
}

function capitalizeFirstLetter(obj) {
	val = obj.value;
    newVal = '';
    val = val.split(' ');
    for(var c=0; c < val.length; c++) {
    	newVal += val[c].substring(0,1).toUpperCase() + val[c].substring(1,val[c].length) + ' ';
    }
    obj.value = newVal;
}

function trimString (str) {
  str = this != window? this : str;
  return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}*/
