if(typeof window['__dsns_'] == 'undefined') window['__dsns_'] = {};
(function() {
var ds_namespace = '__dsns_', ds_plugin_name = 'KVAL_WidgetsV1';
window[ds_plugin_name] = function() {
	var Keywords = '50 Cent,Adam Putnam,Adam Sandler,Adam Smith,Addison Taylor,AFC,Akon,Al Franken,Al Green,Al Peterson,Alan Jackson,Alan Zelenka,Alanis Morissette,Albany,Alec Baldwin,Alex Gardner,Alfred Hitchcock,Alice Cooper,Alicia Keys,Alison Krauss,Alsea,Alvadore,Amy Klobuchar,Amy Winehouse,Anderson Cooper,Andrea Ortiz,Andy Dick,Andy Olson,Andy Williams,Angelina Jolie,Anna Eshoo,Anna Nicole Smith,Antonio Banderas,Aretha Franklin,Arlen Specter,Arnie Roblan,Arnold Schwarzenegger,Arrianee LeBeau,Ashlee Simpson,Ashley Judd,Ashley Tisdale,Ashton Kutcher,Audrey Hepburn,Avril Lavigne,Barack Obama,Barbara Boxer,Barbara Lee,Barbara Mikulski,Barney Frank,Barry Manilow,Bart Gordon,Baseball,Basketball,Ben Nelson,Ben Stiller,Bennie Thompson,Bernie Mac,Bette Midler,Betty Taylor,Beverly Perdue,Beyonce Knowles,Bill Cosby,Bill Dwyer,Bill Fleenor,Bill Maher,Bill Morrisette,Bill Nelson,Bill Richardson,Bill Ritter,Bill Young,Billie Holiday,Billy Joel,Billy Ray Cyrus,Birdman,Bjork,Blachly,Blake Shelton,Blanche Lincoln,Blodgett,Blue River,Bob Casey,Bob Corker,Bob Dylan,Bob Marley,Bob Newhart,Bob Riley,Bob Seger,Bobby Brown,Bobby Jindal,Bobby Rush,Bow Wow,Bowling,Boxing,Brad Ellsworth,Brad Henry,Brad Miller,Brad Paisley,Brad Pitt,Bret Michaels,Brian Elder,Brian Schweitzer,Britney Spears,Brooke Burke,Brownsville,Bruce Hanna,Bruce Lee,Bruce Springsteen,Buddy Holly,Busta Rhymes,Butch Otter,Byron Dorgan,Cali Bagby,Cameron Diaz,Candice Miller,Carl Levin,Carlos Gutierrez,Carlos Santana,Carmen Electra,Carol Burnett,Carrie Underwood,Cascadia,Cassie,Celine Dion,Channing Tatum,Charles Manson,Charlie Brown,Charlie Chaplin,Charlie Crist,Charlie Rangel,Charlie Sheen,Charlie Wilson,Charlize Theron,Cheshire,Chet Culver,Chevy Chase,Chris Botti,Chris Brown,Chris Cole,Chris Cornell,Chris Dodd,Chris Edwards,Chris Gregoire,Chris Lee,Chris Pryor,Chris Rock,Chris Smith,Chris Van Hollen,Christian Bale,Christie Brinkley,Christina Aguilera,Christine Lundberg,Chuck Berry,Chuck Grassley,Chuck Norris,Chuck Schumer,Chuck Wicks,Ciara,Claire McCaskill,Clay Aiken,Clint Eastwood,Condoleezza Rice,Corvallis,Cottage Grove,Courtney Love,Craig Ferguson,Creswell,Cricket,Cycling,Dakota Fanning,Dana Rohrabacher,Dane Cook,D\'Angelo,Daniel Inouye,Danny Kaye,Darius Rucker,Darrell Issa,Dave Matthews,Dave Ralston,David Archuleta,David Beckham,David Bowie,David Foster,David Letterman,David Price,David Robinson,David Scott,David Vitter,David Walker,Deadwood,Dean Martin,Debbie Stabenow,Demi Moore,Denae D\'Arcy,Denise Richards,Dennis Kucinich,Dennis Quaid,Dennis Rodman,Denzel Washington,Deval Patrick,Dexter,Diana Ross,Diane Lane,Dianne Feinstein,Dick Cheney,Dick Durbin,Dick Van Dyke,Diddy,Dinah Shore,Dirk Weishaar,DMX,Dolly Parton,Don Young,Dorena,Dr. Dre,Drew Barrymore,Drew Carey,Duke Ellington,Duncan Hunter,Dutch Ruppersberger,Earl Pomeroy,Ed Rendell,Eddie Murphy,Eddy Arnold,Edolphus Towns,Elaine Chao,Elijah Cummings,Elissa Harrington,Elizabeth Dole,Elizabeth Hurley,Elizabeth Taylor,Ella Fitzgerald,Ellen DeGeneres,Ellen Tauscher,Elmira,Elton John,Elvis Presley,Eminem,Emma Watson,Eric Cantor,Eric Clapton,Etta James,Eugene,Eva Longoria,Eva Mendes,Evan Bayh,Events,Faith Hill,Fall Creek,Faye Stewart,Fergie,Florence,Floyd Prozanski,Football,Foster,Frank Lautenberg,Frank Lucas,Frank Morse,Frank Sinatra,Fred Thompson,Garth Brooks,Gene Autry,Gene Taylor,George Brown,George Bush,George Clooney,George Harrison,George Jones,George Lopez,George Michael,George Miller,George Poling,George Strait,Gerard Butler,Golf,Gordon Smith,Grace Kelly,Greg Walden,Gwen Stefani,Gwyneth Paltrow,Gymnastics,Haley Barbour,Halle Berry,Halsey,Hank Williams,Harold Ford,Harrisburg,Harrison Ford,Harry Reid,Hayden Panettiere,Heath Ledger,Heath Shuler,Heather Wilson,Heidi Klum,Henry Waxman,Hilary Duff,Hilda Solis,Hillary Clinton,Hockey,Howard Stern,Hugh Jackman,Hulk Hogan,Ice Cube,Ike Skelton,Jack Benny,Jack Black,Jack Johnson,Jack Kevorkian,Jack Kingston,Jack Markell,Jack Nicholson,Jack Reed,Jackson Browne,Jade Goody,James Blunt,James Brown,James Dean,James Franco,James Taylor,Jamie Foxx,Jane Harman,Janet Jackson,Janet Napolitano,Janis Joplin,Jared Polis,Jason Aldean,Jason Mraz,Jay Leno,Jay Nixon,Jay Rockefeller,Jay-Z,Jeanne Shaheen,Jeff Kruse,Jeff Merkley,Jeff Miller,Jeff Sessions,Jennifer Aniston,Jennifer Garner,Jennifer Granholm,Jennifer Hudson,Jennifer Lopez,Jennifer Solomon,Jennifer Winters,Jerry Lewis,Jerry Moran,Jerry Springer,Jesse Jackson,Jessica Alba,Jessica Biel,Jessica Simpson,Jim Bunning,Jim Carrey,Jim Doyle,Jim Gibbons,Jim Himes,Jim Jones,Jim Morrison,Jim Webb,Jimi Hendrix,Jimmy Buffett,Jimmy Fallon,Jimmy Kimmel,Joan Collins,Joan Jett,Joanne Verger,Joaquin Phoenix,Jodie Foster,Joe Biden,Joe Manchin,Joe Pishioneri,Joe Sestak,Joe Wilson,John Baldacci,John Boehner,John Campbell,John Conyers,John Cornyn,John Denver,John Dingell,John Edwards,John Hall,John Kerry,John Larson,John Legend,John Lennon,John Lynch,John Mayer,John McCain,John Peterson,John Ruiz,John Sullivan,John Tierney,John Travolta,John Warner,John Wayne,Johnny Carson,Johnny Cash,Johnny Depp,Johnny Isakson,Jon Kyl,Jon Stewart,Jordin Sparks,Josh Groban,Josh Hartnett,Judge Judy,Judy Garland,Julia Roberts,Junction City,Justin Timberlake,Kanye West,Karate,Kate Beckinsale,Kate Hudson,Kate Moss,Kate Winslet,Katherine Heigl,Kathleen Sebelius,Kathy Griffin,Kathy Ireland,Katie Couric,Katie Holmes,Katt Williams,Kay Hagan,Keira Knightley,Keith Ellison,Keith Urban,Kellie Pickler,Kelly Clarkson,Kelly Ripa,Ken Salazar,Kenny Chesney,Kenny Rogers,Kevin Costner,Kevin McCarthy,Kid Rock,Kim Kardashian,Kim Quintero,King County,Kirsten Gillibrand,Kit Bond,Kitsap County,Kitty Piercy,Kristen Stewart,Kurt Cobain,Kylie Minogue,Lamar Alexander,Lamar Smith,Larry Craig,Larry the Cable,Laura Rillos,Lauren Conrad,LeAnn Rimes,Lebanon,Leonard Cohen,Leonardo DiCaprio,Lil\' Kim,Lil Wayne,Lily Allen,Lindsay Lohan,Lindsey Graham,Lionel Richie,Lisa Murkowski,LL Cool J,Lorane,Louis Armstrong,Lowell,Lucille Ball,Ludacris,Lupe Fiasco,Lyons,Madonna,Mandy Moore,Mapleton,Marc Anthony,Marcola,Margaret Spellings,Maria Cantwell,Mariah Carey,Marie Osmond,Marilyn Monroe,Mariska Hargitay,Mark Begich,Mark Furman,Mark Harmon,Mark Pryor,Mark Sanford,Mark Udall,Mark Warner,Marsha Blackburn,Martin Lawrence,Martin O\'Malley,Martina McBride,Marvin Gaye,Mary J. Blige,Mary Landrieu,Mary Tyler Moore,Matt Damon,Max Baucus,Maxine Waters,Meg Ryan,Megan Fox,Mel Gibson,Mel Martinez,Merle Haggard,Meryl Streep,Michael Chertoff,Michael Douglas,Michael J. Fox,Michael Jackson,Michele Bachmann,Michelle Williams,Mickey Rourke,Mike Beebe,Mike Clark,Mike Crapo,Mike Doyle,Mike Huckabee,Mike Pence,Mike Rogers,Mike Simpson,Mila Kunis,Miley Cyrus,Miranda Lambert,Mitch Daniels,Mitch McConnell,Mitt Romney,MLB,MLS,Molly Blancett,Monroe,Morgan Freeman,Nancy Nathanson,Nancy Pelosi,Naomi Campbell,NASCAR,Natalie Portman,Natasha Bedingfield,Natasha Chughtai,NBA,Neil Diamond,Neil Young,Nelly,Ne-Yo,NFC,NFL,NHL,Nick Krupke,Nicole Kidman,Nicole Richie,Norm Coleman,Norm Dicks,Noti,Oakridge,Olympia Snowe,Oprah Winfrey,Orlando Bloom,Orrin Hatch,Ozzy Osbourne,Pamela Anderson,Paris Hilton,Pat Roberts,Patrick Leahy,Patrick Murphy,Patrick Swayze,Patti LaBelle,Patty Duke,Patty Murray,Paul Holvey,Paul McCartney,Paul Newman,Paul Ryan,Paul Simon,Paul Smith,Paula Abdul,Penelope Cruz,Pete Sessions,Pete Sorenson,Pete Stark,Peter DeFazio,Peter Welch,PGA,Phil Barnhart,Phil Collins,Philomath,Pierce County,Pleasant Hill,Queen Latifah,R. Kelly,Rahm Emanuel,Randy Jackson,Randy Travis,Raul Grijalva,Ray Charles,Reba McEntire,Recipes,Red Skelton,Reese Witherspoon,Richard Burr,Richard Gere,Richard Shelby,Rick Larsen,Rick Perry,Ricky Martin,Rob Handy,Robert Byrd,Robin Thicke,Robin Williams,Rod Blagojevich,Rod Stewart,Rodeo,Ron Howard,Ron Paul,Ron Wyden,Ronald Reagan,Roy Orbison,Roy Rogers,Rudy Giuliani,Rugby,Russ Burger,Russ Feingold,Ryan Reynolds,Ryan Seacrest,Salma Hayek,Salvador Dali,Sam Johnson,Samuel L. Jackson,Sandra Bullock,Sara Evans,Sara Gelser,Sarah Jessica Parker,Sarah McLachlan,Sarah Palin,Sarah Silverman,Saxby Chambliss,Scarlett Johansson,Scio,Sean Connery,Sean Penn,Selena,Seth Rogen,Seth Wayne,Shaggy,Shakira,Shania Twain,Shaquille O\'Neal,Sharon Stone,Shedd,Shelley Kurtz,Sherrod Brown,Sheryl Crow,Shirley Temple,Sid Leiken,Silvestre Reyes,Simon Cowell,Skagit County,Skiing,Snohomish County,Snoop Dogg,Snowboarding,Soccer,Softball,Sonny Perdue,Sophia Loren,Springfield,Stephen Johnson,Steve Cohen,Steve Harvey,Steve King,Steve Miller,Steve Young,Stevie Wonder,Susan Collins,Susan Lucci,Sweet Home,Tangent,Taylor Hicks,Taylor Swift,Ted Kennedy,Ted Stevens,Ted Strickland,Tennis,Terri Leezer,Thurston,Thurston County,Tiger Woods,Tim Burton,Tim Freeman,Tim Johnson,Tim Mahoney,Tim McGraw,Tim Pawlenty,Tina Turner,Toby Keith,Tom Adams,Tom Coburn,Tom Cruise,Tom Green,Tom Hanks,Tom Harkin,Tom Jones,Tom Petty,Tom Ward,Tommy Lee,T-Pain,Trace Adkins,Track & Field,Trent Lott,Tyler Perry,Tyra Banks,Usher,Van Morrison,Veneta,Vicki Walker,Vida,Vin Diesel,Vince Gill,Volleyball,Walter Jones,Walter Reed,Walterville,Walton,Wendy Williams,Westfir,Westlake,Whitney Houston,Will Ferrell,Will Smith,WNBA,Woody Allen,Wrestling,WWE,Zac Efron,'.split(','); var qsHTML = '<!--\n<div class="dsnsqs">\n\t<div class="title">\n\t\t<div class="text">Advanced Search</div>\n\t\t<div class="close">&times;</div>\n\t\t<i></i>\n\t</div>\n\t<form action="http://search.kval.com">\n\t<input type="hidden" name="ct" value="r" />\n\t<label for="qscat_\{id\}">Category</label><select id="qscat_\{id\}" rel="20198">\n\t\t\t<option value="">( any category )</option>\n\t\t\t<option value="90000062">Local &amp; Regional</option>\n\t\t\t<option value="89000012">National &amp; World</option>\n\t\t\t<option value="89000040">Business</option>\n\t\t\t<option value="89000028">Technology</option>\n\t\t\t<option value="90000060">Consumer</option>\n\t\t\t<option value="90000061">Health</option>\n\t\t\t<option value="20249945">Sports</option>\n\t\t\t<option value="20249924">Entertainment</option>\n\t\t\t<option value="112000013">YouNews</option>\n\t\t</select><i></i>\n\t<label for="qsfeat_\{id\}">When</label><select id="qsdate_\{id\}" rel="r.STRDAT">\n\t\t\t<option value="">( anytime )</option>\n\t\t\t<option value="0">Today</option>\n\t\t\t<option value="7">Past 7 Days</option>\n\t\t\t<option value="30">Past 30 Days</option>\n\t\t\t<option value="365">Past 12 Months</option>\n\t\t</select><i></i>\n\t<label for="qscity_\{id\}">City</label><select id="qscity_\{id\}" rel="361">\n\t\t\t<option value="">( any city )</option>\n\t\t\t<option value="83619" rel="1684">Eugene</option>\n\t\t\t<option value="108704" rel="1684">Springfield</option>\n\t\t\t<option value="79791" rel="286">Corvallis</option>\n\t\t\t<option value="90414" rel="1684">Junction City</option>\n\t\t\t<option value="71809" rel="1575">Albany</option>\n\t\t\t<option value="84561" rel="1684">Florence</option>\n\t\t\t<option value="79833" rel="1684">Cottage Grove</option>\n\t\t\t<option value="113299" rel="1684">Veneta</option>\n\t\t</select><i></i>\n\t<label for="qscnty_\{id\}">County</label><select id="qscnty_\{id\}" rel="6">\n\t\t\t<option value="">( any county )</option>\n\t\t\t<option value="1684">Lane</option>\n\t\t\t<option value="286">Benton</option>\n\t\t\t<option value="1575">Linn</option>\n\t\t</select><i></i>\n\t<label for="qstext">Keywords</label><input class="qstext" name="q" /><i></i>\n\t<input type="submit" class="normalbutton" value="Search" /><i></i>\n\t</form>\n</div>\n-->'; var lfHTML = '<div id="dsnslocalnews"><!--\n\t<div class="title"><a href="http://community_link/">community_name News</a></div>\n\t<a class="pickcommunity" href="#pickcommunity">Change your community</a>\n\t<ul>\n\t\t<li class="first"><a href="http://first_link/"><div class="localimg"><img src="http://the_image/" alt="first_title"/></div>first_title</a></li>\n\t\t<li class="second"><a href="http://second_link/">second_title</a></li>\n\t\t<li class="third"><a href="http://third_link/">third_title</a></li>\n\t\t<li class="fourth"><a href="http://fourth_link/">fourth_title</a></li>\n\t\t<li class="fifth"><a href="http://fifth_link/">fifth_title</a></li>\n\t</ul>\n--></div>\n<div id="dsnslocalnews2" style="display:none"><!--\n\t<div class="head">\n\t\t<div class="text">WHERE YOU LIVE</div>\n\t\t<div class="edit"><a href="#pickcommunity">EDIT</a></div>\n\t</div>\n\t<div class="title">\n\t\t<a href="http://community_link/">community_name News</a>\n\t</div>\n\t<ul>\n\t\t<li class="first"><a href="http://first_link/"><div class="localimg"><img src="http://the_image/" alt="first_title"/></div>first_title</a></li>\n\t\t<li class="second"><a href="http://second_link/">second_title</a></li>\n\t\t<li class="third"><a href="http://third_link/">third_title</a></li>\n\t</ul>\n--></div>\n<div class="bottom_links" id="dsnslocallinks"><ul>\n\t<li><a href="http://community_link/" class="morenews">More community_name News</a><br /></li>\n\t<li><a href="http://community_link/business-directory" class="morenews rantsandraves">Local Businesses</a></li>\n</ul></div>\n<div class="bottom_links" id="dsnslocallinks2" style="display:none"><a href="http://community_link/" class="morenews">More News</a> | <a href="http://community_link/business-directory" class="morenews rantsandraves">Local Businesses</a></div>\n<div id="dsnsOverlay">&nbsp;</div>\n<div id="dsnsLfPopup">\n\t<div class="topHead">\n\t\t<h1>Choose your neighborhood</h1>\n\t\t<div class="subHead">Tell us where you live and get your community headlines along with your local, breaking news.</div>\n\t\t<div class="closeButton"><a href="#close">close window</a></div>\n\t</div>\n\t<div class="mainHoodContent">\n\t\t<div class="introText">Choose the neighborhood closest to you. If you don\'t see your neighborhood, <a href="http://www.kval.com/about/contact">let us know</a>! We\'ll be adding more neighborhoods soon!</div>\n\t\t<div class="box">\n\t\t\t<div class="column">\n\t\t\t\t<ul>\n\t\t\t\t\t<li><a href="#albany" title="Albany News">Albany</a></li>\n\t\t\t\t\t<li><a href="#bethel" title="Bethel News">Bethel/Danebo</a></li>\n\t\t\t\t\t<li><a href="#churchill" title="Churchill News">Churchill</a></li>\n\t\t\t\t\t<li><a href="#downtowneugene" title="Downtown Eugene News">Downtown Eugene</a></li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="box">\n\t\t\t<div class="column">\n\t\t\t\t<ul>\n\t\t\t\t\t<li><a href="#corvallis" title="Corvallis News">Corvallis</a></li>\n\t\t\t\t\t<li><a href="#florence" title="Florence News">Florence</a></li>\n\t\t\t\t\t<li><a href="#junctioncity" title="Junction City News">Junction City</a></li>\n\t\t\t\t\t<li><a href="#oakridge" title="Oakridge News">Oakridge</a></li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="box">\n\t\t\t<div class="column">\n\t\t\t\t<ul>\n\t\t\t\t\t <li><a href="#riverroadsantaclara" title="River Road Santa Clara News">River Road/Santa Clara</a></li>\n\t\t\t\t\t <li><a href="#sheldon" title="Sheldon News">Sheldon</a></li>\n\t\t\t\t\t <li><a href="#southeugene" title="South Eugene News">South Eugene</a></li>\n\t\t\t\t\t<li><a href="#southlane" title="South Lane News">South Lane</a></li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="box">\n\t\t\t<div class="column">\n\t\t\t\t<ul>\n\t\t\t\t\t<li><a href="#springfield" title="Springfield News">Springfield</a></li>\n\t\t\t\t\t<li><a href="#thurston" title="Thurston News">Thurston</a></li>\n\t\t\t\t\t<li><a href="#university" title="University News">University</a></li>\n\t\t\t\t\t<li><a href="#veneta" title="Veneta News">Veneta</a></li>\n\t\t\t\t\t<li><a href="#whiteaker" title="Whiteaker News">Whiteaker</a></li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div class="popupBottom">\n\t\t<div class="logo">KVAL.com</div>\n\t</div>\n</div>'; var lbHTML = '<div class="sponsor">\n\t<a href="the_link"><img src="the_img" /></a>\n\t<div class="text">\n\t\t<span class="title">Community Sponsor</span><br/>\n\t\t<a class="name" href="the_link">the_title</a>\n\t</div>\n\t<div style="clear:both;"></div>\n</div>';
	var plugin_name = ds_plugin_name;
	var Load = function() {
		if(typeof window[ds_namespace] != "object")
			window[ds_namespace] = {};
		if(typeof window[ds_namespace].OnInit != "undefined") {
			if(window[ds_namespace].Initialized) {
				window[ds_plugin_name].Init(window[ds_namespace]);
				if(window[ds_namespace].IsReady)
					window[ds_plugin_name].Ready(window[ds_namespace]);
				else
					window[ds_namespace].OnReady.push(window[ds_plugin_name].Ready);
			}
			else {
				window[ds_namespace].OnInit.push(window[ds_plugin_name].Init);
			}
			return;
		}
		
		if(typeof window[ds_namespace].$ == "function") {
			window[ds_plugin_name].$ = window[ds_namespace].$;
			window[ds_plugin_name].Init();
			return;
		}
		if(typeof window[ds_plugin_name].$ == "function") {
			window[ds_plugin_name].Init();
			return;
		}
 
		if(typeof jQuery == "function" && (jQuery.fn.jquery >= '1.3.2')) {
			window[ds_plugin_name].$ = jQuery;
			window[ds_plugin_name].Init();
			return;
		}
		
		var el = document.createElement('SCRIPT');
		el.setAttribute('language', 'JavaScript');
		el.setAttribute('src', 'http://cdn.secondspace.com/news/jquery.1.4.2.js');
		document.getElementsByTagName('head')[0].appendChild(el);
		WaitForInit(1000);
	}
		
	var WaitForInit = function(max) {
		if(!max) max = 200;
		if(typeof window[ds_namespace].$ != "function") {
			if (max > 0)
				setTimeout(function() { window[ds_plugin_name].WaitForInit(max - 1); }, 200);
			return;
		}
		window[ds_plugin_name].Init();
	}
	var WaitForReady = function(max) {
		if(!max) max = 200;
		if(typeof window[ds_plugin_name].FullyInitialized != 'bool') {
			if (max > 0)
				setTimeout(function() { window[ds_plugin_name].WaitForReady(max - 1); }, 200);
			return;
		}
		window[ds_plugin_name].Ready();
	}
	var WaitForBody = function(max) {
		if(!max) max = 200;
		try {
			document.body.className += ' dsnsjs';
		} catch (e) {
			if (max > 0)
				setTimeout(function() { window[ds_plugin_name].WaitForBody(max - 1); }, 200);
		}
	}
	
	var SetCookie = function(name, value, expires, domain, path) {
		if(!expires) expires = 'Wed, 1 Jan 2020 00:00:00 UTC';
		if(!path) path = '/';
		if(!domain && location.host.indexOf('.') != -1) { // default to topmost domain
			var a = location.host.split('.');
			domain = '.' + a[a.length-2] + '.'+ a[a.length-1];
		}
		document.cookie = name+'='+value+'; expires='+expires+'; domain='+domain+'; path='+path;
	}
	window['__dsns_'].SetCookie = SetCookie;
	
	var GetCookie = function(name) { 
		var nameEQ = name + '=';
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	}
	window['__dsns_'].GetCookie = GetCookie;
	
	var GetCommunityCookie = function() {
		var cc = __dsns_.GetCookie('dsnscomm'), h = window.location.hash;
		if (h.indexOf('overridecommunity')==1) {
			var c = h.split('=')[1];
			if (c != '') cc = c;
		}
		return cc;
	}

	var Init = function(init_host) {
		if(window[ds_plugin_name].Initialized) return;
		window[ds_plugin_name].Initialized = true;
		var $ = window[ds_plugin_name].$;
		if(typeof $ == 'undefined')
		{
			if(init_host && typeof init_host.$ == 'function') // we're a plugin
				$ = window[ds_plugin_name].$ = init_host.$;
			else 
				$ = window[ds_namespace].$;
		}
		if(typeof $ == 'undefined')
			return;
		
		$.ajaxSetup({ cache: true });
		var IE = $.browser.msie;
		var IE6 = IE && /MSIE 6/.test(navigator.userAgent);
		var IE8 = IE && /MSIE 8/.test(navigator.userAgent);
		
		function Bind(sel, ev, func) {$(sel).live(ev, func);}
		function FullQuery(q) {var r = {};if(!q) q = CurrentSearch();if(!q) return new Array(); q = q.replace(/^\?/,'').replace(/\&$/,'');$.each(q.split('&'), function(){r[this.split('=')[0]] = this.split('=')[1];});return r;};
		function CurrentSearch() {var s = GetMetaData($('.searchquery'), location.search);if(!s || s == undefined)return false;return s;}
		function GetMetaData(el, fallback) {el = $(el); if (typeof fallback == 'undefined') fallback = false; if (el.length == 0) return fallback; var h = $.trim(el.html());if (h.length > 6) {if (h.slice(0, 5).toLowerCase() == '<pre>') h = h.slice(5); if (h.slice(0, 4) == '<!--') h = h.slice(4);if (h.slice(-6).toLowerCase() == '</pre>') h = h.slice(0, -6); if (h.slice(-3) == '-->') h = h.slice(0, -3);}return $.trim(h);}
		
		var Autocomplete = function(input) {
var host = $(input);
var cache = new Array();
var pending,popup,seeAllLink,list;
var options = {extraleft:0, extrawidth:0, maxheight:175, extratop:0, altpos:false, host:'BODY', match:'startword'}; // match:all, start, startword

function Render(data, q, c) {
	if(typeof data == 'undefined' || typeof data.suggest == 'undefined')
		return;
	
	list.empty();
	seeAllLink.css({ display: 'none' }).unbind();
	var html1 = new Array();
	var html2 = new Array();
	var html3 = new Array();
	var all = new RegExp(query, 'i');
	var start = new RegExp('^'+query, 'i');
	var startword = new RegExp(' '+query, 'i');
	var count = 0;
	var truncated = false;
	for(var i=0;i<data.suggest.length;i++) {
		var matched = false;
		var s = data.suggest[i].replace( all, function(q) { matched = true; return '<span class="match">' + q + '</span>' });
		if (matched) {
			// test if the cached data is valid
			var l = data.suggest[i].toLowerCase();
			if (typeof q != 'undefined' && typeof c != 'undefined' && l.indexOf(c) != l.indexOf(q))
				return false;
			if(start.test(l))
					html1.push('<li>' + s + '</li>');
			else if(startword.test(l) && options.match == 'startword')
					html2.push('<li>' + s + '</li>');
			else if(options.match == 'all')
					html3.push('<li>' + s + '</li>');
			else
				continue;
			count++;
			if (count > 100 && !seeAll) {
				truncated = true;
				break;
			}
		}			
	}
	if (html1.length + html2.length + html3.length == 0) {
		popup.css({ display: 'none' });
		return true;
	}
	list.append(html1.join('') + html2.join('') + html3.join(''));
	if (truncated) seeAllLink.css({ display: 'inline' }).click(function() { Complete(true); host.focus(); return false; });
	
	var o = host.offset();
	if(options.altpos == '1' || options.altpos == 'true')
		o = host.position();
	else if('' == 'position' && window.location.host.indexOf('search') == 0)
		o = host.position();
	else if('' == 'position' && window.location.host.indexOf('www') == 0)
		o = host.position();
		 
	var d = {height:host.height(), width:host.outerWidth()};
	var top = o.top + d.height + options.extratop + 5;
	var left = o.left + options.extraleft;
	var width = d.width + options.extrawidth - 1;
	popup.css({height:'auto', overflowY:'auto', display:'block', top:top, left:left, width:width});
	if(list.height() > options.maxheight)
		popup.css({height:options.maxheight, overflowY:'scroll'});
	list.find('LI').hover(MouseOver, MouseOut).click(Click);
	popup.scrollTop(0);
	host.focus();
	$(document).click(BodyClick);
	return true;
}
function BodyClick(event) {							
	$(document).unbind('click', BodyClick);
	var target = $(event.target);
	if(target.parents('#AutoComplete_'+id).length == 0)
	{
		popup.css({display:'none'});
		return;
	}

	list = $('#AutoComplete_'+id);				
	if (list == null)
		return;

	var selected = list.find('.mouseover');
	if (selected.length == 0) return;
	host.val(selected.text()).focus();		 
}

function ScrollToView() {
	var selected = list.find('.selected');
	if(selected.length == 0) return;
	var pos = selected.position().top;
	var max = popup.height() - selected.outerHeight();
	if(pos > max)
		popup.scrollTop(popup.scrollTop() + pos - max);
	if(pos < 0)
		popup.scrollTop(popup.scrollTop() + pos);
}
function HandleKey(event) {
	var selected = list.find('.selected');
	var keycode = event.which;
	if(keycode == 9) {
		// if there's only one choice, select it
		if(selected.length > 0 && list.find('LI').length == 1) {
			popup.css({display:'none'});
			host.val(selected.text()+' ').focus();
			return false;
		}
		if(event.shiftKey)
			keycode = 38; // shift+tab = up
		else
			keycode = 40; // tab = down
	}
	switch(keycode) {
		case 13:	// return when item selected, get text
			if(selected.length == 0)
			{				
				return true;
			}
			popup.css({display:'none'});
			host.val(selected.text()).focus();
			return true;
		case 40: // down selects the one below
			if(selected.length == 0) {
				list.find('LI:first').addClass('selected');
				ScrollToView();
				return false;
			}
			var next = selected.removeClass('selected').next();
			if(next.length == 0)
				list.find('LI:first').addClass('selected');
			else
				next.addClass('selected');
			ScrollToView();
			return false;
		case 38: // up selects the one on top
			if(selected.length == 0) {
				list.find('LI:last').addClass('selected');
				ScrollToView();
				return false;
			}
			var prev = selected.removeClass('selected').prev();
			if(prev.length == 0)
				list.find('LI:last').addClass('selected');
			else
				prev.addClass('selected');
			ScrollToView();
			return false;
		case 16: // shift by itself
			return true;
		case 33: //page up
			popup.scrollTop(popup.scrollTop() - popup.height());
			return false;
		case 34: // page down
			popup.scrollTop(popup.scrollTop() + popup.height());
			return false;
		case 27: // esc: disable autocomplete
			popup.css({display:'none'});
			host.attr('autocomplete', 'on');
			host.attr('AutoCompleted', 'false');
			host.unbind('keydown', HandleKey);
			return false;
		default:
			setTimeout(function() {Complete();}, 10);
			return true;
	}
}

function Complete(forceSeeAll) {
	if(!host || !popup || !list) return;
	seeAll = false;
	if (forceSeeAll) seeAll = true;
	var v = host.val();
	if(v.length < 3) {
		popup.css({display:'none'});
		return;
	}
	
	query = v.toLowerCase();
	var p = host.val().substring(0,i);
	prefix = ''
	if(p.length > 0)
		prefix = '<span class="before">'+p+' </span>';

	// check if we have a cache for the the full length down to the first 3 letters
	// if we do, call render and see if it's a valid one
	var cacheKey = query +'';
	var data = false;
	for(var i=query.length;i>2;i--) {
		cacheKey = query.substring(0, i);
		data = cache[cacheKey];
		if (typeof data != 'undefined')
			if(Render(data, query, cacheKey))
				return;
	}
	cacheKey = query + ''; // revert to the full key
	var data = {suggest:new Array()};
	var r = new RegExp(query, 'i');
	data.suggest = $.grep(Keywords, function(n,i) {return r.test(n);} );
	cache[cacheKey] = data;
	Render(data);
	// call the web service
	/*
	var url = "/ws.aspx?key=SUGGEST&q=" + query;
	if (pending) return;
	pending = true;
	setTimeout(function() {pending = false;}, 2000);
	$.getJSON(url,
		function(data){
			cache[cacheKey] = data;
			pending = false;
			Render(data);
		}
	);
	*/
}
function MouseOver() {
	$(this).addClass('mouseover');
}
function MouseOut(event) {
	$(this).removeClass('mouseover');
}
function Click(event) {
	if(!host) return;
	popup.css({display:'none'});
	host.val($(this).text()+' ').focus();
}
function Resized(event) {
	if($(window).width() != savedWidth)
		setTimeout(function() {Complete();}, 10);
	savedWidth = $(window).width();
}
var savedWidth = $(window).width();
$(window).bind('resize', Resized);
			
// look for options
var temp = host.parent().html();
var start = -1;
if(temp) 
	start = temp.indexOf('<!-- autocompleted.options');
if(start > -1) {
	temp = temp.substring(start + 26, temp.indexOf('-->', start))+' ';
	var extraleft = temp.indexOf('extraleft:');
	if(extraleft > -1)
		try {options.extraleft = parseInt(temp.substring(extraleft + 10, temp.indexOf(' ', extraleft + 10)));} catch(err) {}
	var extrawidth = temp.indexOf('extrawidth:');
	if(extrawidth > -1)
		try {options.extrawidth = parseInt(temp.substring(extrawidth + 11, temp.indexOf(' ', extrawidth + 11)));} catch(err) {}
	var extratop = temp.indexOf('extratop:');
	if(extratop > -1)
		try {options.extratop = parseInt(temp.substring(extratop + 9, temp.indexOf(' ', extratop + 9)));} catch(err) {}
	var maxheight = temp.indexOf('maxheight:');
	if(maxheight > -1)
		try {options.maxheight = parseInt(temp.substring(maxheight + 10, temp.indexOf(' ', maxheight + 10)));} catch(err) {}
	var altpos = temp.indexOf('altpos:');
	if(altpos > -1)
		try {options.altpos = temp.substring(maxheight + 10, temp.indexOf(' ', maxheight + 10));} catch(err) {}
	var achost = temp.indexOf('host:');
	if(achost > -1)
		try {options.host = temp.substring(achost + 5, temp.indexOf(' ', achost + 5));} catch(err) {}
	var match = temp.indexOf('match:');
	if(match > -1)
		try {options.match = temp.substring(match + 6, temp.indexOf(' ', match + 6));} catch(err) {}
}
var id = (''+Math.random()).substr(2);
var popupid = '__dsns_autocomplete_'+id;
if(host.data('dsnsAutoCompleted') == 'false')
	return;

if(host.data('dsnsAutoCompleted') == 'true') {
	popup = $('#'+popupid);
	seeAllLink = popup.find('A[href$=#all]');
	list = popup.find('UL');
	return;
}

host.attr('autocomplete', 'off');
host.data('dsnsAutoCompleted', 'true');
host.keydown(HandleKey);
var tmp = $(options.host);
if(tmp.length == 0)
	tmp = $('#loaderhost');
if(tmp.length == 0)
	tmp = $('BODY');
if($('#'+popupid).length == 0)
	tmp.append('<div id="'+popupid+'" class="dsnsAutoComplete"><ul></ul><a href="#all" class="dsnsAutoCompleteSeeAll">See all...</a></div>');

popup = $('#'+popupid);
seeAllLink = popup.find('A[href$=#all]');
list = popup.find('UL');
};  /*
$('#advancedsearch, .dsnsadvsearch A, #header .advanced A, #search .advanced A').live('click', function() {
	var me = $(this);
	var id = me.data('dsns_quicksearch');
	if(!me.data('dsns_quicksearch')) {
		id = (''+Math.random()).substr(2);
		me.data('dsns_quicksearch', id);
	}
	
	var popupid = '__dsns_quicksearch_'+id;
	var popup = $('#'+popupid);

	var tmp = $('#loaderhost');
	if(tmp.length == 0)
		tmp = $('body');
			
	var created = false;
	if(popup.length == 0) {
		popup = $('<div id="'+popupid+'" class="dsnsQuickSearch"></div>').appendTo(tmp);
		popup.html(qsHTML.replace(/\{id\}/ig, id));
		created = true;
	}
	if(me.hasClass('dsnsoffset')) {
		var oft = me.offset();
		var l = oft.left + me.width() - popup.width();
		popup.css({display:'block', top: oft.top + 20, left: l});
	} else {
		var pos = me.position();
		popup.css({display:'block', top: pos.top + me.height(), left: -1000});
		popup.css({left:$('#header').width() - 50});
		if(me.attr('id') == 'advancedsearch') popup.css({top:220, left:380, marginTop:0});
	}
	if(!created) return false;
	
	function BodyClick(event) {							
		var target = $(event.target);
		if (!(target.parents().index(popup) >= 0 || target[0] == popup[0] || target[0].tagName == 'HTML')) {
			popup.css({display:'none'});
			return;
		}
	}
	$(document).mousedown(BodyClick);
	
	function Resized(event) {
		if($(window).width() != savedWidth)
			popup.css({display:'none'});
		savedWidth = $(window).width();
	}
	var savedWidth = $(window).width();
	$(window).bind('resize', Resized);
	
	popup.find('.close').click(function() {
		popup.css({display:'none'});
	});
	
	$('#qscity_' + id).bind('change', function() {
		var me = $(this);
		var city = me.find('OPTION:selected');
		var v = city.val();
		if(v && v.length > 0)
			$('#qscnty_' + id).attr('disabled', true).find('option[value="'+city.attr('rel')+'"]').attr('selected', 'selected');
		else
			$('#qscnty_' + id).attr('disabled', false);
	});
	
	popup.find('FORM').bind('submit', function() {
		var type = '', q = '', date = '';
		var me = $(this);
		q = me.find('.qstext').val();
		
		var cat = $('#qscat_' + id +' OPTION:selected').val();
		if(cat && cat.length > 0)
			type += $('#qscat_'+id).attr('rel') + ',' + cat + ';';
			
		var feat = $('#qsfeat_' + id +' OPTION:selected').val();
		if(feat && feat.length > 0)
			type += $('#qsfeat_'+id).attr('rel') + ',' + feat + ';';
		
		var city = $('#qscity_' + id +' OPTION:selected').val();
		if(city && city.length > 0)
			type += $('#qscity_'+id).attr('rel') + ',' + city + ';';
			
		var cnty = $('#qscnty_' + id +' OPTION:selected').val();
		if(cnty && cnty.length > 0)
			type += $('#qscnty_'+id).attr('rel') + ',' + cnty + ';';
		
		var date = $('#qsdate_' + id +' OPTION:selected').val();
		if(date && date.length > 0) {
			var d = new Date();
			d.setDate(d.getDate() - parseInt(date));
			var day = d.getDate();
			if(day < 10) day = '0'+day;
			var month = d.getMonth() + 1;
			if(month < 10) month = '0'+month;
			date = $('#qsdate_'+id).attr('rel') + '=' + month + '%2f' + day + '%2f' + d.getFullYear() + '%2c';
		}
		
		if(type.length > 0)
			type = type.substr(0, type.length - 1);
		
		var url = 'http://'+window.location.host.replace('www', 'search')+'/default.aspx?ct=r';
		if(q && q.length > 0)
			url += '&q="'+q+'"';
		if(type && type.length > 0)
			url += '&type='+type;
		if(date && date.length > 0)
			url += '&'+date;
		window.location = url;
		return false;
	});
	
	return false;
});
*/ function AddDefaultText(box) {
	if(!box || box.length == 0 || box.data('defaulttext'))
		return;
	box.data('defaulttext', true);
	var t = box.attr('title');
	if (!t || typeof t != 'string')
		t = 'Search';
	box.blur(function() {
		var me = $(this).removeClass('hasfocus').addClass('isblurred');
		var v = me.val();
		if(v == '' || v == t)
			me.val(t);
	}).focus(function() {
		var me = $(this).removeClass('isblurred').addClass('hasfocus');
		var v = me.val();
		if(v == t)
			me.val('');
	});

	var v = box.val();
	if(v == '' || v == t)
		box.addClass('isblurred').val(t);

	var forms = box.parents('form');
	if(forms && forms.length > 0) {
		forms.each(function(n, f) {
			var p = $(f), u = p.attr('action') + '?ct=r&q=';
			p.submit(function() {
				var v = p.find('.autocompleted').val();
				if(v == t) v = '';
				window.location = u + encodeURIComponent(v.replace(/^\s*|\s*$/g,'').replace(/[\s]+/g,' '));
				return false;
			});
		});
	}
}

(function() {
setTimeout(function() {$('.autocompleted').each(function() {AddDefaultText($(this));});}, 10);
setTimeout(function() {$('.autocompleted').each(function() {AddDefaultText($(this));});}, 200);
setTimeout(function() {$('.autocompleted').each(function() {AddDefaultText($(this));});}, 500);
$(function() {$('.autocompleted').each(function() {AddDefaultText($(this));});});
})(); var localFeeds = new Array({"t":"Bethel/Danebo", "u":"http://bethel.kval.com", "k":"bethel", "lp":"/node/", "ip":"/sites/kval.com/files/imagecache/story_image_widget/",  "i": [ {"t":"Man shot 3 times: Twice by police, once in head by self", "n":"254101", "i":"http://media.dtsph.com/sites/kval.com/files/imagecache/story_image_widget/120210da_demo_gun405_0.jpg"},{"t":"Woman accused of stealing $55K from employer, senior party fund", "n":"254109"},{"t":"Cunningham resigns EWEB post", "n":"254072"},{"t":"Man gets life sentence for roommate\\\\'s murder", "n":"254046"},{"t":"\\\\'He was displaying a firearm and appeared to be delusional\\\\'", "n":"254013"} ]},{"t":"Churchill", "u":"http://churchill.kval.com", "k":"churchill", "lp":"/node/", "ip":"/sites/kval.com/files/imagecache/story_image_widget/",  "i": [ {"t":"Dolce: The Divine Cupcake", "n":"254086"},{"t":"Churchill charges past Marist", "n":"254041"},{"t":"Lancer Parent Assoc. meets Feb. 7", "n":"254008"},{"t":"Dolce: Dizzy Dean Doughnuts", "n":"253922"},{"t":"\\\\'I can carry a tune. At least I think I can\\\\'", "n":"253914"} ]},{"t":"Downtown Eugene", "u":"http://downtowneugene.kval.com", "k":"downtowneugene", "lp":"/node/", "ip":"/sites/kval.com/files/imagecache/story_image_widget/",  "i": [ {"t":"Homebrew sales to benefit FOOD for Lane County", "n":"254110"},{"t":"Bolton, former ambassador to UN, in Eugene on April 17", "n":"254066"},{"t":"Inn at the 5th open for business", "n":"254026"},{"t":"Photos with your furry valentine", "n":"253902"},{"t":"Apartments would add 1,200 residents to downtown Eugene", "n":"253898"} ]},{"t":"Junction City", "u":"http://junctioncity.kval.com", "k":"junctioncity", "lp":"/node/", "ip":"/sites/kval.com/files/imagecache/story_image_widget/",  "i": [ {"t":"1 dead in 2-car crash on Hwy 99", "n":"254080", "i":"http://media.dtsph.com/sites/kval.com/files/imagecache/story_image_widget/120210meadowview660_0.jpg"},{"t":"Crash pushes car into path of oncoming school bus", "n":"253971"},{"t":"Police dog tracks down suspect", "n":"253909"},{"t":"Tri-County Chamber dinner and auction March 3", "n":"253822"},{"t":"Chamber After Houses is Feb. 2", "n":"253821"} ]},{"t":"River Road Santa Clara", "u":"http://riverroadsantaclara.kval.com", "k":"riverroadsantaclara", "lp":"/node/", "ip":"/sites/kval.com/files/imagecache/story_image_widget/",  "i": [ {"t":"AARP Tax Aide Program through April 12", "n":"253905"},{"t":"\\\\'Firemen were petting the dogs and everyone was clapping and happy\\\\'", "n":"253830"},{"t":"Fire injures woman, damages home", "n":"253818"},{"t":"Crash on Beltline near River Road", "n":"253816"},{"t":"Students Have Choice of Schools in Eugene 4J", "n":"253707"} ]},{"t":"Sheldon", "u":"http://sheldon.kval.com", "k":"sheldon", "lp":"/node/", "ip":"/sites/kval.com/files/imagecache/story_image_widget/",  "i": [ {"t":"If you build it, they will swim", "n":"254073", "i":"http://media.dtsph.com/sites/kval.com/files/imagecache/story_image_widget/120208chinook405.jpg"},{"t":"Gigantic inflatable human heart at VRC Friday and Saturday", "n":"254056"},{"t":"Neighbors report garage fire", "n":"254053"},{"t":"Churchill charges past Marist", "n":"254041"},{"t":"Car burgled? Call police", "n":"254039"} ]},{"t":"South Eugene", "u":"http://southeugene.kval.com", "k":"southeugene", "lp":"/node/", "ip":"/sites/kval.com/files/imagecache/story_image_widget/",  "i": [ {"t":"What do you know about Dorris Ranch?", "n":"254124", "i":"http://media.dtsph.com/sites/kval.com/files/imagecache/story_image_widget/orchardad.jpg"},{"t":"Student turns setback into opportunity", "n":"254123"},{"t":"\\\\'Collaborations\\\\' dance concert Feb. 23, 24 and 25 at LCC", "n":"254105"},{"t":"Dorris Ranch closed weekdays through fall starting Feb. 20", "n":"254065"},{"t":"Whim yields awards for actor", "n":"254047"} ]},{"t":"Springfield", "u":"http://springfield.kval.com", "k":"springfield", "lp":"/node/", "ip":"/sites/kval.com/files/imagecache/story_image_widget/",  "i": [ {"t":"What do you know about Dorris Ranch?", "n":"254124", "i":"http://media.dtsph.com/sites/kval.com/files/imagecache/story_image_widget/orchardad.jpg"},{"t":"FEMA to flood zone: Government here to help", "n":"254122"},{"t":"Dorris Ranch closed weekdays through fall starting Feb. 20", "n":"254065"},{"t":"Gigantic inflatable human heart at VRC Friday and Saturday", "n":"254056"},{"t":"3 hurt when taxi and truck collide", "n":"254011"} ]},{"t":"Thurston", "u":"http://thurston.kval.com", "k":"thurston", "lp":"/node/", "ip":"/sites/kval.com/files/imagecache/story_image_widget/",  "i": [ {"t":"Woman accused of stealing $55K from employer, senior party fund", "n":"254109", "i":"http://media.dtsph.com/sites/kval.com/files/imagecache/story_image_widget/120210perryman405.jpg"},{"t":"Dorris Ranch closed weekdays through fall starting Feb. 20", "n":"254065"},{"t":"Thurston wins one of 25 Project Ignition grants", "n":"254038"},{"t":"3 hurt when taxi and truck collide", "n":"254011"},{"t":"Vida woman hurt in crash on icy highway", "n":"253972"} ]},{"t":"University", "u":"http://university.kval.com", "k":"university", "lp":"/node/", "ip":"/sites/kval.com/files/imagecache/story_image_widget/",  "i": [ {"t":"What do you know about Dorris Ranch?", "n":"254124", "i":"http://media.dtsph.com/sites/kval.com/files/imagecache/story_image_widget/orchardad.jpg"},{"t":"Student turns setback into opportunity", "n":"254123"},{"t":"\\\\'Collaborations\\\\' dance concert Feb. 23, 24 and 25 at LCC", "n":"254105"},{"t":"Oregon students offer input on search for new University president", "n":"254064"},{"t":"Whim yields awards for actor", "n":"254047"} ]},{"t":"Veneta", "u":"http://veneta.kval.com", "k":"veneta", "lp":"/node/", "ip":"/sites/kval.com/files/imagecache/story_image_widget/",  "i": [ {"t":"\\\\'Lane Fire Authority\\\\' formed", "n":"254052"},{"t":"Garden club meets Saturday", "n":"254043"},{"t":"Man faces attempted murder charge after shots fired in Veneta", "n":"253940"},{"t":"OCF awards $25K to Fern Ridge Service Center", "n":"253904"},{"t":"Have flood damage? Report it", "n":"253712"} ]},{"t":"Whiteaker", "u":"http://whiteaker.kval.com", "k":"whiteaker", "lp":"/node/", "ip":"/sites/kval.com/files/imagecache/story_image_widget/",  "i": [ {"t":"Police: Teen sexually assaulted by stranger with knife", "n":"254119"},{"t":"If you build it, they will swim", "n":"254073"},{"t":"\\\\'Officer Baker\\\\' pleads guilty to impersonating police", "n":"254045"},{"t":"Fire damages building downtown", "n":"254010"},{"t":"New debate: When is medical marijuana \\\\'usable?\\\\'", "n":"253907"} ]},{"t":"Albany", "u":"http://albany.kval.com", "k":"albany", "lp":"/node/", "ip":"/sites/kval.com/files/imagecache/story_image_widget/",  "i": [ {"t":"5 teens accused of assaulting man", "n":"254125", "i":"http://media.dtsph.com/sites/kval.com/files/imagecache/story_image_widget/120210albany_suspects405.jpg"},{"t":"FEMA to flood zone: Government here to help", "n":"254122"},{"t":"Tree line proposed in Albany where car was swept away, killing 2", "n":"254112"},{"t":"Albany duo accused of counterfeiting $100 bills", "n":"254108"},{"t":"\\\\'There\\\\'s no one riding to our rescue with a saddle bag full of money\\\\'", "n":"254079"} ]},{"t":"Corvallis", "u":"http://corvallis.kval.com", "k":"corvallis", "lp":"/node/", "ip":"/sites/kval.com/files/imagecache/story_image_widget/",  "i": [ {"t":"Dad accused of spanking 15 month old son 50 times", "n":"254099", "i":"http://media.dtsph.com/sites/kval.com/files/imagecache/story_image_widget/120210mosieur_brealan405.jpg"},{"t":"FEMA to flood zone: Government here to help", "n":"254122"},{"t":"Oregon bill would require coaches to report abuse", "n":"253899"},{"t":"Police: Wife shot up husband\\\\'s SUV after fight", "n":"253975"},{"t":"Currents carrying Japanese tsunami debris to U.S. West Coast", "n":"254023"} ]},{"t":"Florence", "u":"http://florence.kval.com", "k":"florence", "lp":"/node/", "ip":"/sites/kval.com/files/imagecache/story_image_widget/",  "i": [ {"t":"FEMA to flood zone: Government here to help", "n":"254122", "i":"http://media.dtsph.com/sites/kval.com/files/imagecache/story_image_widget/120210fema_visit405.jpg"},{"t":"Police find otter\\\\'s owner", "n":"254044"},{"t":"Oregon Senate advances marine habitat protections", "n":"254040"},{"t":"Currents carrying Japanese tsunami debris to U.S. West Coast", "n":"254023"},{"t":"Valentine\\\\'s Day activities at aquarium", "n":"253977"} ]},{"t":"Oakridge", "u":"http://oakridge.kval.com", "k":"oakridge", "lp":"/node/", "ip":"/sites/kval.com/files/imagecache/story_image_widget/",  "i": [ {"t":"Winter Carnival at Hoodoo on Feb. 11", "n":"253849", "i":"http://media.dtsph.com/sites/kval.com/files/imagecache/story_image_widget/hoodoo-winter-carnival-poster.jpg"},{"t":"Backyard Orchard Project classes offered in communities across Lane County", "n":"253820"},{"t":"Dutch oven gatherings Feb. 14, March 10", "n":"253814"},{"t":"Community service for dam intruder", "n":"253706"},{"t":"Storm damage closes forest roads", "n":"253613"} ]},{"t":"South Lane", "u":"http://southlane.kval.com", "k":"southlane", "lp":"/node/", "ip":"/sites/kval.com/files/imagecache/story_image_widget/",  "i": [ {"t":"What do you know about Dorris Ranch?", "n":"254124", "i":"http://media.dtsph.com/sites/kval.com/files/imagecache/story_image_widget/orchardad.jpg"},{"t":"Creswell considers closing airport", "n":"254100"},{"t":"Dorris Ranch closed weekdays through fall starting Feb. 20", "n":"254065"},{"t":"Tasty Tuesday: Fleur De Lis", "n":"254012"},{"t":"Deadline for Cottage Grove Voters Pamphlet is Feb. 10", "n":"254007"} ]}); var host = window.location.host.replace('search.', 'www.').replace('.test.datasphere', '').replace('.regisweb', '').replace('dev.', '');
var GetLocationFromGoogleLoader = function(callback) {
	var AjaxGeoLocation = (function() {
		var loading = false;
		var loadGoogleLoader = function() {
			if (!hasGoogleLoader() && !loading) { loading = true; var s = document.createElement('script'); s.src = 'http://www.google.com/jsapi?callback=_google_loader_apiLoaded'; s.type = "text/javascript"; document.getElementsByTagName('head')[0].appendChild(s); }
		};
		var queue = [];
		var addLocationQueue = function(callback) { queue.push(callback); }
		var runLocationQueue = function() {
			if (hasGoogleLoader()) while (queue.length > 0) { var call = queue.pop(); call(); }
		}

		window['_google_loader_apiLoaded'] = function() { runLocationQueue(); }
		var hasGoogleLoader = function() { return (window['google'] && google['loader']); }
		var checkGoogleLoader = function(callback) { if (hasGoogleLoader()) return true; addLocationQueue(callback); loadGoogleLoader(); return false; };
		loadGoogleLoader();
		return { shim: true, type: "ClientLocation", lastPosition: null,
			getCurrentPosition: function(successCallback) {
				var self = this;
				if (!checkGoogleLoader(function() { self.getCurrentPosition(successCallback); })) return;
				if (google.loader.ClientLocation) {
					var cl = google.loader.ClientLocation;
					var position = { latitude: cl.latitude, longitude: cl.longitude, altitude: null, accuracy: 43000, altitudeAccuracy: null, heading: null, velocity: null, timestamp: new Date(),
						address: { city: cl.address.city, country: cl.address.country, country_code: cl.address.country_code, region: cl.address.region }
					};
					successCallback(position);
					this.lastPosition = position;
				} else {
					successCallback(false);
				}
			}
		};
	})();
	AjaxGeoLocation.getCurrentPosition(function(pos) { if(/debugfeeds/ig.test(window.location.href)) window['dsnsloc'] = {'gpos':pos}; if(pos) callback(pos.address.city.toLowerCase()); else callback(false); });
}

var CommunityFromCity = function(city) {
var cities = {'seattle':'ballard', 'eugene':'downtowneugene', 'portland':'beaverton', 'bakersfield':'central', 'boise':'boisebench'};
	return cities[city] || city;
}
var GetLocationFromAdManager = function(callback) {
	var loc = window['__dsns_'].GetCookie('dsnsloc');
	if (loc) callback(CommunityFromCity(loc));
	else callback(false);
}

var GetLocationFromCookie = function(callback) {
	var loc = window['__dsns_'].GetCookie('dsnscomm');
	if (loc) callback(loc);
	else callback(false);
}
var adHider = false;
var HideFlash = function() {
		$('object, embed').each(function() {
				var me = $(this);
				if (me.hasClass('dsnshidden')) return;
				if (me.css('visibility') != 'hidden') {
						me.addClass('dsnshidden').css('visibility','hidden');
				}
		});
		$('iframe').each(function() {
				var me = $(this);
				if(me.data('hiddenflash')) return;
				if(me.css('visibility') != 'hidden') {
						me.data('hiddenflash', true);
						me.css({visibility:'hidden'});
				}
		});
}
var ShowFlash = function() {
		$('object, embed').each(function() {
				var me = $(this);
				if (me.hasClass('dsnshidden'))
						me.removeClass('dsnshidden').css('visibility','visible');
		});
		$('iframe').each(function() {
				var me = $(this);
				if(me.data('hiddenflash'))
						me.css({visibility:'visible'});
						me.data('hiddenflash', false);
		});
}

var AddOverlay = function(needElement) {
	var mask = $('#dsnsOverlay');
	if(window.top != window.self) {
		window.top['__dsns_'].AddOverlay(true);
		return;
	}
	if(mask.length == 0 && needElement)
		mask = $('<div id="dsnsOverlay">&nbsp;</div>').appendTo($('body')).css({display:'none'});
	if(mask.length == 0 || mask.is(':visible'))
		return;
	var w = $(window).width();
	var h = $(window).height();
	var dw = $(document).width();
	var dh = $(document).height();
	if(dh>h)h=dh;
	if(dw>w)w=dw;
	if(IE6 || IE8) w -= 22;
	if(IE6) $('SELECT').css({visibility:'hidden'});
	mask.css({position:'absolute', opacity:.0, backgroundColor:'#333', top:0, left:0, width:w, height:h,display:'block', zIndex:19999, opacity:.4});
	HideFlash();
	adHider = setInterval(function() {HideFlash();}, 500);
	return this;
}
window['__dsns_'].AddOverlay = AddOverlay;

var RemoveOverlay = function(outto) {
	clearInterval(adHider);
	if(outto) {
		var pos = outto.position();
		if(pos.left || pos.top == 0) pos = outto.offset();
		$('#dsnsOverlay').css({height:$(window).height(), backgroundColor:'#5B8CBE'}).animate({opacity:.0, top:pos.top, left:pos.left, width:outto.width(), height:outto.height()}, 500, function() {$(this).hide();ShowFlash();if(IE6) $('SELECT').css({visibility:'visible'});});
	}
	else
		$('#dsnsOverlay').animate({opacity:.0}, 300, function() {$(this).hide();ShowFlash();if(IE6) $('SELECT').css({visibility:'visible'});});
	return this;
}
var tmplBck = false;
var RenderLocalDeals = function(host, tmpl, comm) {
	LocalDealsRendered = true;
	var LocalDealsFound = false;
	host = host || $('#dsnslocaldeals').hide();
	if(tmpl == 'undefined') tmpl = false;
	tmpl = tmpl || tmplBck || GetMetaData(host.hide().html(lfHTML).find('#dsnsbizdir'));
	comm = comm || (window['__dsns_'].LocalFeed?window['__dsns_'].LocalFeed.k:false) || __dsns_.GetCookie('dsnscomm');
	if(!comm) comm = 'all';
	if(!tmplBck) tmplBck = tmpl;
	host.find('.title').text('fetching deals...');
	$.ajax({
		url:'http://content.secondspace.com/kval/ld/'+comm+'.js',
		dataType:'script',
		success:function() {
			if(typeof __dsns_.BusinessFeed != 'object' || __dsns_.BusinessFeed.length < 1) return;
			LocalDealsFound = true;
			host.html(tmpl).find('.business, .smalllist, .biglist').hide();
			var cfg = __dsns_.BusinessFeedConfig;
			var max = 6;
			if(__dsns_.BusinessFeed.length < max) max = __dsns_.BusinessFeed.length;
			var arr = $(__dsns_.BusinessFeed).sort(function(){
					return Math.round(Math.random())-0.5
				}).slice(0,max)
			for(var i=0;i<max&&i<3;i++) {
				var b = $('.business'+(i+1)), x = arr[i];
				x.link = cfg.root + '/' + x.name.replace(/\W+/ig, '_')+'/'+x.id+'.html';
				b.find('.name').html('<a href="'+x.link+'">'+x.name+'</a>');
		
				var k = x.logo.indexOf('http://hlocal.');
				if(k>-1)
					x.logo = x.logo.substr(k);
				else
					x.logo = cfg.imgroot+x.logo;
				k = x.logo.indexOf('http://hlcdn.');
				if(k==-1)
					k = x.logo.indexOf('http://media.');
				if(k>-1)
					x.logo = x.logo.substr(k);
				
				b.find('.thumb').html('<a href="'+x.link+'"><img src="'+x.logo+'" /></a>');
				if(!x.video) b.find('.video').hide();
				else b.find('.video').show().find('A').attr('href', x.link);
				if(!x.coupon) b.find('.coupon').hide();
				else b.find('.coupon .text').show().html('<a href="'+x.link+'?o='+x.oid+'">'+x.coupon+'</a>');
				host.find('.biglist').show();
				b.show();
			}

			//max = 3;
			//if(__dsns_.CouponFeed.length < max) max = __dsns_.CouponFeed.length;
			//arr = $(__dsns_.CouponFeed).sort(function(){
			//		return Math.round(Math.random())-0.5
			 // }).slice(0,max)
 
			for(var i=3;i<max;i++) {
				var b = $('.business'+(i+1)), x = arr[i];
				x.link = cfg.root + '/' + x.name.replace(/\W+/ig, '_')+'/'+x.id+'.html';
				b.find('.name').html('<a href="'+x.link+'">'+x.name+'</a>');
				b.find('.coupon').show().html('<a href="'+x.link+'?o='+x.oid+'">'+x.coupon+'</a>');
				host.find('.smalllist').show();
				b.show();
			}

			var t = 'Local deals';
			if(comm != 'all') {
				t = comm+' deals';
				if(window['__dsns_'].LocalFeed)
					t = window['__dsns_'].LocalFeed.t+' deals';
			}
			host.find('.title').text(t);
			host.find('.change A').click(function() {
				if($('#dsnsLfPopup').length == 0) {
					host.after($('<div/>').hide().html(lfHTML));
				}
				window['__dsns_'].ShowPicker();
				return false;
			});
			host.show();
		}
	});
	setTimeout(function() {if(!LocalDealsFound) RenderLocalDeals(host, tmpl, 'all'); }, 2000);
}
function RenderFeed(source) {
	var dealsHost = $('#dsnslocaldeals');
	window['__dsns_'].LocalFeed = source;
	if(dealsHost && dealsHost.length > 0)
		RenderLocalDeals(dealsHost, dsnsLFHTMLTemplates.deals + '', source.k);

	$('#dsnslocalnews, #dsnslocallinks').hide().find('*').show();
	var newshtml = dsnsLFHTMLTemplates.news + '';
	var linkshtml = dsnsLFHTMLTemplates.links + '';
	newshtml = newshtml.replace(/community_name/ig, source.t);
	newshtml = newshtml.replace(/http:\/\/community_link/ig, source.u);
	linkshtml = linkshtml.replace(/community_name/ig, source.t);
	linkshtml = linkshtml.replace(/http:\/\/community_link/ig, source.u);
	var img = source.i[0].i;

	if (!img || img.length < 1) {
		img = false;
		newshtml = newshtml.replace(/http:\/\/the_image./ig, 'http://cdn.secondspace.com/fshr/blank.gif');
	} else {
		var k = img.indexOf('http://hlocal.');
		if(k>-1)
			img = img.substr(k);
		else
			img = source.u + source.ip + source.i[0].i;
		k = img.indexOf('http://hlcdn.');
		if(k==-1)
			k = img.indexOf('http://media.');
		if(k>-1)
			img = img.substr(k);
				 
		newshtml = newshtml.replace(/http:\/\/the_image./ig, img);
	}

	newshtml = newshtml.replace(/http:\/\/first_link./ig, source.u + source.lp + source.i[0].n);
	newshtml = newshtml.replace(/first_title/ig, source.i[0].t.replace('\'', IE?'\'':'&apos;').replace(/[^\x20-\x7E]/ig, ' '));

	if (source.i.length > 1) {
		newshtml = newshtml.replace(/http:\/\/second_link./ig, source.u + source.lp + source.i[1].n);
		newshtml = newshtml.replace(/second_title/ig, source.i[1].t.replace('\'', IE?'\'':'&apos;').replace(/[^\x20-\x7E]/ig, ' '));
	}
	if (source.i.length > 2) {
		newshtml = newshtml.replace(/http:\/\/third_link./ig, source.u + source.lp + source.i[2].n);
		newshtml = newshtml.replace(/third_title/ig, source.i[2].t.replace('\'', IE?'\'':'&apos;').replace(/[^\x20-\x7E]/ig, ' '));
	}
	if (source.i.length > 3) {
		newshtml = newshtml.replace(/http:\/\/fourth_link./ig, source.u + source.lp + source.i[3].n);
		newshtml = newshtml.replace(/fourth_title/ig, source.i[3].t.replace('\'', IE?'\'':'&apos;').replace(/[^\x20-\x7E]/ig, ' '));
	}
	if (source.i.length > 4) {
		newshtml = newshtml.replace(/http:\/\/fifth_link./ig, source.u + source.lp + source.i[4].n);
		newshtml = newshtml.replace(/fifth_title/ig, source.i[4].t.replace('\'', IE?'\'':'&apos;').replace(/[^\x20-\x7E]/ig, ' '));
	}

	$('#dsnslocalnews').html(newshtml);
	$('#dsnslocallinks').html(linkshtml);
	if(window.top != window.self)
		$('#dsnslocalnews A, #dsnslocallinks A').attr('target', '_top');
		
	if (source.i.length < 2) $('#dsnslocalnews .second').hide();
	if (source.i.length < 3) $('#dsnslocalnews .third').hide();
	if (source.i.length < 4) $('#dsnslocalnews .fourth').hide();
	if (source.i.length < 5) $('#dsnslocalnews .fifth').hide();
	if(img) $('#dsnslocalnews .localimg').show();
	$('#dsnslocalnews, #dsnslocallinks').show();
}
window['__dsns_'].RenderFeed = RenderFeed;

function GetDefault() {
	if('downtowneugene'.length > 0) return 'downtowneugene';
	var cities = {'www.katu.com':'portland', 'www.kval.com':'eugene', 'www.komonews.com':'seattle', 'www.kionrightnow.com':'monterey', 'www.kcba.com':'monterey', 'www.myfox11.com':'santabarbara', 'www.kcoy.com':'santabarbara', 'www.abc6.com':'warwick', 'www.bakersfieldnow.com':'bakersfield', 'www.kboi2.com':'boise'};
	var pick = cities[host];
	if(pick) return CommunityFromCity(pick);
	return CommunityFromCity('seattle');
}
var dsnsLFHTMLTemplates = {news:'', links:''};
function ShowFeeds(picked) {
	var defcom = GetDefault();
	if (!picked)
		picked = defcom;
	
	var com = false, dcom = false;;
	var communityList = new Array();

	function feedSort(a, b) {
		var A = a.t.charAt(0), B = b.t.charAt(0);
		return A > B ? 1 : A < B ? -1 : 0;
	}
	localFeeds.sort(feedSort);

	$.each(localFeeds, function(i, c) {
		if (c.i.length == 0)
			c.i.push({"t":"No News Yet", "n":"0", "i":false});
	});
	if(/debugfeeds/ig.test(window.location.href))
		window['dsnsTemp'] = {localFeeds:localFeeds, defcom:defcom};

	window['__dsns_'].LocalFeeds = localFeeds;
	$.each(localFeeds, function(i, c) {
		if (c.i.length == 0) return true;
		communityList.push('<li><a href="#pick' + i + '">' + c.t + '</a></li>');
		if (c.k == picked) com = c;
		if (c.k == defcom) dcom = c;
	});
	if (!com) com = dcom;
	if (!com || communityList.length == 0) {
		$('#dsnslocal').show();
		return;
	}
	
	lfHTML = lfHTML.replace('<!--', '<pre><!--').replace('-->', '--></pre>').replace('<pre><pre>', '<pre>').replace('</pre></pre>', '</pre>');
	$('#dsnslocal').hide().html(lfHTML);
	dsnsLFHTMLTemplates.news = GetMetaData($('#dsnslocalnews'));
	dsnsLFHTMLTemplates.links = GetMetaData($('#dsnslocallinks'));
	dsnsLFHTMLTemplates.deals = GetMetaData($('#dsnsbizdir'));
	if($('#fin_maincontainer').length > 0) { // new layout
		if($('#dsnslocalnews2').length > 0) dsnsLFHTMLTemplates.news = GetMetaData($('#dsnslocalnews2'));
		if($('#dsnslocallinks2').length > 0) dsnsLFHTMLTemplates.links = GetMetaData($('#dsnslocallinks2'));
	}
	RenderFeed(com);


	$('#dsnspickcommunity').hide().find('UL').html(communityList.join(''));
	$('#dsnspickcommunity UL LI A').live('click', function() {
		$('#dsnspickcommunity').hide();
		var sel = localFeeds[parseInt(/[0-9]+$/.exec($(this).attr('href')))];
		RenderFeed(sel);
		window['__dsns_'].SetCookie('dsnscomm', sel.k);
		return false;
	});

		$('#dsnslocalnews').find('a[href$="pickcommunity"]').live('click', function() {
				setTimeout(function() {ShowPicker();}, 100);
				return false;
		});
		$('#dsnslocallinks a.email').live('click', function() {
			$('#dsnsLfPopup').addClass('email');
				setTimeout(function() {ShowPicker();}, 100);
				return false;
		});
	$('#dsnslocal').show();

	var autoPopup = false;
	if(host == 'www.komonews.com' || host == 'www.kionrightnow.com'	|| host == 'www.kcba.com'	||
		 host == 'www.kcoy.com'	|| host == 'www.myfo11.com' || 'true' == 'true')
		 autoPopup = true;
	if(autoPopup) {
		var c1 = window['__dsns_'].GetCookie('dsnsloc');
		var c2 = window['__dsns_'].GetCookie('dsnscomm');
		var c3 = window['__dsns_'].GetCookie('dsnslfpop');
		var date = new Date();
		if((c1 && !c2 && !c3) || c3 && c3 != '1')
		{
			try {
				if(date.getTime() > parseInt(c3))
				{
					date.setTime(date.getTime()+(30*24*60*60*1000));
					window['__dsns_'].SetCookie('dsnslfpop', '1', date.toGMTString());
					setTimeout(function() {ShowPicker();}, 100);
				}
			} catch(e) {}
		}
		if(!c2 && !c1 && !c3) {
				date.setTime(date.getTime()+(3*24*60*60*1000));
				window['__dsns_'].SetCookie('dsnslfpop', date.getTime());
		}
	}
}
var HidePicker = function(outto) {
	RemoveOverlay(outto);
	$('#dsnsLfPopup, #dsnsLfPopup2').hide();
	if(IE) $('BODY').css({position:''});
}

var ShowPicker = function(target, outto, linkoff) {
		if(window.top != window.self) {
				window.top['__dsns_'].ShowPicker(window.self);
				return;
		}
		var isemail = function() {return $('#dsnsLfPopup').hasClass('email');}
		if(isemail() && !$.isReady || IE && $('#fin_maincontainer').length > 0 && $('#footer').length == 0) {
				setTimeout(function() {ShowPicker(target, outto, linkoff);}, 500);
				return;
		}

	if(!window['__dsns_'].GetCookie('dsnsloc')) {
		var date = new Date();
		date.setTime(date.getTime()+(30*24*60*60*1000));
		window['__dsns_'].SetCookie('dsnslfpop', '1', date.toGMTString());
	}
	if($('#header #dsnsOverlay').length == 0 && $('BODY > #dsnsOverlay').length == 0)
	{
		$('#dsnsOverlay').prependTo($('BODY')).hide();
		$('#dsnsLfPopup').prependTo($('BODY'));
	}
		
	var p = $('#dsnsLfPopup2');
	if(!p || p.length < 1)
		p = $('#dsnsLfPopup');
		
	var t = $('#dsnslocal');
	if(target) { // we need to copy the popup in here
		if(!p || p.length == 0) {
			p = $('<div id="dsnsLfPopup"> </div>').appendTo($('body'));
			p.html($(target.document).find('#dsnsLfPopup').html());
		}
		t = $(target.frameElement);
	}
		
		var showemail = function(animate) {
			p.removeClass('email');
			var th = p.find('.topHead');
			th.find('iframe').remove();
		if (th.find('iframe').length == 0) {
			//var iframe = '<iframe class="nohide" src="http://kenyond-dt/iframe.htm" style="width:630px;height:230px;margin:auto;display:block" frameborder="0" scrolling="no"></iframe>';
			//var iframe = '<iframe class="nohide" src="http://tukwila.komonews.com/newsletter-signup" style="width:430px;height:230px;margin:auto;display:block" frameborder="0" scrolling="no"></iframe>';
			var iframe = '<iframe class="nohide" src="' + t.find('#dsnslocalnews .title a').attr('href') + 'newsletter-signup" style="width:430px;height:225px;margin:auto;display:block" frameborder="0" scrolling="no"></iframe>';
			if (animate) {
				p.find('.mainHoodContent').slideUp();
				p.find('.subHead').slideUp();
				p.find('.topHead').append(iframe).slideDown();
			}
			else 
				p.find('.topHead').append(iframe);
				p.find('.mainHoodContent, .subHead').hide();
		}
		p.find('h1').text('Stay Informed');
		}

		if (isemail()) {
			if (window['__dsns_'].GetCookie('dsnscomm')) showemail();
		}
		else {
			var h = p.find('h1');
			if (h.text() == 'Stay Informed') {
				h.text('Choose your community');
				p.find('iframe').remove();
				p.find('.mainHoodContent, .subHead').show();
			}			
		}	
		
	setTimeout(function() {AddOverlay(target || outto);p.find('A').css({color:''});}, 10);
	p.css({left:-1000,top:-1000}).show();
	var ww = $(window).width();
	var wh = $(window).height();
	var dl = $(document).scrollLeft();
	var dt = $(document).scrollTop();
	var ew = p.width();
	var eh = p.height();
	var left = (ww - ew) / 2 + dl;
	var top = (wh - eh) / 2 + dt;
	if(top < 10) top = 10;
	if(left < 10) left = 10;
	p.css({left:left,top:top});
	if(!p.data('bound')) {
		p.data('bound', true);
		p.find('A[href$=close], .closeButton').click(function() {
			HidePicker();
			return false;
		});
		p.find('.column A').click(function() {
			var href = $(this).attr('href');
			var i = href.indexOf('#'), k=4;
			while(i == -1 && k-- > 0)
			{
				href = decodeURIComponent(href);
				i = href.indexOf('#');
			}
			if(i==-1) {
				HidePicker();
				return false;
			}
			
			n = href.substr(i+1);
			var com = false;
				
			$.each(localFeeds, function(i, c) {
				if (c.k == n) {
					com = c;
					return false;
				}
			});
			if(com) {
				window['__dsns_'].SetCookie('dsnscomm', com.k);
				if(linkoff) {
					window.location = href.substr(0, href.indexOf('#'));
					return false;
				}
								if(typeof window['__dsns_'].selectBusinesses == 'function')
										window['__dsns_'].selectBusinesses();
								if(target) 
										target['__dsns_'].RenderFeed(com);
								else
										RenderFeed(com);
								if (isemail())
									showemail(true);
								else
									HidePicker(target || outto);
						} else
								HidePicker();
						return false;
				});		 
	}
}
window['__dsns_'].ShowPicker = ShowPicker;

var LocalDealsRendered = false;
var ldrmax = 100;
var dealsReady = function() {
	if(LocalDealsRendered) return;
	if ($('#dsnslocaldeals').length == 0 || typeof window['__dsns_'] != 'object') {
		if(ldrmax-- > 0)
			setTimeout(function() { dealsReady(); }, 100);
		return;
	}
	RenderLocalDeals();
}
var localReady = function() {	
	var max = 100;
	if ($('#dsnslocal').length == 0 || typeof window['__dsns_'] != 'object') {
		if(max-- > 0)
			setTimeout(function() { localReady(); }, 100);
		return;
	}
	GetLocationFromCookie(function(city) {
		if (city) ShowFeeds(city);
		else GetLocationFromAdManager(function(city) {
			if (city) ShowFeeds(city);
			else GetLocationFromGoogleLoader(function(city) {
				if (city) ShowFeeds(CommunityFromCity(city));
				else ShowFeeds(false);
			});
		});
	});
}
localReady();dealsReady(); var localBusiness = new Array({'k':'bethel', 'u':'/kval/lb/bethel.js'},{'k':'churchill', 'u':'/kval/lb/churchill.js'},{'k':'downtowneugene', 'u':'/kval/lb/downtowneugene.js'},{'k':'junctioncity', 'u':'/kval/lb/junctioncity.js'},{'k':'riverroadsantaclara', 'u':'/kval/lb/riverroadsantaclara.js'},{'k':'sheldon', 'u':'/kval/lb/sheldon.js'},{'k':'southeugene', 'u':'/kval/lb/southeugene.js'},{'k':'springfield', 'u':'/kval/lb/springfield.js'},{'k':'thurston', 'u':'/kval/lb/thurston.js'},{'k':'university', 'u':'/kval/lb/university.js'},{'k':'veneta', 'u':'/kval/lb/veneta.js'},{'k':'whiteaker', 'u':'/kval/lb/whiteaker.js'},{'k':'albany', 'u':'/kval/lb/albany.js'},{'k':'corvallis', 'u':'/kval/lb/corvallis.js'},{'k':'florence', 'u':'/kval/lb/florence.js'},{'k':'oakridge', 'u':'/kval/lb/oakridge.js'},{'k':'southlane', 'u':'/kval/lb/southlane.js'}); var savedHeight = false;
var HideLocalBiz = function() {
	$('#dsnslocalbiz').css({display:'none'});
	if(!savedHeight) savedHeight = $('#dsnslocallinks').height();
	$('#dsnslocallinks').css({height:'auto'});
}
var bizReady = function() {	
	var max = 100;
	if ($('#dsnslocalbiz').length == 0 || typeof window['__dsns_'] != 'object') {
		if(max == 0) HideLocalBiz();
		if(max-- > 0)
			setTimeout(function() { bizReady (); }, 100);
		return;
	}
	window['__dsns_'].localBusinesses = new Array();
	var FindBiz = function(key) {
		if(typeof window['__dsns_'].localBusinesses != 'object') return false;
		var f = false;
		$.each(window['__dsns_'].localBusinesses, function(i,b)	{
			if(b.k == key) f = b;
			return (f == false);
		});
		return f;
	}
	var FindBizOnCDN = function(key, callback) {
		var found = false;
		if(key) $.each(localBusiness, function(n,v) {
			if(v.k == key) {
if(/debugfeeds/ig.test(window.location.href))	__dsns_.cdnbiz = v;
				$.getScript('http://content.secondspace.com'+v.u, callback);
				found = true;
				return false;
			}
		});
		if(!found) callback();
	}
	var RenderBiz = function(b) {
if(/debugfeeds/ig.test(window.location.href)) __dsns_.biz = b;
		if(!b || b.i.length == 0) {HideLocalBiz();return;}
		var r = Math.floor(Math.random()*b.i.length);
		var x = b.i[r];
		if(savedHeight) $('#dsnslocallinks').css({height:savedHeight});

		var img = x.i;
		var k = img.indexOf('http://hlocal.');
		if(k>-1)
			img = img.substr(k);
		else
			img = b.u+b.ip+img;
		k = img.indexOf('http://hlcdn.');
		if(k==-1)
			k = img.indexOf('http://media.');
		if(k>-1)
			img = img.substr(k);

		$('#dsnslocalbiz').html(lbHTML.replace(/the_title/ig, x.t).replace(/the_link/ig, b.u+b.lp+x.n+'?utm_source=homepage_widget&utm_medium=referral&utm_campaign=na').replace(/the_img/ig, img));

		if($('#fin_maincontainer').length > 0) // new layout
			$('#dsnslocalbiz .oldlayout').hide();
		else
			$('#dsnslocalbiz .newlayout').hide();
		$('#dsnslocalbiz').css({display:'block'});
	}
	window['__dsns_'].selectBusinesses = function() {
		var c = window['__dsns_'].GetCookie('dsnscomm');
		var b = FindBiz(c);
		if(b) {
			RenderBiz(b);
			return;
		}
		FindBizOnCDN(c, function() {
			b = FindBiz(c);
			if(!b) b = FindBiz('downtowneugene');
			if(!b) {
				FindBizOnCDN('downtowneugene', function() {
					b = FindBiz('downtowneugene');
					RenderBiz(b);
				});
				return;
			}
			RenderBiz(b);
		});
	}
	window['__dsns_'].selectBusinesses();
}
bizReady();
		
		var Ready = function(ready_host) {
			if(window[ds_plugin_name].IsReady) return;
			window[ds_plugin_name].IsReady = true;
			if(typeof $ == 'undefined')
			{
				if(ready_host && typeof ready_host.$ == 'function')
					$ = window[ds_plugin_name].$ = ready_host.$;
				else 
					$ = window[ds_namespace].$;
			}
			if(typeof $ == 'undefined')
				return;
			var boxes = $('.autocompleted');
if(IE)
	$(function(){boxes.each(function() {Autocomplete($(this));});});
else
	boxes.each(function() {
		Autocomplete($(this));
	});
if($('#dsnslocalbiz').length == 0) $('#dsnslocallinks').css({height:'auto'}); /* */ 

 /* tracking */
		//remove double tracking
		$('#dsnsLfPopup .widget .trackingmeta').remove();
(function(){for(var p={Type:"",DSC:"",PPID:"",ILocation:"",ISource:"",SFLT:"",name:"",order:"",offer:""},q={Type:"",DSC:"",PPID:"",ILocation:"",ISource:"",SFLT:"",name:"",order:"",offer:""},i={URI:"",UserId:""},l=["a","button"],j="services.datasphere.com",h="",k=0;k<l.length;k++)h.length>0&&(h+=","),h=h+l[k]+".clicktracking ,.clicktracking "+l[k];var r=function(a){var f=[];typeof a==="undefined"&&(a=".meta");$(a).each(function(){f.push(GetMetaData(this))});return f},m=function(){var a="",f;for(f in i)i.hasOwnProperty(f)&& (a.length>0&&(a+=";"),i[f]!==""&&(a=a+f+":"+i[f]));return a},n=function(a){a.slice(0,4)=="<\!--"&&(a=a.slice(4));a.slice(-3)=="--\>"&&(a=a.slice(0,-3));return $.trim(a)},o=function(a,f){for(var b,d=0;d<a.length;){b=a[d].split(";");for(var e=0;e<b.length;){var g=b[e].split(":"),c=g[0],g=window.escape(g.slice(1).join(""));b[e]=c+":"+g;typeof i[c]!="undefined"&&(i[c]=g);c==="TRACKINGDOMAIN"&&(j=window.unescape(g));typeof f[c]=="undefined"?b.splice(e,1):e++}b.length>0?(a[d]=b.join(";"),d++):a.splice(d, 1)} },s=function(){var a=new Image,f="/trackingImage.trk?TYPE=IMPRESSION",b=r(".trackingmeta");o(b,p);var d=2,e;if(i.URI.length===0)i.URI=window.escape(window.location.host+window.location.pathname+window.location.search);var g=m();if(!(j.length<=0))if(f="http://"+j+f,b.join().length>2E3){for(;b.slice(0,d*2).toString().length<2E3;)d*=2;for(var c=d,h=0;h!=b.length;){for(e=b.slice(h,c).toString();e.length<2E3&&c<b.length;){if(e.length+b[c].length<1999)e=e+","+b[c];else break;c++}h=c;c+=d;if(c>b.length)c=b.length;a=new Image; a.src=f+"&sk="+g+"&d="+e} }else e=b.toString(),a.src=f+"&sk="+g+"&d="+e};$(function(){s();j.length>0&&$(h).bind("click",function(){var a="http://"+j+"/trackingImage.trk?TYPE=CLICK",f=new Image,b=$(this).parents(),d="",e=[],g=m(),c="";$(this).is("a")?(c=$(this).text().length>0?window.escape($(this).text()):window.escape($(this).attr("title")),d=d+"ClickElement:Link;LinkText:"+c+";LinkUrl:"+window.escape($(this).attr("href"))):$(this).is("img")&&(d+="ClickElement:image;",$(this).parent().is("a")&&(d= d+"LinkUrl:"+window.escape($(this).parent().attr("href"))));typeof $(this).attr("trackingattrb")!="undefined"&&(d=$(this).attr("trackingattrb"));$(this).siblings(".trackingmeta").length>0&&e.push(n($(this).siblings(".trackingmeta").html()));for(c=0;c<b.length;c++)$(b[c]).attr("trackingattrb")!==null&&typeof $(b[c]).attr("trackingattrb")!=="undefined"&&e.push($(b[c]).attr("trackingattrb")),$(b[c]).siblings(".trackingmeta").length>0&&e.push(n($(b[c]).siblings(".trackingmeta").html()));o(e,q);d=d+";"+ e.join(";");f.src=a+"&sk="+g+"&d="+d})})})(); 
		}
		window[ds_plugin_name].Ready = Ready;
		window[ds_plugin_name].FullyInitialized = true;

		if(init_host)
			init_host.OnReady.push(window[ds_plugin_name].Ready);
		else
			$(function(){window[ds_plugin_name].Ready();});
	}
	Ready = false;
	
	return {
		Load: Load,
		WaitForInit: WaitForInit,
		Init: Init,
		WaitForReady: WaitForReady,
		WaitForBody: WaitForBody,
		Ready: Ready,
		GetCookie: GetCookie,
		SetCookie: SetCookie
	};
}();
//window[ds_plugin_name].WaitForBody();
window[ds_plugin_name].Load();

})();
