var popup_x = 100, popup_y = 100;

var storyboard_url = 'stPop.html';
var storyboard_w = 881, storyboard_h = 526;

var video_url = 'videoPlayer.html';
//var video_w = 426, video_h = 326;
var video_w = 360, video_h = 256;

var storyboard_info = {};
var video_info = {};

function popStoryboard(aName)
{
	// Give the popup something to pull.
	storyboard_info.image = aName;

	openSimpleWindow(site_url + "/" + storyboard_url, storyboard_w, storyboard_h);
}

function popFlashWin(content, w, h)
{
	openSimpleWindow(site_url + "/" + content, w, h);
}

function popVidWin(aName, cTitle)
{
	// Give the popup something to pull.
	video_info.source = aName;
	video_info.title = cTitle;
	video_info.debug = window.location.search.indexOf("videodebug") != -1;

	openSimpleWindow(site_url + "/" + video_url, video_w, video_h);
}

function openSimpleWindow(url, width, height)
{
	// Mac IE fix - credit: Pascal Weaver of Knitting Pixel. http://www.knittingpixel.com
	if (document.body.clientWidth && window.navigator.appVersion.indexOf('MSIE') != -1 && window.navigator.appVersion.indexOf('Mac') != -1)
	{
		width += 10;
		height += 10;
	}

	window.open(url, '', 'height=' + height + ',width=' + width + ',left=' + popup_x + ',top=' + popup_y);
}

function writeQuickTime(el_id, video, doc)
{
	if (!doc)
		doc = document;

	doc.getElementById(el_id).innerHTML = '<embed id="popup-video" src="' + video + '" width="360" height="256" autoplay="true" controller="true" loop="false" bgcolor="000000" enablejavascript="true" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/indext.html"></embed>';
}