	/************************************************************************************************************
	(C) www.dhtmlgoodies.com, October 2005
	
	This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.	
	
	Terms of use:
	You are free to use this script as long as the copyright message is kept intact. However, you may not
	redistribute, sell or repost it without our permission.
	
	Thank you!
	
	www.dhtmlgoodies.com
	Alf Magne Kalleland
	
	************************************************************************************************************/	
	var textPaddingS = 3; // Padding at the left of tab text - bigger value gives you wider tabs
	var strictDocTypeS = true;	// Set to true if you're using a strict or loose doctype, false otherwise
	
	/* Don't change anything below here */
	var tabObjS;
	var activeTabIndexS = -1;
	var MSIE = navigator.userAgent.indexOf('MSIE')>=0?true:false;
	var navigatorVersion = navigator.appVersion.replace(/.*?MSIE (\d\.\d).*/g,'$1')/1;
		
	function setPaddingS(objS,padding){
		var spanS = objS.getElementsByTagName('SPAN')[0];
		spanS.style.paddingLeft = padding + 'px';	
		spanS.style.paddingRight = padding + 'px';	
	}
	function showTabS(tabIndexS)
	{
		
		if(activeTabIndexS>=0){
			if(activeTabIndexS==tabIndexS)return;
			var objS = document.getElementById('tabTabS'+activeTabIndexS);
			objS.className='tabInactive';
			var imgS = objS.getElementsByTagName('IMG')[0];
			imgS.src = '../docroot/fecliba/images/tab_right_inactive.gif';
			document.getElementById('tabViewS' + activeTabIndexS).style.display='none';
		}
		
		var thisObjS = document.getElementById('tabTabS'+tabIndexS);		
		thisObjS.className='tabActive';
		var imgS = thisObjS.getElementsByTagName('IMG')[0];
		imgS.src = '../docroot/fecliba/images/tab_right_active.gif';
		document.getElementById('tabViewS' + tabIndexS).style.display='block';
		activeTabIndexS = tabIndexS;
		

		var parentObjS = thisObjS.parentNode;
		var aTabS = parentObjS.getElementsByTagName('DIV')[0];
		countObjectss = 0;
		var startPosS = 2;
		var previousObjectActiveS = false;
		while(aTabS){
			if(aTabS.tagName=='DIV'){
				if(previousObjectActiveS){
					previousObjectActiveS = false;
					startPosS-=2;
				}
				if(aTabS==thisObjS){
					startPosS-=2;
					previousObjectActiveS=true;
					setPaddingS(aTabS,textPaddingS+1);
				}else{
					setPaddingS(aTabS,textPaddingS);
				}
				
				aTabS.style.left = startPosS + 'px';
				countObjectss++;
				startPosS+=2;
			}			
			aTabS = aTabS.nextSibling;
		}
		
		return;
	}
	
	function tabClickS()
	{
		showTabS(this.id.replace(/[^\d]/g,''));
		
	}
	
	function rolloverTabS()
	{
		if(this.className.indexOf('tabInactive')>=0){
			this.className='inactiveTabOver';
			var imgS = this.getElementsByTagName('IMG')[0];
			imgS.src = '../docroot/fecliba/images/tab_right_over.gif';
		}
		
	}
	function rolloutTabS()
	{
		if(this.className ==  'inactiveTabOver'){
			this.className='tabInactive';
			var imgS = this.getElementsByTagName('IMG')[0];
			imgS.src = '../docroot/fecliba/images/tab_right_inactive.gif';
		}
		
	}
	
	function initTabsS(tabTitles,activeTab,width,height)
	{
		tabObjS = document.getElementById('dhtmlgoodies_tabViewS');
		width = width + '';
		if(width.indexOf('%')<0)width= width + 'px';
		tabObjS.style.width = width;
		
		height = height + '';
		if(height.length>0){
			if(height.indexOf('%')<0)height= height + 'px';
			tabObjS.style.height = height;
		}
		
		var tabDivS = document.createElement('DIV');
		
		var firstDivS = tabObjS.getElementsByTagName('DIV')[0];
		
		tabObjS.insertBefore(tabDivS,firstDivS);
		tabDivS.className = 'dhtmlgoodies_tabPane';
		for(var no=0;no<tabTitles.length;no++){
			var aTabS = document.createElement('DIV');
			aTabS.id = 'tabTabS' + no;
			aTabS.onmouseover = rolloverTabS;
			aTabS.onmouseout = rolloutTabS;
			aTabS.onclick = tabClickS;
			aTabS.className='tabInactive';
			tabDivS.appendChild(aTabS);
			var spanS = document.createElement('SPAN');
			spanS.innerHTML = tabTitles[no];
			aTabS.appendChild(spanS);
			
			var imgS = document.createElement('IMG');
			imgS.valign = 'bottom';
			imgS.src = '../docroot/fecliba/images/tab_right_inactive.gif';
			// IE5.X FIX
			if((navigatorVersion && navigatorVersion<6) || (MSIE && !strictDocTypeS)){
				imgS.style.styleFloat = 'none';
				imgS.style.position = 'relative';	
				imgS.style.top = '4px'
				spanS.style.paddingTop = '4px';
				aTabS.style.cursor = 'hand';
			}	// End IE5.x FIX
			aTabS.appendChild(imgS);
		}

		var tabsS = tabObjS.getElementsByTagName('DIV');
		var divCounters = 0;
		for(var no=0;no<tabsS.length;no++){
			if(tabsS[no].className=='dhtmlgoodies_aTabS'){
				if(height.length>0)tabsS[no].style.height = height;
				tabsS[no].style.display='none';
				tabsS[no].id = 'tabViewS' + divCounters;
				divCounters++;
			}			
		}		
		showTabS(activeTab);
	}	
