var whichFact;
var intervalTime=20000;
var pausePlay = "pause";
var controlBlock = "&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"border:1px solid white;\"><a href=\"javascript:prevFact();\">&lt;&lt;</a>&nbsp;&nbsp;<a href=\"javascript:pause();\" style=\"font-size:8px;\">||</a>&nbsp;&nbsp;<a href=\"javascript:nextFact();\">&gt;&gt;</a></span>"
var control

// ARRAY OF FACTS / CASE STUDIES
var fact=new Array()
   fact[1]="<p><b class='fact-bold'>Case Study - National Head Start Association:</b><br />\"Launching a Telework!VA program in 2001, the National Head Start Association has seen productivity increase markedly for teleworking individuals. Teleworkers enjoyed reduced commute times and costs, being closer to family... and the general lessening of stress in all aspects of their lives.\"<br /><br /><a href=\"/forManagers/national_head_start.aspx\">Read More...</a> "+  controlBlock +"</p>";
   fact[2]="<p><b class='fact-bold'>Case Study - National School Boards Association:</b><br />\"Thirty-five employees participated in the National School Board Association's Telework!VA program 2004-2006. Dispelling one of teleworking's biggest myths, supervisors said communication actually improved. Also, teleworkers reported an average increase in productivity of 17 percent.\"<br /><br /><a href=\"/forManagers/nsba.aspx\">Read More...</a> "+ controlBlock +"</p>";
   fact[3]="<p><b class='fact-bold'>Case Study - National Wildlife Federation:</b><br />\"Because the National Wildlife Federation is a conservation and environmental organization, it made sense for this steward of Mother Earth to implement a formal telework program for its employees. During the two-year project period, the program grew by more than 900 percent and vehicle trips were reduced by 2,947.\"<br /><br /><a href=\"/forManagers/national_wildlife_federation.aspx\">Read More...</a> "+ controlBlock +"</p>";
   fact[4]="<p><b class='fact-bold'>Case Study - CIMA</b><br />\"A VOIP telephone system combined with a document imaging system has allowed us to create a virtual office in the telework environment. Operating costs have been reduced significantly. Productivity has remained high, if not increased. Employee satisfaction with the program is high\"<br /><br /><a href=\"/forManagers/cima.aspx\">Read More...</a> "+ controlBlock +"</p>";
   fact[5]="<p><b class='fact-bold'>Case Study - Endependence Center</b><br>\"Our teleworkers report that they are working more efficiently and effectively, and as a disability organization, many of our employees have benefited from the reduction in their commute in terms of stamina and avoiding the physical strain required to travel to and from work every day.\"<br /><br /><a href=\"/forManagers/national_wildlife_federation.aspx\">Read More...</a> "+ controlBlock +"</p>";
   fact[6]="<p><b class='fact-bold'>Case Study - MHZ Networks</b><br />\"Teleworking is immensely popular at MHz. We were able to retain a valued employee who moved from Falls Church to Fredericksburg a few months ago, because we're allowing her to telecommute two to three days a week. It's helpful for both attracting and retaining employees in the congested metro area that we all live in.\"<br /><br /><a href=\"/forManagers/mhz_networks.aspx\">Read More...</a> "+ controlBlock +"</p>";
   fact[7]="<p><b class='fact-bold'>Case Study - Mid-Atlantic Business Systems</b><br />\"Telework!VA has enabled us to allow a number of our staff members to work from home-based or virtual offices an average of two days per week.  As a result, we've found that our employees' relationships with internal and external customers have improved. In addition, the decreased commuting time and lower fuel expenses that the employees experience engender loyalty to MABC.\"<br /><br /><a href=\"/forManagers/midatlantic_business_systems.aspx\">Read More...</a> "+ controlBlock +"</p>";

function pause(){
	if (document.title == ""){document.title = "Telework!Va"}
	if (pausePlay == "play"){
		pausePlay = "pause";
		window.clearInterval(control);
	}
	else{
		pausePlay = "play";
		control = window.setInterval("nextFact()",intervalTime);
	}
}

function get_random()
{
    var ranNum= Math.floor(Math.random()*fact.length);
	if ((ranNum == 0)||(!ranNum)||(ranNum > fact.length)){(ranNum = 1)}
    return ranNum;
}
function nextFact()
{
   if (whichFact == (fact.length-1))
   {
   theFact = (fact[1]);
   whichFact = 1;
   writeTheFact();
   }
   else{
   theFact = (fact[whichFact+1]);
   whichFact = whichFact+1;
   writeTheFact();
   }
  }
function prevFact()
{
   if (whichFact == 1)
   {writeTheFact();}
   else{
   theFact = (fact[whichFact-1]);
   whichFact = whichFact-1;
   writeTheFact();
   }
  }
function randomFacts()
{
   whichFact=get_random();
   theFact = (fact[whichFact]);
  }
//
var theFact;

function writeTheFact() {
	
		if (document.getElementById) {
			document.getElementById('fact-feed').innerHTML=theFact;
		} else if (document.all) {
			document.all[fact-feed].innerHTML = theFact;
		}
	
}

function start() {
  control = window.setInterval("nextFact()",intervalTime);
}

function ReadCookie(cookieName) {
 var file_name = document.location.href;
 var end = (file_name.indexOf("?") == -1) ? file_name.length : file_name.indexOf("?");
 var theFileName = file_name.substring(file_name.lastIndexOf("/")+1, end)
 var theCookie=""+document.cookie;
 var ind=theCookie.indexOf(cookieName);
 if (ind==-1 || cookieName=="") return ""; 
 var ind1=theCookie.indexOf(';',ind);
 if (ind1==-1) ind1=theCookie.length; 
 if (((theCookie.substring(ind+cookieName.length+1,ind1)) <= 1) && ((theFileName == "Default.aspx")||(theFileName == "")))
 {
	 	alert("");
 }
}