/* sni-food.js - Tue, 28 Jun 2011 15:02:26 -0400 */
if( typeof(SNI.Food) == "undefined" ) { SNI.Food = {}; }
SNI.Food.ANIMATION_SPEED = 150;


if(typeof(SNI.Food.GlobalHeader)=="undefined"){SNI.Food.GlobalHeader={};}
SNI.Food.GlobalHeader={globalNav:function(){var recipeLbl="recipes-and-cooking";var navTimer=null;var bodyId=document.body.id;bodyId=(bodyId=='shows'||bodyId=='chefs')?bodyId:recipeLbl;var initializeMenu="#sub-nav-"+bodyId+" li";hideAll();$(".topnav ."+bodyId).find('a').addClass("nav-on");initMenu(initializeMenu);function initMenu(initializeMenu){var menu=initializeMenu;$(menu).find('h3:first span').click(function(){hideAll();});$(menu+"[class ^= 'nav-']").each(function(i){$(this).hover(function(e){hideAll();var $this=$(this);var offsetVal="auto";var divs=$(this).nextAll();var width=0;$this.find('a:first').addClass("dd-on");jQuery.each(divs,function(){width=width+parseInt($(this).width());});if($this.hasClass("nav-e")){offsetVal=(($(this).parents().filter('ul').width()-$(this).find('div.drop').width())-width);}else{if((jQuery.browser.msie)&&(jQuery.browser.version==6)){offsetVal=($(this).parents().filter('ul').width()-width)-parseInt($(this).width())-7;}else{offsetVal="auto";}}
$('body').bind("click",function(e){bodyClick(e);});navTimer=setTimeout(function(){$this.find('div.drop').css({left:offsetVal,top:"28px",background:"none",display:"block"});navTimer=null;},375);},function(e){clearTimeout(navTimer);navTimer=null;var closeDiv=$(this);if(jQuery.browser.msie){$(this).find('div.drop').css({background:"b2b2b2"});}
navTimer=setTimeout(function(){closeDiv.find("a:first").removeClass("dd-on");closeDiv.find('div.drop').css({top:"28px",display:"none",display:"none"});navTimer=null;},100);});});}
function bodyClick(e){var $clicked=$(e.target);if($clicked.parents().is('.drop')){return false;}else{hideAll();$('body').unbind();}}
function hideAll(){clearTimeout(navTimer);navTimer=null;$("#sub-nav-"+bodyId+" li[class ^= 'nav-']").each(function(){$(this).find('a:first').removeClass("dd-on");});$("#sub-nav li[class ^= 'nav-'] div.drop").each(function(){$(this).css({display:"none"});});}},globalSearch:function(){SNI.Util.inputField('#hd-search-input','Enter Search Term');function findValue(li){if(li==null){return alert("No match!");}else{return li.selectValue;}}
function selectItem(li){findValue(li);}
function formatItem(row){return row[0];}
$("#hd-search-input").autocomplete(SNI.Config.autoSuggestService,{delay:10,width:341,resultsClass:"flyout fmed drop",minChars:3,matchSubset:1,matchContains:0,cacheLength:10,onItemSelect:selectItem,onFindValue:findValue,formatItem:formatItem,autoFill:false});$("#foodSearchForm select").dropdown({title:'close'});var str="";var $form=$("#foodSearchForm");$("#HeadSrchOpt").bind("change",function(e){$("#HeadSrchOpt option:selected").each(function(){str=$(this).val();});}).change();$('#foodSearchForm').submit(function(event){if(str=="products"){event.preventDefault();var data=$form.find('input[name=fnSearchString]').val();window.open("http://www.foodnetworkstore.com/ProductList.aspx?Ntt="+data+"&Ntx=mode%2Bmatchall&Nty=1&N=0&Ntk=All&ccaid=FNFNSEARCH");}else{return true;}});},signInStatus:function(el,config){var $mrbLink=$('#head-mrb-lnk');if(urUser.isLoggedIn){loggedIn();}else{loggedOut();}
function loggedIn(){$('#fn-hd .search .member').remove();var html=[];html.push('<div id="ur-member-links">');html.push('<div class="ur-links-wrap clrfix">');html.push('<select style="display: none;" id="ur-actions-dropdown">');html.push('<option value="profile">My Profile</option>');html.push('<option value="recipe-box">My Recipe Box</option>');html.push('<option value="reviews">My Reviews</option>');html.push('<option value="settings">My Settings</option>');html.push('<option value="sign-out" >Sign Out</option>');html.push('</select>');html.push('<a class="ur-name" href="'+SNI.Community.ur3Domain+"/community/style.esi"+'">'+SNI.Community.UR.displayName()+'</a>');html.push('</div>');html.push('<div class="ur-rcp-wrap">');html.push('<a class="ur-recipe-link" href="'+SNI.Community.mainSiteDomain+'/app/food/mrb/myrecipes/index.do?applicationId=MY-RECIPE-BOX">My Recipe Box</a>');html.push('</div>');html.push('</div>');$('#foodSearchForm').after(html.join(''));var urDropdown=$("#ur-actions-dropdown");urDropdown.dropdown({title:'close'});urDropdown.bind("change",function(e){$("#ur-actions-dropdown option:selected").each(function(){var urAction=$(this).val();var urActionUrl=null;switch(urAction){case"profile":urActionUrl=SNI.Community.ur3Domain+"/community/style.esi";break;case"recipe-box":urActionUrl=SNI.Community.mainSiteDomain+'/app/food/mrb/myrecipes/index.do?applicationId=MY-RECIPE-BOX';break;case"reviews":urActionUrl=SNI.Community.ur3Domain+"/community/reviews.esi";break;case"settings":urActionUrl=SNI.Community.ur3Domain+"/community/usersettings.esi";break;case"sign-out":SNI.Community.UR.logout();break;}
if(urActionUrl!=null){window.location.href=urActionUrl;}});});}
function loggedOut(){$mrbLink.find('a').attr('href',SNI.Community.mainSiteDomain+'/my-recipe-box/package/index.html');var URhtml='<li><a href="'+SNI.Community.UR.getLoginLink()+'">Sign In</a></li>';URhtml+='<li><a href="'+SNI.Community.UR.getRegisterLink()+'">Register</a></li>';$mrbLink.after(URhtml);}},init:function(){SNI.Food.GlobalHeader.globalNav();SNI.Food.GlobalHeader.globalSearch();SNI.Food.GlobalHeader.signInStatus();}};
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');}
SNI.Community.mainSiteDomain='http://www.foodnetwork.com';SNI.Community.ur3Domain='http://my.foodnetwork.com';SNI.Community.xUrlPre='';if((location.hostname.toLowerCase().indexOf("dev-")>-1)||(location.hostname.toLowerCase().indexOf("test1-")>-1)){SNI.Community.xUrlPre="test1-";SNI.Community.mainSiteDomain='http://www.dev-foodnetwork.com';SNI.Community.ur3Domain='http://test1-my.foodnetwork.com';}
else if((location.hostname.toLowerCase().indexOf("staging-")>-1)||(location.hostname.toLowerCase().indexOf("test2-")>-1)){SNI.Community.xUrlPre="test2-";SNI.Community.mainSiteDomain='http://www.staging-foodnetwork.com';SNI.Community.ur3Domain='http://test2-my.foodnetwork.com';}
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(){window.location.href=SNI.Community.ur3Domain+"/redirectors/logout_redirector.jsp?DEST_URL="+escape(window.location.href);};SNI.Community.UR.getLoginLink=function(){return SNI.Community.ur3Domain+"/registration/login.esi";};SNI.Community.UR.getRegisterLink=function(){return SNI.Community.ur3Domain+"/registration/register.esi";};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.extendedInit();window.urUser=new SNI.UR.UrUser(new SNI.UR.ApplicationConfig());
FOODApplicationConfig.prototype=new SNI.UR.ApplicationConfig();function FOODApplicationConfig(){FOODApplicationConfig.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;};}
AddRecipeApplicationConfig.prototype=new FOODApplicationConfig();function AddRecipeApplicationConfig(){AddRecipeApplicationConfig.prototype=new FOODApplicationConfig();this.requiresLogin=false;this.applicationName="My Recipe Box";this.applicationCode="MY-RECIPE-BOX";this.applicationPath="ur/";this.addRole("FOODGENERAL");}
function FoodAd(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");}
ad.addParameter("adsize",adsize);ad.addParameter("PagePos",pos);if(keywords!=""){var words=keywords.split(" ");for(i=0;i<words.length;i++){ad.addParameter("keyword",words[i]);}}
writeAd(ad);}
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 RecipeAd(pos,adtype,pnames,pvals){if(pos<0||pos==undefined){pos=1;}
var ad=new DartAd();if(pos==1&&adtype=='GOOGLE'){pos=2;}
ad.setUrl("http://"+SNI.Ads._adServerHostname+"/js.ng/");ad.addParameter("PagePos",pos);if(adtype!=""&&adtype!=undefined)
{ad.addParameter("adtype",adtype);}else{if(pos==5){ad.addParameter("adtype",'BIGBOX');}}
var paramNames=pnames.split(" ");var paramVals=pvals.split(" ");for(i=0;i<paramNames.length;i++){ad.addParameter(paramNames[i],paramVals[i]);}
writeAd(ad);}
function LeaderboardAd(pos){if(pos<0||pos==undefined||pos==''){pos=1;}
FoodAd('LEADERBOARD','468x60',pos);}
function PushdownAd(pos){if(pos<0||pos==undefined){pos=1;}
FoodAd('PUSHDOWN','',pos);}
function GoogleBixboxAd(pos){if(pos<0||pos==undefined){pos=1;}
FoodAd('GOOGLE_BIGBOX','',pos);}
function GoogleLeaderboardAd(pos){if(pos<0||pos==undefined){pos=1;}
FoodAd('GOOGLE_LEADERBOARD','',pos);}
function BigboxAd(pos,keywords){if(typeof(mdManager)!=undefined&&mdManager.getParameterString("VideoPlayer")==""){if(pos<0||pos==undefined){pos=1;}
FoodAd('BIGBOX','',pos,keywords);}}
function BigboxAd300x150(pos,keywords){if(pos<0||pos==undefined){pos=1;}
FoodAd('SPONSORSHIP_CONTENT','',pos,keywords);}
function SuperstitialAd(pos){if(pos<0||pos==undefined){pos=1;}
FoodAd('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.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 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(){if($(".sponsor-multi-logo a img").length>0){if($(".sponsor-multi-logo").parent().hasClass("west-spons","article-gallery")){$(".sponsor-multi-logo").prepend("<em>Sponsored by:</em>");$(".west-spons").css("display","block");}else{$(".sponsor-multi-logo").prepend("<em>Sponsored by:</em>");}}});}}
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);}
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+"/sndigital_textlinks.html?");ad.addParameter("adtype",adtype);ad.addParameter("PagePos",1);if(linkNum>0){writeAd(ad);}}
function setDefaultBigboxAd(){if(typeof(mdManager)!=undefined&&mdManager.getParameterString("VideoPlayer")==""){return;}
var default_ad=VideoPlayerAd('BIGBOX','',5);var oAd=document.getElementById('bigbox');if(oAd){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;}
oAd.innerHTML="<iframe src=\'"+default_ad+"\' width=\'"+boxW+"\' height=\'"+boxH+"\'"+"frameborder='0' scrolling='no' marginheight='0' marginwidth='0'></iframe>";}}
if(typeof(SNI.Food.Player)=='undefined'){SNI.Food.Player={};}
SNI.Food.Player.Configs={FullSize:{dimensions:{width:'576',height:'631'},flashvars:{config:SNI.Config.snapConfigs+"for-testing/snap-style.xml,"+SNI.Config.snapConfigs+"for-testing/snap-config-std.xml"}},FullSizeNoPlaylist:{dimensions:{width:'576',height:'460'},flashvars:{config:SNI.Config.snapConfigs+"for-testing/snap-style.xml,"+SNI.Config.snapConfigs+"for-testing/snap-config-std.xml"}},RightRail:{dimensions:{width:'320',height:'360'},flashvars:{config:SNI.Config.snapConfigs+"for-testing/snap-style.xml,"+SNI.Config.snapConfigs+"for-testing/snap-config-rr.xml"}},RightRailNoPlaylist:{dimensions:{width:'320',height:'263'},flashvars:{config:SNI.Config.snapConfigs+"for-testing/snap-style.xml,"+SNI.Config.snapConfigs+"for-testing/snap-config-rr.xml"}},Blog:{dimensions:{width:'320',height:'263'},flashvars:{config:SNI.Config.snapConfigs+"for-testing/snap-style.xml,"+SNI.Config.snapConfigs+"for-testing/snap-config-rr.xml"}},Lead:{enableSyncAdFix:1,dimensions:{width:'400',height:'300'},flashvars:{config:SNI.Config.snapConfigs+"for-testing/snap-style.xml,"+SNI.Config.snapConfigs+"for-testing/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.Food.Player.Configs,true);SNI.Food.Player.FullSize=SNI.Player.FullSize;SNI.Food.Player.Big=SNI.Food.Player.FullSize;SNI.Food.Player.VideoLibrary=SNI.Food.Player.FullSize;SNI.Food.Player.TravelingVideoLibrary=function(divId,channelId,videoId,callback,ui_config){var tvlEventHandler=function(eventType,eventInfo){SNI.Player.callbackSystem(eventType,eventInfo);var data=SNI.Player.getJSON(eventInfo);if(typeof(data.sponsorshipValue)!='undefined'){if(data.sponsorshipValue!=mdManager.getParameter('Sponsorship')){mdManager.setParameter('Sponsorship',data.sponsorshipValue);adManager.setParameter('Topic',data.sponsorshipValue);if(typeof(setDefaultBigboxAd)=='function'){setDefaultBigboxAd();}}}};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.Food.Player.FullSizeNoPlaylist=SNI.Player.FullSizeNoPlaylist;SNI.Food.Player.VideoAsset=SNI.Food.Player.FullSizeNoPlaylist;SNI.Food.Player.RightRail=SNI.Player.RightRail;SNI.Food.Player.RightRailNoPlaylist=SNI.Player.RightRailNoPlaylist;SNI.Food.Player.Blog=function(divId,channelId,videoId,ui_config){buildChannelFeedUrlForBlogs=function(chId){return'http://www.foodnetwork.com/food/channel/xml/0,,'+chId+',00.xml';};return new SNI.Player.Blog(divId,channelId,videoId,buildChannelFeedUrlForBlogs,ui_config);};SNI.Food.Player.Lead=function(divId,channelId,videoId,callback,ui_config){return new SNI.Player.SNAP({"container_div_id":divId,"ui_config":mergeObjects(SNI.Player.UserInterfaceConfigs.Lead,ui_config,true),"channel_id":channelId,"video_id":videoId,"fcn_callback_user":callback});};
(function(){_egg=function(){if($("#fn-ft div.brand").length==0){return;}
var o=$("#fn-ft .brand").get(0);if(o!==null){var ee=document.createElement("div");ee.className="_egg";o.appendChild(ee);$(ee).click(function(){if(document.getElementById('_egg-yolk')===null){var bd=document.getElementById('fn-bd');if(bd!=null){var img_w=620;var img_h=465;var x=($(window).width()-img_w)/2;var y=($(window).height()-img_h)/2;y+=window.scrollY;var yolk=document.createElement("div");yolk.setAttribute('id','_egg-yolk');yolk.style.left=Math.ceil(x)+'px';yolk.style.top=Math.ceil(y)+'px';bd.appendChild(yolk);$(yolk).click(function(){yolk.parentNode.removeChild(yolk);});$(yolk).animate({width:img_w+'px',height:img_h+'px'},700);}}});}};$(document).ready(_egg);})();
$.ui=$.ui||{};$.fn.extend({dropdown:function(options,data){var args=Array.prototype.slice.call(arguments,1);return this.each(function(){if(typeof options=="string"){var dropdown=$.data(this,"ui-dropdown");dropdown[options].apply(dropdown,args);}else if(!$(this).is(".ui-dropdown")){$.data(this,"ui-dropdown",new $.ui.dropdown(this,options));}});}});$.ui.dropdown=function(container,options){this.element=$(container);this.options=options=$.extend({},$.ui.dropdown.defaults,options);this.options.title=this.options.title||this.element.find('option.select-title').text();this.element.addClass("ui-dropdown");this.list=buildList(this.element,this.options);this.element.after(this.list);this.css={position:this.element.css('position'),left:this.element.css('left')};this.element.hide();if(this.element.attr('disabled')){this.disable();}else{this.enable();}};$.extend($.ui.dropdown,{defaults:{title:'',disabled:false}});$.ui.dropdown.prototype={enable:function(){var element=this.element;var list=this.list;this.options.disabled=false;this.element.removeAttr('disabled');this.list.find('.disabled').removeClass('disabled');var handle=this.list.find('dt a');handle.mousedown(function(){hideDropDowns();list.find('dd').show();$(this).parent('dt').addClass('active');return false;});handle.mouseup(function(){$('body').bind("mouseup",hideDropDowns);return false;});return element;},disable:function(){this.options.disabled=true;this.element.attr('disabled','disabled');this.list.find('dt').addClass('disabled');var handle=this.list.find('dt a');handle.unbind('mousedown');return this.element;},destroy:function(){this.list.remove();this.element.show();this.element.removeClass("ui-dropdown");$.removeData(this.element,"ui-dropdown");},reset:function(){this.list.remove();this.options.title=this.element.find('option.select-title').text();this.list=buildList(this.element,this.options);this.element.after(this.list);},select:function(){select=this.element.get(0);option=select.selectedIndex>-1?select[select.selectedIndex]:false;if(option){this.list.find('dt a').html(option.text+'<em></em>');}},activate:function(event){dropdown=event&&event.data?event.data.dropdown:this;if(!dropdown.options.disabled){hideDropDowns();dropdown.list.find('dd').show();dropdown.list.find('dt').addClass('active');}}};function buildList(element,options){select=element.get(0);option=select.selectedIndex>-1?select[select.selectedIndex]:false;var selected=option?option.text:'';var ddList='<dl class="dd-list">';ddList+=options.disabled?'<dt class="dd-dt disabled">':'<dt class="dd-dt">';ddList+='<a>'+selected+'<em></em></a></dt>';ddList+='<dd style="display: none;">';ddList+='<div class="dd-hd"></div>';ddList+='<div class="dd-bd">';if(options.title){ddList+='<h3>'+options.title+'<a class="close"></a></h3>';}
ddList+='</div>';ddList+='<div class="dd-ft"></div>';ddList+='</dd>';ddList+='</dl>';ddList=$(ddList);ddList.find('.close').click(function(){hideDropDowns();return false;});var list=$('<ul class="dd-ul"></ul>');element.children('option:not(.select-title)').each(function(i){var link=$('<a href="#">'+$(this).text()+'</a>');link.click(function(){ddList.find('dt a').html($(this).text()+'<em></em>');element.find('option:not(.select-title)')[i].selected=true;hideDropDowns();element.trigger('change');return false;});var item=$('<li class="dd-li"></li>').append(link);list.append(item);});ddList.find('.dd-bd').append(list);return ddList;}
function hideDropDowns(event){if(event&&$.browser.mozilla&&$(event.target).hasClass('dd-ul')){return true;}
$('.dd-list dd').hide();$('.dd-list .active').removeClass('active');$('body').unbind("mouseup",hideDropDowns);return true;}
$.ui=$.ui||{};$.fn.extend({dependent_dropdowns:function(conf){if(!$(this).is(".ui-dependent-dropdowns")){$.data(this,"ui-dependent-dropdowns",new $.ui.dependent_dropdowns(this,conf));}}});$.ui.dependent_dropdowns=function(container,options){var ddd_obj=this;ddd_obj.element=$(container);ddd_obj.options=options=$.extend({},$.ui.dependent_dropdowns.defaults,options);ddd_obj.dropdowns=ddd_obj.options.dropdowns||ddd_obj.element.find('select');ddd_obj.data=ddd_obj.options.data;ddd_obj.element.addClass("ui-dependent-dropdowns");var current_dd;$.each(ddd_obj.dropdowns,function(i,val){$(val).dropdown();});$.each(ddd_obj.dropdowns,function(i,val){current_dd=$(val);current_dd.bind("change",function(evt){var index=$.inArray(evt.target,ddd_obj.dropdowns);if(index!=-1){ddd_obj._updateValues(index);}});});ddd_obj.enable();};$.ui.dependent_dropdowns.prototype={enable:function(){this._updateValues(0);this.defaults();},disable:function(){},destroy:function(){$.each(this.dropdowns,function(key,value){$(value).destroy();});this.element.removeClass("ui-dependent-dropdowns");$.removeData(this.element,"ui-dependent-dropdowns");},defaults:function(){if(this.data.defaults){var now=new Date();var hours=now.getHours()<10?'0'+now.getHours():now.getHours();var minutes=now.getMinutes()<10?'0'+now.getMinutes():now.getMinutes();var time=hours.toString()+minutes.toString();var dd=this;$.each(this.data.defaults,function(key,values){times=key.split('-');if(dd._checkTime(times[0],times[1],time)){index=0;$.each(values,function(k,v){if(select=dd.dropdowns[index]){$(select).find('option').each(function(){if($(this).val()==v){this.selected=true;$(select).dropdown('select');$(select).trigger('change');}});}
index++;});}});}},_updateValues:function(index){if(index==null){index=0;}
if(dropdown=this.dropdowns[index]){values=this._findValues(this.data.values,0,index);previous_value=$(dropdown).val()||false;if(this.data.titles&&this.data.titles[index]){options='<option value="" class="select-title">'+this.data.titles[index]+'</option>';}else{options='';}
if(values){$.each(values,function(key,val){options+='<option value="'+key+'"';if(previous_value&&previous_value==key){options+=' selected="selected"';}
options+='>'+val.label+'</option>';});}
if(!values){$(dropdown).dropdown('disable');}
$(dropdown).html(options);$(dropdown).dropdown('reset');if(values){$(dropdown).dropdown('enable');}
this._updateValues(index+1);}},_findValues:function(values,start_index,end_index){if(start_index==end_index){return values;}else{values=values[$(this.dropdowns[start_index]).val()];if(values){return this._findValues(values.values,start_index+1,end_index);}else{return null;}}},_updateDropdown:function(dropdown){if(index=$.inArray(dropdown,this.dropdowns)){this._updateValues(index+1);}},_checkTime:function(from_time,to_time,time){if(to_time<from_time){if(time>=from_time&&time<2400){return true;}else if(time<to_time&&time>=0){return true;}}else if(time>=from_time&&time<to_time){return true;}
return false;}};
SNI.Food.QuickMeals={init:function(){$('#select-time').dropdown({title:'select one'});$('#select-chef').dropdown({title:'select one'});$('#quick-meal').dependent_dropdowns({data:this.data,dropdowns:[$('#select-course')[0],$('#select-ingredient')[0]]});},surpiseMe:function(form){form=$(form);form.find("input[name='fnSurpriseMe']").val('y');form.submit();}};
SNI.Food.FindRecipe={init:function(){$('#find-recipe-from-date').attr('readonly','readonly');$('#find-recipe-to-date').attr('readonly','readonly');$(document).ready(function(){$("#find-recipe .date").attachDatepicker({maxDate:new Date()});});$('#find-recipe select').dropdown();$('#find-recipe-chef').bind('change',function(){var frs=$('#find-recipe-show');frs.get(0).selectedIndex=0;frs.dropdown('select');});$('#find-recipe-show').bind('change',function(){var frc=$('#find-recipe-chef');frc.get(0).selectedIndex=0;frc.dropdown('select');});SNI.Food.FindRecipe.validate();},validate:function(){$('#find-recipe form').submit(function(){dateDefault='mm/dd/yy';showName=$('#find-recipe-show').val();chefName=$('#find-recipe-chef').val();keywords=$.trim($('#find-recipe-keywords').val());fromDate=$('#find-recipe-from-date').val();toDate=$('#find-recipe-to-date').val();$('#find-recipe-from-label span').removeClass('error');$('#find-recipe-to-label span').removeClass('error');if(fromDate!=dateDefault&&toDate==dateDefault){toDate=$.datepicker.formatDate('mm/dd/y',new Date());$('#find-recipe-to-date').val(toDate);}
if(showName===''&&chefName===''&&keywords===''&&fromDate==dateDefault&&toDate==dateDefault){$('#find-recipe-notice').text('Whoops. Please use at least one field below.').addClass('error');}else if((fromDate!=dateDefault&&toDate!=dateDefault)&&(Date.parse(fromDate)>Date.parse(toDate))){$('#find-recipe-notice').text('Whoops. Please ensure the "from" date is before the "to" date.').addClass('error');$('#find-recipe-from-label span').addClass('error');$('#find-recipe-to-label span').addClass('error');}else{$('#find-recipe-notice').css('visibility','hidden');$('#find-recipe ul').css('visibility','hidden');$('#find-recipe .find button').addClass('disabled').attr('disabled','disabled');$('#find-recipe .loading').show();return true;}
return false;});}};
SNI.Food.UR={selectDefault:function(elems,def){if(elems.length){elems.get(0).select();}else{$(def).focus();}},validateSignin:function(form){$('#ur .signin form').validate({errorLabelContainer:false,rules:{email:{required:true,email:true},password:{required:true}},messages:{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@food.com)."},password:"Whoops. Please enter your password."},showErrors:function(errorMap,errorList){if(errorList.length){$(this.currentForm).find('.message').addClass('error').html(errorList[0].message);element=$(errorList[0].element);if(element.hasClass('email')){element.select();}
this.errorList=[this.errorList[0]];this.defaultShowErrors();}},submitHandler:function(form){form=$(form);form.find('.message').css('visibility','hidden');form.find('ul').css('visibility','hidden');form.find('button').addClass('disabled').attr('disabled','disabled');form.find('.loading').show();form.submit();}});},validatePasswordRequest:function(){$('#ur .password-request form').validate({errorContainer:'#ur .password-request .form-error',errorLabelContainer:'#ur .password-request .form-error ul',wrapper:"li",rules:{email:{required:true,email:true}},messages:{email:{required:"Please enter your e-mail address",email:"Please check the format of your e-mail address and re-enter (i.e. joe@foodnetwork.com)"}},showErrors:function(errorMap,errorList){if(errorList.length){$('#ur .password-request .form-error').fadeIn();$(errorList[0].element).select();this.defaultShowErrors();}},submitHandler:function(form){form=$(form);$('#ur .password-request .form-error').hide();form.find('p:first').css('visibility','hidden');form.find('ul').css('visibility','hidden');form.find('button').addClass('disabled').attr('disabled','disabled');form.find('.loading').show();form.addClass('disabled');form.submit();}});},validateRegisterStep1:function(){$('#ur .step1 form').validate({errorContainer:'#ur .step1 .form-error',errorLabelContainer:'#ur .step1 .form-error ul',wrapper:"li",rules:{email:{required:true,email:true},password:{required:true,minlength:6,spaces:true},password2:{required:true,equalTo:"#password"},zip:"required"},messages:{email:{required:"Please enter your e-mail address",email:"Please check the format of your e-mail address and re-enter (i.e. joe@foodnetwork.com)"},password:{required:"Please enter a password",minlength:"Your password must be at least six characters long with no spaces",spaces:"Your password must be at least six characters long with no spaces"},password2:{required:"Please confirm your password",equalTo:"Please make sure your password and confirmation password match"},zip:"Please enter your zip code"},showErrors:function(errorMap,errorList){if(errorList.length){$('#ur .step1 .form-error').fadeIn();element=$(errorList[0].element);if(element.hasClass('email')){element.select();}
this.defaultShowErrors();}}});},validateRegisterStep2:function(){$('#ur .step2 form').validate({errorContainer:'#ur .step2 .form-error',errorLabelContainer:'#ur .step2 .form-error ul',wrapper:"li",rules:{fname:"required",lname:"required",address:"required",city:"required",state:"required",zip:"required",gender:"required"},messages:{fname:"Please enter your first name",lname:"Please enter your last name",address:"Please enter your address",city:"Please enter your city",state:"Please select your state",zip:"Please enter your zip code",gender:"Please select your gender"},showErrors:function(errorMap,errorList){if(errorList.length){$('#ur .step2 .form-error').fadeIn();element=$(errorList[0].element);if(element.hasClass('email')){element.select();}
this.defaultShowErrors();}}});}};
if(typeof(SNI.Food.Toolbar)=="undefined"){SNI.Food.Toolbar={};}
SNI.Food.Toolbar={toolbar:"#toolbar",revealModule:function(trigger,module){$(SNI.Food.Toolbar.toolbar).find(trigger).click(function(){module.fadeIn(SNI.Food.ANIMATION_SPEED);$(this).addClass("active");return false;})},closeModule:function(trigger,module,speed){if(speed==null){speed=SNI.Food.ANIMATION_SPEED;};module.fadeOut(speed);if($(trigger).hasClass("active")){$(trigger).removeClass("active");};},fontResize:function(element){if(element==null){element=".font-resize";}
$(element).find("li").click(function(){var defaultSize="100%";$(element).find("li").removeClass("active");$(this).addClass("active");if($(this).hasClass("med")){$(".body-text").css("font-size",defaultSize);}else if($(this).hasClass("sm")){$(".body-text").css("font-size","85%");}else{$(".body-text").css("font-size","116%");}});},printPage:function(){var module=$("#print-select");SNI.Food.Toolbar.revealModule(".print-drop",module);$("em.close").click(function(){SNI.Food.Toolbar.closeModule(".print-drop",module);});$(".email").click(function(){SNI.Food.Toolbar.closeModule(".print-drop",module);});},emailAFriend:function(){var module=$("#email-a-friend");var form=module.find("form");form.submit(function(){return false;});var null_value="";var email_page_type=mdManager.getPageType();if(email_page_type!="ENCYCLOPEDIA"){$("#email-a-friend textarea").val("Check out this awesome page on FoodNetwork.com!");}
else{$("#email-a-friend textarea").val("I'm learning more about the foods I love on FoodNetwork.com.");};function newCaptchaImg(){addtime=new Date().getTime();};$(".email").click(function(){form.find('#captcha-img').html('<img src="/app/emailservice2/captchaImg" height="30" width="93" />');});$("#captcha-request a, .email").click(function(){newCaptchaImg();form.find('#captcha-img').html('<img src="/app/emailservice2/captchaImg?generateNew=true&t='+addtime+'" height="30" width="93" />');return false;});$(".print").click(function(){SNI.Food.Toolbar.closeModule(".email",module);});SNI.Food.Toolbar.revealModule(".email",module);$(".close").click(function(){SNI.Food.Toolbar.closeModule(".email",module);});$(".form-submit a").click(function(){SNI.Food.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@foodnetwork.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 FoodNetwork.com')
var txtarea=form.find('textarea[name="body"]');var txtarea_comment=txtarea.val();var page_title=mdManager.getPageTitle();if(email_page_type!="ENCYCLOPEDIA"){var msg_body=form.find('input[name="from_name"]').val()+" thought you would be interested in this link to \""+page_title+"\" on the Food Network:\n\n";}
else{var msg_body=form.find('input[name="from_name"]').val()+" thought you'd find information and tips about \""+page_title+"\" useful. Click the link below to visit the Food Encyclopedia on FoodNetwork.com.\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@foodnetwork.com).").show();}}else{var success=module.find('.success');var page_title=mdManager.getPageTitle();form.hide();success.show();var timeout=setTimeout(function(){SNI.Food.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.Food.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();}});}});},toolbarElement:$(SNI.Food.Toolbar.toolbar),shareThis:function(){var share_url=SNI.Util.Url.setParameter(document.location.href,"soc","share");var tweet_page_type=mdManager.getPageType();var tweet_title=mdManager.getPageTitle();var tweet_this;if(tweet_page_type!="ENCYCLOPEDIA"){tweet_this="#FOOD";}
else{tweet_this="(via @FoodNetwork Encyclopedia)";}
var twitter_shared_object=SHARETHIS.addEntry({title:tweet_title+" "+tweet_this,url:share_url});var facebook_shared_object=SHARETHIS.addEntry({title:mdManager.getPageTitle(),url:share_url});twitter_shared_object.attachChicklet("twitter",SNI.Food.Toolbar.toolbarElement.find(".sharing .twitter a.chicklet")[0]);facebook_shared_object.attachChicklet("facebook",SNI.Food.Toolbar.toolbarElement.find(".sharing .facebook a.chicklet")[0]);},init:function(){SNI.Food.Toolbar.fontResize();SNI.Food.Toolbar.emailAFriend();SNI.Food.Toolbar.printPage();if(!SNI.Food.Toolbar.toolbarElement||SNI.Food.Toolbar.toolbarElement.length==0){SNI.Food.Toolbar.toolbarElement=jQuery(SNI.Food.Toolbar.toolbar);}
if(SNI.Food.Toolbar.toolbarElement.find(".sharing .facebook a.chicklet").length>0){SNI.Food.Toolbar.shareThis();}
SNI.Util.sched({yr:2010,mon:2,day:22,hr:8,min:0,sec:0},{yr:2010,mon:4,day:30,hr:23,min:59,sec:59},"SNI.Food.Sponsors.printHPSponsor()");}};
if(typeof(SNI.Food.RecipeTools)=="undefined"){SNI.Food.RecipeTools={};}
SNI.Food.RecipeTools={tools:"#rcp-tools",close_module:function(module,speed){if(speed==null){speed=SNI.Food.ANIMATION_SPEED;}
module.fadeOut(speed);},getCard:function(){var module=$("#get-card");var add_to_mrb=$("#add-to-mrb");var logged_out=$("#mrb-logged-out");var get_card=$(SNI.Food.RecipeTools.tools).find("li.getcard");get_card.click(function(){SNI.Food.RecipeTools.close_module(add_to_mrb);SNI.Food.RecipeTools.close_module(logged_out);module.fadeIn(SNI.Food.ANIMATION_SPEED);return false;});module.find(".close").click(function(){SNI.Food.RecipeTools.close_module(module);});},addToMRB:function(){var module=$("#add-to-mrb");var logged_out=$("#mrb-logged-out")
var get_card=$("#get-card");var save_rcp=$(SNI.Food.RecipeTools.tools).find("li.save-rcp");var form=module.find("form");var add_rcp_data=form.attr("action");var folder_data="/app/food/mrb/myrecipes/xml/cachedViewTagsXml.do";if(urUser.isLoggedIn==true){$.get(folder_data,function(data){var folder_list=form.find("select#mrb-folders");$(data).find("Tag").each(function(){var folder_name=$(this).children("tagTitle").text();var folder_id=$(this).children("tagId").text();$("<option>"+folder_name+"</option>").val(folder_id).appendTo(folder_list);});$(folder_list).dropdown();});};save_rcp.click(function(){SNI.Food.RecipeTools.close_module(get_card);if(urUser.isLoggedIn==true){module.fadeIn(SNI.Food.ANIMATION_SPEED);}else{logged_out.fadeIn(SNI.Food.ANIMATION_SPEED);}
return false;});module.find(".close").click(function(){SNI.Food.RecipeTools.close_module(module);});logged_out.find(".close").click(function(){SNI.Food.RecipeTools.close_module(logged_out);});form.find(".form-submit a").click(function(){SNI.Food.RecipeTools.close_module(module);return false;});var success_message=module.find(".success");show_success=success_message.find("#show_mrb_success");show_success.change(function(){if($(this).attr("checked")==true){SNI.Util.Cookie.set("hide_mrb_add_success","1",365);}else{SNI.Util.Cookie.remove("hide_mrb_add_success");}});form.submit(function(){var transaction_type,transaction_option,transation_param,folder_title;var new_folder=form.find("input[name='newFolderName']");var folder_list=form.find("select#mrb-folders");var null_value="";var recipe_soi=form.find("input[name='recipe_soi']").val();if(new_folder.val()!=null_value){transaction_type="newTag";transaction_param=escape(new_folder.val())+"&tagId=";transaction_option="tagTitle";folder_title=new_folder.val();}else{var selected_folder=folder_list.find("option:selected");if(selected_folder.val()=="allMyRecipes"){transaction_type="allView";transaction_option="tagId";transaction_param="&tagTitle=";folder_title=selected_folder.text();}else{transaction_type="existingTag";transaction_param=selected_folder.val();transaction_option="tagId";folder_title=selected_folder.text();}};form.find('fieldset').hide();form.find('button[type="submit"]').addClass('disabled').attr('disabled','disabled');form.find('.cancel').addClass("disabled");form.find('.loading').show();var add_rcp_url=add_rcp_data+"?transactionType="+transaction_type+"&"+transaction_option+"="+transaction_param+"&soi="+recipe_soi;$.ajax({type:"GET",url:add_rcp_url,success:function(){success_message.find("span.destination").text(folder_title);if(SNI.Util.Cookie.get("hide_mrb_add_success")){SNI.Food.RecipeTools.close_module(module);}else{form.hide();success_message.show();}},error:function(){success_message.find("strong").text("Sorry, we encountered an error when trying to save this recipe.").css("color","#b50938");success_message.find("p:eq(1)").text("Please wait a few moments and try again.")
form.hide();success_message.show();}});return false;});},init:function(){SNI.Food.RecipeTools.getCard();SNI.Food.RecipeTools.addToMRB();}};
SNI.Food.Rating=function(container,options){this.element=$(container);this.options=$.extend({stars:5,text:['Awful','Poor','Average','Good','Excellent']},options);this.selected=0;this.init=function(){var rating=this;if(rating.options.input){rating.input=$(rating.options.input);}else{rating.input=rating.element.find("input:first");}
this.setInitialValue();for(i=1;i<=rating.options.stars;i++){star=$('<a href="#stars'+i+'"></a>');star.attr('rel',i);star.hover(function(){rating.clearStars(rating.selected);rating.showStars($(this).attr('rel'));rating.element.parent(".review-rating").addClass('dyn');},function(){rating.clearStars($(this).attr('rel'));rating.showStars(rating.selected);rating.element.parent(".review-rating").removeClass('dyn');});star.click(function(){rating.setStars($(this).attr('rel'));return false;});rating.element.append(star);}
if(rating.options.text){rating.text=$('<span class="rating-text">&nbsp;</span>');rating.element.append(rating.text);}};this.clearStars=function(stars){this.element.removeClass('stars'+stars);};this.showStars=function(stars){this.element.addClass('stars'+stars);if(this.text){if(stars>0){this.text.html(this.options.text[stars-1]);}else{this.text.html('&nbsp;');}}};this.setStars=function(stars){this.selected=stars;if(this.input){this.input.val(this.selected);}};this.setInitialValue=function(){if(this.input){value=this.input.val();if(value>0){this.setStars(value);this.showStars(value);}}};this.init();};SNI.Food.ReviewRecipe={init:function(){var submitStatus='';if($.query.has('status')){submitStatus=$.query.get('status');}
if(submitStatus=='Error'){$("#rev-failure").show();$('#review-recipe').addClass('open')}else if(submitStatus=='Success'){$("#rev-success").show();$('#review-recipe').remove();}
if(submitStatus!='Success'){if(urUser.isLoggedIn){$('#review-recipe .bd').find('.bd.signin').remove();$('#review-recipe').addClass('open')}
else{$('#review-recipe .bd').find('.bd.rrform').remove();$('#review-recipe').addClass('open')}}
if(!$('#review-recipe').hasClass('open')){$('#review-recipe .bd .bd').hide();}
$('#review-recipe .hd h4 a, #review-recipe .submit a.cancel').click(function(){SNI.Food.ReviewRecipe.toggle();return false;});rating=SNI.Food.Rating('.rating-box');$('#review-recipe form').validate({errorContainer:'#rev-error',errorLabelContainer:'#rev-error ul',wrapper:"li",rules:{rating1:'required',reviewTitle:'required',review:'required'},messages:{rating1:'Please enter a rating',reviewTitle:'Please enter a headline',review:'Please enter your comments'},showErrors:function(errorMap,errorList){if(errorList.length){$('#rev-error').fadeIn();this.defaultShowErrors();}}});},toggle:function(){var rr=$('#review-recipe');if(rr.hasClass('open')){$('#rev-error').hide();rr.find('.bd .bd').slideUp(SNI.Food.ANIMATION_SPEED,function(){rr.removeClass('open');});}else{rr.find('.bd .bd').slideDown(SNI.Food.ANIMATION_SPEED);rr.addClass('open');}}};SNI.Food.FlagReview={init:function(){myForm=$("form#frmFlagRecipeReview");myForm.find("input[name='user_id']").attr("value","0000000");if(urUser.isLoggedIn){$("#flag-sign-pop").remove();}
else{$("#flag-sign-pop a.close, #flag-sign-pop .txt-link a").click(function(){$("#flag-sign-pop").hide();$("body").unbind("click.drops");return false;});}
$("ul.revcomments .flagugc a").click(function(e){thisContainer=$(this).parent();if(!urUser.isLoggedIn){SNI.Food.RecipeModules.clearDrops();$("body").bind("click.drops",function(e){if(!$(e.target).parents().is(".drops")){SNI.Food.RecipeModules.clearDrops();}
return true;});myPosn=thisContainer.offset();myOs=$("#main-bd").offset();myPosn.left-=myOs.left;myPosn.top-=myOs.top;$("#flag-sign-pop").css("left",(myPosn.left-7)+"px");$("#flag-sign-pop").css("top",(myPosn.top+7)+"px");$("#flag-sign-pop").show();return false;}
else{thisContainer.addClass("processing");myForm.find("input[name='user_id']").attr("value",($(this).attr("rel")));$.getJSON(myForm.attr("action")+'_JSON?'+myForm.serialize()+'&callback=?',function(data){thisContainer.removeClass("processing").text("Flagged");});}
e.preventDefault();});}};SNI.Food.ReviewMore={init:function(){$(".revcomments .description .morelnk").click(function(e){$(this).parent().find(".ellip").hide();$(this).hide();$(this).parent().find(".more").show();e.preventDefault();});}}
if(typeof(SNI.Food.MRB)=="undefined"){SNI.Food.MRB={};}
SNI.Food.MRB={login:"#mrb-login",pwdfetch:function(){var module=$("#pwd-request");var form=module.find("form");var null_value="";var initMessage=form.find("textarea").val();var close_module=function(speed){if(speed===null){speed=SNI.Food.ANIMATION_SPEED;}
module.fadeOut(speed);};$(SNI.Food.MRB.login).find("#pass-retrieve").click(function(){module.fadeIn(SNI.Food.ANIMATION_SPEED);return false;});$(".close").click(function(){close_module();});$(".form-submit a").click(function(){close_module();return false;});form.validate({errorLabelContainer:false,rules:{email:{required:true,email:true}},messages:{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@food.com)."}},showErrors:function(errorMap,errorList){if(errorList.length){module.find('.message').addClass('alert').html(errorList[0].message);element=$(errorList[0].element);if(element.hasClass('isemail')){element.select();}
this.errorList=[this.errorList[0]];this.defaultShowErrors();}},submitHandler:function(){form.find('.message').hide();form.find('fieldset').hide();form.find('button').addClass('disabled').attr('disabled','disabled');form.find('.cancel').addClass("disabled");form.find('.loading').show();$.ajax({type:"POST",url:'http://web.foodnetwork.com/food/web/universalreg/getacctsprocess/1,8924,na_na_na,00.html',cache:false,success:function(data){var response=$(data);var emailSent=response.eq(9).text();if(emailSent=="false"){form.find('.loading').hide();form.find('.message').show();form.find('fieldset').show();form.find('button').removeClass('disabled').removeAttr('disabled');form.find('.cancel').removeClass("disabled");$("#pwd-request label[for='email']").addClass("error");$("#email").select();module.find('.message').addClass("alert").text("Whoops, please enter your e-mail address....");}else{var success=module.find('.success');var page_title=mdManager.getPageTitle();var timeout=setTimeout(function(){close_module(300);},3000);$(".close").click(function(){clearTimeout(timeout);close_module();});form.hide();success.find('strong');success.show();}},error:function(){form.find('.loading').hide();form.find('.message').show();form.find('fieldset').show();form.find('button').removeClass('disabled').removeAttr('disabled');form.find('.cancel').removeClass("disabled");$("#pwd-request label[for='email']").addClass("error");$("#email").select();module.find('.message').addClass("alert").text("Whoops, please enter your e-mail address.");}});}});},addrcp:function(){$('#rcp-times #selPrepTimeHours').dropdown();$('#rcp-times #selPrepTimeMinutes').dropdown();$('#rcp-times #selNonActivePrepTimeHours').dropdown();$('#rcp-times #selNonActivePrepTimeMinutes').dropdown();$('#rcp-times #selCookTimeHours').dropdown();$('#rcp-times #selCookTimeMinutes').dropdown();$("#mrb-addrcp #selPrepTimeHours").dpl("recipetimes");$("#mrb-addrcp #selPrepTimeMinutes").dpl("recipetimes");$("#mrb-addrcp #selNonActivePrepTimeHours").dpl("recipetimes");$("#mrb-addrcp #selNonActivePrepTimeMinutes").dpl("recipetimes");$("#mrb-addrcp #selCookTimeHours").dpl("recipetimes");$("#mrb-addrcp #selCookTimeMinutes").dpl("recipetimes");$("#mrb-addrcp .ft-wrap a").click(function(){history.back();return false;});$("#mrb-addrcp form").submit(function(){var nullValue="";var errorform=$("body div.form-error");var titleValue=$("#mrb-addrcp form #title").val();var ingredientsValue=$("#mrb-addrcp form #ingredients").val();var servesValue=$("#mrb-addrcp form #serves").val();var prepValue=$("#mrb-addrcp form #prep-instructions").val();var notesValue=$("#mrb-addrcp form #notes").val();var agreeValue=0;var levelValue=0;var timeFlag=0;var limitFlag=0;var totalHours=parseInt($("#mrb-addrcp form #txtHoursOutput").html(),10);var totalMins=parseInt($("#mrb-addrcp form #txtMinutesOutput").html(),10);if($('#mrb-addrcp form #agree').is(':checked')){agreeValue=1;}
$errormsg="";$(".list-alt").find("li").remove();if(titleValue===nullValue){$("label[for='title']").find('span').addClass("error");$errormsg+="<li>Please enter a recipe title.</li>";}else{$("label[for='title']").find('span').removeClass("error");}
if(!$("label[for='title']").find('span').hasClass("error")){if(titleValue.length>240){$("label[for='title']").find('span').addClass("error");$errormsg+="<li>Please enter a title with less than 240 characters.</li>";limitFlag=1;}else{$("label[for='title']").find('span').removeClass("error");}}
if(ingredientsValue===nullValue){$("label[for='ingredients']").find('span').addClass("error");$errormsg+="<li>Please enter ingredients.</li>";}else{$("label[for='ingredients']").find('span').removeClass("error");}
if(servesValue===nullValue){$("label[for='serves']").find('span').addClass("error");$errormsg+="<li>Please enter a serving.</li>";}else{$("label[for='serves']").find('span').removeClass("error");}
if(!$("label[for='serves']").find('span').hasClass("error")){if(servesValue.length>240){$("label[for='serves']").find('span').addClass("error");$errormsg+="<li>Please limit your input for servings to less than 40 characters.</li>";limitFlag=1;}else{$("label[for='serves']").find('span').removeClass("error");}}
if($('input[name=difficulty]').is(':checked')){$(".levels h4 span").removeClass("error");levelValue=1;}else{$(".levels h4 span").addClass("error");$("label[for='levels']").find('span').addClass("error");$errormsg+="<li>Please select a level.</li>";}
if((totalHours===0)&&(totalMins===0)){$("#rcp-times .hd-times").find('span').addClass("error");$errormsg+="<li>Please enter at least one recipe time.</li>";}else{$("#rcp-times .hd-times").find('span').removeClass("error");timeFlag=1;}
if(prepValue===nullValue){$("label[for='prep-instructions']").find('span').addClass("error");$errormsg+="<li>Please enter preparation instructions.</li>";}else{$("label[for='prep-instructions']").find('span').removeClass("error");}
if(agreeValue===0){$("label[for='agree']").find('span').addClass("error");$errormsg+="<li>Please agree to the terms and conditions.</li>";}else{$("label[for='agree']").find('span').removeClass("error");}
if(notesValue.length>240){$("label[for='notes']").find('span').addClass("error");$errormsg+="<li>Please limit your cooking notes to less than 3000 characters.</li>";limitFlag=1;}else{$("label[for='notes']").find('span').removeClass("error");}
if((agreeValue===0)||(titleValue===nullValue)||(ingredientsValue===nullValue)||(servesValue===nullValue)||(prepValue===nullValue)||(levelValue===0)||(timeFlag===0)||(limitFlag===1)){$(".form-error").show(300);$(".list-alt").append($errormsg);$('html, body').animate({scrollTop:0},'slow');return false;}});},editrcp:function(){$('#rcp-times #selPrepTimeHours').dropdown();$('#rcp-times #selPrepTimeMinutes').dropdown();$('#rcp-times #selNonActivePrepTimeHours').dropdown();$('#rcp-times #selNonActivePrepTimeMinutes').dropdown();$('#rcp-times #selCookTimeHours').dropdown();$('#rcp-times #selCookTimeMinutes').dropdown();$("#mrb-editrcp #selPrepTimeHours").dpl("recipetimes");$("#mrb-editrcp #selPrepTimeMinutes").dpl("recipetimes");$("#mrb-editrcp #selNonActivePrepTimeHours").dpl("recipetimes");$("#mrb-editrcp #selNonActivePrepTimeMinutes").dpl("recipetimes");$("#mrb-editrcp #selCookTimeHours").dpl("recipetimes");$("#mrb-editrcp #selCookTimeMinutes").dpl("recipetimes");$("#mrb-editrcp form").submit(function(){var nullValue="";var errorform=$(".form-error");var titleValue=$("#mrb-editrcp #title").val();var ingredientsValue=$("#mrb-editrcp #ingredients").val();var servesValue=$("#mrb-editrcp #serves").val();var prepValue=$("#mrb-editrcp #prep-instructions").val();var agreeValue=0;var levelValue=0;var timeFlag=0;var limitFlag=0;var totalHours=parseInt($("#mrb #txtHoursOutput").html(),10);var totalMins=parseInt($("#mrb #txtMinutesOutput").html(),10);if($('#agree').is(':checked')){agreeValue=1;}
$errormsg="";$(".list-alt").find("li").remove();if(titleValue===nullValue){$("label[@for='title']").find('span').addClass("error");$errormsg+="<li>Please enter a recipe title.</li>";}else{$("label[@for='title']").find('span').removeClass("error");}
if(!$("label[@for='title']").find('span').hasClass("error")){if(titleValue.length>240){$("label[@for='title']").find('span').addClass("error");$errormsg+="<li>Please enter a title with less than 240 characters.</li>";limitFlag=1;}else{$("label[@for='title']").find('span').removeClass("error");}}
if(ingredientsValue===nullValue){$("label[@for='ingredients']").find('span').addClass("error");$errormsg+="<li>Please enter ingredients.</li>";}else{$("label[@for='ingredients']").find('span').removeClass("error");}
if(servesValue===nullValue){$("label[@for='serves']").find('span').addClass("error");$errormsg+="<li>Please enter a serving.</li>";}else{$("label[@for='serves']").find('span').removeClass("error");}
if(!$("label[@for='serves']").find('span').hasClass("error")){if(servesValue.length>240){$("label[@for='serves']").find('span').addClass("error");$errormsg+="<li>Please limit your input for servings to less than 40 characters.</li>";limitFlag=1;}else{$("label[@for='serves']").find('span').removeClass("error");}}
if($('input[@name=difficulty]').is(':checked')){$(".levels h4 span").removeClass("error");levelValue=1;}else{$(".levels h4 span").addClass("error");$("label[@for='levels']").find('span').addClass("error");$errormsg+="<li>Please select a level.</li>";}
if((totalHours===0)&&(totalMins===0)){$("#rcp-times .hd-times").find('span').addClass("error");$errormsg+="<li>Please enter at least one recipe time.</li>";}else{$("#rcp-times .hd-times").find('span').removeClass("error");timeFlag=1;}
if(prepValue===nullValue){$("label[@for='prep-instructions']").find('span').addClass("error");$errormsg+="<li>Please enter preparation instructions.</li>";}else{$("label[@for='prep-instructions']").find('span').removeClass("error");}
if(agreeValue===0){$("label[@for='agree']").find('span').addClass("error");$errormsg+="<li>Please agree to the terms and conditions.</li>";}else{$("label[@for='agree']").find('span').removeClass("error");}
if(notesValue.length>240){$("label[@for='notes']").find('span').addClass("error");$errormsg+="<li>Please limit your cooking notes to less than 3000 characters.</li>";limitFlag=1;}else{$("label[@for='notes']").find('span').removeClass("error");}
if((agreeValue===0)||(titleValue===nullValue)||(ingredientsValue===nullValue)||(servesValue===nullValue)||(prepValue===nullValue)||(levelValue===0)||(timeFlag===0)||(limitFlag===1)){$(".form-error").show(300);$(".list-alt").append($errormsg);$('html, body').animate({scrollTop:0},'slow');return false;}});},viewrcp:function(){if($('#pu_times').length){$("#pu_times").bind("mouseenter",function(e)
{$("#times_pu").show("fast");return false;}).click(function()
{return false;});$("#times_pu a").click(function()
{$("#times_pu").hide("fast");return false;});}},init:function(){if($('#mrb-login').length){SNI.Food.MRB.pwdfetch();}}};
if(typeof(SNI.Food.contactus)==="undefined"){SNI.Food.contactus={};}
SNI.Food.contactus={contactform:function(){$('#contactform #reason').dropdown();$('#contactform #regarding').dropdown();$('#contactform #lastwatched').dropdown();$('#contactform #whattime').dropdown();$("#contactform form").submit(function(){var nullValue="";var errorList="";var pattern=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;var reason=$("#reason").val();var regarding=$("#regarding").val();var email=$("#email").val();var confirm=$("#confirm").val();var fname=$("#fname").val();var lname=$("#lname").val();var zip=$("#zip").val();var msg=$("#msg").val();var errorform=$(".form-error");var emailflag='true';$errormsg="";$(".list-alt").find("li").remove();if(reason==="Select"){$("label[@for='reason']").find('span').addClass("error");$errormsg+="<li>Please select a reason for contacting us.</li>";}else{$("label[@for='reason']").find('span').removeClass("error");}
if(regarding==="Select"){$("label[@for='regarding']").find('span').addClass("error");$errormsg+="<li>Please select what this is regarding.</li>";}else{$("label[@for='regarding']").find('span').removeClass("error");}
if(email===nullValue){$("label[@for='email']").find('span').addClass("error");$errormsg+="<li>Please enter your e-mail address.</li>";emailflag='false';}else{$("label[@for='email']").find('span').removeClass("error");}
if(!$("label[@for='email']").find('span').hasClass("error")){if(pattern.test(email)===false){$("label[@for='email']").find('span').addClass("error");$errormsg+="<li>Please check the format of your e-mail address and re-enter.</li>";emailflag='false';}else{$("label[@for='email']").find('span').removeClass("error");}}
if(confirm===nullValue){$("label[@for='confirm']").find('span').addClass("error");$errormsg+="<li>Please confirm your e-mail address.</li>";emailflag='false';}else{$("label[@for='confirm']").find('span').removeClass("error");}
if(!$("label[@for='confirm']").find('span').hasClass("error")){if(pattern.test(confirm)===false){$("label[@for='confirm']").find('span').addClass("error");$errormsg+="<li>Please check the format of your confirmation e-mail address and re-enter.</li>";emailflag='false';}else{$("label[@for='confirm']").find('span').removeClass("error");}}
if(!$("label[@for='email']").find('span').hasClass("error")){if(email!=confirm){$("label[@for='email']").find('span').addClass("error");$("label[@for='confirm']").find('span').addClass("error");$errormsg+="<li>Please make sure your e-mail address and confirmation e-mail address match.</li>";emailflag='false';}}
if(!$("label[@for='confirm']").find('span').hasClass("error")){if(email!=confirm){$("label[@for='email']").find('span').addClass("error");$("label[@for='confirm']").find('span').addClass("error");$errormsg+="<li>Please make sure your e-mail address and confirmation e-mail address match.</li>";emailflag='false';}}
if(fname===nullValue){$("label[@for='fname']").find('span').addClass("error");$errormsg+="<li>Please enter your first name.</li>";}else{$("label[@for='fname']").find('span').removeClass("error");}
if(lname===nullValue){$("label[@for='lname']").find('span').addClass("error");$errormsg+="<li>Please enter your last name.</li>";}else{$("label[@for='lname']").find('span').removeClass("error");}
if(zip===nullValue){$("label[@for='zip']").find('span').addClass("error");$errormsg+="<li>Please enter your zip code.</li>";}else{$("label[@for='zip']").find('span').removeClass("error");}
if(msg===nullValue){$("label[@for='msg']").find('span').addClass("error");$errormsg+="<li>Please enter a message.</li>";}else{$("label[@for='msg']").find('span').removeClass("error");}
if((reason==="Select")||(regarding==="Select")||(email===nullValue)||(confirm===nullValue)||(fname===nullValue)||(lname===nullValue)||(zip===nullValue)||(msg===nullValue)||(emailflag==="false")){$(".form-error").show(300);$(".list-alt").append($errormsg);$('html, body').animate({scrollTop:0},'slow');return false;}});}};
if(typeof(SNI.Food.newsletters)==="undefined"){SNI.Food.newsletters={};}
SNI.Food.newsletters={choose:function(){$(".morelink").find("a.moretoggle").click(function(){if($(".morelink a.moretoggle").hasClass('active')){$(".morelink a.moretoggle").removeClass('active');$(".morelink .morelist").hide(250);return false;}else{$(".morelink .morelist").show(250);$(".morelink a.moretoggle").addClass('active');return false;}});$("fieldset#required-list").find("#checkall").click(function(){var $this=$(this);var checkValue=$this.find('span').html();if(checkValue==='Check All'){$("#required-list input[type=checkbox]").each(function(){$("#required-list input[type='checkbox']").attr('checked',true);});$this.find('span').html('Uncheck All');}else{$("#required-list input[type=checkbox]").each(function(){$("#required-list input[type='checkbox']").attr('checked',false);});$this.find('span').html('Check All');}
return false;});$("fieldset.morelist").find("#optionalall").click(function(){var $this=$(this);var checkValue=$this.find('span').html();if(checkValue==='Check All'){$(".morelist input[type=checkbox]").each(function(){$(".morelist input[type='checkbox']").attr('checked',true);});$this.find('span').html('Uncheck All');}else{$(".morelist input[type=checkbox]").each(function(){$(".morelist input[type='checkbox']").attr('checked',false);});$this.find('span').html('Check All');}
return false;});$("#newsletter-options form").submit(function(){var nullValue="";var errorList="";var pattern=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;var fname=$("#fname").val();var lname=$("#lname").val();var email=$("#email").val();var emailconfirm=$("#emailconfirm").val();var zipcode=$("#zipcode").val();var errorform=$(".form-error");var requiredchecked='false';var requiredchecked2='false';var emailflag='true';$errormsg="";$(".list-alt").find("li").remove();$("#required-list input[type=checkbox]:checked").each(function(){requiredchecked='true';});$("#required-list-2 input[type=checkbox]:checked").each(function(){requiredchecked2='true';});if(requiredchecked==='false'){$("#required-list h3 span").addClass("error");$errormsg+="<li>Please enter at least one Food Network newsletter.</li>";}else{$("#required-list h3 span").removeClass("error");}
if(requiredchecked2==='false'){$("#required-list-2 h3 span").addClass("error");$errormsg+="<li>Please agree to Food Network's Privacy Policy.</li>";}else{$("#required-list-2 h3 span").removeClass("error");}
if(fname===nullValue){$("label[for='fname']").find('span').addClass("error");$errormsg+="<li>Please enter your first name.</li>";}else{$("label[for='fname']").find('span').removeClass("error");}
if(lname===nullValue){$("label[for='lname']").find('span').addClass("error");$errormsg+="<li>Please enter your last name.</li>";}else{$("label[for='lname']").find('span').removeClass("error");}
if(email===nullValue){$("label[for='email']").find('span').addClass("error");$errormsg+="<li>Please enter your e-mail address.</li>";emailflag='false';}else{$("label[for='email']").find('span').removeClass("error");}
if(emailconfirm===nullValue){$("label[for='emailconfirm']").find('span').addClass("error");$errormsg+="<li>Please confirm your e-mail address.</li>";emailflag='false';}else{$("label[for='emailconfirm']").find('span').removeClass("error");}
if(!$("label[for='email']").find('span').hasClass("error")){if(pattern.test(email)===false){$("label[for='email']").find('span').addClass("error");$errormsg+="<li>Please check the format of your e-mail address and re-enter.</li>";emailflag='false';}else{$("label[for='email']").find('span').removeClass("error");}}
if(!$("label[for='email']").find('span').hasClass("error")){if((email.indexOf('@')==-1)||(email.indexOf('.')==-1)||(email.indexOf(' ')!=-1)||(email.length<6)){$("label[for='email']").find('span').addClass("error");$errormsg+="<li>Please check the format of your e-mail address and re-enter.</li>";emailflag='false';}else{$("label[for='email']").find('span').removeClass("error");}}
if(!$("label[for='email']").find('span').hasClass("error")){if(pattern.test(emailconfirm)===false){$("label[for='emailconfirm']").find('span').addClass("error");$errormsg+="<li>Please check the format of your confirmation e-mail address and re-enter.</li>";emailflag='false';}else{$("label[for='emailconfirm']").find('span').removeClass("error");}}
if(!$("label[for='email']").find('span').hasClass("error")){if(email!=emailconfirm){$("label[for='email']").find('span').addClass("error");$("label[for='emailconfirm']").find('span').addClass("error");$errormsg+="<li>Please make sure your e-mail address and confirmation e-mail address match.</li>";emailflag='false';}}
if(!$("label[for='emailconfirm']").find('span').hasClass("error")){if(email!=emailconfirm){$("label[for='email']").find('span').addClass("error");$("label[for='emailconfirm']").find('span').addClass("error");$errormsg+="<li>Please make sure your e-mail address and confirmation e-mail address match.</li>";emailflag='false';}}
if(zipcode===nullValue){$("label[for='zipcode']").find('span').addClass("error");$errormsg+="<li>Please enter your zip code.</li>";}else{$("label[for='zipcode']").find('span').removeClass("error");}
if((zipcode.length>5)||(zipcode.length<5)){$("label[for='zipcode']").find('span').addClass("error");$errormsg+="<li>Please enter a 5 digit zip code.</li>";}else{$("label[for='zipcode']").find('span').removeClass("error");}
if((requiredchecked==="false")||(requiredchecked2==="false")||(fname===nullValue)||(lname===nullValue)||(emailflag==="false")||(zipcode===nullValue)){$(".form-error").show(300);$(".list-alt").append($errormsg);$('html, body').animate({scrollTop:0},'slow');return false;}});},changeemail:function(){$("#newsletter-options form").submit(function(){var nullValue="";var errorList="";var pattern=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;var newemail=$("#newemail").val();var oldemail=$("#oldemail").val();var emailconfirm=$("#emailconfirm").val();var errorform=$(".form-error");var emailflag='true';$errormsg="";$(".list-alt").find("li").remove();if(oldemail===nullValue){$("label[for='oldemail']").find('span').addClass("error");$errormsg+="<li>Please enter your old e-mail address.</li>";emailflag='false';}else{$("label[for='oldemail']").find('span').removeClass("error");}
if(newemail===nullValue){$("label[for='newemail']").find('span').addClass("error");$errormsg+="<li>Please enter your new e-mail address.</li>";emailflag='false';}else{$("label[for='newemail']").find('span').removeClass("error");}
if(emailconfirm===nullValue){$("label[for='emailconfirm']").find('span').addClass("error");$errormsg+="<li>Please confirm your new e-mail address.</li>";emailflag='false';}else{$("label[for='emailconfirm']").find('span').removeClass("error");}
if(!$("label[for='oldemail']").find('span').hasClass("error")){if(pattern.test(oldemail)===false){$("label[for='oldemail']").find('span').addClass("error");$errormsg+="<li>Please check the format of your old e-mail address and re-enter.</li>";emailflag='false';}else{$("label[for='oldemail']").find('span').removeClass("error");}}
if(!$("label[for='newemail']").find('span').hasClass("error")){if(pattern.test(newemail)===false){$("label[for='newemail']").find('span').addClass("error");$errormsg+="<li>Please check the format of your new e-mail address and re-enter.</li>";emailflag='false';}else{$("label[for='newemail']").find('span').removeClass("error");}}
if(!$("label[for='emailconfirm']").find('span').hasClass("error")){if(pattern.test(emailconfirm)===false){$("label[for='emailconfirm']").find('span').addClass("error");$errormsg+="<li>Please check the format of your confirmation new e-mail address and re-enter.</li>";emailflag='false';}else{$("label[for='emailconfirm']").find('span').removeClass("error");}}
if((!$("label[for='newemail']").find('span').hasClass("error"))||(!$("label[for='emailconfirm']").find('span').hasClass("error"))){if(newemail!=emailconfirm){$("label[for='newemail']").find('span').addClass("error");$("label[for='emailconfirm']").find('span').addClass("error");$errormsg+="<li>Please make sure your e-mail address and confirmation e-mail address match.</li>";emailflag='false';}}
if((oldemail===nullValue)||(emailconfirm===nullValue)||(newemail===nullValue)||(emailflag==="false")){$(".form-error").show(300);$(".list-alt").append($errormsg);$('html, body').animate({scrollTop:0},'slow');return false;}});},unsubscribe:function(){$(".morelink").find("a.moretoggle").click(function(){if($(".morelink a.moretoggle").hasClass('active')){$(".morelink a.moretoggle").removeClass('active');$(".morelink .morelist").hide(250);return false;}else{$(".morelink .morelist").show(250);$(".morelink a.moretoggle").addClass('active');return false;}});$("fieldset#required-list").find("#checkall").click(function(){var $this=$(this);var checkValue=$this.find('span').html();if(checkValue==='Check All'){$("#required-list input[type=checkbox]").each(function(){$("#required-list input[type='checkbox']").attr('checked',true);});$this.find('span').html('Uncheck All');}else{$("#required-list input[type=checkbox]").each(function(){$("#required-list input[type='checkbox']").attr('checked',false);});$this.find('span').html('Check All');}
return false;});$("#newsletter-options form").submit(function(){var nullValue="";var errorList="";var pattern=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;var email=$("#email").val();var emailconfirm=$("#emailconfirm").val();var errorform=$(".form-error");var requiredchecked='false';var emailflag='true';$errormsg="";$(".list-alt").find("li").remove();$("#required-list input[type=checkbox]:checked").each(function(){requiredchecked='true';});if(requiredchecked==='false'){$("#required-list h4 span").addClass("error");$errormsg+="<li>Please enter at least one Food Network newsletter.</li>";}else{$("#required-list h4 span").removeClass("error");}
if(email===nullValue){$("label[for='email']").find('span').addClass("error");$errormsg+="<li>Please enter your e-mail address.</li>";emailflag='false';}else{$("label[for='email']").find('span').removeClass("error");}
if(emailconfirm===nullValue){$("label[for='emailconfirm']").find('span').addClass("error");$errormsg+="<li>Please confirm your e-mail address.</li>";emailflag='false';}else{$("label[for='emailconfirm']").find('span').removeClass("error");}
if(!$("label[for='email']").find('span').hasClass("error")){if(pattern.test(email)===false){$("label[for='email']").find('span').addClass("error");$errormsg+="<li>Please check the format of your e-mail address and re-enter.</li>";emailflag='false';}else{$("label[for='email']").find('span').removeClass("error");}}
if(!$("label[for='email']").find('span').hasClass("error")){if(pattern.test(emailconfirm)===false){$("label[for='emailconfirm']").find('span').addClass("error");$errormsg+="<li>Please check the format of your confirmation e-mail address and re-enter.</li>";emailflag='false';}else{$("label[for='emailconfirm']").find('span').removeClass("error");}}
if(!$("label[for='email']").find('span').hasClass("error")){if(email!=emailconfirm){$("label[for='email']").find('span').addClass("error");$("label[for='emailconfirm']").find('span').addClass("error");$errormsg+="<li>Please make sure your e-mail address and confirmation e-mail address match.</li>";emailflag='false';}}
if(!$("label[for='emailconfirm']").find('span').hasClass("error")){if(email!=emailconfirm){$("label[for='email']").find('span').addClass("error");$("label[for='emailconfirm']").find('span').addClass("error");$errormsg+="<li>Please make sure your e-mail address and confirmation e-mail address match.</li>";emailflag='false';}}
if((requiredchecked==="false")||(emailflag==="false")){$(".form-error").show(300);$(".list-alt").append($errormsg);$('html, body').animate({scrollTop:0},'slow');return false;}});}};
SNI.Food.BorderFix=function(){var center_column=$('.fn-we');var left_rail=$('.fn-ww');if(left_rail.height()>center_column.height()){var extend_length=left_rail.height()-center_column.height();center_column.css('padding-bottom',extend_length+30+'px');}};SNI.Food.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="ie6-msg" class="clrfix"><a href="#" class="close">Close</a><div id="ie6-txt"><h3>We Noticed You Are Using Internet Explorer 6.</h3><p>We detected your browser is out of date. For the best possible experience, upgrade to the latest version of <a href="http://www.browserforthebetter.com/download.html" target="_blank">Internet Explorer</a>, or try one of these fine browsers: <a href="http://www.firefox.com" target="_blank">Firefox</a> or <a href="http://www.apple.com/safari/download/" target="_blank">Safari</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><ul><li><a id="icn-ie" href="http://www.browserforthebetter.com/download.html" target="_blank">Get Internet Explorer</a></li><li><a id="icn-ff" href="http://www.firefox.com" target="_blank">Get Firefox</a></li><li><a id="icn-sf" href="http://www.apple.com/safari/download/" target="_blank">Get Safari</a></li></ul></div>';html=$(html);$('a.close, .remind a.yes',html).click(function(){bc.setReminder(30);$(html).slideUp();SNI.Food.Omniture.ClickTrackSingle(this,"UpgradeIE6 ","Food");return false;});$('.remind a.no',html).click(function(){bc.setReminder(365);$(html).slideUp();SNI.Food.Omniture.ClickTrackSingle(this,"UpgradeIE6 ","Food");return false;});$('#main-bd').prepend(html);html.show();SNI.Food.Omniture.ClickTrackSingle("#ie6-msg #ie6-txt","UpgradeIE6 ","Food");SNI.Food.Omniture.ClickTrackSingle("#ie6-msg ul li","UpgradeIE6 ","Food");SNI.Food.Omniture.ClickTrackSingle("#ie6-msg .remind","UpgradeIE6 ","Food");}}},setReminder:function(days){SNI.Util.Cookie.set('upgradeReminderSet','1',days);SNI.Util.Cookie.set('upgradePreviouslyReminded','1',365*2);}};$(document).ready(function(){SNI.Food.BorderFix();SNI.Food.BrowserCheck.init();});
if(typeof(SNI.Food.ImageEnlarge)=="undefined"){SNI.Food.ImageEnlarge={};}
SNI.Food.ImageEnlarge={clickCtrl:".img-enlarge",insertArea:"#main-bd",imgFrame:"#blow-up",closeCtrl:"#blow-up a.close",activeFl:false,init:function(){$(SNI.Food.ImageEnlarge.clickCtrl).bind("click",SNI.Food.ImageEnlarge.clickExpand);},clickExpand:function(e){if(!SNI.Food.ImageEnlarge.activeFl)
{$(SNI.Food.ImageEnlarge.insertArea).prepend(SNI.Food.ImageEnlarge.htmlImage(this));$(SNI.Food.ImageEnlarge.closeCtrl).bind("click",SNI.Food.ImageEnlarge.closeImg);SNI.Food.ImageEnlarge.activeFl=true;myTop=Math.max($(window).scrollTop()-$(SNI.Food.ImageEnlarge.insertArea).offset().top,0);if(myTop+$(SNI.Food.ImageEnlarge.imgFrame).height()>$(SNI.Food.ImageEnlarge.insertArea).height())
{myTop-=(myTop+$(SNI.Food.ImageEnlarge.imgFrame).height()-$(SNI.Food.ImageEnlarge.insertArea).height());myTop=Math.max(myTop,0);}
$(SNI.Food.ImageEnlarge.imgFrame).css("top",myTop);}
return false;},htmlImage:function(poplink){retHTML="<div id=\"blow-up\" class=\"clrfix\"><div class=\"bu-hd\"></div><div class=\"bu-bd\"><div class=\"bu-bd-hd\"><a class=\"close\" href=\"#\">Close</a></div><img width=\"616\" src=\""+poplink.href+"\" alt=\"";retHTML+=$(poplink).attr("rel").replace(/"/g,"&quot;");retHTML+="\"><div class=\"bu-bd-ft clrfix\"><!--[if IE]><center><![endif]--><p class=\"clrfix\"><span class=\"lgbtn\"><a class=\"close\" href=\"#\"><span class=\"lgbtn-lfcap\"></span><span class=\"lgbtn-text\">CLOSE</span><span class=\"lgbtn-rtcap\"></span></a></span>";if((typeof pgalurl)!="undefined")
{retHTML+="<span class=\"pgal-link\">or <a href=\""+pgalurl+"\">Go to Photo Gallery</a></span>";}
retHTML+="</p><!--[if IE]></center><![endif]--></div></div><div class=\"bu-ft\"></div>"
return retHTML;},closeImg:function(e){$(SNI.Food.ImageEnlarge.imgFrame).remove();SNI.Food.ImageEnlarge.activeFl=false;return false;}};
if(typeof(SNI.Food.CookTime)=="undefined"){SNI.Food.CookTime={};}
SNI.Food.CookTime={popCtrl:"#pu_times",timesPanel:"#times_pu",closeCtrl:"#times_pu a",init:function(){$(SNI.Food.CookTime.popCtrl).bind("mouseenter",SNI.Food.CookTime.popItUp).click(function(){return false;});},popItUp:function(){$(SNI.Food.CookTime.timesPanel).show("fast");$(SNI.Food.CookTime.timesPanel).bind("mouseleave",SNI.Food.CookTime.closeIt);$(SNI.Food.CookTime.closeCtrl).click(SNI.Food.CookTime.closeIt);return false;},closeIt:function(){$(SNI.Food.CookTime.timesPanel).hide("fast");return false;}};
if(typeof(SNI.Food.PagedPhotos)=="undefined"){SNI.Food.PagedPhotos={};}
SNI.Food.PagedPhotos={lgImg:"#pgallery .largeImage",panel:"#pgallery .largeImage .imgpanel",panelClose:"#pgallery .largeImage .imgpanel .close-btn",init:function(){$(SNI.Food.PagedPhotos.lgImg).bind("mouseenter",function(){$(SNI.Food.PagedPhotos.lgImg).find(".nextlnk, .prevlnk ").css("display","block");}).bind("mouseleave",function(){$(SNI.Food.PagedPhotos.lgImg).find(".prevlnk, .nextlnk").css("display","none");});$(SNI.Food.PagedPhotos.panelClose).bind("click",function(e){$(SNI.Food.PagedPhotos.panel).css("display","none");e.preventDefault();});}};
if(typeof(SNI.Food.PagedPhotos2)=="undefined"){SNI.Food.PagedPhotos2={};}
SNI.Food.PagedPhotos2={init:function(){if($.browser.mozilla&&$.browser.version<"1.9")
{$("#main-bd .content").css("padding-top","0px");}
$("#pgallery2 .close-btn").click(function(){var topmargin=8;var panelheight=$('#pgallery2 .imgpanel').height();var shrinkheight=panelheight-topmargin;$(".imgpanel").animate({bottom:-shrinkheight+"px"},500);$("#pgallery2 .imgpanel span.close-btn").css("display","none");$("#pgallery2 .imgpanel em").css("visibility","hidden");$("#pgallery2 .imgpanel span.open-btn").css("display","block");return false;});$("#pgallery2 .open-btn").click(function(){$(".imgpanel").animate({bottom:"0px"},500);$("#pgallery2 .imgpanel span.open-btn").css("display","none");$("#pgallery2 .imgpanel em").css("visibility","visible");$("#pgallery2 .imgpanel span.close-btn").css("display","block");return false;});}};
if(typeof(SNI.Food.PagedPhotos3)=="undefined"){SNI.Food.PagedPhotos3={};}
SNI.Food.PagedPhotos3={init:function(){ITMPERPANEL=9;XBASE=$("#pgallery3 .pglnks").position().left;ITMLAST=$("#pgallery3 .pglnks li").length-1;ITMWIDTH=$("#pgallery3 .pglnks li").outerWidth();newwidth=(ITMLAST+1)*ITMWIDTH;if(ITMLAST>ITMPERPANEL){++newwidth;}
$("#pgallery3 .pglnks").css("width",newwidth);$("#pgallery3 .pglnkmask .leftctrl a").click(function(){if($(this).hasClass("dis")){return false;}
itmcur=Math.round((XBASE-$("#pgallery3 .pglnks").position().left)/ITMWIDTH);itmnew=Math.max(0,itmcur-ITMPERPANEL);if(itmcur==ITMLAST-ITMPERPANEL){$("#pgallery3 .pglnkmask .rightctrl a").removeClass("dis");}
$("#pgallery3 .pglnks").animate({left:(XBASE-itmnew*ITMWIDTH)+"px"},SNI.Food.ANIMATION_SPEED);if(itmnew==0){$("#pgallery3 .pglnkmask .leftctrl a").addClass("dis");}
return false;});$("#pgallery3 .pglnkmask .rightctrl a").click(function(){if($(this).hasClass("dis")){return false;}
itmcur=Math.round((XBASE-$("#pgallery3 .pglnks").position().left)/ITMWIDTH);itmnew=Math.min(ITMLAST-ITMPERPANEL,itmcur+ITMPERPANEL);if(itmcur==0){$("#pgallery3 .pglnkmask .leftctrl a").removeClass("dis");}
$("#pgallery3 .pglnks").animate({left:(XBASE-itmnew*ITMWIDTH)+"px"},SNI.Food.ANIMATION_SPEED);if(itmnew==ITMLAST-ITMPERPANEL){$("#pgallery3 .pglnkmask .rightctrl a").addClass("dis");}
return false;});$("#pgallery3 .pglnks li a").bind("mouseenter",function(){$(this).parent().find(".tnframe").show(SNI.Food.ANIMATION_SPEED);}).bind("mouseleave",function(){$(this).parent().find(".tnframe").hide(SNI.Food.ANIMATION_SPEED);});if($.browser.msie){$("#pgallery3 .photonav a").click(function(){location.href=this.href;return false;});}
$("#pgallery3 .endframe .nav a").click(function(){$("#pgallery3 .endframe .nav li.sel").removeClass("sel");$(".endframe .tab").hide();$(".endframe .tab."+$(this).parent().parent().attr("class")).show();$(this).parent().parent().addClass("sel");return false;});$("#pgallery3 .endframe div.share p#copylink a").click(function(){$("#embed_code").select();return false;});$("#pgallery3 .endframe .share .digg a").click(function(){window.open('http://digg.com/submit?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(mdManager.getParameter('Title'))+'&topic=food_drink');return false;});$("#pgallery3 .endframe .share .fb a").click(function(){window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(location.href)+'&t='+encodeURIComponent(mdManager.getParameter('Title')),'sharer','toolbar=0,status=0,width=626,height=436,resizable=yes');return false;});$("#pgallery3 .endframe .share .mysp a").click(function(){window.open('http://www.myspace.com/index.cfm?fuseaction=postto&'+'t='+encodeURIComponent(mdManager.getParameter('Title'))+'&u='+encodeURIComponent(location.href));return false;});$("#pgallery3 .endframe .share .deli a").click(function(){window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(mdManager.getParameter('Title')),'delicious','toolbar=no,width=550,height=550,resizable=yes');return false;});idx=$("#pgallery3 .pglnks li").index($("#pgallery3 .pglnks li:has(>span)"));if(idx>ITMPERPANEL)
{itmnew=Math.min(ITMLAST-ITMPERPANEL,Math.floor((idx-1)/ITMPERPANEL)*ITMPERPANEL);$("#pgallery3 .pglnks").css("left",(XBASE-itmnew*ITMWIDTH)+"px");$("#pgallery3 .pglnkmask .leftctrl a").removeClass("dis");if(itmnew==ITMLAST-ITMPERPANEL){$("#pgallery3 .pglnkmask .rightctrl a").addClass("dis");}}
$("#pgallery3 .largeImage img").load(function(){if($("#pgallery3 .largeImage img").height()>$("#pgallery3 .largeImage img").width()){$("#pgallery3 .largeImage, #pgallery3 .photowrap").height(799);}else{$("#pgallery3 .largeImage, #pgallery3 .photowrap").height(451);}
return;});}}
if(typeof(SNI.Food.QuickVote)=="undefined"){SNI.Food.QuickVote={};}
SNI.Food.QuickVote={inputLink:"#poll-input-link",resultLink:"#poll-result-link",inputPanel:"#inputPanel",inputForm:"#quick-vote-poll",resultsPanel:"#resultsPanel",submittingPanel:".quick-vote .submitting",loadingPanel:".quick-vote .loading",validateOptions:{rules:{Rating:"required"},messages:{Rating:""},errorContainer:"#quick-vote-poll .errormsg"},voteURL:'',resURL:'',POLL_Cookie:'',oValidator:'',init:function(pollnum,voteURL,resURL){SNI.Food.QuickVote.voteURL=voteURL;SNI.Food.QuickVote.resURL=resURL;SNI.Food.QuickVote.POLL_Cookie="FOOD_poll_"+pollnum;SNI.Food.QuickVote.oValidator=$(SNI.Food.QuickVote.inputForm).validate(SNI.Food.QuickVote.validateOptions);SNI.Food.QuickVote.oValidator.resetForm();$(SNI.Food.QuickVote.inputForm).get(0).reset();$(SNI.Food.QuickVote.resultLink).click(function(){$(SNI.Food.QuickVote.inputPanel).hide();SNI.Food.QuickVote.showResults(resURL);return false;});$(SNI.Food.QuickVote.inputPanel).submit(SNI.Food.QuickVote.submitVote);if(SNI.Util.Cookie.get(SNI.Food.QuickVote.POLL_Cookie)=="yes"){$(SNI.Food.QuickVote.inputPanel).hide();SNI.Food.QuickVote.showResults(resURL);}
else
{$(SNI.Food.QuickVote.inputPanel).show();}},submitVote:function(){$(SNI.Food.QuickVote.inputPanel).hide();$(SNI.Food.QuickVote.submittingPanel).show();$.post(SNI.Food.QuickVote.voteURL,$(SNI.Food.QuickVote.inputForm).serialize(),SNI.Food.QuickVote.afterSubmit);return false;},afterSubmit:function(){SNI.Util.Cookie.set(SNI.Food.QuickVote.POLL_Cookie,"yes");$(SNI.Food.QuickVote.submittingPanel).hide();SNI.Food.QuickVote.showResults();},showResults:function(){$(SNI.Food.QuickVote.loadingPanel).show();$(SNI.Food.QuickVote.resultsPanel).load(SNI.Food.QuickVote.resURL,'',SNI.Food.QuickVote.resInit);return false;},resInit:function(){$(SNI.Food.QuickVote.loadingPanel).hide();$(SNI.Food.QuickVote.resultsPanel).show();$(SNI.Food.QuickVote.inputLink).click(function(){SNI.Food.QuickVote.showInputForm();return false;});return;},showInputForm:function(){$(SNI.Food.QuickVote.resultsPanel).empty();$(SNI.Food.QuickVote.resultsPanel).hide();SNI.Food.QuickVote.oValidator.resetForm();$(SNI.Food.QuickVote.inputForm).get(0).reset();$(SNI.Food.QuickVote.inputPanel).show();return false;}};
if(typeof(SNI.Food.RecipeCollections)=="undefined"){SNI.Food.RecipeCollections={};}
SNI.Food.RecipeCollections={hoverCity:function(element){$('#fn-w').css({'overflow':'visible'});$('#rec-col-groups ol > li').bind("mouseenter mouseleave",function(e){$(this).toggleClass('hoverCity');});SNI.Food.Omniture.ClickTrack("#rec-col-groups .group-wrap","Food:Site: Recipe Collections Groups","Recipe_Collections-Groups");},rightRail:function(element){$('#rec-col-wrap .more-colls').hide();$('a.more-colls-cta').hide();$('a.more-all').hide();var protectedCount=$('.more-colls-cta span').text();var allCollsCount=$('.status a em').text();var collectionName=$('.dpl-pop-tabs h5:first').text();collectionName=jQuery.trim(collectionName);var topicLink=$('a.topic-link').attr('href');var collLink=$('a.exp-all').attr('href');$('.status a em').wrapInner('<span class="collectionCount"></span>');$('.status a em').append('<span class="collectionName">&nbsp;'+collectionName+'</span>');var totalCount=$('.status a .collectionCount').text();var visibleCount=$('#rec-col-wrap li.rec-item:visible').length;if(totalCount>2){visibleCount=3;$('a.cta[rel="more"]').show();$('a.more-colls-cta').hide();}else{$('a.more-colls-cta').hide();};if(totalCount<2){$('a.cta[rel="more"]').hide();}else{$('a.cta[rel="more"]').show();};$('a.cta[rel="more"]').click(function(){visibleCount=totalCount;});$('#status-items').text('1-'+visibleCount);if($('#more-collections-tab').hasClass('ui-tabs-selected')){$('ul.ingredients').hide();$('ul.more-colls').show();$('.collectionName').hide();$('a.more-colls-cta').show();visibleCount=$('ul.more-colls li').length;$('.status a .collectionCount').text(protectedCount);$('#status-items').text('1-'+visibleCount);};if($('ul:visible').hasClass('more-colls')){$('a.exp-all').show();$('a.cta[rel="more"]').hide();$('a.more-colls-cta').show();$('.topic-link').attr({href:collLink});visibleCount=$('ul.more-colls li').length;}else{$('a.exp-all').hide();visibleCount=3;};$('#rec-col-wrap li.rec-item').each(function(recIndex){if(recIndex>2){$(this).hide()};});$('.dpl-pop-tabs h5').click(function(){if($(this).hasClass('ui-tabs-selected')){}else{var visibleUL=$('#rec-col-wrap ul:visible')
$(visibleUL).hide().removeClass('active-list');$(visibleUL).siblings().show().addClass('active-list');};if($('ul:visible').hasClass('more-colls')){$('a.exp-all').show();$('.status a .collectionCount').text(protectedCount);$('a.cta[rel="more"]').hide();$('a.more-colls-cta').show();$('#status-items').text('1-8');visibleCount=$('ul.more-colls li').length;}else{$('.collectionName').show();$('.more-colls-cta').hide();$('a.cta').show();$('a.exp-all').hide();visibleCount=$('#rec-col-wrap li.rec-item:visible').length;totalCount=$('#rec-col-wrap li.rec-item').length;$('.status a .collectionCount').text(allCollsCount);if(totalCount>2){$('a.cta[rel="more"]').show();$('a.more-colls-cta').hide();}else{$('a.more-colls-cta').hide();};$('#status-items').text('1-'+visibleCount);};if($('.exp-all').is(':visible')){$('.collectionName').hide();visibleCount=$('ul.more-colls li').length;$('.topic-link').attr({href:collLink});}else{$('.collectionName').show();$('.topic-link').attr({href:topicLink});};if($('ul:visible').hasClass('more-colls')){};if($('a.cta[rel="more"]').hasClass('expanded')){$('a.cta[rel="more"]').removeClass('expanded');$('a.cta[rel="more"]').hide();$('a.more-all').hide();$('#rec-col-wrap li.rec-item').each(function(recIndex){if(recIndex>2){$(this).fadeOut('slow')};});$('#status-items').text('1-'+visibleCount);$('#rec-col-wrap').animate({height:"260px"},'slow');};$(this).siblings().removeClass('ui-tabs-selected');$(this).addClass('ui-tabs-selected');return false;});$('a.cta[rel="top-3"]').click(function(){$(this).hide();$(this).next().slideDown('slow');return false;});$('a.cta[rel="more"]').click(function(){if($(this).hasClass('expanded')){$(this).removeClass('expanded');$(this).text('Show More');$('#rec-col-wrap li.rec-item').each(function(recIndex){if(recIndex>2){$(this).fadeOut('slow')};});$('#status-items').text('1-'+visibleCount);$('#rec-col-wrap').animate({height:"260px"},'slow');}else{$(this).addClass('expanded');$('#rec-col-wrap li.rec-item').fadeIn('slow');$(this).hide();$('a.more-all').show();$('#status-items').text('1-'+visibleCount);$('#rec-col-wrap').animate({height:"415px"},'slow');};return false;});},init:function(){SNI.Food.RecipeCollections.hoverCity();SNI.Food.RecipeCollections.rightRail();}};
if(typeof(SNI.Food.GalleryLibrary)==="undefined"){SNI.Food.GalleryLibrary={};}
SNI.Food.GalleryLibrary={itemsPerPage:8,columnsPerPage:4,galleryUrl:'/common/collection/site/food/formatter/assetLibrary.xsl/collectioncategory/RECIPE/collectiongroup/',itemTitle:'Recipes',errorMessage:'Sorry we could not load the Recipe Collections.',init:function(sectionUrl){this.sectionUrl=sectionUrl;this.loadSections();},loadSections:function(){var gl=this;gl.showLoading();$.ajax({dataType:'script',url:gl.sectionUrl,success:function(result){gl.hideLoading();if(typeof(sections)=="object"){var html='<ul>';$.each(sections['items'],function(key,value){html+='<li>';html+='<a href="#" data-section="'+key+'" title="'+value+'">'+SNI.Util.truncate(value,21)+'</a>';html+='</li>';});html+='</ul>';html=$(html);$('a',html).click(function(){var items=$('.gallery-library .items');$('.viewing',items).html('&nbsp;');$('.pagination',items).html('&nbsp;');gl.loadGallery($(this).attr('data-section'),1);return false;});$('.gallery-library .sections').html(html);if(sections['initialize']){$(".gallery-library .sections ul a[data-section='"+sections['initialize']+"']").click();}else{$('.gallery-library .sections ul a:first').click();}}},error:function(XMLHttpRequest,textStatus,errorThrown){$('.gallery-library .sections').html('<ul></ul>');gl.showError();}});},loadGallery:function(sectionId,page){var gl=this;gl.abortPreviousRequests();gl.showLoading();var sections=$('.gallery-library .sections ul a');sections.removeClass('selected');sections.filter("[data-section='"+sectionId+"']").addClass('selected');gl.xhr=$.ajax({dataType:'script',url:gl.buildGalleryUrl(sectionId,page),success:function(result){gl.hideLoading();if(typeof(gallery)=="object"){gl.updateViewing(gallery.current_page,gallery.total_pages,gallery.total_items,gallery.gallery_link,gallery.gallery_text);gl.updateThumbs(gallery.items);gl.updatePagination(gallery.current_page,gallery.total_pages);}},error:function(XMLHttpRequest,textStatus,errorThrown){gl.showError();},complete:function(request,textStatus){gl.xhr=null;}});},updateViewing:function(currentPage,totalPages,totalItems,galleryLink,sectionTitle){var gl=this;var start=currentPage==1?1:(gl.itemsPerPage*(currentPage-1)+1);var end=currentPage==totalPages?totalItems:start+gl.itemsPerPage-1;var html='Showing '+start+'-'+end+' of '+totalItems;html+=' <a href="'+galleryLink+'">'+sectionTitle+' Recipe Collections</a>';$('.gallery-library .items .viewing').html(html);},updateThumbs:function(items){var gl=this;var count=1;var html='<ul>';$.each(items,function(key,value){if(count%gl.columnsPerPage==0){html+='<li class="last">';}else{html+='<li>';}
html+='<h5>'+value.title+'</h5>';html+='<a rel="rcl-image'+count+'" class="thumb" href="'+value.link+'"><img src="'+value.thumb+'" width="92" height="69" alt="'+value.alt_text+'" /></a>';html+='<a class="count" href="'+value.link+'">'+value.count+'</a>';html+='<a rel="rcl-title'+count+'" href="'+value.link+'">'+value.title+' Recipes</a>';html+='</li>';count++;});for(var i=count;i<=gl.itemsPerPage;i++){if(i%gl.columnsPerPage==0){html+='<li class="empty last"></li>';}else{html+='<li class="empty"></li>';}}
html+='</ul>';$('.gallery-library .items .thumbs').html(html);},updatePagination:function(currentPage,totalPages){var gl=this;var html='<div class="pagi clrfix">';if(currentPage>1){html+='<a class="nextprev prev" href="#">&laquo; Previous</a> ';}else{html+='<span class="nextprev prev">&laquo; Previous</span> ';}
if(totalPages<10){html+=gl.getPaginationHtml(1,totalPages,currentPage,totalPages);}else{if(currentPage<6){html+=gl.getPaginationHtml(1,currentPage+2,currentPage,totalPages);}else{html+=gl.getPaginationHtml(1,2,currentPage,totalPages);html+='<span>...</span>';html+=gl.getPaginationHtml(currentPage-2,currentPage+2,currentPage,totalPages);}
if(currentPage<totalPages-4){html+='<span>...</span>';html+=gl.getPaginationHtml(totalPages-1,totalPages,currentPage,totalPages);}else{html+=gl.getPaginationHtml(currentPage+3,totalPages,currentPage,totalPages);}}
if(currentPage<totalPages){html+='<a class="nextprev next" href="#">Next &raquo;</a>';}else{html+='<span class="nextprev next">Next &raquo;</span>';}
html=$(html);var sectionId=$('.gallery-library .sections ul a.selected').attr('data-section');$('a.prev',html).click(function(){gl.loadGallery(sectionId,currentPage-1);return false;});$('a.next',html).click(function(){gl.loadGallery(sectionId,currentPage+1);return false;});$('a.page',html).click(function(){gl.loadGallery(sectionId,$(this).text());return false;});$('.gallery-library .items .pagination').html(html);},getPaginationHtml:function(fromPage,toPage,currentPage,totalPages){var html='';for(var i=fromPage;i<=toPage;i++){if(i>0&&i<=totalPages){if(i==currentPage){html+='<span class="current">'+i+'</span> ';}else{html+='<a href="#" class="page">'+i+'</a> ';}}}
return html;},showError:function(){var gl=this;var html=$('<div class="viewing">&nbsp;</div><div class="thumbs"><div class="error"><strong>'+gl.errorMessage+'</strong><br />We are working to correct this. <a href="#">Please try again.</a></div></div><div class="pagination">&nbsp;</div>');$('a',html).click(function(){var selected=$('.gallery-library .sections ul a.selected');if(selected.length>0){selected.click();}else{gl.loadSections();}
return false;});gl.hideLoading();$('.gallery-library .items').html(html);},showLoading:function(){$('.gallery-library .items .thumbs').html('<div class="loading">Loading Collections</div>');},hideLoading:function(){$('.gallery-library .items .loading').remove();},buildGalleryUrl:function(sectionId,page){var modSectionId=sectionId.replace(/-/g,"_");return this.galleryUrl+sectionId+'/pagenumber/'+page+'/recordsperpage/'+this.itemsPerPage+'/'+modSectionId+'_'+page+','+this.itemsPerPage+'.rf';},abortPreviousRequests:function(){if(this.xhr){this.xhr.abort();}}};
if(typeof(SNI.Food.TravelingLib)=="undefined"){SNI.Food.TravelingLib={};}
SNI.Food.TravelingLib={itemsPerPage:9,itemsInList:20,itemsPerRow:3,libraryUrl:SNI.Config.snapPlayListUrl+"/feeds/channel-video/",viewingPage:1,currentVideoDuration:null,currentVideoId:null,videoPaused:false,sortOrder:'RA',channels:[],channelInfo:{},init:function(){var lib=this;var params=lib.params();lib.getChannelList();lib.changeSelectedChannel();if((params.channel)&&($.inArray(params.channel+"",lib.channels)>-1)){$(".traveling-lib .sections li[data-channel='"+params.channel+"'] a").click();if(params.video){lib.viewingPage=lib.findVideoInChannel(params.video,params.channel);}}
lib.videoView(lib.getChannelId());$("form.toggle-view input:radio").change(function(){lib.toggleView($(this).val(),lib.getChannelId());});$('form.toggle-view label').click(function(){var label=$(this).attr('for');$('#'+label).change();});lib.lastPlayedVideoId=null;$('#sort-by-rank').click(function(){if($(this).find('span').hasClass('sort-ascending')){lib.loadList(lib.getChannelId(),"RD");}else{lib.loadList(lib.getChannelId(),"RA");}});$('#sort-by-title').click(function(){if($(this).find('span').hasClass('sort-ascending')){lib.loadList(lib.getChannelId(),"LD");}else{lib.loadList(lib.getChannelId(),"LA");}});$('#sort-by-date').click(function(){if($(this).find('span').hasClass('sort-descending')){lib.loadList(lib.getChannelId(),"DA");}else{lib.loadList(lib.getChannelId(),"DD");}});},params:function(){var query=jQuery.query.get();var channel,video;if(query.channel){channel=query.channel;}
if(query.video){video=query.video;}
return{'channel':channel,'video':video};},toggleView:function(view,channel_id){var lib=this;var thumbs=$('.traveling-lib div.thumbs');var list=$('.traveling-lib div.list');var resetSelected=function(){$('form.toggle-view label').removeClass('selected');}
if(view=='icons'){resetSelected();$('form.toggle-view #view-icon-label').addClass('selected');list.hide();lib.loadStream(channel_id,lib.viewingPage);thumbs.show();}else if(view=='list'){resetSelected();$('form.toggle-view #view-list-label').addClass('selected');thumbs.hide();lib.loadList(channel_id);list.show();}else{throw"Not a recognized View."}},videoView:function(channel_id){var lib=this;var toggled=$("form.toggle-view input:radio").filter(':checked').val();lib.toggleView(toggled,channel_id);},loadStream:function(sectionId,page){var lib=this;var library_url=lib.buildLibraryUrl(sectionId,page);lib.showLoading();$.ajax({dataType:'script',url:library_url,success:function(result,textStatus){lib.hideLoading();if(typeof snapTravelingLib=="undefined"){eval(result);}
lib.buildThumbs(snapTravelingLib[0]);},error:function(XMLHttpRequest,textStatus,errorThrown){if(typeof console=="object"){console.log('ERROR: '+textStatus);}}});},loadList:function(sectionId,sortOrder){var lib=this;if(sortOrder===undefined){sortOrder=lib.sortOrder;}
var library_url="";if(sectionId=="all-videos"){var player_id=$('.traveling-lib .sections li[data-channel="'+sectionId+'"]').attr('data-player');library_url=lib.libraryUrl+"0,,FOOD_PLAYER_"+player_id+"_1_"+lib.itemsInList+"_"+sortOrder+",00.json";}else{library_url=lib.libraryUrl+"0,,FOOD_CHANNEL_"+sectionId+"_1_"+lib.itemsInList+"_"+sortOrder+",00.json";}
lib.showLoading();$.ajax({dataType:'script',url:library_url,success:function(result,textStatus){lib.hideLoading();if(typeof snapTravelingLib=="undefined"){eval(result);}
lib.buildList(snapTravelingLib[0],sectionId,sortOrder);},error:function(XMLHttpRequest,textStatus,errorThrown){if(typeof console=="object"){console.log('ERROR: '+textStatus);}}});},buildList:function(data,channelId,sortOrder){var settings={};var lib=this;var total_items=data.total;var build_rows=function(key,value,sponsored){var markup="";var title=value.label;var duration=value.length;var image_src=value.thumbnailURL;var description=value.description;var date=value.delvStartDt;if((value.id==lib.currentVideoId)&&(value.length==lib.currentVideoDuration)){if(lib.videoPaused){duration="Paused";}else{duration="Playing";}}
var is_playing="";if(value.id==lib.currentVideoId){is_playing=' playing';}
var first_class="";if(key==0){markup+='<tr class="first">';}else{markup+="<tr>";}
if(sponsored!=true){markup+='<td class="rank">'+value.number+'</td>';markup+='<td class="title'+is_playing+'" data-id="'+value.id+'" data-channel="'+value.channelId+'">';}else{markup+='<td colspan="3" class="title'+is_playing+'" data-id="'+value.id+'" data-channel="'+value.channelId+'">';}
markup+='<div class="meta"><a href="#">'+title+'</a> <span class="duration">'+duration+'</span>';if((image_src!="")||(description!="")){markup+='<div class="description flyout"><div class="fly-hd"></div><div class="fly-bd clrfix">';if(image_src!=""){markup+='<img src="'+image_src+'" alt="'+title+'" class="thumbnail" />'}
if(description!=""){markup+='<p>'+description+'</p>';}
markup+='</div><div class="fly-ft"></div></div>';}
markup+='</div></td>';if(sponsored!=true){markup+='<td class="date">';markup+='<span>'+date+'</span>';markup+='</td>';}
markup+="</tr>";return markup;}
var sponsor_html="";if(data['sponsor_videos']&&(data['sponsor_videos'].length>0)){sponsor_html+='<tbody class="sponsored">';sponsor_html+='<tr><th scope="rowgroup" colspan="3">Sponsored Videos</th></tr>';$.each(data['sponsor_videos'],function(key,value){sponsor_html+=build_rows(key,value,true);});sponsor_html+='</tbody>';}
var html="";if(data['videos']&&(data['videos'].length>0)){$.each(data['videos'],function(key,value){html+=build_rows(key,value,false);});}
html=$(sponsor_html+html);var foot="";if(total_items!=data.last){if((total_items-data.last)>=lib.itemsInList){var remaining_count=lib.itemsInList;}else{var remaining_count=(total_items-data.last);}
foot+='<tfoot><tr><td colspan="3"><p class="loading" style="display: none;"><span>Loading</span></p><a class="button" href="#"><span>Load '+remaining_count+' More Videos</span></a></tr></tfoot>';}
if(foot!=""){foot=$(foot);$('a',foot).click(function(){$(this).siblings('.loading').show();$(this).hide();lib.loadMore(channelId,2,sortOrder);return false;});}
$('td.title a',html).hover(function(){var $this=$(this);$this.addClass('hover');$this.parents('td').css('z-index','5000');settings.timer=setTimeout(function(){$this.parents('td').find('.description').fadeIn('fast');settings.timer=null;},250);},function(){$(this).parents('td').css('z-index','500');$(this).removeClass('hover');clearTimeout(settings.timer);$(this).parents('td').find('.description').fadeOut('fast');});$('td.title a',html).click(function(){var vid_id=$(this).parents('td').attr('data-id');var channel_id=$(this).parents('td').attr('data-channel');lib.playVideo(vid_id,channel_id);return false;});$('div.viewing p.count').html(total_items+" Videos");if($('div.list tbody').length>0){$('div.list tbody').each(function(){$(this).remove();});}
$('div.list table').html(html);if(foot!=""){$('div.list table').append(foot);}
lib.sortable(sortOrder);},loadMore:function(channelId,page,sortOrder){var lib=this;var library_url="";if(channelId=="all-videos"){var player_id=$('.traveling-lib .sections li[data-channel="'+channelId+'"]').attr('data-player');library_url=lib.libraryUrl+"0,,FOOD_PLAYER_"+player_id+"_"+page+"_"+lib.itemsInList+"_"+sortOrder+",00.json";}else{library_url=lib.libraryUrl+"0,,FOOD_CHANNEL_"+channelId+"_"+page+"_"+lib.itemsInList+"_"+sortOrder+",00.json";}
$.ajax({dataType:'script',url:library_url,success:function(result,textStatus){if(typeof snapTravelingLib=="undefined"){eval(result);}
lib.buildMore(snapTravelingLib[0],page,channelId,sortOrder);},error:function(XMLHttpRequest,textStatus,errorThrown){if(typeof console=="object"){console.log('ERROR: '+textStatus);}}});},buildMore:function(data,page,channel,sortOrder){var settings={};var lib=this;var total_items=data.total;var last_loaded_item=$('.traveling-lib div.list tbody:not(".sponsored") tr:last td.rank').text();var build_rows=function(key,value){var markup="";var title=value.label;var duration=value.length;var image_src=value.thumbnailURL;var description=value.description;var date=value.delvStartDt;if((value.id==lib.currentVideoId)&&(value.length==lib.currentVideoDuration)){if(lib.videoPaused){duration="Paused";}else{duration="Playing";}}
var is_playing="";if(value.id==lib.currentVideoId){is_playing=' playing';}
markup+="<tr>";markup+='<td class="rank">'+value.number+'</td>';markup+='<td class="title'+is_playing+'" data-id="'+value.id+'" data-channel="'+value.channelId+'">';markup+='<div class="meta"><a href="#">'+title+'</a> <span class="duration">'+duration+'</span>';if((image_src!="")||(description!="")){markup+='<div class="description flyout"><div class="fly-hd"></div><div class="fly-bd clrfix">';if(image_src!=""){markup+='<img src="'+image_src+'" alt="'+title+'" class="thumbnail" />'}
if(description!=""){markup+='<p>'+description+'</p>';}
markup+='</div><div class="fly-ft"></div></div>';}
markup+='</div></td>';markup+='<td class="date">';markup+='<span>'+date+'</span>';markup+='</td>';markup+="</tr>";return markup;}
var html="";if(data.videos&&(data.videos.length>0)){$.each(data.videos,function(key,value){html+=build_rows(key,value);});}
html=$(html);var foot=$('div.list table tfoot a');foot.unbind();foot.show();foot.siblings('.loading').hide();if(total_items!=data.last){if((total_items-data.last)>=lib.itemsInList){var remaining_count=lib.itemsInList;}else{var remaining_count=(total_items-data.last);}
foot.find('span').text('Load '+remaining_count+' More Videos');}else{foot.remove();}
$(foot).click(function(){$(this).siblings('.loading').show();$(this).hide();lib.loadMore(channel,page+1,sortOrder);return false;});$('td.title a',html).hover(function(){var $this=$(this);$this.parents('td').css('z-index','5000');$this.addClass('hover');settings.timer=setTimeout(function(){$this.parents('td').find('.description').fadeIn('fast');settings.timer=null;},250);},function(){$(this).parents('td').css('z-index','500');$(this).removeClass('hover');clearTimeout(settings.timer);$(this).parents('td').find('.description').fadeOut('fast');});$('td.title a',html).click(function(){var vid_id=$(this).parents('td').attr('data-id');var channel_id=$(this).parents('td').attr('data-channel');lib.playVideo(vid_id,channel_id);return false;});$('div.list tbody:not(".sponsored")').append(html);},buildThumbs:function(data){var settings={};var lib=this;var first_item=data.first;var last_item=data.last;var total_items=data.total;var viewing=this.buildViewingInfo(first_item,last_item,total_items);var current_page=this.getCurrentPage(last_item);var total_pages=this.getTotalPages(total_items);var pagi=this.buildPagination(current_page,total_pages);var build_a_video=function(values){var title=values.label;var duration=values.length;var image_src=values.thumbnailURL;var description=values.description;if((values.id==lib.currentVideoId)&&(values.length==lib.currentVideoDuration)){if(lib.videoPaused){duration="Paused";}else{duration="Playing";}}
var is_playing="";if(values.id==lib.currentVideoId){is_playing=' class="playing"';}
markup='<li data-id="'+values.id+'" data-channel="'+values.channelId+'"'+is_playing+'>';markup+='<a href="#" class="thumbnail"><img src="'+image_src+'" width="92" height="69" alt="'+title+'" /></a>';markup+='<p class="meta"><a href="#" class="title">'+title+'</a> <span class="duration">'+duration+'</span></p>';if(description!=""){markup+='<div class="description flyout fxsm"><div class="fly-hd"></div>';markup+='<div class="fly-bd"><p>'+description+'</p></div>';markup+='<div class="fly-ft"></div></div>';}
markup+='</li>';return markup;};var sponsor_html="";if(data['sponsor_videos']&&(data['sponsor_videos'].length>0)){sponsor_html='<div class="sponsored">';sponsor_html+='<h5>Sponsor Videos</h5>';sponsor_html+='<ul class="videos clrfix">';$.each(data['sponsor_videos'],function(key,value){sponsor_html+=build_a_video(value);});sponsor_html+='</ul>';sponsor_html+='</div>';}
var html='<ul class="videos clrfix">';if(data['videos']&&(data['videos'].length>0)){$.each(data['videos'],function(key,value){html+=build_a_video(value);});}
html+='</ul>';html=$(sponsor_html+html);$('li:nth-child('+lib.itemsPerRow+'n-1)',html).each(function(){$(this).addClass("middle");});$('li:nth-child('+lib.itemsPerRow+'n)',html).each(function(){$(this).addClass('end-cap');})
$('li',html).hover(function(){var $this=$(this);$this.addClass('hover');settings.timer=setTimeout(function(){$this.find('.description').fadeIn('fast');settings.timer=null;},250);},function(){$(this).removeClass('hover');clearTimeout(settings.timer);$(this).find('.description').fadeOut('fast');});$('li a',html).click(function(){var channel_id=$(this).parents('li').attr('data-channel');var vid_id=$(this).parents('li').attr('data-id');lib.playVideo(vid_id,channel_id);return false;});$('div.thumbs').html(html).append(pagi);$('div.viewing p.count').html(viewing);},sortable:function(sortOrder){var lib=this
$('.sort-options .sort span').removeClass('sort-ascending sort-descending');switch(sortOrder){case"RA":$('#sort-by-rank span').addClass('sort-ascending');lib.sortOrder='RA';break;case"RD":$('#sort-by-rank span').addClass('sort-descending');lib.sortOrder='RD';break;case"LA":$('#sort-by-title span').addClass('sort-ascending');lib.sortOrder='LA';break;case"LD":$('#sort-by-title span').addClass('sort-descending');lib.sortOrder='LD';break;case"DA":$('#sort-by-date span').addClass('sort-ascending');lib.sortOrder='DA';break;case"DD":$('#sort-by-date span').addClass('sort-descending');lib.sortOrder='DD';break;default:throw"Not a recognized Sort Order";break;}},playVideo:function(vidId,channelId){var lib=this;snap.loadPlaylist(channelId,'',vidId);this.setPlayingVideo(vidId,channelId);var ad_location=$('#bigbox').offset().top;$('html,body').animate({scrollTop:ad_location},1000);},buildPagination:function(currentPage,totalPages){var lib=this;var html='<div class="pagination"><div class="pagi clrfix">';if(currentPage>1){html+='<a class="nextprev prev" href="#">&laquo; Previous</a> ';}else{html+='<span class="nextprev prev">&laquo; Previous</span> ';}
if(totalPages<10){html+=lib.getPaginationHtml(1,totalPages,currentPage,totalPages);}else{if(currentPage<6){html+=lib.getPaginationHtml(1,currentPage+2,currentPage,totalPages);}else{html+=lib.getPaginationHtml(1,2,currentPage,totalPages);html+='<span>...</span>';html+=lib.getPaginationHtml(currentPage-2,currentPage+2,currentPage,totalPages);}
if(currentPage<totalPages-4){html+='<span>...</span>';html+=lib.getPaginationHtml(totalPages-1,totalPages,currentPage,totalPages);}else{html+=lib.getPaginationHtml(currentPage+3,totalPages,currentPage,totalPages);}}
if(currentPage<totalPages){html+='<a class="nextprev next" href="#">Next &raquo;</a>';}else{html+='<span class="nextprev next">Next &raquo;</span>';}
html+='</div></div>';html=$(html);var sectionId=lib.getChannelId();$('a.prev',html).click(function(){lib.loadStream(sectionId,currentPage-1);lib.viewingPage=currentPage-1;return false;});$('a.next',html).click(function(){lib.loadStream(sectionId,currentPage+1);lib.viewingPage=currentPage+1;return false;});$('a.page',html).click(function(){lib.loadStream(sectionId,$(this).text());lib.viewingPage=$(this).text();return false;});return html;},getPaginationHtml:function(fromPage,toPage,currentPage,totalPages){var html='';for(var i=fromPage;i<=toPage;i++){if(i>0&&i<=totalPages){if(i==currentPage){html+='<span class="current">'+i+'</span> ';}else{html+='<a href="#" class="page">'+i+'</a> ';}}}
return html;},getTotalPages:function(totalItems){var lib=this;return Math.ceil(totalItems/lib.itemsPerPage);},getCurrentPage:function(lastItem){var lib=this;return Math.ceil(lastItem/lib.itemsPerPage);},buildViewingInfo:function(firstItem,lastItem,totalItems){return firstItem+" - "+lastItem+" of "+totalItems+" Videos";},buildLibraryUrl:function(channelId,page){if(channelId=="all-videos"){var player_id=$('.traveling-lib .sections li[data-channel="'+channelId+'"]').attr('data-player');return this.libraryUrl+"0,,FOOD_PLAYER_"+player_id+"_"+page+"_"+this.itemsPerPage+"_"+this.sortOrder+",00.json";}else{return this.libraryUrl+"0,,FOOD_CHANNEL_"+channelId+"_"+page+"_"+this.itemsPerPage+"_"+this.sortOrder+",00.json";}},changeSelectedChannel:function(){var lib=this;$('.traveling-lib .sections li a').click(function(){$(this).parents('ul').find('li a').each(function(){$(this).removeClass('selected');});$(this).addClass('selected');var channel=$(this).parent().attr('data-channel');lib.viewingPage=1;lib.videoView(channel);return false;});},getChannelList:function(){var lib=this;$('.traveling-lib .sections li').each(function(){var channel=$(this).attr('data-channel');if(channel!='all-videos'){lib.channels.push(channel);}});return lib.channels;},getChannelId:function(){return $('.traveling-lib .sections li:has("a.selected")').attr('data-channel');},findVideoInChannel:function(video_id,channel_id){var lib=this;var items_per_page=lib.itemsPerPage;var channel_listing=lib.channelInfo[channel_id+""];if(channel_listing&&channel_listing.length&&$.inArray(video_id+"",channel_listing)){var position=$.inArray(video_id+"",channel_listing);return Math.ceil((position+1)/items_per_page);}
return 1;},showLoading:function(){$('.traveling-lib .items .loading').remove();$('.traveling-lib .viewing p.count').html('<span class="loading">Loading</span>');$('<div class="loading">Loading Galleries</div>').insertAfter('.traveling-lib .items .viewing');},hideLoading:function(){$('.traveling-lib .items .loading').remove();$('.traveling-lib .viewing p.count span.loading').remove();},snapHandler:function(eventType,eventInfo){var event=SNI.Food.TravelingLib.evaluateJSON(eventInfo);SNI.Food.TravelingLib.currentVideoId=event.videoId;if(eventType=='playerReady'){SNI.Food.TravelingLib.resetPlayingVideo(SNI.Food.TravelingLib.currentVideoId,event.channelId);}else if(eventType=='itemBegin'){if(event.itemType!='ad'){SNI.Food.TravelingLib.setPlayingVideo(event.videoId,event.channelId);}}else if(eventType=='itemEnd'){if(event.itemType!='ad'){SNI.Food.TravelingLib.resetPlayingVideo(event.videoId,event.channelId);}}else if(eventType=='itemPause'){if(event.itemType!='ad'){SNI.Food.TravelingLib.pauseVideo(event.videoId,event.channelId);}}else if(eventType=='itemResume'){if(event.itemType!='ad'){SNI.Food.TravelingLib.resumeVideo(event.videoId,event.channelId);}}else if(eventType=='done'){SNI.Food.TravelingLib.resetPlayingVideo(event.videoId,event.channelId);var channels=SNI.Food.TravelingLib.channels;var channel_index=channels.indexOf(event.channelId);var next_channel=channels[(channel_index-(-1))];if((channel_index-(-1))>=channels.length){next_channel=channels[0];}
if($('.traveling-lib .sections li a.selected').parent().attr('data-channel')=='all-videos'){SNI.Food.TravelingLib.playVideo('',next_channel);}}else{throw'SNAP Callback Error';}},evaluateJSON:function(json){return eval('('+json+')');},setPlayingVideo:function(video_id,channel_id){var lib=this;lib.resetPlayingVideo(lib.lastPlayedVideoId);var currently_playing=$(".traveling-lib .items [data-id='"+video_id+"']").eq(0);var duration=currently_playing.find('.duration').text();if(!currently_playing.data('duration')){currently_playing.data('duration',duration);}
currently_playing.addClass('playing');currently_playing.find('.duration').text('Playing');lib.currentVideoDuration=duration;lib.lastPlayedVideoId=video_id;},pauseVideo:function(video_id,channel_id){var lib=this;var currently_playing=$(".traveling-lib .items [data-id='"+video_id+"']");currently_playing.find('.duration').text('Paused');lib.videoPaused=true;},resumeVideo:function(video_id,channel_id){var lib=this;var currently_playing=$(".traveling-lib .items [data-id='"+video_id+"']");currently_playing.find('.duration').text('Playing');lib.videoPaused=false;},resetPlayingVideo:function(video_id,channel_id){var lib=this;if(video_id==null){return;}
var currently_playing=$(".traveling-lib .items [data-id='"+video_id+"']");var duration=currently_playing.data('duration');currently_playing.removeClass('playing');if(duration){currently_playing.find('.duration').text(duration);}}};
if(typeof(SNI.Food.RecipeModules)=="undefined"){SNI.Food.RecipeModules={};}
SNI.Food.RecipeModules={initRCLiPad:0,clearDrops:function(){$(".drops").hide();$("body").unbind("click.drops");if(($.browser.msie)&&($(".rcp-lr").length>0)){$(".rec-item").css("padding-top",SNI.Food.RecipeModules.initRCLiPad);}},init:function(){SNI.Food.RecipeModules.initRCLiPad=parseInt($(".rec-item").css("padding-top"));$(".rcp-lr .rcp-coll .lnkexp").click(function(e){$(this).parent().hide(300,function(){$(this).next().show(800,function(){$(this).parent().addClass("sel");myFrame=$(this).parents(".vscroll");myItem=$(this).parent();myFrame.myTop=myFrame.offset().top;myFrame.myBot=myFrame.myTop+myFrame.height();myItem.myTop=myItem.offset().top;myItem.myBot=myItem.myTop+myItem.outerHeight();myDiff=0;if(myItem.myTop<myFrame.myTop){myDiff=myItem.myTop-myFrame.myTop-4;}else if(myItem.myBot>myFrame.myBot){myDiff=myItem.myBot-myFrame.myBot+4;}
myFrame.animate({scrollTop:myDiff+myFrame.scrollTop()});});});e.preventDefault();});$(".rcp-lr .drops .close").click(function(){SNI.Food.RecipeModules.clearDrops();return false;});$(".rcp-lr .lnkpop").click(function(e){SNI.Food.RecipeModules.clearDrops();myPosn=$(this).position();myPosn.left+=$(this).outerWidth();mySib=$(this).next();if((mySib.length>0)&&(mySib.position().left>=myPosn.left))
{myPosn.left+=mySib.outerWidth();}
myPosn.left+=7;myPosn.top-=14;myPop=$(this).parent().siblings(".drops");myPop.css("left",myPosn.left+"px");myPop.css("top",myPosn.top+"px");myPop.show();$("body").bind("click.drops",function(e){if(!$(e.target).parents().is(".drops")){SNI.Food.RecipeModules.clearDrops();}
return true;});if($.browser.msie){$(this).parents(".rec-item").next().css("padding-top","1px");}
return false;});$(".rcp-lr .rcp-coll .vscroll").scroll(function(){SNI.Food.RecipeModules.clearDrops();return true;});return;}};
if(typeof(SNI.Food.Quizine)=="undefined"){SNI.Food.Quizine={};}
SNI.Food.Quizine={Toolbar:{toolbar:'#toolbar',fontResize:function(element){if(element==null){element=".font-resize";}
$(element).find("li").click(function(){var defaultSize="100%";$(element).find("li").removeClass("active");$(this).addClass("active");if($(this).hasClass("med")){$("#quizine").css("font-size",defaultSize);}else if($(this).hasClass("sm")){$("#quizine").css("font-size","85%");}else{$("#quizine").css("font-size","116%");}});},emailAFriend:function(){$(SNI.Food.Quizine.Toolbar.toolbar).find(".email").click(function(){SNI.Food.Quizine.emailAFriend.init();return false;});},init:function(){SNI.Food.Quizine.Toolbar.fontResize();SNI.Food.Quizine.Toolbar.emailAFriend();}},advance:function(){},emailAFriend:{module:'#email-a-friend',null_value:"",close_module:function(speed){if(speed==null){speed=SNI.Food.ANIMATION_SPEED;}
$(this.module).fadeOut(speed);},open_module:function(){$(this.module).fadeIn(SNI.Food.ANIMATION_SPEED);},init:function(quiz_data){if(typeof(quiz_data)=="undefined"){var score={'number_correct':9,'number_of_questions':10};quiz_data={'type':"QUIZ",'title':"Title of Quiz",'url':'http://go.to/url','delvfrmt':"QUIZINE",'score':score};}
var email_a_friend=this;var module=$(email_a_friend.module);var win=$(window);var fn_w=$('#fn-w');var form=module.find('form');module.css({'top':win.scrollTop()+((win.height()/2)-(module.height()/2)),'left':(fn_w.width()/2)-(module.width()/2)});module.find('.close').click(function(){email_a_friend.close_module();});form.find(".form-submit a").click(function(){email_a_friend.close_module();return false;});email_a_friend.open_module();form.validate({errorLabelContainer:false,rules:{from_name:{required:true},from_email:{required:true,email:true},to_emails:{required:true,multipleEmails: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@food.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@food.com)."}},showErrors:function(errorMap,errorList){if(errorList.length){module.find('.message').addClass('alert').html(errorList[0].message);element=$(errorList[0].element);if(element.hasClass('isemail')){element.select();}
this.errorList=[this.errorList[0]];this.defaultShowErrors();}},submitHandler:function(){var subject="";var msg_body='';var senders_name=form.find('input[name="from_name"]').val();if(quiz_data.type==='QUIZ'){subject=senders_name+" sent you a FoodNetwork.com quiz";msg_body=senders_name+" just scored "+quiz_data.score.number_correct+" out of "+quiz_data.score.number_of_questions+" on FoodNetwork.com's "+quiz_data.title+". Can you beat this score?";msg_body+="\n\n";msg_body+="Take the quiz at "+quiz_data.url;if(quiz_data.delvfrmt==="QUIZINE"){msg_body+="\n\n"+"Plus see all the quizzes at FoodNetwork.com/Quizines";}}else{subject=senders_name+" sent you a FoodNetwork.com poll";msg_body=senders_name+" just took FoodNetwork.com's "+quiz_data.title+". You should too!";msg_body+="\n\n";msg_body+="Take the poll at "+quiz_data.url;if(quiz_data.delvfrmt==="QUIZINE"){msg_body+="\n\n"+"Plus see all the polls at FoodNetwork.com/Quizines";}}
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();var form_data="";form.find(":input:not('button')").each(function(){var input_name=$(this).attr("name");var input_value=$(this).val();form_data+=input_name+"="+input_value+"&";});form_data+='subject='+subject+'&'+'body='+msg_body+'&';$.ajax({type:"POST",url:form.attr("action"),data:form_data.slice(0,-1),cache:false,success:function(data){form.find('.loading').hide();var response=$(data);var emailSent=response.eq(7).text();if(emailSent=="false"){form.find('fieldset').show();form.find('button').removeClass('disabled').removeAttr('disabled');form.find('.cancel').removeClass("disabled");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@food.com).").show();}else{var success=module.find('.success');form.hide();success.show();var timeout=setTimeout(function(){email_a_friend.close_module(300);module.hide();success.hide();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);email_a_friend.close_module();module.hide();success.hide();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();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();}});}});}},postToFacebook:function(quiz){var caption='';if(quiz.type==='QUIZ'){caption="{*actor*} just scored "+quiz.score.number_correct+" out of "+quiz.score.number_of_questions+" on FoodNetwork.com's "+quiz.title+". Can you do better? Take the quiz at "+quiz.url+".";if(quiz.delvfrmt==="QUIZINE"){caption+="\n\nPlus see all the quizzes at FoodNetwork.com/Quizines.";}}else{caption="{*actor*} just took FoodNetwork.com's "+quiz.title+". You should too! Take the poll at "+quiz.url+".";if(quiz.delvfrmt==="QUIZINE"){caption+="\n\nPlus see all the polls at FoodNetwork.com/Quizines.";}}
var attachment={'caption':caption,'media':[{'type':'image','src':'http://images.foodnetwork.com/webfood/fn20/imgs/quiz_fb_logo.jpg','href':'http://www.foodnetwork.com/quizines'}]};FB.Connect.requireSession(function(){FB.Connect.streamPublish('',attachment);});}};
if(typeof(SNI.Food.Photogallery3)=="undefined"){SNI.Food.Photogallery3={};}
SNI.Food.Photogallery3={cbackHotSpotJSON:function(){if(SNI.Food.Photogallery3.ImageData[ITMCUR].bhs){SNI.Food.Photogallery3.doHotSpots(ITMCUR);}
SNI.Food.Photogallery3.insertProdsTab();return;},doHotSpots:function(itmSel){if(typeof SNI.Food.Photogallery3.Hotspots=="undefined"){return;}
imgId=$("#pgallery3 .pglnks li").eq(itmSel).find("a").attr("rel");for(i=0;i<SNI.Food.Photogallery3.Hotspots.images.length;++i){if(imgId==SNI.Food.Photogallery3.Hotspots.images[i].id){SNI.Food.Photogallery3.applyHotSpots(SNI.Food.Photogallery3.Hotspots.images[i],itmSel);break;}}
return;},applyHotSpots:function(oHS,itmSel){$imgCont=$("#pgallery3 #img-"+(itmSel));vi='';vc='';if($imgCont.hasClass("vert-enl")){vi="-v";vc=" v";}
$imgCont=$imgCont.find(".imgwrap");wImg=parseInt($imgCont.css("width"));hImg=parseInt($imgCont.css("height"));for(i=0;i<oHS.hotspots.length;++i){hsID="hs-"+itmSel+'-'+i+vi;hsRel="hs-"+oHS.id+'-'+oHS.hotspots[i].id;sHS='<span class="hs'+vc+'" id="'+hsID+'"><a href="'+oHS.hotspots[i].url+'" rel="'+hsRel+'">click</a><span>'+oHS.hotspots[i].name+'</span></span>';$imgCont.append(sHS);$jBtn=$imgCont.find("#"+hsID+" a");if(typeof wBtn=="undefined"){wBtn=parseInt($jBtn.css("width"));hBtn=parseInt($jBtn.css("height"));}
xBtn=Math.round(wImg*oHS.hotspots[i].hotspotXPercent/100-wBtn/2,0);yBtn=Math.round(hImg*oHS.hotspots[i].hotspotYPercent/100-hBtn/2,0);$ePop=$jBtn.next();wPop=$ePop.width()+parseInt($ePop.css("padding-left"))+parseInt($ePop.css("padding-right"));hPop=$ePop.height()+parseInt($ePop.css("padding-top"))+parseInt($ePop.css("padding-bottom"));yPop=yBtn-4-hPop;if(yPop<7){yPop=Math.max(yBtn+(hBtn-hPop)/2,7);if(xBtn+wBtn/2>wImg/2){xPop=xBtn-4-wPop;}else{xPop=xBtn+wBtn+4;}}else{xPop=xBtn+(wBtn-wPop)/2;xPop=Math.min(Math.max(7,xPop),wImg-7-wPop);}
$jBtn.css({"left":xBtn,"top":yBtn}).hover(function(){$(this).parent().find("span").addClass("on");},function(){$(this).parent().find("span").removeClass("on");}).bind("click",{oHSthis:oHS.hotspots[i]},function(e){SNI.Food.Omniture.HotSpotClick(e.data.oHSthis,"c");return SNI.Food.Photogallery3.showProd($(this))}).parent().find("span").css({"left":xPop,"top":yPop});}
return;},showProd:function($hsLink){aID=$hsLink.parent().attr("id").split("-");imgNum=parseInt(aID[1]);hsNum=parseInt(aID[2]);aRel=$hsLink.attr("rel").split("-");imgCMA=aRel[1];hsCMA=aRel[2];imgSel="#pgallery3 #img-"+imgNum;prodSel="#pgallery3 #prod-"+imgNum;bNew=false;if($(prodSel).length==0){for(i=0;i<SNI.Food.Photogallery3.Hotspots.images.length;++i){if(imgCMA==SNI.Food.Photogallery3.Hotspots.images[i].id){oHS=SNI.Food.Photogallery3.Hotspots.images[i].hotspots;hTabs='<h4>Products From this Photo:</h4>\n<div class="tab-wrap">\n<ul class="tabs">\n';hCont='<ul class="cont">';bMkt=true;for(j=0;j<oHS.length;++j){hTabs+='<li><a href="'+oHS[j].url+'">'+oHS[j].name+'</a></li>\n';hCont+='<li>\n<h4><a target="_blank" href="'+oHS[j].url+'">'+SNI.Util.strTrimEllips(oHS[j].name,42)+'</a></h4>\n';hCont+='<a class="pframe" target="_blank" href="'+oHS[j].url+'"><img width="266" height="200" src="'+oHS[j].imageURL+'"><span>More Info</span></a>';hCont+='<p>'+SNI.Util.strTrimEllips(oHS[j].description,180)+'</p>\n</li>';bMkt=bMkt&&(oHS[j].marketplaceId!="");}
hTabs+="</ul>\n</div>\n";hCont+="</ul>\n";break;}}
hOut='<div class="prod clrfix" id="prod-'+imgNum+'">\n';hOut+='<div class="l clrfix">';hOut+='<a class="close" href="#"><img width="160" src="'+$(imgSel).find("img").attr("src")+'"></a>\n';hOut+='<p><a class="close" href="#">Back to Photo</a></p>'
hOut+=hTabs;hOut+='</div>\n';hOut+='<div class="r">';hOut+='<a href="#" class="close">Close</a>\n';hOut+=hCont;if(bMkt){hOut+=SNI.Food.Photogallery3.getProdYMAL();}
hOut+='</div>\n';$("#pgallery3 .pglnkmask").before(hOut);bNew=true;$(prodSel+" .r ul.cont li").each(function(i){$(this).find("a").bind("click",{oHSthis:oHS[i]},function(e){SNI.Food.Omniture.HotSpotClick(e.data.oHSthis,"l");return true;});});$(prodSel+" .l .tabs li a").click(function(){if($(this).parent().hasClass("sel")){return false;};$(prodSel).find(".l .tabs li").removeClass("sel");$(prodSel).find(".r .cont li").removeClass("sel");$(this).parent().addClass("sel");$(prodSel).find(".r .cont li").eq($(prodSel).find(".l .tabs li").index($(prodSel).find(".l .tabs li.sel"))).addClass("sel");if($(prodSel).find(".r .relProd").length>0){$(prodSel).find(".r .relProd").replaceWith(SNI.Food.Photogallery3.getProdYMAL());}
return false;});$(prodSel+" a.close").click(function(){var $prodCont=$(this).parents(".prod");var aID=$prodCont.attr("id").split("-");var imgNum=parseInt(aID[1]);var imgSel="#pgallery3 #img-"+imgNum;$prodCont.hide();$(imgSel).show();return false;});}
$(prodSel+" .l .tabs li").removeClass("sel").eq(hsNum).addClass("sel");$(prodSel+" .r .cont li").removeClass("sel").eq(hsNum).addClass("sel");$(imgSel).hide();$(prodSel).show();if(bNew){$(prodSel+" .tab-wrap").height($(prodSel).offset().top+$(prodSel).innerHeight()-parseInt($(prodSel).css("padding-bottom"))-$(prodSel+" .tab-wrap").offset().top);}
return false;},getProdYMAL:function(){hRet='';if(typeof SNI.Food.ProductIdeas=="undefined"){return hRet;}
iSrcLen=SNI.Food.ProductIdeas.length;if(iSrcLen==0){return hRet;}
aSrc=new Array(iSrcLen);for(i=0;i<iSrcLen;++i){aSrc[i]=i;}
iDrawnLen=Math.min(iSrcLen,3);aDrawn=new Array(iDrawnLen);for(i=0;i<iDrawnLen;++i){j=Math.floor(Math.random()*aSrc.length);aDrawn[i]=aSrc[j];aSrc.splice(j,1);}
hRet='<div class="relProd clrfix">\n';hRet+='<a class="more" href="http://marketplace.hgtv.com/">More Products</a><h4>You Might Also Like:</h4>\n';hRet+='<ul class="clrfix">\n';itmClass='';for(i=0;i<iDrawnLen;++i){with(SNI.Food.ProductIdeas[aDrawn[i]]){if(i==iDrawnLen-1){itmClass=' class="last"';}
hRet+='<li'+itmClass+'><a target="_blank" href="'+pURL+'"><img width="92" height="69" src="'+iURL+'" alt="'+iAlt+'" /><span>'+pName+'</span></a></li>\n';}}
hRet+='</ul>\n';hRet+='</div>\n';return hRet;},insertProdsTab:function(){if(typeof SNI.Food.Photogallery3.Hotspots=="undefined"){return;}
hRet="<ul>\n<h4>Products From This Gallery</h4>";for(i=0;i<SNI.Food.Photogallery3.Hotspots.images.length;++i){oHS=SNI.Food.Photogallery3.Hotspots.images[i].hotspots;;for(j=0;j<oHS.length;++j){hRet+='<li><a target="_blank" href="'+oHS[j].url+'"><img src="'+oHS[j].imageURL+'" alt="'+oHS[j].name+'" />';hRet+='<p class="first"><a target="_blank" href="'+oHS[j].url+'">'+oHS[j].name+'</a></p></li>\n';}}
hRet+="</ul>\n";$("#pgallery3 .endframe .tab.shop").append(hRet);$("#pgallery3 .endframe .nav .shop").show();},init:function(){EF_IMG_HTML='<img width="92" height="69" src="http://web.hgtv.com/webhgtv/hg20/imgs/email-share_sm.jpg" alt="Share or Email this Photo Gallery" />';ITMCUR=$("#pgallery3 .pglnks li").index($("#pgallery3 .pglnks li.sel"));BYLINE="";if($("#hg-w > .intro p.byline").length>0){BYLINE=$("#hg-w > .intro p.byline").text();}
ITMPERPANEL=9;XBASE=$("#pgallery3 .pglnks").position().left;ITMLAST=$("#pgallery3 .pglnks li").length-1;ITMWIDTH=$("#pgallery3 .pglnks li").outerWidth();newwidth=(ITMLAST+1)*ITMWIDTH;if(ITMLAST>ITMPERPANEL){++newwidth;}
$("#pgallery3 .pglnks").css("width",newwidth);$("#pgallery3 .pglnkmask .leftctrl a").click(function(){if($(this).hasClass("dis")){return false;}
itmBaseCur=Math.round((XBASE-$("#pgallery3 .pglnks").position().left)/ITMWIDTH);itmBaseNew=Math.max(0,itmBaseCur-ITMPERPANEL);if(itmBaseCur==ITMLAST-ITMPERPANEL){$("#pgallery3 .pglnkmask .rightctrl a").removeClass("dis");}
$("#pgallery3 .pglnks").animate({left:(XBASE-itmBaseNew*ITMWIDTH)+"px"},SNI.Food.ANIMATION_SPEED);if(itmBaseNew==0){$("#pgallery3 .pglnkmask .leftctrl a").addClass("dis");}
return false;});$("#pgallery3 .pglnkmask .rightctrl a").click(function(){if($(this).hasClass("dis")){return false;}
itmBaseCur=Math.round((XBASE-$("#pgallery3 .pglnks").position().left)/ITMWIDTH);itmBaseNew=Math.min(ITMLAST-ITMPERPANEL,itmBaseCur+ITMPERPANEL);if(itmBaseCur==0){$("#pgallery3 .pglnkmask .leftctrl a").removeClass("dis");}
$("#pgallery3 .pglnks").animate({left:(XBASE-itmBaseNew*ITMWIDTH)+"px"},SNI.Food.ANIMATION_SPEED);if(itmBaseNew==ITMLAST-ITMPERPANEL){$("#pgallery3 .pglnkmask .rightctrl a").addClass("dis");}
return false;});$("#pgallery3 .pglnks li a").bind("mouseenter",function(){if($(this).parent().hasClass("sel")){return false;}
$(this).parent().find(".tnframe").show();$(this).parents(".pglnkmask").addClass("popactive");}).bind("mouseleave",function(){$(this).parent().find(".tnframe").hide();$(this).parents(".pglnkmask").removeClass("popactive");});$("#pgallery3 .photonav .prevlnk a").click(function(){setImg((ITMCUR+ITMLAST)%(ITMLAST+1));return false;});$("#pgallery3 .photonav .nextlnk a, #pgallery3 .largeImage a.bigimg").click(function(){setImg((ITMCUR+1)%(ITMLAST+1));return false;});$("#pgallery3 .pglnks a").click(function(){if(!$(this).parent().hasClass("sel")){$(this).parent().find(".tnframe").hide();setImg($(this).text()-1);}
return false;});$("#pgallery3 .largeImage a.vtoggle.enl").click(function(){$myImgCont=$(this).parents(".largeImage");$myImgCont.removeClass("vert-shr").addClass("vert-enl");if($myImgCont.find(" .hs.v").length==0){SNI.Food.Photogallery3.doHotSpots(parseInt($(this).parents(".largeImage").attr("id").split("-")[1]))}
return false;});$("#pgallery3 .largeImage a.vtoggle.shr").click(function(){$myImgCont=$(this).parents(".largeImage");$myImgCont.removeClass("vert-enl").addClass("vert-shr");return false;});$("#pgallery3 .largeImage .imgpanel a.open").click(function(){$myPanel=$(this).parent();$myPanel.find("a.open").hide();$myPanel.animate({bottom:"0"});$myPanel.find("a.close").show();return false;});$("#pgallery3 .largeImage .imgpanel a.close").click(function(){$myPanel=$(this).parent();myCollapseHt=parseInt(Math.max($myPanel.find("h2").outerHeight(),$myPanel.find("a.cap-lnk.close").outerHeight())+parseInt($myPanel.css("padding-top"))-$myPanel.innerHeight())+"px";$myPanel.find("a.close").hide();$myPanel.animate({bottom:myCollapseHt});$myPanel.find("a.open").show();return false;});function setImg(itmSel){if(itmSel==ITMCUR){return;}
doDynOmni(itmSel);newImgCont="#pgallery3 #img-"+itmSel;if($(newImgCont).length>0){$("#pgallery3 .largeImage, #pgallery3 .prod").hide();$(newImgCont).show();}else{$("#pgallery3 .largeImage").eq(0).clone(true).attr("id","img-"+itmSel).insertAfter("#pgallery3 .largeImage:last");$(newImgCont).hide();$("#pgallery3 .largeImage.loading").show();$(newImgCont).find(".hs").remove();$(newImgCont+" img").remove();myImg=new Image();if($(newImgCont+" a.bigimg").length>0){$(myImg).appendTo(newImgCont+" a.bigimg");}else{$(myImg).appendTo(newImgCont+" .imgwrap");}
$(myImg).load(function(){$("#pgallery3 .largeImage, #pgallery3 .prod").hide();$(newImgCont).show();if(SNI.Food.Photogallery3.ImageData[itmSel].bhs){SNI.Food.Photogallery3.doHotSpots(itmSel);}
$("#pgallery3 .largeImage.loading").hide();});setImgData(SNI.Food.Photogallery3.ImageData[itmSel],$(newImgCont));}
fixByLine(itmSel);if(itmSel==0){$("#pgallery3 .photonav .prevlnk").css("visibility","hidden");}
else if(ITMCUR==0){$("#pgallery3 .photonav .prevlnk").css("visibility","visible");}
$("#pgallery3 .photonav .pagen span").text(itmSel+1);topPrev="#pgallery3 .photonav .prevlnk";$(topPrev+" img").remove();$pgItmPrev=$("#pgallery3 .pglnks li").eq((itmSel+ITMLAST)%(ITMLAST+1));if($pgItmPrev.find("img").length>0){$pgItmPrev.find("img").clone().prependTo(topPrev+" a");}
$(topPrev+" a").attr("href",$pgItmPrev.find("a").attr("href"));topNext="#pgallery3 .photonav .nextlnk";$(topNext+" img").remove();$pgItmNext=$("#pgallery3 .pglnks li").eq((itmSel+1)%(ITMLAST+1));if($pgItmNext.find("img").length>0){$pgItmNext.find("img").clone().prependTo(topNext+" a");}
$(topNext+" a").attr("href",$pgItmNext.find("a").attr("href"));if($(newImgCont+" a.bigimg").length>0){$(newImgCont+" a.bigimg").attr("href",$pgItmNext.find("a").attr("href"));}
$("#pgallery3 .pglnks li").eq(ITMCUR).removeClass("sel");$("#pgallery3 .pglnks li").eq(itmSel).addClass("sel");ITMCUR=itmSel;SNI.Food.DynAds.refresh();if($("#print-select a.this").length>0){plink=$("#print-select a.this").attr("href");i=itmSel+1;if(i<10){i='0'+parseInt(itmSel+1);}
plink=$("#print-select a.this").attr("href");plink=plink.replace(/(.*ARTICLE-PRINT-PHOTO-GALLERY-CURRENT).*?(,00.html)$/,"$1_"+i+"$2");$("#print-select a.this").attr("href",plink);}
setPanel();SNI.Util.hitCount();return;}
function doDynOmni(i){++i;if(mdManager.getParameterString("oUrl")==""){mdManager.setParameter("oUrl",mdManager.getParameterString("Url"))}
mdManager.setParameter("Url",mdManager.getParameter("oUrl")+"?i="+parseInt(i));if(i<10){i='0'+parseInt(i);}
mdManager.setParameter("UniqueId",mdManager.getParameterString("UniqueId").replace(/(.*?)-([0-9]{1,2})$/,"$1-"+i));if(typeof s=="object"){s.t();}
return;}
function setImgData(imgData,$inImgCont){if(imgData.bvert){$inImgCont.removeClass("vert-enl").addClass("vert-shr");}else{$inImgCont.removeClass("vert-shr vert-enl");}
$inImgCont.find("img").attr("src",imgData.iurl).attr("alt",imgData.ialt);$myPanel=$inImgCont.find(".imgpanel");$myPanel.find("h2").html(imgData.ititle);$myPanel.find("cite").html(imgData.icap);if((imgData.rurl!="")&&(imgData.rtxt!="")){$myPanel.find(".lgbtn a").attr("href",imgData.rurl);$myPanel.find(".lgbtn .lgbtn-text").text(imgData.rtxt);$myPanel.find(".lgbtn").removeClass("hide");}else{$myPanel.find(".lgbtn").addClass("hide");}
if((imgData.ititle=="")&&(imgData.icap=="")&&(imgData.rurl=="")&&(imgData.rtxt=="")){$myPanel.addClass("hide");}else{$myPanel.find("a.open").hide();$myPanel.find("a.close").show();$myPanel.css({bottom:"0"});$myPanel.removeClass("hide");}
return;}
function fixByLine(itmSel){iCreator="";if(itmSel<SNI.Food.Photogallery3.ImageData.length){iCreator=SNI.Food.Photogallery3.ImageData[itmSel].creator;}
if(iCreator!=""){if($("#hg-w > .intro p.byline").length==0){$("#hg-w > .intro").append("<p class=\"byline\"></p>");}
$("#hg-w > .intro p.byline").addClass("pic").text("By "+iCreator);}else if($("#hg-w > .intro p.byline.pic").length>0){if(BYLINE!=""){$("#hg-w > .intro p.byline").removeClass("pic").text(BYLINE);}else{$("#hg-w > .intro p.byline").remove();}}
return;}
$("#pgallery3 .endframe .nav a").click(function(){$("#pgallery3 .endframe .nav li.sel").removeClass("sel");$(".endframe .tab").hide();$(".endframe .tab."+$(this).parent().parent().attr("class")).show();$(this).parent().parent().addClass("sel");return false;});$("#pgallery3 .endframe div.share p#copylink a").click(function(){$("#embed_code").select();return false;});$("#pgallery3 .endframe .share .digg a").click(function(){window.open('http://digg.com/submit?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(mdManager.getParameter('Title')));return false;});$("#pgallery3 .endframe .share .fb a").click(function(){window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(location.href)+'&t='+encodeURIComponent(mdManager.getParameter('Title')),'sharer','toolbar=0,status=0,width=626,height=436,resizable=yes');return false;});$("#pgallery3 .endframe .share .mysp a").click(function(){window.open('http://www.myspace.com/index.cfm?fuseaction=postto&'+'t='+encodeURIComponent(mdManager.getParameter('Title'))+'&u='+encodeURIComponent(location.href));return false;});$("#pgallery3 .endframe .share .deli a").click(function(){window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(mdManager.getParameter('Title')),'delicious','toolbar=no,width=550,height=550,resizable=yes');return false;});function loadHotSpotJSON(){if(typeof SNI.Food.Photogallery3.hsJSON=="undefined"){return;}
myJSONurl="http://"+location.hostname+SNI.Food.Photogallery3.hsJSON;$.ajax({url:myJSONurl,dataType:"script",cache:true,timeout:10000,success:successHotSpotJSON,error:errorHotSpotJSON,complete:completeHotSpotJSON});return;}
function errorHotSpotJSON(oXHTTP,stat,oExc){return;}
function successHotSpotJSON(dta,stat){$("#pgallery3").append('<script type="text/javascript">'+dta+'\n SNI.Food.Photogallery3.cbackHotSpotJSON();</script>');return;}
function completeHotSpotJSON(oXHTTP,stat){if(stat=="success"){}
return;}
function setPanel(){itmBaseCur=Math.round((XBASE-$("#pgallery3 .pglnks").position().left)/ITMWIDTH);itmBaseNew=Math.max(0,Math.min(ITMLAST-ITMPERPANEL,Math.floor((ITMCUR-1)/ITMPERPANEL)*ITMPERPANEL));if(itmBaseCur!=itmBaseNew)
{itmBaseNew=Math.max(0,Math.min(ITMLAST-ITMPERPANEL,Math.floor((ITMCUR-1)/ITMPERPANEL)*ITMPERPANEL));$("#pgallery3 .pglnks").css("left",(XBASE-itmBaseNew*ITMWIDTH)+"px");if(itmBaseCur==0){$("#pgallery3 .pglnkmask .leftctrl a").removeClass("dis");}
if(itmBaseNew==0){$("#pgallery3 .pglnkmask .leftctrl a").addClass("dis");}
if(itmBaseCur==ITMLAST-ITMPERPANEL){$("#pgallery3 .pglnkmask .rightctrl a").removeClass("dis");}
if(itmBaseNew==ITMLAST-ITMPERPANEL){$("#pgallery3 .pglnkmask .rightctrl a").addClass("dis");}}}
function fixEndFrame(){if($("#pgallery3 .endframe .tab.shop img").length==0){$("#pgallery3 .endframe .nav .shop").hide();}
if($("#pgallery3 .endframe .tab.ymal img").length==0){$("#pgallery3 .endframe .nav .ymal").hide();$("#pgallery3 .endframe .nav .email").addClass("sel");$("#pgallery3 .endframe .tab.email").show();}
if($("#pgallery3 .pglnks li:last img").length==0){$("#pgallery3 .pglnks li:last .tnframe").append(EF_IMG_HTML);if((ITMCUR==ITMLAST)&&($("#pgallery3 .photonav .nextlnk img").length==0)){$("#pgallery3 .photonav .nextlnk").prepend(EF_IMG_HTML);}}
return;}
bHS=false;for(i=0;i<SNI.Food.Photogallery3.ImageData.length;i++){bHS=bHS||SNI.Food.Photogallery3.ImageData[i].bhs;}
if(bHS){if(typeof SNI.Food.Photogallery3.hsJSON!="undefined"){loadHotSpotJSON()}};if(ITMCUR<SNI.Food.Photogallery3.ImageData.length){if(typeof SNI.Food.Photogallery3.hsJSON=="undefined"){if(SNI.Food.Photogallery3.ImageData[ITMCUR].bhs){SNI.Food.Photogallery3.doHotSpots(ITMCUR);}
if(bHS){SNI.Food.Photogallery3.insertProdsTab();}}
fixByLine(ITMCUR);}
$("#pgallery3 .photowrap").append('<div class="largeImage loading"><span></span><p>loading</p></div>');SNI.Food.DynAds.init();var itmSel=ITMCUR;if($.query.has('i')){itmSel=parseInt($.query.get('i'));if(isNaN(itmSel)||(itmSel<1)||(itmSel>ITMLAST+1)){itmSel=ITMCUR;}else{--itmSel;}}
if(itmSel!=ITMCUR){setImg(itmSel);}
setPanel();fixEndFrame();return;}};SNI.Food.DynAds={descr:{active:true,refreshRate:3,interstitial:false},iparm:{iURL:"",iFmt:"",iHREF:"",iHeight:"",iWidth:"",iTrackURL:"",bURL:""},impressionCt:1,init:function(){myJSON=getDartEnterpriseUrl("PHOTO_DESCRIPTOR",1);myJSON+="&params.styles=photoGallery&callback=?";$.getJSON(myJSON,SNI.Food.DynAds.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.Food.DynAds.descr.active=true;SNI.Food.DynAds.descr.refreshRate=tmp;if(oJSON.interstitial==undefined){return false;}
if(oJSON.interstitial=="true"){SNI.Food.DynAds.descr.interstitial=true;}
return true;},refresh:function(){if(!this.descr.active){return;}
$("#pgallery3 .interwrap").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.Food.DynAds.cback_interJSON);return;}else{setDartEnterpriseBanner("BIGBOX",getDartEnterpriseUrl("BIGBOX",5));}}
return;},cback_interJSON:function(oJSON){$.each(SNI.Food.DynAds.iparm,function(key,val){SNI.Food.DynAds.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.Food.DynAds){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.Food.DynAds){if(iparm.iURL==""||iparm.iFmt==""||iparm.bURL==""){return false;}}
SNI.Food.DynAds.gen_interstitial();return true;},gen_interstitial:function(){hRet="";with(SNI.Food.DynAds){hRet+='<div class="interwrap">';hRet+='<a href="#" class="close"><span></span>Go To Photo</a>';hRet+='<h6>Advertisement</h6>';if(iparm.iFmt.toLowerCase()=="swf"){hRet+='<div id="interad"></div>';}else{if(iHREF!=""){hRet+='<a href="'+iparm.iHREF+'">';}
hRet+='<img src ="'+iparm.iURL+'" />';if(iHREF!=""){hRet+='</a>';}}
hRet+='<iframe class="tracker" width="0" height="0" frameborder="0"></iframe>';hRet+='</div>';$myImgCont=$("#pgallery3 #img-"+ITMCUR);if($myImgCont.hasClass("vert-enl")){$myImgCont.removeClass("vert-enl").addClass("vert-shr");}
$("#pgallery3 .photowrap").append(hRet);$("#pgallery3 .interwrap .close").click(function(){$("#pgallery3 .interwrap").remove();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","",{wmode:"opaque",allowScriptAccess:"always",quality:"high"});}
setDartEnterpriseBanner("BIGBOX",iparm.bURL);$("#pgallery3 .interwrap .tracker").attr("src",iparm.iTrackURL);}
return;}};
if(typeof(SNI)=="undefined"){SNI={};}
if(typeof(SNI.Food)=="undefined"){SNI.Food={};};SNI.Food.LazyImage={load:function(img_element,src){var image_src=src||img_element.attr('data-src');img_element.attr('src',image_src);return img_element;}};SNI.Food.ViewSlider=(function(){function ViewSlider(){this.updateImageList=function(){this.images=this.images.not('[src]');return this.images;},this.monitorScroll=function(){var sliding_window=this;var slider=sliding_window.slider;sliding_window.images=slider.find('img').not('[src]');if(sliding_window.images.length>0){slider.scroll(function(e){sliding_window.images.each(function(i){var $this=jQuery(this);if(($this.offset().left-slider.offset().left)<=slider.width()){SNI.Food.LazyImage.load($this);sliding_window.updateImageList();}});});}},this.calculateBodyWidth=function(slider_body){slider_body=slider_body||sliding_window.slider.children('ul');var total_body_width=0;slider_body.children('li').each(function(i){var $this=$(this);var list_item_width=$this.outerWidth()+parseInt($this.css('margin-left'))+parseInt($this.css('margin-right'));total_body_width=total_body_width+list_item_width;});return total_body_width;},this.init=function(element){var sliding_window=this;var slider=element||jQuery('.view-slider');sliding_window.slider=slider;slider.addClass("view-slider-setup")
sliding_window.images=slider.find('img').not('[src]');var slider_body=slider.children('ul');var slider_body_width=sliding_window.calculateBodyWidth(slider_body);if(slider_body.width()!==slider_body_width){slider_body.width(slider_body_width+200);}
sliding_window.images.each(function(i){var $this=jQuery(this);if($this.position().left<=sliding_window.slider.width()){SNI.Food.LazyImage.load($this);}});sliding_window.updateImageList();sliding_window.monitorScroll();}}
return{init:function(element){var view_slider=new ViewSlider();view_slider.init(element);return view_slider;}};})();;(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.Food.pGrid=="undefined"){SNI.Food.pGrid={};}
SNI.Food.pGrid.init=function(panel,pagi){var panel=panel||'.p-grid-wrap';var pagi=pagi||'.pagi a';$(pagi).click(function(cur){var clicked="#"+$(cur.target).attr('rel');$(pagi).removeClass('current');$(this).addClass('current');$(panel).scrollTo(clicked,350,{});return false;});}
$.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");
$(document).ready(function()
{});(function($){$.fn.initFlyoutPanel=function(options){var defaults={numOriginal:3,hiddenListClassName:'',panelHeight:0,panelWrapClassName:'',panelBtnCloseClassName:'',panelTitleClassName:'',panelContentClassName:''};var options=$.extend(defaults,options);var showOnly=options.numOriginal;return this.each(function(i){var lists=this.getElementsByTagName('ul');var titles=this.getElementsByTagName("h5");var makeMoreButton=function(number,text){var newSpan=document.createElement("span");newSpan.innerHTML='<a href="javascript: void(0);">More '+text+'</a> ('+number+')';return newSpan;}
var moreBtnTextFromGroupTitle=function(titleElement){return titleElement.innerHTML.replace(/:/g,'');}
for(var i=0;i<lists.length;i++){var qty=lists[i].getElementsByTagName('li').length;if(qty>showOnly){var extra=qty-showOnly;for(var k=showOnly;k<qty;k++){$(lists[i].getElementsByTagName('li')[k]).addClass(options.hiddenListClassName);}
var col1Qty=Math.ceil(qty/2);var col2Qty=qty-col1Qty;var newList=new Array();var newUL=lists[i].cloneNode(false);for(var m=0;m<qty;m++){newList[$(lists[i].getElementsByTagName("li")[m]).text()]=lists[i].getElementsByTagName("li")[m].innerHTML;if(m==col1Qty){$(lists[i].getElementsByTagName('li')[m]).addClass('col-start');}
if(m<col1Qty){$(lists[i].getElementsByTagName('li')[m]).addClass('col-1');}else{$(lists[i].getElementsByTagName('li')[m]).addClass('col-2');}}
newList=$.sniUtil.sortAssocArray(newList).sort();for(var m=0;m<newList.length;m++){var newLIContainer=lists[i].getElementsByTagName('li')[m].cloneNode(false);newLIContainer.innerHTML=newList[m];newUL.appendChild(newLIContainer);}
var lih=$(lists[i].getElementsByTagName('li')[0]).height();var lipt=parseInt($(lists[i].getElementsByTagName('li')[0]).css('padding-top'));var lipb=parseInt($(lists[i].getElementsByTagName('li')[0]).css('padding-bottom'));var limt=parseInt($(lists[i].getElementsByTagName('li')[0]).css('margin-top'));var limb=parseInt($(lists[i].getElementsByTagName('li')[0]).css('margin-bottom'));var lith=lih+lipt+lipb+limt+limb;var moreButton=makeMoreButton(qty,moreBtnTextFromGroupTitle(titles[i]));this.insertBefore(moreButton,lists[i].nextSibling);var lHeight=18;btnMore=moreButton.getElementsByTagName('a')[0];btnMore.contentObj=newUL;btnMore.offset=$(moreButton).offset();btnMore.qty=qty;btnMore.lh=lHeight;btnMore.lith=lith;btnMore.optionsHeight=options.panelHeight;btnMore.panelWrapClassName=options.panelWrapClassName;btnMore.panelBtnCloseClassName=options.panelBtnCloseClassName;btnMore.panelTitleClassName=options.panelTitleClassName;btnMore.panelContentClassName=options.panelContentClassName;btnMore.onclick=function(){var pHeight=(Math.ceil(this.qty)*this.lh);var pAllowScale=false;if(this.qty>7){pAllowScale=true;}
$(this).flyoutPanel({title:this.innerHTML,contentObj:this.contentObj,x:(this.offsetLeft+this.offsetWidth+30),y:(this.offsetTop-4),w:333,h:this.optionsHeight,numLI:this.qty,maxLI:7,liTotalHeight:this.lith,allowScroll:pAllowScale,wrapClassName:this.panelWrapClassName,btnCloseClasnName:this.panelBtnCloseClassName,titleClassName:this.panelTitleClassName,contentClassName:this.panelContentClassName});return false;}}}});};})(jQuery);(function($){$.fn.flyoutPanel=function(options){var defaults={title:'',contentStr:'',contentObj:null,h:0,x:0,y:0,allowScroll:false,targetId:'',wrapClassName:'',btnCloseClassName:'dpl-panel-close',titleClassName:'',contentClassName:'',numLI:0,maxLI:0,liTotalHeight:0};var options=$.extend(defaults,options);return this.each(function(i){try{if(options.targetId==''){document.body.removeChild($.sniFlyoutContainer);}else{document.getElementById(options.targetId).removeChild($.sniFlyoutContainer);}}catch(e){}
var pWrap=document.createElement('div');$.sniFlyoutContainer=pWrap;pWrap.className='panelWrap';pWrap.style.left=options.x+'px';pWrap.style.zIndex=$.sniUtil.getHighestZIndex()+1;var outputContainer=pWrap.appendChild(document.createElement('div'));outputContainer.className=options.wrapClassName;var title=outputContainer.appendChild(document.createElement('div'));title.className=options.titleClassName;title.innerHTML=options.title;var btnClose=outputContainer.appendChild(document.createElement('a'));btnClose.title='close';btnClose.href='javascript: void(0);';btnClose.className=options.btnCloseClassName;btnClose.onclick=function(){document.body.removeChild($.sniFlyoutContainer);return false;}
var footer=pWrap.appendChild(document.createElement('div'));footer.className='panel-footer';var contentArea=footer.appendChild(document.createElement('div'));contentArea.className=options.contentClassName;if(options.numLI>options.maxLI){contentArea.style.height=options.h+'px';}else{}
if(options.allowScroll){contentArea.style.overflowY='auto';contentArea.style.overflowX='hidden';}else{contentArea.style.overflow='hidden';}
if(options.contentObj!=null){contentArea.appendChild(options.contentObj);}else{contentArea.innerHTML=options.contentStr;}
if(options.targetId==''){document.body.appendChild(pWrap);}else{document.getElementById(options.targetId).appendChild(pWrap);}
var viewportHeight=$(window).height();var scrollTop=$.sniUtil.getScrollXY()[1];var viewportBottomY=scrollTop+viewportHeight;var containerMaxTopY=(viewportBottomY-(pWrap.offsetHeight+10));if(options.y>containerMaxTopY&&options.h<=viewportHeight){pWrap.style.top=containerMaxTopY+'px';}else{pWrap.style.top=options.y+'px';}
if(options.allowScroll){contentArea.style.width=(contentArea.offsetWidth-10)+'px';var theUL=pWrap.getElementsByTagName('ul')[0];if(theUL)theUL.style.paddingRight='0px';}});};})(jQuery);function hgliteInitFlyout(){$('#hgFilters').initFlyoutPanel({numOriginal:3,hiddenListClassName:'extra',panelHeight:165,panelWrapClassName:'dpl-panel-popup-container2',panelBtnCloseClassName:'dpl-panel-close',panelTitleClassName:'dpl-panel-title',panelContentClassName:'dpl-panel-content-area'});}
function js_test(){alert('hello');}

if(typeof(SNI.Food.Omniture)=='undefined'){SNI.Food.Omniture={};}
SNI.Food.Omniture.timeout=null;SNI.Food.Omniture.queue=[];SNI.Food.Omniture.ClickTrack=function(jsel,module,searchKey){var $el=$(jsel);if($el.length==0||$el.data('events.click.omniture')){return;}
$el.bind('click.omniture',function(e){SNI.Food.Omniture.ClickTrackFire(e.target,module,searchKey);e.stopPropagation();});};SNI.Food.Omniture.ClickTrackSingle=function(jsel,module,section){var $el=$(jsel);if($el.length==0||$el.data('events.click.omniture')){return;}
$el.bind('click.omniture',function(e){SNI.Food.Omniture.ClickTrackFireSingle(e.target,module,section);e.stopPropagation();});};SNI.Food.Omniture.ClickTrackFire=function(el,module,searchKey,jsonOptions){var element=$(el);var isLink=element.is("a");var site;if(isLink){var formId=element.parents().filter('form').attr("id");if(formId=='foodSearchForm'){return;}}
var parentElement=element.parent();var isParentLink=parentElement.is("a");var isSubmit=element.attr("type")=="submit";if(isLink||isParentLink||isSubmit){if(isSubmit){site="FOOD: "+$clicked.parents().filter('form').attr("name")+" ";}else{site="FOOD: "+module+" ";}
var hasCustomLink=false;var hasEvents=false;if(jsonOptions!=null&&typeof(jsonOptions)=="object"){if(typeof(jsonOptions.customLinkText)=='string'){hasCustomLink=true;}
if(typeof(jsonOptions.events)=='string'){hasEvents=true;}}
var s={};s.linkTrackVars='prop14,eVar16,prop15,eVar18,prop16,eVar17,prop17,eVar19,prop18,prop19,eVar20,prop20';if(hasEvents){s.events=jsonOptions.events;s.linkTrackVars+=',events';s.linkTrackEvents=jsonOptions.events;}
s.prop14=site;s.eVar16=s.prop14;var linkText;var thumbnail=false;if(hasCustomLink){linkText=jsonOptions.customLinkText;}
else{linkText=element.html();if(linkText==''&&element.is("img")){linkText='Photo : '+element.attr("alt");thumbnail=true;}}
s.prop15=site+linkText;s.eVar18=s.prop15;var relid="relid?";var linkUrl=element.attr("href");if(isLink){relid=element.attr("rel");}else if(isParentLink){relid=parentElement.attr("rel");linkUrl=parentElement.attr("href");}
s.prop16=site+relid;s.eVar17=s.prop16;s.prop17=site+linkUrl;s.eVar19=s.prop17;s.prop18=site+mdManager.getParameter("Url");if(typeof(searchKey)!=='undefined'){s.prop19="endeca: "+mdManager.getParameter(searchKey+"_name"," ");s.eVar20=s.prop19;s.prop20="endeca: "+mdManager.getParameter(searchKey+"_style"," ");}
s.element=el;SNI.Food.Omniture.ClickTrackTrigger(s);}};SNI.Food.Omniture.ClickTrackFireSingle=function(el,module,section,jsonOptions){var element=$(el);var isLink=element.is("a");var parentElement=element.parent();var isParentLink=parentElement.is("a");var isSubmit=element.attr("type")=="submit";if(isLink||isParentLink||isSubmit){var hasCustomLink=false;var hasEvents=false;if(jsonOptions!=null&&typeof(jsonOptions)=="object"){if(typeof(jsonOptions.customLinkText)=='string'){hasCustomLink=true;}
if(typeof(jsonOptions.events)=='string'){hasEvents=true;}}
var linkText;var thumbnail=false;if(hasCustomLink){linkText=jsonOptions.customLinkText;}
else{linkText=element.html();if(linkText==''&&element.is("img")){linkText='Photo : '+element.attr("alt");thumbnail=true;}}
var s={};if(hasEvents){s.events=jsonOptions.events;}
s.linkTrackVars='prop26';if(hasEvents){s.events=jsonOptions.events;s.linkTrackVars+=',events';s.linkTrackEvents=jsonOptions.events;}
s.prop26=section+": "+module+": "+linkText;s.element=el;SNI.Food.Omniture.ClickTrackTrigger(s);}};SNI.Food.Omniture.ClickTrackTrigger=function(data){if(typeof data=='object'){SNI.Food.Omniture.queue.push(data);}
if(typeof s_gi=='function'){if(SNI.Food.Omniture.timeout!==null){clearTimeout(SNI.Food.Omniture.timeout);SNI.Food.Omniture.timeout=null;}}else{SNI.Food.Omniture.timeout=setTimeout(function(){clearTimeout(SNI.Food.Omniture.timeout);SNI.Food.Omniture.timeout=null;SNI.Food.Omniture.ClickTrackTrigger();},1000);return false;}
while(SNI.Food.Omniture.queue.length>0){var d=SNI.Food.Omniture.queue.pop();var s=s_gi(s_account);$.each(d,function(key,value){if(key!='element'){s[key]=value;}});s.tl(d.element,'o','Link Name');}};
if(typeof(SNI.Food.Sponsors)=="undefined"){SNI.Food.Sponsors={};}
SNI.Food.Sponsors={printHPSponsor:function(){var toolbar="#toolbar";var navTimer=null;var trackerVar=true;var msg='';msg+='<div id="print-popup">';msg+=' <div class="print-hd"> </div>';msg+=' <div class="print-bd">';msg+=' <span class="close" style="cursor: pointer;">Close</span>'
msg+='   <p class="top-lbl">Advertisement</p>';msg+='  <div class="msg">';msg+='   <p>Print 50% more pages than with refilled inks. Trust Original HP Inks.</p>';msg+='   <p><a href="#">Hit Print Reliably.</a></p>';msg+='   <p class="form-submit"><button id="supp-print-btn" class="button"><span>Print Page</span></button></p>';msg+='  </div>';msg+=' </div>';msg+=' <div class="print-ft"></div>';msg+='</div>';$(toolbar).find(".print a").after(msg);$(toolbar).find(".print a").add("#print-popup").hover(function(e){clearTimeout(navTimer);navTimer=null;$("#print-popup").fadeIn("fast",tracker);$("#print-popup").find('.close').click(function(){closeIt();return false;}).css({cursor:"pointer"});$("body").bind("click",handleClick);},function(e){navTimer=setTimeout(function(){closeIt();},3000);});function tracker(){if(tracker){$("#print-popup .msg").append('<img src="http://ad.doubleclick.net/ad/N5823.FoodNetwrk/B4259045;sz=1x1;ord=[timestamp]?" width="1" height="1" alt="Click Here" >');tracker=false;}
return;}
function handleClick(e){var $clicked=$(e.target);if($clicked.parents().is('#print-popup')){if($clicked.attr("id")==="supp-print-btn")
{window.open($("#toolbar li.print > a").attr("href"));}
else
{window.open("http://ad.doubleclick.net/clk;222683025;46416118;a");}
return false;}
else
{closeIt();return true;}}
function closeIt(){clearTimeout(navTimer);navTimer=null;$("#print-popup").fadeOut("fast");$("body").unbind("click",handleClick);return;}},NexiumSponsorISI:function(){var msg='';msg+='<div id="splogo-popup">';msg+=' <div class="splogo-pop-hd"></div>';msg+=' <div class="splogo-pop-bd">';msg+=' <h5>NEXIUM<sup>&reg;</sup><span class="close">Close</span></h5>'
msg+='  <div class="msg">';msg+='   <p class="subhd">Important Information about NEXIUM</p>';msg+='   <p>NEXIUM is prescribed to treat the symptoms of acid reflux disease, which typically include persistent heartburn on 2 or more days per week, despite treatment and change of diet.</p>';msg+='   <p>For many people, NEXIUM is also prescribed to heal damage to the esophagus called erosive esophagitis. This damage may be caused over time from stomach acid wearing away the lining of the esophagus. Only a doctor can diagnose this condition. With NEXIUM, most erosions heal in 4 to 8 weeks. Your results with NEXIUM may vary.</p>';msg+='   <p class="side-effects">Side effects with NEXIUM include headache, diarrhea, and abdominal pain.</p>';msg+='   <p>Symptom relief does not rule out the presence of other serious stomach conditions.</p>';msg+='   <p>Please read the <a href="http://adsremote.scrippsnetworks.com/event.ng/Type=click&FlightID=&AdID=&TargetID=&Values=2026000&Redirect=http:%2f%2fwww1.astrazeneca-us.com%2fpi%2fnexium.pdf" target="_blank">Important Product Information</a> and discuss it with your doctor or health care professional.</p>';msg+='  </div>';msg+=' </div>';msg+=' <div class="splogo-pop-ft"></div>';msg+='</div>';$("#popup-logo a").after(msg);$("#popup-logo a").bind("mouseenter",function(){$("#splogo-popup").fadeIn("fast");$("#splogo-popup").find('.close').click(function(){$("#splogo-popup").fadeOut("fast");return false;});});}};

if(typeof(SNI.Food.Menus)=="undefined"){SNI.Food.Menus={};}
SNI.Food.Menus.forminit=function(){$(".menusumm .printdlg a").click(function(){$(".itemsel input:checkbox").attr("checked","checked");$(".itemsel a.submit").parent().removeClass("dis");$(".menusumm").addClass("printdlgact");return false;});$(".itemsel input:checkbox").click(function(){if($(".itemsel input:checked").length==0)
{$(".itemsel a.submit").parent().addClass("dis");}
else if($(".itemsel a.submit").parent().hasClass("dis"))
{$(".itemsel a.submit").parent().removeClass("dis");}});$(".itemsel .action a.submit").click(function(e){if($(this).parent().hasClass("dis"))
{return false;}
myUrl=this.href.toString();bitmask=0;$(".itemsel input:checked").each(function(){idx=this.name.substr(1);bitmask+=Math.pow(2,idx);});this.href=myUrl.replace(/MENU-DETAIL.*?,/,"MENU-DETAIL_"+bitmask+",");$(".menusumm").removeClass("printdlgact");return true;});$(".itemsel .action .cancel a, .itemsel .formhd a.close").click(function(e){$(".menusumm").removeClass("printdlgact");return false;});};
if(typeof(SNI.Food.PrintPages)=="undefined"){SNI.Food.PrintPages={};}
SNI.Food.PrintPages.init=function(){$("#print-button").click(function(){window.print();});return;};SNI.Food.PrintPages.footer=function(){now=new Date();outstr='<p>Printed from FoodNetwork.com on '+now.toDateString()+'</p>';outstr+='<p class="copyright">&#169; '+now.getFullYear()+' Television Food Network, G.P. All Rights Reserved</p>';document.write(outstr);return;}

if(typeof(SNI.Food.CouponsInc)=='undefined'){SNI.Food.CouponsInc={};}
SNI.Food.CouponsInc.initCoupons=function(){return;};
if(typeof(SNI.Food.DYM)=="undefined"){SNI.Food.DYM={};}
SNI.Food.DYM={init:function(){$('.message .dym .close').click(function(){$('.message .dym').fadeOut('slow');SNI.Util.Cookie.set(SNI.Food.DYM.DYM_Cookie,"yes");$('.message .dym .close').hide();});var dym_hide=SNI.Util.Cookie.get(SNI.Food.DYM.DYM_Cookie);if(dym_hide=="yes"){$('.message .dym').hide();};}};
SNI.Food.Search={sortBy:function(){var select=$('.search-control #sortby');select.dropdown();select.change(function(){SNI.Util.Cookie.persist(SNI.Util.Cookie.SEARCH,'sortOrder',select.val());this.form.submit();});},closeDYMNotice:function(){$('.message .dym .close').click(function(){$('.message .dym').fadeOut('slow');SNI.Util.Cookie.session(SNI.Util.Cookie.SEARCH,'hideDym','true');$('.message .dym .close').hide();return false;});},hideDYMNotice:function(){SNI.Util.Cookie.session(SNI.Util.Cookie.SEARCH,'hideDym',null);}};
SNI.Food.NewsletterWidget=(function(){var newslForm,rootElement,emailInput,type;var attachNewsletterBehavior=function(){var updateLeadMessage=function(msg){var lead_msg_element=rootElement.find(".lead_message");lead_msg_element.addClass("error");lead_msg_element.html(msg);};var messages_config={newsl_service_down:"Service in maintenance. Please try again  later.",newsl_agreement:"Whoops. Please agree to Food Network's privacy policy and terms of use.",newsl_your_email:{required:"Whoops. Please check the format of your e-mail address and re-enter (i.e. joe@foodnetwork.com)",email:"Whoops. Please check the format of your e-mail address and re-enter (i.e. joe@foodnetwork.com)"}};rootElement.find(".email .button").click(function(evt){var validator=newslForm.validate({rules:{newsl_agreement:{required:true},newsl_your_email:{required:true,email:true}},messages:messages_config,showErrors:function(errorMap,errorList){newslForm.find(".email label").removeClass("error");newslForm.find(".agreement label").removeClass("error");rootElement.find(".lead_message").removeClass("error");if(errorList.length){var error,errorFound;for(var i=0,L=errorList.length;i<L;i++){error=errorList[i];if("newsl_your_email"==error.element.id){newslForm.find(".email label").addClass("error");errorFound=true;}
else if("newsl_agreement"==error.element.id){newslForm.find(".agreement label").addClass("error");errorFound=true;}
if(errorFound){updateLeadMessage(error.message);break;}}}}});var validForm=validator.form();if(validForm){var startTime=new Date().getTime();var minimalSignupDuration=1500;rootElement.find("#newsl_form_wrapper").hide();rootElement.find("#newsl_signup_wrapper").show();$.ajax({async:true,url:"/api/newsletter/add",data:"email="+encodeURI(emailInput.attr("value"))+"&privacy=1&list[]="+type,type:"GET",cache:false,dataType:"json",success:function(payload){var subscriptionDone=false;if(payload&&payload.success){subscriptionDone=payload.success;}
if(!subscriptionDone){updateLeadMessage(messages_config.newsl_service_down);rootElement.find("#newsl_signup_wrapper").hide();rootElement.find("#newsl_form_wrapper").show();}else{var remainingDuration=0,duration=(new Date().getTime()-startTime)
if(duration<minimalSignupDuration){remainingDuration=minimalSignupDuration-duration;}
setTimeout(function(){rootElement.find("#newsl_signup_wrapper").hide();rootElement.find("#newsl_thanks_wrapper").show();},remainingDuration);SNI.Food.Omniture.ClickTrackFireSingle(rootElement.find(".email .button"),"Subscribe","Newsletter",{customLinkText:$.trim($("#newsl-pod .bd .hd h4").html()),events:"event37"});}}});}
return false;});};return{init:function(jqueryRootElem){rootElement=jqueryRootElem;emailInput=rootElement.find(".email input");newslForm=jQuery("#newsl_form");type=newslForm.attr("data-newsletter-type");SNI.Util.inputField(emailInput,"Your email here");emailInput.keypress(function(evt){emailInput.addClass("focused");emailInput.unbind("keypress");});attachNewsletterBehavior();}};})();
SNI.Food.ActiveScroll=(function(){var rootElement;var featuredItems;var itemList;var currentActiveElement;var initActiveScrollBehavior=function(){var activeItem=_getInitialActiveItem();currentActiveElement=activeItem;activeItem.addClass("active");rootElement.scrollTo(activeItem,350,{offset:-153});itemList.parent().click(_onItemPodClick);}
var _getInitialActiveItem=function(){var activeItem;if((typeof(featuredItems)=="object")&&(featuredItems.length>0)){activeItem=$(featuredItems[Math.floor(Math.random()*(featuredItems.length))]);}
else{activeItem=itemList.eq(0);}
return activeItem;}
var _onItemPodClick=function(evt){var allowDefaultBehavior=true;var clicked=$(evt.target);if(!clicked.hasClass("item")){clicked=clicked.parents(".item").eq(0);}
if(!clicked.hasClass("active")){var activeItem=rootElement.find(".active");activeItem.removeClass('active');clicked.addClass('active');rootElement.scrollTo(clicked,{duration:150,offset:-153});allowDefaultBehavior=false;}
return allowDefaultBehavior;}
return{init:function(jqueryRootElement,jsonConf){rootElement=jqueryRootElement;itemList=rootElement.find('.item');featuredItems=rootElement.find(".featured");SNI.Food.ViewSlider.init(rootElement);initActiveScrollBehavior(jsonConf);}};})();

SNI.Food.DynamicAds={descr:{active:true,refreshRate:4,interstitial:false},iparm:{iURL:"",iFmt:"",iHREF:"",iHeight:"",iWidth:"",iTrackURL:"",bURL:""},impressionCt:1,init:function(descriptor,param_styles,gen_inter_func){descriptor=descriptor||"PHOTO_DESCRIPTOR";param_styles=param_styles||'photoGallery';SNI.Food.DynamicAds.gen_interstitial=gen_inter_func||SNI.Food.DynamicAds.gen_interstitial;myJSON=getDartEnterpriseUrl(descriptor,1);myJSON+="&params.styles="+param_styles+"&callback=?";$.getJSON(myJSON,SNI.Food.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.Food.DynamicAds.descr.active=true;SNI.Food.DynamicAds.descr.refreshRate=tmp;if(oJSON.interstitial==undefined){return false;}
if(oJSON.interstitial=="true"){SNI.Food.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.Food.DynamicAds.cback_interJSON);return true;}else{setDartEnterpriseBanner("BIGBOX",getDartEnterpriseUrl("BIGBOX",5));}}
return;},cback_interJSON:function(oJSON){$.each(SNI.Food.DynamicAds.iparm,function(key,val){SNI.Food.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.Food.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.Food.DynamicAds){if(iparm.iURL==""||iparm.iFmt==""||iparm.bURL==""){return false;}}
SNI.Food.DynamicAds.gen_interstitial();return true;},gen_interstitial:function(){var hRet="";with(SNI.Food.DynamicAds){hRet+='<div class="interwrap">';hRet+='<a href="#" class="close"><span></span>Continue to Next Room</a>';hRet+='<h6>Advertisement</h6>';if(iparm.iFmt.toLowerCase()=="swf"){hRet+='<div id="interad"></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>';$("#room-viewer").append(hRet);$("#room-viewer .interwrap .close").click(function(){SNI.Food.DesignPortfolio.RoomBrowser.goNextRoom();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","",{wmode:"opaque",allowScriptAccess:"always",quality:"high"});}
setDartEnterpriseBanner("BIGBOX",iparm.bURL);$("#room-viewer .interwrap .tracker").attr("src",iparm.iTrackURL);}
return;}};
(function($){if(typeof(SNI.Food.ArticleInfo)=="undefined"){SNI.Food.ArticleInfo={};}
SNI.Food.ArticleInfo={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");});}}})(jQuery);
(function($){var DEFAULT_CONFIG={current_index:0,thumbnail_loader:"../imgs/hg-loader.gif",default_product_image_sm:"../imgs/product_unavailable_sm.jpg",default_product_image_lg:"../imgs/product_unavailable_al.jpg",images:null,interstitial_refresh_rate:5000};var PhotoGallery=function(element,config){for(var prop in DEFAULT_CONFIG){if(!config.hasOwnProperty(prop)){config[prop]=DEFAULT_CONFIG[prop];}}
config.images=config.images||imageData;var gallery=this,gallery_element,count_label,photo_display,thumbnails_button,thumbnails_frame,next_button,previous_button,ad_unit,photo_description,photo_author,caption_head,caption,toggler,endframe_info,template_element,hsproduct_wrapper,display_wrapper,ymal,ymal_desc,ymal_list,_load_once,current_index,loader_img=new Image(),default_product_img_sm=new Image(),default_product_img_lg=new Image(),inter_wrap,inter_next=false,print_link,inter_refreshed=true;loader_img.src=config.thumbnail_loader;function doDynOmni(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;}
function createImageWrapper(current_data){var clone=template_element.clone(),clone_image=clone.find("a img"),new_image=new Image(),toggler=clone.children(".pg-toggler");clone.attr("id","pg-photo-"+current_data.iid);clone.find("a.photo").attr("href",current_data.pgUrl).click(function(e){if(current_data.bhs!=-1){gallery.nextPhoto(e);}
return false;});clone.children(".pg-hotspots").remove();clone_image.attr("alt",current_data.ialt);jQuery(new_image).load(function(response,status,xhr){clone.appendTo(photo_display);current_data.image_wrapper=clone;clone_image.attr("src",new_image.src);clone_image.attr("style","");clone.attr("style","");if(current_data.bvert){setupToggler(toggler,current_index);toggler.show();}
else{toggler.hide();clone.removeClass("pg-fitted");}
applyHotspots(current_data);gallery_element.removeClass("pg-loading");clone.hide();clone.fadeIn("fast");}).error(function(){gallery_element.removeClass("pg-loading");gallery_element.addClass("pg-errored");});new_image.src=current_data.iurl;}
function setupToggler(toggler,index){var enlarge=toggler.find(".pg-enlarge");var shrink=toggler.find(".pg-shrink");var current_data=config.images[index];current_data.image_wrapper.addClass("pg-fitted");current_data.toggler=toggler;current_data.toggler.enlarge=enlarge;current_data.toggler.shrink=shrink;enlarge.click(function(){current_data.image_wrapper.animate({width:"602px"},200);current_data.image_wrapper.find("a.photo img").animate({width:"602px"},200);enlarge.hide();shrink.show();});enlarge.children(".pg-toggler-button").hover(function(){enlarge.children(".pg-toggler-label").show();},function(){enlarge.children(".pg-toggler-label").hide();});enlarge.children(".pg-toggler-label").hover(function(){enlarge.children(".pg-toggler-label").show();},function(){enlarge.children(".pg-toggler-label").hide();});shrink.click(function(){current_data.image_wrapper.animate({width:"339px"},250);current_data.image_wrapper.find("a.photo img").animate({width:"339px"},250);shrink.hide();enlarge.show();});shrink.children(".pg-toggler-button").hover(function(){shrink.children(".pg-toggler-label").show();},function(){shrink.children(".pg-toggler-label").hide();});shrink.children(".pg-toggler-label").hover(function(){shrink.children(".pg-toggler-label").show();},function(){shrink.children(".pg-toggler-label").hide();});}
function loadPhotoInfo(index){var current_data=config.images[index];var caption_length=207;var cap_start,cap_end='';var next_index=(index+1)%config.images.length;doDynOmni(index);SNI.Util.hitCount();next_button.attr("href",config.images[next_index].pgUrl);if(print_link.length>0){var i=index+1;var plink=print_link.attr("href");if(i<10){i='0'+parseInt(index+1,10);}
plink=plink.replace(/(.*ARTICLE-PRINT-PHOTO-GALLERY-CURRENT).*?(,00.html)$/,"$1_"+i+"$2");print_link.attr("href",plink);}
gallery_element.addClass("pg-loading");count_label.html(index+1);if(current_data.iid!="endframe"){$(display_wrapper).css('background-color','#FFFFFF');photo_description.show();endframe_info.hide();if(current_data.ititle.length>41){caption_length=157;}
cap_start=current_data.icap.substring(0,caption_length);var link_open=/<a/ig;var link_close=/(.)*?<\/a>/i;var icap_div=$('<div />');icap_div.html(current_data.icap).find("a").each(function(){$(this).replaceWith($(this).text());});var new_icap_length=icap_div.html().length;if(caption_length<=new_icap_length){var caption_remainder=current_data.icap.substring(caption_length,current_data.icap.length);var caption_array=caption_remainder.match(link_close);if(caption_array!=null){cap_end='<span class="pg-cap-elipse">&#8230; <span class="pg-show-caption">more</span></span><span class="pg-full-caption">'
+current_data.icap.substring(caption_length,current_data.icap.length)
+'</span>';if(caption_remainder.match(link_open)==null){cap_end=cap_end.replace(caption_array[0],'');cap_start+=caption_array[0];cap_end='<span class="pg-cap-elipse">&#8230; <span class="pg-show-caption">more</span></span><span class="pg-full-caption">'
+cap_end
+'</span>';}}
else{cap_end='<span class="pg-cap-elipse">&#8230; <span class="pg-show-caption">more</span></span><span class="pg-full-caption">'
+current_data.icap.substring(caption_length,current_data.icap.length)
+'</span>';}
photo_description.addClass("pg-short-caption");}else{photo_description.removeClass("pg-short-caption");}
var rendered_content=cap_start+cap_end;caption_head.html(current_data.ititle);caption.html(rendered_content);caption.find(".pg-show-caption").click(function(){caption.find(".pg-cap-elipse").hide();caption.hide();caption.find(".pg-full-caption").css({display:"inline"});caption.slideDown("slow",function(){photo_description.removeClass("pg-short-caption");caption.html(current_data.icap);});return false;});if(current_data.ititle||current_data.icap||current_data.rtitle&&current_data.rtxt!=""){ymal.show();ymal_desc.html(current_data.rtxt);ymal_list.html('<li><a href="'+current_data.rurl+'">'+current_data.rtitle+'</a></li>');$('.pg-photo-info').show();}
else{ymal.hide();$('.pg-photo-info').hide();}
if(current_data.creator){photo_author.children(".pg-author-name").html(current_data.creator);photo_author.show();}
else{photo_author.hide();}}else{photo_description.hide();photo_author.hide();endframe_info.show();ymal.hide();$(display_wrapper).css('background-color','#FFFFFF');}
$(thumbnails_frame.find(".pg-thumbnails li")[index]).addClass("pg-selected-thumbnail");if(!current_data.image_wrapper){createImageWrapper(current_data);}else{gallery_element.removeClass("pg-loading");current_data.image_wrapper.fadeIn("fast");}}
function applyHotspots(current_data){if(SNI.Food.Hotspots){$(SNI.Food.Hotspots.images).each(function(){var hotspotImage=this;if(hotspotImage.id==current_data.iid&&!current_data.hotspotSet){current_data.hotspotSet=true;var hotspots_container=$('<div class="pg-hotspots"></div>').appendTo(current_data.image_wrapper);var hotspots_products,hotspot_items_info;var list_html=[],product_info_html=[],panel_html=[];list_html.push('<h3>Products From This Photo:</h3><ul class="pg-hotspot-list">');product_info_html.push('<ul class="pg-hsproducts">');panel_html.push('<div class="pg-hotspot-panel clrfix"><div class="l"><div class="pg-close-hspanel pg-close"><img src="'+current_data.itnurl+'" /><span><a href="javascript: void(0);">Back to this Photo</a></span></div>');var showProducts=function(e){SNI.Food.Omniture.HotSpotClick(e.data.hotspot,"c");current_data.image_wrapper.fadeOut("fast",function(){hotspots_products.find("ul.pg-hotspot-list li.selected").removeClass("selected");hotspot_items_info.hide();$(hotspots_products.find("ul.pg-hotspot-list li")[e.data.index]).addClass("selected");$(hotspot_items_info[e.data.index]).show();current_data.image_wrapper.product_panel.fadeIn("fast",function(){current_data.image_wrapper.addClass("pg-hide-hotspots");});hsproduct_wrapper.fadeIn("fast");});};var hoverIn=function(){$(this).children().fadeIn("fast");};var hoverOut=function(){$(this).children().fadeOut("fast");};var product_image_url,product_description;$(hotspotImage.hotspots).each(function(index){var hotspot=this;product_image_url=hotspot.imageURL;product_description=hotspot.description;if(product_description.length>180){product_description=product_description.substring(0,180)+'... <a class="hotspot_readmore_'+index+'" href="'+hotspot.url+'">Read More</a>';}
if(hotspot.imageURL==="null"||hotspot.imageURL==""||hotspot.imageURL==null){product_image_url=default_product_img_lg.src;}
list_html.push('<li>'+hotspot.name+'</li>');product_info_html.push('<li class="clrfix">'
+'<h4><a class="hotspot_readmore_'+index+'" href="'+hotspot.url+'" target="_blank">'+hotspot.name+'</a></h4>'
+' <div class="pg-hsproduct-img"><a class="hotspot_readmore_'+index+'" href="'+hotspot.url+'" target="_blank"><img src="'+product_image_url+'" alt="'+hotspot.name+'" /></a></div>'
+' <p>'+product_description+'</p>'
+' <a class="pg-hsproduct-moreinfo hotspot_readmore_'+index+'" href="'+hotspot.url+'" target="_blank">'
+' <span>More info</span></a>'
+'</li>');var hotspotCSS={left:hotspot.hotspotXPercent+"%",top:hotspot.hotspotYPercent+"%"};var hotspot_element=$('<div class="pg-hotspot"><span class="pg-hotspot-name">'+hotspot.name+'</span></div>').appendTo(hotspots_container);hotspot_element.css(hotspotCSS);hotspot_element.bind("click",{hotspot:hotspot,index:index},showProducts);hotspot_element.hover(hoverIn,hoverOut);});list_html.push('</ul>');product_info_html.push('</ul>');panel_html.push(list_html.join("\n"));panel_html.push('</div><div class="r">');panel_html.push(product_info_html.join("\n"));panel_html.push('</div><span class="pg-close-btn pg-close">close</span></div>');hotspots_products=$(panel_html.join("\n")).appendTo(hsproduct_wrapper);current_data.image_wrapper.product_panel=hotspots_products;hotspot_items_info=hotspots_products.find("ul.pg-hsproducts li");$(hotspot_items_info[0]).show();hotspots_products.find("ul.pg-hotspot-list li").each(function(index){$(this).click(function(){SNI.Food.Omniture.HotSpotClick(hotspotImage.hotspots[index],"c");hotspots_products.find("ul.pg-hotspot-list li.selected").removeClass("selected");hotspot_items_info.hide();$(this).addClass("selected");$(hotspot_items_info[index]).show();});});hotspots_products.find(".pg-close").click(function(){hsproduct_wrapper.fadeOut("fast",function(){current_data.image_wrapper.product_panel.hide();current_data.image_wrapper.removeClass("pg-hide-hotspots");current_data.image_wrapper.fadeIn("fast");});});hotspots_products.find("ul.pg-hsproducts li").each(function(index){$(this).find("a.hotspot_readmore_"+index).click(function(e){SNI.Food.Omniture.HotSpotClick(hotspotImage.hotspots[index],"1");e.stopPropagation();return true;});});}});}}
gallery.previousPhoto=function(e){e.preventDefault();if(!previous_button.hasClass("pg-disabled")){if(gallery_element.hasClass("pg-errored")){gallery_element.removeClass("pg-errored");}
inter_next=false;gallery.goToPhoto((current_index-1));}
e.preventDefault();};gallery.nextPhoto=function(e){if(!next_button.hasClass("pg-disabled")){if(gallery_element.hasClass("pg-errored")){gallery_element.removeClass("pg-errored");}
inter_next=true;gallery.goToPhoto(((current_index+1)%config.images.length));}
e.preventDefault();};_load_once=function(){thumbnails_frame.find(".hd span.pg-close-btn").click(function(e){gallery.hideThumbnails(e);});thumbnails_frame.find(".pg-thumbnail").each(function(){var thumb_container=$(this);var thumb=$(thumb_container.children("img"));thumb.attr("src",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");});_load_once=function(){return;};};gallery.showThumbnails=function(e){if(!gallery_element.hasClass("pg-loading")){_load_once();thumbnails_button.addClass("selected");thumbnails_frame.fadeIn("fast");}
e.stopPropagation();};gallery.hideThumbnails=function(e){thumbnails_button.removeClass("selected");thumbnails_frame.fadeOut("fast");e.stopPropagation();};gallery.toggleThumbnails=function(e){if(!gallery_element.hasClass("pg-loading")){_load_once();if(thumbnails_button.hasClass("selected")){thumbnails_button.removeClass("selected");}else{thumbnails_button.addClass("selected");}
thumbnails_frame.animate({opacity:'toggle'});}
e.stopPropagation();};gallery.goToPhoto=function(index,skip_interstitial){if(gallery_element.hasClass("pg-errored")){gallery_element.removeClass("pg-errored");}
if(!gallery_element.hasClass("pg-loading")){gallery_element.addClass("pg-loading");gallery_element.removeClass("interstitial-show");if(inter_refreshed===true&&!skip_interstitial&&SNI.Food.DynamicAds.refresh(inter_wrap)){gallery_element.removeClass("pg-loading");gallery_element.addClass("interstitial-show");inter_refreshed=false;setTimeout(function(){inter_refreshed=true;},config.interstitial_refresh_rate);return;}
hsproduct_wrapper.hide();if(current_index>=0){var previous_data=config.images[current_index];if(previous_data.image_wrapper){previous_data.image_wrapper.css('display','none');if(previous_data.image_wrapper.product_panel){previous_data.image_wrapper.product_panel.hide();previous_data.image_wrapper.removeClass("pg-hide-hotspots");}
thumbnails_frame.find(".pg-thumbnails li.pg-selected-thumbnail").removeClass("pg-selected-thumbnail");previous_button.attr("href",previous_data.pgUrl);}}
current_index=index;if(current_index<=0){current_index=0;previous_button.addClass("pg-disabled");}else if(current_index>0&&previous_button.hasClass("pg-disabled")){previous_button.removeClass("pg-disabled");}
loadPhotoInfo(current_index);}};gallery_element=$(element);photo_display=gallery_element.find(".pg-viewport .pg-photo-display-wrapper");count_label=gallery_element.find(".pg-navigation .pg-photo-count .count");thumbnails_button=gallery_element.find(".pg-navigation a.pg-thumbnails-button");thumbnails_frame=gallery_element.find(".pg-navigation .pg-thumbnails-frame");next_button=gallery_element.find(".pg-navigation .pg-next");previous_button=gallery_element.find(".pg-navigation .pg-previous");display_wrapper=(".pg-photo-display-wrapper");template_element=photo_display.children(".pg-photo-wrapper");photo_description=$(".pg-viewport .pg-photo-description");photo_author=$(".pg-author");caption_head=photo_description.children("h2");caption=photo_description.children("p");endframe_info=$(".pg-viewport .pg-endframe-info");hsproduct_wrapper=$('<div class="pg-photo-hsproduct-wrapper"></div>').appendTo(photo_display);ymal=gallery_element.find(".pg-you-might-like");ymal_desc=$('.pg-you-might-like h4');ymal_list=ymal.find("ul");inter_wrap=$('<div class="interwrap"></div>').appendTo(photo_display);print_link=$("#print-select a.this");current_index=config.current_index;config.images.push({iid:"endframe",image_wrapper:$(photo_display).children(".pg-endframe")});if(!config.images[current_index]){current_index=0;}
template_element.hide();if(config.images[current_index].iid!="endframe"){if(current_index==0){previous_button.addClass("pg-disabled");}
config.images[current_index].image_wrapper=template_element;toggler=template_element.children(".pg-toggler");if(config.images[current_index].bvert==1){setupToggler(toggler,current_index);toggler.show();}else{toggler.hide();template_element.removeClass("pg-fitted");}
config.images[current_index].image_wrapper.find("a.photo").click(function(e){if(config.images[current_index].bhs!=-1){gallery.nextPhoto(e);}
return false;});}
var applyHotspotImg=config.images[current_index];$.ajax({url:config.hotspotURL,dataType:"script",timeout:10000,success:function(data){SNI.Food.buildProductsTab=function(){var endframe_products=[];applyHotspots(applyHotspotImg);var count=0;default_product_img_sm.src=config.default_product_image_sm;default_product_img_lg.src=config.default_product_image_lg;$(config.images).each(function(){var image=this;var product_image_url;var even_class;if(image.bhs!=0){$(SNI.Food.Hotspots.images).each(function(){if(image.iid==this.id){$(this.hotspots).each(function(){count++;even_class="";product_image_url=this.imageURL;if(this.imageURL=="null"||this.imageURL==""||this.imageURL==null){product_image_url=default_product_img_sm.src;}
if((count%2)==0){even_class=" even";}
endframe_products.push('<li class="clrfix hs-product'+even_class+'"><div class="pg-endframe-product-img"><img src="'+product_image_url+'" /></div><p><a href="'+this.url+'">'+this.name+'</a></p></li>');});}});}});if(endframe_products.length>0){var endframe_products_list=$('<ul class="pg-endframe-products clrfix">'+endframe_products.join("\n")+'</ul>').appendTo(".pg-endframe .pg-endframe-content");var $endframe_products=endframe_products_list.find("li.hs-product");$($endframe_products[$endframe_products.length-1]).addClass("last");if(($endframe_products.length%2)==0){$($endframe_products[$endframe_products.length-2]).addClass("last");}else{$('<li class="last"></li>').appendTo(endframe_products_list);}
$(".pg-endframe .tabs .pg-endframe-ymal-btn").click(function(){$(".pg-endframe .tabs .pg-endframe-products-btn").removeClass("selected");$(this).addClass("selected");$(".pg-endframe-content .pg-endframe-products").hide();$(".pg-endframe-content .recommend").fadeIn("fast");});$(".pg-endframe .tabs .pg-endframe-products-btn").click(function(){$(".pg-endframe .tabs .pg-endframe-ymal-btn").removeClass("selected");$(this).addClass("selected");$(".pg-endframe-content .recommend").hide();$(".pg-endframe-content .pg-endframe-products").fadeIn("fast");});$(".pg-endframe-products-btn").show();}};$("head").append('<script type="text/javascript">'+data+' \n SNI.Food.buildProductsTab(); </script>');},complete:function(){loadPhotoInfo(current_index);applyHotspots(config.images[current_index]);}});thumbnails_button.click(gallery.toggleThumbnails);thumbnails_frame.find(".pg-thumbnails li").each(function(index){jQuery(this).click(function(e){gallery.goToPhoto(index,false,true);gallery.hideThumbnails(e);e.stopPropagation();});});thumbnails_frame.click(function(e){e.stopPropagation();});$(document).click(function(e){gallery.hideThumbnails(e);});previous_button.click(gallery.previousPhoto);gallery_element.find(".pg-error button").click(function(e){gallery.goToPhoto(current_index);e.preventDefault();});next_button.click(gallery.nextPhoto);$("#toolbar .font-resize").find("li").click(function(){var defaultSize="100%";$(element).find("li.active").removeClass("active");$(this).addClass("active");if($(this).hasClass("med")){photo_description.css("font-size",defaultSize);}else if($(this).hasClass("sm")){photo_description.css("font-size","85%");}else{photo_description.css("font-size","116%");}});$("#gallery_url").click(function(){this.select();});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+" #FOOD ",url:share_url});facebook_shared_object.attachChicklet("facebook",endframe_info.find(".pg-share .facebook a")[0]);twitter_shared_object.attachChicklet("twitter",endframe_info.find(".pg-share .twitter a")[0]);SNI.Food.DynamicAds.init(null,null,function(){var hRet="";with(SNI.Food.DynamicAds){hRet+='<div class="pg-inter-wrap">';hRet+='<span class="mrec">Advertisement</span>';hRet+='<div class="pg-inter-container">';if(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(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+='<a href="#" class="close"><span></span>Continue to Next Photo</a>';hRet+='</div>';inter_wrap=$(hRet).appendTo(photo_display);$(inter_wrap).find(".close").click(function(e){gallery_element.removeClass("interstitial-show");if(inter_next){gallery.nextPhoto(e);}
else{gallery.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);$(inter_wrap).find(".tracker").attr("src",iparm.iTrackURL);}
return;});return gallery;}
SNI.Food.PhotoGallery4=PhotoGallery;})(jQuery);
SNI.Foodterms={};SNI.Foodterms.searchbox=(function(){var searchBoxRoot;var input;var button;var searchServer;var defaultString="Search Our Food Encyclopedia";function submitSearchForm(keywords){keywords=$.trim(keywords);if(keywords!=null&&(keywords!='')&&(keywords!=defaultString)){var action=searchBoxRoot.attr('action');if((typeof(action)=="string")&&action!=""){trackSearch();searchBoxRoot.submit();}
else{trackSearch();var searchServer=searchBoxRoot.attr('data-search-server-url');searchServer=searchServer+encodeURIComponent(keywords);window.location.href=searchServer;}}}
function trackSearch(){SNI.Food.Omniture.ClickTrackFireSingle($("#hd-search-submit"),"FTRM : Header : Encyclopedia Search","FOOD ",{customLinkText:"",events:"event40"});}
function initSearchBoxBehavior(){input.keypress(function(evt){var code=(evt.keyCode?evt.keyCode:evt.which);if(code==13){submitSearchForm(input.val());evt.preventDefault();}});button.click(function(evt){submitSearchForm(input.val())
evt.preventDefault();});};return{init:function(id){searchBoxRoot=$(id);input=searchBoxRoot.find('input');button=searchBoxRoot.find('.button');if(input&&(input.val()==''||input.val()==defaultString)){SNI.Util.inputField(input,defaultString);}
initSearchBoxBehavior();}}})();
(function($){$.fn.ellipsis=function(enableUpdating){var s=document.documentElement.style;if(!('textOverflow'in s||'OTextOverflow'in s)){return this.each(function(){var el=$(this);if(el.css("overflow")=="hidden"){var originalText=el.html();var w=el.width();var t=$(this.cloneNode(true)).hide().css({'position':'absolute','width':'auto','overflow':'visible','max-width':'inherit'});el.after(t);var text=originalText;while(text.length>0&&t.width()>el.width()){text=text.substr(0,text.length-1);t.html(text+"...");}
el.html(t.html());t.remove();if(enableUpdating==true){var oldW=el.width();setInterval(function(){if(el.width()!=oldW){oldW=el.width();el.html(originalText);el.ellipsis();}},200);}}});}else return this;};})(jQuery);


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});};

(function($){$.fn.jcarousel=function(o){if(typeof o=='string'){var instance=$(this).data('jcarousel'),args=Array.prototype.slice.call(arguments,1);return instance[o].apply(instance,args);}else
return this.each(function(){$(this).data('jcarousel',new $jc(this,o));});};var defaults={vertical:false,start:1,offset:1,size:null,scroll:3,visible:null,animation:'normal',easing:'swing',auto:0,wrap:null,initCallback:null,reloadCallback:null,itemLoadCallback:null,itemFirstInCallback:null,itemFirstOutCallback:null,itemLastInCallback:null,itemLastOutCallback:null,itemVisibleInCallback:null,itemVisibleOutCallback:null,buttonNextHTML:'<div></div>',buttonPrevHTML:'<div></div>',buttonNextEvent:'click',buttonPrevEvent:'click',buttonNextCallback:null,buttonPrevCallback:null};$.jcarousel=function(e,o){this.options=$.extend({},defaults,o||{});this.locked=false;this.container=null;this.clip=null;this.list=null;this.buttonNext=null;this.buttonPrev=null;this.wh=!this.options.vertical?'width':'height';this.lt=!this.options.vertical?'left':'top';var skin='',split=e.className.split(' ');for(var i=0;i<split.length;i++){if(split[i].indexOf('jcarousel-skin')!=-1){$(e).removeClass(split[i]);skin=split[i];break;}}if(e.nodeName=='UL'||e.nodeName=='OL'){this.list=$(e);this.container=this.list.parent();if(this.container.hasClass('jcarousel-clip')){if(!this.container.parent().hasClass('jcarousel-container'))this.container=this.container.wrap('<div></div>');this.container=this.container.parent();}else if(!this.container.hasClass('jcarousel-container'))this.container=this.list.wrap('<div></div>').parent();}else{this.container=$(e);this.list=this.container.find('ul,ol').eq(0);}if(skin!=''&&this.container.parent()[0].className.indexOf('jcarousel-skin')==-1)this.container.wrap('<div class=" '+skin+'"></div>');this.clip=this.list.parent();if(!this.clip.length||!this.clip.hasClass('jcarousel-clip'))this.clip=this.list.wrap('<div></div>').parent();this.buttonNext=$('.jcarousel-next',this.container);if(this.buttonNext.size()==0&&this.options.buttonNextHTML!=null)this.buttonNext=this.clip.after(this.options.buttonNextHTML).next();this.buttonNext.addClass(this.className('jcarousel-next'));this.buttonPrev=$('.jcarousel-prev',this.container);if(this.buttonPrev.size()==0&&this.options.buttonPrevHTML!=null)this.buttonPrev=this.clip.after(this.options.buttonPrevHTML).next();this.buttonPrev.addClass(this.className('jcarousel-prev'));this.clip.addClass(this.className('jcarousel-clip')).css({overflow:'hidden',position:'relative'});this.list.addClass(this.className('jcarousel-list')).css({overflow:'hidden',position:'relative',top:0,left:0,margin:0,padding:0});this.container.addClass(this.className('jcarousel-container')).css({position:'relative'});var di=this.options.visible!=null?Math.ceil(this.clipping()/this.options.visible):null;var li=this.list.children('li');var self=this;if(li.size()>0){var wh=0,i=this.options.offset;li.each(function(){self.format(this,i++);wh+=self.dimension(this,di);});this.list.css(this.wh,wh+'px');if(!o||o.size===undefined)this.options.size=li.size();}this.container.css('display','block');this.buttonNext.css('display','block');this.buttonPrev.css('display','block');this.funcNext=function(){self.next();};this.funcPrev=function(){self.prev();};this.funcResize=function(){self.reload();};if(this.options.initCallback!=null)this.options.initCallback(this,'init');if($.browser.safari){this.buttons(false,false);$(window).bind('load.jcarousel',function(){self.setup();});}else
this.setup();};var $jc=$.jcarousel;$jc.fn=$jc.prototype={jcarousel:'0.2.4'};$jc.fn.extend=$jc.extend=$.extend;$jc.fn.extend({setup:function(){this.first=null;this.last=null;this.prevFirst=null;this.prevLast=null;this.animating=false;this.timer=null;this.tail=null;this.inTail=false;if(this.locked)return;this.list.css(this.lt,this.pos(this.options.offset)+'px');var p=this.pos(this.options.start);this.prevFirst=this.prevLast=null;this.animate(p,false);$(window).unbind('resize.jcarousel',this.funcResize).bind('resize.jcarousel',this.funcResize);},reset:function(){this.list.empty();this.list.css(this.lt,'0px');this.list.css(this.wh,'10px');if(this.options.initCallback!=null)this.options.initCallback(this,'reset');this.setup();},reload:function(){if(this.tail!=null&&this.inTail)this.list.css(this.lt,$jc.intval(this.list.css(this.lt))+this.tail);this.tail=null;this.inTail=false;if(this.options.reloadCallback!=null)this.options.reloadCallback(this);if(this.options.visible!=null){var self=this;var di=Math.ceil(this.clipping()/this.options.visible),wh=0,lt=0;$('li',this.list).each(function(i){wh+=self.dimension(this,di);if(i+1<self.first)lt=wh;});this.list.css(this.wh,wh+'px');this.list.css(this.lt,-lt+'px');}this.scroll(this.first,false);},lock:function(){this.locked=true;this.buttons();},unlock:function(){this.locked=false;this.buttons();},size:function(s){if(s!=undefined){this.options.size=s;if(!this.locked)this.buttons();}return this.options.size;},has:function(i,i2){if(i2==undefined||!i2)i2=i;if(this.options.size!==null&&i2>this.options.size)i2=this.options.size;for(var j=i;j<=i2;j++){var e=this.get(j);if(!e.length||e.hasClass('jcarousel-item-placeholder'))return false;}return true;},get:function(i){return $('.jcarousel-item-'+i,this.list);},add:function(i,s){var e=this.get(i),old=0,add=0;if(e.length==0){var c,e=this.create(i),j=$jc.intval(i);while(c=this.get(--j)){if(j<=0||c.length){j<=0?this.list.prepend(e):c.after(e);break;}}}else
old=this.dimension(e);e.removeClass(this.className('jcarousel-item-placeholder'));typeof s=='string'?e.html(s):e.empty().append(s);var di=this.options.visible!=null?Math.ceil(this.clipping()/this.options.visible):null;var wh=this.dimension(e,di)-old;if(i>0&&i<this.first)this.list.css(this.lt,$jc.intval(this.list.css(this.lt))-wh+'px');this.list.css(this.wh,$jc.intval(this.list.css(this.wh))+wh+'px');return e;},remove:function(i){var e=this.get(i);if(!e.length||(i>=this.first&&i<=this.last))return;var d=this.dimension(e);if(i<this.first)this.list.css(this.lt,$jc.intval(this.list.css(this.lt))+d+'px');e.remove();this.list.css(this.wh,$jc.intval(this.list.css(this.wh))-d+'px');},next:function(){this.stopAuto();if(this.tail!=null&&!this.inTail)this.scrollTail(false);else
this.scroll(((this.options.wrap=='both'||this.options.wrap=='last')&&this.options.size!=null&&this.last==this.options.size)?1:this.first+this.options.scroll);},prev:function(){this.stopAuto();if(this.tail!=null&&this.inTail)this.scrollTail(true);else
this.scroll(((this.options.wrap=='both'||this.options.wrap=='first')&&this.options.size!=null&&this.first==1)?this.options.size:this.first-this.options.scroll);},scrollTail:function(b){if(this.locked||this.animating||!this.tail)return;var pos=$jc.intval(this.list.css(this.lt));!b?pos-=this.tail:pos+=this.tail;this.inTail=!b;this.prevFirst=this.first;this.prevLast=this.last;this.animate(pos);},scroll:function(i,a){if(this.locked||this.animating)return;this.animate(this.pos(i),a);},pos:function(i){var pos=$jc.intval(this.list.css(this.lt));if(this.locked||this.animating)return pos;if(this.options.wrap!='circular')i=i<1?1:(this.options.size&&i>this.options.size?this.options.size:i);var back=this.first>i;var f=this.options.wrap!='circular'&&this.first<=1?1:this.first;var c=back?this.get(f):this.get(this.last);var j=back?f:f-1;var e=null,l=0,p=false,d=0,g;while(back?--j>=i:++j<i){e=this.get(j);p=!e.length;if(e.length==0){e=this.create(j).addClass(this.className('jcarousel-item-placeholder'));c[back?'before':'after'](e);if(this.first!=null&&this.options.wrap=='circular'&&this.options.size!==null&&(j<=0||j>this.options.size)){g=this.get(this.index(j));if(g.length)this.add(j,g.children().clone(true));}}c=e;d=this.dimension(e);if(p)l+=d;if(this.first!=null&&(this.options.wrap=='circular'||(j>=1&&(this.options.size==null||j<=this.options.size))))pos=back?pos+d:pos-d;}var clipping=this.clipping();var cache=[];var visible=0,j=i,v=0;var c=this.get(i-1);while(++visible){e=this.get(j);p=!e.length;if(e.length==0){e=this.create(j).addClass(this.className('jcarousel-item-placeholder'));c.length==0?this.list.prepend(e):c[back?'before':'after'](e);if(this.first!=null&&this.options.wrap=='circular'&&this.options.size!==null&&(j<=0||j>this.options.size)){g=this.get(this.index(j));if(g.length)this.add(j,g.find('>*').clone(true));}}c=e;var d=this.dimension(e);if(d==0){return 0;}if(this.options.wrap!='circular'&&this.options.size!==null&&j>this.options.size)cache.push(e);else if(p)l+=d;v+=d;if(v>=clipping)break;j++;}for(var x=0;x<cache.length;x++)cache[x].remove();if(l>0){this.list.css(this.wh,this.dimension(this.list)+l+'px');if(back){pos-=l;this.list.css(this.lt,$jc.intval(this.list.css(this.lt))-l+'px');}}var last=i+visible-1;if(this.options.wrap!='circular'&&this.options.size&&last>this.options.size)last=this.options.size;if(j>last){visible=0,j=last,v=0;while(++visible){var e=this.get(j--);if(!e.length)break;v+=this.dimension(e);if(v>=clipping)break;}}var first=last-visible+1;if(this.options.wrap!='circular'&&first<1)first=1;if(this.inTail&&back){pos+=this.tail;this.inTail=false;}this.tail=null;if(this.options.wrap!='circular'&&last==this.options.size&&(last-visible+1)>=1){var m=$jc.margin(this.get(last),!this.options.vertical?'marginRight':'marginBottom');if((v-m)>clipping)this.tail=v-clipping-m;}while(i-->first)pos+=this.dimension(this.get(i));this.prevFirst=this.first;this.prevLast=this.last;this.first=first;this.last=last;return pos;},animate:function(p,a){if(this.locked||this.animating)return;this.animating=true;var self=this;var scrolled=function(){self.animating=false;if(p==0)self.list.css(self.lt,0);if(self.options.wrap=='circular'||self.options.wrap=='both'||self.options.wrap=='last'||self.options.size==null||self.last<self.options.size)self.startAuto();self.buttons();self.notify('onAfterAnimation');};this.notify('onBeforeAnimation');if(!this.options.animation||a==false){this.list.css(this.lt,p+'px');scrolled();}else{var o=!this.options.vertical?{'left':p}:{'top':p};this.list.animate(o,this.options.animation,this.options.easing,scrolled);}},startAuto:function(s){if(s!=undefined)this.options.auto=s;if(this.options.auto==0)return this.stopAuto();if(this.timer!=null)return;var self=this;this.timer=setTimeout(function(){self.next();},this.options.auto*1000);},stopAuto:function(){if(this.timer==null)return;clearTimeout(this.timer);this.timer=null;},buttons:function(n,p){if(n==undefined||n==null){var n=!this.locked&&this.options.size!==0&&((this.options.wrap&&this.options.wrap!='first')||this.options.size==null||this.last<this.options.size);if(!this.locked&&(!this.options.wrap||this.options.wrap=='first')&&this.options.size!=null&&this.last>=this.options.size)n=this.tail!=null&&!this.inTail;}if(p==undefined||p==null){var p=!this.locked&&this.options.size!==0&&((this.options.wrap&&this.options.wrap!='last')||this.first>1);if(!this.locked&&(!this.options.wrap||this.options.wrap=='last')&&this.options.size!=null&&this.first==1)p=this.tail!=null&&this.inTail;}var self=this;this.buttonNext[n?'bind':'unbind'](this.options.buttonNextEvent+'.jcarousel',this.funcNext)[n?'removeClass':'addClass'](this.className('jcarousel-next-disabled')).attr('disabled',n?false:true);this.buttonPrev[p?'bind':'unbind'](this.options.buttonPrevEvent+'.jcarousel',this.funcPrev)[p?'removeClass':'addClass'](this.className('jcarousel-prev-disabled')).attr('disabled',p?false:true);if(this.buttonNext.length>0&&(this.buttonNext[0].jcarouselstate==undefined||this.buttonNext[0].jcarouselstate!=n)&&this.options.buttonNextCallback!=null){this.buttonNext.each(function(){self.options.buttonNextCallback(self,this,n);});this.buttonNext[0].jcarouselstate=n;}if(this.buttonPrev.length>0&&(this.buttonPrev[0].jcarouselstate==undefined||this.buttonPrev[0].jcarouselstate!=p)&&this.options.buttonPrevCallback!=null){this.buttonPrev.each(function(){self.options.buttonPrevCallback(self,this,p);});this.buttonPrev[0].jcarouselstate=p;}},notify:function(evt){var state=this.prevFirst==null?'init':(this.prevFirst<this.first?'next':'prev');this.callback('itemLoadCallback',evt,state);if(this.prevFirst!==this.first){this.callback('itemFirstInCallback',evt,state,this.first);this.callback('itemFirstOutCallback',evt,state,this.prevFirst);}if(this.prevLast!==this.last){this.callback('itemLastInCallback',evt,state,this.last);this.callback('itemLastOutCallback',evt,state,this.prevLast);}this.callback('itemVisibleInCallback',evt,state,this.first,this.last,this.prevFirst,this.prevLast);this.callback('itemVisibleOutCallback',evt,state,this.prevFirst,this.prevLast,this.first,this.last);},callback:function(cb,evt,state,i1,i2,i3,i4){if(this.options[cb]==undefined||(typeof this.options[cb]!='object'&&evt!='onAfterAnimation'))return;var callback=typeof this.options[cb]=='object'?this.options[cb][evt]:this.options[cb];if(!$.isFunction(callback))return;var self=this;if(i1===undefined)callback(self,state,evt);else if(i2===undefined)this.get(i1).each(function(){callback(self,this,i1,state,evt);});else{for(var i=i1;i<=i2;i++)if(i!==null&&!(i>=i3&&i<=i4))this.get(i).each(function(){callback(self,this,i,state,evt);});}},create:function(i){return this.format('<li></li>',i);},format:function(e,i){var $e=$(e).addClass(this.className('jcarousel-item')).addClass(this.className('jcarousel-item-'+i)).css({'float':'left','list-style':'none'});$e.attr('jcarouselindex',i);return $e;},className:function(c){return c+' '+c+(!this.options.vertical?'-horizontal':'-vertical');},dimension:function(e,d){var el=e.jquery!=undefined?e[0]:e;var old=!this.options.vertical?el.offsetWidth+$jc.margin(el,'marginLeft')+$jc.margin(el,'marginRight'):el.offsetHeight+$jc.margin(el,'marginTop')+$jc.margin(el,'marginBottom');if(d==undefined||old==d)return old;var w=!this.options.vertical?d-$jc.margin(el,'marginLeft')-$jc.margin(el,'marginRight'):d-$jc.margin(el,'marginTop')-$jc.margin(el,'marginBottom');$(el).css(this.wh,w+'px');return this.dimension(el);},clipping:function(){return!this.options.vertical?this.clip[0].offsetWidth-$jc.intval(this.clip.css('borderLeftWidth'))-$jc.intval(this.clip.css('borderRightWidth')):this.clip[0].offsetHeight-$jc.intval(this.clip.css('borderTopWidth'))-$jc.intval(this.clip.css('borderBottomWidth'));},index:function(i,s){if(s==undefined)s=this.options.size;return Math.round((((i-1)/s)-Math.floor((i-1)/s))*s)+1;}});$jc.extend({defaults:function(d){return $.extend(defaults,d||{});},margin:function(e,p){if(!e)return 0;var el=e.jquery!=undefined?e[0]:e;if(p=='marginRight'&&$.browser.safari){var old={'display':'block','float':'none','width':'auto'},oWidth,oWidth2;$.swap(el,old,function(){oWidth=el.offsetWidth;});old['marginRight']=0;$.swap(el,old,function(){oWidth2=el.offsetWidth;});return oWidth2-oWidth;}return $jc.intval($.css(el,p));},intval:function(v){v=parseInt(v);return isNaN(v)?0:v;}});})(jQuery);
(function($){$.ui=$.ui||{};$.fn.tabs=function(initial,options){if(initial&&initial.constructor==Object){options=initial;initial=null;}
options=options||{};initial=initial&&initial.constructor==Number&&--initial||0;return this.each(function(){new $.ui.tabs(this,$.extend(options,{initial:initial}));});};$.each(['Add','Remove','Enable','Disable','Click','Load','Href'],function(i,method){$.fn['tabs'+method]=function(){var args=arguments;return this.each(function(){var instance=$.ui.tabs.getInstance(this);instance[method.toLowerCase()].apply(instance,args);});};});$.fn.tabsSelected=function(){var selected=-1;if(this[0]){var instance=$.ui.tabs.getInstance(this[0]),$lis=$('li',this);selected=$lis.index($lis.filter('.'+instance.options.selectedClass)[0]);}
return selected>=0?++selected:-1;};$.ui.tabs=function(el,options){this.source=el;this.options=$.extend({initial:0,event:'click',disabled:[],cookie:null,unselected:false,unselect:options.unselected?true:false,spinner:'Loading&#8230;',cache:false,idPrefix:'ui-tabs-',ajaxOptions:{},fxSpeed:'normal',add:function(){},remove:function(){},enable:function(){},disable:function(){},click:function(){},hide:function(){},show:function(){},load:function(){},tabTemplate:'<li><a href="#{href}"><span>#{text}</span></a></li>',panelTemplate:'<div></div>',navClass:'ui-tabs-nav',selectedClass:'ui-tabs-selected',unselectClass:'ui-tabs-unselect',disabledClass:'ui-tabs-disabled',panelClass:'ui-tabs-panel',hideClass:'ui-tabs-hide',loadingClass:'ui-tabs-loading',forcePositionCenter:false},options);this.options.event+='.ui-tabs';this.options.cookie=$.cookie&&$.cookie.constructor==Function&&this.options.cookie;$.data(el,$.ui.tabs.INSTANCE_KEY,this);this.tabify(true);};$.ui.tabs.INSTANCE_KEY='ui_tabs_instance';$.ui.tabs.getInstance=function(el){return $.data(el,$.ui.tabs.INSTANCE_KEY);};$.extend($.ui.tabs.prototype,{tabId:function(a){return a.title?a.title.replace(/\s/g,'_'):this.options.idPrefix+$.data(a);},tabify:function(init){this.$lis=$('h5:has(a[href])',this.source);this.$tabs=this.$lis.map(function(){return $('a',this)[0]});this.$panels=$([]);var self=this,o=this.options;this.$tabs.each(function(i,a){if(a.hash&&a.hash.replace('#','')){self.$panels=self.$panels.add(a.hash);}
else if($(a).attr('href')!='#'){$.data(a,'href',a.href);var id=self.tabId(a);a.href='#'+id;self.$panels=self.$panels.add($('#'+id)[0]||$(o.panelTemplate).attr('id',id).addClass(o.panelClass).insertAfter(self.$panels[i-1]||self.source));}
else{o.disabled.push(i+1);}});if(init){$(this.source).hasClass(o.navClass)||$(this.source).addClass(o.navClass);this.$panels.each(function(){var $this=$(this);$this.hasClass(o.panelClass)||$this.addClass(o.panelClass);});if(o.forcePositionCenter&&$(this.source).hasClass(o.navClass)){nav=$(this.source);navWidth=3;nav.children().each(function(){navWidth+=$(this).outerWidth({margin:true});});if($.browser.msie&&(parseInt($.browser.version)<7)){navWidth+=3;}
nav.css({width:navWidth,position:'absolute',left:'50%'});nav.css('margin-left',-1*Math.ceil(navWidth/2.0));}
for(var i=0,position;position=o.disabled[i];i++){this.disable(position);}
this.$tabs.each(function(i,a){if(location.hash){if(a.hash==location.hash){o.initial=i;if($.browser.msie||$.browser.opera){var $toShow=$(location.hash),toShowId=$toShow.attr('id');$toShow.attr('id','');setTimeout(function(){$toShow.attr('id',toShowId);},500);}
scrollTo(0,0);return false;}}else if(o.cookie){o.initial=parseInt($.cookie($.ui.tabs.INSTANCE_KEY+$.data(self.source)))||0;return false;}else if(self.$lis.eq(i).hasClass(o.selectedClass)){o.initial=i;return false;}});var n=this.$lis.length;while(this.$lis.eq(o.initial).hasClass(o.disabledClass)&&n){o.initial=++o.initial<this.$lis.length?o.initial:0;n--;}
if(!n){o.unselected=o.unselect=true;}
this.$panels.addClass(o.hideClass);this.$lis.removeClass(o.selectedClass);if(!o.unselected){this.$panels.eq(o.initial).show().removeClass(o.hideClass);this.$lis.eq(o.initial).addClass(o.selectedClass);}
var href=!o.unselected&&$.data(this.$tabs[o.initial],'href');if(href){this.load(o.initial+1,href);}
if(!/^click/.test(o.event)){this.$tabs.bind('click',function(e){e.preventDefault();});}}
var showAnim={},showSpeed=o.fxShowSpeed||o.fxSpeed,hideAnim={},hideSpeed=o.fxHideSpeed||o.fxSpeed;if(o.fxSlide||o.fxFade){if(o.fxSlide){showAnim['height']='show';hideAnim['height']='hide';}
if(o.fxFade){showAnim['opacity']='show';hideAnim['opacity']='hide';}}else{if(o.fxShow){showAnim=o.fxShow;}else{showAnim['min-width']=0;showSpeed=1;}
if(o.fxHide){hideAnim=o.fxHide;}else{hideAnim['min-width']=0;hideSpeed=1;}}
var resetCSS={display:'',overflow:'',height:''};if(!$.browser.msie){resetCSS['opacity']='';}
function hideTab(clicked,$hide,$show){$hide.animate(hideAnim,hideSpeed,function(){$hide.addClass(o.hideClass).css(resetCSS);if($.browser.msie&&hideAnim['opacity']){$hide[0].style.filter='';}
o.hide(clicked,$hide[0],$show&&$show[0]||null);if($show){showTab(clicked,$show,$hide);}});}
function showTab(clicked,$show,$hide){if(!(o.fxSlide||o.fxFade||o.fxShow)){$show.css('display','block');}
$show.animate(showAnim,showSpeed,function(){$show.removeClass(o.hideClass).css(resetCSS);if($.browser.msie&&showAnim['opacity']){$show[0].style.filter='';}
o.show(clicked,$show[0],$hide&&$hide[0]||null);});}
function switchTab(clicked,$li,$hide,$show){$li.addClass(o.selectedClass).siblings().removeClass(o.selectedClass);hideTab(clicked,$hide,$show);}
this.$tabs.unbind(o.event).bind(o.event,function(){var $li=$(this).parents('h5:eq(0)'),$hide=self.$panels.filter(':visible'),$show=$(this.hash);if(($li.hasClass(o.selectedClass)&&!o.unselect)||$li.hasClass(o.disabledClass)||o.click(this,$show[0],$hide[0])===false){this.blur();return false;}
if(o.cookie){$.cookie($.ui.tabs.INSTANCE_KEY+$.data(self.source),self.$tabs.index(this),o.cookie);}
if(o.unselect){if($li.hasClass(o.selectedClass)){$li.removeClass(o.selectedClass);self.$panels.stop();hideTab(this,$hide);this.blur();return false;}else if(!$hide.length){self.$panels.stop();if($.data(this,'href')){var a=this;self.load(self.$tabs.index(this)+1,$.data(this,'href'),function(){$li.addClass(o.selectedClass).addClass(o.unselectClass);showTab(a,$show);});}else{$li.addClass(o.selectedClass).addClass(o.unselectClass);showTab(this,$show);}
this.blur();return false;}}
self.$panels.stop();if($show.length){if($.data(this,'href')){var a=this;self.load(self.$tabs.index(this)+1,$.data(this,'href'),function(){switchTab(a,$li,$hide,$show);});}else{switchTab(this,$li,$hide,$show);}}else{throw'jQuery UI Tabs: Mismatching fragment identifier.';}
if($.browser.msie){this.blur();}
return false;});},add:function(url,text,position){if(url&&text){position=position||this.$tabs.length;var o=this.options,$li=$(o.tabTemplate.replace(/#\{href\}/,url).replace(/#\{text\}/,text));var id=url.indexOf('#')==0?url.replace('#',''):this.tabId($('a:first-child',$li)[0]);var $panel=$('#'+id);$panel=$panel.length&&$panel||$(o.panelTemplate).attr('id',id).addClass(o.panelClass).addClass(o.hideClass);if(position>=this.$lis.length){$li.appendTo(this.source);$panel.appendTo(this.source.parentNode);}else{$li.insertBefore(this.$lis[position-1]);$panel.insertBefore(this.$panels[position-1]);}
this.tabify();if(this.$tabs.length==1){$li.addClass(o.selectedClass);$panel.removeClass(o.hideClass);var href=$.data(this.$tabs[0],'href');if(href){this.load(position+1,href);}}
o.add(this.$tabs[position],this.$panels[position]);}else{throw'jQuery UI Tabs: Not enough arguments to add tab.';}},remove:function(position){if(position&&position.constructor==Number){var o=this.options,$li=this.$lis.eq(position-1).remove(),$panel=this.$panels.eq(position-1).remove();if($li.hasClass(o.selectedClass)&&this.$tabs.length>1){this.click(position+(position<this.$tabs.length?1:-1));}
this.tabify();o.remove($li.end()[0],$panel[0]);}},enable:function(position){var o=this.options,$li=this.$lis.eq(position-1);$li.removeClass(o.disabledClass);if($.browser.safari){$li.css('display','inline-block');setTimeout(function(){$li.css('display','block')},0)}
o.enable(this.$tabs[position-1],this.$panels[position-1]);},disable:function(position){var o=this.options;this.$lis.eq(position-1).addClass(o.disabledClass);o.disable(this.$tabs[position-1],this.$panels[position-1]);},click:function(position){this.$tabs.eq(position-1).trigger(this.options.event);},load:function(position,url,callback){var self=this,o=this.options,$a=this.$tabs.eq(position-1),a=$a[0],$span=$('span',a);if(url&&url.constructor==Function){callback=url;url=null;}
if(url){$.data(a,'href',url);}else{url=$.data(a,'href');}
if(o.spinner){$.data(a,'title',$span.html());$span.html('<em>'+o.spinner+'</em>');}
var finish=function(){self.$tabs.filter('.'+o.loadingClass).each(function(){$(this).removeClass(o.loadingClass);if(o.spinner){$('span',this).html($.data(this,'title'));}});self.xhr=null;};var ajaxOptions=$.extend(o.ajaxOptions,{url:url,success:function(r){$(a.hash).html(r);finish();if(callback&&callback.constructor==Function){callback();}
if(o.cache){$.removeData(a,'href');}
o.load(self.$tabs[position-1],self.$panels[position-1]);}});if(this.xhr){this.xhr.abort();finish();}
$a.addClass(o.loadingClass);setTimeout(function(){self.xhr=$.ajax(ajaxOptions);},0);},href:function(position,href){$.data(this.$tabs.eq(position-1)[0],'href',href);}});})(jQuery);
if(typeof(SNI.Util)=="undefined"){SNI.Util={};}
SNI.Util.inputField=function(elem,defaultText,preventDefault){var elem=$(elem);var preventDefault=preventDefault==null?true:preventDefault;if(elem.length>0){var input=elem.get(0);if(input.tagName.toLowerCase()=='input'&&input.type=='text'){if($.trim(elem.val())===''){elem.val(defaultText);}
elem.blur(function(){if($.trim(this.value)===''){this.value=defaultText;}});elem.focus(function(){if(this.value==defaultText){this.value='';}});if(preventDefault===true){form=$(elem.get(0).form);if(form){form.submit(function(event){if($.trim(elem.val())==defaultText||$.trim(elem.val())==""){if($(elem).parents().filter('form').attr("name")=="HeaderSearchForm"){event.preventDefault();elem.focus();}else{elem.val('');}}
return true;});}}}}};SNI.Util.truncate=function(str,length,truncation){length=length||30;truncation=truncation==undefined?'...':truncation;return str.length>length?str.slice(0,length-truncation.length)+truncation:str;};SNI.Util.onMDready=function(myfn,tmlim){if(tmlim==undefined){tmlim=5000;}
n=0;nlim=tmlim/100;timerID=window.setInterval(function(){++n;if(n>nlim){window.clearInterval(timerID);}
else if(typeof(mdManager)!="undefined"){window.clearInterval(timerID);myfn();}},100);};SNI.Util.hitCount=function(){var myURL;if(location.host=="www.foodnetwork.com"){myURL="http://images.foodnetwork.com/webfood/fn20/html/fixHits.html";}else{myURL="http://frontend.scrippsnetworks.com/food/dev/html/fixHits.html";}
if($("#hitCounter").length>0){$("#hitCounter").remove();}
$("head").append('<iframe id="hitCounter" src="'+myURL+'" width="0" height="0" frameborder="0" style="height:0; width:0; display:none;"></iframe>')
return;};SNI.Util.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.Util.positionInViewport(element);}
element.fadeIn('fast');};SNI.Util.getOffset=function(element){element=$(element);var hidden=element.is(":hidden");if(hidden){element.show();}
var offset=element.offset();if(hidden){element.hide();}
return offset;};SNI.Util.positionInViewport=function(element){element=$(element);var windowOffset=63;var offset=SNI.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)});}};SNI.Util.Cookie.session=function(cookieName,key,value){var cookie=this.get(cookieName);if(typeof value=='undefined'){if(cookie==null){return null;}else{var values=this.getPersistValues(cookie);return values[key];}}else{if(cookie==null){var values={};values[key]=escape(value);}else{var values=this.getPersistValues(cookie);values[key]=value;}
this.set(cookieName,this.buildPersistString(values));}}
if(typeof(SNI)=="undefined"){SNI={};}
if(typeof(SNI.Util)=="undefined"){SNI.Util={};}
SNI.Util.sched=function(dtStart,dtEnd,runfn){if((typeof dtStart=='object')&&(typeof dtEnd=='object'))
{frDate=new Date();frDate.setFullYear(dtStart.yr,dtStart.mon-1,dtStart.day);frDate.setHours(dtStart.hr,dtStart.min,dtStart.sec);toDate=new Date();toDate.setFullYear(dtEnd.yr,dtEnd.mon-1,dtEnd.day);toDate.setHours(dtEnd.hr,dtEnd.min,dtEnd.sec);now=new Date();if((now.getTime()>frDate.getTime())&&(now.getTime()<=toDate.getTime()))
{eval(runfn);}}
return;};
(function($){$.fn.countDown=function(options){var options=$.extend({date:'January 1, 2099 00:00:00',updateInterval:1,wraps:null,onExpire:function(){}},options);return this.each(function(i){var obj=this;var today=new Date();var endDate=new Date(options.date);var ms=Math.floor(endDate.getTime()-today.getTime());function two(x){return((x>9)?"":"0")+x}
function three(x){return((x>99)?"":"0")+((x>9)?"":"0")+x}
function MS2DHMSMS(ms){var nt={};var sec=Math.floor(ms/1000);ms=ms%1000;nt.ms=three(ms).toString();var min=Math.floor(sec/60);sec=sec%60;nt.ss=two(sec).toString();var hr=Math.floor(min/60);min=min%60;nt.mm=two(min).toString();var day=Math.floor(hr/24);hr=hr%24;nt.hh=two(hr).toString();nt.dd=day.toString();return nt;}
function getTimeLeft(){var today=new Date();var ms=Math.floor(endDate.getTime()-today.getTime());if(ms<0)options.onExpire.call(this,obj);sLeft=MS2DHMSMS(ms).ss;mLeft=MS2DHMSMS(ms).mm;hLeft=MS2DHMSMS(ms).hh;dLeft=MS2DHMSMS(ms).dd;if(options.wraps==null)
$(obj).html('<span class="jcdDays">'+dLeft+'</span>&nbsp;<span class="jcdDaysText">day'+s+'</span>&nbsp;<span class="jcdHours">'+hLeft+'</span>:<span class="jcdMinutes">'+mLeft+'</span>:<span class="jcdSeconds">'+sLeft+'</span>');else{for(x in options.wraps){if(x=='days')$(options.wraps[x]).html(dLeft);if(x=='hours')$(options.wraps[x]).html(hLeft);if(x=='minutes')$(options.wraps[x]).html(mLeft);if(x=='seconds')$(options.wraps[x]).html(sLeft);}}};if(parseInt(MS2DHMSMS(ms).dd)<0)
options.onExpire.call(this,obj);else
if(options.updateInterval)setInterval(function(){getTimeLeft();},options.updateInterval*500);else getTimeLeft();});};})(jQuery);
jQuery.fn.sort=Array.prototype.sort;jQuery.sniUtil={getScrollXY:function(){var scrOfX=0,scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;scrOfX=window.pageXOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;scrOfX=document.body.scrollLeft;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;scrOfX=document.documentElement.scrollLeft;}
return[scrOfX,scrOfY];},alphaCompare:function(a,b){a=a.toLowerCase();b=b.toLowerCase();return a<b?-1:a>b?1:0;}};jQuery.dpl={init:function(type,config){return this.each(function(i){if(this.id){}
else{this.id=type+"-"+new Date().getTime();}
try{document.execCommand('BackgroundImageCache',false,true);}catch(e){}
var init=$.dpl[type];if($.isFunction(init)){init(this,config);}});},carousel:function(ele,config){config=$.extend({pause:null,scroll:1,animation:"slow",auto:0,wrap:null,pagelink:null,pagetext:null,start:1},config);var crsl_itemFirstInCallback=function(carousel,item,idx,state){if(config["pagelink"]=="text"){var tmpText=config["pagetext"];tmpText=tmpText.replace(/_current/ig,idx);tmpText=tmpText.replace(/_total/ig,carousel["options"]["size"]);carousel.container.find(".jcarousel-pagetext").html(tmpText);}
else
if(config["pagelink"]=="image"){jQuery(ele).find('.jcarousel-pageimg a.current').removeClass("current");link=jQuery(ele).find('.jcarousel-pageimg a')[idx-1];jQuery(link).addClass("current");}}
var crsl_initCallback=function(carousel,state){if((config["pagelink"]=="text")||(config["pagelink"]=="both")){carousel.container.append('<div class="jcarousel-pagetext"></div>');}
else
if((config["pagelink"]=="image")||(config["pagelink"]=="both")){var imgLinks="";for(var i=1;i<=carousel["options"]["size"];i++){imgLinks+='<a href="#'+i+'">'+i+'</a>';}
carousel.container.append('<div class="jcarousel-pageimg"></div>');jQuery(ele).find(".jcarousel-pageimg").append(imgLinks);jQuery(ele).find(".jcarousel-pageimg").css("left",parseInt($(ele).width())/2-parseInt($(ele).find(".jcarousel-pageimg").width())/2);jQuery(ele).find('.jcarousel-pageimg a').bind('click',function(){carousel.scroll(jQuery.jcarousel.intval(jQuery(this).html()));return false;});}}
$(ele).find('.crsl').jcarousel({scroll:config["scroll"],animation:config["slow"],auto:config["auto"],wrap:config["wrap"],itemFirstInCallback:crsl_itemFirstInCallback,initCallback:crsl_initCallback,start:config["start"]});},accordion:function(el,config){jQuery(el).accordion({autoheight:true,header:'.acco-link',animated:false});},tab:function(el,config){jQuery(el).tabs(config);},fixedHeightAccordion:function(el,config){$("#"+el.id).find('li:eq(0)').addClass('selected');$("#"+el.id).find("h4").click(function(){$("#"+el.id).find("li.selected").removeClass('selected');$(this).parents('li').addClass('selected');});},episodeguide:function(ele,config){$(ele).find('.bd.upcoming').hide();$(ele).find(".dpl-btn-nav ul li a").each(function(){$(this).click(function(){if($(this).hasClass('recent')){$(this).addClass('selected');$(ele).find('.dpl-btn-nav li a.upcoming').removeClass('selected');$(ele).find('.bd.upcoming').hide();$(ele).find('.bd.recent').fadeIn("slow");$(this).blur();}
else if($(this).hasClass('upcoming')){$(this).addClass('selected');$(ele).find('.dpl-btn-nav li a.recent').removeClass('selected');$(ele).find('.bd.recent').hide();$(ele).find('.bd.upcoming').fadeIn("slow");$(this).blur();};});});},toggler:function(el,config){$(el).find('li:not(".expand") .acco-bd').hide();$(el).find(".acco-link h3").each(function(i){var $this=$(this);$this.click(function(){$this.parents("li").toggleClass("expand");$this.parents("li").find(".acco-bd").toggle();return false;});});},mwtabs:function(el,config){config=$.extend({daytabs:false},config);if(config["daytabs"]==true){var today=new Date();var dayofweek=today.getDay();switch(dayofweek){case 0:$("#nav-sun").parent().addClass("ui-tabs-selected");break;case 1:$("#nav-mon").parent().addClass("ui-tabs-selected");break;case 2:$("#nav-tue").parent().addClass("ui-tabs-selected");break;case 3:$("#nav-wed").parent().addClass("ui-tabs-selected");break;case 4:$("#nav-thu").parent().addClass("ui-tabs-selected");break;case 5:$("#nav-fri").parent().addClass("ui-tabs-selected");break;case 6:$("#nav-sat").parent().addClass("ui-tabs-selected");break;default:$("#nav-sun").parent().addClass("ui-tabs-selected");break;};};$(el).children().each(function(){var $this=$(this);var target=$this.find("a").attr("href");if(!$this.hasClass("ui-tabs-selected")){$(target).hide();};$this.click(function(){var selected_siblings=$this.siblings(".ui-tabs-selected");var sibling_targets=selected_siblings.find("a").attr("href");selected_siblings.removeClass("ui-tabs-selected");$this.addClass("ui-tabs-selected");$(sibling_targets).hide();$(target).show();return false;});});},collapser:function(el,config){config=$.extend({programguide:false,videochannels:false},config);if(config["programguide"]==true){var today=new Date();var current_time=today.getHours();var current_minutes=today.getMinutes();var dayofweek=today.getDay();var weekend=false;if(dayofweek==0||dayofweek==6){weekend=true;}
if(weekend==true&&current_time>=7&&current_time<12){$("#pguide-morning").addClass("active");}
else if(current_time>=9&&current_time<12){$("#pguide-morning").addClass("active");}
else if(current_time>=12&&current_time<16){$("#pguide-daytime").addClass("active");}
else if(current_time>=16&&current_time<19){$("#pguide-evening").addClass("active");}
else if(current_time>=19&&current_time<23){$("#pguide-primetime").addClass("active");}
else{$("#pguide-latenight").addClass("active");};};if(config["videochannels"]==true){togglelist=$(el).find('li.switch');togglelist.each(function(){var $this=$(this);var target=$this.find("h4");if(!$this.hasClass("active")){$this.find(".crsl-w").hide();};target.click(function(){if($this.hasClass("active")){$this.removeClass("active");$this.find(".crsl-w").hide(250);}else{$this.addClass("active");$this.find(".crsl-w").show(250);}});});};if(config["videochannels"]!=true){$(el).children(":first").each(function(){var $this=$(this);$this.click(function(){$this.parent().toggleClass("active");return false;});});};},meetchefs:function(el,config){cheflist=$(el).find('ul.chefs');cheflist.children().each(function(){var $this=$(this);var target=$this.find(".more-options");var clicktarget=$this.find(".cta");if(!target.hasClass("expand")){$(target).find(".pane").hide();}else{$(target).find(".cta").hide();};$(clicktarget).click(function(){$(target).find(".pane").show(250);$(clicktarget).hide();});});var guideTabs=$(el).find(".dpl-meetchefs");guideTabs.find('a').each(function(){var $this=$(this);$this.click(function(){newHeight=$(el).find('.panel').height();if($(this).attr("href")==="#guide-tab2"){$('#dpl-chefguide').find('.chefs-az ul').css('height',newHeight);$('#dpl-chefguide').find('.chefs-az ul').css('overflow','auto');}else{$(el).find('.bd').css('height','auto');}});});},recipetimes:function(el){$(el).change(function(){var mTotalHours=0;var mTotalmHours=0;var mTotalMinutes=0;var mSelPrepTimeHours=parseInt($("#mrb #selPrepTimeHours").val());var mSelPrepTimeMinutes=parseInt($("#mrb #selPrepTimeMinutes").val());var mSelNonActivePrepTimeHours=parseInt($("#mrb #selNonActivePrepTimeHours").val());var mSelNonActivePrepTimeMinutes=parseInt($("#mrb #selNonActivePrepTimeMinutes").val());var mSelCookTimeHours=parseInt($("#mrb #selCookTimeHours").val());var mSelCookTimeMinutes=parseInt($("#mrb #selCookTimeMinutes").val());mTotalMinutes=mSelPrepTimeMinutes+mSelNonActivePrepTimeMinutes+mSelCookTimeMinutes;if(mTotalMinutes>1){mTotalmHours=Math.floor(mTotalMinutes/60);mTotalMinutes=mTotalMinutes-(mTotalmHours*60);mTotalMinutes=mTotalMinutes+" mins";}else{mTotalMinutes=mTotalMinutes+" min";}
mTotalHours=mSelPrepTimeHours+mSelNonActivePrepTimeHours+mSelCookTimeHours+mTotalmHours;if(mTotalHours>1){mTotalHours=mTotalHours+" hrs";}else{mTotalHours=mTotalHours+" hr";}
$("#mrb #txtHoursOutput").html(mTotalHours);$("#mrb #txtMinutesOutput").html(mTotalMinutes);});},mrbHomePage:function(el,config){var $el=$('#mrb-home');if(urUser.isLoggedIn){mrbLoggedIn();}else{mrbLoggedOut();}
function mrbLoggedIn(){$el.find('#loading').remove();$el.removeClass("loading");$el.addClass("mrb-sin");$el.find('h3').after('<h4>Add, Organize and Share.</h4><p>Meal planning has never been easier!</p>');$el.find('.hd').html('<div class="dpl-mrb sm-tabs clrfix"><h5 class="ui-tabs-selected"><a id="mrb-your-recently-saved" href="#mrb-tab1"><span>YOUR RECENTLY SAVED</span></a></h5><h5><a id="mrb-top5-saved" href="#mrb-tab2"><span>TOP 5 SAVED</span></a></h5></div>');$el.find('.bd h4').remove();$el.find('.bd').append('<div id="mrb-tab1" class="ui-tabs-panel"></div>');$el.find('.bd').append('<div id="mrb-tab2" class="ui-tabs-hide"></div>');$el.find('#mrb-your-recently-saved').click(mrbOnClickYourRecentlySaved);$el.find('#mrb-top5-saved').click(mrbOnClickTop5Saved);$(".dpl-mrb").dpl("tab");$.ajax({type:"GET",url:"/app/food/mrb/myrecipes/xml/viewFolderItemsXml.do",dataType:"xml",success:function(xml){if($(xml).find('FolderItemCount').find('int').text()!="0"){$('#mrb-tab1').html("<ul id='update-target'></ul>");var count=0;$(xml).find('FolderItem').each(function(){if(count<5){var name_url=$(this).find('url').text();var name_text=$(this).find('title').text();$('<li></li>').html('<a href="'+name_url+'">'+name_text+'</a>').appendTo('#update-target');}
count++;});}else{$('#mrb-tab1').html("<h6>Start saving recipes to your Recipe Box now.</h6>");}},error:function(data,status,e){mrbLoggedOut();}});}
function mrbOnClickTop5Saved(){$el.find('#mrb-tab1').removeClass("ui-tabs-panel");$el.find('#mrb-tab1').addClass("ui-tabs-hide");$el.find('#mrb-tab2').removeClass("ui-tabs-hide");$el.find('#mrb-tab2').addClass("ui-tabs-panel");if($el.find('#top5-update-target').length==0){$.ajax({type:"GET",url:"/food/feeds/topSavedRecipes/0,,FOOD_RECIPE_5,00.xml",dataType:"xml",success:function(xml){if($(xml).find('FolderItemCount').find('int').text()!="0"){$('#mrb-tab2').html("<ul id='top5-update-target'></ul>");var count=0;$(xml).find('FolderItem').each(function(){if(count<5){var name_url=$(this).find('url').text();var name_text=$(this).find('title').text();$('<li></li>').html('<a href="'+name_url+'">'+name_text+'</a>').appendTo('#top5-update-target');}
count++;});}},error:function(data,status,e){mrbLoggedOut();}});}}
function mrbOnClickYourRecentlySaved(){$el.find('#mrb-tab2').removeClass("ui-tabs-panel");$el.find('#mrb-tab2').addClass("ui-tabs-hide");$el.find('#mrb-tab1').removeClass("ui-tabs-hide");$el.find('#mrb-tab1').addClass("ui-tabs-panel");}
function mrbLoggedOut(){$el.find('#mrb-tab2').removeClass("ui-tabs-hide");$el.find('#loading').remove();$el.removeClass("loading");}},srchLeftNavFilter:function(el,config){$("#resultFilters ul").each(function(i){var ct=$(this).children().size();var title=$(this).prev().text();var ctDiff=parseInt(ct-3);if(ct>4){$(this).attr("id","srf-list"+i);var results=document.createElement("div");var $results=$(results);$results.addClass("drops").addClass("small");$results.html('<div class="hd"> </div><div class="bd"><h5>More '+title+'<span class="close">Close</span></h5><ul id="alpha'+i+'"></ul></div><div class="ft"> </div>');$(this).find("li").each(function(i){$(this).find("a").click(function(e){$(this).parents().filter(".drops").hide();return true;});if(i<=2){$(this).clone(true).appendTo($results.find(".bd ul"));}else{$results.find(".bd ul").append($(this));}});$("#srf-list"+i).after('<div id="srf-drop'+i+'"><a class="cta">More '+title+'</a> <span>('+ct+')</span></div>');$("#srf-drop"+i).append(results);function alphaList($it){$('#alpha'+i).html(($it.map(function(){return'<li><a href="'+this.href+'">'+this.innerHTML+'</a></li>';}).get().join('\n')));}
alphaList($('#alpha'+i+' li a').sort(function(a,b){return $.sniUtil.alphaCompare(a.innerHTML,b.innerHTML);}));$("#srf-drop"+i).find(".cta").click(function(e){var $fDiv=$("#srf-drop"+i).find(".drops");var $aDiv=$("#srf-drop"+i).find("a");hideAll();if(jQuery.browser.msie){$fDiv.css({background:""})}
SNI.Util.moveToView($fDiv,{anchor:$aDiv,topOffset:-30,leftOffset:85});$('body').bind("click",function(e){bodyClick(e);});}).css({cursor:"pointer"});$("#srf-drop"+i).find('.close').click(function(){hideAll();}).css({cursor:"pointer"});}});function bodyClick(e){var $clicked=$(e.target);if($clicked.is('.cta')||$clicked.parents().is('.drops')){return false;}else{hideAll();$('body').unbind();}}
function hideAll(){$("#fnFilters div.drops").each(function(){if(jQuery.browser.msie){$(this).css({background:"B1B1B1"})}
$(this).fadeOut("fast");});}},moreoptions:function(el,config){$(el).each(function(){var $this=$(this);if($this.hasClass("active")){$this.removeClass("active");};$this.children(".cta").hover(function(){$this.children(".cta").css("text-decoration","underline");},function(){$this.children(".cta").css("text-decoration","none");});$this.children(".cta").click(function(){$this.addClass("active");});});},gallery:function(el,config){var galleryLarge_carousel;var gallerySmall_carousel;function galleryLarge_initCallback(carousel,state){if(state=="init"){galleryLarge_carousel=carousel;}
carousel.container.append('<div class="jcarousel-pagetext"></div>');var nextbtn=carousel.container.find(".jcarousel-next-horizontal");var prevbtn=carousel.container.find(".jcarousel-prev-horizontal");var pagetext=carousel.container.find(".jcarousel-pagetext");carousel.list.find(".jcarousel-item img").each(function(i){$(this).hover(function(a){prevbtn.show();nextbtn.show();},function(a){prevbtn.hide();nextbtn.hide();});});prevbtn.hover(function(){$(this).show();prevbtn.show();nextbtn.show();},function(){prevbtn.hide();nextbtn.hide();});nextbtn.hover(function(){prevbtn.show();nextbtn.show();},function(){prevbtn.hide();nextbtn.hide();});pagetext.hover(function(){prevbtn.show();nextbtn.show();},function(){prevbtn.hide();nextbtn.hide();});}
function gallerySmall_initCallback(carousel,state){if(state=="init"){gallerySmall_carousel=carousel;}
var imgLinks="";for(var i=1;i<=carousel["options"]["size"]/carousel["options"]["scroll"];i++){imgLinks+='<a href="#'+i+'">'+i+'</a>';}
carousel.container.append('<div class="jcarousel-pageimg">'+imgLinks+'</div>');jQuery(el).find(".jcarousel-pageimg").css("left",parseInt(carousel.container.width())/2-parseInt($(el).find(".jcarousel-pageimg").width())/2);jQuery(el).find('.jcarousel-pageimg a').bind('click',function(){var scrollto=(jQuery(this).html()==1)?1:(jQuery(this).html()-1)*carousel["options"]["scroll"];carousel.scroll(jQuery.jcarousel.intval(scrollto));return false;});}
var sendThumbnailCarouselToIndex;function syncImageCarousels(gLarge,gSmall){gSmall.list.find(".jcarousel-item").each(function(i){var $this=$(this);$this.bind("click",function(){gLarge.scroll(parseInt($this.attr("jcarouselindex")),true,true);setActiveCarouselItemClassName(gSmall,parseInt($this.attr("jcarouselindex")),"active");});});sendThumbnailCarouselToIndex=function(i){var itemSpan=gSmall.last-gSmall.first;if(i>gSmall.last){if(i>(gSmall.last+itemSpan)){gSmall.scroll(i,true);}else{gSmall.next();}}
if(i<gSmall.first){if(i<(gSmall.first-itemSpan)){gSmall.scroll(i,true);}else{gSmall.prev();}}
setActiveCarouselItemClassName(gSmall,i,"active");}}
function setActiveCarouselItemClassName(carouselObj,carouselItemInt,classNameStr){carouselObj.list.children('li').each(function(i){if(carouselItemInt==parseInt($(this).attr("jcarouselindex"))){$(this).addClass(classNameStr);}else{$(this).removeClass(classNameStr);}});}
var galleryLarge_itemFirstInCallback=function(carousel,item,idx,state){var pagetext=carousel.container.find(".jcarousel-pagetext");var tmpText="<a href='#'>close</a><em>Photo _current of _total</em>";tmpText=tmpText.replace(/_current/ig,idx);tmpText=tmpText.replace(/_total/ig,carousel["options"]["size"]);pagetext.html(tmpText);tmpText=jQuery("#gallery .jcarousel-skin-largeImages .jcarousel-item span").eq(idx-1).html();pagetext.find("em").after("<span>"+tmpText+"</span>");pagetext.show();pagetext.find("a").click(function()
{pagetext.hide();return false;});}
var gallerySmall_itemFirstInCallback=function(carousel,item,idx,state){jQuery(el).find('.jcarousel-pageimg a.current').removeClass("current");var link=jQuery(el).find('.jcarousel-pageimg a')[Math.ceil(parseInt(idx/carousel["options"]["scroll"]))];jQuery(link).addClass("current");}
jQuery('#galleryLarge').jcarousel({scroll:1,auto:0,wrap:null,itemFirstInCallback:galleryLarge_itemFirstInCallback,initCallback:galleryLarge_initCallback});jQuery('#gallerySmall .crsl').jcarousel({scroll:4,auto:0,wrap:null,itemFirstInCallback:gallerySmall_itemFirstInCallback,initCallback:gallerySmall_initCallback});syncImageCarousels(galleryLarge_carousel,gallerySmall_carousel);},dynlead:function(ele,config){config=$.extend({delay:15000,loops:0,showThumbnails:false,widthThumbails:110,pause:null},config);var _timeout;var currentSlide=0;var slides=$(ele).find(".dl-content li");var pageLinks=$(ele).find(".dl-menu");var maxSlides=slides.length;var countLoop=0;$(".video-cn").hide();$(ele).find(".videolink").click(function(){clearTimeout(_timeout);$(this).hide();$(this).parent().find(".video-cn").show();});var play=true;if(config["pause"]!=null){$(ele).find("."+config["pause"]).click(function(){txt=($(this).html()=="PAUSE")?"PLAY":"PAUSE";$(this).html(txt);if(play){clearTimeout(_timeout);play=false;}
else{nextSlide(ele,config);play=true;}});}
slides.not(":first").hide();pageLinks.find("li:first-child").addClass("active");pageLinks.find("li").each(function(i){var $this=$(this);if(config["showThumbnails"]){var thPreviewID=ele.id+"-cn-th-"+i;$this.attr({"rel":"#"+thPreviewID});$this.next(".content-th").attr({"id":thPreviewID});$this.cluetip({width:config["widthThumbails"],cluezIndex:6,cluetipClass:'content-th',local:true,showTitle:false,sticky:true,mouseOutClose:true,closePosition:'title',closeText:'',topOffset:6,leftOffset:-($this.parent().width()),positionBy:'fixed',dropShadow:false,cursor:'hand',titleAttribute:'',waitImage:false});$this.hover(function(e){height=$("#cluetip-inner").outerHeight();$('#cluetip').hide();opt={margin:true,padding:true,border:true,scroll:true};anchorPos=$(this).offset({scroll:true,margin:true,padding:true,border:true});_top=parseInt(anchorPos["top"])-parseInt(height);$('#cluetip').css('top',_top);$('#cluetip').show();},function(){if($('#cluetip').is(':visible')){$('#cluetip').hover(function(){$('#cluetip').show();},function(){$('#cluetip').hide();});$('#cluetip').hide();}});}
$this.click(function(){clearTimeout(_timeout);pageLinks.find("li.active").prev("li").removeClass("sib");$(this).prev("li").addClass("sib");currentSlide=i;nextSlide(ele,config);});});var nextSlide=function(ele,config){clearTimeout(_timeout);var currentID=ele.id;var currentPage=slides[currentSlide];$(ele).find("li.active").removeClass("active");pageLinks.find("li:eq("+currentSlide+")").addClass("active");$(currentPage).fadeIn('slow').siblings().not(":hidden").fadeOut('slow');if(currentSlide==(maxSlides-1)){currentSlide=0;countLoop++;}
else{currentSlide++;}
if((countLoop<config["loops"])&&(config["loops"]>0)){_timeout=setTimeout(function(){nextSlide(ele,config)},config["delay"]);}}
if((config["loops"]>0)){_timeout=setTimeout(function(){nextSlide(ele,config)},config["delay"]);}},slideshow:function(ele,config){var navlinks=$(ele).find(".ss_nav li a");ilast=parseInt(navlinks.not("[rel='p']").not("[rel='n']").slice(-1).attr("rel"));navlinks.click(function(){if(!$(this).hasClass("sel")&&!$(this).hasClass("dis"))
{idx=this.getAttribute("rel");isel=parseInt(navlinks.filter("[class='sel']").attr("rel"));if(idx=='p'){idx=isel-1;}
else if(idx=='n'){idx=isel+1;}
else{idx=parseInt(idx);}
navlinks.eq(isel).removeClass("sel");navlinks.eq(idx).addClass("sel");if(idx==1){navlinks.filter("[rel='p']").addClass("dis");}
else if(idx==ilast){navlinks.filter("[rel='n']").addClass("dis");}
if(isel==1){navlinks.filter("[rel='p']").removeClass("dis");}
else if(isel==ilast){navlinks.filter("[rel='n']").removeClass("dis");}
slidelist=navlinks.eq(1).parents("ul.ss_nav").siblings("ul.ss_slide").find("li");slidelist.eq(isel-1).removeClass("sel");slidelist.eq(idx-1).addClass("sel");}
return false;});}}
jQuery.fn.dpl=jQuery.dpl.init;
new function(settings){var $separator=settings.separator||'&';var $spaces=settings.spaces===false?false:true;var $suffix=settings.suffix===false?'':'[]';jQuery.query=new function(){var queryObject=function(a){var self=this;self.keys={};if(a.queryObject){jQuery.each(a.keys,function(key,val){self.destructiveSet(key,val);});}else{var q=""+a;q=q.replace(/^\?/,'');q=q.replace(/[;&]$/,'');if($spaces)q=q.replace('+',' ');jQuery.each(q.split(/[&;]/),function(){var key=this.split('=')[0];var val=this.split('=')[1];var temp,hashKey=null,type=null;if(/^-?[0-9]+\.[0-9]+$/.test(val))
val=parseFloat(val);else if(/^-?[0-9]+$/.test(val))
val=parseInt(val);if(/\[([^\] ]+)\]$/.test(key))
type=Object,hashkey=key.replace(/^.+\[([^\] ]+)\]$/,"$1"),key=key.replace(/\[([^\] ]+)\]$/,"");else if(/\[\]$/.test(key))
type=Array,key=key.replace(/\[\]$/,"");val=val||true;if(!type&&self.has(key))
type=Array,self.destructiveSet(key,self.has(key,Array)?self.keys[key]:[self.keys[key]]);if(!type)
self.destructiveSet(key,val);else
if(type==Object)
temp=self.keys[key]||{},temp[hashkey]=val,self.destructiveSet(key,temp);else if(type==Array)
temp=self.keys[key]||[],temp.push(val),self.destructiveSet(key,temp);});}
return self;};queryObject.prototype={queryObject:true,has:function(key,type){var keys=this.keys;return!!type?keys[key]!=undefined&&keys[key]!==null&&keys[key].constructor==type:keys[key]!=undefined&&keys[key]!==null;},get:function(key){var value=(key==undefined)?this.keys:this.keys[key];if(value.constructor==Array)
return value.slice(0);else if(value.constructor==Object)
return jQuery.extend({},value);else
return value;},destructiveSet:function(key,val){if(val==undefined||val===null)
this.destructiveRemove(key);else
this.keys[key]=val;return this;},set:function(key,val){return this.copy().destructiveSet(key,val);},destructiveRemove:function(key){if(typeof this.keys[key]!='undefined')
delete this.keys[key];return this;},remove:function(key){return this.copy().destructiveRemove(key);},destructiveEmpty:function(){var self=this;jQuery.each(self.keys,function(key,value){delete self.keys[key];});return self;},copy:function(){return new queryObject(this);},empty:function(destructive){return this.copy().destructiveEmpty();},toString:function(){var i=0,queryString=[],self=this,addFields=function(o,key,value){o.push(key);if(value!==true){o.push("=");o.push(encodeURIComponent(value));}};jQuery.each(this.keys,function(key,value){var o=[];if(value!==false){if(i++==0)
o.push("?");if(self.has(key,Object)){var _o=[]
jQuery.each(value,function(_key,_value){var __o=[];addFields(__o,key+"["+_key+"]",_value);_o.push(__o.join(""));});o.push(_o.join($separator));}else if(self.has(key,Array)){var _o=[]
jQuery.each(value,function(_key,_value){var __o=[];addFields(__o,key+$suffix,_value);_o.push(__o.join(""));});o.push(_o.join($separator));}else{addFields(o,key,value);}}
queryString.push(o.join(""));});return queryString.join($separator);}};return new queryObject(location.search);};}(jQuery.query||{});
jQuery.extend({onElementReady:function(query,callBack,timeoutValue,pollInterval){var _pollInterval=pollInterval||100;var _timeoutValue=timeoutValue||8500;var elementPoll=null;var elementTimeout=null;var endPolling=function(condition,element,callback){if(condition&&($(element).siblings().length>0||$(element).text().length>0)){clearInterval(elementPoll);clearTimeout(elementTimeout);elementPoll=null;elementTimeout=null;if(callBack)callBack();}}
elementPoll=setInterval(function(){var element=$(query)[0];endPolling(element!==undefined,element,callBack);},_pollInterval);elementTimeout=setTimeout(function(){var element=$(query)[0];endPolling(element===undefined,element);},_timeoutValue);}});

if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

