// JavaScript Document
// JavaScript Document

var num=0;
var timedFunc = '';
var timedNum = 0;
// format: src, alt, text --->



var imgArray = [['<a href="http://www.automationfederation.org/AFTemplate.cfm?Section=Press_Room5&template=/ContentManagement/ContentDisplay.cfm&ContentID=87994"><img src="/Graphics/aftemplate/panels/4362_SWE.jpg" alt="" border="0"></a>', 'The Society of Women Engineers (SWE), founded in 1950, is a not-for-profit educational and service organization. SWE is the driving force that establishes engineering as a highly desirable career aspiration for women. <a href="http://www.automationfederation.org/AFTemplate.cfm?Section=Press_Room5&template=/ContentManagement/ContentDisplay.cfm&ContentID=87994">Learn More...</a>'],
		['<a href="http://www.automationfederation.org/AFTemplate.cfm?Section=Press_Room5&template=/ContentManagement/ContentDisplay.cfm&ContentID=87959"><img src="/Graphics/aftemplate/panels/SME_panel.jpg" alt="" border="0"></a>', 'The Society of Manufacturing Engineers (SME) is the world\'s leading professional society advancing manufacturing knowledge and influencing more than half a million manufacturing practitioners annually. <a href="http://www.automationfederation.org/AFTemplate.cfm?Section=Press_Room5&template=/ContentManagement/ContentDisplay.cfm&ContentID=87959">Learn More...</a>'],
		['<a href="http://www.automationfederation.org/CareerPoster"><img src="/Graphics/aftemplate/panels/4439-sme-foundation-poster-panel.jpg" alt="" border="0"></a>', 'AF and its member organization, the Society of Manufacturing Engineers (SME) Education Foundation, will be distributing a "Consider a Career in Automation" poster to the 4,000+ Project Lead The Way middle and high schools across the U.S. <a href="http://www.automationfederation.org/CareerPoster">Click here to view the poster.</a>'],
		['<a href="http://www.isa.org/Content/ContentGroups/News/ISA_Insights1/201113/November41/Automation_Federation_Career_Day_2011_success.htm?utm_source=ISA%2BCorporate&utm_medium=Email%2BPromotion-Non%2BListPilot&utm_campaign=Nov11%2BCareer"><img src="/Graphics/aftemplate/panels/4386-ACD-AF-home-page-panel.jpg" alt="2011 Automation Career Connections slideshow now available!" border="0"></a>', 'AF, ISA, and Bishop State Community College hosted a successful Automation Career Day at ISA Automation Week 2011 in Mobile, Alabama. This mini-career fair introduced over 900 high school students to the many exciting careers in automation... <a href="http://www.isa.org/Content/ContentGroups/News/ISA_Insights1/201113/November41/Automation_Federation_Career_Day_2011_success.htm?utm_source=ISA%2BCorporate&utm_medium=Email%2BPromotion-Non%2BListPilot&utm_campaign=Nov11%2BCareer">Learn More...</a>'],
		['<a href="http://automationfederation.org/AFTemplate.cfm?Section=The_Automation_Federation&template=/ContentManagement/ContentDisplay.cfm&ContentID=83675"><img src="/Graphics/aftemplate/panels/3815-AF-FIRST-home-pg-web-panel.jpg" alt="AF and FIRST" border="0"></a>', 'The Automation Federation (AF) announced that FIRSTŪ (For Inspiration and Recognition of Science and Technology) has formed a global strategic alliance with AF and the International Society of Automation (ISA) to promote the importance of science, technology... <a href="http://automationfederation.org/AFTemplate.cfm?Section=The_Automation_Federation&template=/ContentManagement/ContentDisplay.cfm&ContentID=83675">More...</a>'],
		 ['<a href="http://thevoice.automationfederation.org"><img src="/Graphics/aftemplate/panels/3811-The-Voice-web-panel.jpg" alt="The Voice" border="0"></a>', 'The Automation Federation Communications Committee has created this newsletter/blog to help spread the message about all the good things the Automation Federation is doing for the automation profession, and as part of our efforts to promote the... <a href="http://thevoice.automationfederation.org">Read the blog...</a>'],
		 ['<a href="/aftemplate.cfm?template=/Content/ContentGroups/News/ISA_Insights1/200917/May40/AF_Spotlight.htm"><img src="http://www.isa.org/graphics/aftemplate/panels/06-2009-competency-model.jpg" alt="Automation Competency Model" border="0"></a>', 'On 17 April leaders of the Automation Federation and representatives from the U.S. Department of Labor, DOL, met to complete the work of the Automation Competency Model. <a href="/aftemplate.cfm?template=/Content/ContentGroups/News/ISA_Insights1/200917/May40/AF_Spotlight.htm">More...</a>'],
		 ['<a href="http://www.isa.org/template.cfm?Section=ISA_Insights&template=/Content/ContentGroups/News/ISA_Insights1/200917/July42/Importance_of_Automation_in_Manufacturing_Gets_Recognized_by_U_S__Congress.htm"><img src="/Graphics/aftemplate/panels/Importance_Automation_Manufacturing.jpg" alt="Importance of Automation Manufacturing" border="0"></a>', 'It\'s not everyday that automation and manufacturing take center stage, but on 25 June 2009, a giant leap took place as the importance of automation in manufacturing was included in a report language submitted by Senator Barbara Mikulski (D-MD) <a href="http://www.isa.org/template.cfm?Section=ISA_Insights&template=/Content/ContentGroups/News/ISA_Insights1/200917/July42/Importance_of_Automation_in_Manufacturing_Gets_Recognized_by_U_S__Congress.htm">More...</a>'],
		 ['<a href="http://www.automationfederation.org/AFTemplate.cfm?Section=Press_Room5&template=/ContentManagement/ContentDisplay.cfm&ContentID=85602"><img src="/Graphics/aftemplate/panels/4033-AF-homepage-panel-CSIA.jpg" alt="AF welcomes new member: the Control Systems Integrators Association (CSIA)" border="0"></a>', 'CSIA is a global, not-for-profit, professional association for control system integration companies. Control System Integrators utilize industrial automation equipment and software in the implementation of their projects in a wide variety of industries....  <a href="http://www.automationfederation.org/AFTemplate.cfm?Section=Press_Room5&template=/ContentManagement/ContentDisplay.cfm&ContentID=85602">More...</a>'],
		 ['<a href="http://www.automationfederation.org/AFTemplate.cfm?Section=Press_Room5&template=/ContentManagement/ContentDisplay.cfm&ContentID=85770"><img src="/Graphics/aftemplate/panels/4033-AF-homepage-panel-ASMC.jpg" alt="AF welcomes new member: the American Small Manufacturers Coalition (ASMC)" border="0"></a>', 'The American Small Manufacturers Coalition (ASMC) is a trade association of manufacturing extension agents who work to improve the innovation and productivity of America\'s manufacturing community....  <a href="http://www.automationfederation.org/AFTemplate.cfm?Section=Press_Room5&template=/ContentManagement/ContentDisplay.cfm&ContentID=85770">More...</a>']];

count=imgArray.length;
  
function Initialize()
{

  num = Math.floor(Math.random()*count);
  slide(num,'panels','panelsDesc');
  InitTimeInterval();
}

function slide(slide_num,panels,panelsDesc) {
  document.getElementById(panels).innerHTML=imgArray[slide_num][0];
  document.getElementById(panelsDesc).innerHTML=imgArray[slide_num][1];
}


function InitTimeInterval() {
  timeFunc = setInterval("TimedImage()",6000);
}


function TimedImage() {
  num++;
  num = LimitNumber(num);
  slide(num,'panels','panelsDesc');
}


function LimitNumber(value) {
  if (value < 0) { value = count - 1; }
  else if (value >= count) { value = 0 }
  return value; 
}


function slideshowUp() {
  num++;
  num = LimitNumber(num);
  slide(num,'panels','panelsDesc');
  clearInterval(timeFunc);
  InitTimeInterval();
}

function slideshowBack() {
  num--;
  if (num < 0) { num = count; }
  slide(num,'panels','panelsDesc');
  clearInterval(timeFunc);
  InitTimeInterval();
}
