/* RELEASE DATE (YYMMDD): 120213 */

/* <![CDATA[ */

var imagePath = '/hp-pa/img/theme/'
var imageExt = '.jpg'
var imageArray = new Array()
imageArray[0] = '3956'
imageArray[1] = '3867'
imageArray[2] = '2162'
imageArray[3] = '2621'

var dateArray = new Array()
dateArray[0] = 'February 10, 2012'
dateArray[1] = 'February 8, 2012'
dateArray[2] = 'February 7, 2012'
dateArray[3] = 'February 3, 2012'

var linkArray = new Array()
linkArray[0] = '/daily-quotidien/120210/dq120210a-eng.htm'
linkArray[1] = '/daily-quotidien/120208/dq120208a-eng.htm'
linkArray[2] = '/daily-quotidien/120207/dq120207a-eng.htm'
linkArray[3] = '/daily-quotidien/120203/dq120203a-eng.htm'

var titleText = new Array()
titleText[0] = 'Canadian international merchandise trade, December&nbsp;2011'
titleText[1] = '2011&nbsp;Census: Population and dwelling counts'
titleText[2] = 'Building permits, December&nbsp;2011'
titleText[3] = 'Labour Force Survey, January&nbsp;2012'

var summaryArray = new Array()
summaryArray[0] = 'Canada\'s merchandise exports rose 4.5% and imports edged up 0.8%. As a result, Canada\'s trade surplus rose from $1.2 billion in...'
summaryArray[1] = 'The population of Canada increased 5.9% between the 2006 and 2011 censuses, compared with a 5.4% increase during the previous five-year period. The...'
summaryArray[2] = 'Municipalities issued building permits worth $6.8 billion in December, up 11.1% from November. This is the highest level since June 2007. The...'
summaryArray[3] = 'Employment was virtually unchanged in January, and the unemployment rate edged up 0.1 percentage points to 7.6% as more people searched for...'

var altArray = new Array()
altArray[0] = ''
altArray[1] = ''
altArray[2] = ''
altArray[3] = ''

var LongSummary  = new Array()
LongSummary[0] = 'Canada\'s merchandise exports rose 4.5% and imports edged up 0.8%. As a result, Canada\'s trade surplus rose from $1.2 billion in November to $2.7 billion in December.'
LongSummary[1] = 'The population of Canada increased 5.9% between the 2006 and 2011 censuses, compared with a 5.4% increase during the previous five-year period. The increase in the growth rate was attributable to slightly higher fertility and to an increase in the number of non-permanent residents and immigrants.'
LongSummary[2] = 'Municipalities issued building permits worth $6.8 billion in December, up 11.1% from November. This is the highest level since June 2007. The advance in December was due primarily to an increase in multi-family dwellings in Ontario and commercial buildings in Alberta.'
LongSummary[3] = 'Employment was virtually unchanged in January, and the unemployment rate edged up 0.1 percentage points to 7.6% as more people searched for work. Compared with 12 months earlier, employment rose by 129,000 (+0.7%), with most of the growth occurring in the first six months of this period.'

var RegistryNumber = new Array()
RegistryNumber[0] = '3612'
RegistryNumber[1] = '4992'
RegistryNumber[2] = '3592'
RegistryNumber[3] = '3587'

var ThemeList = new Array()
ThemeList[0] = '3956; 1130'
ThemeList[1] = '3867'
ThemeList[2] = '2162'
ThemeList[3] = '2621'

var j = 0
var stopTime
var whichImage = 0;
var seconds = 8;
var waitingTime = 1000;


function showImagePol()
{

  document.write('<div>');
  document.write('<img id="imgA" src="' + imagePath + imageArray[whichImage]+imageExt + '" alt="'+altArray[whichImage]+ '">');
  document.write('<p class="dateText" id="dateText">'+dateArray[whichImage]+'<\/p>');
  document.write('<strong id="topLink">'+titleText[whichImage]+'<\/strong>');
  document.write('<span class="txtaligndr" id="summaryText">'+summaryArray[whichImage]+'<\/span>');
  document.write('<\/div>');
  document.write('<div class="boutonalign">');
  document.write('<a href="javascript:previous()"><img src="images/B_recule1.gif" alt="Previous" /><\/a>&nbsp;')
  document.write('<a href="javascript:play()"><img src="images/B_joue1.gif" alt="Play" /><\/a>&nbsp;')
  document.write('<a href="javascript:stop()"><img src="images/B_pause1.gif" alt="Pause" /><\/a>&nbsp;')
  document.write('<a href="javascript:next()"><img src="images/B_avance1.gif" alt="Next" /><\/a>&nbsp;')
  document.write('<div class="moreLink"><a id="moreLink" href="'+linkArray[whichImage]+'" title="'+altArray[whichImage]+'">'+"Full story..." +'<\/a><\/div>');
  document.write('<\/div>');
		
}

function populate()
{
  seconds = seconds-1;
  stopTime = setTimeout("populate()", waitingTime); 
  if (seconds == 0)
  {
    seconds = 6;
    whichImage = whichImage +1;
    if (whichImage >= imageArray.length)
    {
      whichImage =0;
    }
    document.getElementById("dateText").innerHTML = dateArray[whichImage];
    document.getElementById("topLink").href = linkArray[whichImage];
    document.getElementById("topLink").title= altArray[whichImage];
    document.getElementById("topLink").innerHTML = titleText[whichImage];
    document.getElementById("moreLink").href = linkArray[whichImage];
    document.getElementById("moreLink").title= altArray[whichImage];
    document.getElementById("imgA").src=imagePath + imageArray[whichImage]+imageExt;
    document.getElementById("imgA").alt=altArray[whichImage];
    document.getElementById("summaryText").innerHTML = summaryArray[whichImage];
  }
}

function stop()
{
  clearTimeout(stopTime);
}

function play()
{
  stop();
  stopTime = setTimeout("populate()", waitingTime);
}

function next()
{
  if (whichImage < ((imageArray.length)-1))
  {
    whichImage = whichImage +1;
  }
  else
  {
    whichImage = 0;
  }
  document.getElementById("dateText").innerHTML = dateArray[whichImage];
  document.getElementById("topLink").href = linkArray[whichImage];
  document.getElementById("topLink").title= altArray[whichImage];
  document.getElementById("topLink").innerHTML = titleText[whichImage];
  document.getElementById("moreLink").href = linkArray[whichImage];
  document.getElementById("moreLink").title= altArray[whichImage];
  document.getElementById("imgA").src=imagePath + imageArray[whichImage]+imageExt;
  document.getElementById("imgA").alt=altArray[whichImage];
  document.getElementById("summaryText").innerHTML = summaryArray[whichImage];
}

function previous()
{
  if (whichImage <= ((imageArray.length)-1) && whichImage !=0)
  {
    whichImage = whichImage -1;
  }
  else
  {
    if (whichImage == 0)
    {
      whichImage = whichImage + ((imageArray.length)-1);
    }
    else
    {
      whichImage = 0;
    }
  }
  document.getElementById("dateText").innerHTML = dateArray[whichImage];
  document.getElementById("topLink").href = linkArray[whichImage];
  document.getElementById("topLink").title= altArray[whichImage];
  document.getElementById("topLink").innerHTML = titleText[whichImage];
  document.getElementById("moreLink").href = linkArray[whichImage];
  document.getElementById("moreLink").title= altArray[whichImage];
  document.getElementById("imgA").src=imagePath + imageArray[whichImage]+imageExt;
  document.getElementById("imgA").alt=altArray[whichImage];
  document.getElementById("summaryText").innerHTML = summaryArray[whichImage];

}

