// # resize
	function centerSmallWindow() {
		var tWidth = $("#smallWindow").width();
		var tHeight = $("#smallWindow").height();
		var tWindowWidth = $(window).width();
		var tWindowHeight = $(window).height();
		
		var tScrollTop = $(document).scrollTop();
		
		
		//console.log("tWindowWidth: "+tWindowWidth);
		
		var tX = Math.floor((tWindowWidth-tWidth)*.5) - 15;
		if (tX < 0) tX = 0;
		var tY = Math.floor((tWindowHeight-tHeight)*.35) + tScrollTop;
		if (tY < 0) tY = 0;
		
		//console.log("tY: "+tY);
		
		$("#smallWindow").css({left:tX, top:tY});
	}
	function resized() {
		centerSmallWindow();
	}
	function scrolled() {
		centerSmallWindow();
	}

// # speific functions
	function showBanner(id_a, width_a, height_a, text_a) {
		var tUrl = "portfolio/banners/bannerShower.php?id="+id_a+"&width="+width_a+"&height="+height_a;
		
		if (!text_a) text_a = "&nbsp;";
		showSmallWindow(tUrl, width_a, height_a, "<i>"+text_a+"</i>");
	}
	function showLiveSite(url_a, width_a, height_a, hostName_a, hostUrl_a, text_a) {
		var tHost = "";
		var tText = "";
		if (hostName_a) {
			tHost = "<a class='smallWindowText' href='"+hostUrl_a+"'>"+hostName_a+"</a>";
			tText = "This site is hosted by "+tHost;
		}
		if (text_a) {
			tText += "<br><i>"+text_a+"</i>";
		}
		if (tText == "") tText = "&nbsp;";
		showSmallWindow(url_a, width_a, height_a, tText);
	}
	function showArchivedSite(id_a, width_a, height_a, liveUrl_a, text_a) {
		var tUrl = "../archive/"+id_a;
		var tText = "<b>note</b>: you are viewing an archived version of this site.";
		if (liveUrl_a) {
			tText += " <a class='smallWindowText' href='"+liveUrl_a+"' target='_blank'>click here for the live version.</a>";
		} else {
			tText += " there is no live version.";
		}
		if (text_a) {
			tText += "<br><i>"+text_a+"</i>";
		}
		showSmallWindow(tUrl, width_a, height_a, tText);
	}
	
	smallWindowSize = {
		borderSize:24, // # this is hard coded from the div
		width:100,
		height:100
	}
	function showSmallWindow(url_a, width_a, height_a, text_a) {
		if (!url_a) return;
		if (!text_a) text_a = "&nbsp;";
		
		$("#smallWindowIFrame").attr("src", url_a);
		$("#smallWindowIFrame").width(width_a);
		$("#smallWindowIFrame").height(height_a);
		
		
		$("#smallWindow").width(width_a);
		
		smallWindowSize.width = width_a;
		smallWindowSize.height = height_a;
		
		$(".smallWindowText").html(text_a);
		
		centerSmallWindow();
		
		$("#smallWindow").show();
	}
	function hideSmallWindow() {
		$("#smallWindow").hide();
		$("#smallWindowIFrame").attr("src", "about:blank");
	}
