
///////////////////////////////////////////////////////////////////////////////
//
// Email
//

// Opens e-mail window for Re:vive
// NOTE:  Assumes valid email address
function openDefaultEmailWindow( /* String */ email ) {
	openEmailWindow("", email);
}

// Opens e-mail window for 'pageTitle' (i.e. TCBC, Re:vive, etc.)
// Assumes valid email address
function openEmailWindow( /* String */ pageTitle,
						  						/* String */ email     ) {

	var winLeft = (screen.width - 600) / 2;
	var winTop  = (screen.height - 450) / 2 - 50;

	if (winLeft < 0) {
		winLeft = 0;
	}
	if (winTop < 0) {
		winTop = 0;
	}

	/*
	popUpWindow = window.open( '/revive/email/emailform.jsp?sendToAddress='+email+'&pageTitle='+pageTitle,
			'email'+parseInt(Math.random()*100),
			'toolbar=0,location=0,scrollbars=1,resizable=1,status=1,width='+ 600 +',height=' + 450 + ',top=' + winTop + ',left=' + winLeft );
	*/
	
	openSizedWindow(
			"/revive/email/emailform.jsp?sendToAddress=" + email + "&pageTitle=" + pageTitle,
			"email" + parseInt(Math.random()*100),
			600, 450,
			"toolbar=0,location=0,scrollbars=1,resizable=1,status=1" );
}

///////////////////////////////////////////////////////////////////////////////
//
// Centered Pop-up Windows
//

function openSizedWindow( /* String */ url,
												  /* String */ title,
                          /* int */    width,
                          /* int */    height,
                          /* String */ parms  ) {

  // sample parms
  // "toolbar=0,location=0,scrollbars=0,resizable=1"

  var winLeft = (screen.width - width) / 2;
  var winTop  = (screen.height - height) / 2 - 50;

  if (winLeft < 0) {
    winLeft = 0;
  }
  if (winTop < 0) {
    winTop = 0;
  }

  var popUpWindow = window.open( url,
			title,
			parms + "," + "width="+ width +",height=" + height + ",top=" + winTop + ",left=" + winLeft );
	
	return popUpWindow;
}

///////////////////////////////////////////////////////////////////////////////
//
// Calendar
//

function openCalendarWindow( /* String */ id ) {

	var winLeft = (screen.width - 600) / 2;
	var winTop  = (screen.height - 350) / 2 - 50;

	if (winLeft < 0) {
		winLeft = 0;
	}
	if (winTop < 0) {
		winTop = 0;
	}

	/*
	popUpWindow = window.open( '/tcbc/calendar/displayevent.jsp?id=' + id,
			'event' + parseInt(Math.random()*100),
			'toolbar=0,location=0,scrollbars=1,resizable=1,status=1,width='+ 600 +',height=' + 350 + ',top=' + winTop + ',left=' + winLeft );
	*/

	openSizedWindow(
			"/tcbc/calendar/displayevent.jsp?id=" + id,
			"event" + parseInt(Math.random()*100),
			600, 350,
			"toolbar=0,location=0,scrollbars=1,resizable=1,status=1" );
}


///////////////////////////////////////////////////////////////////////////////
//
// Show / Hide Display
//

function hide( /* String */ id ) {
	if (document.getElementById(id) ) {
		document.getElementById(id).style.display = "none";
	}
}

function show( /* String */ id ) {
	if (document.getElementById(id) ) {
		document.getElementById(id).style.display = "";
	}
}

function showHide( /* String */ id ) {
	if (document.getElementById(id) ) {
		if (document.getElementById(id).style.display == "") {
			document.getElementById(id).style.display = "none";
		}
		else {
			document.getElementById(id).style.display = "";
		}
	}
}


///////////////////////////////////////////////////////////////////////////////
//
// Video
//

function openVideo( /* String */ url,
										/* int */    width,
										/* int */    height ) {

	
}
