function ieHover()
{
	var navs = document.getElementsByTagName("ul");
	for (var j=0; j<navs.length; j++)
	{
		var nodes = navs[j].getElementsByTagName("li");
		for (var i=0; i<nodes.length; i++)
		{
			if(nodes[i].parentNode.className.indexOf('drop') != -1)
			{
				nodes[i].onmouseover = function() 
				{
					this.className += " hover";
				}
				nodes[i].onmouseout = function()
				{
					this.className = this.className.replace("hover", "");
				}
			}
		}
	}
}

if (window.addEventListener)
	window.addEventListener("load", ieHover, false);
else if (window.attachEvent)
	window.attachEvent("onload", ieHover);

function initDropDowns()
{
	var divs = document.getElementsByTagName("div");
	for (var i=0; i<divs.length; i++)
	{
		if(divs[i].className.indexOf('one-box') != -1)
		{
			divs[i].onmouseover = function() 
			{
				this.className += " active";
			}
			divs[i].onmouseout = function()
			{
				this.className = this.className.replace(" active", "");
			}
			
			var inps = divs[i].getElementsByTagName("input");
			var _checkboxes = [];
			var _input = false;
			for (var j=0; j<inps.length; j++)
			{
				if(inps[j].type == 'checkbox')
				{
					_checkboxes[j] = inps[j];

					_checkboxes[j]._label = '';

					var _labels = _checkboxes[j].parentNode.getElementsByTagName('label');
					if(_labels[0])
					{
						_checkboxes[j]._label = _labels[0].innerHTML;
					}
					
					_checkboxes[j].onclick = function()
					{
						if(this._checkboxes)
						{
							
							this._input.value = '';
							
							for(_j in this._checkboxes)
							{
								if(this._checkboxes[_j].checked && this._checkboxes[_j]._label)
								{
									if(this._input.value == '' || this._checkboxes[_j]._label.length == 0)
									{
										this._input.value += this._checkboxes[_j]._label;
									}
									else
									{
										this._input.value += ', ' + this._checkboxes[_j]._label;
									}
								}
							}
						}
					}
				}
				else if(inps[j].type == 'text')
				{
					inps[j].readOnly = 'true';
					_input = inps[j];
				}
			}
			
			if(_input)
			{
				for(j in _checkboxes)
				{	
					_checkboxes[j]._input = _input;				
					_checkboxes[j]._checkboxes = _checkboxes;
				}
			}
			
		}
	}
}

if (window.addEventListener)
	window.addEventListener("load", initDropDowns, false);
else if (window.attachEvent)
	window.attachEvent("onload", initDropDowns);