
var ctisIE=((navigator.appVersion.indexOf("MSIE")!=-1)?true:false);var ctisWindowActive=true;var ctrecipeBaseurl="http://d3pnveezgteiph.cloudfront.net/cometogether/static/recipes/ct_recipe_";var ctbaseUrl=hostUrl[campaignidSA]+"/mc/templates/macys/guide/xml.jsp?jsonresponse=1&campaign_id="+campaignidSA+"&channel_id=1&bundle_entryPath=";var ctrecipeIndexes=new Array();var ctrecipeEntries=null;var ctproductEntries=null;var ctrecipeId=null;var ctrecipeIndex=0;var ctshowPrev=-1;var ctshowNext=-1;var CT_TOTAL_THEMES=17;var CT_SHOW_PREVIOUS=0;var CT_SHOW_CURRENT=1;var CT_SHOW_NEXT=2;var CT_INDEX_LABEL=0;var CT_INDEX_SERVES=1;var CT_INDEX_COMMENT=2;var CT_INDEX_INGREDIENTS=3;var CT_INDEX_DIRECTIONS=4;var ctallEventEntries=null;var ctselectionState="default";var ctstateList=null;var ctfunctionName=null;var ctswfname=null;var ctCallbackSwf={onOpCancelled:function()
{var code=-1;var retval1=null;if(showAlerts)
{alert("flashfile name = "+ctswfname+" function name = "+ctfunctionName+" code = "+code+" result = "+retval1);}
getFlashObj(ctswfname).onOpCompleted(ctfunctionName,code,retval1);},onOpCompleted:function(code,msg,opcode,retval1,retval2)
{if(showAlerts)
{alert("flashfile name = "+ctswfname+" function name = "+ctfunctionName+" code = "+code+" result = "+retval1);}
getFlashObj(ctswfname).onOpCompleted(ctfunctionName,code,retval1);},PercentLoaded:function(){return 100;}};function ctshowWaitAnimForRecipe()
{if(ctisWindowActive)
{var innerHtml=('<table id="header" class="ccrDisplayArea ccrDrawBorder" cellspacing="0" cellpadding="0" valign="top" >'+'<tr><td><table align="right" cellspacing="0" cellpadding="0">'+'<tr class="ccrButtonClose">'+'<td valign="top">'+'<img class="ctccCursorHand ctccCloseButtonWH ctccCloseImgPaddingTopRight" id="ccidCloseButton" src="'+VERSION_DIR+'img/button_close.jpg" onclick="ctClosePage();return false;"></img>'+'</td>'+'</tr>'+'</table></td></tr>'+'<tr><td width="746px" height="632px" align="center" valign="middle"><img  border="none" align="center" src="'+VERSION_DIR+'img/loading_anim.gif"></img></td></tr>'+'</table>');platformShowPopup(innerHtml,746,632,true,false,createDelegate(platformOnCancelled,this,[1,"ctShowRecipe"]));var ctplatformPopupTitleBar=document.getElementById("platformPopupTitleBar");ctplatformPopupTitleBar.style.display="none";}}
function ctShowRecipe(recipeid)
{if(showAlerts)
{alert("ctShowRecipe called");}
platformRegisterPageView('ca-so-cc-recipes.'+recipeid,'ca-so-cc-recipes.list');ctrecipeId=recipeid;ctrecipeIndex=parseInt(ctrecipeId.substring(6),"10");ctisWindowActive=true;var url=ctrecipeBaseurl+recipeid+".json";if(showAlerts)
{alert("json url = "+url);}
if(!ctrecipeEntries)
{ctsetRecipeIndexByTheme();ctrecipeEntries=new Array();ctproductEntries=new Array();}
ctsetPrevNextRecipe(ctrecipeId.substring(6));if(!ctrecipeEntries[ctrecipeIndex])
{ctshowWaitAnimForRecipe();ctproductEntries[ctrecipeIndex]=new Array();getDataFromServer("id",url);}
else
{var recipeInnerHtml=ctcreateHTMLForRecipe(ctrecipeEntries[ctrecipeIndex],ctproductEntries[ctrecipeIndex]);var recipeHtml=document.getElementById("recipeheader");if(recipeHtml)
{recipeHtml.innerHTML=recipeInnerHtml;}
else
{platformShowPopup(recipeInnerHtml,746,632,true,false,createDelegate(platformOnCancelled,this,[1,"ctShowRecipe"]));var ctplatformPopupTitleBar=document.getElementById("platformPopupTitleBar");ctplatformPopupTitleBar.style.display="none";}}}
function ctcreateHTMLForRecipe(recipe,productEntries)
{var recipeData=('<table class="ccrDisplayArea ccrDrawBorder '+((ctisIE)?" ccrIEDisplayArea":" ccrBreakHere")+'" cellspacing="0" cellpadding="0" valign="top" >'+'<tr>'+'<td>'+'<table align="center" class="ccrBreakHere ccrChefDetImgTableWidth ccrChefImgTableHeight ccrDrawBorder'+((ctisIE)?" ccrIEChefImgTableWidth":"")+'" cellspacing="0" cellpadding="0">'+'<tr>'+'<td class="ccrChefImageWidthHeight ctccValignTop">'+'<img class="ccrChefImageWidthHeight ccrValign" src="'+VERSION_DIR+'img/'+recipe.entry_chef_iconurl+'" ></img>'+'</td>'+'<td class="ctccCulinaryShowRecipeTitleWidth10">&nbsp;</td>'+'<td class="ctccChefNameWidth">'+'<img class="ctccValignTop" src="'+VERSION_DIR+'img/'+recipe.entry_chef_name+'" ></img>'+'</td>'+'<td class="ctccCulinaryShowRecipeTitleWidth13">&nbsp;</td>'+'<td class="ctccCulinaryFullWidth">'+'<table class="ctccCulinaryFullWidth">'+'<tr>'+'<td class="ctccCulinaryNextPrevPaddingRight" align="right">'+'<table cellspacing="0" cellpadding="0">'+'<tr>');if(ctshowPrev!=-1)
{var recipeIdPrev='RECIPE'+ctshowPrev;recipeData+=('<td align="left" class="ctccPrevNextRecipeImgWH"><img class="ctccCursorHand ctccPrevNextRecipeImgWH " src="'+VERSION_DIR+'img/prev_recipe.jpg" onclick="ctShowRecipe(\''+recipeIdPrev+'\');return false;"></img></td><td class="ctccCulinaryNextPrevWidth6">&nbsp;</td>');}
else
{recipeData+=('<td align="left" class="ctccPrevNextRecipeImgWH"><img class="ctccPrevNextRecipeImgWH " src="'+VERSION_DIR+'img/prev_recipe_desel.jpg"></img></td><td class="ctccCulinaryNextPrevWidth6">&nbsp;</td>');}
recipeData+=('<td class="ctccCulinaryNextPrevWidth15">&nbsp;</td>');if(ctshowNext!=-1)
{var recipeIdNext='RECIPE'+ctshowNext;recipeData+=('<td align="center" class="ctccPrevNextRecipeImgWH"><img class="ctccCursorHand ctccPrevNextRecipeImgWH " src="'+VERSION_DIR+'img/next_recipe.jpg" onclick="ctShowRecipe(\''+recipeIdNext+'\');return false;"></img></td><td class="ctccCulinaryNextPrevWidth6">&nbsp;</td>');}
else
{recipeData+=('<td align="center" class="ctccPrevNextRecipeImgWH"><img class="ctccPrevNextRecipeImgWH" src="'+VERSION_DIR+'img/next_recipe_desel.jpg"></img></td><td class="ctccCulinaryNextPrevWidth6">&nbsp;</td>');}
recipeData+=('<td class="ctccCulinaryNextPrevWidth15">&nbsp;</td>');recipeData+=('<td align="right" class="ctccCloseButtonWH">'+'<img class="ctccCursorHand ctccCloseButtonWH" id="ccidCloseButton" src="'+VERSION_DIR+'img/button_close.jpg" onclick="ctClosePage();return false;"></img>'+'</td>'+'</tr>'+'</table>'+'</td>'+'</tr>'+'<tr>'+'<td align="left">'+'<img  align="left" class="ccrValign" src="'+VERSION_DIR+'img/'+recipe.entry_theme_name+'" ></img>'+'</td>'+'</tr>'+'</table>'+'</td>'+'</tr>'+'</table>'+'</td>'+'</tr>'+'<tr>'+'<td valign="top">'+'<table class="ccrChefImgTableWidth'+((ctisIE)?" ccrIEChefImgTableWidth":"")+'" cellspacing="0" cellpadding="0">'+'<tr>'+'<td>'+'<div class="ccrDivScroll'+((ctisIE)?" ccrIEDivScroll":"")+'">'+'<table class="ccrChefImgTableWidth'+((ctisIE)?" ccrIEChefImgTableWidth":"")+'" cellspacing="0" cellpadding="0">'+'<tr>'+'<td class= "ccrRecipeDetailWidth ccrlPaddingLeft10 ccrPrintLeft" valign="top">'+'<table class="ccrRecipeDetailWidth ccrlPaddingLeft10" cellspacing="0" cellpadding="0">');var totalRecipes=(recipe.entry_totalrecipes?recipe.entry_totalrecipes:1);for(var i=0;i<totalRecipes;i++)
{var values=ctgetValue(i,recipe);var label=values[0];var serves=values[1];var comment=values[2];var ingredients=values[3];var directions=values[4];recipeData+=('<tr>'+'<td class="ccrRecipeDetailWidth">');if(label)
{recipeData+=('<br/><font class="ccrFontVerdana">'+ctreplaceAll(label,"\n","<br/>",0)+'&nbsp;');if(i==0)recipeData+=('<a href="javascript:window.print()" class="ctccValignBottom ccrNoTextDecoration ccrImgHighlight ccMozOutlineStyle"><img class="ccrNoTextDecoration ctccValignBottom ccCloseAndPrintButtonWH" style="border:none" src="'+VERSION_DIR+'img/button_print.jpg"></img></a>');recipeData+=('</font><br/><center class="ccrSpacebw">&nbsp;</center>');}
if(serves)
{recipeData+=('<font class="ccrFontVerdana14">'+ctreplaceAll(serves,"\n","<br/>",0)+'</font><br/>');}
if(comment)
{recipeData+=('<font class="ccrFontIngredients">'+ctreplaceAll(comment,"\n","<br/>",0)+'</font><br/>');}
if(ingredients)
{recipeData+=('<br/>'+'<font class="ccrFontVerdana14"> Ingredients</font>&nbsp;<br/>'+'<font class="ccrFontIngredients">'+ctreplaceAll(ingredients,"\n","<br/>",0)+'</font>');}
recipeData+=('</td>'+'</tr>');if(directions)
{recipeData+=('<tr>'+'<td>'+'<br/>'+'<font class="ccrFontVerdana14"> Directions</font>&nbsp;<br/>'+'<font class="ccrFontIngredients">'+ctreplaceAll(directions,"\n","<br/>",0)+'</font>'+'</td>'+'</tr>');}}
if(recipe.entry_entryprops.ct_prop_9)
{recipeData+=('<tr>'+'<td>'+'<font class="ccrFooter">'+'<br/>'+recipe.entry_entryprops.ct_prop_9+'<br/><br/>'+'</font>'+'</td>'+'</tr>');}
recipeData+=('</table>'+'</td>'+'<td class="ccrRecipeDummyWidth">'+'&nbsp;'+'</td>'+'<td valign="top" class="ccrRecipeImgWidth ccrPrintRight">'+'<table  cellspacing="0" cellpadding="0" class="ccrRecipeImgWidth" align="left">');for(var i=0;i<productEntries.length;i++)
{recipeData+=('<tr class="ccrRecipeImgWidth">'+'<td class="ccrRecipeImg ccrRecipeImgBg ccrRecipeImgWidth" align="center">'+'<img class="ccrProductImageWH" src="'+productEntries[i].entry_fileurl+'" alt="Product Image"></img><br/>'+'</td>'+'</tr>'+'<tr class="ccrRecipeImgWidth">'+'<td class="ccrRecipeImg ccrRecipeImgBg ccrRecipeImgWidth" align="center">'+'<a target="_blank" href="'+productEntries[i].entry_itemurl1+'" class="ccrFontProductName ccrRecipeImgWidth ccrWordWrap">'+productEntries[i].entry_label1+'</a>'+'</td>'+'</tr>');}
recipeData+=('</table>'+'</td>'+'</tr>'+'<tr class="ccrRecipeImgWidth">'+'<td class="ccrRecipeImgWidth">'+'<br/>'+'</td>'+'</tr>'+'</table>'+'</div>'+'</td>'+'</tr>'+'</table>'+'</td>'+'</tr>'+'</table> ');return recipeData;}
function ctgetRecipeIdSuffix(show)
{var recipeidSuffix=ctrecipeId.substring(6);recipeidSuffix=parseInt(recipeidSuffix,"10");recipeidSuffix=(show==CT_SHOW_NEXT?recipeidSuffix+1:recipeidSuffix-1);var recipeid=""+recipeidSuffix;var len=recipeid.length;if(len==3)
{recipeidSuffix="0"+recipeidSuffix;}
else if(len==2)
{recipeidSuffix="00"+recipeidSuffix;}
else if(len==1)
{recipeidSuffix="000"+recipeidSuffix;}
return recipeidSuffix;}
function ctsetRecipeIndexByTheme()
{ctrecipeIndexes[0]=new Array("0005","0004","0003","0002","0001");ctrecipeIndexes[1]=new Array("0007","0010","0008","0012","0009");ctrecipeIndexes[2]=new Array("0013","0014","0021","0015","0040","0017","0019","0020","0022","0023","0018","0024","0025","0026","0027","0028","0016");ctrecipeIndexes[3]=new Array("0032","0030","0031","0029");ctrecipeIndexes[4]=new Array("0036","0035","0033","0039","0034","0038");ctrecipeIndexes[5]=new Array("0044","0046","0042","0043","0045","0112");ctrecipeIndexes[6]=new Array("0053","0048","0051","0050","0052","0047");ctrecipeIndexes[7]=new Array("0060","0059","0054","0056");ctrecipeIndexes[8]=new Array("0062","0065","0064","0061");ctrecipeIndexes[9]=new Array("0067","0071","0068","0070","0066");ctrecipeIndexes[10]=new Array("0075","0074","0076","0073","0072","0078");ctrecipeIndexes[11]=new Array("0081","0079","0082","0080");ctrecipeIndexes[12]=new Array("0086","0085","0087","0084");ctrecipeIndexes[13]=new Array("0089","0090","0091","0088");ctrecipeIndexes[14]=new Array("0097","0093","0092","0096","0095");ctrecipeIndexes[15]=new Array("0099","0101","0098","0111");ctrecipeIndexes[16]=new Array("0110","0105","0102","0103","0109","0108","0106","0107");}
function ctsetPrevNextRecipe(recipeidsuffix)
{for(var i=0;i<CT_TOTAL_THEMES;i++)
{for(var j=0;j<ctrecipeIndexes[i].length;j++)
{if(ctrecipeIndexes[i][j].indexOf(recipeidsuffix)!=-1)
{ctshowNext=(j+1<ctrecipeIndexes[i].length?ctrecipeIndexes[i][j+1]:-1);ctshowPrev=(j-1>-1?ctrecipeIndexes[i][j-1]:-1);if(showAlerts)
{alert("next recipe = "+ctshowNext);alert("prev recipe = "+ctshowPrev);}
return;}}}}
function ctshowStoreEvent()
{if(showAlerts)
{alert("ctshowStoreEvent called");}
platformRegisterPageView('ca-so-cc-events','ca-so-culinary council');var afterLoad=function(result)
{var jsonObject=JSON.parse(result);ctallEventEntries=jsonObject.root.bn_c;ctstateList=new Array();var innerHtml=ctcreateHTMLForStoreEventByState(ctallEventEntries);platformShowPopup(innerHtml,955,518,true,false,createDelegate(platformOnCancelled,this,[1,"ctshowStoreEvent"]));var ctplatformPopupTitleBar=document.getElementById("platformPopupTitleBar");ctplatformPopupTitleBar.style.display="none";};var errcallback=function()
{if(showAlerts)
{alert("error while connecting......"+(ccbaseUrl+ccparamEntryPath));}};ccparamEntryPath="/allevents";jx.load(ctbaseUrl+ccparamEntryPath,afterLoad,"application/x-www-form-urlencoded","GET",errcallback);}
function ctcreateHTMLForStoreEventByState(storeEventEntries)
{var ctChooseAStateValues=new Array(0);for(var i=0;i<storeEventEntries.length;i++)
{if(storeEventEntries[i].entry_entryprops.ct_prop_5&&(ctChooseAStateValues+"").indexOf(storeEventEntries[i].entry_entryprops.ct_prop_5)==-1)
{ctChooseAStateValues.push(storeEventEntries[i].entry_entryprops.ct_prop_5);}}
if(ctChooseAStateValues.length>1)
{ctChooseAStateValues.sort();}
var storeEventData=('<table id="id_mainTable" class="ccsMainTableWidth ccsBorder1" cellspacing="0" cellpadding="0">'+'<tr>'+'<td valign="top" align="right">'+'<img align="right" class="ctccCursorHand ctccValignBottom ctccCloseButtonWH" id="ccidCloseButton" src="'+VERSION_DIR+'img/button_close.jpg" onclick="ctClosePage();return false;"></img>'+'</td>'+'</tr>'+'<tr>'+'<td class="ccsTHPadding ccsTitleTRHeight ccsAlignLeft" valign="top">'+'<img src="'+VERSION_DIR+'img/storeevents_title.jpg"></img>'+'</td>'+'</tr>'+'<tr>'+'<td height="17px">'+'<font class="ccsTHPadding ccsFontStyleCenturyGothicSub">See Culinary Council Chefs live & in-person, preparing their favorite recipes and sharing valuable tips!</font><br/>'+'</td>'+'</tr>'+'<tr>'+'<td><table class="ccsTitleBorder ccsTitleTableWidth" cellpadding="0" cellspacing="0"><tr>'+'<td class="ccsTD1Width ccsBorderRightForTD ccsPadding"><img src="'+VERSION_DIR+'img/location_title.jpg"></img></td>'+'<td class="ccsTD2Width ccsBorderRightForTD ccsPadding"><img src="'+VERSION_DIR+'img/time_title.jpg"></img></td>'+'<td class="ccsPadding">'+'<table cellpadding="0" cellspacing="0" class="ccsFilterTableWidth">'+'<tr>'+'<td class="ccsTHPadding"><img src="'+VERSION_DIR+'img/event_details_title.jpg"></img></td>'+'<td class="ccsFontStyleState" align="right">&nbsp;&nbsp;State'+'<select name="s" size="1" onchange="ctgetEventsByState(this);return false;">'+'<option value="default" selected="true" class="ccsFontStyleChooseState">Choose a state</option>');for(var i=0;i<ctChooseAStateValues.length;i++)
{storeEventData+=('<option value='+ctChooseAStateValues[i]+'>'+ctChooseAStateValues[i]+'</option>');}
storeEventData+=('</select>'+'</td>'+'</tr>'+'</table>'+'</td>'+'</tr></table></td>'+'</tr>'+'<tr>'+'<td valign="top">'+'<div id="store" class="ccsContentDivHt ccsScrollY">'+'<table class="ccsSubTableCls" cellpadding="0" cellspacing="0">');storeEventData+='<tr><td id="eventslist">';storeEventData+=ctgenerateEventsListByState(storeEventEntries);storeEventData+='</td></tr>';storeEventData+=('</table>'+'</div>'+'</td>'+'</tr>'+'</table> ');return storeEventData;}
function ctgetEventsByState(el)
{var currentState=ctselectionState;if(el)
{ctselectionState=el.value;}
var eventslistbystate=document.getElementById("eventslist");if(eventslistbystate&&currentState!=ctselectionState)
{eventslistbystate.innerHTML=ctgenerateEventsListByState(ctallEventEntries);var eventIdStoreDiv=document.getElementById("store");eventIdStoreDiv.scrollTop=0;}}
function ctgenerateEventsListByState(storeEventEntries)
{var storeData="";storeData+='<table cellpadding="0" cellspacing="0">';for(var i=0;i<storeEventEntries.length;i++)
{if(ctselectionState=="default"||ctselectionState==storeEventEntries[i].entry_entryprops.ct_prop_5)
{var drawBottomBorder=(i==storeEventEntries.length-1)?"ccsTdBorderBottom":"";var drawBgndColor=(i%2==0)?"ccsBgColorGray":"";storeData+=('<tr class="'+drawBgndColor+'">'+'<td class="ccsTD1Width ccsContentLeftBorderTD csBorderRightForTD ccsContentTopBorderTD ccsPadding '+drawBottomBorder+'" valign="top">'+'<font class="ccsFontStyleVerdana">'+(storeEventEntries[i].entry_entryprops.ct_prop_2?ctreplaceAll(storeEventEntries[i].entry_entryprops.ct_prop_2,"\\n","<br/>",0):"")+'</font><br/>'+'<font class="ccsFontStyleVerdanaNormal">'+(storeEventEntries[i].entry_entryprops.ct_prop_3?ctreplaceAll(storeEventEntries[i].entry_entryprops.ct_prop_3,"\\n","<br/>",0):"")+'</font><br/>'+'<font class="ccsFontStyleVerdanaNormal">'+(storeEventEntries[i].entry_entryprops.ct_prop_4?ctreplaceAll(storeEventEntries[i].entry_entryprops.ct_prop_4,"\\n","<br/>",0):"")+'</font><br/>'+'<font class="ccsFontStyleVerdanaNormal">'+(storeEventEntries[i].entry_entryprops.ct_prop_5?ctreplaceAll(storeEventEntries[i].entry_entryprops.ct_prop_5,"\\n","<br/>",0):"")+'</font><br/>'+'<font class="ccsFontStyleVerdanaNormal">'+(storeEventEntries[i].entry_entryprops.ct_prop_6?ctreplaceAll(storeEventEntries[i].entry_entryprops.ct_prop_6,"\\n","<br/>",0):"")+'</font><br/>'+'<font class="ccsFontStyleVerdanaNormal">'+(storeEventEntries[i].entry_entryprops.ct_prop_7?ctreplaceAll(storeEventEntries[i].entry_entryprops.ct_prop_7,"\\n","<br/>",0):"")+'</font><br/>'+'</td>'+'<td class="ccsTD2Width ccsContentLeftBorderTD ccsBorderRightForTD ccsContentTopBorderTD ccsPadding '+drawBottomBorder+' " valign="top">'+'<font class="ccsFontStyleVerdanaNormal">'+ctreplaceAll(storeEventEntries[i].entry_entryprops.ct_prop_1,"\\n","<br/>",0)+'</font><br/>'+'</td>'+'<td class="ccsBorderRightForTD ccsContentTopBorderTD ccsPadding '+drawBottomBorder+'" valign="top">'+'<font class="ccsFontStyleVerdana">'+storeEventEntries[i].entry_label1+'</font><br/>'+'<font class="ccsFontStyleVerdanaNormal ccsLineHeightForDescription">'+ctreplaceAll(storeEventEntries[i].entry_comment,"\\n","<br/>",0)+'</font><br/>'+'</td>'+'</tr><tr><td height="2px"></td></tr>');}}
storeData+='</table>';return storeData;}
function ctreplaceAll(str,find,replace,inc)
{var index=-1;var fromIndex=0;if(str)
{while((index=str.indexOf(find,fromIndex))!=-1)
{str=str.replace(find,replace);fromIndex=index+inc;}}
return str;}
function ctgetValue(ivalue,recipe)
{var fret=new Array();switch(ivalue)
{case 1:{fret[CT_INDEX_LABEL]=recipe.entry_label2;fret[CT_INDEX_SERVES]=recipe.entry_entryprops.ct_prop_10;fret[CT_INDEX_COMMENT]=recipe.entry_comment2;fret[CT_INDEX_INGREDIENTS]=recipe.entry_entryprops.ct_prop_11;fret[CT_INDEX_DIRECTIONS]=recipe.entry_entryprops.ct_prop_12;}
break;case 2:{fret[CT_INDEX_LABEL]=recipe.entry_label3;fret[CT_INDEX_SERVES]=recipe.entry_entryprops.ct_prop_14;fret[CT_INDEX_COMMENT]=recipe.entry_comment3;fret[CT_INDEX_INGREDIENTS]=recipe.entry_entryprops.ct_prop_15;fret[CT_INDEX_DIRECTIONS]=recipe.entry_entryprops.ct_prop_16;}
break;case 3:{fret[CT_INDEX_LABEL]=recipe.entry_label4;fret[CT_INDEX_SERVES]=recipe.entry_entryprops.ct_prop_18;fret[CT_INDEX_COMMENT]=recipe.entry_comment4;fret[CT_INDEX_INGREDIENTS]=recipe.entry_entryprops.ct_prop_19;fret[CT_INDEX_DIRECTIONS]=recipe.entry_entryprops.ct_prop_20;}
break;case 4:{fret[CT_INDEX_LABEL]=recipe.entry_label5;fret[CT_INDEX_SERVES]=recipe.entry_entryprops.ct_prop_22;fret[CT_INDEX_COMMENT]=recipe.entry_comment5;fret[CT_INDEX_INGREDIENTS]=recipe.entry_entryprops.ct_prop_23;fret[CT_INDEX_DIRECTIONS]=recipe.entry_entryprops.ct_prop_24;}
break;default:{fret[CT_INDEX_LABEL]=recipe.entry_label1;fret[CT_INDEX_SERVES]=recipe.entry_entryprops.ct_prop_6;fret[CT_INDEX_COMMENT]=recipe.entry_comment1;fret[CT_INDEX_INGREDIENTS]=recipe.entry_entryprops.ct_prop_7;fret[CT_INDEX_DIRECTIONS]=recipe.entry_entryprops.ct_prop_8;}
break;}
return fret;}
function ctClosePage()
{ctisWindowActive=false;ctselectionState="default";var ctplatformPopupTitleBar=document.getElementById("platformPopupTitleBar");ctplatformPopupTitleBar.style.display="block";platformOnCancelled(1,'ctClosePage');}
function afterLoadRecipeJson(recipe)
{ctrecipeEntries[ctrecipeIndex]=recipe;var getProducts=function(result)
{var jsonObject=JSON.parse(result);ctproductEntries[ctrecipeIndex]=jsonObject.root.bn_c;if(ctisWindowActive)
{var innerHtml=''+'<table cellspacing="0" cellpadding="0" >'+'<tr>'+'<td id="recipeheader" class="ctccValignTop">';innerHtml+=ctcreateHTMLForRecipe(ctrecipeEntries[ctrecipeIndex],ctproductEntries[ctrecipeIndex]);innerHtml+=''+'</td>'+'</tr>'+'</table>';platformShowPopup(innerHtml,746,632,true,false,createDelegate(platformOnCancelled,this,[1,"ctShowRecipe"]));var ctplatformPopupTitleBar=document.getElementById("platformPopupTitleBar");ctplatformPopupTitleBar.style.display="none";}}
var getProductsErrcallback=function()
{if(showAlerts)
{alert("error while connecting......"+(ctbaseUrl+"/pdt_recipe_"+ctrecipeId));}}
if(showAlerts)
{alert("pdts url = "+(ctbaseUrl+"/pdts_recipe_"+ctrecipeId));}
jx.load(ctbaseUrl+"/pdts_recipe_"+ctrecipeId,getProducts,"application/x-www-form-urlencoded","GET",getProductsErrcallback);}
function ctshareMs(swfname,title,descriptiontext,iconUrl,webUrl)
{setCtShareProperties(swfname,'ctshareMs');shareMs(ctCallbackSwf,title,descriptiontext,iconUrl,webUrl);}
function ctshareLj(swfname,title,descriptiontext,iconUrl,webUrl)
{setCtShareProperties(swfname,'ctshareLj');shareLj(ctCallbackSwf,title,descriptiontext,iconUrl,webUrl);}
function ctshareGoog(swfname,title,descriptiontext,iconUrl,webUrl)
{setCtShareProperties(swfname,'ctshareGoog');shareGoog(ctCallbackSwf,title,descriptiontext,iconUrl,webUrl);}
function ctshareTwitter(swfname,title,descriptiontext,iconUrl,webUrl)
{setCtShareProperties(swfname,'ctshareTwitter');shareTwitter(ctCallbackSwf,title,descriptiontext,iconUrl,webUrl);}
function ctshareDigg(swfname,title,descriptiontext,iconUrl,webUrl)
{setCtShareProperties(swfname,'ctshareDigg');shareDigg(ctCallbackSwf,title,descriptiontext,iconUrl,webUrl);}
function ctshareDelicious(swfname,title,descriptiontext,iconUrl,webUrl)
{setCtShareProperties(swfname,'ctshareDelicious');shareDelicious(ctCallbackSwf,title,descriptiontext,iconUrl,webUrl);}
function ctshareFb(swfname,title,descriptiontext,iconUrl,webUrl)
{setCtShareProperties(swfname,'ctshareFb');shareFb(ctCallbackSwf,title,descriptiontext,iconUrl,webUrl);}
function ctshowEmail(swfname,title,descriptiontext,iconUrl,webUrl)
{setCtShareProperties(swfname,'ctshowEmail');showEmail(ctCallbackSwf,title,descriptiontext,iconUrl,webUrl);}
function ctshowEmailEx(swfname,title,description,iconUrl,webUrl,mailerId)
{setCtShareProperties(swfname,'ctshowEmailEx');showEmailEx(ctCallbackSwf,title,description,iconUrl,webUrl,mailerId);}
function ctsendtoPhone(swfname,entryId)
{setCtShareProperties(swfname,'ctsendtoPhone');sendtoPhone(ctCallbackSwf,entryId);}
function setCtShareProperties(flashname,functionname)
{ctswfname=flashname;ctfunctionName=functionname;}