// -- required form fields - contact form:
function checkFields() {
missinginfo = "";
if (document.form.name.value == "") {
missinginfo += "\n     -  name";
}
if ((document.form.email.value == "") || 
(document.form.email.value.indexOf('@') == -1) || 
(document.form.email.value.indexOf('.') == -1)) {
missinginfo += "\n     -  email address";
}
if(document.form.message.value == "") {
missinginfo += "\n     -  message";
}
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"Please fill in the following fields:\n" +
missinginfo + "\n_____________________________" +
"\nThanks!";
alert(missinginfo);
return false;
}
else return true;
}
// -- end required form fields.

// -- required form fields - newsletter sign-up form:
function checkFieldsnl() {
missinginfo = "";
if (document.formnl.name.value == "") {
missinginfo += "\n     -  name";
}
if ((document.formnl.email.value == "") || 
(document.formnl.email.value.indexOf('@') == -1) || 
(document.formnl.email.value.indexOf('.') == -1)) {
missinginfo += "\n     -  email address";
}
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"Please fill in the following fields:\n" +
missinginfo + "\n_____________________________" +
"\nThanks!";
alert(missinginfo);
return false;
}
else return true;
}
// -- end required form fields.

// -- required form fields for Testimonials page:
function checkTestimonial() {
for (var i = 0; i < document.testiform.elements.length; i++) { 
	if (document.testiform.elements[i].value == "" ) {        
		alert("All fields are required."); 
		return false   
	}
}
}

// -- gallery & retreats pop-ups OLD OLD OLD:
function showimage(img){
	openWindow('gallery_popups.html?image='+img,300,300)
}
	
function openWindow(url, height, width){
		var sParams = 'height='+height+',' 
            sParams = sParams + 'width='+width+',' 
            sParams = sParams + 'toolbar=no,' 
            sParams = sParams + 'status=no,' 
            sParams = sParams + 'scrollbars=yes,' 
            sParams = sParams + 'directories=no,' 
            sParams = sParams + 'location=no,' 
            sParams = sParams + 'menubar=no' 
            sParams = sParams + ',resizable=yes';
		var win = window.open(url,"memberwin",sParams,true);
	}
	
// --- gallery & retreats popup windows:
function gallerypop(url) {
mywin =
window.open(url,"gallerywin",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=550,height=600');
}
	
// --- class schedule popup windows:
function classpop(url) {
mywin =
window.open(url,"classwin",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=550,height=600');
}

// -- Coupon popup:
function couponpop(url,name,features) {
twowin = window.open(url,'couponpop','resizable=yes,width=520,height=500,scrollbars=yes');
twowin.focus();
}

// -- Paypal popup:
var win = null;
function paypal(mypage){
h = 500;
w = 800;
myname = 'paypal';
LeftPosition = (screen.width) ? (screen.width-w)/2 : 100;
//TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
TopPosition = 0;
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable=yes'
win = window.open(mypage,myname,settings)
}