/*
 * imgs - array of images to rotate
 * strimage - starting image
 * curimage - current image
 * rotate - should images be rotated
 * delay  - time between rotations
 */
function preload_sol_imgs() {
  plnew1 = new Array(imgs.length);
  plnew2 = new Array(imgs.length);
  for (i=0;i<imgs.length;i++){
    plnew1[i] = new Image();
    plnew1[i].src = imgs[i];
    plnew2[i] = new Image();
    plnew2[i].src = imgs[i].replace(/1/,"2");
  }
}
function init_sol() {
   strimage = 0;
   imgs = new Array(3);
   imgs[0] = "Images/main/home_bc1.jpg";
   imgs[1] = "Images/main/home_bc1.jpg";
   imgs[2] = "Images/main/home_bc1.jpg";
   lnks = new Array(3);
   lnks[0] = "virtualisation.html";
   lnks[1] = "virtualisation.html";
   lnks[2] = "virtualisation.html";
   curimage = -1;   
   delay = 6000;
   rotate = true;
   preload_sol_imgs();
   rotate_sol();
}
function rotate_sol() {
   if (rotate){
      if (curimage<(imgs.length-1)){
         curimage++;
      } else {
         curimage = 0;
      }
      curimage = Math.max(curimage,strimage);
      update_sol();
   }
   setTimeout("rotate_sol()", delay);
}
/*
 * imgselect - image to select
 */
function select_sol(imgselect) {
   rotate = false;
   curimage = imgselect;
   update_sol();
}
function update_sol() {
   if (curimage==0) {
      document.getElementById("solarea").innerHTML =
      "<a "+"href='"+lnks[curimage]+"' "+"onMouseOver='rotate_off()' onMouseOut='rotate_on()' class='solheader5'>"+
      'Virtualisation<br>'+
      '<span class="solheader3">Move towards 100% server virtualisation<br>'+
      'Virtualise Microsoft Exchange and SQL Server<br>'+
      'Increase the security and availability of your applications<br>'+
      'Deploy and centrally manage virtual desktops and applications<br>'+
      'Utilise VMware integrated storage and replication technologies</span></a>'
      }
   else if (curimage==1) {
      document.getElementById("solarea").innerHTML =
      "<a "+"href='"+lnks[curimage]+"' "+"onMouseOver='rotate_off()' onMouseOut='rotate_on()' class='solheader5'>"+
      'Backup and Recovery<br>'+
      '<span class="solheader3">Improve your backups by minimising the use of tape<br>'+
	  'Optimise VMware image and guest backup and recovery<br>'+
      'Recover data and virtual machines from any point-in-time<br>'+
      'Reduce backup data and it’s impact on storage and networks<br>'+
      'Utilise SAN replicas to enable near-instant backup and recovery</a>'
      }
   else if (curimage==2) {
      document.getElementById("solarea").innerHTML =
      "<a "+"href='"+lnks[curimage]+"' "+"onMouseOver='rotate_off()' onMouseOut='rotate_on()' class='solheader5'>"+
      'Disaster Recovery<br>'+
      '<span class="solheader3">Deliver virtual desktops in the event of a disaster<br>'+
	  'Optimally backup and recover a virtual environment<br>'+
	  'Make disaster recovery affordable with virtualisation<br>'+
      'Automate disaster recovery fail-over, fail-back and testing<br>'+
      'Dynamically optimise storage for performance and efficiency</span></a>'
      }
   document.getElementById("soltop").style.backgroundImage = 'url('+imgs[curimage]+')';
   document.getElementById("solbot").style.backgroundImage = 'url('+imgs[curimage].replace(/1/,"2")+')';
}
function rotate_on() {
   rotate = true;
}
function rotate_off() {
   rotate = false;
}