<!-- Start hiding Javascript
/////  RESOURCES
/////  uploads images from server to browser and puts load-status to don(0)
/////  is a special case of animation with combined operations on single image
/////  incorporates DPL03res.js
/////  incorporates DPS04res.js

/////  browser version check - needed because IE uses division tag for display. Netscape uses layer tag
   var brws_nm=		navigator.appName;
   var brws_ver=		parseInt(navigator.appVersion);
   if (brws_nm=="Netscape")	var brows=true
   else 				var brows=false;

/////  initialises
   dir = '';
   eWidth = 05;
   eHeight= 09;
   color1 = "jscripts/_1grey05.gif";
   color2 = "jscripts/_2mdgy05.gif";
   color3 = "jscripts/_3dkgy05.gif";
   color4 = "jscripts/_4red05.gif";
   color5 = "jscripts/_5yell05.gif";
   color6 = "jscripts/_6grn05.gif";
   color7 = "jscripts/_7blue05.gif";
   color8 = "jscripts/_8red10.gif";
   color9 = "jscripts/_9blue10.gif";
   frameloc0=	new Image;	frameloc0.src=		"jscripts/a_GIFopt/sue0c_00.jpg";
   target0=	new Image;	target0.src=		"jscripts/a_GIFopt/sue0c_00.jpg";
   target1=	new Image;	target1.src=		 frameloc0.src;
   target2=	new Image;	target2.src=		"jscripts/a_GIFopt/sue0x_00.jpg";

  suespeak= new Array(
"jscripts/a_GIFopt/sue1c_00.jpg",
"jscripts/a_GIFopt/sue1c_01.jpg",
"jscripts/a_GIFopt/sue1c_02.jpg",
"jscripts/a_GIFopt/sue1c_03.jpg",
"jscripts/a_GIFopt/sue1c_04.jpg",
"jscripts/a_GIFopt/sue1c_05.jpg",
"jscripts/a_GIFopt/sue1c_06.jpg",
"jscripts/a_GIFopt/sue1c_07.jpg",
"jscripts/a_GIFopt/sue1c_08.jpg",
"jscripts/a_GIFopt/sue1c_09.jpg",
"jscripts/a_GIFopt/sue1c_10.jpg",
"jscripts/a_GIFopt/sue1c_11.jpg",
"jscripts/a_GIFopt/sue1c_12.jpg",
"jscripts/a_GIFopt/sue1c_13.jpg",
"jscripts/a_GIFopt/sue1c_14.jpg",
"jscripts/a_GIFopt/sue1c_15.jpg",
"jscripts/a_GIFopt/sue1c_16.jpg",
"jscripts/a_GIFopt/sue1c_17.jpg",
"jscripts/a_GIFopt/sue1c_18.jpg",
"jscripts/a_GIFopt/sue1c_19.jpg",
"jscripts/a_GIFopt/sue1c_20.jpg",
"jscripts/a_GIFopt/sue1c_21.jpg",
"jscripts/a_GIFopt/sue1c_22.jpg",
"jscripts/a_GIFopt/sue1c_23.jpg",
"jscripts/a_GIFopt/sue1c_24.jpg",
"jscripts/a_GIFopt/sue1c_25.jpg",
"jscripts/a_GIFopt/sue1c_26.jpg",
"jscripts/a_GIFopt/sue1c_27.jpg",
"jscripts/a_GIFopt/sue1c_28.jpg"         
);
   var nspeaks=suespeak.length;
   var isourc=0;
   var loaded=0;
   var lFlag=0;
   var kFlag=0;
   var freezFlag=0;
   var stoptl=0;
   var iframe=0;
   var thespeak = new Array();
   var theDelay=170;

/////  instantiates layer object/////////////////
function getLayer(msg,ytop,xleft){
   this.msg=	msg;
   this.ytop=	ytop;
   this.xleft=	xleft
}
 var link=new Array();
   link[4]=new getLayer('<font face="verdana" size="2" color="#ffff00"><span style="background-color:rgb(00,64,128);">click to enlarge</span></font>',760,590);
   link[3]=new getLayer('<font face="verdana" size="2" color="#ffff00"><span style="background-color:rgb(00,64,128);">click on animation to close</span></font>',440,680);
   link[2]=new getLayer('<font face="verdana" size="2" color="#ffff00"><span style="background-color:rgb(00,64,128);">loading ...Completed</span></font>',430,880);   
   link[1]=new getLayer('<font face="verdana" size="2" color="#ffff00"><span style="background-color:rgb(00,64,128);">click to open animation</span></font>', 440,700);
   link[0]=new getLayer('<span style="background-color: rgb(0,64,128);"><font face="verdana" size="2" color="yellow">  loading ...</font>'+
'<img src='+color7+' name="elapsed0" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed1" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed2" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed3" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed4" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed5" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed6" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed7" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed8" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed9" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed10" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed11" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed12" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed13" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed14" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed15" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed16" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed17" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed18" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed19" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed20" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed21" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed22" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed23" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed24" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed25" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed26" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed27" align="center" width='+eWidth+' height='+eHeight+' >'+
'<img src='+color7+' name="elapsed28" align="center" width='+eWidth+' height='+eHeight+' >'+
'        </span>',520,670);

/////  ONs and OFFs layer texts and Starts/Stops/Closes animation
/////  TURNING_ON
function don(x){
   if ((brws_nm=="Netscape" && brws_ver>=8) || (brws_nm=="Microsoft Internet Explorer" && brws_ver>=4))
   { 
   //Netscape layer code ---
	if (brows){
		with(link[x]){
			document.layers['nex'].document.write(msg);
			document.layers['nex'].document.close();
			document.layers['nex'].top=ytop;
			document.layers['nex'].left=xleft};
		document.layers['nex'].visibility="show"}
   //Internet Explorer division code ---
	else{
		with(link[x]){
			iex.innerHTML=msg;
			iex.style.top=ytop;
			iex.style.left=xleft};
		iex.style.visibility="visible"}
   }
}
/////  TURNING_OFF
function doff(){
   if ((brws_nm=="Netscape" && brws_ver>=8) || (brws_nm=="Microsoft Internet Explorer" && brws_ver>=4))
   {
	if (brows)
		document.layers['nex'].visibility="hide"
	else	
		iex.style.visibility="hidden"
   }   
}

/////  DUALflip76 animates thespeak array///////////////
function locoMote(){	
	document.steamage.src=thespeak[iframe].src;	
	iframe++;
	if (iframe>nspeaks-1) iframe=0;	
	timeinc=setTimeout('locoMote()',theDelay)
}
function freeze_motion(iframe){
	if( kFlag<1){
		freezFlag=1;
		clearTimeout(timeinc);
		document.steamage.src=thespeak[iframe].src}
}
function resume_motion(){
	if( kFlag<1) locoMote()
}
function close_motion(target_id,target){	
		kFlag=1;
		freezFlag=0;
		clearTimeout(timeinc);
		doff();		
		document.images[target_id].src = eval(target + ".src")
}

/////  uploads images from server to browser and puts load-status to don(0)/////////////
function stoptheLoad(){
		stoptl=1
}
function onLoaded(){
		lFlag=0; loaded=1; locoMote()
}
function preLoad(){
   switch(stoptl){
   case 0:	thespeak[isourc] =		new Image(10,09);
		thespeak[isourc].onload=	proceed;
		thespeak[isourc].src=		dir + suespeak[isourc];
		break;			
   case 1:	return}  
}
function proceed(){
   document.images['elapsed' + isourc].src = color5;      
   if( isourc<nspeaks-1 ){
		isourc++;
		preLoad()}
   else
		onLoaded()		
}

/////  eventhandlers for mouse actions on <a>tag
function startLoad(target_id,target){	
		lFlag=1;		
		stoptl=0;
		document.images[target_id].src = eval(target + ".src");
		don(0);	
		preLoad()
}
function msgtoLoad(){
	if(loaded<1){	
		if(lFlag<1){	window.status='loading image'; startLoad('steamage','target2')}
		else		outdualFlip('steamage','target1')
		}
	else{
		window.status=' ';
		if(kFlag>0){
				doff();
				kFlag=0;
				iframe=0;
				locoMote()}
		else{		close_motion('steamage','target0');
				doff()}
		}
}
function dualFlip(target_id,target){
	if(loaded<1 || kFlag>0 ){
		don(1); window.status='click to open animation';
		document.images[target_id].src = eval(target + ".src")}
	else	freeze_motion(iframe)
}
function outdualFlip(target_id,target){
	if(loaded<1 || kFlag>0 ){
		if(lFlag>0){ lFlag=0; stoptheLoad()};				
		document.images[target_id].src = eval(target + ".src");	
		doff(); window.status=' '}
	else{
		don(3); window.status='click on animation to close';
		if( freezFlag>0 ) resume_motion()}
}

/////  writes the division HTML tag, I do it here so that it is less confusing. You don't have to add separate HTML tags---
document.write("<div id=\"iex\" style=\"position:absolute; visibility: hidden; width=30%\">")
document.write("</div>")
/////  writes the layer code---
document.write("<Layer name=\"nex\" visibility=\"hide\" width=\"30%\">")
document.write("</layer>")

//--done hiding etc--->
