
//pre-load the images
/*function this_preloadImages() { 
  var doc=document; 
  if(doc.imageLst){ 
	if(!d.imageLst) 
	d.images=new Array();
    var i,j=doc.imageLst.length, a=this_preloadImages.arguments; 
    for(i=0; i< a.length; i++){
		if (a[i].indexOf("#")!=0){ 
			d.imageLst[j]=new Image; 
			d.imageLst[j++].src=a[i];
			}
    }
   }
}
*/
//globals

var clicked;	//used in nxtpic

//clock display in browser information line-->
function dateTimeDisplay(){
	var today = new Date();
 	var clock = today.toLocaleString();
  	defaultStatus = clock;
  	setTimeout("dateTimeDisplay()", 6000);
}

/*
function rollImg(){
	clicked=clicked+1;
	var srcLst=new Array();
	srcLst[0]="images/tmd19.jpg";
	srcLst[1]="images/11.jpg";
	srcLst[2]="images/ag6.jpg";
	srcLst[3]="images/ag_aj4.jpg";
	srcLst[4]="images/ag_aj5.jpg";
	srcLst[5]="images/aj1.jpg";
	srcLst[6]="images/aj2.jpg";
	srcLst[7]="images/aj3.jpg";
	srcLst[8]="images/aj_am10.jpg";
	srcLst[9]="images/jc11.jpg";
	srcLst[10]="images/jm12.jpg";
	srcLst[11]="images/kd13.jpg";
	srcLst[12]="images/lc15.jpg";
	srcLst[13]="images/lc_lh16.jpg";
	srcLst[14]="images/lh14.jpg";
	srcLst[15]="images/pw17.jpg";
	srcLst[16]="images/rjc18.jpg";
	var num1=srcLst.length;
	var num2=srcLst.length;
	while(num1>srcLst.length-1 || num2>srcLst.length-1){
		num1=Math.random();
		num1=Math.round(num1*10);
		num2=Math.random();
		num2=Math.round(num2*10);
	}
	
	for(var i=0; i<document.images.length; i++){
		if(document.images[i].name=="rollingImg1")document.images[i].src=srcLst[num1];
		if(document.images[i].name=="rollingImg2")document.images[i].src=srcLst[num2];
	}
	setTimeout("rollImg()", 6000);
}
*/

/*v4.01 
	n: objName this is the href id passed in the function call to changeColour
	d: isnt passed to the function by changeColour but is then declared and initialised as the document object
	returns x the object with name n
*/
function MainfindObj(n, d) { 
  var p,i,x;  
  if(!d) d=document;								//this document obj
  if((p=n.indexOf("?"))>0 && parent.frames.length) {//objs index
    d=parent.frames[n.substring(p+1)].document; 
    n=n.substring(0,p);
    }
  if(!(x=d[n])&& d.all) x=d.all[n]; 
  for (i=0;!x && i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x && d.layers && i<d.layers.length;i++) x=MainfindObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); 
  return x;
}
/*v6.0
	objName this is the href id passed in the function call
	x: null value '' passed in the function call
	theValue: colour
	theTestVal: colour
*/
function MainchangeColor(objName,x,theValue,moverCol) { 
  var obj = MainfindObj(objName);
  var property = 'style.color';
  
  if (obj && (property.indexOf("style.")==-1 || obj.style)){
    if (obj.style.color != moverCol) {							//if the objects colour doesnt equal red
		if (theValue == true || theValue == false)
		  eval("obj."+property+"="+theValue);					//evaluate the expression built by concatinating the string
		else eval("obj."+property+"='"+theValue+"'");			//else will only be evaluated if theValue is null
	}	
  }
}


/*
responds to button clicks and changes  caption to the image in index.htm
called from nxt()
*/
var clicked=0;
var string="The audience";

function caption()
{

	switch(clicked){
		case 0:
			string="The audience in attendance 5th November 2008 the Jubilee Room of the Houses of Parliament";
			break;
		case 1:
			string="Professor Tom Harrison, St George's University of London, Marianne Abdulla & Dominique Sadi";
			break;
		case 2:
			string="Andrew George MP, All Party Parliamentary Working Group in tuberculosis eradication";
			break;
		case 3:
			string="Andrew George MP, All Party Parliamentary Working Group in tuberculosis eradication, intoductory address to the audience";
            break;
		case 4:
			string="Andrew George MP & Dr Amina Jindani MD FRCP (St George's University of London)";
            break;
		case 5:
			string="Andrew George MP & Dr Jindani discussing living with and dying from TB";
            break;
		case 6:
			string="Dr Amina Jindani addressing the audience - the facts about TB";
            break;
		case 7:
			string="Dr Amina Jindani addressing the audience - the facts about TB";
            break;
		case 8:
			string="Jane Marshall (business and project manager large pharma) & Dr Angela Miller St George's University of London) both of WWTB";
            break;
		case 9:
			string="John Fraser WWTB Trustee, retired Solicitor and former MP Norwood and Ann Kingsbury";
            break;
		case 10:
			string="The reality of TB in Africa today, a killer disease";
            break;
		case 11:
			string="Keithe Chapman & Dominic Ahern discussing the way forward at the reception following the event";
            break;
		case 12:
			string="Lucy Cheshire - HIV/TB advocay at its very best"
            break;
		case 13:
			string="Lucy Cheshire & Louise Holly of The UK Coalition to Stop TB";
            break;
		case 14:
			string="Louise Holly  of The UK Coalition to Stop TB";
            break;
		case 15:
			string="Peg Willingham Areas Global TB Vaccine Foundation"
            break;
		case 16:
			string="Rafiq Rattansi WWTB Trustee, Jane Dunmall & Chris Brown (University of Heretfordshire)";
            break;
		default:
			string="";
		}

	document.form1.textcap.value=string;
}
/*
responds to button clicks and changes both the image and caption in index.htm
*/

function nxt(){
	clicked=clicked+1;
	var srcLst=new Array();
	srcLst[0]="images/11.jpg";
	srcLst[1]="images/tmd19.jpg";
	srcLst[2]="images/ag6.jpg";
	srcLst[3]="images/ag7.jpg";
	srcLst[4]="images/ag_aj4.jpg";
	srcLst[5]="images/ag_aj5.jpg";
	srcLst[6]="images/aj1.jpg";
	srcLst[7]="images/aj2.jpg";
	srcLst[8]="images/aj_am10.jpg";
	srcLst[9]="images/jc11.jpg";
	srcLst[10]="images/guinea.gif";
	srcLst[11]="images/kd13.jpg";
	srcLst[12]="images/lc15.jpg";
	srcLst[13]="images/lc_lh16.jpg";
	srcLst[14]="images/lh14.jpg";
	srcLst[15]="images/pw17.jpg";
	srcLst[16]="images/rjc18.jpg";
	var num1=srcLst.length;
	
	for(var i=0; i<document.images.length; i++){
		if(clicked<17){
			if(document.images[i].name=="nxtImg")
			{
				document.images[i].src=srcLst[clicked];
				string=clicked;
			}
		}
		else
		{
			clicked=0;
			if(document.images[i].name=="nxtImg")
			{
				document.images[i].src=srcLst[clicked];
				string=clicked;
			}
		}
	}
	caption();
}
