/* Document ID: 28644445 */
function HeaderSearchText(){this.default_text="Powered by Bing";this.searching=false;this.timeoutVal=null;this.IEBingBranding=function(){$(".IE #content input.sw_qbox").focus(function(){$(this).css("background-position","0 -937em");$(this).val("");});$(".IE #content input.sw_qbox").blur(function(){$(this).css("background-position","100% 4px");});};this.CreateFocus=function(ctl){ctl.val("");ctl.addClass('sw_qbox').removeClass('sw_qbox_blur');};this.CreateBlur=function(ctl){if(ctl.val().length==0){ctl.val(this.default_text);ctl.addClass('sw_qbox_blur').removeClass('sw_qbox');}};this.CreateClick=function(ctl,evt){if(ctl.val()!=this.default_text){DoSearch(0);}};this.CreateEvents=function(ctl){var searchbox=$(ctl).find('#q');var me=this;if(searchbox){$(searchbox).focus(function(){me.CreateFocus(searchbox)});$(searchbox).blur(function(e){me.CreateBlur(searchbox)});searchbox.blur();}var searchBtn=$(ctl).find(':button');if(searchBtn&&searchbox){$(searchBtn).attr('onclick','');$(searchBtn).click(function(e){me.CreateClick(searchbox,e)});}};this.Initialize=function(){var searchCtl=$('#searchset');if(searchCtl){this.CreateEvents(searchCtl);}}};$(document).ready(function(){var searchTextObject=new HeaderSearchText();searchTextObject.Initialize();searchTextObject.IEBingBranding();});
//END SEARCH
//START Marketplace Pricegrabber code
$(function() {
//check for existence of the pg categories 'mp' from ad package
if(typeof(mp) != 'undefined'){
if(typeof(s_msn.channel) != 'undefined'){
var flyoutSecName = s_msn.channel.replace(/ /g,"_");
flyoutSecName = flyoutSecName.replace(/&/g,"and");
} else {
var flyoutSecName = "s_msn_channel_undefined";
};
var pgTrack = '&pid='+ pd_me.id +'&s='+ flyoutSecName;
var mpto="";
$('#nav-left #pg-featured').removeClass('noshow');
$('#nav-left #pg-menu').removeClass('noshow');
$(function() { $("#pg-menu").hover(function()
{
if($('#shopFlyOutIfrm').length){
clrMPFOTO();
}else{
addMPFO();
}
},function()
{
if($('#shopFlyOutIfrm').length){
setMPFOTO();
}
}
);
});
function addMPFO(){
var mp_mpLinkDiv = $("#pg-menu");
var mp_offset = mp_mpLinkDiv.offset();
var mp_x=mp_offset.left+112;
var mp_y=mp_offset.top-20;
$(document.body).append('');
$('#shopFlyOutIfrm').attr('src', '/id/30987851?pg='+ mp.marketplaceParams + pgTrack);
};
$(function(){
var PriceGrabberMenuItem={};
PriceGrabberMenuItem.Init=function(){
var pgProd={};
pgProd.page_id=mp.marketplaceMenuItem;
pgProd.limit=1;
PriceGrabberMenuItem.GetWS(pgProd);
$("#nav-left #pg-menu").hover(function () {$(this).addClass("active");},function () {$(this).removeClass("active");});
$("#nav-left #pg-menu").append('Deals, Coupons Updated prices on msnbc.com shopping');
};
PriceGrabberMenuItem.GetWS = function(params)
{
var pStr='';
for(var t in params)
{
pStr+=''+t+''+params[t]+'';
};
pStr+='';
var getStr='/proxy/proxy.asmx/GetWSXml?DestinationKey=pricegrabber_api&Passkey=&Parameters='+pStr;
$.get(getStr,PriceGrabberMenuItem.Response);
};
PriceGrabberMenuItem.Response=function(data)
{
t=$(data).find('product').each(PriceGrabberMenuItem.Product);
};
PriceGrabberMenuItem.Product=function(){
var url=$(this).find('url').text()
var title = $.trim($(this).find('title_short').text());
var topcat_id=$(this).find('topcat').attr('id');
var catzero_id=$(this).find('catzero_id').text();
var imgSrc=$(this).find('image_small').text();
var catzero_name =$(this).find('catzero').text();
var cat_zero_name_strip="";
cat_zero_name_strip = catzero_name.replace(/\s/g,"");
cat_zero_name_strip = cat_zero_name_strip.replace(/&/g,"");
cat_zero_name_strip = cat_zero_name_strip.replace(/[aeiouy_]/ig, "");
if(title.length < 1){
title=$.trim($(this).find('title').text());
}
if(title.length > 80){
title= String(title).substring(0,79);
}
var bow = '
';
var img='
'+title+'
';
var link='Compare Prices';
if(title.length==0)
{
title=$(this).find('title').text();
};
$('#pg-featured').css("position","relative");
$('#pg-featured').append(img);
$('#pg-featured').append(bow);
$('#pg-featured').append(link);
if ( $.browser.msie ) { $('#pg-bow').css("margin-left","-30"); }
};
PriceGrabberMenuItem.Init();
});
}else{
$(function () {
$('#nav-left #pg-featured').remove();
$("#nav-left #pg-menu").remove();
});
}
}
);
function remMPFO(){
$("#shopFlyOutIfrm").remove();
};
function clrMPFOTO(){
clearTimeout(mpto);
};
function setMPFOTO(){
if($('#shopFlyOutIfrm').length){
mpto=setTimeout("remMPFO()",1000);
}
};
//END marketplace pricegrabber code
// begin pricegrabber
function returnPGCats()
{
var mpCatList=mp.marketplaceMenuItem+","+mp.marketplaceParams;
return mpCatList;
}