	
function $(element) {
	return document.getElementById(element);
}

var tabs = [];
var isIe = typeof document.all != 'undefined';

function assignTabToggles(tabsContainerId) {
	var bar = $(tabsContainerId);
	
	var ul = bar.getElementsByTagName('ul')[0];
	
	tabs = ul.getElementsByTagName('li');
	if (typeof tabs == 'undefined') {
		tabs = [];
	}
	
	for (var i = 0; i < tabs.length; i ++) {
		//punem conditiile sa afiseze pentru fiecare tab imaginea cand s-a apasat pe el 
	
	
		tabs[i].onclick = function(e) {

			var target = isIe ? window.event.srcElement : e.target;
			$(target.id).style.backgroundImage = 'url("img/ie6/hats.gif")';
			//$(target.id).style.backgroundRepeat += 'no-repeat'; 
			if (target.id == 'productivity')
					$(target.id).style.backgroundPosition = '-25px -25px';
					
			if (target.id == 'management')
					$(target.id).style.backgroundPosition = '-25px -123px';

			if (target.id == 'portability')
					$(target.id).style.backgroundPosition = '-25px -221px';
					
			if (target.id == 'security')
					$(target.id).style.backgroundPosition = '-25px -319px';
					
			if (target.id == 'customization')
					$(target.id).style.backgroundPosition = '-25px -417px';
					
			var contents = $(target.id + 'Contents');
			
			if (typeof contents != 'undefined') {
				contents.style.display = '';
				
				for (var j = 0; j < tabs.length; j ++) {
					if (tabs[j].id != target.id) {
						$(tabs[j].id + 'Contents').style.display = 'none';
						$(tabs[j].id).style.backgroundImage = 'none';
					}
				}
			}
		};
	}
}



