// JavaScript Document

function ExtraExpand(Section) {

	var theAnchor = "more" + Section;
	var theArea = "addtl" + Section;
	var chkAnchor = document.getElementById(theAnchor);
	var chkArea = document.getElementById(theArea);
	
	if (chkArea.style.display=="block") {
		chkArea.style.display="none";
		chkAnchor.style.display="block";
	} else {
		chkArea.style.display="block";
		chkAnchor.style.display="none";
	}
}

function CollapseContent() {
	var area1 = document.getElementById("addtl1");
	var area2 = document.getElementById("addtl2");
	var area3 = document.getElementById("addtl3");
	var chk1 = document.getElementById("more1");
	var chk2 = document.getElementById("more2");
	var chk3 = document.getElementById("more3");
	
	if (area1) {
		area1.style.display="none";
		chk1.style.display="block";
	}
	
	if (area2) {
		area2.style.display="none";
		chk2.style.display="block";
	}
	
	if (area3) {	
		area3.style.display="none";
		chk3.style.display="block";
	}
}

function LaunchBreeze(obj){
	url = obj.href
	
	if (url.indexOf("breeze") > 0){
		windowFeatures = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=800,height=500"
	}
	else{
			windowFeatures = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=970,height=660"
	}
	
	BPWindow = window.open(url,"BPPlayer",windowFeatures)
}


function LaunchDLink(obj){
	url = obj.href
	windowFeatures = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=600,height=500"
	DLWindow = window.open(url,"DLPlayer",windowFeatures)
}


function LaunchSlideShow(obj){
	url = obj.href
	windowFeatures = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=690,height=530"
	SSWindow = window.open(url,"SSPlayer",windowFeatures)
}

function LaunchSlideShowAudio(obj){
	url = obj.href
	windowFeatures = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=670,height=585"
	SSWindow = window.open(url,"SSPlayer",windowFeatures)
}

function LaunchSharePage(){
	windowFeatures = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=540";
	SPWindow = window.open('/share/?'+location.href,"NewWindow",windowFeatures);
}
function LaunchSubscribe(){
	windowFeatures = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=280";
	SBWindow = window.open('/includes/subscribe.cfm?'+location.href,"NewWindow",windowFeatures);
}

function LaunchGuideTour(){

	url = "/media/dww_guidedtour.html"
	videoName = "GuidedTour"
	
	windowFeatures = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=580,height=440"
	VideoWindow = window.open(url,videoName,windowFeatures)
	VideoWindow.focus()
}
function LaunchOverMovieMovie(tid,forder){
	if(forder =="" || typeof(forder)=="undefined"){ forder = 0 }
		
		url = "/topic/topic_overview.cfm?T_ID="+tid+"&F_Order="+forder
		videoName = "TopicOverview"
		
		windowFeatures = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=690,height=530"
		VideoWindow = window.open(url,videoName,windowFeatures)
		VideoWindow.focus()
	}
	
function LaunchMedia(obj,catid,doctype)
{
	url = obj.href
	windowFeatures = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no"
	
	if(doctype == 'flasho' || doctype == 'flashl'){
	//if(catid == 3) windowFeatures = windowFeatures + ",width=690,height=530"
	if(catid ==3) windowFeatures = windowFeatures + ",width=970,height=660"
		else windowFeatures = windowFeatures + ",width=970,height=660"
	}
	if(doctype == 'slideshow') windowFeatures = windowFeatures + ",width=690,height=530"
	if(doctype == 'ssaud')	windowFeatures = windowFeatures + ",width=670,height=585"
	
	PresentationWindow = window.open(url,"PresentationPlayer",windowFeatures)
}


/*
Commented out by Bart Lewis on 10/28/09

function ReportPrint(){
	var theFirefox = 0;
	
	if (navigator.userAgent.indexOf("Firefox") > -1)
	{
		var theFirefox = 1;	
	}
	
	Printable = document.body.innerHTML;
	
	//open a blank window
	w=window.open('about:blank');
	//write content var html to the window
	// w.document.open('','PrintPage');
	
	w.document.writeln("<html lang='en'>");
	w.document.writeln("<head><title>Doing What Works</title>");
	//write some javascript to make the newly opened window print itself.
	w.document.writeln("<link rel='stylesheet' href='/includes/styles/master.css' media='screen, projection, print'>");
	w.document.writeln("<link rel='stylesheet' href='/includes/styles/print.css' media='screen, projection, print'>");
w.document.writeln("</head><body>");
	w.document.writeln(Printable);
	// scripttext = "<";
	// scripttext = scripttext + "script>window.print();</";
	// scripttext = scripttext + "script>";
	//w.document.writeln(scripttext);
	w.document.writeln("</body>");
	w.document.writeln("</html>");
	//w.document.close();
	//if (theFirefox == 0)
	//{
	//	w.window.close();
	//}
}
*/

