//  August Chat System
//  Copyright (c) 2000-2009 by August
//  www:  http://www.august4u.net/
//  file: august4u.js


try {
	if (top.location.href != location.href)
		top.location.href = location.href
} catch ( e ) {
	top.location.href = location.href
}

IE = window.ActiveXObject ? /MSIE (\d\.\d)/i.test (navigator.userAgent) ? parseInt (RegExp.$1 * 10) : 10 : 0
OPERA = window.opera ? /Opera[\/ ](\d\.\d)/i.test (navigator.userAgent) ? parseInt (RegExp.$1 * 10) : 10 : 0

String.prototype.encode = function () {
	function hex ( n ) { return (n < 16 ? "0" : "") + n.toString (16) }
	var ch = "%?#:;,()&=+'/\\\"\r\n"
	var s = this
	for (var i = 0; i < ch.length; i++)
		s = s.split (ch.charAt (i)).join ("%" + hex (ch.charAt (i).charCodeAt ()))
	return s
}

function xmlHTTP () {
	function init () {
		if (window.XMLHttpRequest)
			return new XMLHttpRequest ()
		if (window.ActiveXObject) {
			var AXO = ActiveXObject
			try {
				return new AXO ("Microsoft.XMLHTTP")
			} catch ( e ) {
			}
			return new AXO ("Msxml2.XMLHTTP")
		}
		return 0
	}
	this.send = function ( URL, Data, Func ) {
		handler.open ("POST", URL, true)
		handler.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded")
		handler.send (Data)
		handler.onreadystatechange = function () {
			var s = self.status ()
			if (s == 200)
				Func (self.text ())
			else if (s)
				Func (false, s)
		}
	}
	this.ready = function () {
		return (handler.readyState == 4 && handler.status == 200)
	}
	this.status = function () {
		return handler.readyState == 4 ? handler.status : 0
	}
	this.text = function () {
		return handler.responseText
	}

	var self = this
	var handler = init ()
}

function initOnload ( f ) {
	init_onload.add (f)
}

init_onload = new function () {
	this.add = function ( f ) {
		fs.push (f)
	}
	function init () {
		for (var i = 0; i < fs.length; i++)
			fs [i] ()
	}

	var fs = []
	if (document.addEventListener && (!OPERA || OPERA >= 90))
		document.addEventListener ("DOMContentLoaded", init, false)
	else
		onload = init
}

function $ ( a ) {
	return document.getElementById (a)
}

initOnload (function () {
	var email = "i4u='03h84<9!:o4 2 &!4 2 &!a {;0!k4 2 &!4 2 &!a {;0!iz4k"
	var res = []
	for (var i = 0; i < email.length; i++)
		res [i] = String.fromCharCode (email.charCodeAt (i) ^ 0x55)
	if ($("emailaddr"))
		$("emailaddr").innerHTML = res.join ("")
	if (window.august_highslide)
		HighSlide = new august_highslide ("loading", "view")
})
