﻿/*global document, window, Event */



var EMAIL = {

	emailPage: {
		mailWindow: null,

		RootPath: '/Content/MailPage/',

		emailPage: function (PageID) {
			var sURL =
				this.RootPath +
				'Window-MailPage.asp' +
				'?URL=' + encodeURIComponent(document.location.href) +
				'&Title=' + encodeURIComponent(document.title);

			if (PageID) {
				sURL += '&PageID=' + PageID;
			}

			this.mailWindow =
				window.open(sURL, 'EmailPage',
				'height=575,width=500,toolbar=no,scrollbars=yes,resizable=yes');

			if (this.mailWindow !== null) {
				this.mailWindow.Scope = this;
			} else {
				window.alert(
					'Your popup blocker has prevented us from ' +
					'opening a new window.\nPlease disable ' +
					'your popup blocker and try again.');
			}
		},

		closeEmail: function () {
			if (this.mailWindow !== null) {
				this.mailWindow.close();
				this.mailWindow = null;
			}
		}

	}


};
Event.onDOMReady(EMAIL.emailPage, EMAIL, true);


