	


function openCalendar() {
	switch(browsername)	{
		case "MSIE":
			ypos = document.body.scrollTop;
			break;
		case "NS":
			ypos = window.scrollY;
			break;
		default:
			ypos = document.body.scrollTop;
			break;
	}
	
	  var myWidth = 0, myHeight = 0;
	  if( typeof( window.innerWidth ) == 'number' ) {
	    //Non-IE
	    myWidth = window.innerWidth;
	    myHeight = window.innerHeight;
	  } else if( document.documentElement &&
	      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	    //IE 6+ in 'standards compliant mode'
	    myWidth = document.documentElement.clientWidth;
	    myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	    //IE 4 compatible
	    myWidth = document.body.clientWidth;
	    myHeight = document.body.clientHeight;
	  }
	  //window.alert( 'Width = ' + myWidth );
	  //window.alert( 'Height = ' + myHeight );


		document.getElementById("popupcalendar_html").style.top = ypos + (myHeight/2) - 166;
		document.getElementById("popupcalendar_html").style.visibility = "visible"
		document.getElementById("popupcalendar_html").style.display = "block";

	
}

function validate_form_calendar() {
		Goon = "0";
		var msg = "";
		if(document.forms.send.calendar_name.value == "") {	Goon = "1"; }
		if(!checkEmail(document.forms.send.calendar_email.value)) { Goon = "1";	}
		if(Goon == "0"){
			document.getElementById("calendar_alreadyopen").value = "2";
			document.getElementById("complete_url").value = document.getElementById("complete_url").value + "&calendar_alreadyopen=" + document.getElementById("calendar_alreadyopen").value;
			document.forms.send.method="post";
			document.forms.send.action = "vcalendar_send.asp";
			document.forms.send.submit();	
		}else{
			document.getElementById("popupcalendar_html").style.visibility = "visible";
			document.getElementById("validate_calendar").style.display = "block";
		}
}

function closeCalendar(){
	document.getElementById("popupcalendar_html").style.visibility = "hidden";
	document.getElementById("validate_calendar").style.display = "none";
}

function goBack(){
	if(document.getElementById("calendar_alreadyopen").value == "1"){
		history.go(-1);
	}else if(document.getElementById("calendar_alreadyopen").value == "2"){
		history.go(-2);
	}else{
		history.back();
	}
}




function openRsvp() {
	switch(browsername)	{
		case "MSIE":
			ypos = document.body.scrollTop;
			break;
		case "NS":
			ypos = window.scrollY;
			break;
		default:
			ypos = document.body.scrollTop;
			break;
	}
	
	  var myWidth = 0, myHeight = 0;
	  if( typeof( window.innerWidth ) == 'number' ) {
	    //Non-IE
	    myWidth = window.innerWidth;
	    myHeight = window.innerHeight;
	  } else if( document.documentElement &&
	      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	    //IE 6+ in 'standards compliant mode'
	    myWidth = document.documentElement.clientWidth;
	    myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	    //IE 4 compatible
	    myWidth = document.body.clientWidth;
	    myHeight = document.body.clientHeight;
	  }
	  //window.alert( 'Width = ' + myWidth );
	  //window.alert( 'Height = ' + myHeight );

	document.getElementById("popuprsvp_html").style.top = ypos + (myHeight/2) - 166;
	document.getElementById("popuprsvp_html").style.visibility = "visible"
	document.getElementById("popuprsvp_html").style.display = "block";
}

function validate_form_rsvp() {
		Goon = "0";
		var msg = "";
		if(document.forms.send.rsvp_first_name.value == "") {	Goon = "1"; }
		if(document.forms.send.rsvp_last_name.value == "") { Goon = "1";	}
		if(!checkEmail(document.forms.send.rsvp_email.value)) { Goon = "1";	}
		if(document.forms.send.rsvp_phone.value == "") { Goon = "1";	}
		if(Goon == "0"){
			document.getElementById("calendar_alreadyopen").value = "2";
			document.getElementById("complete_url").value = document.getElementById("complete_url").value + "&calendar_alreadyopen=" + document.getElementById("calendar_alreadyopen").value;
			document.forms.send.method="get";
			document.forms.send.action = "db_rsvp_send.asp";
			document.forms.send.submit();	
		}else{
			document.getElementById("popuprsvp_html").style.visibility = "visible";
			document.getElementById("validate_rsvp").style.display = "block";
		}
}

function closeRsvp(){
	document.getElementById("popuprsvp_html").style.visibility = "hidden";
	document.getElementById("validate_rsvp").style.display = "none";
}


