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  slideProjection() {
		var _self = this;
		this.continueRoll = true;
		this.numFrames = 0;
		this.currFrame = 1;
		this.projectorId = '';
		this.projector = '';
		this.sliderTimer = null;
		this.sliderDelay = 10000;
		this.init = function (projId, totalFrames, curr, autoRoll, speed) {
			this.projectorId = projId;
			this.projector = document.getElementById(this.projectorId);
			this.numFrames = totalFrames;
			this.continueRoll = (autoRoll && this.numFrames > 1) ? autoRoll: false;
			this.sliderDelay = (speed === undefined) ? 10000 : speed;
		}
		this.showSlide = function (currShow) {
			this.currFrame = currShow;
			var slideLI;
			slideLI = jQuery("#"+this.projectorId + " li");
			slideLI.removeClass('selected');
			slideLI = jQuery("#"+this.projectorId + " li.tn" + this.currFrame);
			slideLI.addClass('selected');
			
			// pagination
			var pages = jQuery("#"+this.projectorId +" .cnnPager li");
			pages.removeClass('selected');

			pages = jQuery("#"+this.projectorId + " .cnnPager li a:contains('"+ this.currFrame +"')");
			pages.addClass('selected');
			pages.parent().addClass('selected');
			if(this.continueRoll) this.rotateMe();
		}
		this.rotateMe = function () {
			var newRotate = this.currFrame+1;
			if (newRotate > this.numFrames ) { newRotate = 1; }
			this.sliderTimer = setTimeout(function() {_self.showSlide(newRotate); }, this.sliderDelay);
		}
		this.pause = function (slideNum) {
			clearTimeout(this.sliderTimer);
			this.continueRoll = false;
			this.showSlide(slideNum);
		}

}//end ()




/* 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;
		}
	}
};
