standardBarHeight=240;standardBarBottomMargin=99;standardBarLeftMargin=45;firstBarLeftMargin=145;redGradientStart="#991F1D";redGradientEnd="#B92624";redProjected="#7E0800";yellowGradientStart="#DC9600";yellowGradientEnd="#ECBD00";yellowProjected="#BA7F00";greenGradientStart="#3D8D08";greenGradientEnd="#57B519";greenProjected="#337606";yellowPercentageCeeling=0.5;redPercentageCeeling=0.8;nutrientCategoryLabel="#730A00";
function updateBar(a,b){ceeling=b.ceeling;projectedPercentage=b.projectedPercentage;projectedValue=b.projectedValue;if(projectedValue>0.1){tooltipValue=projectedValue;tooltipUnit="grams"}else if(projectedValue>0.0010){tooltipValue=projectedValue*1E3;tooltipUnit="miligrams"}else if(projectedValue>1.0E-6){tooltipValue=projectedValue*1E6;tooltipUnit="micrograms"}else{tooltipValue=0;tooltipUnit="grams"}recommendedValue=b.recommendedValue;nutrientId=b.nutrientId;currentPercentage=projectedPercentage;projectedPercentIncrease=
projectedPercentage=0;roundedCurrentPercent=Math.ceil(currentPercentage*100)/100;if(ceeling)if(roundedCurrentPercent<yellowPercentageCeeling){currentBarGradientStart=greenGradientStart;currentBarGradientEnd=greenGradientEnd}else if(roundedCurrentPercent<redPercentageCeeling){currentBarGradientStart=yellowGradientStart;currentBarGradientEnd=yellowGradientEnd}else{currentBarGradientStart=redGradientStart;currentBarGradientEnd=redGradientEnd}else{currentBarGradientStart=greenGradientStart;currentBarGradientEnd=
greenGradientEnd}totalPercent=roundedCurrentPercent+Math.ceil(projectedPercentIncrease*100)/100;if(ceeling)totalPercent=1-totalPercent;projectedBarColor=totalPercent<yellowPercentageCeeling?greenProjected:totalPercent<redPercentageCeeling?yellowProjected:redProjected;currentBarHeight=Math.ceil(standardBarHeight*currentPercentage);if(currentPercentage>0.2)currentBarHeight=Math.ceil(standardBarHeight*currentPercentage);else if(currentPercentage>=0.095)currentBarHeight=Math.ceil(standardBarHeight*0.2);
else if(currentPercentage>=0)currentBarHeight=Math.ceil(standardBarHeight*0.15);projectedBarHeight=projectedPercentIncrease>0.2?Math.ceil(standardBarHeight*(currentPercentage+projectedPercentIncrease)):projectedPercentIncrease>=0.095?Math.ceil(standardBarHeight*(currentPercentage+0.2)):projectedPercentIncrease>0?Math.ceil(standardBarHeight*(currentPercentage+0.17)):currentBarHeight;if(currentBarHeight>standardBarHeight){currentBarHeight=standardBarHeight;projectedBarHeight=standardBarHeight-2}$("#current_"+
nutrientId).unbind("mouseover");$("#current_"+nutrientId).animate({left:firstBarLeftMargin+standardBarLeftMargin*a+"px",height:currentBarHeight+"px"});backgroundCss=null;backgroundCss=$.browser.webkit?"-webkit-gradient(linear, left top, left bottom, from("+currentBarGradientStart+"), to("+currentBarGradientEnd+"))":"-moz-linear-gradient(top, "+currentBarGradientStart+", "+currentBarGradientEnd+")";$("#current_"+nutrientId).css({background:backgroundCss,"-moz-border-bottom-colors":currentBarGradientStart,
border:"1px solid "+currentBarGradientEnd,"border-bottom-color":currentBarGradientStart,"border-top-color":currentBarGradientEnd});$("#projected_"+nutrientId).animate({left:firstBarLeftMargin+standardBarLeftMargin*a+"px",height:projectedBarHeight-2+"px"});$("#current_percent_"+nutrientId).html((currentPercentage*100).toFixed(0)+"%");$("#projected_percent_"+nutrientId).html((projectedPercentage*100).toFixed(0)+"%");currentPercentage>=1?$("#current_percent_"+nutrientId).css({"margin-top":"1.5em"}):
$("#current_percent_"+nutrientId).css({"margin-top":"1em"});projectedPercentage>=1?$("#projected_percent_"+nutrientId).css({"margin-top":"1.5em"}):$("#projected_percent_"+nutrientId).css({"margin-top":"1em"});$("#current_"+nutrientId).qtip({content:tooltipValue.toFixed(2)+" "+tooltipUnit,show:{delay:0},hide:{when:"mouseout",fixed:true},style:{width:200,padding:5,background:"#A2D959",color:"black",textAlign:"center",border:{width:7,radius:5,color:"#A2D959"},tip:"topLeft",name:"dark"}})}
function initializeBar(a,b){currentBarCss="background: "+greenGradientStart+";background: -webkit-gradient(linear, left top, left bottom, from("+greenGradientEnd+"), to("+greenGradientStart+"));background: -moz-linear-gradient(top, "+greenGradientEnd+", "+greenGradientStart+");-moz-border-bottom-colors: "+greenGradientStart+"; -moz-border-radius: 15px 15px;width: 30px;height: 43px;border: 1px solid "+greenGradientEnd+";border-bottom-color: "+greenGradientStart+"; border-top-color: "+greenGradientEnd+
"; border-bottom-left-radius: 15px 15px;border-bottom-right-radius: 15px 15px;border-top-left-radius: 15px 15px;border-top-right-radius: 15px 15px;position: absolute;left: 10000px;bottom:"+standardBarBottomMargin+"px;z-index: 1;";projectedBarCss="background-color: "+greenProjected+";-moz-border-radius: 15px 15px;width: 30px;height: 0px;border: 1px solid "+greenProjected+";border-bottom-left-radius: 15px 15px;border-bottom-right-radius: 15px 15px;border-top-left-radius: 15px 15px;border-top-right-radius: 15px 15px;margin-bottom: 1px;position: absolute;left: 10000px;bottom:"+
standardBarBottomMargin+"px;cursor: default;z-index: 0;";percentCss="-webkit-transform: rotate(-90deg);-moz-transform: rotate(-90deg);color: white;display: block;font-size: 1.15em;text-align: right;margin-top: 1em;font-weight: 600;";captionCss="position: relative;top: -60px;left: 30px;color: #777777;font-size: 1.15em;-webkit-transform: rotate(-30deg);-moz-transform: rotate(-30deg);display: block;white-space: nowrap;font-weight: 500;";htmlContent="<div id='current_"+a+"' class='current_bar' name="+
a+" style='"+currentBarCss+"'><span id='current_percent_"+a+"' class='current_bar_percent' style='"+percentCss+"'>0%</span></div><div id='projected_"+a+"' class='projected_bar' style='"+projectedBarCss+"'><span id='projected_percent_"+a+"' class='projected_bar_percent' style='"+percentCss+"'>0%</span><span id='bar_caption_"+a+"' class='bar_caption' style='"+captionCss+"'>"+b+"</span></div>";$("#container").append(htmlContent);$("#current_"+a).click(function(c){id=$(this).attr("name");$("#current_"+
id+", #projected_"+id+", #current_percent_"+id+", #bar_caption_"+id).css({opacity:1});$(".projected_bar_percent, .projected_bar").not("#projected_"+id).css({opacity:0});$(".current_bar, .current_bar_percent, .bar_caption").not("#current_"+id+", #current_percent_"+id+", #bar_caption_"+id).css({opacity:0.4});updateWings(id,selectedNutritionCategory);c.stopImmediatePropagation();nutrientHighlighted=id})}
function initializeGraph(){for(nutrientCategory in userRecommendations)for(nutrientId in userRecommendations[nutrientCategory])if(!$.isEmptyObject(nutrientId)&&nutrientId>0){nutrientFriendlyName=userRecommendations[nutrientCategory][nutrientId].friendlyName;initializeBar(nutrientId,nutrientFriendlyName)}}
function updateGraph(){graphData={};totalEnergy=0;for(subject in pancakeStack){for(nutrientId in pancakeStack[subject].nutrients[selectedNutritionCategory]){units=pancakeStack[subject].nutrients[selectedNutritionCategory][nutrientId].units;value=pancakeStack[subject].nutrients[selectedNutritionCategory][nutrientId].value;friendlyName=pancakeStack[subject].nutrients[selectedNutritionCategory][nutrientId].friendlyName;ceeling=pancakeStack[subject].nutrients[selectedNutritionCategory][nutrientId].Ceeling;
switch(units){case "mg":value/=1E3;break;case "mcg":value/=1E6}if(graphData[nutrientId])graphData[nutrientId].projectedValue+=value;else{graphData[nutrientId]={};graphData[nutrientId].nutrientId=nutrientId;graphData[nutrientId].projectedValue=value}}totalEnergy+=pancakeStack[subject].nutrients.energy[208].value}for(subject in userRecommendations)for(nutrientId in userRecommendations[selectedNutritionCategory]){units=userRecommendations[selectedNutritionCategory][nutrientId].units;drv=userRecommendations[selectedNutritionCategory][nutrientId].drv;
rda=userRecommendations[selectedNutritionCategory][nutrientId].rda;rdi=userRecommendations[selectedNutritionCategory][nutrientId].rdi;ceeling=userRecommendations[selectedNutritionCategory][nutrientId].ceeling;if(drv)recommendedValue=drv;else if(rda)recommendedValue=rda;else if(rdi)recommendedValue=rdi;switch(units){case "mg":recommendedValue/=1E3;break;case "mcg":recommendedValue/=1E6}if(typeof graphData[nutrientId]=="undefined"){graphData[nutrientId]={};graphData[nutrientId].nutrientId=nutrientId;
graphData[nutrientId].projectedValue=0}graphData[nutrientId].recommendedValue=Number(recommendedValue);graphData[nutrientId].projectedPercentage=graphData[nutrientId].projectedValue/graphData[nutrientId].recommendedValue;graphData[nutrientId].ceeling=ceeling}graphDataArray=[];for(nutrientId in graphData){graphDataArray[nutrientId]={};graphDataArray[nutrientId].nutrientId=nutrientId;graphDataArray[nutrientId].percentage=graphData[nutrientId].projectedPercentage}graphDataArray.sort(function(a,b){return b.percentage-
a.percentage});sortedGraphData=[];for(index in graphDataArray){nutrientIdToCopy=graphDataArray[index].nutrientId;sortedGraphData.push(jQuery.extend(true,{},graphData[nutrientIdToCopy]))}graphData=sortedGraphData;for(category in userRecommendations)if(category!=selectedNutritionCategory)for(nutrientId in userRecommendations[category]){$("#current_"+nutrientId).animate({left:"10000px"});$("#projected_"+nutrientId).animate({left:"10000px"})}$(".qtip").remove();for(index in graphData)updateBar(index,
graphData[index]);$("#calories").html(totalEnergy.toFixed(0))};foodDbLocal={};foodDbLocal.cache=function(a){id=a.aliasId;if(foodDbLocal[id]){if(foodDbLocal[id].measurementDescription!=a.measurementDescription)foodDbLocal[id]=a;if(foodDbLocal[id].amount!=a.amount)foodDbLocal[id]=a}else foodDbLocal[id]=a};$("#sano").submit(function(){push=[];userInputFormatted=$("#bodday_input").val().toLowerCase();$("#nuntis").html("<img src='images/loader.gif'>");$("#reddo").fadeIn();$.getJSON("get.php",{sano:userInputFormatted},function(a){if($.isEmptyObject(a)){$("#nuntis").html("Don't know that one yet. Try again soon!");return false}$("#bodday_input").val("");$("#historia-cibum, #historia-exercitationem, #catagrapha").hide();$("#cibus, footer, #calories").show();$("#exerceo").hide();var b=0;jQuery.each(a,function(){foodDbLocal.cache(this);
pushPancake(this.aliasId);b++});if(b>1){var c=0,d=[];for(e in a){d.push("<span id='"+e+"' class='penitus'>"+e+"</span>");c+=parseFloat(a[e].weight)}c=c.toFixed(0);d=d.join(", ");$("#cognomen").html(d);$("#modus").html(c+" grams");$(".penitus").click(function(){var f=$(this).html();$("#singula").html(f);$("#modus").html(a[f].Protein.Amount+" "+a[f].Protein.Msre_Desc);$("#cognomen").fadeOut("fast",function(){$("#singula").fadeIn("fast")})});$("#singula").click(function(){$("#cognomen").html(d);$("#modus").html(c+
" grams");$("#singula").fadeOut("fast",function(){$("#cognomen").fadeIn("fast")});$(".penitus").click(function(){var f=$(this).html();$("#singula").html(f);$("#modus").html(a[f].Protein.Amount+" "+a[f].Protein.Msre_Desc);$("#cognomen").fadeOut("fast",function(){$("#singula").fadeIn("fast")})})})}else for(var e in a){$("#cognomen").html(e);$("#modus").html(a[e].amount+" "+a[e].measurementDescription)}numberOfSubjects=null;$("#reddo").fadeOut();$("#tabela, #das").fadeIn();$("#discere").html("Not what you searched for?").click(function(){jQuery.post("post.php",
{type:"report",input:userInputFormatted},function(){$("#discere").fadeOut(function(){$(this).unbind("click").css({cursor:"default"}).html("Thanks! We're working on it!").fadeIn()})})});lastGetResponse=a;updatePancakes();updateGraph(a);updateWings()})});function loadUserRecommendations(){$.getJSON("recommendations.php",function(a){userRecommendations=a.recommendations;initializeGraph()})};selectedNutritionCategory="essential";defaultNutritionCategoryId="#essential-category-label";newUserInputPushedToServer=false;lastGetResponse=userNutritionData=userRecommendations=nutrientHighlighted=null;
$(document).ready(function(){loadUserRecommendations();$(document).click(function(a){if(nutrientHighlighted)if(a.target.localName=="html"){$(".projected_bar_percent, .projected_bar, .current_bar, .current_bar_percent, .bar_caption").css({opacity:1});$(".ala").animate({width:0});$(".imago").css({"border-left-width":"1px","margin-left":"0px"});nutrientHighlighted=null}});$("#reddo, #tabela, #das, #fattyacid-platter, #vitamin-platter, #maluit, footer, #calories").hide();$(defaultNutritionCategoryId).css({color:"white"});
$("#fattyacids-category-label").click(function(){$(".nutrient-category").not(this).css({color:nutrientCategoryLabel});$(this).css({color:"white"});$(".subcategory-platter").not("#fattyacid-platter").hide();$("#fattyacids-category-label").css({cursor:"default"});$(".nutrient-category").not("#fattyacids-category-label").css({cursor:"pointer"});$("#fattyacid-platter").show();selectedNutritionCategory="fattyacids";updateGraph(lastGetResponse);$("#bodday_input").focus()});$("#vitamins-category-label").click(function(){$(".nutrient-category").not(this).css({color:nutrientCategoryLabel});
$(this).css({color:"white"});$(".subcategory-platter").not("#vitamin-platter").hide();$("#vitamins-category-label").css({cursor:"default"});$(".nutrient-category").not("#vitamins-category-label").css({cursor:"pointer"});$("#vitamin-platter").show();selectedNutritionCategory="vitamins";updateGraph(lastGetResponse);$("#bodday_input").focus()});$("#aminoacids-category-label").click(function(){$(".nutrient-category").not(this).css({color:nutrientCategoryLabel});$(this).css({color:"white"});$(".subcategory-platter").hide();
$("#vitamins-category-label").css({cursor:"default"});$(".nutrient-category").not("#aminoacids-category-label").css({cursor:"pointer"});selectedNutritionCategory="aminoacids";updateGraph(lastGetResponse);$("#bodday_input").focus()});$("#minerals-category-label").click(function(){$(".nutrient-category").not(this).css({color:nutrientCategoryLabel});$(this).css({color:"white"});$(".subcategory-platter").hide();$("#minerals-category-label").css({cursor:"default"});$(".nutrient-category").not("#minerals-category-label").css({cursor:"pointer"});
selectedNutritionCategory="minerals";updateGraph(lastGetResponse);$("#bodday_input").focus()});$("#sugars-category-label").click(function(){$(".nutrient-category").not(this).css({color:nutrientCategoryLabel});$(this).css({color:"white"});$(".subcategory-platter").hide();$("#sugars-category-label").css({cursor:"default"});$(".nutrient-category").not("#sugars-category-label").css({cursor:"pointer"});selectedNutritionCategory="sugars";updateGraph(lastGetResponse);$("#bodday_input").focus()});$("#essential-category-label").click(function(){$(".nutrient-category").not(this).css({color:nutrientCategoryLabel});
$(this).css({color:"white"});$(".subcategory-platter").hide();$("#essential-category-label").css({cursor:"default"});$(".nutrient-category").not("#essential-category-label").css({cursor:"pointer"});selectedNutritionCategory="essential";updateGraph(lastGetResponse);$("#bodday_input").focus()});$(".vitamin-subcategory, .fattyacid-subcategory").click(function(){$(".vitamin-subcategory, .fattyacid-subcategory").css({color:"#F60"});$(this).css({color:"white"});updateGraph(lastGetResponse);$("#bodday_input").focus()});
$(".nutrient-category").click(function(){$(".vitamin-subcategory, .fattyacid-subcategory").css({color:"#F60"});$("#bodday_input").focus()});$("#confiteor").click(function(){$("#sano").submit();$("#bodday_input").focus()});$("#bodday_input").focus()});Object.size=function(a){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b};pancakeStack={};favoriteStack={};
function sortPancakes(){pancakesSorted=false;for(pancakeCount=0;!pancakesSorted;){pancakesSwapped=false;previousPancake=null;$(".ala").each(function(){pancake=this.title;if(previousPancake){previousPercent=$("#wing_"+previousPancake+"_percent").attr("title");currentPercent=$("#wing_"+pancake+"_percent").attr("title");if(currentPercent>previousPercent){swapNodes(document.getElementById("pancake_"+pancake),document.getElementById("pancake_"+previousPancake));return pancakesSwapped=true}}previousPancake=
pancake});pancakesSwapped||(pancakesSorted=true)}}jQuery.fn.swapWith=function(a){return this.each(function(){var b=$(a).clone(true);$(a).replaceWith(this);$(this).replaceWith(b)})};function swapNodes(a,b){var c=a.parentNode,d=a.nextSibling===b?a:a.nextSibling;b.parentNode.insertBefore(a,b);c.insertBefore(b,d)}
function pushPancake(a){if(pancakeStack[a]){if(pancakeStack[a].amount!=foodDbLocal[a].amount){pancakeStack[a]=foodDbLocal[a];newAmount=pancakeStack[a].amount;$("#pancake_"+a+"_amount").html(newAmount)}}else pancakeStack[a]=foodDbLocal[a];return true}function updatePancakes(){jQuery.each(pancakeStack,function(){id=this.aliasId;selector="#pancake_"+id;$(selector).length||initializePancake(id)})}
function initializePancake(a){pushPancake(a);if($("#pancake_"+a).length)return false;alias=foodDbLocal[a].alias;measure=foodDbLocal[a].measurementDescription;amount=foodDbLocal[a].amount;if(favoriteStack[a]){favoriteHtml="<div id='pancake_"+a+"_favorite' class='non-placet' onClick='javascript:unfavoritePancake("+a+")'>";favoriteStack[a]=true}else{favoriteHtml="<div id='pancake_"+a+"_favorite' class='placet' onClick='javascript:favoritePancake("+a+")'>";favoriteStack[a]=false}htmlContent="<div id='pancake_"+
a+"' class='factum'><div id='wing_"+a+"' title='"+a+"' class='ala'><span id='wing_"+a+"_percent' title='0' class='alaCompositio'>0%</span></div><div id='pancake_"+a+"_imago' class='imago'><img src='images/food/"+a+".png' width=32 height=32></div><div class='factumCorporis'><span class='cognomen'>"+alias+"</span>&nbsp;<span class='modus'>("+measure+")</span></span><div class='remove' onClick='javascript:pullPancake("+a+", event)'><img src='images/x.png'></div>"+favoriteHtml+"<img src='images/heart.png'></div><div class='quantitas'><div class='minus' onClick='javascript:minusPancake("+
a+", event)'><img src='images/minus.png'></div><span id='pancake_"+a+"_amount' class='numero'>"+amount+"</span><div class='major' onClick='javascript:plusPancake("+a+", event)'><img src='images/plus.png'></div><div class='pellucida'>&nbsp;</div></div></div></div></div></div>";$("#tabela").append(htmlContent)}function pullPancake(a){$("#pancake_"+a).fadeOut(function(){$(this).remove()});delete pancakeStack[a];updateGraph();updateWings()}
function plusPancake(a){oldAmount=pancakeStack[a].amount;newAmount=++pancakeStack[a].amount;$("#pancake_"+a+"_amount").html(newAmount);for(category in pancakeStack[a].nutrients)for(nutrientId in pancakeStack[a].nutrients[category])pancakeStack[a].nutrients[category][nutrientId].value=pancakeStack[a].nutrients[category][nutrientId].value/oldAmount*newAmount;updateGraph();updateWings();return true}
function minusPancake(a){oldAmount=pancakeStack[a].amount;newAmount=pancakeStack[a].amount-1;if(newAmount<1)return false;--pancakeStack[a].amount;$("#pancake_"+a+"_amount").html(newAmount);for(category in pancakeStack[a].nutrients)for(nutrientId in pancakeStack[a].nutrients[category])pancakeStack[a].nutrients[category][nutrientId].value=pancakeStack[a].nutrients[category][nutrientId].value/oldAmount*newAmount;updateGraph();updateWings();return true}
function favoritePancake(a){if(!favoriteStack[a]){$("#pancake_"+a+"_favorite").removeClass("placet").addClass("non-placet").unbind().click(function(){unfavoritePancake(a)});favoriteStack[a]=true;htmlContent="<div id='unfavorite_"+a+"' class='maluitCibus' onclick='javascript:initializePancake("+a+");updateGraph();'><img src='images/food/"+a+".png' width='32' height='32'></div>";$("#maluitTabela").append(htmlContent);favoritePanelHeightAdjust();$("#maluit").fadeIn();return true}return false}
function unfavoritePancake(a){if(favoriteStack[a]){$("#pancake_"+a+"_favorite").removeClass("non-placet").addClass("placet").unbind().click(function(){favoritePancake(a)});favoriteStack[a]=false;$("#unfavorite_"+a).remove();count=0;for(key in favoriteStack)favoriteStack[key]&&count++;count>=1?favoritePanelHeightAdjust():$("#maluit").fadeOut();return true}return false}
function favoritePanelHeightAdjust(){count=0;height=35;for(key in favoriteStack)if(favoriteStack[key])if(count>=7){height+=37;count=1}else count++;$("#maluitTabela").height(height)};standardWingWidth=250;
function updateWings(a,b){$(".qtip").remove();a||(a=nutrientHighlighted);b||(b=selectedNutritionCategory);totalAmount=0;for(foodId in pancakeStack){try{value=pancakeStack[foodId].nutrients[b][a].value}catch(c){value=0}totalAmount+=value}if(!totalAmount){$(".ala").animate({width:0});$(".imago").css({"border-left-width":"1px","margin-left":"0px"});return false}for(foodId in pancakeStack){try{value=pancakeStack[foodId].nutrients[b][a].value}catch(d){value=0}currentPercentage=value/totalAmount;$("#wing_"+
foodId+"_percent").attr("title",currentPercentage).html((currentPercentage*100).toFixed(0)+"%");currentBarGradientStart=greenGradientStart;currentBarGradientEnd=greenGradientEnd;roundedCurrentPercent=Math.ceil(currentPercentage*100)/100;if(roundedCurrentPercent<yellowPercentageCeeling){currentBarGradientStart=greenGradientStart;currentBarGradientEnd=greenGradientEnd}else if(roundedCurrentPercent<redPercentageCeeling){currentBarGradientStart=yellowGradientStart;currentBarGradientEnd=yellowGradientEnd}else{currentBarGradientStart=
redGradientStart;currentBarGradientEnd=redGradientEnd}if(currentPercentage>0.25)currentWingWidth=Math.ceil(standardWingWidth*currentPercentage)+25;else if(currentPercentage>=0.095)currentWingWidth=85;else if(currentPercentage>=0)currentWingWidth=Math.ceil(standardWingWidth*0.15);backgroundCss=null;backgroundCss=$.browser.webkit?"-webkit-gradient(linear, left 50, right 50, from("+currentBarGradientEnd+"), to("+currentBarGradientStart+"))":"-moz-linear-gradient(left, "+currentBarGradientEnd+", "+currentBarGradientStart+
")";$("#wing_"+foodId).css({background:backgroundCss,"-moz-border-bottom-colors":currentBarGradientStart,border:"1px solid "+currentBarGradientEnd,"border-bottom-color":currentBarGradientStart,"border-top-color":currentBarGradientEnd});$("#pancake_"+foodId+"_imago").css({"border-left-width":"0px","margin-left":"1px"});if(currentWingWidth<75)currentWingWidth=75;$("#wing_"+foodId).animate({width:currentWingWidth+"px"},function(){sortPancakes(a,b)})}for(foodId in pancakeStack){try{value=pancakeStack[foodId].nutrients[b][a].value}catch(e){value=
0}try{units=pancakeStack[foodId].nutrients[b][a].units}catch(f){units="g"}if(units=="g")units="grams";else if(units=="mcg")units="micrograms";else if(units=="mg")units="milligrams";$("#wing_"+foodId).qtip({content:value.toFixed(2)+" "+units,show:{delay:0},position:{corner:{target:"leftMiddle",tooltip:"rightMiddle"}},hide:{when:"mouseout",fixed:true},style:{width:200,padding:5,background:"#A2D959",color:"black",textAlign:"center",border:{width:7,radius:5,color:"#A2D959"},tip:"rightMiddle",name:"dark"}})}return true}
function initializeWing(){};

