﻿var timeout = 5000;

function startContacts(server)
{    					 
  setTimeout("changeContacts('" + server + "')", timeout);
}

function changeContacts(server)
{
  try
  {
    var photos = new Array("metz_01.jpg",
      					   "metz_02.jpg",
      					   "metz_03.jpg",
      					   "metz_04.jpg");
      					 
    var titles = new Array("Metz",
      					   "Metz",
      					   "Metz",
      					   "Technopôle Metz");
      					 
	var randomNumber = Math.floor(Math.random()*photos.length);
	var img = document.getElementById('metz');
    if(img)
    {
	  img.src = server + "company/" + photos[randomNumber];
	  img.alt = titles[randomNumber];
	  setTimeout("changeContacts('" + server + "')", timeout);
	}
	else
	{
      setTimeout("changeContacts('" + server + "')", 10);
	}
  } 
  catch(err)
  {
  }
}

function startCompany(server)
{    					 
  setTimeout("changeCompany('" + server + "')", timeout);
}

function changeCompany(server)
{
  try
  {
    var photos = new Array("pci_01.jpg",
      					   "pci_02.jpg",
      					   "pci_03.jpg",
      					   "pci_04.jpg");
      					 
    var titles = new Array("ProConsultant Informatique",
      					   "ProConsultant Informatique",
      					   "ProConsultant Informatique",
      					   "ProConsultant Informatique");
      					 
	var randomNumber = Math.floor(Math.random()*photos.length);
	var img = document.getElementById('us');
    if(img)
    {
	  img.src = server + "company/" + photos[randomNumber];
	  img.alt = titles[randomNumber];
	  setTimeout("changeCompany('" + server + "')", timeout);
	}
	else
	{
      setTimeout("changeCompany('" + server + "')", 10);
	}
  } 
  catch(err)
  {
  }
}

function startLouiseComment(server)
{    					 
  setTimeout("changeLouiseComment('" + server + "')", timeout*2);
}

function changeLouiseComment(server)
{
  try
  {
    var photos = new Array(/*"tfo_eric_minoli.png",*/
      					   "tv4_malte_andreasson.png", 
      					   "tv4_jonas_collsioo.png");
      					 
    var titles = new Array(/*"Eric Minoli and Louise, his broadcasting management system",*/
      					   "Louise - Broadcast management system",
      					   "Louise - Broadcast management system");
      					  
    var line1 = new Array(/*"\"LOUISE is the 'brain' of the entire operation.",*/
                          "\"We were really interested in buying a workflow,", 
                          "\"Louise is the nerve center making a lot of other systems work - in the right way,");
                          
    var line2 = new Array(/*"Everything revolves around Louise's metadata management.\"",*/ 
    					  "not just a software.\"", 
    					  "in the right order, at the right time.\"");
    					  
    var name = new Array(/*"Eric Minoli",*/ 
    					 "Malte Andreasson", 
    					 "Jonas Collsiöö");
    					 
    var role = new Array(/*"Chief of Logistics, TFO",*/ 
    					 "Head of Planning, TV4", 
    					 "Technical Director, TV4");
    					 
    var copy = new Array(/*"Picture Copyright: TFO",*/ 
    					 "Picture Copyright: TV4", 
    					 "Picture Copyright: TV4");
      					 
	var randomNumber = Math.floor(Math.random()*photos.length);
	var img = document.getElementById('louise_comment_img');
    var em = document.getElementById('louise_comment');
    var p = document.getElementById('louise_comment_quote');
    if(img && em && p)
    {
	  img.src = server + "louise/" + photos[randomNumber];
	  img.alt = titles[randomNumber];
	  
	  em.innerHTML = line1[randomNumber] + "<br/>\r\n" + "  " + line2[randomNumber] + "<br/>";
	  
	  p.innerHTML = "\r\n" + "  " + name[randomNumber] + "<br/>\r\n" + "  " + role[randomNumber] + "<br/>\r\n" + "  <span class=\"italic_10\">" + copy[randomNumber] + "</span>\r\n" + " ";
	  
	  setTimeout("changeLouiseComment('" + server + "')", timeout*2);
	}
	else
	{
      setTimeout("changeLouiseComment('" + server + "')", 10);
	}
  } 
  catch(err)
  {
  }
}

function startTrainingComment(server)
{    					 
  setTimeout("changeTrainingComment('" + server + "')", timeout*5);
}

function changeTrainingComment(server)
{
  try
  {
    var photos = new Array("tf1_thomas_fournier.png", 
      					   "tf1_pauline_jaffrennou.png");
      					 
    var titles = new Array("Louise - Advanced Training Courses",
      					   "Louise - Advanced Training Courses");
      					  
    var line1 = new Array("\"I consider the LOUISE Advanced Training as absolutely essential to get a clear and complete vision of the system.", 
                          "\"LOUISE Advanced Training is a very complete training that offers a global vision of the functionalities and the links between them.");
                          
    var line2 = new Array("This training also gave us the opportunity to discover how some of the new tools, modules and innovations in LOUISE expanded the system functionality.\"", 
    					  "Because the trainers have both technical and functional knowledge, they convey a very good and useful understanding of the system to participants.\"");
    					  
    var name = new Array("Thomas Fournier", 
    					 "Pauline Jaffrennou");
    					 
    var role = new Array("IT Project Manager, TF1", 
    					 "Project Manager, TF1");
    					 
    var copy = new Array("", 
    					 "");
      					 
	var randomNumber = Math.floor(Math.random()*photos.length);
	var img = document.getElementById('training_comment_img');
    var em = document.getElementById('training_comment');
    var p = document.getElementById('training_comment_quote');
    if(img && em && p)
    {
	  var reg = new RegExp("^"+ (server + "services/" + photos[0]) +".*$","i");  // Le "i" sert à ne pas tenir compte de la casse.
	  if(img.src.match(reg))
	  {
	    randomNumber = 1;
	  }
	  else
	  {
	    randomNumber = 0;
	  }
	  
	  img.src = server + "services/" + photos[randomNumber];
	  img.alt = titles[randomNumber];
	  
	  em.innerHTML = line1[randomNumber] + "<br/>\r\n" + "  " + line2[randomNumber] + "<br/>";
	  
	  p.innerHTML = "\r\n" + "  " + name[randomNumber] + "<br/>\r\n" + "  " + role[randomNumber] + "<br/>\r\n" + "  <span class=\"italic_10\">" + copy[randomNumber] + "</span>\r\n" + " ";
	  
	  setTimeout("changeTrainingComment('" + server + "')", timeout*5);
	}
	else
	{
      setTimeout("changeTrainingComment('" + server + "')", 10);
	}
  } 
  catch(err)
  {
  }
}
