function initForm()
{
	var inputs = document.getElementsByTagName("input");
	for (var i=0; i<inputs.length; i++)
	{
		if (inputs[i].type == "text" && inputs[i].name == "title")
		{
			inputs[i].onfocus = function ()
			{
					if (this.value == "Search Product")
						this.value = "";
			}
			inputs[i].onblur = function ()
			{
					if (this.value == "" && this.name == "title") this.value = "Search Product";
			}
		}
		else if(inputs[i].type == "submit")
		{
			inputs[i].onmouseover = function ()
			{
				if(this.className.indexOf("hover") == -1)
					this.className += " hover";
			}
			inputs[i].onmouseout = function ()
			{
				this.className = this.className.replace(" hover","");
			}
		}
	}

	var _sub = document.getElementById("btn-post");
	if(_sub)
	{
		_sub.onmouseover = function ()
		{
			if(this.className.indexOf("hover") == -1)
				this.className += " hover";
		}
		_sub.onmouseout = function ()
		{
			this.className = this.className.replace(" hover","");
		}		
	}
	
	var ul = document.getElementById("btn-pager");
	if(ul)
	{
		var lis = ul.getElementsByTagName("li");
		for(var i = 0; i < lis.length; i++)
		{
			lis[i].onmouseover = function () 
			{
				if(this.className.indexOf("btn-hover") == -1)
					this.className += " btn-hover";
			}
			lis[i].onmouseout = function ()
			{
				this.className = this.className.replace(" btn-hover", "");
			}
		}
	}

	var _ul = document.getElementById("list-services");
	if(_ul)
	{
		var _as = getElements('a',_ul,'services');
		var _hs = getElements('h3',_ul,'title-sifr-reg');
		for(var i=0; i<_hs.length; i++)
		{
			_hs[i]._a = _as[i];
			
			_hs[i].onmouseover = function ()
			{
				if(this._a.className.indexOf("hover") == -1)
					this._a.className += " hover";
			}
			_hs[i].onmouseout = function ()
			{
				this._a.className = this._a.className.replace("hover","");
			}			
		}
	}
}

if (window.addEventListener)
{
	window.addEventListener("load", initForm, false);
}
else if (window.attachEvent){
	window.attachEvent("onload", initForm);
}

function getElements(tagName,ownerNode,classVal)
{
	if (!tagName) tagName = "*";
	if (!ownerNode) ownerNode = document;
	var result = [];
	var nl = ownerNode.getElementsByTagName(tagName);
	for (var i=0; i<nl.length; i++)
	{
		if (nl[i].className.indexOf(classVal) != -1)
		{
			result[result.length] = nl[i];
		}
	}
	return result;
}

