/*
 * sni-site-library cooking channel
 * Thu, 02 Sep 2010 10:18:34 -0400
 *
 */


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},config);return $(element+' .crsl-wrap').jCarouselLite({btnNext:config.btnNext,btnPrev:config.btnPrev,visible:config.visible,circular:config.circular,scroll:config.visible,displayPage:(config.displayPage),btnNavigation:(config.displayPage)?false:true,miniNav:config.miniNav,container:element,mouseWheel:true});};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 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={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;}
form.find('input').val()=escape(searchText);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="#">chicken</a>, <a href="#">beef</a>)</li>';html+='      <li><strong>Chef or Host</strong> (e.g. <a href="#">Rachel Ray</a>, <a href="#">Paula Deen</a>)</li>';html+='      <li><strong>Holiday</strong> (e.g. <a href="#">Thanksgiving</a>, <a href="#">Christms</a>)</li>';html+='      <li><strong>Technique</strong> (e.g. <a href="#">grilled</a>, <a href="#">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.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++){if(document.getElementById("progGuide"+i)!=null)
document.getElementById("progGuide"+i).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:{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:'319'},flashvars:{showCarousel:"false",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:{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",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});};
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(typeof(SNI.CC.PrintPages)=="undefined"){SNI.CC.PrintPages={};}
SNI.CC.PrintPages.init=function(){$(".print-options .button").click(function(){window.print();});return;};SNI.CC.PrintPages.footer=function(){now=new Date();outstr='<p>Printed from CookingChannelTV.com on '+now.toDateString()+'</p>';outstr+='<p class="copyright">&#169; Fine Living Network, LLC. All Rights Reserved</p>';document.write(outstr);return;}
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);console.log(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();});
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=a.firstChild.innerHTML.toLowerCase();b=b.firstChild.innerHTML.toLowerCase();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;}},pgHitCount:function(){var myURL;if(location.host=="www.cookingchanneltv.com"){myURL="http://cooktv.sndimg.com/webcook/html/fixHits.html";}else{myURL="http://frontend.scrippsnetworks.com/cooking-channel/fixHits.html";}
if($("#hitCounter").length>0){$("#hitCounter").remove();}
myURL+="?t="+(new Date().getTime());$("head").append('<iframe id="hitCounter" src="'+myURL+'" width="0" height="0" frameborder="0" style="height:0; width:0; display:none;"></iframe>')
return;}};
if(typeof(SNI.CC.Omniture)=='undefined'){SNI.CC.Omniture={};}
SNI.CC.Omniture.MultiVar=SNI.Omniture.MultiVar;SNI.CC.Omniture.SingleVar=SNI.Omniture.SingleVar;
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(){$('.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.PhotoGallery)=='undefined'){SNI.CC.PhotoGallery={};}
SNI.CC.PhotoGallery={State:{image_data:null,inter_next:true,current_index:0,num_frames:0,ad_active:false},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_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.inter_wrap=$('<div class="interwrap"></div>').appendTo(components.photo_display);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);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(null,null,null);},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.hide();clone.attr("id","pg-photo-"+current_data.iid);clone_image=clone.find("a img");clone_image.attr("alt",current_data.ialt);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);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().not(clone).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);SNI.ShareThis.photoGallery();},goToPhoto:function(index){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.removeClass("interstitial-show");SNI.CC.PhotoGallery.State.ad_active=false;SNI.CC.PhotoGallery.Components.gallery_element.addClass("pg-loading");if(SNI.CC.DynamicAds.refresh(SNI.CC.PhotoGallery.Components.inter_wrap)){SNI.CC.PhotoGallery.State.current_index=index;SNI.CC.PhotoGallery.State.ad_active=true;SNI.CC.PhotoGallery.Components.gallery_element.removeClass("pg-loading");SNI.CC.PhotoGallery.Components.gallery_element.addClass("interstitial-show");SNI.CC.PhotoGallery.Components.photo_display.children().hide();return;}
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.State.current_index=index;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);}
SNI.CC.Util.pgHitCount();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((SNI.CC.PhotoGallery.State.ad_active==true)&&(SNI.CC.PhotoGallery.State.inter_next==false)){SNI.CC.PhotoGallery.State.inter_next=false;SNI.CC.PhotoGallery.goToPhoto(SNI.CC.PhotoGallery.State.current_index);}else{SNI.CC.PhotoGallery.State.inter_next=false;SNI.CC.PhotoGallery.goToPhoto(SNI.CC.PhotoGallery.State.current_index-1);}}
e.preventDefault();},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((SNI.CC.PhotoGallery.State.ad_active==true)&&(SNI.CC.PhotoGallery.State.inter_next==true)){SNI.CC.PhotoGallery.State.inter_next=true;SNI.CC.PhotoGallery.goToPhoto(SNI.CC.PhotoGallery.State.current_index);}else{SNI.CC.PhotoGallery.State.inter_next=true;SNI.CC.PhotoGallery.goToPhoto((SNI.CC.PhotoGallery.State.current_index+1)%SNI.CC.PhotoGallery.State.num_frames);}}
e.preventDefault();},_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.CC.DynamicAds={descr:{active:true,refreshRate:4,interstitial:false},iparm:{iURL:"",iFmt:"",iHREF:"",iHeight:"",iWidth:"",iTrackURL:"",bURL:""},impressionCt:0,init:function(descriptor,param_styles,gen_inter_func){descriptor=descriptor||"PHOTO_DESCRIPTOR";param_styles=param_styles||'photoGallery';SNI.CC.DynamicAds.gen_interstitial=gen_inter_func||SNI.CC.DynamicAds.gen_interstitial;myJSON=getDartEnterpriseUrl(descriptor,1);myJSON+="&params.styles="+param_styles+"&callback=?";$.getJSON(myJSON,SNI.CC.DynamicAds.cback_descrJSON);return;},cback_descrJSON:function(oJSON){if(typeof oJSON!="object"){return false;}
if(oJSON.photo_descriptor==undefined){return false;}
oJSON=oJSON.photo_descriptor;if(oJSON.active==undefined){return false;}
if(oJSON.refreshRate==undefined){return false;}
if(oJSON.active!="true"){return false;}
tmp=parseInt(oJSON.refreshRate);if(isNaN(tmp)){return false;}
if(tmp<1||tmp>100){return false;}
SNI.CC.DynamicAds.descr.active=true;SNI.CC.DynamicAds.descr.refreshRate=tmp;if(oJSON.interstitial==undefined){return false;}
if(oJSON.interstitial=="true"){SNI.CC.DynamicAds.descr.interstitial=true;}
return true;},refresh:function(interstitial_selector){if(!this.descr.active){return;}
var interstitial_element=interstitial_selector||'#pgallery3 .interwrap';$(interstitial_element).remove();this.impressionCt++;if(this.impressionCt==this.descr.refreshRate){this.impressionCt=0;if(this.descr.interstitial){myJSON=getDartEnterpriseUrl("PHOTO_INTERSTITIAL",1);myJSON+="&params.styles=photoGallery&callback=?";$.getJSON(myJSON,SNI.CC.DynamicAds.cback_interJSON);return true;}else{setDartEnterpriseBanner("BIGBOX",getDartEnterpriseUrl("BIGBOX",5));}}
return;},cback_interJSON:function(oJSON){$.each(SNI.CC.DynamicAds.iparm,function(key,val){SNI.CC.DynamicAds.iparm[key]="";});if(typeof oJSON!="object"){return false;}
if(typeof oJSON.scrippsads!="object"){return false;}
if(typeof oJSON.scrippsads.ad!="object"){return false;}
for(i=0;i<oJSON.scrippsads.ad.length;++i){if(typeof oJSON.scrippsads.ad[i].position!="object"){return false;}
with(oJSON.scrippsads.ad[i].position){with(SNI.CC.DynamicAds){if((iparm.iURL=="")&&(id=="interstitial")){iparm.iURL=media.src;iparm.iFmt=media.format;iparm.iHREF=media.href;iparm.iHeight=media.height;iparm.iWidth=media.width;if(typeof media.tracking.audit=="object"){iparm.iTrackURL=media.tracking.audit.src;}}
if((iparm.bURL=="")&&(id=="300syncBanner")){iparm.bURL=media.src;}}}}
with(SNI.CC.DynamicAds){if(iparm.iURL==""||iparm.iFmt==""||iparm.bURL==""){return false;}}
SNI.CC.DynamicAds.gen_interstitial();return true;},gen_interstitial:function(){var hRet="";with(SNI.CC.DynamicAds){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(iparm.iFmt.toLowerCase()=="swf"){hRet+='<div id="interad">'
+'<a 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(iparm.iHREF!=""){hRet+='<a href="'+iparm.iHREF+'">';}
hRet+='<img src ="'+iparm.iURL+'" />';if(iparm.iHREF!=""){hRet+='</a>';}}
hRet+='<iframe class="tracker" width="0" height="0" frameborder="0"></iframe>';hRet+='</div>';hRet+='</div>';SNI.CC.PhotoGallery.Components.inter_wrap=$(hRet).appendTo(SNI.CC.PhotoGallery.Components.photo_display);$(SNI.CC.PhotoGallery.Components.inter_wrap).find(".close").click(function(e){SNI.CC.PhotoGallery.Components.gallery_element.removeClass("interstitial-show");if(SNI.CC.PhotoGallery.State.inter_next){SNI.CC.PhotoGallery.nextPhoto(e);}else{SNI.CC.PhotoGallery.previousPhoto(e);}
return false;});if(iparm.iFmt.toLowerCase()=="swf"){swfobject.embedSWF(iparm.iURL,"interad",iparm.iWidth,iparm.iHeight,"9","http://common.scrippsnetworks.com/common/flash-express-install/expressInstall.swf",null,{wmode:"transparent",allowScriptAccess:"always",quality:"high"});}
setDartEnterpriseBanner("BIGBOX",iparm.bURL);$(SNI.CC.PhotoGallery.Components.inter_wrap).find(".tracker").attr("src",iparm.iTrackURL);}
return;}};

/* -----  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() {};
}