///////////////////////////////////////////////////////////////////////////////
//
// Email
//

// Opens e-mail window for Tri-City
// 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( '/ibc/email/emailform.jsp?sendToAddress='+email+'&pageTitle='+pageTitle,
			'email'+parseInt(Math.random()*100),
			'toolbar=0,location=0,scrollbars=0,resizable=1,status=1,width='+ 600 +',height=' + 450 + ',top=' + winTop + ',left=' + winLeft );
}

///////////////////////////////////////////////////////////////////////////////
//
// 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 );
}

///////////////////////////////////////////////////////////////////////////////
//
// Youth Conference Registration
//

function openYCRegistrationWindow() {

	popUpWindow = window.open( 'http://www.tricityministries.org/tbcforms/youthregistration/newYouth.action',
			'YCreg' + parseInt(Math.random()*100),
			'toolbar=0,location=0,scrollbars=1,resizable=1,status=1,width='+ 750 +',height=' + 800  );
}

///////////////////////////////////////////////////////////////////////////////
//
// Image Rotate
//

///////////////////////////////////////////////////////////////////////////////
//
// College Comparison Tool
//

function openCollegeComparisonToolWindow() {

	popUpWindow = window.open( 'http://www.ibconline.edu/ibc/resources/tools/college_comparison_tool.jsp',
			'CollegeComparisonTool' + parseInt(Math.random()*100),
			'menubar=1,toolbar=0,location=0,scrollbars=1,resizable=1,status=1,width='+ 750 +',height=' + 800  );
}

