
 browser_name = navigator.appName;
 browser_version = parseFloat(navigator.appVersion); 

 if (browser_name == "Netscape" && browser_version >= 3.0) { roll = 'true'; }
 else if (browser_name == "Microsoft Internet Explorer" && browser_version >= 4.0) { roll = 'true'; }
 else { roll = 'false'; }

// Preload MouseOver Images & Mouseover Script
 function msover(img,ref) { if (roll == 'true') { document.images[img].src = ref; } }
 function msout(img,ref)  { if (roll == 'true') { document.images[img].src = ref; } }

	// determine browser
   CR_DOM = (document.getElementById) ? true : false;
   CR_NS4 = (document.layers) ? true : false;
   CR_IE = (document.all) ? true : false;
   CR_IE4 = CR_IE && !CR_DOM;
   CR_Mac = (navigator.appVersion.indexOf("Mac") != -1);
   CR_IE4M = CR_IE4 && CR_Mac;
   CR_IsFader = (CR_IE && !CR_IE4M);

var t;
var level=0;
var VDimage;
var VDtran='/features/dive/images/komodotran.jpg';
var imgurl='/features/dive/images/species/irian1-';
var imgext='.jpg';
var infourl='nitedive';

	function descend() {
			if (!top.VDright.VDimage.document.images['species']){ 
				var vidurl='/features/dive/vdimage.asp?vdimage=irian1-';
				level=level+1;
					if (level > 19 ){
					level=19
					}
				vidurl=vidurl+level+imgext;
				top.VDright.VDimage.location=vidurl;
				infourl="/features/dive/irian1-"+level+".html";
				top.VDinfo.location=infourl;
				}
				else {
				top.VDright.VDimage.document.images['species'].src=VDtran;
				top.VDinfo.location='/features/dive/VDloading.html';
				level=level+1;
				if (level > 19 ){
					level=19
					}
				VDimage=imgurl+level+imgext;
				infourl="/features/dive/irian1-"+level+".html";
				//top.document.title='Virtual Dive Encounter #'+level;
				if(CR_IsFader) {
						fader(VDimage);
						top.document.title='Virtual Dive Encounter #'+level;
						}
				else {
					 delay();
					 }
				}
			}

	function ascend() {
				if (!top.VDright.VDimage.document.images['species']){ 
					var vidurl='/features/dive/vdimage.asp?vdimage=irian1-';
					level=level-1;
					if (level <=0 ){
						level=0
						}
					vidurl=vidurl+level+imgext;
					top.VDright.VDimage.location=vidurl;
					infourl="/features/dive/irian1-"+level+".html";
					top.VDinfo.location=infourl;
					}
					else {
					level=level-1;
					if (level <= 0 ){
						level=0
						}
					VDimage=imgurl+level+imgext;
					infourl="/features/dive/irian1-"+level+".html";
					if(CR_IsFader) {
						fader(VDimage);
						top.document.title='Virtual Dive Encounter #'+level;
						}
					else {
						top.VDright.VDimage.document.images['species'].src=VDimage;
						 delay();
					 }
					top.VDinfo.location=infourl;
					}
				}
				
	function closeit(){
	if ( confirm("You are about to surface!\n This will end your dive.\n ")){
		top.close()
		} else {
		// no nothing
		}
	}
	function delay(){
		t = setTimeout("top.VDinfo.location=infourl" ,1700);
		t = setTimeout("top.VDright.VDimage.document.images['species'].src=VDimage;" ,2000);
		}
	// Used for IE Only		
	function fader(which){
		top.VDright.VDimage.document.all.species.filters.blendTrans.Apply();
		top.VDright.VDimage.document.images['species'].src= which;
		top.VDright.VDimage.document.all.species.filters.blendTrans.Play();
		t = setTimeout("top.VDinfo.location=infourl" ,1700);
	}
		
// end of dive script