window.addEvent('domready', function(){
	var b = '<div id="legal-notice-content"> \
		<div id="legal-notice-header"> \
			<h1 class="title cufon">Legal Notice</h1> \
			<div id="legalNoticeCloser" style="position: absolute; top: 8px; right: 8px;"> \
				<a href="javascript:void(0);" style="border: none;">[ CLOSE ]</a> \
			</div> \
		</div> \
		<div id="legal-notice-body"> \
			<p class="content"> \
				<img class="left" src="../img/legal-logo.png" /> \
				This site is prepared to provide information about <em><strong>Cosmetic, Plastic and Reconstructive Surgery.</strong></em>. This site has no commercial purposes. If you see that any part of the site is against laws, please inform us. Also because of the laws and regulations, we can not provide detailed information about surgeries or "before & after" photos of surgeries. \
			</p> \
		</div> \
	</div>';
	b = new Element("div").set("html", b).inject(document.body);
	$("legalNoticeCloser").addEvent("click", function () {
		$("legal-notice-content").morph({
			opacity: [1, 0]
		});
		(function () {
			$("legal-notice-content").setStyles({
				left: 0,
				top: 0,
				width: 0,
				height: 0
			})
		}).delay(500);
		a.morph({
			opacity: [0.5, 0]
		});
		(function () {
			a.setStyles({
				width: 0,
				height: 0
			})
		}).delay(500)
	});
	var a = new Element("div", {
		styles: {
			"background-color": "#444",
			opacity: 0,
			position: "absolute",
			left: 0,
			top: 0,
			width: 0,
			height: 0,
			"z-index": 999
		}
	}).addEvent("click", function () {
		$("legal-notice-content").morph({
			opacity: [1, 0]
		});
		(function () {
			$("legal-notice-content").setStyles({
				left: 0,
				top: 0,
				width: 0,
				height: 0
			})
		}).delay(500);
		a.morph({
			opacity: [0.5, 0]
		});
		(function () {
			a.setStyles({
				width: 0,
				height: 0
			})
		}).delay(500)
	}).inject(document.body);
	$("legal-link").getElement("a").addEvent("click", function (c) {
		c.stop();
		a.setStyles({
			width: window.getScrollSize().x,
			height: window.getScrollSize().y
		});
		a.morph({
			opacity: [0, 0.5]
		});
		$("legal-notice-content").setStyles({
			left: (window.getSize().x - 600) / 2,
			top: window.getScroll().y + ((window.getSize().y - 200) / 2),
			width: 600,
			height: 200,
			position: "absolute"
		});
		$("legal-notice-content").morph({
			opacity: [0, 1]
		})
	})
});
