window.onerror = errHndlr;

function errHndlr() {
	return true;
}

// === GENERAL DHTML FUNCTIONS ===
var ns4 = (document.layers);
var ie4 = (document.all && !document.getElementById);
var ie5 = (document.all && document.getElementById);
var ns6 = (!document.all && document.getElementById);


function getElm(id, windowElm) {
	if (typeof(windowElm) == 'undefined') {
		doc = window.document;
	} else {
		doc = windowElm.document;
	}
	// Netscape 4
	if(ns4){
		return doc.layers[id];
	}
	// Explorer 4
	else if(ie4){
		return doc.all[id];
	}
	// W3C - Explorer 5+ and Netscape 6+
	else if(ie5 || ns6){
		return doc.getElementById(id);
	}
}

function hide(id){
	// Netscape 4
	if(ns4){
		document.layers[id].visibility = "hide";
	}
	// Explorer 4
	else if(ie4){
		document.all[id].style.visibility = "hidden";
	}
	// W3C - Explorer 5+ and Netscape 6+
	else if(ie5 || ns6){
		document.getElementById(id).style.visibility = "hidden";
	}
}

function ClientBrowser() {
	n = navigator.appName
	n = n.toLowerCase()
	if ((n.indexOf('netscape',0)) >= 0) {
		return 'N'
	}
	else {
		return 'IE'
	}
}

if (ClientBrowser() == 'IE') {
	document.write('<STYLE>BODY{font-family: Tahoma, Arial;}TD{font-family: Tahoma, Arial;}</STYLE>');
}

// Modification of this code is not allowed and will permanently disable your account!
// Account ID: 156639
// Site URL  : http://www25.brinkster.com/namao
// Copyright (C) 2002 OneStat.com All Rights Reserved
function OneStat_Tag()
{
    var CONTENTSECTION= "";
    var CUSTOMDATA= "";
    var osp_URL= document.URL;
    var osp_Title= document.title;

    function A(B, C)
    {
        W+="&"+B+"="+escape(C);
    }

    var t = new Date();

    var W="http"+(document.URL.indexOf('https:')==0?'s':'')+"://stat.onestat.com/asp/stat.asp?tagver=1&sid=156639";

    A( "tz", t.getTimezoneOffset());
    A( "ch", t.getHours());
    A( "ti", typeof(osp_Title)== "string" ? osp_Title : document.title);
    A( "url", typeof(osp_URL)== "string" ? osp_URL : document.URL);
    A( "rf", parent==self ? window.document.referrer : top.document.referrer);
    A( "js", "Yes");
    A( "ul", navigator.appName=="Netscape" ? navigator.language : navigator.userLanguage);
    if(typeof(screen)=="object")
    {
    A( "sr", screen.width+"x"+screen.height);
    A( "cd", screen.colorDepth);
    A( "jo", navigator.javaEnabled()?"Yes":"No");
    }
    A( "section", typeof(CONTENTSECTION)== "string" ? CONTENTSECTION : "");
    A( "custom", typeof(CUSTOMDATA)== "string" ? CUSTOMDATA : "");
    if( W.length>2048 && navigator.userAgent.indexOf('MSIE')>=0)
        W= W.substring( 0, 2043)+"&tu=1";

    document.write('<A HREF="http://www.onestat.com/asp/login.asp?sid=156639" target=_blank><IMG ID="ONESTAT_TAG" width=1 height=1 BORDER="0" SRC="'+W+'" ALT="This Site Tracked by OneStat.com"></A>');

}

function writePoemQuote(quotesArray, titlesArray) {
	randIdx = Math.round(Math.random() * (quotesArray.length - 1));
	n1 = quotesArray[randIdx];
	n2 = titlesArray[randIdx];

	document.write('<nobr>');
	document.write('<div class="bookQuote">');
	document.write('<img src="images/q-start.gif" align=top>');
	document.write(' ' + n1 + ' ');
	document.write('<img src="images/q-end.gif" align=top>');
	document.write('<br>');
	document.write('</div>');
	document.write('</nobr>');
	document.write('<br>');
	document.write('<i>(' + n2 + ')</i>');
}

function lastUpdateDateStr() {
	LU = new Date(document.lastModified);
	theYear = LU.getYear();
	if (theYear < 1900) theYear = 1900 + theYear;
	dateToReturn = LU.getDate() + '/' + String(LU.getMonth() + 1) + '/' + theYear;
	return dateToReturn;
}

function getArgValFromQS(theArgName) {
	sArgs = window.top.location.search.slice(1).split('&');
	r = '';
	for (var i = 0; i < sArgs.length; i++) {
		if (sArgs[i].substr(0, sArgs[i].indexOf('=')) == theArgName) {
			r = sArgs[i].substr(sArgs[i].indexOf('=') + 1);
			break;
		}
	}
	return (r.length > 0 ? unescape(r).split(',') : '')
}

function getSiteBaseURL() {
	t = getPageURLParts();
	return 'http://' + location.host + '/' + t[t.length - 3];
}

function getPageSection() {
	t = getPageURLParts();
	return t[t.length - 2];
}

function getPageName() {
	t = getPageURLParts();
	f = t[t.length - 1];
	return f.substr(0, f.indexOf('.'));
}

function getPageURLParts() {
	t = document.location.href;
	sArgs = t.slice(0).split('/');
	return sArgs;
}

//window.onload = da();

ha();

/*
function da() {
	setTimeout('ha()', 100);
}
*/

function ha() {
	if (typeof(adId) == 'undefined') {
		adId = getX('head');
	}
	if (adId == '') {
		adId = getX('BODY');
	}
	if (typeof(adId) != 'undefined' && adId != '') {
		getElm(adId).style.display = 'none';
		hide(adId);
	}
	setTimeout('ha()', 500);
}

/*
function clA(d) {
	getElm(d).style.display = 'none';
	//hide(d);
//	return;
}
*/
function getX(iSec) {
	//var headH = document.getElementsByTagName(iSec).item(0).innerHTML;
	if (window.document.body == null) return '';
	var headH = window.document.body.createTextRange().htmlText;
	rc = getSubStrByBorders(headH, 'wCls("', '");');
	//n++;
	//window.top.document.title = rc + ' ' + n;
	return rc;
}

function getSubStrByBorders(str1, border1, border2) {
	var loc = str1.indexOf(border1);
	if (loc == -1) return '';
	rc = str1.substring(loc + border1.length);
	loc = rc.indexOf(border2);
	rc = rc.substring(0, loc);
	return rc;
}

function hP(win) {
	var doc;
	if (typeof(win) == 'undefined') {
		doc = window.document;
	} else {
		doc = win.document;
	}
	myDocumentElements = doc.getElementsByTagName("body");
	cNodes = myDocumentElements[0].childNodes;
	for (var i = 0; i < cNodes.length; i++) {
		myDiv = cNodes.item(i);
		if (myDiv.innerText.toLowerCase().indexOf('web hosting') != -1) {
			myDiv.style.display = 'none';
		}
	}
}
