<!--JavaScript for preloads images, initialises programme, provides basic site navigation and image display

preloadImages("ent_line.gif","ent_nick.gif","ent_vision.gif","ent_when.gif","ent_1_0.gif","ent_1_1.gif","ent_1_2.gif","ent_2_0.gif","ent_2_1.gif","ent_2_2.gif","log_centre.gif","log_right.gif","log_left.gif","nav_left_top.gif","nav_left_home.gif","nav_left_mid1.gif","nav_left_qual.gif","nav_left_mid2.gif","nav_left_skil.gif","nav_left_mid3.gif","nav_left_care.gif","nav_left_bot.gif","nav_left_cont.gif","navarrow_left.gif","navarrow_left_over.gif","navarrow_right.gif","navarrow_right_over.gif","0_v_filler.gif")

function preloadImages() { 
  if (document.images) {
    var imgFiles = preloadImages.arguments;
    if (document.preloadArray==null) document.preloadArray = new Array();
      var i = document.preloadArray.length;
      with (document) for (var j=0; j<imgFiles.length; j++) 
        if (imgFiles[j].charAt(0)!="#") {    
	  preloadArray[i] = new Image;
          preloadArray[i++].src = imgFiles[j];
        }
    }
}

function setStyle() { 
  var scr = screen.width;
  
  if ((scr==800) || (scr==640)) {
    document.write('<LINK REL="stylesheet" TYPE="text/css" MEDIA="screen" HREF="Style.css">');
  }    
  else { 
    document.write('<LINK REL="stylesheet" TYPE="text/css" MEDIA="screen" HREF="Style1.css">');  
  }
}  

function init() {
  if (navigator.appName == "Netscape") 
    alert("Sorry. Netscape Navigator is not supported as yet!");
}

function image_swap(n,np) {
  if (document.images) {
    document.images[n].src=np;
  }
}

function image_restore(n,np) {
  if (document.images) {
    document.images[n].src=np;
  }
}

function processInfo() {
  q = ""
  q += document.info
  
  document.question.result.value = q
   document.question.submit()
  return false
}

function initialize() {
  start=false
    
  imageSource1=new Array(3)
  imageSource2=new Array(3) 
 
  for(var i=0; i<3; ++i) { 
    imageSource1[i]=new Image()
    imageSource1[i].src="ent_1_"+i+".gif" 
  }        
  delay1=5000
  startAnimation1()
  nextImageSkill=1 

  for(var i=0; i<3; ++i) { 
    imageSource2[i]=new Image()
    imageSource2[i].src="ent_2_"+i+".gif" 
  }        
  delay2=5000
  startAnimation2()
  nextImageExperience=1   
}

function startAnimation1() {
  interval=setInterval('animateSkill()', delay1)
}

function startAnimation2() {
  interval=setInterval('animateExperience()', delay2)
}

function setStart() {
  start=true
}

function animateSkill() {
  if(start==true) {
    i=nextImageSkill
    ++nextImageSkill
    nextImageSkill%=3
    if(imageSource1[i].complete)
      document.ent_1.src=imageSource1[i].src
   }
}  

function animateExperience() {
  if(start==true) {
    i=nextImageExperience
    ++nextImageExperience
    nextImageExperience%=3
    if(imageSource2[i].complete)
      document.ent_2.src=imageSource2[i].src
   }
}  

//-->