$(document).ready(function() {
	
	function getPageSizeWithScroll(){
		if (window.innerHeight && window.scrollMaxY) {// Firefox
			yWithScroll = window.innerHeight + window.scrollMaxY;
			xWithScroll = window.innerWidth + window.scrollMaxX;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			yWithScroll = document.body.scrollHeight;
			xWithScroll = document.body.scrollWidth;
		} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
			yWithScroll = document.body.offsetHeight;
			xWithScroll = document.body.offsetWidth;
	  	}
		arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
		return arrayPageSizeWithScroll;
	}

	var pageHeight = getPageSizeWithScroll();

	$("#popup").css("height", pageHeight[1] + "px");
	
	$(".popup-link").click(function() {
		$("#popup").fadeIn(500);
		$("#popup-frame").fadeIn(500);		
	});
	
	$("#popup").click(function() {
		$("#popup").fadeOut("fast");
		$("#popup-frame").fadeOut("fast");		
	});	

});