<!-- Hide from old browsers 

// Javascripts: The Quest for Thylacoleo, http://www.thylacoleo.com/
// Ian Hynes 2007

//  Begin Rotate Images Function ... 
//  Rotate an array of banner ads, each ad clickable to a new window.

// Banner images array elements ... 
adImages = new Array ( 		  
"./adverts/ad_bobuck01.jpg",
"./adverts/ad_thylacine01.jpg",	
"./adverts/ad_wherelightmeetsdark.jpg",
"./adverts/ad_webstar_01.jpg",
"./adverts/ad_thylacine01.jpg")	

// Banner ad links array elements ...
adURL = new Array( 
"./bobuck_underground/bobucks_index.php",
"report_fauna.php",
"http://www.wherelightmeetsdark.com/",
"http://www.web-star.com.au/",
"report_fauna.php")
thisAd = 0
banCt = adImages.length

function rotate() {
 if (document.images) {
   if (document.adBanner.complete) {
     thisAd++
	 if (thisAd == banCt) {
	   thisAd = 0                     // Reset counter & loop around
	   }
	 document.adBanner.src=adImages[thisAd]
    }
	// rotate thrue with a 4(?) second delay
	setTimeout("rotate()", 5 * 1000)
   }
  } 
 
// Use this one to tranfer entirely to the new page ...
function newLocation() {
  document.location.href=adURL[thisAd] 
 //  document.location.href = "http://www.thylacoleo.com/" + adURL[thisAd]   
 }

// Use this one to open a child window and keep the parent window in the background. More useful.
 function newWindow() {
    window.open(adURL[thisAd])
 }
 
//  ........... END Rotate Images Function. ............. 

// .....................  START Random Images ............. 
// Randomly pick a background image to display upon page load.

bkPix = new Array(
"./slide_show/sunset_00.jpg",
"./slide_show/sunset_00.jpg",
"./slide_show/tawny_frogmouth.jpg",
"./slide_show/clouds_0455.jpg",
"./slide_show/clock_melbcentral.jpg",
"./slide_show/brick_wall01.jpg",
"./slide_show/yin.jpg",
"./slide_show/motorbike_008.jpg",
"./slide_show/shops_0071.jpg",
"./slide_show/ferns01.jpg",
"./slide_show/bckgnd10.jpg", 
"./slide_show/bobuck00.jpg",
"./slide_show/bobuck24.jpg", 
"./slide_show/brick_wall01.jpg",
"./slide_show/ufo_exhib_blg.jpg", 
"./slide_show/ufo_exhib_blg.jpg", 
"./slide_show/wandjina_01.jpg", 
"./slide_show/wandjina_01.jpg", 
"./slide_show/wallab16.jpg", 
"./slide_show/wallab34.jpg",  
"./slide_show/bushrat52.jpg", 
"./slide_show/bckgnd05.jpg",  
"./slide_show/wallab59.jpg",   
"./slide_show/barnsley_fern011.jpg",  
"./slide_show/wallab36.jpg",  
"./slide_show/rockart02.jpg",  
"./slide_show/melbourne_night003.jpg",   
"./slide_show/southern_cross_04.jpg", 
"./slide_show/image_006.jpg",
"./slide_show/storm_clouds.jpg", 
"./slide_show/UniMelb_leafy.jpg", 
"./slide_show/ShrineOfMemorial_Melbourne.jpg",
"./slide_show/avalon_2011_01.jpg", 
"./slide_show/avalon_2011_01.jpg")  
imgCt = bkPix.length

function anyPic() {
	if (document.images) {
		randomNum = Math.floor((Math.random()*imgCt))
		document.myPicture.src = bkPix[randomNum]
	}
}
//   ..............  END Random images ......................................  


//   ..............  Open News List Pop Up Window.  .................. 
function openWin_newslist(URL) {
  aWindow_1=window.open(URL, "newslistwindow", "toolbar=no,width=400,height=300,status=no,scrollbars=yes,resize=yes,menubar=no");
  }
// ...............  End of Open Forum Function  .............................

//   ..............  Open Forum Guidelines Pop Up Window.  .................. 
function openWin_33(URL) {
  aWindow_2=window.open(URL, "forumwindow", "toolbar=no,width=350,height=450,status=no,scrollbars=yes,resize=yes,menubar=no");
  }
// ...............  End of Open Forum Function  .............................


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
} 

// ......................................................................
// FORM VALIDATION
// What report inputs are allowed?
allowed = new Array ("visitor_name", "visitor_email", "gender", "age", "street_pob", "city", "postcode", "state", "telephone", "mobile", "fax", "occupation", "encounter_date", "encounter_time", "encounter_location_txt", "nearest_town_txt", "description_txt", "vegetation_txt", "size_total", "size_tail", "size_body", "size_shoulder", "size_nearest", "aware", "reaction_txt", "sounds", "sounds_txt", "action", "action_other", "stationary_txt", "traces_txt", "group", "group_txt01", "ordinary_animals", "ordinary_description", "other_animals_txt01", "attention", "direction_start", "direction_fin", "how_long", "distance", "the_ending", "weather", "temperature", "the_time", "moon", "tellothers", "tellothers_txt01", "tellothers_txt02", "history", "similar", "similar_txt", "unusual", "unusual_txt", "ready_set", "submit")

allowed_count = allowed.length

function checkbadcharacters() {  // Only called upon KeyPress. Exclude h40 = d65 (@) from consideration.
  if ((event.keyCode > 32 && event.keyCode < 48) || (event.keyCode > 57 && event.keyCode < 64) || (event.keyCode > 90 && event.keyCode < 97)) event.returnValue = false;
}
  
// .........  End hiding from old browsers  ............................. 
 -->

