window.addEvent('domready', function(){

	loginPopup = true; // see core.js videos section

	$$('.login-required').addEvent('click', function(e){
		new Event(e).stop();

		this.overlay = new Element('div', {
			id: 'overlay'
		}).inject(document.body);

		this.dialog = new Element('div', {
			id: 'dialog-box',
			'class': 'dialog-box generic'
		}).set('html','\
			<div class="dialog-box generic">\
				<a href="#" id="dialog-close" class="dialog-close" title="Close"></a>\
				<div class="top-popup" >\
					<div class="top-left-popup popup-corner"></div>\
					<div class="top-right-popup popup-corner"></div>\
				</div>\
				<div class="dialog-content-wrap">\
					<div class="dialog-content">\
						<p class="dialog-title">Sign-In Required</p>\
						<p>Please login to access this part of our website. If you already have an online account with us, click the secure sign-in button below. If you do not have an account, please click create a new account.</p>\
						<p>Creating a new account is free and only takes a minute to complete! The benefits of an AOA account includewatching videos, commenting on the blog, and experiencing other exciting features across the website.</p>\
						<p>Please note that creating an account does not enroll you in AOA. If you have already enrolled your student, but you do not currently have an account, please create a new account to access this part of our website.</p>\
						<a class="btn" href="/login.php" title="Sign In"><span>Secure Sign-In</span></a>\
						<a class="btn" href="/account-new.php" title="Create Account"><span>Create a New Account</span></a>\
					</div>\
				</div>\
				<div class="bottom-popup">\
					<div class="bottom-left-popup popup-corner"></div>\
					<div class="bottom-right-popup popup-corner"></div>\
				</div>\
			</div>').inject(document.body);

		$('dialog-close').addEvent('click', function(el){
			new Event(el).stop();
			$('dialog-box').dispose();
			$('overlay').dispose();
		});
		$('overlay').addEvent('click', function(el){
			new Event(el).stop();
			$('dialog-close').fireEvent('click');
		});
	});

});
