/*
 *
 *
*/

function modifyMenu()
{
	//var MSIE = navigator.appVersion.indexOf('MSIE')+5;
	//var semi = navigator.appVersion.indexOf(';',MSIE);
	//var vers = parseInt(navigator.appVersion.substr(MSIE,(semi-MSIE)));
	
	if (document.all&&document.getElementById)
	//if (true)
	{
		var root = document.getElementById('menu');
		if(root && root.childNodes)
		{
			for (var i = 0; i < root.childNodes.length; i++)
			{
				if (root.childNodes[i].className == 'menu_group')
				{
					root.childNodes[i].onmouseover = function(){this.className = 'menu_group_over';};
					root.childNodes[i].onmouseout = function(){this.className = 'menu_group';};
				}
			}
		}
	}	
}


function heightFix()
{

	left = document.getElementById('left');
	center = document.getElementById('center');
	right = document.getElementById('right');
	
	if(center.offsetHeight >= right.offsetHeight && center.offsetHeight >= left.offsetHeight){
		
		left.style.height = center.offsetHeight + 'px';
		right.style.height = center.offsetHeight + 'px';
		center.style.height = center.offsetHeight + 'px';
		
	}else if(right.offsetHeight >= center.offsetHeight && right.offsetHeight >= left.offsetHeight){
		
		left.style.height = right.offsetHeight + 'px';
		center.style.height = right.offsetHeight + 'px';
		right.style.height = right.offsetHeight + 'px';
		
	}else if(left.offsetHeight >= center.offsetHeight && left.offsetHeight >= right.offsetHeight){
		
		right.style.height = left.offsetHeight + 'px';
		center.style.height = left.offsetHeight + 'px';
		left.style.height = left.offsetHeight + 'px';
		
	}
	
	
	

}

function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\\\s)"+searchClass+"(\\\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

function activate(which){
	
	
	var active = document.getElementById('active');
	var pending = document.getElementById('pending');
	var inactive = document.getElementById('inactive');
	
	var tabs = getElementsByClass('tab');

	
	switch(which){
		
		case 'active':		active.style.display = 'block';
							pending.style.display = 'none';
							inactive.style.display = 'none';
							tabs[0].style.backgroundColor = '#FFFFFF';
							tabs[1].style.backgroundColor = '#999999';
							tabs[2].style.backgroundColor = '#999999';			
							break;
		
		
		case 'inactive':	inactive.style.display = 'block';
							pending.style.display = 'none';
							active.style.display = 'none';
							tabs[0].style.backgroundColor = '#999999';
							tabs[1].style.backgroundColor = '#FFFFFF';
							tabs[2].style.backgroundColor = '#999999';
							break;
							
							
		case 'pending':		pending.style.display = 'block';
							active.style.display = 'none';
							inactive.style.display = 'none';
							tabs[0].style.backgroundColor = '#999999';
							tabs[1].style.backgroundColor = '#999999';
							tabs[2].style.backgroundColor = '#FFFFFF';
							break;
		
		default: 			break;
		
	}
	
	
	
	
	
	
	
}

function activate_prefs(which){
	
	
	personal = document.getElementById('personal');
	email = document.getElementById('email');
	password = document.getElementById('password');
	
	tabs = getElementsByClass('tab');

	
	switch(which){
		
		case 'personal':	personal.style.display = 'block';
							password.style.display = 'none';
							email.style.display = 'none';
							tabs[0].style.backgroundColor = '#FFFFFF';
							tabs[1].style.backgroundColor = '#999999';
							tabs[2].style.backgroundColor = '#999999';			
							break;
		
		
		case 'email':		email.style.display = 'block';
							password.style.display = 'none';
							personal.style.display = 'none';
							tabs[0].style.backgroundColor = '#999999';
							tabs[1].style.backgroundColor = '#FFFFFF';
							tabs[2].style.backgroundColor = '#999999';
							break;
							
							
		case 'password':	password.style.display = 'block';
							personal.style.display = 'none';
							email.style.display = 'none';
							tabs[0].style.backgroundColor = '#999999';
							tabs[1].style.backgroundColor = '#999999';
							tabs[2].style.backgroundColor = '#FFFFFF';
							break;
		
		default: 			break;
		
	}
	
	
	
	
	
	
	
}