function searchForum(){
	document.search.submit();
	}

function $(id) {
	return document.getElementById(id);
}

HW = {}

HW.Components = {}

HW.Components.Core = {
	getElementsByClassName:function(cls,n,t)
	{
		var rtn = [];
		n=n===null?document:n;
		t=t===null?'*':t;
		var els = n.getElementsByTagName ? n.getElementsByTagName(t) : document.all;
		els = (!els||!els.length ) && document.all ? document.all : els;
		if(cls==null){return els;}
		for (var i=0,j=0; i < els.length; i++)
		{
			if(this.hasClass(els[i],cls))
			{
				rtn[j++] = els[i];
			}
		}
		return rtn;
	},
	attachEvent:function(obj,evt,fnc)
	{
		if(window.addEventListener)
		{
			obj.addEventListener(evt, fnc, false);
		}
		else if(window.attachEvent)
		{
			obj.attachEvent('on'+evt, fnc);
		}
		else if (obj.getElementById && evt=='load')
		{
			obj.onload = fnc;
		}
	},
	extendObject:function(d, s)
	{
		d=d===null?new Object():d;
		for (p in s)
		{
			d[p] = s[p];
		}
		return d;
	},
	addClass:function(target, theClass)
	{
		if (!this.hasClass(target, theClass))
		{
			if (target.className == "")
			{
				target.className = theClass;
			}
			else
			{
				target.className += " " + theClass;
			}
		}
	},
	hasClass:function(target, theClass)
	{
		var pattern = new RegExp("(^| )" + theClass + "( |$)");
		if (pattern.test(target.className))
		{
			return true;
		}
	
	  return false;
	},
	removeClass:function(target, theClass)
	{
		var pattern = new RegExp("(^| )" + theClass + "( |$)");
		
		target.className = target.className.replace(pattern, "$1");
		target.className = target.className.replace(/ $/, "");
	},
	swapClass:function(target, oldClass, newClass)
	{
		this.removeClass(target, oldClass);
		this.addClass(target, newClass);
	},
	getPosition:function(target)
	{
		var left = 0;
		var top = 0;
		if (target.offsetParent) {
			left = target.offsetLeft
			top = target.offsetTop
			while (target = target.offsetParent) {
				left += target.offsetLeft
				top += target.offsetTop
			}
		}
		return [left,top];
	},
	setFade:function(target, value)
	{
		var agt = navigator.userAgent.toLowerCase();
		if((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1))
		{
			if (value == 100) target.style.filter = "";
			else if (value < 0) target.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=0);";
			else target.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity="+ Math.round(value) + ");";
		}
		else
		{			
			target.style.MozOpacity = (Math.round(value) / 100);
			target.style.opacity = (Math.round(value) / 100);
		}
	},
	log:function(a) {
		if(window.console) {
			console.log(a);
		}
		else {
			alert(a);
		}
	},
	windowSize:function() {
		var obj = new Object();
		var w = 0;
		if(window.innerWidth) {
			w = window.innerWidth;
			h = window.innerHeight;
		}
		else if(document.documentElement.clientWidth) {
			w = document.documentElement.clientWidth;
			h = document.documentElement.clientHeight;
		}
		else if(document.body.clientWidth) {
			w = document.body.clientWidth;
			h = document.body.clientHeight;
		}
		obj.width = w;
		obj.height = h;
		return obj;
	},
	docSize:function() {
		var obj = new Object();
		var w = document.body.clientWidth?document.body.clientWidth:0;
		w = Math.max(w,document.documentElement.clientWidth?document.documentElement.clientWidth:0);
		w = Math.max(w,window.innerWidth?window.innerWidth:0);
		var h = document.body.clientHeight?document.body.clientHeight:0;
		h = Math.max(h,document.documentElement.clientHeight?document.documentElement.clientHeight:0);
		h = Math.max(h,window.innerHeight?window.innerHeight:0);
		obj.width = w;
		obj.height = h;
		return obj;
	},
	_setTimeout:function(fnc,i,obj) {
		var tmp = HW.Components.Core.extendObject(new Object(),HW.Components.Core.Timer);
		tmp._setTimeout(fnc,i,obj);
		return tmp;
	}
}

HW.Components.Core.Timer = {
	_parent:null,
	_int:100,
	_trg:null,
	_setTimeout:function(fnc,i,obj) {
		this._parent = obj;
		this._func = fnc;
		this._createTimeout(i);
		this._callback = function() {
			//alert(this._func);
			this._parent._respond = this._func;
			this._parent._respond();
		}
	},
	_createTimeout:function(i) {
		this._int = i;
		var elm = this;
		function step() {
			elm._callback();
		}
		var t = setTimeout(function(){step();},this._int);
	}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}