function showNavTab(tabId,tabNo) {
	var tabCollection = document.getElementById(tabId);
	tabCollection.className='Tab'+tabNo+'Visible';
}
function navThis(url) {
	top.location.href = url;
}
/* FOR INDUSTRY SSI ON SNAPSHOTS */
function revealAllCompanies() {
	if (navigator.appName=="Microsoft Internet Explorer") {
		document.getElementById('moreIndustriesTable').style.display = 'block';
	} else {
		document.getElementById('moreIndustriesTable').style.display = 'table';
	}
	document.getElementById('expandIndustries').style.display='none';
	document.getElementById('expandIndustries2').innerHTML='<a href="javascript:hideSomeCompanies();">See fewer</a>';
}
function hideSomeCompanies() {
	document.getElementById('moreIndustriesTable').style.display = 'none';
	document.getElementById('expandIndustries').style.display='block';
	document.getElementById('expandIndustries2').innerHTML='<a href="javascript:revealAllCompanies();">See all</a>';
}
/* FOR SEARCH WIDGET */
function DoTheCheckBig() {
	bigEmp = document.getElementById('bigEmp');
	smallEmp = document.getElementById('smallEmp');
	if (bigEmp.checked == true) {
		smallEmp.checked = false;
	}
}
function DoTheCheckSmall() {
	bigEmp = document.getElementById('bigEmp');
	smallEmp = document.getElementById('smallEmp');
	if (smallEmp.checked == true) {
		bigEmp.checked = false;
	}
}
function expIndList() {
	var indList = document.getElementById('industryList');
	var indToggle1 = document.getElementById('indControls1');
	var indToggle2 = document.getElementById('indControls2');
	indList.style.display = 'block';
	indToggle1.innerHTML = '<a href="javascript:contIndList();">Select Industry\(s\)</a>';
	indToggle2.innerHTML = '<a href="javascript:contIndList();">Hide</a>';
}
function contIndList() {
	var indList = document.getElementById('industryList');
	var indToggle1 = document.getElementById('indControls1');
	var indToggle2 = document.getElementById('indControls2');
	indList.style.display = 'none';
	indToggle1.innerHTML = '<a href="javascript:expIndList();">Select Industry\(s\)</a>';
	indToggle2.innerHTML = '<a href="javascript:expIndList();">See all</a>';
}
function expStateList() {
	var stateList = document.getElementById('stateList');
	var stateToggle1 = document.getElementById('stateControls1');
	var stateToggle2 = document.getElementById('stateControls2');
	stateList.style.display = 'block';
	stateToggle1.innerHTML = '<a href="javascript:contStateList();">Select State\(s\)</a>';
	stateToggle2.innerHTML = '<a href="javascript:contStateList();">Hide</a>';
}
function contStateList() {
	var stateList = document.getElementById('stateList');
	var stateToggle1 = document.getElementById('stateControls1');
	var stateToggle2 = document.getElementById('stateControls2');
	stateList.style.display = 'none';
	stateToggle1.innerHTML = '<a href="javascript:expStateList();">Select State\(s\)</a>';
	stateToggle2.innerHTML = '<a href="javascript:expStateList();">See all</a>';
}

/* FOR GALLERY TOUTS ON SNAPSHOTS */
function writeWidgetBox(numFrames,currShow,fade) {
	for (var i=1; i<=numFrames; i++) {
		document.getElementById('tn'+i).style.visibility = "hidden";
		document.getElementById('tn'+i).style.display = "none";
		if (i==currShow) {
			document.getElementById('tn'+i).style.visibility = "visible";
			document.getElementById('tn'+i).style.display = "block";
		}
	}
	//if (fade==true) {shiftOpacity('tncontainer', 500);}
	var sequenceInd = document.getElementById('widgetSeqNums');
	sequenceInd.innerHTML = '';
	sequenceInd.innerHTML = '\(' + currShow + ' of ' + numFrames + '\)';
	var fade = true;
}
function shiftOpacity(id, millisec) {
	document.getElementById(id).style.opacity = 0
	opacity(id, 0, 100, millisec);
}
function opacity(id, opacStart, opacEnd, millisec) {
	var speed = Math.round(millisec / 100);
	var timer = 0;
	for(i = opacStart; i <= opacEnd; i++) {
		setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
		timer++;
	}
}
function changeOpac(opacity, id) {
	var object = document.getElementById(id).style;
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}
function rotateMe(total,curr) {
	var newRotate = curr+1;
	if ( newRotate > total ) { newRotate = 1; }
	writeWidgetBox(total,newRotate,true);
	setTimeout("rotateMe("+total+","+newRotate+")",7000);
}
/* FOR VIDEO TOUTS */
function writeWidgetBoxVideo(numFrames,currShow,fade, restart_interval) {
	if(typeof(restart_interval) == "undefined")
	{
		var restart_interval = false;
	}
	for (var i=1; i<=numFrames; i++) {
		document.getElementById('tnVideo'+i).style.visibility = "hidden";
		document.getElementById('tnVideo'+i).style.display = "none";
		if (i==currShow) {
			document.getElementById('tnVideo'+i).style.visibility = "visible";
			document.getElementById('tnVideo'+i).style.display = "block";
		}
	}
	//if (fade==true) {shiftOpacity('tncontainerVideo', 500);}
	var sequenceInd = document.getElementById('widgetSeqNumsVideo');
	sequenceInd.innerHTML = '';
	sequenceInd.innerHTML = '\(' + currShow + '&nbsp;of&nbsp;' + numFrames + '\)';
	var fade = true;
	

	if(restart_interval == true)
	{
		cnnRotateWidgetBoxVideo.restart(currShow);
	}
	
}
function rotateMeVideo(total,curr) {
	var newRotate = curr+1;
	if ( newRotate > total ) { newRotate = 1; }
	writeWidgetBoxVideo(total,newRotate,true);
	setTimeout("rotateMeVideo("+total+","+newRotate+")",7000);
}

/**
 * Image rotate object
 * For reuse, make a class, add a callback capability
 */
var cnnRotateWidgetBoxVideo = {
	window_interval:null,
	total_frames:1,
	current_frame:1,
	
	init:function(total_frames, current_frame)
	{
		this.total_frames = total_frames;
		this.current_frame = current_frame;
	},
	restart:function(current_frame)
	{
		this.current_frame = current_frame;
		this.stop();
		this.start();
	},
	rotate:function()
	{
		this.current_frame++;
		if(this.current_frame > this.total_frames)
		{
			this.current_frame = 1;
		}
		writeWidgetBoxVideo(this.total_frames, this.current_frame, true, false);
	},
	start:function(total_frames, current_frame)
	{
		this.window_interval = window.setInterval('cnnRotateWidgetBoxVideo.rotate()', 7000);
	},
	stop:function()
	{
		if(this.window_interval != null)
		{
			window.clearInterval(this.window_interval);
			this.window_interval = null;
		}
	}
};