
	/************************************************************************************************************
	(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 textPadding = 3; // Padding at the left of tab text - bigger value gives you wider tabs
	var strictDocType = true;	// Set to true if you're using a strict or loose doctype, false otherwise

	/* Don't change anything below here */
	var tabObj;
	var activeTabIndex = -1;
	var MSIE = navigator.userAgent.indexOf('MSIE')>=0?true:false;
	var navigatorVersion = navigator.appVersion.replace(/.*?MSIE (\d\.\d).*/g,'$1')/1;

	var tabPaneTabPaths = new Array();

	function setPadding(obj,padding){
		var span = obj.getElementsByTagName('SPAN')[0];
		span.style.paddingLeft = padding + 'px';
		span.style.paddingRight = padding + 'px';
	}
	function showTab(tabIndex)
	{
		if(activeTabIndex>=0){
			if(activeTabIndex==tabIndex)return;
		}

		var thisObj = document.getElementById('tabTab'+tabIndex);
		if (thisObj.className.indexOf('dios_displayreport0910m_sid') >= 0) {// 200910m display component
			thisObj.className='tabActive_dios_displayreport0910m_sid';
		} else {// default
			thisObj.className='tabActive';
		}
		var img = thisObj.getElementsByTagName('IMG')[0];
		/*if (thisObj.className.indexOf('dios_displayreport0910m_sid') >= 0) {// 200910m display component
			img.src = '/dios/images/tab_right_active_display_component.gif';
		}
		else {// default*/
			img.src = '/dios/images/tab_right_active.gif';
		/*}*/
		activeTabIndex = tabIndex;

		var parentObj = thisObj.parentNode;
		var aTab = parentObj.getElementsByTagName('DIV')[0];
		countObjects = 0;
		var startPos = 2;
		var previousObjectActive = false;
		while(aTab){
			if(aTab.tagName=='DIV'){
				if(previousObjectActive){
					previousObjectActive = false;
					startPos-=2;
				}
				if(aTab==thisObj){
					startPos-=2;
					previousObjectActive=true;
					setPadding(aTab,textPadding+1);
				}else{
					setPadding(aTab,textPadding);
				}

				aTab.style.left = startPos + 'px';
				countObjects++;
				startPos+=2;
			}
			aTab = aTab.nextSibling;
		}

		return;
	}

	function tabClick()
	{
	  showTab( this.id.replace(/[^\d]/g,'') );
	  window.location = tabPaneTabPaths[ this.id.replace(/[^\d]/g,'') ];
	}

	function rolloverTab()
	{
		/*if (this.className.indexOf('dios_displayreport0910m_sid') >= 0) {// 200910m display component
			this.className='inactiveTabOver_dios_displayreport0910m_sid';
			var img = this.getElementsByTagName('IMG')[0];
			img.src = '/dios/images/tab_right_over_display_component.gif';
		}
		else*/ if (this.className.indexOf('tabInactive') >= 0) {// default
			this.className='inactiveTabOver';
			var img = this.getElementsByTagName('IMG')[0];
			img.src = '/dios/images/tab_right_over.gif';
		}
	}

	function rolloutTab()
	{
		/*if (this.className.indexOf('inactiveTabOver_dios_displayreport0910m_sid') >= 0) {// 200910m display component
			this.className='tabInactive_dios_displayreport0910m_sid';
			var img = this.getElementsByTagName('IMG')[0];
			img.src = '/dios/images/tab_right_inactive_display_component.gif';
		}
		else*/ if (this.className == 'inactiveTabOver') {// default
			this.className='tabInactive';
			var img = this.getElementsByTagName('IMG')[0];
			img.src = '/dios/images/tab_right_inactive.gif';
		}
	}

	function initTabs(tabTitles,tabPaths,activeTab,width,height)
	{
		tabPaneTabPaths = tabPaths;
		if (activeTab < 0) {
		  // Default
		  activeTab = 0;
	  	}

		tabObj = document.getElementById('diosTabs');
		width = width + '';
		if(width.indexOf('%')<0)width= width + 'px';
		tabObj.style.width = width;

		height = height + '';
		if(height.length>0){
			if(height.indexOf('%')<0)height= height + 'px';
			tabObj.style.height = height;
		}

		var tabDiv = document.createElement('DIV');

		var firstDiv = tabObj.getElementsByTagName('DIV')[0];

		tabObj.insertBefore(tabDiv,firstDiv);
		tabDiv.className = 'dhtmlgoodies_tabPane';
		for(var no=0;no<tabTitles.length;no++){
			var aTab = document.createElement('DIV');
			aTab.id = 'tabTab' + no;
			aTab.onmouseover = rolloverTab;
			aTab.onmouseout = rolloutTab;
			aTab.onclick = tabClick;
			// select inactive class based on tab name
			if (tabPaths[no].indexOf('/dios/displayReport0910m.php') >= 0) {// 200910m display component
				aTab.className='tabInactive_dios_displayreport0910m_sid';
			}
			else {// default
				aTab.className='tabInactive';
			}
			tabDiv.appendChild(aTab);
			var span = document.createElement('SPAN');
			span.innerHTML = tabTitles[no];
			aTab.appendChild(span);

			var img = document.createElement('IMG');
			img.valign = 'bottom';

			// select right image inactive based on tab name
			/*if (tabPaths[no].indexOf('/dios/displayReport0910m.php') >= 0) {// 200910m display component
				img.src = '/dios/images/tab_right_inactive_display_component.gif';
			}
			else {// default*/
				img.src = '/dios/images/tab_right_inactive.gif';
			/*}*/

			// IE5.X FIX
			if((navigatorVersion && navigatorVersion<6) || (MSIE && !strictDocType)){
				img.style.styleFloat = 'none';
				img.style.position = 'relative';
				img.style.top = '4px'
				span.style.paddingTop = '4px';
				aTab.style.cursor = 'hand';
			}	// End IE5.x FIX
			aTab.appendChild(img);
		}
		showTab(activeTab);
	}// function initTabs

