// AP2 urchin lib (split for size, as only used in spesh page)

// set stylesheet
function ss(style, style_type)
{
style = check_style(style);
if (style) { bestow_urchin(AP2_urchin, style); alert("The AP2 style urchin has committed '" + style_type + "' to tousle-haired memory. Choose a layout (or reload the page) to see changes."); }
}

// write
function bestow_urchin(urchin, pockets)
{
var urchin_persistence, urchin_mumble;
urchin_persistence = new Date();
urchin_persistence.setTime(urchin_persistence.getTime() + (1000 * 60 * 60 * 24 * 365));
urchin_mumble = find_random_mumble();
t.cookie = urchin + "=" + urchin_mumble + ".(" + pockets + "); path=/; expires=" + urchin_persistence.toGMTString();
}

// delete
function concuss_urchin()
{
var chimney = new Date();
chimney.setTime(chimney.getTime()-1);
t.cookie = AP2_urchin + "=CONCUSSED; path=/; expires=" + chimney.toGMTString();
alert("The AP2 style urchin has been BRUTALLY CONCUSSED. Choose a layout (or reload the page) for the default style.");
}

// mumble
function find_random_mumble()
{
var a_list_of_random_things = new Array
(
"Righto.guv",
"Right.you.are.guv",
"Chirpy.urchin.at.your.service",
"Spare.a.crust.for.a.ragged.type",
"Hang.on.I.am.in.the.middle.of.a.tricky.drainpipe.shimmy",
"Posh.types.belted.on.the.nut",
"Blimey.guv",
"Crikey.guv",
"Gravy.beard.of.the.funky.apostle.guv",
"Look.out.guv.somebody.is.at.the.sash",
"I.can.wriggle.through.the.transom.guv.and.be.back.before.this.steam.pipe.ruptures",
"Cheery.urchin.reporting.for.duty",
"I.like.nutrition"
);
return a_list_of_random_things[Math.round(Math.random() * a_list_of_random_things.length - 0.5)];
}
