var flashvars = {};
flashvars.dataPath = "/flash/discussion-guide/data/full.xml";
//flashvars.pageName = document.title;


var params = {};
params.allowScriptAccess = "always";
params.menu = "false";
params.quality = "high";
params.wmode = "transparent";

var attributes = {};
attributes.id = "drDiscussionGuide";


//swfobject.embedSWF(swfUrl, id, width, height, version, expressInstallSwfurl = null, flashvars = null, params = null, attributes = null);
swfobject.embedSWF("/flash/discussion-guide/discussion-guide.swf", "drDiscussionGuideDiv", "195", "450", "8.0.24", "false", flashvars, params, attributes);



function handlePageScroll() {
	var newYval = 0;
	// ANOTHER HACK TO MAKE IE WORK
	if (typeof(window.pageYOffset) == "number") {
		newYval = window.pageYOffset;
	} else if (document.body && document.body.scrollTop) {
		newYval = document.body.scrollTop;
	} else if (document.documentElement && document.documentElement.scrollTop) {
		newYval = document.documentElement.scrollTop;
	}
	newYval += 10;
	
	if (newYval < 150) newYval = 150;
	
	document.getElementById("drDiscussionGuide").style.top = newYval + "px";
}





function addItemToDiscussionGuide(passedVar) {
	// CALLED BY LINKS ON THE PAGE TO TELL THE FLASH PIECE TO ADD A QUESTION ID TO THE LIST
	// USE THE IDS LISTED IN /flash/discussion-guide/data/full.xml
	document.getElementById("drDiscussionGuide").addItem(passedVar);
}



 
 
 
 
 
function showPrintPreview() {
	// CALLED BY FLASH
	SWFDelegate('/flash/discussion-guide/discussion-guide-print.swf','500','650','');
//	monitorFlashToolUsage("viewGuide");
}

 
 

function SWFDelegate(url,width,height,caption) {
	var objLink = document.createElement('a');
	objLink.setAttribute('href',url);
	objLink.setAttribute('rel','lightbox');
	objLink.setAttribute('title',caption);
	objLink.setAttribute('flashvars', 'pageName=' + document.title);
	if(typeof width != 'undefined') {
		objLink.setAttribute('width',width);
	}
	if(typeof height != 'undefined') {
		objLink.setAttribute('height',height);
	}
	Lightbox.prototype.start(objLink);
}




function emailForm(passedMessageBody) {
	// CALLED BY FLASH
//	alert("Would have emailed: \n" + passedMessageBody);
}

function getPageTitle() {
	return document.title;
}