var BensWidget={storeHash:{"1800 contacts":491,"1-800-contacts.com":491,"1-800-flowers.com":258,"1-800-petmeds.com":701,"123inkjets":587,"24-hour fitness":443,"39dollarglasses.com":588,"1st wishes":791,"4inkjets":583,"4inkjets.com":583,"6pm.com":528,"6th ave":462,"abebooks":667,"abt electronics":2,"ac lens":764,"accessorygeeks.com":493,"ace hardware":104,"adidas":576,"adobe":360,"aeropostale":251,"alaska airlines":668,"alienware":478,"allergy buyers club":752,"alloy":401,"altrec":549,"amazon":3,"american eagle":768,"angie's list":801,"apple store":68,"appleseeds":669,"appleseed's":669,"armani exchange":670,"ashford":488,"at&t wireless":354,"audible.com":589,"autopartsgiant.com":806,"auto parts warehouse":590,"autos.com":233,"avenue.com":591,"avon":98,"b.a. mason":592,'babies "r" us':211,"babiesrus":211,"babyage":292,"back to basics toys":593,"backcountry.com":280,"bagsbuy.com":519,"banana republic":541,"bare necessities":702,"barnes & noble":36,"bass pro shops":288,"bath & body works":769,"batteries.com":242,"beach camera":581,"bealls florida":809,"beauty.com":465,"bellacor":810,"best buy":49,"best deal magazines":71,"bike bandit":594,"bike nashbar":183,"birthday express":792,"blair":312,"blinds.com":362,"blindsgalore":672,"blockbuster":111,"bloomingdale's":299,"bluefly":164,"blue nile":270,"boca java":340,"bookcloseouts":817,"borders":194,"boxcovs":113,"boscov's":113,"botanic choice":595,"brecks":516,"breck's":516,"brooks brothers":431,"brookstone":230,"brylane home":495,"budget rent a car":492,"busted tees":515,"buy.com":96,"buycostumes.com":276,"cabelas":766,"cafepress":596,"cambridge soundworks":1159,"camping world":423,"carol wright gifts":755,"carsdirect.com":542,"casual male":705,"celebrate express":790,"chadwick's":675,"charlotte russe":597,"cheap tickets.com":706,"checks in the mail":598,"chefs catalog":676,"chegg.com":821,"cheryl&co.":337,"chico's":546,"circuit city":145,"classiccloseoouts":765,"coastal contacts":496,"coffeeforless.com":823,"collectibles today":600,"collectiblestoday.com":600,"compact appliance":509,"compusa.com":146,"converse":673,"cooking.com":389,"corel":523,"costume express":789,"couture candy":824,"cross":761,"crutchfield":125,"current":708,"david's cookies":551,"deepdiscount.com":315,"delia*s":400,"dell":6,"dell small business":6,"dermadoctor":709,"diamond.com":248,"dick's sporting goods":150,"direct gardening":601,"discount contact lenses.com":602,"discovery store":74,"disneyshopping.com":213,"disneystore.com":213,"domestications":603,"dr jays":678,"dr. leonard's healthcare":604,"drs. foster and smith":710,"drugstore.com":37,"eastbay":147,"eastern mountain sports":367,"ebags":55,"ecampus":781,"ecost":25,"eddie bauer":95,"ediets":606,"ediets.com":606,"endless":407,"enterprise rent-a-car":373,"entertainment book":85,"entirelypets.com":745,"equifax":607,"espn shop":386,"espirit":608,"essentialapparel.com":830,"etnies":556,"etoys":163,"etronics":298,"exofficio":679,"expedia":159,"express":774,"famous footwear":680,"fandango.com":268,"fandango":268,"fannie may":681,"fao schwarz":575,"fashion bug":712,"fathead.com":611,"figleaves":325,"fingerhut":326,"finish line":228,"fogdog sports":79,"folica":585,"foot locker":103,"footsmart":380,"fossil":612,"fragrancenet":713,"fragrancex":613,"fragrancex.com":613,"frames direct":772,"franklin covey":499,"frederick's of hollywood":450,"freshpair":317,"froobi":780,"frys":13,"ftd.com":281,"fujitsu":92,"netphonenow":92,"f.y.e":445,"gamehouse":836,"gamestop":10,"gap":87,"gardener's supply company":714,"gardens alive":614,"geeks.com":26,"gevalia":105,"gnc":352,"godaddy.com":123,"golf galaxy":615,"gourmetgiftbaskets.com":508,"guess":420,"guitar center":616,"gurney's seed & nursery":617,"h&r block":672,"hallmark":385,"hammacher schlemmer":618,"hanes.com":476,"hearthsong":715,"hickory farms":148,"highlights":291,"history channel":779,"home bistro":453,"home decorator's collection":303,"homedecorators.com":303,"home depot":118,"hotels.com":313,"hot topic":533,"hotwire":256,"hp":89,"hsn":59,"ice.com":45,"ichapters.com":844,"indigo":620,"inkgrabber":274,"instawares":622,"international jock":716,"international star registry":623,"irobot":262,"itunes":700,"j&r":11,"jackson & perkins":682,"jc penney":112,"j.crew":54,"jc whitney":424,"jessica london":683,"jet blue":351,"jos. a. bank":220,"journeys":684,"just my size":717,"kansas city steaks":685,"karmaloop":517,"kb toys":39,"king size direct":686,"kmart":75,"kodak":178,"kohl's":130,"lamps plus":290,"lands' end":369,"lane bryant":718,"leapfrog":460,"legal sea foods":624,"lego store":720,"lenovo":91,"lens.com":442,"lensmart":625,"lids.com":415,"life uniform":760,"lillian vernon":722,"limoges":501,"linens 'n things":78,"little giant ladder":626,"lord & taylor":237,"lucky brand jeans":513,"luxury link":627,"macmall":296,"macy's":101,"magazines.com":309,"maidenform":628,"match.com":721,"mcafee":723,"medifast":756,"meijer":555,"michigan bulb":630,"microsoft store":557,"mikasa":293,"mlb.com":724,"miles kimball":747,"modell's":726,"monterey bay clothing":725,"monterey bay clothing company":725,"moosejaw mountaineering":554,"mothernature.com":632,"motorcycle superstore":633,"mrs. fields":727,"music123":634,"musician's friend":446,"musicians friend":446,"my fico":635,"mylife.com, inc.":871,"my wines direct":154,"myleft.com, inc.":871,"nascar superstore":247,"national geographic":579,"nba store":578,"nbc universal store":872,"net10 wireless":636,"netflix":62,"network solutions":511,"new york & company":193,"newegg":53,"newport news":688,"nflshop.com":252,"nike":382,"nutrisystem":729,"office depot":29,"officemax":12,"old navy":236,"omaha steaks":94,"onehanesplace.com":730,"oneida":405,"oneshare":637,"online shoes.com":278,"onsale.com":121,"orbitz":253,"orvis":316,"overnight prints":531,"overstock.com":30,"overtons":689,"pac sun":560,"palm":22,"paragon sports":272,"paul fredrick":56,"payless shoes source":638,"pc connection":124,"performance bicycle":181,"performance bike":181,"perfume emporium":639,"perfume worldwide":762,"personal creations":279,"personalizationmall.com":732,"petcarerx":640,"petco":459,"petfooddirect":294,"petsmart":396,"pfaltzgraff":754,"piperlime":641,"plow & hearth":731,"prescriptives":733,"proflowers":84,"proform":643,"puma":429,"puritan's pride":734,"qwest products":888,"radioshack":15,"rail europe":644,"razorgator.com":558,"redenvelope":330,"reebok":224,"rei":76,"restaurant.com":187,"ritz camera":110,"road runner sports":263,"roaman's":690,"rockport":238,"ross-simons":646,"roxio":645,"sally beauty supply":757,"san francisco music box company":691,"sears":116,"sephora":735,"shoebuy.com":174,"shoemall":565,"shoes.com":244,"shop 4 tech":33,"shopbop":310,"shopnbc":28,"shop pbs":273,"shop.com":305,"shopper's choice":647,"shopperschoice.com":647,"shutterfly":129,"sierra trading post":83,"silhouettes":759,"sirius satellite radio":736,"site59":648,"six flags":649,"skinstore":650,"smartbargains.com":64,"smarthome":151,"smooth fitness":753,"snapfish":182,"soft surroundings":651,"sony style":69,"southwest vacations":577,"spafinder.com":404,"spafinder":404,"spencer's gifts":652,"speigel":692,"springhill nurseries":693,"stacks and stacks":653,"staples":16,"starbucks store":895,"steve madden":510,"strawberrynet":899,"stub hub":654,"stubhub":654,"super warehouse":378,"sur la table":694,"swell":695,"swimsuitsforall.com":902,"symantec netherlands":520,"symantec":520,"szul":107,"target":18,"taylor gifts":321,"teleflora":544,"teva":441,"the great indoors":502,"the children's place":696,"the entertainment book":85,"thenerds.net":470,"the popcorn factory":257,"the company store":655,"the north face":737,"the walking company":657,"the vitamin shoppe":662,"sharper image":72,"sports authority":42,"thinkgeek":552,"thrifty":283,"tigerdirect.com":19,"timberland":102,"tirerack.com":90,"tire rack":90,"tivo":223,"tmobile":403,"tool king":659,"toolking.com":659,"toshiba":212,"toys 'r' us":210,"tradepub":196,"travelocity":208,"trustedid":740,"tumi":910,"turbotax":475,"urban outfitters":770,"vans":438,"verizon":119,"verseo":916,"vision direct":563,"vista print":189,"vitamin world":739,"wal-mart":35,"walgreens":743,"warner bros":777,"webroot":738,"weight watchers":663,"west marine":307,"wet seal":748,"wilson's leather":783,"wine enthusiast":697,"wine.com":327,"wissota trader":664,"woman within":698,"woodwind and brasswind":665,"wynn las vegas":412,"yahoo fantasy footaball":782,"yahoo! personals":793,"yoox":323,"yves rocher":304,"zagg.com":254,"zappos":169,"zazzle":699,"zipzoomfly":131,"zone diet":666,"the zone diet":666},proxyUrl:"/ajax-proxy.php",bensMerUrl:"http://benscoupons.com/merchants_rss.xml/",bensCatUrl:"http://benscoupons.com/category_rss.xml/",bensRecUrl:"http://benscoupons.com/rss_widget.xml",init:function(storeName,divId){BensWidget.storeName=storeName;var tempStoreName=storeName.toLowerCase();BensWidget.divId=divId;if(storeName=="mostrecent"){jQuery.get(BensWidget.proxyUrl,{url:BensWidget.bensRecUrl},function(xmlString){BensWidget.processFeed(xmlString,"mostrecent")})}else{if(BensWidget.storeHash[tempStoreName]==null){BensWidget.abort()}else{jQuery.get(BensWidget.proxyUrl,{url:BensWidget.bensMerUrl+BensWidget.storeHash[tempStoreName]},function(xmlString){BensWidget.processFeed(xmlString)})}}},processFeed:function(xmlString,doctype){var doctype=doctype||"merchant";var jsonObj=jQuery.xml2json(xmlString);var title=jsonObj.channel.title.replace("BensCoupons.com ","");var header_text=(doctype=="mostrecent")?"Hot Coupons":title;var html_table_header='<div class="dotted"><h2>'+header_text+'</h2><table><tr><th class="coupon_column">Coupon</th><th class="expiration_column">Expires</th><th class="code_column">Coupon Code</th></tr>';var html_table_footer="</table></div>";var refer_string="?referrer=Barg";var html_table_content="";var items=[];if(jsonObj.channel.item instanceof Array){items=jsonObj.channel.item}else{items[0]=jsonObj.channel.item}if(items[0].title.indexOf("No")>-1&&items[0].title.indexOf("Headlines")>-1){BensWidget.abort();return }var limit=(doctype=="mostrecent")?8:8;var displayTotal=(items.length<limit)?items.length:limit;var couponsToDisplay=false;if(displayTotal==0){}else{for(var i=0;i<displayTotal;i++){var code=(items[i].codestring)?items[i].codestring:"Click Here";var expDateParts=items[i].expiration.split("/");var expDate=new Date(expDateParts[0],expDateParts[1]-1,expDateParts[2]);var today=new Date();var expMonth=expDate.getMonth()+1;var expDayofMonth=expDate.getDate();var expYear=expDate.getFullYear().toString().replace("20","");var expDateString=expMonth+"/"+expDayofMonth+"/"+expYear;if(today>expDate){if(today.getDate()==expDate.getDate()){expDateString="<span style='color:red;font-weight:bold;'>Today</span>"}else{continue}}couponsToDisplay=true;html_table_content+='<tr><td class="coupon_column"><a href="'+items[i].guid+refer_string+'" target="_blank" rel="nofollow">'+items[i].plaintitle+'</a></td><td class="expiration_column">'+expDateString+'</td><td class="code_column"><strong><a href="'+items[i].guid+refer_string+'" target="_blank" rel="nofollow">'+code+"</a></strong></td></tr>"}if(couponsToDisplay==false){BensWidget.abort();return false}var html_table=html_table_header+html_table_content+html_table_footer;var widgetNode=document.getElementById(BensWidget.divId);var relatedNode=document.getElementById("relatedEntries");if(relatedNode){relatedNode.style.display="none"}widgetNode.innerHTML=html_table;widgetNode.style.display=""}},abort:function(){var node=document.getElementById(BensWidget.divId);node.parentNode.removeChild(node)}}
