var _____WB$wombat$assign$function_____=function(name){return (globalThis._wb_wombat && globalThis._wb_wombat.local_init && globalThis._wb_wombat.local_init(name))||globalThis[name];};if(!globalThis.__WB_pmw){globalThis.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
let window = _____WB$wombat$assign$function_____("window");
let self = _____WB$wombat$assign$function_____("self");
let document = _____WB$wombat$assign$function_____("document");
let location = _____WB$wombat$assign$function_____("location");
let top = _____WB$wombat$assign$function_____("top");
let parent = _____WB$wombat$assign$function_____("parent");
let frames = _____WB$wombat$assign$function_____("frames");
let opener = _____WB$wombat$assign$function_____("opener");
function createCookie(name, value, days, domain)
{
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
    }
  else var expires = "";
  var cookieString = name+"="+value+expires+"; path=/";
  if(domain) {
    cookieString += "; domain="+domain;
  } 
  document.cookie = cookieString;
}

function readCookie(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;
}

function eraseCookie(name,domain) {
if(domain) {
	createCookie(name,"",-1,domain);
} else {
	createCookie(name,"",-1);
}
}


// From star tribune code I found in another template
function getCookie(Name){ 
	var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
	if (document.cookie.match(re)) //if cookie found
		return document.cookie.match(re)[0].split("=")[1] //return its value
	return ""
}
function setCookie(name, value){
	document.cookie = name+"="+value
}


 // Define a function that - when called - will invoke the subscription-protected page that checks $cms.subscriptionUser and sets js var AND cookies accordingly.
function setLoginCookies(){
	document.write('<scr'+'ipt language="JavaScript" type="text/javascript" src="https://web.archive.org/web/20100528065950/http://www.startribune.com/templates/determineLoginStatus.js?c=n&r='+Math.random()+'"></scr'+'ipt>');
}

 // If there is a UID cookie (means they should be logged in), but the username cookie not set yet, call setLoginCookies to initialize them
if(readCookie("UID") && !readCookie("username")){
	setLoginCookies();
}

function deleteLoginCookies(){
	eraseCookie("username","startribune.com");
	eraseCookie("startribune_user_auth","startribune.com");
	eraseCookie("RDB","startribune.com");
	eraseCookie("vendor_reg","startribune.com");
	eraseCookie("UID", "www.startribune.com");
	return true;
}

 // If the UID cookie has gone away (means they have logged out), clear out their cookies so that they'll be set fresh upon next login
//if(!readCookie("UID") && readCookie("username")){
//	deleteLoginCookies()
//}

}

/*
     FILE ARCHIVED ON 06:59:50 May 28, 2010 AND RETRIEVED FROM THE
     INTERNET ARCHIVE ON 05:18:09 Jul 07, 2026.
     JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.

     ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
     SECTION 108(a)(3)).
*/
/*
playback timings (ms):
  captures_list: 0.337
  exclusion.robots: 0.036
  exclusion.robots.policy: 0.029
  esindex: 0.005
  cdx.remote: 5.914
  LoadShardBlock: 94.602 (3)
  PetaboxLoader3.datanode: 104.371 (4)
  PetaboxLoader3.resolve: 243.542 (2)
  load_resource: 317.088
*/