var google_ad_client = "pub-0497825753579781";
var google_color_border = "eeeeee";
var google_color_bg = "eeeeee";
var google_color_link = "aa1111";
var google_color_url = "333333";
var google_color_text = "666666";

/*
var google_alternate_color = "ff4202";
var google_ad_width = 200;
var google_ad_height = 90;
var google_ad_format = "200x90_0ads_al_s";
*/


var google_ad_width = 250;
var google_ad_height = 250;
var google_ad_format = "250x250_as";
var google_ad_type = "text";

var HOST = 'looselife.net';

function init(){
    if(! document.getElementById) return;
    abac();
	clickableCite();
	q2q();
}


/*
==============================================================
clickable cite attribute DOM
==============================================================
original source written by Simon Willson
: http://simon.incutio.com/
*/
function clickableCite() {
    q = document.getElementsByTagName('blockquote');
    for (i=0; i<q.length; i++) {
        cite = q[i].getAttribute('cite')
        if (cite) {
            newlink = document.createElement('a');
            newlink.setAttribute('href', cite);
            newlink.setAttribute('title', cite);
            newlink.appendChild(document.createTextNode('→ Source'));
            newdiv = document.createElement('div');
            newdiv.className = 'citesource';
            newdiv.appendChild(newlink);
            q[i].appendChild(newdiv);
        }
    }
}



/* q2a
Convert <q cite="" title=""> to <a href="" title"">
function q2a() {
    q = document.getElementsByTagName('q');
    for (i=0; i<q.length; i++) {
        cite = q[i].getAttribute('cite')
		title = q[i].getAttribute('title')
        if (cite) {
            newlink = document.createElement('a');
            newlink.setAttribute('href', cite);
            newlink.setAttribute('title', title);
            newdiv = document.createElement('a');
            newdiv.className = 'citesource';
            newdiv.appendChild(newlink);
            q[i].appendChild(newdiv);
        }
    }
}



// Standard utility scripts
// Modified 2004-04-06, by M.Kanzaki
/* --------------------------------------------------------------
  This set of scripts is copyright (c) 2002-2004 by Masahide Kanzaki.
  You can redistribute it and/or modify it under the terms of 
  the GPL (GNU General Public License) .
  See <http://www.gnu.org/licenses/gpl.html> for detail of license.
  Japanese taranslation <http://www.opensource.jp/gpl/gpl.ja.html>
  ---------------------------------------------------------------- */

// Get User Environment
var gEnv = new getenv();

function init(lv){
    if(! document.getElementById) return;
    abac();
    notify('');
}

//---- general environment variables ----
//instantiated as gEnv
function getenv(){
    var ua = navigator.userAgent;
    if(ua.match(/Opera/)) this.isOpera = true;
    else if(ua.match(/MSIE/)) {
        this.isIE = true;
        if(ua.match(/Mac/)) this.isMacIE = true;
        else if(ua.match(/Win/)) this.isWinIE = true;
    }
    else if(ua.match(/Safari/)) this.isSafari = true;
    else if(ua.match(/Gecko/)) this.isMozilla = true;
    else if(ua.match(/iCab/)) this.isIcab = true;
    this.usrLang = (navigator.userLanguage || navigator.language);
}

// abbr to acronym for Win ie
function abac(){
    if(gEnv.isWinIE){
        var ab, abp, m;
        notify('preparing abbreviations...');
        ab = document.getElementsByTagName("abbr"); //For HPR3.01
        while(m = ab.length){
            abp = ab.item(m-1).parentNode;
            abp.innerHTML = abp.innerHTML.replace(/(<\/?)abbr/ig,'$1acronym');
        }
    }
}

function notify(str){
    if(gEnv.isMozilla) return;
    status = ((str == '') ? defaultStatus : str);
}







// Copyright (c) 1996-1997 Athenia Associates.
// http://www.webreference.com/js/
// License is granted if and only if this entire
// copyright notice is included. By Tomer Shiran.

function setCookie (name, value, expires, path, domain, secure) {
    var curCookie = name + "=" + escape(value) + (expires ? "; expires=" + expires : "") + (path ? "; path=" + path : "") + (domain ? "; domain=" + domain : "") + (secure ? "secure" : "");
    document.cookie = curCookie;
}

function getCookie (name) {
    var prefix = name + '=';
    var c = document.cookie;
    var nullstring = '';
    var cookieStartIndex = c.indexOf(prefix);
    if (cookieStartIndex == -1)
        return nullstring;
    var cookieEndIndex = c.indexOf(";", cookieStartIndex + prefix.length);
    if (cookieEndIndex == -1)
        cookieEndIndex = c.length;
    return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}

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 fixDate (date) {
    var base = new Date(0);
    var skew = base.getTime();
    if (skew > 0)
        date.setTime(date.getTime() - skew);
}

function rememberMe (f) {
    var now = new Date();
    fixDate(now);
    now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
    now = now.toGMTString();
    if (f.author != undefined)
       setCookie('mtcmtauth', f.author.value, now, '/', '', '');
    if (f.email != undefined)
       setCookie('mtcmtmail', f.email.value, now, '/', '', '');
    if (f.url != undefined)
       setCookie('mtcmthome', f.url.value, now, '/', '', '');
}

function forgetMe (f) {
    deleteCookie('mtcmtmail', '/', '');
    deleteCookie('mtcmthome', '/', '');
    deleteCookie('mtcmtauth', '/', '');
    f.email.value = '';
    f.author.value = '';
    f.url.value = '';
}


// minmax.js: make IE5+/Win support CSS min/max-width/height
// version 1.0, 08-Aug-2003
// written by Andrew Clover <and@doxdesk.com>, use freely

/*@cc_on
@if (@_win32 && @_jscript_version>4)

var minmax_elements;

minmax_props= new Array(
  new Array('min-width', 'minWidth'),
  new Array('max-width', 'maxWidth'),
  new Array('min-height','minHeight'),
  new Array('max-height','maxHeight')
);

// Binding. Called on all new elements. If <body>, initialise; check all
// elements for minmax properties

function minmax_bind(el) {
  var i, em, ms;
  var st= el.style, cs= el.currentStyle;

  if (minmax_elements==window.undefined) {
    // initialise when body element has turned up, but only on IE
    if (!document.body || !document.body.currentStyle) return;
    minmax_elements= new Array();
    window.attachEvent('onresize', minmax_delayout);
    // make font size listener
    em= document.createElement('div');
    em.setAttribute('id', 'minmax_em');
    em.style.position= 'absolute'; em.style.visibility= 'hidden';
    em.style.fontSize= 'xx-large'; em.style.height= '5em';
    em.style.top='-5em'; em.style.left= '0';
    if (em.style.setExpression) {
      em.style.setExpression('width', 'minmax_checkFont()');
      document.body.insertBefore(em, document.body.firstChild);
    }
  }

  // transform hyphenated properties the browser has not caught to camelCase
  for (i= minmax_props.length; i-->0;)
    if (cs[minmax_props[i][0]])
      st[minmax_props[i][1]]= cs[minmax_props[i][0]];
  // add element with properties to list, store optimal size values
  for (i= minmax_props.length; i-->0;) {
    ms= cs[minmax_props[i][1]];
    if (ms && ms!='auto' && ms!='none' && ms!='0' && ms!='') {
      st.minmaxWidth= cs.width; st.minmaxHeight= cs.height;
      minmax_elements[minmax_elements.length]= el;
      // will need a layout later
      minmax_delayout();
      break;
  } }
}

// check for font size changes

var minmax_fontsize= 0;
function minmax_checkFont() {
  var fs= document.getElementById('minmax_em').offsetHeight;
  if (minmax_fontsize!=fs && minmax_fontsize!=0)
    minmax_delayout();
  minmax_fontsize= fs;
  return '5em';
}

// Layout. Called after window and font size-change. Go through elements we
// picked out earlier and set their size to the minimum, maximum and optimum,
// choosing whichever is appropriate

// Request re-layout at next available moment
var minmax_delaying= false;
function minmax_delayout() {
  if (minmax_delaying) return;
  minmax_delaying= true;
  window.setTimeout(minmax_layout, 0);
}

function minmax_stopdelaying() {
  minmax_delaying= false;
}

function minmax_layout() {
  window.setTimeout(minmax_stopdelaying, 100);
  var i, el, st, cs, optimal, inrange;
  for (i= minmax_elements.length; i-->0;) {
    el= minmax_elements[i]; st= el.style; cs= el.currentStyle;

    // horizontal size bounding
    st.width= st.minmaxWidth; optimal= el.offsetWidth;
    inrange= true;
    if (inrange && cs.minWidth && cs.minWidth!='0' && cs.minWidth!='auto' && cs.minWidth!='') {
      st.width= cs.minWidth;
      inrange= (el.offsetWidth<optimal);
    }
    if (inrange && cs.maxWidth && cs.maxWidth!='none' && cs.maxWidth!='auto' && cs.maxWidth!='') {
      st.width= cs.maxWidth;
      inrange= (el.offsetWidth>optimal);
    }
    if (inrange) st.width= st.minmaxWidth;

    // vertical size bounding
    st.height= st.minmaxHeight; optimal= el.offsetHeight;
    inrange= true;
    if (inrange && cs.minHeight && cs.minHeight!='0' && cs.minHeight!='auto' && cs.minHeight!='') {
      st.height= cs.minHeight;
      inrange= (el.offsetHeight<optimal);
    }
    if (inrange && cs.maxHeight && cs.maxHeight!='none' && cs.maxHeight!='auto' && cs.maxHeight!='') {
      st.height= cs.maxHeight;
      inrange= (el.offsetHeight>optimal);
    }
    if (inrange) st.height= st.minmaxHeight;
  }
}

// Scanning. Check document every so often until it has finished loading. Do
// nothing until <body> arrives, then call main init. Pass any new elements
// found on each scan to be bound   

var minmax_SCANDELAY= 500;

function minmax_scan() {
  var el;
  for (var i= 0; i<document.all.length; i++) {
    el= document.all[i];
    if (!el.minmax_bound) {
      el.minmax_bound= true;
      minmax_bind(el);
  } }
}

var minmax_scanner;
function minmax_stop() {
  window.clearInterval(minmax_scanner);
  minmax_scan();
}

minmax_scan();
minmax_scanner= window.setInterval(minmax_scan, minmax_SCANDELAY);
window.attachEvent('onload', minmax_stop);

@end @*/

