// JavaScript Document
// JavaScript Document

var num=0;
var timedFunc = '';
var timedNum = 0;
// format: src, alt, text --->
var imgArray = [  
		 ['<a href="/aftemplate.cfm?template=/Content/ContentGroups/News/ISA_Insights1/200917/April41/Automation_Federation_Spotlight.htm"><img src="/Graphics/aftemplate/panels/06-2009-boy-scout.jpg" alt="Boy Scout" border="0"></a>', 'The Automation Federation recently announced that it has been selected by the Boy Scouts of America to provide activities for Technology Quest at the 2010 Boy Scout Jamboree. <a href="/aftemplate.cfm?template=/Content/ContentGroups/News/ISA_Insights1/200917/April41/Automation_Federation_Spotlight.htm">More...</a>'],
		 ['<a href="/aftemplate.cfm?template=/Content/ContentGroups/News/ISA_Insights1/200917/June45/Automation_Federation_and_ISA_Join_In_Presenting_National_Energy_Policy_Goals_Proclamation_to_US_Congress.htm"><img src="/graphics/aftemplate/panels/06-2009-energy.jpg" alt="Energy" border="0"></a>', 'The Automation Federation and the International Society of Automation (ISA) joined nineteen other energy- and technology-oriented organizations in presenting a National Energy Policy. <a href="/aftemplate.cfm?template=/Content/ContentGroups/News/ISA_Insights1/200917/June45/Automation_Federation_and_ISA_Join_In_Presenting_National_Energy_Policy_Goals_Proclamation_to_US_Congress.htm">More...</a>'],
		 ['<a href="/aftemplate.cfm?template=/Content/ContentGroups/News/ISA_Insights1/200917/June45/Automation_Federation_Participates_in_United-States_-_European_Union_Roundtable_Discussion_on_Economic_Recovery.htm"><img src="/graphics/aftemplate/panels/06-2009-roundtable.jpg" alt="Roundtable" border="0"></a>', 'The Automation Federation was invited to participate in a United States – European Union Roundtable to discuss \“Skills for Growth and Jobs in the Economic Recovery and Beyond.\” <a href="/aftemplate.cfm?template=/Content/ContentGroups/News/ISA_Insights1/200917/June45/Automation_Federation_Participates_in_United-States_-_European_Union_Roundtable_Discussion_on_Economic_Recovery.htm">More...</a>'],
		 ['<a href="/aftemplate.cfm?template=/Content/ContentGroups/News/ISA_Insights1/200917/May40/AF_Spotlight.htm"><img src="/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="/aftemplate.cfm?template=/Content/ContentGroups/News/ISA_Insights1/200917/July42/AF_Spotlight__ISA99_and_ISA100_Standards_Included_in_the_EPRI_Interim_Report_on_the_Smart_Grid_Interoperability_Standards_Roadmap_for_NIST_.htm"><img src="/graphics/aftemplate/panels/07-2009-epri-report.jpg" alt="EPRI Interim Report" border="0"></a>', 'The ISA99 Manufacturing and Control Systems Security Standard and ISA100 Wireless Systems for Automation, the emerging standard for industrial wireless, have been identified for use in the Smart Grid Interoperability Standards Roadmap for the NIST by EPRI. <a href="/aftemplate.cfm?template=/Content/ContentGroups/News/ISA_Insights1/200917/July42/AF_Spotlight__ISA99_and_ISA100_Standards_Included_in_the_EPRI_Interim_Report_on_the_Smart_Grid_Interoperability_Standards_Roadmap_for_NIST_.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>']
		]

function Initialize()
{
  num = Math.floor(Math.random()*6);
  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 = imgArray.length - 1; }
  else if (value > 5) { value = 0 }
  return value; 
}


function slideshowUp() {
  num++;
  num = LimitNumber(num);
  slide(num,'panels','panelsDesc');
  clearInterval(timeFunc);
  InitTimeInterval();
}

function slideshowBack() {
  num--;
  if (num < 0) { num = 6; }
  slide(num,'panels','panelsDesc');
  clearInterval(timeFunc);
  InitTimeInterval();
}