function detailsWin(iFile,x,y) {
	var imagewindow=window.open(""+iFile+"","Details","width="+x+",height="+y+",menubar=no,toolbar=no,scrollbars=yes,resizable");
	imagewindow.resizeTo(x,y);
	imagewindow.focus();
}
var isDHTML=0;
var isLayers=0;
var isAll=0;
var isID=0;
if(document.getElementById){
	isID=1;isDHTML=1;
}else{
	if(document.all){isAll=1;isDHTML=1;
	}else{
		browserVersion = parseInt(navigator.appVersion);
		if((navigator.appName.indexOf('Netscape')!=-1)&&(browserVersion==4)){isLayers=1;isDHTML=1;}
	}
}
function findDOM(objectID,withStyle){
	if(withStyle==1){
		if(isID){return(document.getElementById(objectID).style);}
		else{if(isAll){return(document.all[objectID].style);}
		else{if(isLayers){return(document.layers[objectID]);}
		};}
	}else{
		if(isID){return(document.getElementById(objectID));}
		else{if(isAll){return(document.all[objectID]);}
		else{if(isLayers){return(document.layers[objectID]);}
		};}
	}
}
function changeStyle(objectID,styleName,newValue){
	var dom=findDOM(objectID,1);
	if(dom){dom[styleName]=newValue;}
}
function setClass(objectID,newClass){
	var dom=findDOM(objectID,0);
	if(dom){dom.className=newClass;}
}
function sef(domain,name){
	parent.location='m'+'ai'+'lto:'+name+'@'+domain;
}
function startSlideshow(){
	changeStyle('starthidden','display','block');
}
function delay(r,g,b,element) {
	setTimeout("fadetext("+r+","+g+","+b+",'"+element+"'),2000");
}
function fadetext(r,g,b,element){
var rdone=false;
var bdone=false;
var gdone=false;
if(g<198){g+=2;}else{g=198;gdone=true;
	if(b>63){b-=2}else{b=63;bdone=true;
		if(r<141){r+=2;}else{r=141;rdone=true;}
	}
}
	document.getElementById(element).style.borderColor="rgb("+r+","+g+","+b+")";
	document.getElementById(element).style.color="rgb("+r+","+g+","+b+")";
	if(rdone==true && bdone==true && gdone==true){
		return;
	}else{
		setTimeout("fadetext("+r+","+g+","+b+",'"+element+"'),500");
	}
}
function contactSubmit(){
	if(document.contact.firstname.value=='') { 
		alert('Some required information was missing from the form.\n\nPlease include your First Name.');
		document.contact.firstname.focus();
		return false;
	}
	if(document.contact.lastname.value=='') { 
		alert('Some required information was missing from the form.\n\nPlease include your Last Name.');
		document.contact.lastname.focus();
		return false;
	}
	if(document.contact.email.value=='') { 
		alert('Some required information was missing from the form.\n\nPlease include your Email Address.');
		document.contact.email.focus();
		return false;
	}
	AtPos=document.contact.email.value.indexOf("@");
	StopPos=document.contact.email.value.lastIndexOf(".");
	if (AtPos==-1 || StopPos==-1){
		alert('Some required information was incorectly entered into the form.\n\nPlease verify your Email Address.');
		document.contact.email.focus();
		return false;
	}
	if(StopPos<AtPos){
		alert('Some required information was incorectly entered into the form.\n\nPlease verify your Email Address.');
		document.contact.email.focus();
		return false;
	}
	if(StopPos-AtPos==2){
		alert('Some required information was incorectly entered into the form.\n\nPlease verify your Email Address.');
		document.contact.email.focus();
		return false;
	}
	if(AtPos==0 || StopPos==0){
		alert('Some required information was incorectly entered into the form.\n\nPlease verify your Email Address.');
		document.contact.email.focus();
		return false;
	}
	if(StopPos==document.contact.email.value.length-1){
		alert('Some required information was incorectly entered into the form.\n\nPlease verify your Email Address.');
		document.contact.email.focus();
		return false;
	}
	if(document.contact.image.value=='') { 
		alert('Some required information was missing from the form.\n\nPlease type in the Image Verification.');
		document.contact.image.focus();
		return false;
	}
	document.contact.submit();
}
function checkReservations(){
	if(document.reservations.name.value=='') { 
		alert('Some required information was missing from the form.\n Please include your Name.');
		document.reservations.name.focus();
		return false;
	}
	if(document.reservations.email.value=='') { 
		alert('Some required information was missing from the form.\n Please include your Email Address.');
		document.reservations.email.focus();
		return false;
	}
	if(document.reservations.member_number.value=='') { 
		alert('Some required information was missing from the form.\n Please include your Member Number.');
		document.reservations.member_number.focus();
		return false;
	}
	if(document.reservations.member_group.value=='') { 
		alert('Some required information was missing from the form.\n Please include your Member Group.');
		document.reservations.member_group.focus();
		return false;
	}
	document.reservations.submit();
}
function checkDuplicates(testArray){
	var i,j,n;
	n=testArray.length;
	for (i=0; i<n; i++) {
		for (j=i+1; j<n; j++){
			if(testArray[i]!=''){
				if(testArray[i]==testArray[j]) return testArray[j];
			}
		}
	}
	return false;
}
function checkChoices(week){
	var choice=new Array();
	choice[0]=document.reservations['Week_1_Choice_1'].value;
	choice[1]=document.reservations['Week_1_Choice_2'].value;
	choice[2]=document.reservations['Week_1_Choice_3'].value;
	choice[3]=document.reservations['Week_1_Choice_4'].value;
	choice[4]=document.reservations['Week_1_Choice_5'].value;
	choice[5]=document.reservations['Week_2_Choice_1'].value;
	choice[6]=document.reservations['Week_2_Choice_2'].value;
	choice[7]=document.reservations['Week_2_Choice_3'].value;
	choice[8]=document.reservations['Week_2_Choice_4'].value;
	choice[9]=document.reservations['Week_2_Choice_5'].value;
	choice[10]=document.reservations['Week_3_Choice_1'].value;
	choice[11]=document.reservations['Week_3_Choice_2'].value;
	choice[12]=document.reservations['Week_3_Choice_3'].value;
	choice[13]=document.reservations['Week_3_Choice_4'].value;
	choice[14]=document.reservations['Week_3_Choice_5'].value;
	choice[15]=document.reservations['Week_4_Choice_1'].value;
	choice[16]=document.reservations['Week_4_Choice_2'].value;
	choice[17]=document.reservations['Week_4_Choice_3'].value;
	choice[18]=document.reservations['Week_4_Choice_4'].value;
	choice[19]=document.reservations['Week_4_Choice_5'].value;
	dupe=checkDuplicates(choice);
	if(dupe!=false){
		alert('Please select different dates for each Choice per Planned Vaction Week.\nThe duplicate date is:\nWeek '+week+' - '+dupe);
	}
}
function checkRent(weeknumber){
	if(document.reservations["rent_week_"+weeknumber].checked){
		document.reservations["Week_"+weeknumber+"_Choice_1"].value="please rent";
		document.reservations["Week_"+weeknumber+"_Choice_2"].value="please rent";
		document.reservations["Week_"+weeknumber+"_Choice_3"].value="please rent";
		document.reservations["Week_"+weeknumber+"_Choice_4"].value="please rent";
		document.reservations["Week_"+weeknumber+"_Choice_5"].value="please rent";
	}else{
		document.reservations["Week_"+weeknumber+"_Choice_1"].value="";
		document.reservations["Week_"+weeknumber+"_Choice_2"].value="";
		document.reservations["Week_"+weeknumber+"_Choice_3"].value="";
		document.reservations["Week_"+weeknumber+"_Choice_4"].value="";
		document.reservations["Week_"+weeknumber+"_Choice_5"].value="";
	}
}
function checkLength(objectID,maxchars,objectName){
	if(objectID.value.length > maxchars){
		alert('Too many characters in '+objectName+'.\n\nPlease remove '+(objectID.value.length - maxchars)+ ' characters.');
		return false;
	}else{
		return true;
	}
}