/*
 * imgs1 and imgs2 - 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(imgs1.length);
  plnew2 = new Array(imgs1.length);
  for (i=0;i<imgs1.length;i++){
    plnew1[i] = new Image();
    plnew1[i].src = imgs1[i];
    plnew2[i] = new Image();
    plnew2[i].src = imgs2[i];
  }
}
function init_sol() {
   strimage = 0;
   imgs1 = new Array(5);
   imgs1[0] = "Images/main/clouds.jpg";
   imgs1[1] = "Images/main/clouds.jpg";
   imgs1[2] = "Images/main/clouds.jpg";
   imgs1[3] = "Images/main/clouds.jpg";
   imgs1[4] = "Images/main/clouds.jpg";
   imgs2 = new Array(5);
   imgs2[0] = "Images/main/clouds_base.jpg";
   imgs2[1] = "Images/main/clouds_base.jpg";
   imgs2[2] = "Images/main/clouds_base.jpg";
   imgs2[3] = "Images/main/clouds_base.jpg";
   imgs2[4] = "Images/main/clouds_base.jpg";
   lnks = new Array(5);
   lnks[0] = "virtualisation.html";
   lnks[1] = "virtualisation.html";
   lnks[2] = "virtualisation.html";
   lnks[3] = "virtualisation.html";
   lnks[4] = "virtualisation.html";
   curimage = -1;   
   delay = 6000;
   rotate = true;
   preload_sol_imgs();
   rotate_sol();
}
function rotate_sol() {
   if (rotate){
      if (curimage<(imgs1.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='solheader1'>"+
      'SERVER VIRTUALISATION<br>'+
      '<span class="solheader3">Begin the journey to 100% server virtualisation<br>'+
      'Virtualise business critical applications such as Exchange, SQL and Oracle<br>'+
      'Utilise storage and backup solutions that integrate with VMware at every point<br>'+
      'Improve service delivery with built-in high availability and disaster recovery features</span></a>'
      }
   else if (curimage==1) {
      document.getElementById("solarea").innerHTML =
      "<a "+"href='"+lnks[curimage]+"' "+"onMouseOver='rotate_off()' onMouseOut='rotate_on()' class='solheader1'>"+
      'DESKTOP VIRTUALISATION<br>'+
      '<span class="solheader3">Give users a high performance virtual desktop experience<br>'+
	  'Simplify desktop management and deliver desktops as a service<br>'+
	  'Reduce your desktop acquisition, operating and management costs<br>'+
      'Deliver desktops to remote offices to accelerate provisioning while retaining control</span></a>'
      }
   else if (curimage==2) {
      document.getElementById("solarea").innerHTML =
      "<a "+"href='"+lnks[curimage]+"' "+"onMouseOver='rotate_off()' onMouseOut='rotate_on()' class='solheader1'>"+
      'STORAGE<br>'+
      '<span class="solheader3">Dynamically optimise storage for optimal performance and TCO<br>'+
	  'Utilise affordable high performance and highly available storage platforms<br>'+
      'Take advantage of the latest storage efficiency technologies to manage growth<br>'+
  	  'Drive down server and storage consolidation costs with multi-protocol unified storage</span></a>'
      }
   else if (curimage==3) {
      document.getElementById("solarea").innerHTML =
      "<a "+"href='"+lnks[curimage]+"' "+"onMouseOver='rotate_off()' onMouseOut='rotate_on()' class='solheader1'>"+
      'BACKUP AND RECOVERY<br>'+
      '<span class="solheader3">Recover data and virtual machines from any point-in-time<br>'+
      'Archive to reduce backup data and its impact on storage and networks<br>'+
      'Deploy storage array replicas to enable near-instant backup and recovery<br>'+
      'Utilise deduplication to enable the move away from tape-centric backup solutions</span></a>'
      }
   else if (curimage==4) {
      document.getElementById("solarea").innerHTML =
      "<a "+"href='"+lnks[curimage]+"' "+"onMouseOver='rotate_off()' onMouseOut='rotate_on()' class='solheader1'>"+
      'DISASTER RECOVERY<br>'+
      '<span class="solheader3">Make disaster recovery affordable with virtualisation<br>'+
      'Automate disaster recovery fail-over, fail-back and testing<br>'+
	  'Extend business continuity and disaster recovery to your desktops<br>'+
  	  'Make use of storage array replication for reliable disaster recovery</span></a>'
      }
   document.getElementById("soltop").style.backgroundImage = 'url('+imgs1[curimage]+')';
   document.getElementById("solbot").style.backgroundImage = 'url('+imgs2[curimage]+')';
}
function rotate_on() {
   rotate = true;
}
function rotate_off() {
   rotate = false;
}