// JavaScript Document
var slideShowSpeed = 5000
var crossFadeDuration = 3
var Pic = new Array() 
Pic[0] = '/images/header_1.jpg'
Pic[1] = '/images/header_2.jpg'
Pic[2] = '/images/header_3.jpg'
Pic[3] = '/images/header_4.jpg'
Pic[4] = '/images/header_5.jpg'
Pic[5] = '/images/header_6.jpg'
Pic[6] = '/images/header_7.jpg'
Pic[7] = '/images/header_8.jpg'
var t
var j = 0
var p = Pic.length
var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}

startList = function() {
if (document.all&&document.getElementById) {
menuRoot = document.getElementById("menu");
for (x=0; x<menuRoot.childNodes.length; x++) {
node = menuRoot.childNodes[x];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace(" over", "");
}
}
}
}
}

if (window.attachEvent)
window.attachEvent("onload", startList)
else
window.onload=startList;

function show_photo(pFileName, pCaption, pDescription) {
// close other child window
if (window.pixsWin) {pixsWin.close()}

// specify window paramaters
	photoWin = window.open( "", "photo", "width=550,height=450,status=0,scrollbars=0,titlebar=no,resizable=0,screenX=50,screenY=50,left=30,top=150,copyhistory=0,toolbar=0,galleyimg=no");

// write content to window
	photoWin.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">');	
	photoWin.document.write('<html><head><title>' + pCaption + '</title></head>');	
	photoWin.document.write('<body style="background-color:#000; color:#ffffcc" onmousedown="javascript:window.close()">' );
	photoWin.document.write('<p align="center">');
	photoWin.document.write('<img src="' + pFileName + '"galleryimg=no title=Copyright_&copy_Arborlee_Rainforest_Retreat_2006 /></p>');
	photoWin.document.write('<p align="center" style="font-family:Arial, Helvetica, sans-serif; font-size:12px"> ' + pDescription +' </p>');
	photoWin.document.write('<p>&nbsp;</p></body></html>');
	photoWin.document.close();	
	if (window.focus) {photoWin.focus()}

// If NetScape, bring window to front
	if (navigator.appName.substring(0,8) == "Netscape") photoWin.focus();
}
//e-mail address check
function echeck(str) {
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}
		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }
		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
 		 return true					
	}
//Validation of Forms	
function ValidateForm(){
	var realnameID=document.member.realname
	var emailID=document.member.email
	var subjectID=document.member.subject
	var messageID=document.member.Message

	if ((realnameID.value==null)||(realnameID.value=="")){
		alert("Please Enter your Full Name")
		realnameID.focus()
		return false
	}	
	if ((subjectID.value==null)||(subjectID.value=="")){
		alert("Please Enter Subject")
		subjectID.focus()
		return false
	}	
	if ((messageID.value==null)||(messageID.value=="")){
		alert("What - No message! Try again")
		messageID.focus()
		return false
	}
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return 

true
 }
 