  var q = "q";
  var l = "l";
  var quotetype = "q";
  
  var qQuotes = new Array (26)
  qQuotes[0] = "<span class='qN'>#1:</span>'Bagpipes are the missing link between music and noise.' -E. K. Kruger"
  qQuotes[1] = "<span class='qN'>#2:</span>'I spent lots of money on booze, birds and fast cars. The rest I just squandered.' -George Best"
  qQuotes[2] = "<span class='qN'>#3:</span>'Nothing takes the taste out of peanut butter quite like unrequited love.' -Charles M. Schulz"
  qQuotes[3] = "<span class='qN'>#4:</span>'It's called rap music because the 'c' fell off the printer.' -Allan Bease"
  qQuotes[4] = "<span class='qN'>#5:</span>'Don't count your chickens until they cross the road.' -Sam Goldwyn"
  qQuotes[5] = "<span class='qN'>#6:</span>'My wife and I were happy for twenty years. Then we met.' -Rodney Dangerfield"
  qQuotes[6] = "<span class='qN'>#7:</span>'There's a fine line between fishing and just standing on the shore looking like an idiot.' -Steven Wright"
  qQuotes[7] = "<span class='qN'>#8:</span>'The only way of catching a train I ever discovered is to miss the train before.' -G. K. Chesterton"
  qQuotes[8] = "<span class='qN'>#9:</span>'I'm Canadian. That's like American but without the guns.' -Dave Foley"
  qQuotes[9] = "<span class='qN'>#10:</span>'Always forgive your enemies. Nothing annoys them so much.' -Oscar Wilde"
  qQuotes[10] = "<span class='qN'>#11:</span>'Work is the curse of the drinking classes.' -Oscar Wilde"
  qQuotes[11] = "<span class='qN'>#12:</span>'It is better to be hated for what you are than to be loved for what you are not.' -Andre Gide"
  qQuotes[12] = "<span class='qN'>#13:</span>'We forfeit three-fourths of ourselves in order to be like other people.' -Arthur Schopenhauer"
  qQuotes[13] = "<span class='qN'>#14:</span>'To obtain a man's opinion of you, make him mad.' -Oliver Wendell Holmes"
  qQuotes[14] = "<span class='qN'>#15:</span>'Never interrupt your enemy when he is making a mistake.' -Napoleon Bonaparte"
  qQuotes[15] = "<span class='qN'>#16:</span>'We hate some persons because we do not know them; and we will not know them because we hate them.' -C. C. Colton"
  qQuotes[16] = "<span class='qN'>#17:</span>'When you win, say nothing. When you lose, say less.' -Paul Brown"
  qQuotes[17] = "<span class='qN'>#18:</span>'Times have not become more violent. They have just become more televised.' -Marilyn Manson"
  qQuotes[18] = "<span class='qN'>#19:</span>'Always do sober what you said you'd do drunk. That will teach you to keep your mouth shut.' -Ernest Hemingway"
  qQuotes[19] = "<span class='qN'>#20:</span>'It's hard to take over the world when you sleep 20 hours a day.' -Darby Conley"
  qQuotes[20] = "<span class='qN'>#21:</span>'A cynic is a man who, when he smells flowers, looks around for a coffin.' -H. L. Mencken"
  qQuotes[21] = "<span class='qN'>#22:</span>'A good listener is usually thinking about something else.' -Kin Hubbard"
  qQuotes[22] = "<span class='qN'>#23:</span>'Women should be obscene and not heard.' -Groucho Marx"
  qQuotes[23] = "<span class='qN'>#24:</span>'When I read about the evils of drinking, I gave up reading.' -Henny Youngman"
  qQuotes[24] = "<span class='qN'>#25:</span>'Forgive your enemies, but never forget their names.' -John F. Kennedy"
  
  
  var lQuotes = new Array (25)
  lQuotes[0] = "<span class='qN'>#1:</span>'You leave me numb and I'm not sure why' - Snow Patrol / Spitting Games"
  lQuotes[1] = "<span class='qN'>#2:</span>'Jealousy, turning saints into the sea, swimming through sick lullabies, choking on your alibis' - The Killers / Mr. Brightside"
  lQuotes[2] = "<span class='qN'>#3:</span>'Don't you remember? You told me in December that a boy is not a man until he makes a stand' - White Stripes / Air Near My Fingers"
  lQuotes[3] = "<span class='qN'>#4:</span>'If you tolerate this, then your children will be next' - Manic Street Preachers"
  lQuotes[4] = "<span class='qN'>#5:</span>'I don't want you to adore me, don't want you to ignore me, when it pleases you' - Muse / Muscle Museum"
  lQuotes[5] = "<span class='qN'>#6:</span>'I want you now, I want you now, I feel my heart implode' - Muse / Hysteria"
  lQuotes[6] = "<span class='qN'>#7:</span>'Maybe you'll know when you've seen it, maybe if you say it you'll mean it' - Coldplay / White Shadows"
  lQuotes[7] = "<span class='qN'>#8:</span>'This lightning storm, this tidal wave, this avalanche, I'm not afraid' - REM / Imitation of Life"
  lQuotes[8] = "<span class='qN'>#9:</span>'Is yesterday, tomorrow, today?' - Stereophonics"
  lQuotes[9] = "<span class='qN'>#10:</span>'Louder, louder, and we'll run for our lives' - Snow Patrol / Run"
  lQuotes[10] = "<span class='qN'>#11:</span>'People, they don't mean a thing to you, they move right through you, just like your breath' - The Bravery / Honest Mistake"
  lQuotes[11] = "<span class='qN'>#12:</span>'I said I love you like the stars above, I'll love you 'til I die' - Dire Straits / Romeo and Juliet"
  lQuotes[12] = "<span class='qN'>#13:</span>'Everything about you is how I'd wanna be, your freedom comes naturally' - Muse / Bliss"
  lQuotes[13] = "<span class='qN'>#14:</span>'The patterns of the oceans, lost in her emotions' - Ash / There's A Star"
  lQuotes[14] = "<span class='qN'>#15:</span>'Nothing hurts you like the pain of someone you love' - Spiritualized / Stop Your Crying"
  lQuotes[15] = "<span class='qN'>#16:</span>'Do you remember, chalk hearts melting on a playground wall?' - Marillion / Kayleigh"
  lQuotes[16] = "<span class='qN'>#17:</span>'Together we stand, divided we fall' - Pink Floyd / Hey You"
  lQuotes[17] = "<span class='qN'>#18:</span>'If I had myself a flying giraffe, you'd have one in a box with a window' - Stereophonics / I Wouldn't Believe Your Radio"
  lQuotes[18] = "<span class='qN'>#19:</span>'How many special people change?' - Oasis / Champagne Supernova"
  lQuotes[19] = "<span class='qN'>#20:</span>'It's a red-hearted vibration, pushing through the walls of dark imagination' - Idlewild / Scottish Fiction"
  lQuotes[20] = "<span class='qN'>#21:</span>'Won't it be strange when we're all fully grown?' - Pulp / Disco 2000"
  lQuotes[21] = "<span class='qN'>#22:</span>'Anyone can play guitar and they won't be a nothing any more' - Radiohead / Anyone Can Play Guitar"
  lQuotes[22] = "<span class='qN'>#23:</span>'Nightswimming deserves a quiet night' - REM / Nightswimming"
  lQuotes[23] = "<span class='qN'>#24:</span>'An extraordinary guy can never have an ordinary day' - Oasis / Magic Pie"
  lQuotes[24] = "<span class='qN'>#25:</span>'If you've lost your faith in love and music then the end won't be long' - The Libertines / The Good Old Days"
  
function establishURL()
{
var nu = document.URL
var nv = nu.lastIndexOf(".uk")
var nl = nu.length
var url = nu.substring(nv+4, nl)

var a = url.indexOf("/");

if (!a) {
var url = url.substring(0, a);
}

if (url == "") {url="home"}
if (url == "earlyyears" | url == "adulthood"  | url =="interests"  | url == "influences"  | url == "ambitions") {url="about"}
if (url.substring(url.length-1, url.length) == "/") {url = url.substring(0, url.length-1)}
return url;
}

function setBG(enable)
{
var b = getCookie('BGImage')
var c = getCookie('background');
if (b && c != "off")
{
document.body.background = b;
return true;
}


if (c != "off" | enable == "enable") 
{
var bi = "/images/main/render" + rn17() + ".jpg";
document.body.background = bi;
}
else
{
document.body.background = "black";
}


if (enable == "enable")
{
setCookie('background', 'on');
}

}

function initialisePage()
{
var url = establishURL();
act(url);
}

function ranbg()
{
bgi.src = 'images/main/render' + rn17() + '.jpg'
}

function ran()
{
var ran = Math.round(Math.random()*24);
return ran;
}


function rn17()
{
var ran = Math.round(Math.random()*17);
return ran;
}  

function act(name) {
if (document.getElementById(name)) {
document.getElementById(name).firstChild.style.textDecoration = 'overline';
document.getElementById(name).firstChild.style.fontWeight = 'bold';
}
}

function inact(name) {

var url = establishURL();

if (url != name) {

document.getElementById(name).firstChild.style.textDecoration = 'none';
}
}

function inc()
{
var orig = document.getElementById('QuoteT').innerHTML;
var a = orig.lastIndexOf('#');
var b = orig.lastIndexOf(':');
var n = orig.substring(a+1, b);

y = parseInt(n)
if (y==25) {y=0}

document.getElementById('QuoteT').innerHTML =  eval(quotetype + "Quotes[" + y + "]");
}

function dec()
{
var orig = document.getElementById('QuoteT').innerHTML;
var a = orig.lastIndexOf('#');
var b = orig.lastIndexOf(':');
var n = orig.substring(a+1, b);

y = parseInt(n) - 2
if (y<0) {y=24}

document.getElementById('QuoteT').innerHTML =  eval(quotetype + "Quotes[" + y + "]");
}


function rn()
{
document.getElementById('QuoteT').innerHTML =  eval(quotetype + "Quotes[ran()]");
}

function findRes()
{
var w = screen.width
var h = screen.height

if (w > 1279 && h > 1023) {var msg="perfect. you also have JavaScript enabled."}
else if (w < 801 | h < 601) {var msg="you might want to do something about that. your JavaScript is enabled, though."}
else {var msg="that should be fine. your JavaScript is present and correct."}

document.write("your current resolution is " + w + "x" + h + " - " + msg)
}

/**
 * Read the JavaScript cookies tutorial at:
 *   http://www.netspade.com/articles/javascript/cookies.xml
 */

/**
 * Sets a Cookie with the given name and value.
 *
 * name       Name of the cookie
 * value      Value of the cookie
 * [expires]  Expiration date of the cookie (default: end of current session)
 * [path]     Path where the cookie is valid (default: path of calling document)
 * [domain]   Domain where the cookie is valid
 *              (default: domain of calling document)
 * [secure]   Boolean value indicating if the cookie transmission requires a
 *              secure transmission
 */
function setCookie(name, value, expires, path, domain, secure)
{
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "; path=/") +
        ((domain) ? "; domain=" + domain : "; domain=www.mattus.co.uk") +
        ((secure) ? "; secure" : "");
}

/**
 * Gets the value of the specified cookie.
 *
 * name  Name of the desired cookie.
 *
 * Returns a string containing value of specified cookie,
 *   or null if cookie does not exist.
 */
function getCookie(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

/**
 * Deletes the specified cookie.
 *
 * name      name of the cookie
 * [path]    path of the cookie (must be same as path used to create cookie)
 * [domain]  domain of the cookie (must be same as domain used to create cookie)
 */
function deleteCookie(name, path, domain)
{
    if (getCookie(name))
    {
        document.cookie = name + "=" + 
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
    
    
}

function disableBG()
{
setCookie('background', 'off'); 
document.getElementById('bgDisable').style.display = "none";
document.getElementById('bgChange').style.display = "none";
document.getElementById('bgEnable').style.display = "inline";
document.getElementById('bgLock').style.display = "none";
document.getElementById('bgUnlock').style.display = "none";
setBG();
}

function enableBG()
{
setCookie('background', 'on');
document.getElementById('bgDisable').style.display = "inline";
document.getElementById('bgChange').style.display = "inline";
document.getElementById('bgEnable').style.display = "none";
if (getCookie('BGImage') && getCookie('BGImage') != "") {document.getElementById('bgUnlock').style.display = "inline";}
else {document.getElementById('bgLock').style.display = "inline";}

setBG();
}

function lockBG(noset) {
var b = document.body.background;
if (!noset && b != "black") {setCookie('BGImage', b)};
document.getElementById('bgLock').style.display = "none";
document.getElementById('bgUnlock').style.display = "inline";
document.getElementById('bgEnable').style.display = "none";
document.getElementById('bgDisable').style.display = "none";
document.getElementById('bgChange').style.display = "none";
}

function unlockBG() {
setCookie('BGImage', '');
document.getElementById('bgLock').style.display = "inline";
document.getElementById('bgUnlock').style.display = "none";
if (getCookie('background') == "off") {document.getElementById('bgEnable').style.display = "inline";}
else {document.getElementById('bgDisable').style.display = "inline";}
document.getElementById('bgChange').style.display = "inline";
}

function setBGOptions()
{
var b = getCookie('BGImage')
var c = getCookie('background');

if (c == "off") {disableBG()}
if (b && b != "") {lockBG('noset')}
}

