

/*

function stopNews() {
	if (timer != null) {
		clearTimeout(timer);
		timer = null;
	}
}
*/


/*
	This function is called by the onClick event from within the TabNavivation. It determines
	the active tab based on a passed in TabID and resets the grid button to the first
	item within the SubChild (news content) record count.
*/
function showTab(nTabID, sTabID, sFeatureID, nFeatureCount, sFeatureGridID, nChildRecordCount, sType) {
	//alert(nTabID + ':' + sTabID + ':' + sFeatureID + ':' + nFeatureCount + ':' + sFeatureGridID + ':' + nChildRecordCount + ':' + sType)
	var nCurrentTab = 1;
	// Loop over the FlipperX collection's record count
	for(var i = 1; i<=nChildRecordCount; i++) {
		if (i == nTabID) {
			document.getElementById('tabNav_'+sTabID+'_'+i).className = 'tabNavActive';
			document.getElementById('tab_'+sTabID+'_'+i).style.display = 'block';
			if (sType == 'Feature') {
				for(var e = 1; e <= nFeatureCount; e++) {
					// If the loop index EQ 1, toggle the display and class On
					if(e == 1) {
						document.getElementById(sFeatureID+e).style.display = 'block';
						document.getElementById(sFeatureGridID+e).className = 'On';
					//Otherwise toggle the display and class Off
					} else {
						document.getElementById(sFeatureID+e).style.display = 'none';
						document.getElementById(sFeatureGridID+e).className = 'Off';
					}
				}
			}
		} else {
			
			document.getElementById('tab_'+sTabID+'_'+i).style.display = 'none';
			
			if (i == nChildRecordCount) {
				document.getElementById('tabNav_'+sTabID+'_'+i).className = 'tabNavInactive_Right';
			} else if (i == 1) {
				if (nChildRecordCount > 2) {
					if (nTabID == nChildRecordCount) {
						document.getElementById('tabNav_'+sTabID+'_'+i).className = 'tabNavInactive_Right';
					} else {
						document.getElementById('tabNav_'+sTabID+'_'+i).className = 'tabNavInactive_Left';
					}
				} else {
					if (nTabID == nChildRecordCount) {
						document.getElementById('tabNav_'+sTabID+'_'+i).className = 'tabNavInactive_Left';
					} else {
						document.getElementById('tabNav_'+sTabID+'_'+i).className = 'tabNavInactive_Right';
					}
				}
			} else {
				if (nTabID == nChildRecordCount) {
					document.getElementById('tabNav_'+sTabID+'_'+i).className = 'tabNavInactive_Left';
				} else {
					document.getElementById('tabNav_'+sTabID+'_'+i).className = 'tabNavInactive_Right';
				}
			}
		}
		
	}
	
}

/*
	This function is called by the onClick event within the Feature Grid. It toggles
	the On/Off styles of the Feature Grid buttons.
*/
function showFeature(sFeatureID, nFeatureID, nSubChildRecordCount, sFeatureGridID) {
	// Loop over the SubChild (news story) record count
	for (var i = 1; i <= nSubChildRecordCount; i++) {
		// If the loop index EQ the passed in FeatureID, toggle the display and class On
		if (i == nFeatureID) {
			document.getElementById(sFeatureID+i).style.display = 'block';
			document.getElementById(sFeatureGridID+i).className = 'On';
		}
		//Otherwise toggle the display and class Off
		else {
			document.getElementById(sFeatureID+i).style.display = 'none';
			document.getElementById(sFeatureGridID+i).className = 'Off';
		}
	}
	
}