$(document).ready(function(){
	if(typeof($) == 'function') {
		var _btn = $('#btn-try-it-out,#btn-try-it-out2');
		var _popup = $('#popup-holder');
		if(_btn.length > 0 && _popup.length > 0) {
			var newElem = document.createElement('div');
			newElem.id = 'popup-fader';
			document.body.appendChild(newElem);
			newElem = $(newElem);
			newElem.css({
				position: 'absolute',
				left: 0,
				top: 0,
				width: '100%',
				height: '100%',
				background: '#000',
				zIndex: 99,
				display: 'none'
			});
			_btn.click(function() {
				var _h = document.body.offsetHeight;
				if(window.innerHeight > _h) _h = window.innerHeight;
				else if(document.documentElement.clientHeight > _h) _h = document.documentElement.clientHeight;
				newElem.css({opacity: 0, display:'block', height: _h}).fadeTo(300, 0.8, function() {
					_popup.show();
					_popup.find('a.close').click(function() {
						_popup.hide();
						newElem.fadeOut(300);
						return false;
					});
				});
				
				return false;
			});
		}
	}
	
});