/*
 * sni-site-library cooking channel
 * Tue, 17 Jan 2012 12:47:34 -0500
 *
 */


if(typeof(SNI.Common)=='undefined'){SNI.Common={};}
SNI.Common.Carousel=function(element,config){config=$.extend({btnNext:element+" .next-btn",btnPrev:element+" .prev-btn",visible:1,circular:false,displayPage:false,miniNav:false,speed:'fast',btnGo:""},config);return $(element+' .crsl-wrap').jCarouselLite({btnNext:config.btnNext,btnPrev:config.btnPrev,visible:config.visible,circular:config.circular,scroll:config.scroll!=undefined?config.scroll:config.visible,displayPage:(config.displayPage),btnNavigation:(config.displayPage)?false:true,miniNav:config.miniNav,container:element,mouseWheel:true,speed:config.speed,btnGo:config.btnGo});};SNI.Common.Accordion=function(element,config){var ca=this;ca.overflowFix=($.browser.mozilla&&parseFloat($.browser.version)<=1.9);SNI.Common.Accordion.dynamicFix=($.browser.msie&&parseInt($.browser.version)<8);config=$.extend({autoheight:true,header:'.acco-link',change:ca.change,animated:'easeOutSine'},config);var acco=$(element).accordion(config);if(ca.overflowFix||ca.dynamicFix){$(config.header,acco).click(function(){var link=$(this);if(!link.hasClass('ui-state-active')){if(ca.dynamicFix){$('.ui-accordion-content .crsl',acco).hide();}
if(ca.overflowFix){$('.ui-accordion-content .list, .ui-accordion-content .thumbs',acco).css('overflow','hidden');}}});}};SNI.Common.Accordion.change=function(event,ui){if(SNI.Common.Accordion.dynamicFix){$('.crsl',ui.newContent).show();}
if(SNI.Common.Accordion.overflowFix){$('.list, .thumbs',ui.newContent).css('overflow','auto');}};SNI.Common.Tabs=function(element,config){var tabs=$(element).tabs(config);};

/*** sni-site-plugins ***/
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);

if( typeof(SNI.CC) == "undefined" ) {
	SNI.CC = {};
}


function SNIAd(adtype,adsize,pos,keywords){if(pos<0||pos==undefined){pos=1;}
if(keywords==undefined){keywords="";}
var ad=new DartAd();ad.setUrl("http://"+SNI.Ads._adServerHostname+"/js.ng/");if(adtype=='BIGBOX'&&pos==5){ad.addParameter("adtype",'BIGBOX');}else{ad.addParameter("adtype",adtype);}
if(adtype=='LEADERBOARD'){ad.addParameter("Params.styles","SNI_LEADERBOARD");}
if(adtype=='LEADERBOARD'||adtype=='PUSHDOWN'){ad.addParameter("Role",mdManager.getParameter("Role"));}
ad.addParameter("adsize",adsize);ad.addParameter("PagePos",pos);ad.useFeature("tile");if(keywords!=""){var words=keywords.split(" ");for(i=0;i<words.length;i++){ad.addParameter("keyword",words[i]);}}
switch(adtype){default:writeAd(ad);break;}}
function writeAd(ad){if(typeof adRestrictionManager!='undefined'){ad.useIframe=adRestrictionManager.isIframe(ad,mdManager);if(adRestrictionManager.isActive(ad,mdManager)!=false){adManager.createAd(ad);}}else{adManager.createAd(ad);}}
function LeaderboardAd(pos){if(pos<0||pos==undefined||pos==''){pos=1;}
SNIAd('LEADERBOARD','468x60',pos);}
function VswAd(pos){if(pos<0||pos==undefined||pos==''){pos=1;}
SNIAd('VSW','',pos);}
function PushdownAd(pos){if(pos<0||pos==undefined){pos=1;}
SNIAd('PUSHDOWN','',pos);}
function GoogleBigboxAd(pos){if(pos<0||pos==undefined){pos=1;}
SNIAd('GOOGLE_BIGBOX','',pos);}
function GoogleLeaderboardAd(pos){if(pos<0||pos==undefined){pos=1;}
SNIAd('GOOGLE_LEADERBOARD','',pos);}
function BigboxAd(pos,keywords){if(typeof(mdManager)!=undefined&&mdManager.getParameterString("VideoPlayer")==""){if(pos<0||pos==undefined){pos=1;}
SNIAd('BIGBOX','',pos,keywords);}}
function BigboxAd300x150(pos,keywords){if(pos<0||pos==undefined){pos=1;}
SNIAd('SPONSORSHIP_CONTENT','',pos,keywords);}
function SuperstitialAd(pos){if(pos<0||pos==undefined){pos=1;}
SNIAd('SUPERSTITIAL','',pos);}
function VideoPlayerAd(adtype,adsize,pos){var ad=new AdUrl();ad.setUrl("http://"+SNI.Ads._adServerHostname+"/html.ng/");if(adtype!=''){ad.addParameter("adtype",adtype);}
if(adsize!=''){ad.addParameter("adsize",adsize);}
if(!pos||pos==''){pos=1;}
ad.addParameter("PagePos",pos);ad.addParameter("Role",mdManager.getParameter("Role"));ad.useFeature("tile");writeAd(ad);return ad.buildExpandedUrl();}
function getDartEnterpriseUrl(adtype,pos){adtype=adtype.toUpperCase();var strUrl=VideoPlayerAd(adtype,'',pos);return strUrl;}
function setDartEnterpriseBanner(adType,sync_banner){if(adType=='LEADERBOARD'){if($("#leaderboard").length>0){boxW=728;boxH=90;$("#leaderboard").html("<iframe src='"+sync_banner+"\' width=\'"+boxW+"\' height=\'"+boxH+"\'"+"frameborder='0' scrolling='no' marginheight='0' marginwidth='0'></iframe>");}}else{if($("#bigbox").length>0){boxW=300;boxH=250;if(sync_banner.indexOf("336x850")>-1){boxW=336;boxH=850;}else if(sync_banner.indexOf("300x600")>-1){boxW=300;boxH=600;}
$("#bigbox").html("<iframe src='"+sync_banner+"\' width=\'"+boxW+"\' height=\'"+boxH+"\'"+"frameborder='0' scrolling='no' marginheight='0' marginwidth='0'></iframe>");}}
return;}
function setDefaultBigboxAd(){if(typeof(mdManager)!=undefined&&mdManager.getParameterString("VideoPlayer")==""){return;}
var default_ad=VideoPlayerAd('BIGBOX','',5);if($("#bigbox").length>0){boxW=300;boxH=250;if(default_ad.indexOf("336x850")>-1){boxW=336;boxH=850;}else if(default_ad.indexOf("300x600")>-1){boxW=300;boxH=600;}
$("#bigbox").html("<iframe src='"+default_ad+"\' width=\'"+boxW+"\' height=\'"+boxH+"\'"+"frameborder='0' scrolling='no' marginheight='0' marginwidth='0'></iframe>");}}
function MultiLogoAd(adtype,logoNum){var ad=new DartAd();if(logoNum==undefined||logoNum==''||logoNum>4||logoNum<1){logoNum=4;}
if(adtype==undefined||adtype==''){adtype='LOGO';}
ad.setUrl("http://"+SNI.Ads._adServerHostname+"/snDigitalLogo"+logoNum+".html?");ad.addParameter("adtype",adtype);ad.addParameter("PagePos",1);if(logoNum>0){writeAd(ad);$(document).ready(function(){var sponsor=$('.sponsor-multi-logo');if($('a img',sponsor).length>0){if(sponsor.parents("div").hasClass("generic-lead")){$(".generic-lead .hd").css({"border-bottom":"1px solid #e3e3e3","padding":"5px"});}
if(($('em:first-child',sponsor).length<=0)&&(!(sponsor.parents("div").hasClass("section-title")))){if(sponsor.is(':only-child')||sponsor.siblings().is(':empty')){sponsor.prepend('<em class="solo">Sponsored by:</em>');}else{sponsor.prepend("<em>Sponsored by:</em>");}}}});}}
function sponsorTextLinks(adtype,linkNum){var ad=new DartAd();if(linkNum==undefined||linkNum==''||linkNum>6||linkNum<1){linkNum=6;}
if(adtype==undefined||adtype==''){adtype='SPONSORLINKS';}
ad.setUrl("http://"+SNI.Ads._adServerHostname+"/[NEW_SERVER_SIDE_FILENAME] "+linkNum+".html?");ad.addParameter("adtype",adtype);ad.addParameter("PagePos",1);if(linkNum>0){writeAd(ad);}}
function sponsorLinks(adtype,linkNum){var ad=new DartAd();if(linkNum==undefined||linkNum==''||linkNum>6||linkNum<1){linkNum=6;}
if(adtype==undefined||adtype==''){adtype='SPONSORLINKS';}
ad.setUrl("http://"+SNI.Ads._adServerHostname+"/snd_dp_links"+linkNum+".html?");ad.addParameter("adtype",adtype);ad.addParameter("PagePos",1);if(linkNum>0){writeAd(ad);}}
function WDGuidedNavSearchAds(adtype,pos,keywords,filters,pageNo){var ad=new DartAd();if(pos<0||pos==undefined){pos=1;}
if(pageNo>0&&pageNo!=undefined){ad.addParameter("Page",pageNo);}
ad.setUrl("http://"+SNI.Ads._adServerHostname+"/js.ng/");ad.addParameter("adtype",adtype);ad.addParameter("adsize","");ad.addParameter("PagePos",pos);var words=keywords.split(" ");for(i=0;i<words.length;i++){ad.addParameter("keyword",words[i]);}
var words=filters.split(" ");for(i=0;i<words.length;i++){ad.addParameter("filter",words[i]);}
writeAd(ad);}
function WDGuidedNavSiteAdAds(adtype,keywords,filters,pageNo){WDGuidedNavSearchAds(adtype,1,keywords,filters,pageNo);}
SNI.CC.GlobalHeader={showSponsoredLogo:function(){},globalNav:function(){settings=({navTimer:null,initializeMenu:".sni-sub-nav#nav-w li.nav-item",navWidth:$(".sni-sub-nav").width(),padWest:0,padEast:23});hideAll();initMenu();function initMenu(){var menu=settings.initializeMenu;$(menu).find('.close').click(function(){hideAll();});$(menu).each(function(){var menuItem=$(this);var divs=$(this).prevAll();var leftOffset=0;$.each(divs,function(){var tab=$(this);leftOffset=leftOffset+parseInt(tab.width());leftOffset+=parseInt(tab.css("padding-left"),10)+parseInt(tab.css("padding-right"),10);leftOffset+=parseInt(tab.css("borderLeftWidth"),10)+parseInt(tab.css("borderRightWidth"),10);});leftOffset=(leftOffset)+(settings.padWest);menuItem.find('div.flyout').css({left:leftOffset+'px'});menuItem.hover(function(){hideAll();var $this=$(this);$this.addClass("nav-on");settings.navTimer=setTimeout(function(){$this.find('.flyout').show();navTimer=null;},250);},function(){clearTimeout(settings.navTimer);settings.navTimer=null;var closeDiv=$(this);settings.navTimer=setTimeout(function(){closeDiv.removeClass("nav-on");closeDiv.find('.flyout').hide();settings.navTimer=null;},100);});});}
function hideAll(){clearTimeout(settings.navTimer);settings.navTimer=null;$('.sni-sub-nav#nav-w li.nav-item').each(function(){$(this).removeClass('nav-on');$(this).find('.flyout').hide();});}},globalSearch:function(element,autosuggest,searchInputTxt){var gh=this;if(autosuggest===true){function findValue(li){if(li==null){return alert("No match!");}else{$(element+' form').submit();return li.selectValue;}}
function selectItem(li){findValue(li);}
function formatItem(row){return row[0];}
$(element+" input").autocomplete(SNI.Config.autoSuggestService,{delay:10,width:341,minChars:3,matchSubset:1,matchContains:0,cacheLength:10,onItemSelect:selectItem,onFindValue:findValue,formatItem:formatItem,autoFill:false});}
$(element+' form').submit(function(){var form=$(this);var searchText=$.trim(form.find('input').val());if(searchText==''||searchText==searchInputTxt){gh.noSearchPopup(form);return false;}
return true;});},noSearchPopup:function(form){var gh=this;var container=$('#sni-hd');if(typeof gh.noSearchHTML=='undefined'){var html='<div class="flyout flg fly-dd noscroll noquery">';html+=' <div class="fly-hd"></div>';html+=' <div class="fly-bd clrfix">';html+='  <a class="close"></a>';html+='  <div class="col1">&nbsp;</div>';html+='  <div class="col2">';html+='   <p>Please enter a term or phrase into the search field above.  We recommend you search by:</p>';html+='   <ul class="list">';html+='      <li><strong>Ingredient</strong> (e.g. <a href="http://'+SNI.Config.domain+'/search/delegate?searchString=chicken">chicken</a>, <a href="http://'+SNI.Config.domain+'/search/delegate?searchString=beef">beef</a>)</li>';html+='      <li><strong>Chef or Host</strong> (e.g. <a href="http://'+SNI.Config.domain+'/search/delegate?searchString=rachael+ray">Rachael Ray</a>, <a href="http://'+SNI.Config.domain+'/search/delegate?searchString=paula_dean">Paula Deen</a>)</li>';html+='      <li><strong>Holiday</strong> (e.g. <a href="http://'+SNI.Config.domain+'/search/delegate?searchString=thanksgiving">Thanksgiving</a>, <a href="http://'+SNI.Config.domain+'/search/delegate?searchString=christmas">Christmas</a>)</li>';html+='      <li><strong>Technique</strong> (e.g. <a href="http://'+SNI.Config.domain+'/search/delegate?searchString=grilled">grilled</a>, <a href="http://'+SNI.Config.domain+'/search/delegate?searchString=saute">saute</a>)</li>';html+='   </ul>';html+='  </div>';html+=' </div>';html+=' <div class="fly-ft"></div>';html+='</div>';html=$(html);gh.noSearchHTML=html;$('.list a',html).click(function(){form.find('input').val($(this).text());form.submit();return false;});$('.close',html).click(function(){form.find('input').focus();html.fadeOut('fast',function(){});return false;});$('body').bind("mousedown",function(event){var element=$(event.target);if(element.parents().is('div.noquery')){return false;}
html.fadeOut('fast',function(){});$('body').unbind("mousedown",this);});container.append(html);}else{var html=gh.noSearchHTML;}
html.fadeIn('fast');},init:function(){var searchInput=$("#cc-search-input");var searchInputTxt="Enter Search Terms";SNI.Util.inputField("#cc-search-input",searchInputTxt);var host=window.location.hostname;if(host.indexOf(SNI.Config.domain)!=-1){searchInput.bind('mouseover.hinit',function(e){SNI.CC.GlobalHeader.globalSearch('#sni-hd .search',true,searchInputTxt);searchInput.unbind("mouseover.hinit");});}
SNI.CC.GlobalHeader.globalNav();SNI.CC.Omniture.MultiVar("#sni-hd","Header");$('.networking-links a[rel=gh-fb]').click(function(){window.open(this.href,"cc_popup_facebook");return false;});$('.networking-links a[rel=gh-twitter]').click(function(){window.open(this.href,"cc_popup_twitter");return false;});SNI.Community.UR.signInWidget('#sni-hd .masthead',{menuItems:[{optionValue:'first',displayName:''},{optionValue:'profile',displayName:'My Profile',click:function(){window.location.href=SNI.Community.ur3Domain+"/community/style.esi";}},{optionValue:'reviews',displayName:'My Reviews',click:function(){window.location.href=SNI.Community.ur3Domain+"/community/reviews.esi";}},{optionValue:'favorites',displayName:'My Favorites',click:function(){window.location.href=SNI.Community.ur3Domain+"/community/favorites.esi";}},{optionValue:'settings',displayName:'My Settings',click:function(){window.location.href=SNI.Community.ur3Domain+"/community/usersettings.esi";}},{optionValue:'sign-out',displayName:'Sign Out',click:function(){SNI.Community.UR.logout({iframeName:'logoutContainer',iframeClass:'logoutContainer',checkInterval:1000,maxCheckTime:30000});}}],callbacks:{postCallback:function(){var $widget=$(this);$(document).bind('display-ad-logo',function(){$widget.hide();});}}});}};
SNI.CC.ProgramGuide={dprev:'.dprev-btn',dnext:'.dnext-btn',wprev:'.wprev-btn',wnext:'.wnext-btn',currentTime:1,jumpHours:6,maxHours:48,initDay:function(reqDateMonth,reqDateDay,cacheMonth,cacheDay,section_id){var pg=this;$('div.d-guide').hide();$(function(){$('#get-week-select').attachDatepicker({showOtherMonths:true,otherMonthsActive:true,dateFormat:'M d, yy',onSelect:function(input,datepicker){if(datepicker._selectedDay!=datepicker._currentDay||datepicker._selectedMonth!=datepicker._currentMonth||datepicker._selectedYear!=datepicker._currentYear){window.location.href='/cook/programdaily/0,3029,COOK_'+section_id+'_'+(datepicker._currentMonth+1)+'-'+datepicker._currentDay+'-'+datepicker._currentYear+'_EST,00.html';}}});$('a.viewrecipeslink').click(function(){$(this).removeAttr('href');$('div.recipeinfo').hide();$('a.viewrecipeslink').show();SNI.CC.ProgramGuide.showGuideRecipes(this);});$('a.progNext').click(function(){SNI.CC.ProgramGuide.programGuideDay();return false;});$('div.recipeinfo').hide();$.getJSON("/cook/programguide/gettimecode",function(json){reqMonth=parseInt(reqDateMonth);reqDay=parseInt(reqDateDay);myMonth=parseInt(json.date.month);myDay=parseInt(json.date.day);if(reqMonth==myMonth&&reqDay==myDay){$('#itsToday').css('display','block');SNI.CC.ProgramGuide.currentTime=parseInt(json.onair);$('#programNow'+SNI.CC.ProgramGuide.currentTime).html("On Air");SNI.CC.ProgramGuide.programGuideDay();}});$('div.d-guide').show();});},programGuideDay:function(onAirTime){$('.d-guide .show-slot').hide();for(i=SNI.CC.ProgramGuide.currentTime;i<=48;i++){var elId="progGuide"+i;if(document.getElementById("progGuide"+i)==null){var elId=elId+" progGuide"+(i+1)}
if(document.getElementById(elId)!=null)
document.getElementById(elId).style.display="block";}
if(SNI.CC.ProgramGuide.currentTime<=1){$('#progNext').hide();}else{$('#progNext').show();}
SNI.CC.ProgramGuide.currentTime=SNI.CC.ProgramGuide.currentTime-SNI.CC.ProgramGuide.jumpHours;},showGuideRecipes:function(obj){$(obj).hide();$(obj).parents('.viewrecipes').find('.recipeinfo').css('display','block');},initWeek:function(reqDateYear,reqDateMonth,reqDateDay,sctnId){$(function(){$('#weekof-select .date').attachDatepicker({showOtherMonths:true,otherMonthsActive:true,dateFormat:'M d, yy',defaultDate:new Date(reqDateYear,reqDateMonth,reqDateDay),onSelect:function(input,datepicker){if(datepicker._selectedDay!=datepicker._currentDay||datepicker._selectedMonth!=datepicker._currentMonth||datepicker._selectedYear!=datepicker._currentYear){window.location.href='/cook/programweekly/0,3029,COOK_'+sctnId+'_'+(datepicker._currentMonth+1)+'-'+datepicker._currentDay+'-'+datepicker._currentYear+'_EST,00.html';}}});$('#weekof-select .cal-button a').click(function(){$('#weekof-select .date').showDatepicker();return false;});SNI.CC.ProgramGuide.updateBtns();SNI.CC.ProgramGuide.onAir(reqDateYear,reqDateMonth,reqDateDay);$(SNI.CC.ProgramGuide.wnext).click(function(){if(!$(this).hasClass("disabled")){if(SNI.CC.ProgramGuide.currentTime<=SNI.CC.ProgramGuide.maxHours-2*SNI.CC.ProgramGuide.jumpHours+1){SNI.CC.ProgramGuide.currentTime=SNI.CC.ProgramGuide.currentTime+SNI.CC.ProgramGuide.jumpHours;}else{SNI.CC.ProgramGuide.currentTime=SNI.CC.ProgramGuide.maxHours-SNI.CC.ProgramGuide.jumpHours+1;}
$('#week-listing').scrollTo('.w'+SNI.CC.ProgramGuide.currentTime+':first',800);SNI.CC.ProgramGuide.updateBtns();}
return false;});$(SNI.CC.ProgramGuide.wprev).click(function(){if(!$(this).hasClass("disabled")){if(SNI.CC.ProgramGuide.currentTime>SNI.CC.ProgramGuide.jumpHours){SNI.CC.ProgramGuide.currentTime=SNI.CC.ProgramGuide.currentTime-SNI.CC.ProgramGuide.jumpHours;}else{SNI.CC.ProgramGuide.currentTime=1;}
$('#week-listing').scrollTo('.w'+SNI.CC.ProgramGuide.currentTime+':first',800);SNI.CC.ProgramGuide.updateBtns();}
return false;});});},scrollToCurrent:function(){$('#week-listing').scrollTo('.w'+SNI.CC.ProgramGuide.currentTime+':first',800);},updateBtns:function(){if(SNI.CC.ProgramGuide.currentTime==1){$(SNI.CC.ProgramGuide.wprev).addClass('disabled');}else{$(SNI.CC.ProgramGuide.wprev).removeClass('disabled');}
if(SNI.CC.ProgramGuide.currentTime>(SNI.CC.ProgramGuide.maxHours-SNI.CC.ProgramGuide.jumpHours)){$(SNI.CC.ProgramGuide.wnext).addClass('disabled');}else{$(SNI.CC.ProgramGuide.wnext).removeClass('disabled');}},onAir:function(reqDateYear,reqDateMonth,reqDateDay){var jsonURL="/cook/programguide/gettimecode";$.getJSON(jsonURL,function(json){SNI.CC.ProgramGuide.currentTime=json.onair;reqMonth=parseInt(reqDateMonth);reqDay=parseInt(reqDateDay);myMonth=parseInt(json.date.month);myDay=parseInt(json.date.day);if(SNI.CC.ProgramGuide.currentTime!=""){$('#todaySelected .onair').css('display','block');var dayIndex=$('#guide-week #todaySelected').parent().prevAll().size();var onAirCell=$('#tc-'+dayIndex+'-'+SNI.CC.ProgramGuide.currentTime);onAirCell.addClass('tdOnair');onAirCell.prepend('<span class="onAirMsg">on air now</span>');}else{SNI.CC.ProgramGuide.currentTime=1;}
$('#time-select select').change(function(){timeSlot=$('#time-drop-down').val();SNI.CC.ProgramGuide.currentTime=parseInt(timeSlot);SNI.CC.ProgramGuide.scrollToCurrent();SNI.CC.ProgramGuide.updateBtns();});timeVal=((SNI.CC.ProgramGuide.currentTime%2)>0)?SNI.CC.ProgramGuide.currentTime-1:SNI.CC.ProgramGuide.currentTime;timeIndex=$('#time-drop-down option[value='+timeVal+']').index()-1;$('#time-select .fly-ul li:eq('+timeIndex+') a').click();});},getOnTvNow:function(){var d=new Date();var m=(d.getUTCMinutes()<30)?'00':'30';try{xhrReq=$.ajax({url:'/cook/getontv/0,,COOK____no-'+d.getUTCMonth()+'-'+d.getUTCDate()+'-'+d.getUTCFullYear()+'_'+d.getUTCHours()+':'+m+',0.html',success:function(result){$('#onTVnow').html(result);$('#onTvMod').removeClass('hide');},error:function(XMLHttpRequest,textStatus,errorThrown){}});}catch(e){}}};
if(typeof(SNI.CC.Player)=='undefined'){SNI.CC.Player={};}
SNI.CC.Player.Configs={FullSize:{enableSyncAdFix:1,dimensions:{width:'575',height:'492'},flashvars:{playerSize:'FullScreenWide',config:SNI.Config.snapConfigs+"snap-style-playlist-w-title.xml,"+SNI.Config.snapConfigs+"snap-config-std.xml"},params:{menu:"false",scale:"noscale",allowFullScreen:"true",allowScriptAccess:"always",wmode:"transparent",bgcolor:"#ffffff"}},FullSizeNoPlaylist:{enableSyncAdFix:1,dimensions:{width:'575',height:'343'},flashvars:{showCarousel:"false",playerSize:'FullScreenWide',config:SNI.Config.snapConfigs+"snap-style.xml,"+SNI.Config.snapConfigs+"snap-config-std.xml"},params:{menu:"false",scale:"noscale",allowFullScreen:"true",allowScriptAccess:"always",wmode:"transparent"}},RightRail:{enableSyncAdFix:0,dimensions:{width:'320',height:'360'},flashvars:{playerSize:'RightRail',config:SNI.Config.snapConfigs+"snap-style-rr.xml,"+SNI.Config.snapConfigs+"snap-config-rr.xml"},params:{menu:"false",scale:"noscale",allowFullScreen:"true",allowScriptAccess:"always",wmode:"transparent"}},Blog:{enableSyncAdFix:1,dimensions:{width:'576',height:'460'},flashvars:{autoPlay:"false",showCarousel:"false",config:SNI.Config.snapConfigs+"snap-style-rr.xml,"+SNI.Config.snapConfigs+"snap-config-std-no-autoplay.xml"},params:{menu:"false",scale:"noscale",allowFullScreen:"true",allowScriptAccess:"always",wmode:"transparent"}},Lead:{enableSyncAdFix:1,dimensions:{width:'400',height:'300'},flashvars:{autoPlay:"false",showPlaylistTitle:"false",showCarousel:"false",playerSize:'Inline',config:SNI.Config.snapConfigs+"snap-configs/snap-style.xml,"+SNI.Config.snapConfigs+"snap-config-std.xml"},params:{menu:"false",scale:"noscale",allowFullScreen:"true",allowScriptAccess:"always",wmode:"transparent"}}};SNI.Player.UserInterfaceConfigs=SNI.Util.mergeObjects(SNI.Player.UserInterfaceConfigs,SNI.CC.Player.Configs);SNI.CC.Player.FullSize=SNI.Player.FullSize;SNI.CC.Player.Big=SNI.CC.Player.FullSize;SNI.CC.Player.VideoLibrary=SNI.CC.Player.FullSize;SNI.CC.Player.FullSizeNoPlaylist=SNI.Player.FullSizeNoPlaylist;SNI.CC.Player.VideoAsset=SNI.CC.Player.FullSizeNoPlaylist;SNI.CC.Player.RightRail=SNI.Player.RightRail;SNI.CC.Player.Blog=function(divId,channelId,videoId,ui_config){var buildChannelFeed=function(chId){return SNI.Config.snapPlayListUrl+'/channel/xml/0,,'+chId+',00.xml';};return new SNI.Player.SNAP({"container_div_id":divId,"ui_config":SNI.Util.mergeObjects(SNI.CC.Player.Configs.Blog,ui_config,true),"channel_id":channelId,"video_id":videoId,"fcn_build_playlist_url":buildChannelFeed});};SNI.CC.Player.BigBlog=function(divId,channelId,videoId,ui_config){var buildChannelFeed=function(chId){return SNI.Config.snapPlayListUrl+'/channel/xml/0,,'+chId+',00.xml';};var bigBlogConfig=SNI.Util.mergeObjects(SNI.CC.Player.Configs.FullSizeNoPlaylist,{flashvars:{config:SNI.Config.snapConfigs+"snap-style.xml,"+SNI.Config.snapConfigs+"snap-config-std-no-autoplay.xml"}},true);return new SNI.Player.SNAP({"container_div_id":divId,"ui_config":SNI.Util.mergeObjects(bigBlogConfig,ui_config,true),"channel_id":channelId,"video_id":videoId,"fcn_build_playlist_url":buildChannelFeed});};SNI.CC.Player.Lead=function(divId,channelId,videoId,ui_config){return new SNI.Player.SNAP({"container_div_id":divId,"ui_config":SNI.Util.mergeObjects(SNI.CC.Player.Configs.Lead,ui_config,true),"channel_id":channelId,"video_id":videoId});};SNI.CC.Player.DynamicLead=function(divId,channelId,videoId,ui_config){return new SNI.CC.Player.FullSizeNoPlaylist(divId,channelId,videoId,null,SNI.Util.mergeObjects({flashvars:{autoPlay:false,enableRelatedInfoIcon:false,enableNowPlayingOverlay:false,playerSize:"Inline",enableHomePageMode:true},dimensions:{width:272,height:229}},ui_config,true));};SNI.CC.Player.TravelingVideoLibrary=function(divId,channelId,videoId,callback,ui_config){var originalSponsor=mdManager.getParameter('Sponsorship');var tvlEventHandler=function(eventType,eventInfo){SNI.Player.callbackSystem(eventType,eventInfo);var data=$.parseJSON(eventInfo);var currentSponsor=mdManager.getParameter('Sponsorship');if(typeof(data.sponsorshipValue)=='string'){var channelSponsor=data.sponsorshipValue;currentSponsor=channelSponsor!=''?channelSponsor:originalSponsor;mdManager.setParameter('Sponsorship',currentSponsor);adManager.setParameter('Topic',currentSponsor);}
else if(currentSponsor!=originalSponsor){currentSponsor=originalSponsor;mdManager.setParameter('Sponsorship',currentSponsor);adManager.setParameter('Topic',currentSponsor);}};ui_config=SNI.Util.mergeObjects({flashvars:{playerSize:"FullScreenWide",autoPlay:true}},ui_config,true);return new SNI.Player.SNAP({"container_div_id":divId,"ui_config":SNI.Util.mergeObjects(SNI.Player.UserInterfaceConfigs.FullSizeNoPlaylist,ui_config,true),"channel_id":channelId,"video_id":videoId,"fcn_callback_user":callback,"fcn_callback_system":tvlEventHandler});};SNI.CC.Player.NewEpisodesTVL=function(divId,channelId,videoId,callback,ui_config){var useStaging=(SNI.Config.env==="stage")?"true":"false";var extendedConfig={flashvars:{enableSubscriberAuth:true,minimumFlashVersion:"10.2.153",subscriberRedirectURL:"http://www.cookingchanneltv.com/cooking-channel-video-collection/videos/index.html",mvpdConfig:SNI.Config.snapConfigs+"mvpdconfig.xml",convivaServiceURL:"http://livepass.conviva.com",convivaCustomerId:"c3.ScrippsNetwork-Test",saUseStaging:useStaging},alternativeContent:'<p>This website requires the Flash 10.2.153 (or higher) player.<br />You may upgrade your Flash plug-in by visiting the <a href="http://get.adobe.com/flashplayer/">Flash Download Center</a>.<br />Please note you may need to reboot your system.</p>'};return new SNI.CC.Player.TravelingVideoLibrary(divId,channelId,videoId,callback,SNI.Util.mergeObjects(extendedConfig,ui_config,true));};function handleSelectedProvider(mvpdId,mvpdLogo,mvpdClickURL){$('.ad-sponsor-logo').html('<a href="'+mvpdClickURL+'" target="_blank"><img src="'+mvpdLogo+'" alt="Sponsor Logo" /></a>');$('.ad-sponsor-logo').css('display','block');$('#ur-header-links').css('display','none');}
function getReference(id){if(navigator.appName.indexOf("Microsoft")!=-1){return window[id]}
else{return document[id]}}
function closeIFrame(){var fl=getReference("vplayer-1-instance");fl.closeIFrame();}
if(typeof(SNI.CC.QuickVote)=="undefined"){SNI.CC.QuickVote={};}
SNI.CC.QuickVote={inputLink:"#poll-input-link",resultLink:"#poll-result-link",submitLink:"#poll-submit-link",inputPanel:"#inputPanel",inputForm:"#quick-vote-poll",resultsPanel:"#resultsPanel",submittingPanel:".poll .submitting",loadingPanel:".poll .loading",validateOptions:{errorElement:"",highlight:"",rules:{Rating:"required"},messages:{Rating:""},errorContainer:"#quick-vote-poll .errormsg"},voteURL:'',resURL:'',POLL_Cookie:'',oValidator:'',init:function(pollnum,voteURL,resURL){SNI.CC.QuickVote.voteURL=voteURL;SNI.CC.QuickVote.resURL=resURL;SNI.CC.QuickVote.POLL_Cookie="CC_poll_"+pollnum;SNI.CC.QuickVote.oValidator=$(SNI.CC.QuickVote.inputForm).validate(SNI.CC.QuickVote.validateOptions);SNI.CC.QuickVote.oValidator.resetForm();$(SNI.CC.QuickVote.inputForm).get(0).reset();$(SNI.CC.QuickVote.resultLink).click(function(){$(SNI.CC.QuickVote.inputPanel).hide();SNI.CC.QuickVote.showResults();return false;});$(SNI.CC.QuickVote.inputPanel).submit(SNI.CC.QuickVote.submitVote);$(SNI.CC.QuickVote.inputPanel).show();},submitVote:function(){$(SNI.CC.QuickVote.inputPanel).hide();$(SNI.CC.QuickVote.submittingPanel).show();$.post(SNI.CC.QuickVote.voteURL,$(SNI.CC.QuickVote.inputForm).serialize(),SNI.CC.QuickVote.afterSubmit);return false;},afterSubmit:function(){SNI.Util.Cookie.set(SNI.CC.QuickVote.POLL_Cookie,"yes");$(SNI.CC.QuickVote.submittingPanel).hide();SNI.CC.QuickVote.showResults();},showResults:function(){$(SNI.CC.QuickVote.loadingPanel).show();$(SNI.CC.QuickVote.resultsPanel).load(SNI.CC.QuickVote.resURL,'',SNI.CC.QuickVote.resInit);return false;},resInit:function(){$(SNI.CC.QuickVote.loadingPanel).hide();$(SNI.CC.QuickVote.resultsPanel).show();$(SNI.CC.QuickVote.inputLink).click(function(){SNI.CC.QuickVote.showInputForm();return false;});return;},showInputForm:function(){$(SNI.CC.QuickVote.resultsPanel).empty();$(SNI.CC.QuickVote.resultsPanel).hide();SNI.CC.QuickVote.oValidator.resetForm();$(SNI.CC.QuickVote.inputForm).get(0).reset();$(SNI.CC.QuickVote.inputPanel).show();return false;}};
if(SNI.CC.PrintPages===undefined){SNI.CC.PrintPages={};}
SNI.CC.PrintPages={articleResize:function(newSize){$('#sni-w').css('font-size',newSize+'%');},articleHideShow:function(elClass){$('.'+elClass).toggle();},menuResize:function(newSize){$('.menu-rec-sect').contents().css('font-size',newSize+'%');}};SNI.CC.PrintPages.init=function(){$(".print-options .button").click(function(){window.print();});$('input#radTxtMed,input[name=included],input[name=print-size-group]:eq(1)').attr('checked','checked');$('input[name=radTxtSize]').click(function(){SNI.CC.PrintPages.articleResize($(this).val());});$('input[name=included]').click(function(){SNI.CC.PrintPages.articleHideShow($(this).val());});$('input[name=print-size-group]').click(function(){switch($(this).val()){case'3x5':SNI.CC.PrintPages.menuResize(85);break;case'4x6':SNI.CC.PrintPages.menuResize(100);break;case'8x5':SNI.CC.PrintPages.menuResize(116);break;}});$('div#selectPrint a.printCancel,a#lnkPrintMenu').click(function(e){e.preventDefault();$('div#menu-list,div#selectPrint').toggle();});};SNI.CC.PrintPages.footer=function(){var now=new Date();var outstr='Printed on '+now.toDateString()+' from '+document.URL;document.write(outstr);};if(SNI.CC.PrintRecipe===undefined){SNI.CC.PrintRecipe={};}
SNI.CC.PrintRecipe={init:function(inServer){this.optionsContainer=$('#sni-e');this.optionsTop=this.optionsContainer.offset().top;this.optionsHeight=this.optionsContainer.height();this.printArea=$('#print-area');this.currentPrintSize=this.optionsContainer.find('.print-sizes .selected a').attr('data-size');this.currentTextSize='text-med';this.multiLogo=this.printArea.find('.sponsor-multi-logo');this.multiLogo.find('script:first').remove();this.printArea.find('.sponsor-multi-logo').remove();this.recipeTitle=this.printArea.find('h1').text();this.inServer=inServer;this.settings={'8x11':{block_height:1000,blocks_per_page:1,block_heading:false,outline_top:false,outline:false},'4x6':{block_height:355,blocks_per_page:2,block_heading:true,outline_top:{src:'http://cooktv.sndimg.com/webcook/imgs/le/card-outline-ps-4x6-top.png',width:443,height:292},outline:{src:'http://cooktv.sndimg.com/webcook/imgs/le/card-outline-ps-4x6.png',width:437,height:292}},'3x5':{block_height:270,blocks_per_page:2,block_heading:true,outline_top:{src:'http://cooktv.sndimg.com/webcook/imgs/le/card-outline-ps-3x5-top.png',width:369,height:220},outline:{src:'http://cooktv.sndimg.com/webcook/imgs/le/card-outline-ps-3x5.png',width:363,height:220}}};this.sections={'card-meta':{class_name:'card-meta',html:this.printArea.find('.card-meta').html(),span:false,include:true},'recipe-image':{class_name:'recipe-image',html:this.printArea.find('.recipe-image').html()||"",span:false,include:true},'recipe-summary':{class_name:'recipe-summary',html:this.printArea.find('.recipe-summary').html(),span:false,include:true}};var $ingredients=this.printArea.find('.ingredients');$ingredients.each(function(i){SNI.CC.PrintRecipe.sections['ingredients'+i]={class_name:'ingredients',html:$(this).html(),span:'ul',span_element:'<ul></ul>',include:true}});var $lists=this.printArea.find('.list');$lists.each(function(i){SNI.CC.PrintRecipe.sections['list'+i]={class_name:'list',html:$(this).html(),span:'ul',span_element:'<ul></ul>',include:true}});var $notes=this.printArea.find('.notes');$notes.each(function(i){SNI.CC.PrintRecipe.sections['notes'+i]={class_name:'notes',html:$(this).html(),span:'p',span_element:'<p></p>',include:true}});var $directions=this.printArea.find('.directions');$directions.each(function(i){SNI.CC.PrintRecipe.sections['directions'+i]={class_name:'directions',html:$(this).html(),span:'p',span_element:'<p></p>',include:true}});this.sections.copyright={class_name:'copyright',html:this.printArea.find('.copyright').html(),span:false,include:true};this.printArea.find('.recipe-image').hide();this.bindPrintSizes();this.bindTextSizes();this.bindPrintButton();if(this.isIE6()){setTimeout(this.updatePrintView,1);}else{this.updatePrintView();}},bindPrintSizes:function(){var pr=this;var printSizes=$('#print-options .print-sizes');var link=null;printSizes.find('a').click(function(){link=$(this);pr.setPrintSize(link.attr('data-size'));pr.updatePrintView();return false;});},setPrintSize:function(size){var pr=SNI.CC.PrintRecipe;var printSizes=$('#print-options .print-sizes li',pr.optionsContainer);printSizes.removeClass('selected');printSizes.filter('.s-'+size).addClass('selected');pr.printArea.removeClass('ps-8x11 ps-4x6 ps-3x5');pr.printArea.addClass('ps-'+size);pr.currentPrintSize=size;},bindTextSizes:function(){var pr=this;var textSizes=$('#print-options .text-sizes input');textSizes.click(function(){pr.setTextSize(textSizes.filter(':checked')[0].id);pr.updatePrintView();});},setTextSize:function(size){this.currentTextSize=size;this.printArea.removeClass('text-sm text-med text-lg');this.printArea.addClass(size);},bindPrintButton:function(){$("body").delegate("a","click",function(){if($(this).hasClass('button')){window.print();}});},insertPrintButton:function(){var pr=SNI.CC.PrintRecipe;var content='<div class="printable clrfix"><a href="#" class="button"><span>Print</span></a></div>';$('#print-area').append(content);},updatePrintView:function(){var pr=SNI.CC.PrintRecipe,pa=pr.printArea,settings=pr.settings[pr.currentPrintSize],block_count=0,page_count=0,total_elements=0,loop_count=0,html='',previous_section=$('<empty></empty>'),section='card-meta',spanning_content=null,block_finished=true,multiLogoHtml=pr.multiLogo.html();pa.html('');if(pr.isIE8){pr.multiLogo.html(multiLogoHtml);}
while(section!==false){if(block_finished){if(block_count%settings.blocks_per_page===0){if(page_count===0){html='<div class="page first"></div>';html+='<div class="printable clrfix"><p>Printable Area</p></div>';}
else{html='<div class="page"></div>';html+='<div class="printable clrfix "><p>Printable Area</p></div>';}
pa.append(html);var current_page=$('.page').eq(page_count);if(page_count!==0){html='<div class="page-hd clrfix">';html+='<div class="page-num"></div>';html+='<span class="recipe-title">'+pr.recipeTitle+' (cont.)</span>';html+='</div>';current_page.html(html);}
pa.append(current_page);page_count++;html='<div class="block top">';if(settings.outline_top){html+='<img src="'+settings.outline_top.src+'" width="'+settings.outline_top.width+'" height="'+settings.outline_top.height+'" alt="" class="outline" />';html+='<div class="wrap"></div>';}
html+='</div>';}else{html='<div class="block">';if(settings.outline){html+='<img src="'+settings.outline.src+'" width="'+settings.outline.width+'" height="'+settings.outline.height+'" alt="" class="outline" />';html+='<div class="wrap"></div>';}
html+='</div>';}
var current_block=$(html);current_page.append(current_block);if(settings.outline){current_block=current_block.find('.wrap');}
if(settings.block_heading&&block_count!=0){current_block.append('<div class="card-meta"><div class="card-num">X of X</div><span class="recipe-title">'+pr.recipeTitle+' (cont.)</span>');}
block_count++;}
html='<div class="'+pr.sections[section].class_name+' clrfix">';html+=pr.sections[section].html;html+='</div>';var current_section=$(html);current_block.append(current_section);if(pr.sections[section].span!==false){if(pr.isList(section)){total_elements=current_section.find('li').length;}
if(spanning_content==null){spanning_content=$(pr.sections[section].span_element);}else{var section_title=current_section.find('h2');section_title.text((section_title.text().match(/^About/)?section_title.text():section_title.text().split(" ")[0])+' (cont.)');if(removed_count>0&&pr.sections[section].span=='ol'){spanning_content.attr('start',total_elements-removed_count+1);}
current_section.find(pr.sections[section].span).replaceWith(spanning_content);spanning_content=$(pr.sections[section].span_element);}}
if(current_block.height()>settings.block_height){block_finished=true;if(pr.sections[section].span===false){if(current_section.html()==previous_section.html()){block_finished=false;section=pr.nextSection(section);}
previous_section=current_section.remove();}else{var can_span=true;var removed_count=0;var max_count=0;if(pr.sections[section].span=='p'){var paragraph=current_section.find('p');}else if(pr.isList(section)){max_count=current_section.find('li').length;}
do{if(pr.sections[section].span=='p'){var words=$.trim(paragraph.html());if(words.length>0){var regex,word="";if(words.substr(words.length-1)===">"){regex=/[\w<>/.]*$/;word=words.match(regex)[0];}else{regex=/[\s|\w][\w(\.,-\/#!$%\^&\*;:{}"'=\-_`~())]*$/;word=words.match(regex)[0];}
spanning_content.html(word+' '+spanning_content.html());paragraph.html(words.replace(regex,""));removed_count=1;}else{can_span=false;spanning_content=null;paragraph.html('');}}else if(pr.isList(section)){var hh2=null;var elem=current_section.find('li:last').remove();if(current_section.find("ul:last").children("li").length===0){current_section.find("ul:last").remove();}
if(elem.length>0){spanning_content.prepend(elem);if(hh2!=null&&hh2.html()!=""){spanning_content.prepend("</ul><h2>"+hh2.text()+"</h2><ul>");}
removed_count++;}
if(removed_count>=max_count){can_span=false;}}else{can_span=false;}}while(can_span&&(current_block.height()>settings.block_height));if((pr.isList(section)&&removed_count>=max_count)||(pr.sections[section].span=='p'&&$.trim(current_section.find('p').text())=='')){current_section.remove();block_finished=true;if(pr.isList(section)&&removed_count>=total_elements){spanning_content=null;}
if(++loop_count>1){block_finished=false;spanning_content=null;section=pr.nextSection(section);loop_count=0;}}else if(removed_count==0){current_section.remove();spanning_content=null;}}}else{block_finished=false;spanning_content=null;section=pr.nextSection(section);loop_count=0;}}
pa.find('.block').removeClass('auto-height');var count=2;pa.find('.page .page-num').each(function(){$(this).text('Page '+count+++' of '+page_count);});count=2;pa.find('.block .card-num').each(function(){$(this).text(count+++' of '+block_count);});pr.insertMultiLogo();pr.insertPrintButton();pr.insertFooter();},nextSection:function(currentSection){if(currentSection==null){return'card-meta';}
var pr=SNI.CC.PrintRecipe;var section=false;var found=false;for(var key in pr.sections){if(found&&pr.sections[key].include===true){section=key;break;}
if(key==currentSection){found=true;}}
return section;},is3x5:function(){return this.currentPrintSize=='3x5';},is4x6:function(){return this.currentPrintSize=='4x6';},is8x11:function(){return this.currentPrintSize=='8x11';},isList:function(section){return(this.sections[section].span=='ul'||this.sections[section].span=='ol');},isIE6:function(){return($.browser.msie&&parseInt($.browser.version)<7&&!window.XMLHttpRequest);},isIE8:function(){return($.browser.msie&&parseInt($.browser.version)<=8&&!window.XMLHttpRequest);},insertFooter:function(){var monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];var url=document.URL,now=new Date(),month=monthNames[now.getMonth()],day=now.getDate(),year=now.getFullYear(),dateString=month+" "+day+", "+year;var footer='<p class="footer">Printed on '+dateString+' from '+url+'</p>';$('.page:last').append(footer);},insertMultiLogo:function(){if(this.is8x11()){this.printArea.find('.card-meta').prepend(this.multiLogo);}else{this.printArea.find('.page:first').prepend(this.multiLogo);}}};
SNI.CC.FindEpisodeOnTV={init:function(){var showName=$('#episode-finder #show-name').dropdown();var expertName=$('#episode-finder #chef-name').dropdown();showName.change(function(){expertName.get(0).selectedIndex=0;expertName.dropdown('select');});expertName.change(function(){showName.get(0).selectedIndex=0;showName.dropdown('select');});$(document).ready(function(){$('#episode-finder .date-box input').attachDatepicker();});}};
if(typeof(SNI.CC.Toolbar)=="undefined"){SNI.CC.Toolbar={};}
SNI.CC.Toolbar={revealModule:function(trigger,module,container){var containerEl="#toolbar";if(container){containerEl=container;}
containerEl=$(containerEl);containerEl.find(trigger).click(function(){module.fadeIn(SNI.Config.animationSpeed);if(containerEl.attr('id')=="recipe-tools"){SNI.CC.Util.moveToView(module,{anchor:trigger,topOffset:75,leftOffset:-450,align:'left',positionInViewport:false});}
$(this).addClass("active");return false;});},closeModule:function(trigger,module,speed){if(speed==null){speed=SNI.Config.animationSpeed;};module.fadeOut(speed,function(){module.css({'top':'','left':''});});if($(trigger).hasClass("active")){$(trigger).removeClass("active");};},fontResize:function(config){config=$.extend(true,{fontResize:{defaultSize:"100%",controlElement:"#font-resize",textContainer:"p"}},config);$(config.fontResize.controlElement).find("li").click(function(){$(config.fontResize.controlElement).find("li").removeClass("active");$(this).addClass("active");if($(this).hasClass("med")){$(config.fontResize.textContainer).css("font-size",config.fontResize.defaultSize);}else if($(this).hasClass("sm")){$(config.fontResize.textContainer).css("font-size","85%");}else{$(config.fontResize.textContainer).css("font-size","116%");}});},emailAFriend:function(){var module=$("#email-a-friend");var form=module.find("form");form.submit(function(){return false;});var null_value="";var initMessage=form.find("textarea").val();function newCaptchaImg(){addtime=new Date().getTime();};$(".email").click(function(){form.find('#captcha-img').html('<img src="http://'+SNI.Config.domain+'/app/emailservice2/captchaImg" height="30" width="93" />');});$("#captcha-request a").click(function(){newCaptchaImg();form.find('#captcha-img').html('<img src="http://'+SNI.Config.domain+'/app/emailservice2/captchaImg?generateNew=true&t='+addtime+'" height="30" width="93" />');return false;});$(".print").click(function(){SNI.CC.Toolbar.closeModule(".email",module);});SNI.CC.Toolbar.revealModule(".email",module);$(".close").click(function(){SNI.CC.Toolbar.closeModule(".email",module);});$(".form-submit a").click(function(){SNI.CC.Toolbar.closeModule(".email",module);return false;});if(mdManager.getPageTitle){var page_title=mdManager.getPageTitle();var success_message=module.find('.success strong');success_message.text(page_title);}else{success_message.text('this page');};var captcha_msg="Whoops. Please enter the characters in the image to verify you are human.";form.validate({errorLabelContainer:module.find('.message'),wrapper:'',rules:{from_name:{required:true},from_email:{required:true,email:true},to_emails:{required:true,multipleEmails:true},captcha_answer:{required:true}},messages:{from_name:{required:"Whoops. Please enter your name."},from_email:{required:"Whoops. Please enter your e-mail address.",email:"Whoops. Please check the format of your e-mail address and re-enter (i.e. joe@cookingchanneltv.com)."},to_emails:{required:"Whoops. Please enter at least one friend e-mail address.",multipleEmails:"Whoops. One or more of your friend e-mail addresses is not formatted correctly. Please check the format and re-enter (i.e. joe@hgtv.com)."},captcha_answer:{required:captcha_msg}},showErrors:function(errorMap,errorList){if(errorList.length){module.find('.message').addClass('alert').text('');element=$(errorList[0].element);if(element.hasClass('isemail')){element.select();}
this.errorList=[this.errorList[0]];this.defaultShowErrors();}},submitHandler:function(){form.find('input[name="subject"]').val('Check out this page on the Cooking Channel!')
var txtarea=form.find('textarea[name="body"]');var txtarea_comment=txtarea.val();var page_title=mdManager.getPageTitle();var msg_body=form.find('input[name="from_name"]').val()+" thought you would be interested in this link to \""+page_title+"\" on the Cooking Channel:\n\n";msg_body+="http://"+location.hostname;msg_body+=mdManager.getParameter("Url")+"\n\n";if(txtarea.val()!=null_value){msg_body+="Comments from "+form.find('input[name="from_name"]').val()+":\n";msg_body+=txtarea.val();};module.find('.message').hide().removeClass("alert");form.find('fieldset').hide();form.find("label").removeClass("error");form.find('button').addClass('disabled').attr('disabled','disabled');form.find('.cancel').addClass("disabled");form.find('.loading').show();txtarea.val(msg_body);var form_data=form.serialize();$.ajax({type:"POST",url:form.attr("action"),dataType:'json',data:form_data,cache:false,success:function(data){form.find('.loading').hide();var response=$(data);var emailSent=data.emailSent;var captchaCorrect=data.captchaAnswerValid;if(!emailSent){txtarea.val(txtarea_comment);form.find('fieldset').show();form.find('button').removeClass('disabled').removeAttr('disabled');form.find('.cancel').removeClass("disabled");if(!captchaCorrect){form.find("label[for='captcha_answer']").addClass("error");$("#captcha_answer").select();module.find('.message').addClass("alert").text(captcha_msg).show();}else{form.find("label[for='friends-email']").addClass("error");$("#friends-email").select();module.find('.message').addClass("alert").text("Whoops. The e-mail could not be sent to one or more of your friends. Please check the format of their e-mail address and re-enter (i.e. joe@cooking.com).").show();}}else{var success=module.find('.success');var page_title=mdManager.getPageTitle();form.hide();success.show();var timeout=setTimeout(function(){SNI.CC.Toolbar.closeModule(".email",module,300);module.hide();success.hide();txtarea.val(txtarea_comment);module.find('.message').text("All fields are required.").show();form.find("input:text").each(function(){$(this).val("");});form.find('button').removeClass('disabled').removeAttr('disabled');form.find('.cancel').removeClass("disabled");form.find('fieldset').show();form.show();},3000);$(".close").click(function(){clearTimeout(timeout);SNI.CC.Toolbar.closeModule(".email",module);module.hide();success.hide();txtarea.val(txtarea_comment);module.find('.message').text("All fields are required.").show();form.find("input:text").each(function(){$(this).val("");});form.find('button').removeClass('disabled').removeAttr('disabled');form.find('.cancel').removeClass("disabled");form.find('fieldset').show();form.show();});}},error:function(){form.find('.loading').hide();txtarea.val(txtarea_comment);form.find('fieldset').show();form.find('button').removeClass('disabled').removeAttr('disabled');form.find('.cancel').removeClass("disabled");module.find('.message').addClass("alert").text("Whoops. We encountered an error when trying to e-mail this page. Please wait a few moments and try again.").show();}});}});},init:function(config){config=$.extend({fontResize:{defaultSize:"100%",controlElement:"#font-resize",textContainer:"#sni-ww .steps, #ingredients, #directions, #commentsshell, .article-content, .article-header p"}},config);SNI.ShareThis.toolbar();SNI.CC.Toolbar.fontResize(config);SNI.CC.Toolbar.emailAFriend();$("#st-toolbar").click(function(){return false;});}};
SNI.CC.BrowserCheck={init:function(){if($.browser.msie&&parseInt($.browser.version)<7&&!window.XMLHttpRequest){var bc=this;if(SNI.Util.Cookie.get('upgradeReminderSet')==null){var html='<div id="browser-msg" class="notice-msg clrfix"><a href="#" class="close">Close</a>';html+='<div class="col1"><h4>We noticed you are using Internet Explorer 6.</h4>';html+='<p>We detected your browser is out of date. For the best possible experience upgrade to the latest version of <a href="http://www.microsoft.com/windows/downloads/ie/">Internet Explorer</a>, or try one of these fine browsers: <a href="http://www.getfirefox.com/">Firefox</a> and <a href="http://www.apple.com/safari/download/">Safari</a>.</p>';html+='</div><div class="col2"><p><a href="http://www.microsoft.com/windows/downloads/ie/" class="button"><span>Upgrade Internet Explorer</span></a></p>';if(SNI.Util.Cookie.get('upgradePreviouslyReminded')=='1'){html+='<p class="remind"><a href="#" class="yes">Remind Me in 30 Days</a> or <a href="#" class="no">Don\'t Remind Me</a></p>';}
html+='</div></div>';html=$(html);$('a.close, .remind a.yes',html).click(function(){bc.setReminder(30);html.slideUp();SNI.CC.Omniture.ClickTrackSingle(this,"UpgradeIE6 ","COOK");return false;});$('.remind a.no',html).click(function(){bc.setReminder(365);html.slideUp();SNI.CC.Omniture.ClickTrackSingle(this,"UpgradeIE6 ","COOK");return false;});$('#sni-bd').prepend(html);html.show();SNI.CC.Omniture.ClickTrackSingle("#browser-msg .col1","UpgradeIE6 ","COOK");SNI.CC.Omniture.ClickTrackSingle("#browser-msg .col2","UpgradeIE6 ","COOK");SNI.CC.Omniture.ClickTrackSingle("#browser-msg .remind","UpgradeIE6 ","COOK");}}},setReminder:function(days){SNI.Util.Cookie.set('upgradeReminderSet','1',days);SNI.Util.Cookie.set('upgradePreviouslyReminded','1',365*2);}};$(document).ready(function(){SNI.CC.BrowserCheck.init();});
if(typeof(SNI.CC.TVL)==="undefined"){SNI.CC.TVL={};}
SNI.CC.TVL={currVId:null,currCId:null,itemsPerPage:9,itemsInList:0,itemsPerRow:3,channels:[],channelInfo:{},viewingPage:1,initload:1,userclick:0,hasPreroll:0,init:function(){var lib=this;lib.initChannelList();lib.switchView();lib.currCId=$('input#channel').val();lib.currVId=$('input#video').val();if((lib.currVId=="true")||(lib.currVId=="false")||(lib.currVId=="0")||(lib.currVId=="")){lib.currVId=fVid[lib.currCId];}
$('ul#channel-list li').each(function(){$currLi=$(this);if($currLi.attr('id')==lib.currCId){$('ul#channel-list li').removeClass('active');$currLi.addClass('active');return false;}});lib.getVideos('init',1,lib.currCId);},initChannelList:function(){var lib=this;$('ul#channel-list a').click(function(e){e.preventDefault();var $link=$(this);$('ul#channel-list li').removeClass('active');$link.parents('ul#channel-list li.switch').addClass('active');var cid=$link.parents('li.switch').attr('id');if(cid!=lib.currCId){lib.currCId=cid;lib.getVideos('ch',1,cid);}});},getVideos:function(sender,page,cid){var lib=this;var loadCrsl=1;var loadMain=1;var playVid=1;switch(sender){case'crsl-nav':loadMain=0;playVid=0;break;case'pagi':loadCrsl=0;playVid=0;break;case'ch':loadCrsl=0;playVid=0;break;case'main':loadMain=0;break;case'crsl':loadCrsl=0;break;}
if(loadMain){$('div#video-wrap ul.channel-videos li, div#video-wrap .showing, div#video-wrap .pagi').addClass('tvl-hide');$('div#video-wrap div.tvl-loader-main').removeClass('tvl-hide');var mainURL='/cook/tvl/main/0,00,COOK_'+page+'_'+cid+'.html';$.ajax({url:mainURL,success:function(html){html="<div class='tvl-loader-main tvl-hide'></div>"+html;$('div#video-wrap').html(html);SNI.CC.TVL.setPlaying('main');SNI.CC.TVL.mainViewInit();SNI.CC.TVL.initHover();SNI.CC.TVL.initPagination();}});}
if(loadCrsl){$('div#video-carousel ul li, div#video-carousel .page-info').addClass('tvl-hide');$('div#video-carousel .tvl-loader-crsl').removeClass('tvl-hide');var $crsl=$('div#carousel-box');var crslURL='/cook/tvl/carousel/0,00,COOK_'+page+'_'+cid+'.html';$.ajax({url:crslURL,success:function(html){$crsl.html(html);SNI.CC.TVL.setPlaying('crsl');SNI.CC.TVL.crslViewInit();SNI.CC.TVL.crslInitNav();}});}
if(playVid){lib.playVideo();}},getCrslCh:function(){return $('div#video-carousel ul').attr('id').split('-')[1];},getCrslPg:function(){return $('div#video-carousel ul').attr('id').split('-')[2];},crslInitNav:function(){var lib=this;if(lib.getCrslPg()<=1){$('div#video-carousel .prev-btn').addClass('disabled');$('div#video-carousel .prev-btn').unbind('click');}else{$('div#video-carousel .prev-btn').unbind('click').click(function(e){var pgNo=lib.getCrslPg();if(pgNo<=1){return false;}
pgNo--;lib.getVideos('crsl-nav',pgNo,lib.getCrslCh());return false;});}
if($('div#video-carousel').hasClass('last')){$('div#video-carousel .next-btn').addClass('disabled');}else{$('div#video-carousel .next-btn').unbind('click').click(function(e){if($('div#video-carousel').hasClass('last')){return false;}
var pgNo=lib.getCrslPg();pgNo++;lib.getVideos('crsl-nav',pgNo,lib.getCrslCh());return false;});}},crslViewInit:function(){var lib=this;$('div#video-carousel li a').click(function(e){e.preventDefault();lib.userclick=1;var $currLi=$(this).parent();var v=$currLi.attr('id').split('-');vId=v[1];lib.currVId=vId;lib.setPlaying('crsl');var pgNo=v[2].substring(1);var carouselChan=lib.getCrslCh();if(carouselChan!=lib.currCId){lib.hasPreroll=0;lib.currCId=carouselChan;lib.getVideos('crsl',pgNo,lib.currCId);}else if(pgNo!=lib.viewingPage){lib.viewingPage=pgNo;lib.getVideos('pagi',pgNo,lib.currCId);lib.playVideo();}else{lib.setPlaying('main');lib.playVideo();}
return false;});},mainViewInit:function(){var lib=this;$('div#video-wrap div.holder a').click(function(e){e.preventDefault();lib.userclick=1;var $currLi=$(this).parent().parent();var vId=$currLi.attr('id').split('-')[1];lib.currVId=vId;lib.setPlaying('main');crslId=$currLi.attr('id');domid=crslId.split('-');var thisid=domid[1];var thispage=domid[2].substring(1);var thisrow=domid[3].substring(1);var carouselChan=lib.getCrslCh();if(carouselChan!=lib.currCId){lib.hasPreroll=0;lib.getVideos('main',thisrow,lib.currCId);}else if(thisrow!=lib.getCrslPg()){lib.getVideos('main',thisrow,lib.currCId);lib.playVideo();}else{lib.setPlaying('crsl');lib.playVideo();}
$('div#video-wrap li#vmain-'+thisid+'-p'+thispage+'-r'+thisrow+' div.tip-hldr').each(function(){$(this).position({my:"left top",at:"right top",of:'body',offset:"9999 0"});});});},switchView:function(){var lib=this;$('div#sni-w div.sub-header ul.vdOptions a').click(function(e){e.preventDefault();var newView=$(this).parent('li').attr('class').replace(' chosen','');if(newView=='vwGrid'){var newView=$(this).parent('li').attr('class').replace(' chosen','');$('div#video-wrap').removeClass('list-view').addClass('grid-view');$('div.tvl-subheader .vdOptions li.vwList').removeClass('chosen');$('div.tvl-subheader .vdOptions li.vwGrid').addClass('chosen');}else{var newView=$(this).parent('li').attr('class').replace(' chosen','');$('div#video-wrap').removeClass('grid-view').addClass('list-view');$('div.tvl-subheader .vdOptions li.vwGrid').removeClass('chosen');$('div.tvl-subheader .vdOptions li.vwList').addClass('chosen');}});},initHover:function(){$('div#video-list .list-view li.channel-video a').live('mouseenter',function(){var $a=$(this);if($a.parent().parent().hasClass('nowPlaying')){return;}
var $tip=$a.parent('div.holder').siblings('div.tip-hldr');var $time=$a.siblings('span.video-time');$tip.position({my:"left center",at:"right center",of:$time,offset:"5 0"});});$('div#video-list .list-view li.channel-video a').live('mouseout',function(){$('div.tip-hldr').css('left','-9999px');});$('div#video-list .grid-view li.channel-video a').hover(function(){var $a=$(this);if($a.parent().parent().hasClass('nowPlaying')){return;}
var $tip=$a.parent('div.holder').siblings('div.tip-hldr');var $img=$a.children('img.grid-img');$tip.position({my:"left center",at:"right center",of:$img,offset:"5"});},function(){$('div#video-wrap div.tip-hldr').css('left','-9999px');});$('div#video-wrap div.tip-hldr').each(function(){$(this).position({my:"left top",at:"right top",of:'body',offset:"9999 0"});});},initPagination:function(){var lib=this;$('div#video-wrap div.pagi a').click(function(e){e.preventDefault();var url=$(this).attr('href');var urlSplit=url.split('_');var pageNo=urlSplit[1];lib.viewingPage=pageNo;lib.getVideos('pagi',urlSplit[1],lib.currCId);});},evaluateJSON:function(json){return eval('('+json+')');},snapHandler:function(eType,eventInfo){var advance=0;var infoObj=SNI.CC.TVL.evaluateJSON(eventInfo);if(infoObj.itemType=='ad'){SNI.CC.TVL.hasPreroll=1;advance=1;}
if(eType=='itemBegin'){if(!SNI.CC.TVL.hasPreroll){advance=1;}
if(advance){if(!SNI.CC.TVL.initload){if(!SNI.CC.TVL.userclick){SNI.CC.TVL.setNextVideoId();SNI.CC.TVL.setPlaying('main');SNI.CC.TVL.setPlaying('crsl');}}}
SNI.CC.TVL.initload=0;SNI.CC.TVL.userclick=0;return;}
if(infoObj.itemType!='ad'){if(eType=='itemPause'){SNI.CC.TVL.vidTogglePause('pause');}
if(eType=='itemResume'){SNI.CC.TVL.vidTogglePause('resume');}}},vidTogglePause:function(state){grid=$('#video-wrap .nowPlaying .playing');crsl=$('#video-carousel .playing .crslPlay');if(state=="pause"){vTitle=$('.tvl-feature .video-time');li_text="<i>Paused</i>";curr=vTitle.text();vTitle.text(curr+' (paused)');}else{li_text="PLAYING";SNI.CC.TVL.setVidAttribs();}
if(grid.text()!=""){grid.html(li_text);}
if(crsl.text()!=""){crsl.html(li_text);}},playVideo:function(){var lib=this;if(lib.initload<1){snap.loadPlaylist(parseInt(lib.currCId),'',parseInt(lib.currVId));}
var goHere=$('div#featured-video').offset().top-14;$('html,body').stop().animate({scrollTop:goHere},500);},setNextVideoId:function(){var lib=this;vidids=SNI.CC.TVLD.c2v.split(',');var x=0;while(x<vidids.length){if(vidids[x]==lib.currVId){x++;if(x==vidids.length){lib.currVId=vidids[0];}else{lib.currVId=vidids[x];}
break;}
x++;}},setPlaying:function(view){var lib=this;switch(view){case'crsl':$('div#video-carousel li.playing').removeClass('playing');var cObj=document.getElementById("vcar-"+lib.currVId+"-p"+lib.viewingPage);if(cObj!=null){$('div#video-carousel li').each(function(){$currLi=$(this);var thisid=$currLi.attr('id').split('-')[1];$currLi.removeClass('playing');if(thisid==lib.currVId){$currLi.addClass('playing');return false;}});}
break;case'main':$('div#video-wrap li.nowPlaying').removeClass('nowPlaying');mObj=null;$('div#video-wrap li').each(function(){if(mObj!=null){return;}
$currLi=$(this);thisVid=$currLi.attr('id').split('-')[1];if(thisVid==lib.currVId){mObj=$currLi;return;}});if(mObj!=null){var thisid;$('div#video-wrap li').each(function(){$currLi=$(this);domid=$currLi.attr('id').split('-');var thisid=domid[1];$currLi.removeClass('nowPlaying');if(thisid==lib.currVId){$currLi.addClass('nowPlaying');return false;}});}
break;}
lib.setVidAttribs();},setVidAttribs:function(){var vId=SNI.CC.TVL.currVId;var rL="";var rLT="";if(typeof(SNI.CC.TVLD)!=="undefined"){vTi=SNI.CC.TVLD.vT[vId];vTim=SNI.CC.TVLD.vL[vId];vDsc=SNI.CC.TVLD.vD[vId];rL=SNI.CC.TVLD.rU[vId];rLT=SNI.CC.TVLD.rL[vId];}else{var $theLi;$('div#video-wrap li').each(function(){$currLi=$(this);idArr=$currLi.attr('id').split('-');if(idArr[1]==vId){$theLi=$currLi;listVidNum=idArr[3];return false;}});if($theLi!==undefined){vTi=$theLi.find('div.holder a').text();vTim=$theLi.find('span.video-time').text();vDsc=$theLi.find('p.thumb-capt').text();rL=$theLi.find('a.hdnRecLink').attr('href');rLT=$theLi.find('a.hdnRecLink').text();}else{return;}}
if(typeof(vTi)==="undefined"){return;}
$('span#v-title').html(vTi+' <span class="video-time">'+vTim+'</span>');$('p#v-desc').text(vDsc);$('p#v-related a').attr('href',rL).text(rLT);}};SNI.CC.Medialibrary=function(element,o){o=$.extend({crslLoad:null,crslAttr:"data-crsl-loaded",crslClass:".crsl",crslVisible:null},o);if(o.crslLoad){$(o.crslLoad).show();SNI.Common.Carousel(o.crslLoad,{visible:o.crslVisible});$(o.crslLoad).closest('h4').attr(o.crslAttr,'true');}
togglelist=$(element).find('li.switch');togglelist.each(function(){var $this=$(this);var crsl=$this.find('.crsl').attr('id');var target=$this.find("h4");if(!$this.hasClass("active")){$this.find(o.crslClass).slideUp();target.attr(o.crslAttr,'false');}else{target.attr(o.crslAttr,'true');}
target.click(function(){if($this.hasClass("active")){$this.removeClass("active");$this.find(o.crslClass).slideUp(250);}else{$this.addClass("active");$this.find(o.crslClass).slideDown(250);var load=$(this).attr(o.crslAttr);if(load=='false'){SNI.Common.Carousel('#'+crsl,{visible:o.crslVisible});target.attr(o.crslAttr,'true');}}});});};
SNI.CC.Search={filters:function(){var mostUsed=3;var filters=$('#resultsFilters .filter');filters.each(function(index,value){var list=$('ul',value);var children=list.children();var total=children.length;if(total>mostUsed){var title=list.prev('h4').text();if(title.substring(title.length-1)==':'){title=title.substring(0,title.length-1);}
title='More '+title;var items='';var a='';var em='';var url='';children.sort(filterCompare).each(function(i,v){a=$('a',v).text();url=$('a',v).attr("href");em=$('em',v).text();items+='<li class="fly-li"><a href="'+url+'">'+a+' <em>'+em+'</em></a></li>';});var classNames='flyout fly-dd'+(total<=7?' noscroll':'');var flyout='<div class="'+classNames+'">';flyout+='<div class="fly-hd"></div>';flyout+='<div class="fly-bd">';flyout+='<a class="close"></a>';flyout+='<h3>'+title+'</h3>';flyout+='<ul class="fly-ul">';flyout+=items;flyout+='</ul>';flyout+='</div>';flyout+='<div class="fly-ft"></div>';flyout+='</div>';flyout=$(flyout);$('li:gt('+(mostUsed-1)+')',list).remove();$('.close',flyout).click(function(){hideAllFlyouts();return false;});$('li a',flyout).click(function(){hideAllFlyouts();return true;});var moreLink=$('<p class="more"><a href="#">'+title+'</a> <em>('+total+')</em></p>');$('a',moreLink).click(function(){SNI.CC.Util.moveToView(flyout,{anchor:moreLink,topOffset:-30,leftOffset:85});$('body').bind("mousedown",bodyClicked);return false;});list.after(flyout);list.after(moreLink);}});function hideAllFlyouts(){$('#resultsFilters .flyout').fadeOut('fast');$('body').unbind("mousedown",bodyClicked);return true;}
function bodyClicked(event){var element=$(event.target);if(element.parents().is('.flyout')){return false;}
hideAllFlyouts();}
function filterCompare(a,b){a=parseInt(a.firstChild.innerHTML.replace(/\D/g,''));b=parseInt(b.firstChild.innerHTML.replace(/\D/g,''));return(a<b)?-1:(a>b?1:0);}},tips:function(link,tips){var link=$(link);var tips=$(tips);link.click(function(){tips.fadeIn();$('body').bind("mousedown",bodyClicked);return false;});$('.close',tips).click(hideTip);function hideTip(){tips.fadeOut('fast');$('body').unbind("mousedown",bodyClicked);return true;}
function bodyClicked(event){var element=$(event.target);if(element.parents().is('.flyout')){return false;}
hideTip();}},sortBy:function(){var select=$('.results-toolbar select');select.dropdown();select.change(function(){SNI.Util.Cookie.persist(SNI.Util.Cookie.SEARCH,'sortOrder',select.val());this.form.submit();});},recipeFinder:function(episodeID,divId){if(window.ActiveXObject){xmlHttpAlp=new ActiveXObject("Microsoft.XMLHTTP");}else if(window.XMLHttpRequest){xmlHttpAlp=new XMLHttpRequest();}
xmlHttpAlp.onreadystatechange=SNI.CC.Search.handleRecipeFinder;var alpa='/search/findRecipesForEpisodeID?episodeID='+episodeID+"&divID="+divId
xmlHttpAlp.open("GET",alpa,true);xmlHttpAlp.setRequestHeader("Accept","text/html");xmlHttpAlp.send(null);},handleRecipeFinder:function(){if(xmlHttpAlp.readyState==4){if(xmlHttpAlp.status==200){var recResult=xmlHttpAlp.responseText;var recSplit=recResult.split("|");var div=recSplit[0].trim();document.getElementById(div).innerHTML=recSplit[1];document.getElementById(div).style.display="block";}}},closeDYMNotice:function(){$('.dym .close').click(function(){SNI.Util.Cookie.persist(SNI.Util.Cookie.SEARCH,'hideDym','true');$('.dym').slideUp();return false;});},hideDYMNotice:function(){SNI.Util.Cookie.persist(SNI.Util.Cookie.SEARCH,'hideDym',null);}};
SNI.CC.Util={abridge:function(element,numchars,options){options=$.extend({delimiter:" ",forwardRange:10,reverseRange:10,moreSuffix:' ... ',moreLinkText:'more',lessSuffix:' ',lessLinkText:'less',showTruncatedDefault:true},options);numchars=Math.max(numchars,0);var element=$(element);var current_text=element.text();if((options.delimiter!=undefined)&&(options.delimiter!="")){delimiter_found=false;for(var i=numchars;i>Math.max(0,numchars-options.reverseRange);i--){delimiter_position=current_text.indexOf(options.delimiter,i);if((delimiter_position!=-1)&&(delimiter_position<numchars)){delimiter_found=true;numchars=delimiter_position;break;}}
if(!delimiter_found){delimiter_position=current_text.indexOf(options.delimiter,numchars+1);if((delimiter_position!=-1)&&(delimiter_position<Math.min(current_text.length,numchars+options.forwardRange))){delimiter_found=true;numchars=delimiter_position;}}}
var less=options.lessSuffix+'<a href="#" class="less">'+options.lessLinkText+'</a>'
var more=options.moreSuffix+'<a href="#" class="more">'+options.moreLinkText+'</a>'
element.html(current_text+less);var truncated_text=(numchars>=current_text.length)?current_text:current_text.slice(0,numchars)+more;var now=new Date();var seed=now.getSeconds();element.attr('id',element.attr('id')||'original-text-'+Math.floor(Math.random(seed)*10000));var truncated_element=$('#'+element.attr('id')+'-truncated');if(!truncated_element.length){truncated_element=element.clone();truncated_element.attr('id',element.attr('id')+'-truncated');truncated_element.html(truncated_text);element.after(truncated_element);}else{truncated_element.html(truncated_text);}
element.find('.less').click(function(){element.hide();truncated_element.show();return false;});truncated_element.find('.more').click(function(){truncated_element.hide();element.show();return false;});if(options.showTruncatedDefault){element.hide();truncated_element.show();}else{element.show();truncated_element.hide();}},moreTags:function(){var $tags=$(".article-info .tags");var $more_tags=$tags.find(".more-tags");var $trigger=$tags.find("div.more");var fadeOutTimeout,fadeInTimeout;$more_tags.css({top:"15px",left:"0px"});$trigger.hover(function(e){clearTimeout(fadeOutTimeout);$trigger.addClass("on");fadeInTimeout=setTimeout(function(){$more_tags.fadeIn("fast");},100);},function(e){clearTimeout(fadeInTimeout);$trigger.removeClass("on");fadeOutTimeout=setTimeout(function(){$more_tags.fadeOut("fast");},100);});$("body").click(function(){$more_tags.fadeOut("fast");});},moveToView:function(element,options){options=$.extend({anchor:null,align:'left',topOffset:0,leftOffset:0,positionInViewport:true},options);element=$(element);if(options.anchor!==null){var anchor=$(options.anchor);var offset=anchor.offset();if(options.align=='right'){options.leftOffset+=anchor.width();}
options.topOffset+=offset.top;options.leftOffset+=offset.left;}
element.css({top:options.topOffset,left:options.leftOffset});if(options.positionInViewport){SNI.CC.Util.positionInViewport(element);}
element.fadeIn('fast');},getOffset:function(element){element=$(element);var hidden=element.is(":hidden");if(hidden){element.show();}
var offset=element.offset();if(hidden){element.hide();}
return offset;},positionInViewport:function(element){element=$(element);var windowOffset=63;var offset=SNI.CC.Util.getOffset(element);var width=element.width();var height=element.height();var win=$(window);var browserWidth=win.width();var browserHeight=win.height();var scrollX=win.scrollLeft();var scrollY=win.scrollTop()+windowOffset;if(offset.top<scrollY){element.css({top:scrollY});}else if(offset.top+height>(scrollY-windowOffset)+browserHeight){element.css({top:((scrollY-windowOffset)+(browserHeight-height))});}
if(offset.left<scrollX){element.css({left:scrollX});}else if(offset.left+width>scrollX+browserWidth){element.css({left:((scrollX+browserWidth)-width)});}},closeNotice:function(){$('.notice-msg .close').click(function(){$('.notice-msg').slideUp();return false;});},dropdownToLinks:function(select){select=$(select);select.change(function(){var val=$.trim(select.val());if(val!=''){window.location.href=val;}});},jumpLinkScrollTo:function(e){var winOffset=70;if($("#find-project-wrap").is(':visible')){winOffset=winOffset+$("#find-project-wrap").height()}
if($(e).length){var targetOffset=$(e).offset().top-winOffset;$('html,body').animate({scrollTop:targetOffset},"fast");return false;}},getDateByUtcOffset:function(offset){var d=new Date();var utc=d.getTime()+(d.getTimezoneOffset()*60000);return new Date(utc+(3600000*offset));}};
if(typeof(SNI.CC.Omniture)=='undefined'){SNI.CC.Omniture={};}
SNI.CC.Omniture.MultiVar=SNI.Omniture.MultiVar;SNI.CC.Omniture.SingleVar=SNI.Omniture.SingleVar;SNI.CC.Omniture.CrossLinkTrack=SNI.Omniture.CrossLinkTrack;
if(typeof(SNI.ShareThis)=='undefined'){SNI.ShareThis={};}
SNI.ShareThis={JS:"http://w.sharethis.com/button/sharethis.js#publisher=87e14ce7-dc4d-40d2-ada1-38b20bfad22c&amp;type=website&amp;post_services=facebook%2Ctwitter%2Cgbuzz%2Cmyspace%2Cdigg%2Csms%2Cwindows_live%2Cdelicious%2Cstumbleupon%2Creddit%2Cgoogle_bmarks%2Clinkedin%2Cbebo%2Cybuzz%2Cblogger%2Cyahoo_bmarks%2Cmixx%2Ctechnorati%2Cfriendfeed%2Cpropeller%2Cwordpress%2Cnewsvine&button=false",load:function(type){var shared_object=SNI.ShareThis.obj.addEntry({title:mdManager.getPageTitle(),url:document.URL},{button:false,onmouseover:false});switch(type){case"recipe-tools":shared_object.attachChicklet("facebook",document.getElementById("st-rtools-fb"));shared_object.attachChicklet("twitter",document.getElementById("st-rtools-tw"));break;case"toolbar":shared_object.attachButton(document.getElementById('st-toolbar'));break;case"photoGallery":var share_url=SNI.Util.Url.setParameter(document.location.href,"soc","share");var page_title=jQuery("<div>"+mdManager.getPageTitle()+"</div>").text();var facebook_shared_object=SHARETHIS.addEntry({title:page_title,url:share_url});var twitter_shared_object=SHARETHIS.addEntry({title:page_title+" #CookingChannel ",url:share_url});facebook_shared_object.attachChicklet("facebook",SNI.CC.PhotoGallery.Components.endframe_info.find(".pg-share .facebook a")[0]);twitter_shared_object.attachChicklet("twitter",SNI.CC.PhotoGallery.Components.endframe_info.find(".pg-share .twitter a")[0]);SNI.CC.PhotoGallery.Components.endframe_info.find(".pg-share li a").click(function(){return false;});break;default:break;}},toolbar:function(){$.getScript(SNI.ShareThis.JS,function(){SHARETHIS.onReady();SNI.ShareThis.obj=SHARETHIS;SNI.ShareThis.load('toolbar');});},recipeTools:function(){$(function(){if(typeof SNI.ShareThis.obj=='object'){SNI.ShareThis.load('recipe-tools');}else{$.getScript(SNI.ShareThis.JS,function(){SHARETHIS.onReady();SNI.ShareThis.obj=SHARETHIS;SNI.ShareThis.load('recipe-tools');});}});},photoGallery:function(){$(function(){if(typeof SNI.ShareThis.obj=='object'){SNI.ShareThis.load('photoGallery');}else{$.getScript(SNI.ShareThis.JS,function(){SHARETHIS.onReady();SNI.ShareThis.obj=SHARETHIS;SNI.ShareThis.load('photoGallery');});}});}};
if(typeof(SNI.CC.RecipeTools)=="undefined"){SNI.CC.RecipeTools={};}
SNI.CC.RecipeTools=function(){SNI.ShareThis.recipeTools();var emailFlyout=$('#email-a-friend');SNI.CC.Toolbar.revealModule(".email",emailFlyout,"#recipe-tools");$("#st-rtools-fb , #st-rtools-tw").click(function(){return false;});};
SNI.CC.Newsletter={subscribe:function(){SNI.CC.Newsletter.moreNewsletters();SNI.CC.Newsletter.checkAll();SNI.CC.Newsletter.closeErrors();$('.newsletter form').validate({errorContainer:'.newsletter .form-errors',errorLabelContainer:'.newsletter .form-errors ul',wrapper:"li",rules:{list:'required',FIRST_NAME_:'required',LAST_NAME_:'required',email:{required:true,email:true},email_confirm:{required:true,equalTo:'#email'},POSTAL_CODE_:'required',agreement:{required:function(element){return $("#sni_agree:checked").length<1;}}},messages:{list:'Please check the Newsletter you wish to receive.',FIRST_NAME_:'Please enter your first name.',LAST_NAME_:'Please enter your last name.',email:{required:'Please enter your e-mail address.',email:'Please check the format of your e-mail address and re-enter (i.e. sue@cookingchanneltv.com).'},email_confirm:{required:'Please confirm your e-mail address.',equalTo:'Please make sure your e-mail and confirmation e-mail match.'},POSTAL_CODE_:'Please enter your zip code.',agreement:'Please agree to Cooking Channel\'s Privacy Policy.'},showErrors:function(errorMap,errorList){if(errorList.length){if(errorMap.newsletter){$('.newsletter .newsletter-error').show();}else{$('.newsletter .newsletter-error').hide();}
if(errorMap.agreement){$('.newsletter .agreement-error').show();}else{$('.newsletter .agreement-error').hide();}
this.defaultShowErrors();SNI.CC.Newsletter.scrollTop();}}});},changeEmail:function(){SNI.CC.Newsletter.closeErrors();$('.newsletter form').validate({errorContainer:'.newsletter .form-errors',errorLabelContainer:'.newsletter .form-errors ul',wrapper:"li",rules:{email:{required:true,email:true},emailnew:{required:true,email:true},emailnew_confirm:{required:true,equalTo:'#emailnew'}},messages:{email:{required:'Please enter your old e-mail address.',email:'Please check the format of your old e-mail address and re-enter (i.e. sue@cookingchanneltv.com).'},emailnew:{required:'Please enter your e-mail address.',email:'Please check the format of your e-mail address and re-enter (i.e. sue@cookingchanneltv.com).'},emailnew_confirm:{required:'Please confirm your e-mail address.',equalTo:'Please make sure your e-mail and confirmation e-mail match.'}},showErrors:function(errorMap,errorList){if(errorList.length){this.defaultShowErrors();SNI.CC.Newsletter.scrollTop();}}});},unsubscribe:function(){SNI.CC.Newsletter.moreNewsletters();SNI.CC.Newsletter.checkAll();SNI.CC.Newsletter.closeErrors();$('.newsletter form').validate({errorContainer:'.newsletter .form-errors',errorLabelContainer:'.newsletter .form-errors ul',wrapper:"li",rules:{newsletter:{required:function(element){return $(".newsletter .choose input:checked").length<1;}},email:{required:true,email:true},email_confirm:{required:true,equalTo:'#email'}},messages:{newsletter:'Please check the Newsletter you wish to unsubscribe from.',email:{required:'Please enter your e-mail address.',email:'Please check the format of your e-mail address and re-enter (i.e. sue@cookingchanneltv.com).'},email_confirm:{required:'Please confirm your e-mail address.',equalTo:'Please make sure your e-mail and confirmation e-mail match.'}},showErrors:function(errorMap,errorList){if(errorList.length){if(errorMap.newsletter){$('.newsletter .newsletter-error').show();}else{$('.newsletter .newsletter-error').hide();}
this.defaultShowErrors();SNI.CC.Newsletter.scrollTop();}}});},thanks:function(){SNI.CC.Newsletter.moreNewsletters();SNI.CC.Newsletter.checkAll();},closeErrors:function(){$('.newsletter .form-errors .close').click(function(){$('.newsletter .form-errors').slideUp();});},moreNewsletters:function(){$('.newsletter .more-newsletters h4 a').click(function(){var link=$(this);if(link.hasClass('active')){link.removeClass('active')
$('.newsletter .more-newsletters .bd').slideUp(SNI.Config.animationSpeed);link.blur();}else{link.addClass('active');$('.newsletter .more-newsletters .bd').slideDown(SNI.Config.animationSpeed);link.blur();}
return false;});},checkAll:function(){$('.newsletter .more-newsletters .check-all').click(function(){var link=$(this);var text=link.find('span');if(text.text()=='Check All'){text.text('Uncheck All');$('.newsletter .more-newsletters input').attr('checked','checked');}else{text.text('Check All');$('.newsletter .more-newsletters input').removeAttr('checked');}
return false});},scrollTop:function(){var winOffset=70;var win=$(window);var winTop=win.scrollTop()+winOffset;var errorTop=$('.newsletter .form-errors').offset().top;if(errorTop<winTop){win.scrollTop(errorTop-winOffset);}}};
$.validator.setDefaults({errorElement:'span',onfocusout:false,onkeyup:false,onclick:false,highlight:function(element,errorClass){$(element).addClass(errorClass);$(element.form).find("label[for="+element.id+"]").addClass(errorClass);},unhighlight:function(element,errorClass){$(element).removeClass(errorClass);$(element.form).find("label[for="+element.id+"]").removeClass(errorClass);}});$.validator.addMethod("spaces",function(value,element){return this.optional(element)||value.indexOf(' ')==-1;},"Spaces are not allowed");$.validator.addMethod("multipleEmails",function(value,element){if(this.optional(element)){return true;}
var friendsEmails=value.split(",");var isEmail=true;$.each(friendsEmails,function(){var patternTest=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test($.trim(this));if(patternTest==false){isEmail=false;};});return isEmail;},"One of these is not a valid e-mail address");
SNI.CC.Contact={contactContainer:'.newsletter',contactForm:'#contact-form',Init:function(){var flashVersion;$("#contact-form input[name|='optionaldata13']").val(navigator.userAgent)
if(swfobject){flashVersion=swfobject.getFlashPlayerVersion();$("#contact-form input[name|='optionaldata14']").val(flashVersion.major+"."+flashVersion.minor+"."+flashVersion.release);}
$("#contact-form input[name|='optionaldata15']").val(SNI.Community.UR.ViewingUserId);$('.contact-select').dropdown();SNI.CC.Contact.closeErrors();$("#contact-form").validate({errorContainer:this.contactContainer+' .form-errors',errorLabelContainer:this.contactContainer+' .form-errors ul',wrapper:"li",rules:{optionaldata5:'required',optionaldata6:'required',email:{required:true,email:true},confirm:{required:true,equalTo:'#email'},fname:'required',lname:'required',optionaldata4:'required',optionaldata7:{required:true,minlength:6}},messages:{optionaldata5:'Please select a Reason for Contacting Us.',optionaldata6:'Please provide more detail about your Reason for Contacting Us.',email:{required:'Please enter your e-mail address.',email:'Please check the format of your e-mail address and re-enter (i.e. sue@cookingchanneltv.com).'},confirm:{required:'Please confirm your e-mail address.',equalTo:'Please make sure your e-mail and confirmation e-mail match.'},fname:'Please enter your first name.',lname:'Please enter your last name.',optionaldata4:'Please enter your zip code.',optionaldata7:{required:'Please enter a message.',minlength:'Please make sure your message is at least 6 characters long.'}}});},closeErrors:function(){$(SNI.CC.Contact.contactContainer+' .form-errors .close').click(function(){$(SNI.CC.Contact.contactContainer+' .form-errors').slideUp();});}};
if(typeof(SNI.CC.IS)=='undefined'){SNI.CC.IS={};}
SNI.CC.IS.FB={};SNI.CC.IS.FB.like=function(config){config=$.extend({'layout':'button_count','show_faces':'true','width':'50','font':'trebuchet ms','colorscheme':'light'},config);return SNI.IS.FB.like(config);};
if(typeof(SNI.CC.PhotoGallery)=='undefined'){SNI.CC.PhotoGallery={};}
SNI.CC.PhotoGallery={State:{image_data:null,current_index:0,num_frames:0},Components:{gallery_element:null},setComponents:function(){var components=SNI.CC.PhotoGallery.Components;if(!jQuery.isEmptyObject(components.gallery_element)){components.gallery_element=$(components.gallery_element);components.photo_display=components.gallery_element.find(".pg-viewport .pg-photo-display-wrapper");components.count_label=components.gallery_element.find(".pg-navigation .pg-photo-count .count");components.thumbnails_button=components.gallery_element.find(".pg-navigation a.pg-thumbnails-button");components.thumbnails_frame=components.gallery_element.find(".pg-navigation .pg-thumbnails-frame");components.next_button=components.gallery_element.find(".pg-navigation .pg-next");components.previous_button=components.gallery_element.find(".pg-navigation .pg-previous");components.template_element=components.photo_display.children(".pg-photo-wrapper");components.photo_description=components.gallery_element.find(".pg-viewport .pg-photo-description");components.photo_author=components.gallery_element.find(".pg-author");components.caption_head=components.photo_description.children("h2");components.caption=components.photo_description.children("p");components.endframe_conatainer=components.gallery_element.find(".pg-endframe");components.endframe_info=components.gallery_element.find(".pg-viewport .pg-endframe-info");components.ymal=components.gallery_element.find(".pg-you-might-like");components.ymal_list=components.ymal.find("ul");components.endframe_conatainer.find("div.thumb a,h3 a.next-title,div.content h4 a").click(function(e){var link=$(this);var title=link.attr("title")||link.text();var params={section:"Cook:Photo Gallery",module:"EF:"+title,linkText:"Related Photo Gallery: "+title};SNI.Omniture.dynamicSingleVar(params);});return true;}else{return false;}},loadState:function(){SNI.CC.PhotoGallery.State.image_data=SNI.Config.PhotoGallery.images;SNI.CC.PhotoGallery.State.num_frames=SNI.Config.PhotoGallery.images.length+1;SNI.CC.PhotoGallery.State.current_index=SNI.Config.PhotoGallery.current_index;SNI.CC.PhotoGallery.State.loader_img=new Image();SNI.CC.PhotoGallery.State.loader_img.src=SNI.Config.PhotoGallery.thumbnail_loader;if(SNI.CC.PhotoGallery.State.current_index<SNI.Config.PhotoGallery.images.length){var first_data=SNI.CC.PhotoGallery.State.image_data[SNI.CC.PhotoGallery.State.current_index];first_data.image_wrapper=SNI.CC.PhotoGallery.Components.template_element;first_data.image_wrapper.find("a.photo").click(function(e){SNI.CC.PhotoGallery.nextPhoto(e);var gallery_title=mdManager.getParameter('Title');var omniParams={section:"COOK : Photo Gallery",module:(gallery_title),linkText:"Photo Click:"+SNI.CC.PhotoGallery.State.current_index};SNI.Omniture.dynamicSingleVar(omniParams);return false;});if(first_data.bvert){SNI.CC.PhotoGallery.setupToggler(first_data.image_wrapper.children(".pg-toggler"));}else{first_data.image_wrapper.removeClass("pg-fitted");}}
SNI.CC.PhotoGallery.State.image_data.push({iid:"endframe",image_wrapper:$(SNI.CC.PhotoGallery.Components.photo_display).children(".pg-endframe")});SNI.CC.DynamicAds.init({container:SNI.CC.PhotoGallery.Components.gallery_element,insert_tgt:SNI.CC.PhotoGallery.Components.photo_display,dismiss_elts:[SNI.CC.PhotoGallery.Components.next_button,SNI.CC.PhotoGallery.Components.previous_button,SNI.CC.PhotoGallery.Components.thumbnails_button]});},displayEndframe:function(index){SNI.CC.PhotoGallery.Components.photo_description.hide();SNI.CC.PhotoGallery.Components.photo_author.hide();SNI.CC.PhotoGallery.Components.ymal.hide();SNI.CC.PhotoGallery.Components.endframe_info.show();SNI.CC.PhotoGallery.Components.gallery_element.removeClass("pg-loading");SNI.CC.PhotoGallery.Components.photo_display.children(":visible").hide();SNI.CC.PhotoGallery.State.image_data[index].image_wrapper.fadeIn(SNI.Config.PhotoGallery.animationSpeed);},setCaption:function(index){var caption_length=SNI.Config.PhotoGallery.longCaptionLength;var image_data_obj=SNI.CC.PhotoGallery.State.image_data[index];if(image_data_obj.ititle.length>SNI.Config.PhotoGallery.longTitleLength){caption_length=SNI.Config.PhotoGallery.shortCaptionLength;}
SNI.CC.PhotoGallery.Components.caption_head.html(image_data_obj.ititle);SNI.CC.PhotoGallery.Components.caption.html(image_data_obj.icap);},setYouMightAlsoLike:function(index){var image_data_obj=SNI.CC.PhotoGallery.State.image_data[index];if(image_data_obj.rtitle&&image_data_obj.rtitle!=""){SNI.CC.PhotoGallery.Components.ymal.show();SNI.CC.PhotoGallery.Components.ymal.html('<h4 class="slug">'+image_data_obj.rtxt+'</h4><li><a href="'+image_data_obj.rurl+'">'+image_data_obj.rtitle+'</a></li>');}else{SNI.CC.PhotoGallery.Components.ymal.hide();}},setAuthor:function(index){var image_data_obj=SNI.CC.PhotoGallery.State.image_data[index];if(image_data_obj.creator){SNI.CC.PhotoGallery.Components.photo_author.children(".pg-author-name").html(image_data_obj.creator);SNI.CC.PhotoGallery.Components.photo_author.show();}else{SNI.CC.PhotoGallery.Components.photo_author.hide();}},dynamicOmniture:function(i){++i;if(mdManager.getParameterString("oUrl")==""){mdManager.setParameter("oUrl",mdManager.getParameterString("Url"));}
mdManager.setParameter("Url",mdManager.getParameter("oUrl")+"?i="+parseInt(i,10));if(i<10){i='0'+parseInt(i,10);}
mdManager.setParameter("UniqueId",mdManager.getParameterString("UniqueId").replace(/(.*?)-([0-9]{1,2})$/,"$1-"+i));if(typeof s=="object"){s.t();}
return;},createImageWrapper:function(current_data){clone=SNI.CC.PhotoGallery.Components.template_element.clone();clone.attr("id","pg-photo-"+current_data.iid).removeAttr("style").hide();clone_image=clone.find("a img");clone_image.attr("alt",current_data.ialt).removeAttr("style");clone.appendTo(SNI.CC.PhotoGallery.Components.photo_display);current_data.image_wrapper=clone;new_image=new Image();current_data.image_wrapper.find("a.photo").click(function(e){SNI.CC.PhotoGallery.nextPhoto(e);var gallery_title=mdManager.getParameter('Title');var omniParams={section:"COOK : Photo Gallery",module:(gallery_title),linkText:"Photo Click:"+SNI.CC.PhotoGallery.State.current_index};SNI.Omniture.dynamicSingleVar(omniParams);return false;});if(current_data.bvert){SNI.CC.PhotoGallery.setupToggler(current_data.image_wrapper.children(".pg-toggler"));}else{current_data.image_wrapper.removeClass("pg-fitted");}
jQuery(new_image).load(function(response,status,xhr){clone_image.attr("src",new_image.src);SNI.CC.PhotoGallery.Components.gallery_element.removeClass("pg-loading");SNI.CC.PhotoGallery.Components.photo_display.children(".pg-photo-wrapper, .pg-endframe").hide();clone.fadeIn(SNI.Config.PhotoGallery.animationSpeed);}).error(function(){SNI.CC.PhotoGallery.Components.gallery_element.removeClass("pg-loading");SNI.CC.PhotoGallery.Components.gallery_element.addClass("pg-errored");});new_image.src=current_data.iurl;},init:function(element,config){if(typeof(SNI.Config.Global)=='undefined'){SNI.Config.Global={};}
if(typeof(SNI.Config.PhotoGallery)=='undefined'){SNI.Config.PhotoGallery={};}
SNI.Config.PhotoGallery=$.extend({current_index:0,thumbnail_loader:"../imgs/le/cc-loader.gif",default_product_image_sm:"../imgs/le/product_unavailable_sm.jpg",default_product_image_lg:"../imgs/le/product_unavailable_al.jpg",longCaptionLength:207,longTitleLength:41,shortCaptionLength:157,imageWidthNarrow:'346px',imageWidthWide:'616px',images:null},SNI.Config.Global,SNI.Config.PhotoGallery,config);SNI.CC.PhotoGallery.Components.gallery_element=$(element);if(!SNI.CC.PhotoGallery.setComponents()){return false;}
SNI.CC.PhotoGallery.loadState();SNI.CC.PhotoGallery.Components.thumbnails_button.click(SNI.CC.PhotoGallery.toggleThumbnails);SNI.CC.PhotoGallery.Components.previous_button.click(SNI.CC.PhotoGallery.previousPhoto);SNI.CC.PhotoGallery.Components.next_button.click(SNI.CC.PhotoGallery.nextPhoto);SNI.CC.PhotoGallery.Components.gallery_element.find(".pg-error button").click(function(e){SNI.CC.PhotoGallery.goToPhoto(SNI.CC.PhotoGallery.State.current_index);e.preventDefault();});local_config={fontResize:{textContainer:".pg-viewport .pg-photo-description"}};SNI.CC.Toolbar.fontResize(local_config);SNI.CC.PhotoGallery.goToPhoto(SNI.CC.PhotoGallery.State.current_index,true);SNI.ShareThis.photoGallery();SNI.CC.IS.FB.like({element:"li#fb-like"});},goToPhoto:function(index,bFirst){bFirst=(bFirst===true)||false;if(SNI.CC.PhotoGallery.Components.gallery_element.hasClass("pg-errored")){SNI.CC.PhotoGallery.Components.gallery_element.removeClass("pg-errored");}
if(!SNI.CC.PhotoGallery.Components.gallery_element.hasClass("pg-loading")){SNI.CC.PhotoGallery.Components.gallery_element.addClass("pg-loading");if(!bFirst){SNI.DynamicAds.refresh();}
SNI.CC.PhotoGallery.State.current_index=index;SNI.CC.PhotoGallery.dynamicOmniture(index);SNI.CC.PhotoGallery.setupControls(index);var image_data_obj=SNI.CC.PhotoGallery.State.image_data[index];if(image_data_obj.iid=="endframe"){SNI.CC.PhotoGallery.displayEndframe(index);return;}
SNI.CC.PhotoGallery.Components.photo_description.show();SNI.CC.PhotoGallery.Components.endframe_info.hide();SNI.CC.PhotoGallery.setCaption(index);SNI.CC.PhotoGallery.setYouMightAlsoLike(index);SNI.CC.PhotoGallery.setAuthor(index);if(!image_data_obj.image_wrapper){SNI.CC.PhotoGallery.createImageWrapper(image_data_obj);}else{SNI.CC.PhotoGallery.Components.gallery_element.removeClass("pg-loading");SNI.CC.PhotoGallery.Components.photo_display.children(":visible").not(image_data_obj.image_wrapper).hide();image_data_obj.image_wrapper.fadeIn(SNI.Config.PhotoGallery.animationSpeed);}
if(!bFirst){SNI.Nielsen.trackNSE();}
SNI.CC.PhotoGallery.State.current_index=index;}},previousPhoto:function(e){if(!SNI.CC.PhotoGallery.Components.previous_button.hasClass("pg-disabled")){if(SNI.CC.PhotoGallery.Components.gallery_element.hasClass("pg-errored")){SNI.CC.PhotoGallery.Components.gallery_element.removeClass("pg-errored");}
if($(this).data("block")!="yes"){SNI.CC.PhotoGallery.goToPhoto(SNI.CC.PhotoGallery.State.current_index-1);}}
return false;},nextPhoto:function(e){if(!SNI.CC.PhotoGallery.Components.next_button.hasClass("pg-disabled")){if(SNI.CC.PhotoGallery.Components.gallery_element.hasClass("pg-errored")){SNI.CC.PhotoGallery.Components.gallery_element.removeClass("pg-errored");}
if($(this).data("block")!="yes"){SNI.CC.PhotoGallery.goToPhoto((SNI.CC.PhotoGallery.State.current_index+1)%SNI.CC.PhotoGallery.State.num_frames);}}
return false;},_load_once:function(){SNI.CC.PhotoGallery.Components.thumbnails_frame.click(function(e){e.stopPropagation();});SNI.CC.PhotoGallery.Components.thumbnails_frame.find(".hd span.pg-close-btn").click(function(e){SNI.CC.PhotoGallery.hideThumbnails(e);});SNI.CC.PhotoGallery.Components.thumbnails_frame.find(".pg-thumbnails li").each(function(index){$(this).click(function(e){SNI.CC.PhotoGallery.State.inter_next=true;SNI.CC.PhotoGallery.goToPhoto(index);SNI.CC.PhotoGallery.hideThumbnails(e);e.stopPropagation();});var thumb_container=$(this).children(".pg-thumbnail");var thumb=thumb_container.children("img");thumb.attr("src",SNI.CC.PhotoGallery.State.loader_img.src);var img=new Image();$(img).load(function(){thumb_container.removeClass("pg-thumbnails-loading");thumb.attr("src",img.src);});thumb_container.addClass("pg-thumbnails-loading");img.src=thumb.attr("data-src");});$(document).click(function(e){SNI.CC.PhotoGallery.hideThumbnails(e);});SNI.CC.PhotoGallery._load_once=function(){return;}},showThumbnails:function(e){if(!SNI.CC.PhotoGallery.Components.gallery_element.hasClass("pg-loading")){SNI.CC.PhotoGallery._load_once();SNI.CC.PhotoGallery.Components.thumbnails_button.addClass("selected");SNI.CC.PhotoGallery.Components.thumbnails_frame.fadeIn(SNI.Config.PhotoGallery.animationSpeed);}
e.stopPropagation();},selectThumbnail:function(index){SNI.CC.PhotoGallery.Components.thumbnails_frame.find(".pg-thumbnails li.pg-selected-thumbnail").removeClass("pg-selected-thumbnail");SNI.CC.PhotoGallery.Components.thumbnails_frame.find(".pg-thumbnails li:eq("+index+")").addClass("pg-selected-thumbnail");},hideThumbnails:function(e){SNI.CC.PhotoGallery.Components.thumbnails_button.removeClass("selected");SNI.CC.PhotoGallery.Components.thumbnails_frame.fadeOut(SNI.Config.PhotoGallery.animationSpeed);e.stopPropagation();},toggleThumbnails:function(e){if(!SNI.CC.PhotoGallery.Components.gallery_element.hasClass("pg-loading")){SNI.CC.PhotoGallery._load_once();if(SNI.CC.PhotoGallery.Components.thumbnails_button.hasClass("selected")){SNI.CC.PhotoGallery.Components.thumbnails_button.removeClass("selected");}else{SNI.CC.PhotoGallery.Components.thumbnails_button.addClass("selected");}
SNI.CC.PhotoGallery.Components.thumbnails_frame.animate({duration:SNI.Config.PhotoGallery.animationSpeed,opacity:'toggle'});}
e.stopPropagation();},setupToggler:function(toggler){var container=toggler.parent();var image=container.find("a.photo img");container.addClass("pg-fitted");toggler.toggle(function(){container.add(image).animate({width:SNI.Config.PhotoGallery.imageWidthWide},SNI.Config.PhotoGallery.animationSpeed);toggler.children().toggle();},function(){container.add(image).animate({width:SNI.Config.PhotoGallery.imageWidthNarrow},SNI.Config.PhotoGallery.animationSpeed);toggler.children().toggle();});},setupControls:function(index){SNI.CC.PhotoGallery.selectThumbnail(index);SNI.CC.PhotoGallery.Components.count_label.html(index+1);if(index>0){SNI.CC.PhotoGallery.Components.previous_button.removeClass("pg-disabled");SNI.CC.PhotoGallery.Components.previous_button.attr("href",SNI.CC.PhotoGallery.State.image_data[index-1].pgUrl);}else{SNI.CC.PhotoGallery.Components.previous_button.addClass("pg-disabled");}
SNI.CC.PhotoGallery.Components.next_button.attr("href",SNI.CC.PhotoGallery.State.image_data[(index+1)%SNI.CC.PhotoGallery.State.num_frames].pgUrl);}}
SNI=SNI||{};SNI.CC=SNI.CC||{};SNI.CC.DynamicAds=SNI.DynamicAds;SNI.CC.DynamicAds=(function(d){d.fmt_interstitial=function(){var hRet="";hRet+='<div class="pg-inter-wrap">';hRet+='<a href="#" class="close"><span></span>Continue to Next Photo</a>';hRet+='<h6 class="mrec">Advertisement</h6>';hRet+='<div class="pg-inter-container">';if(d.iparm.iFmt.toLowerCase()=="swf"){hRet+='<div id="interad">'
+'<a class="no-flash-message" href="http://www.adobe.com/go/getflashplayer">'
+'<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />'
+'</a>'
+'</div>';}else{if(d.iparm.iHREF!=""){hRet+='<a href="'+d.iparm.iHREF+'">';}
hRet+='<img src ="'+d.iparm.iURL+'" />';if(d.iparm.iHREF!=""){hRet+='</a>';}}
hRet+='<iframe class="tracker" width="0" height="0" frameborder="0"></iframe>';hRet+='</div>';hRet+='</div>';return hRet;}
return d;})(SNI.CC.DynamicAds);
if(typeof(SNI.CC.Topic)=="undefined"){SNI.CC.Topic={};}
SNI.CC.Topic={TopicFilterInitialize:function(topic,pag,filter){var url=document.location.href;var it=(url.split('#'));if(it.length>1){if(it[1]!=null&&it[1]!=''){var tvalues=it[1].split("/");if(tvalues.length>=3){topic=tvalues[0];filter=tvalues[1];pag=tvalues[2];}}}
urlload="/topics/search/"+topic+"/"+filter+"/index.html?No="+pag;$("div#inside-food-list").load(urlload);},changeTopic:function(topic,pageNum,href){var url="/topics/search/"+topic;var it=href.split('/');if(pageNum!=''&&pageNum!=0){pageNum=1;}
$('input[name=hiddenFilter]').attr('value',it[3]);url+='/'+it[3]+"/";if($('input[name=hiddenType]').val()!=''){url+="type_"+$('input[name=hiddenType]').val()+"/index.html";}
else{url+="index.html";}
document.location.href='#'+topic+'/'+it[3]+'/'+pageNum;$("div#inside-food-list").load(url,function(){$('div#inside-food div.loader').hide();});SNI.Nielsen.trackNSE();},pagi:function(topic,pageNum,href,filter){var urlload="/topics/search/"+topic+'/';$('input[name=hiddenFilter]').val(filter);urlload+=filter+'/'
if($('input[name=hiddenType]').val()!=''){urlload+="type_"+$('input[name=hiddenType]').val()+"/index.html";}else{urlload+="index.html";}
if(pageNum>0){urlload+="?No="+pageNum;}
document.location.href='#'+topic+"/"+filter+'/'+pageNum;$("div#inside-food-list").load(urlload,function(){var goHere=$('div#inside-food-list').offset().top-14;$('html,body').animate({scrollTop:goHere},500);});SNI.Nielsen.trackNSE();},init:function(topic,pageNum,filter){$('div#inside-food-list a.topicLink').live('click',function(e){e.preventDefault();var href=$(this).attr("href");var index=href.indexOf('/topics/');href=href.slice(index);$('div#inside-food div.loader').show();SNI.CC.Topic.changeTopic(topic,pageNum,href);});$('select#typeSelect').live('change',function(e){var url="/topics/search/"+topic+"/";$('input[name=hiddenType]').val($("select option:selected").val());var $curr_selection=$("select option:selected");if($('input[name=hiddenFilter]').val()!=''){url+=$('input[name=hiddenFilter]').val()+"/";}
url+="type_"+$("select option:selected").val()+"/index.html";$("div#inside-food-list").load(url);$curr_selection.addClass('select-title');})
$('div#inside-food-list div.pagi a').live('click',function(e){e.preventDefault();var href=$(this).attr('href');var nextPage=href.slice(href.indexOf('page-'));nextPage=nextPage.replace('.html','').replace('page-','');var index=href.indexOf('/topics/');var it=href.slice(index);var filterArr=it.split('/');var newFilter=filterArr[3];SNI.CC.Topic.pagi(topic,nextPage,href,newFilter);});SNI.CC.Topic.TopicFilterInitialize(topic,pageNum,filter);}};
if(typeof(SNI.CC.Menu)=="undefined"){SNI.CC.Menu={};}
SNI.CC.Menu={formTarget:'',init:function(){$("a#lnkPrintMenu").click(function(){$("div#menu-list").removeClass("show");$("div#selectPrint").removeClass("hide");$("div#menu-list").addClass("hide");$("div#selectPrint").addClass("show");$(".itemsel input:checkbox").attr("checked","checked");$(".itemsel a.submit").parent().removeClass("dis");$(".menusumm").addClass("printdlgact");return false;});$("ul#ulChooseItems input:checkbox").click(function(){var numChecked=$("ul#ulChooseItems input:checked").length;if(numChecked){$("ul#ulChooseItems  a.submit").parent().removeClass("dis");}else{$("ul#ulChooseItems  a.submit").parent().addClass("dis");}
if($("ul#ulChooseItems input:checked").length==0){$("ul#ulChooseItems  a.submit").parent().addClass("dis");}else if($(".itemsel a.submit").parent().hasClass("dis")){$(".itemsel a.submit").parent().removeClass("dis");}});$('a#prSubmit.button').click(function(e){if(SNI.CC.Menu.formTarget==''){SNI.CC.Menu.formTarget=$('a#prSubmit.button').attr('href');}else{$('a#prSubmit.button').attr('href',SNI.CC.Menu.formTarget);}
var recipes='|';var count=0;$('ul#ulChooseItems li input').each(function(){$currCk=$(this);var ckd=$currCk.attr('checked');if(ckd){recipes=recipes+count+'|';}
count++;});var tail=',00.html';var head=$('a#prSubmit.button').attr('href').split(tail)[0];if(head.indexOf('PRINT')<1){head=head+'_PRINT';}
var newhref=head+recipes+tail;$('a#prSubmit.button').attr('href',newhref);return true;});$("#selectPrint #closePrint .btnClose, a.printCancel").click(function(e){$("div#selectPrint").removeClass("show");$("div#menu-list").removeClass("hide");$("div#menu-list").addClass("show");$("div#selectPrint").addClass("hide");return false;});}};
SNI.Community.UR.extendedInit=function(){if((SNI.Util.Cookie.get('userLoginCookie')!=null||SNI.Util.Cookie.get('userRoleCookie')!=null||SNI.Util.Cookie.get('value')!=null||SNI.Util.Cookie.get('role')!=null)&&SNI.Util.Cookie.get("SMSESSION")==null){SNI.Community.UR.deleteCookieForLegacyUR2Cookies('userIdCookie');SNI.Community.UR.deleteCookieForLegacyUR2Cookies('role');SNI.Community.UR.deleteCookieForLegacyUR2Cookies('userLoginCookie');SNI.Community.UR.deleteCookieForLegacyUR2Cookies('userRoleCookie');SNI.Community.UR.deleteCookieForLegacyUR2Cookies('value');}
$.extend(true,SNI,{Community:{}});SNI.Community.mainSiteDomain="http://"+SNI.Config.domain;SNI.Community.ur3Domain="http://"+SNI.Config.Community.ur3Domain;SNI.Community.xUrlPre=SNI.Config.Community.xUrlPre;if(typeof SNI.Community.siteName=='string'){if(typeof this.ViewingUserName=='string'){this.logged_in=true;}}else{var user=new SNI.UR.UrUser(new SNI.UR.ApplicationConfig());if(user.isLoggedIn==true){this.ViewingUserId=user.getUserId();this.ViewingUserName=user.getEmail();this.ViewingUserDisplayName=user.getUserName();this.logged_in=true;}}};SNI.Community.UR.deleteCookieForLegacyUR2Cookies=function(name){var baseDomain=document.location.href;var colon_double_fwd_slash=baseDomain.indexOf("://");var first_fwd_slash=baseDomain.indexOf("/",(colon_double_fwd_slash+3));var base=baseDomain.substring((colon_double_fwd_slash+3),first_fwd_slash);var mySplitResult=base.split(".");var domain="."+mySplitResult[mySplitResult.length-2]+"."+mySplitResult[mySplitResult.length-1];document.cookie=name+"=;domain="+domain+";path=/;expires=Thu, 01-Jan-1970 00:00:01 GMT";};SNI.Community.UR.logout=function(config){window.location.href=SNI.Community.ur3Domain+"/redirectors/logout_redirector.jsp?DEST_URL="+escape(window.location.toString());return;var config=$.extend(true,{iframeName:'logoutContainer',iframeClass:'logoutContainer',checkInterval:1000,maxCheckTime:30000},config);var checkCount=0;var maxCheckCount=parseInt(config.maxCheckTime/config.checkInterval);var originalHref=window.location.toString();var unauthHrefPattern=/login.esi/gi;var isSafari=(/Safari/.test(navigator.userAgent));if(isSafari){window.location.href=SNI.Community.ur3Domain+"/redirectors/logout_redirector.jsp?DEST_URL="+escape(originalHref);}
var iframeHtml='<iframe'
+' name="'+config.iframeName+'"'
+' class="'+config.iframeClass+'"'
+' src="'+SNI.Community.ur3Domain+"/redirectors/logout_redirector.jsp?DEST_URL="+escape(originalHref)+'"'
+'" width="0" height="0" frameborder="0" style="width:0; height:0; position:absolute; left:-9999px;"></iframe>';$('#ur-header-links').append(iframeHtml);var checkLogout=function(){var i;var iframe=null;for(i=0;i<window.frames.length;i++){try{if((window.frames[i].name!==undefined)&&(window.frames[i].name===config.iframeName)){iframe=window.frames[i];break;}}catch(e){}}
if(iframe!==null){try{var currentHref=window.frames[i].location.toString();if(originalHrefPattern.test(currentHref)||unauthHrefPattern.test(currentHref)){window.location=originalHref;return;}}catch(e){}}
checkCount++;if(checkCount<maxCheckCount){setTimeout(checkLogout,config.checkInterval);}else{window.location=originalHref;return;}}
var t=setTimeout(checkLogout,config.checkInterval);};SNI.Community.UR.getLoginLink=function(){return SNI.Community.ur3Domain+"/registration/login.esi?DEST_URL="+escape(window.location.href);};SNI.Community.UR.getRegisterLink=function(){return SNI.Community.ur3Domain+"/registration/register.esi?DEST_URL="+escape(window.location.href);};SNI.Community.UR.getRegisterLiteLink=function(){return SNI.Community.ur3Domain+"/registration/register_lite.esi?DEST_URL="+escape(window.location.href);};SNI.Community.UR.displayName=function(){var name=this.ViewingUserDisplayName;if(typeof name!='string'||name==''){var email=this.ViewingUserName;if(typeof email=="string"&&email.indexOf('@')!=-1){return email.substring(0,email.indexOf('@'));}
return email;}
return name;};SNI.Community.UR.signInWidget=function(el,config){var config=$.extend(true,{callbacks:{preLoggedIn:function(){},postCallback:function(){}},menuItems:[]},config);var $container=$(el);var html=[];var clickHandlerMap={};html.push('<div id="ur-header-links">');if(urUser.isLoggedIn){html.push('<div class="ur-links-wrap clrfix">');html.push('<select style="display: none;" id="ur-actions-dropdown">');$.each(config.menuItems,function(index,element,array){if((element.optionValue!==undefined)&&(element.displayName!==undefined)){html.push('<option value="'+element.optionValue+'">'+element.displayName+'</option>');clickHandlerMap[element.optionValue]=element.click;}});html.push('</select>');html.push('<a class="ur-name" href="'+SNI.Community.ur3Domain+"/community/style.esi"+'">'+SNI.Community.UR.displayName()+'</a>');html.push('</div>');}else{html.push('<p>');html.push('<a class="register" href="'+SNI.Community.UR.getRegisterLink()+'">Sign Up</a> or ');html.push('<a class="sign-in" href="'+SNI.Community.UR.getLoginLink()+'">Sign In</a>');html.push('</p>');}
html.push('</div>');var $widget=$(html.join(''));$container.append($widget);var urDropdown=$("#ur-actions-dropdown");if(urDropdown.size()>0){urDropdown.dropdown();urDropdown.bind("change",function(e){$(this).find("option:selected").each(function(){var urAction=$(this).val();if(clickHandlerMap[urAction]!==undefined){clickHandlerMap[urAction].call();}});});}
config.callbacks.postCallback.call($widget);},SNI.Community.UR.extendedInit();window.urUser=new SNI.UR.UrUser(new SNI.UR.ApplicationConfig());COOKApplicationConfig.prototype=new SNI.UR.ApplicationConfig();function COOKApplicationConfig(){COOKApplicationConfig.prototype=new SNI.UR.ApplicationConfig();this.loginServer["DEV"]="http://snokxuq71.scrippsnetworks.com/snokxuq72/";this.loginServer["STAGE"]="http://snokxuq71.scrippsweb.com/snokxuq72/";this.loginServer["PROD"]="http://www.foodnetwork.com/app/";this.urVersion=function(){return 2;};}

/* -----  Turn off firebug console if not on  ----- */ 
// code yanked from the Yahoo media player. Thanks, Yahoo.
if (! ("console" in window) || !("firebug" in console)) {
    var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group"
                 , "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
    window.console = {};
    for (var i = 0; i <names.length; ++i) window.console[names[i]] = function() {};
}

