
		//nutrition vars
		var usecache_nutrition = true;
		var httpconn_nutrition_url = "nutritionajax.aspx";
		var httpconn_nutrition_lastaction = "none";
		var httpcacheconn_nutrition_lastaction = "none";
		
		//request objects				
		var httpconn_nutrition = getHTTPObject(); // My Sender Object	
		var httpcacheconn_nutrition = getHTTPObject(); 
		
					
		function updatenutrition(section)
		{
			//update pagename in omniture			
			s.pageName=section
			void(s.t());

			//make a call to our proxy
			getupdate_nutrition(section);
		}
					
	
		//proxy function (either pulls from cache or makes new ajax call
		function update_nutrition(section)
		{
			//first check if content exists in cache and if we are using our cache
			if (document.getElementById('divcache_' + section) && usecache_nutrition == true )
				getcacheupdate_nutrition(section);
			else
				getupdate_nutrition(section);
		}
		
		function startloadingcache_nutrition()
		{
			if ( !document.getElementById('divcache_balanceddiet') ) loadcacheupdate_nutrition('balanceddiet')
			else if ( !document.getElementById('divcache_carbsmarts') )	loadcacheupdate_nutrition('carbsmarts');	
			else if ( !document.getElementById('divcache_cholesterol') ) loadcacheupdate_nutrition('cholesterol');	
			else if ( !document.getElementById('divcache_label') ) loadcacheupdate_nutrition('label');
			else if ( !document.getElementById('divcache_portions') ) loadcacheupdate_nutrition('portions');	
			else if ( !document.getElementById('divcache_transfat') ) loadcacheupdate_nutrition('transfat');	
			else if ( !document.getElementById('divcache_wholegrain') ) loadcacheupdate_nutrition('wholegrain');	
		}
		
		function getcacheupdate_nutrition(section)
		{
			document.getElementById('usercontrol_container').innerHTML = document.getElementById('divcache_' + section).innerHTML;
			//alert("came from cache");
		}
		
		function getupdate_nutrition(section)
		{
		  if (httpconn_nutrition.readyState == 4 || httpconn_nutrition.readyState == 0)
		  {
			  param = '?section=' + section;
			  httpconn_nutrition.open("GET", httpconn_nutrition_url + param, true);	
			  httpconn_nutrition.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			  httpconn_nutrition.onreadystatechange = handleresponse_getupdate_nutrition; //set handler for readystatechange event
			  httpconn_nutrition_lastaction = section;
			  httpconn_nutrition.send(param); //send query to .net page	  
		  } 
		}
		
		function loadcacheupdate_nutrition(section)
		{
		  if (httpcacheconn_nutrition.readyState == 4 || httpcacheconn_nutrition.readyState == 0)
		  {
			  param = '?section=' + section;
			  httpcacheconn_nutrition.open("GET", httpconn_nutrition_url + param, true);	
			  httpcacheconn_nutrition.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			  httpcacheconn_nutrition.onreadystatechange = handleresponse_loadcache_nutrition; //set handler for readystatechange event
			  httpcacheconn_nutrition_lastaction = section;
			  httpcacheconn_nutrition.send(param); //send query to .net page	  
		  } 
		}
		
		function handleresponse_getupdate_nutrition()
		{
		  if (httpconn_nutrition.readyState == 4) 
		  {
			result = httpconn_nutrition.responseText;
			document.getElementById('usercontrol_container').innerHTML = result;
		  }
		}
		
		function handleresponse_loadcache_nutrition()
		{
		
		  if (httpcacheconn_nutrition.readyState == 4) 
		  {
			result = httpcacheconn_nutrition.responseText;
			
			var parentNode = document.getElementById('divcache');
			var el = document.createElement('div');
			el.id = 'divcache_' + httpcacheconn_nutrition_lastaction;
			el.style.display = 'none';
			el.innerHTML = result;
			parentNode.appendChild(el);
		
			//load next cache item if any exist
			startloadingcache_nutrition()	
		   }
		}
		

