nokiaPopup = {

		popup : "",
		popupOpener : "",

		open : function(opener, type, url, thumb) {

				this.popup = $("#popup").get(0);
				this.popupOpener = $(opener);

				if(type == "image")
					$(this.popup).find("div.inner-inside").html('<img src="' + url + '" alt="" />');
				else if (type == "video")
					$(this.popup).find("div.inner-inside").html('<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/' + url + '&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/' + url + '&fs=1&rel=0" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object>');
				else if(type == "video_inner")
					$(this.popup).find("div.inner-inside").html('<script> var videoPrefs = { file: "' + url + '", image: "' + thumb + '", volume: "85" } </script><div id="player"><strong>You need to upgrade your Flash Player to version 9 or newer.</strong></div><script type="text/javascript"> swfobject.embedSWF("player.swf", "player", "425", "344", "9.0.0","expressInstall.swf", videoPrefs); </script>');

				$("#popup-shadow").click(function() { nokiaPopup.hide(); }).removeClass("hidden");
				//$(this.popup).removeClass("hidden").css("top", (($(document).scrollTop() + ($("body").height() / 2)) - ($(this.popup).height() / 2)) + "px");
				$(this.popup).removeClass("hidden").css("top", ($(document).scrollTop() + 150) + "px");

				return false;
		},
		
		hide : function() {

				$("#popup-shadow").addClass("hidden");
				$(nokiaPopup.popup).addClass("hidden");
				
				return false;
		}
}
