

//ACTIVATE IMAGE 
function rollOver() {
	for (i = 0; i < arguments.length; i++) {
	names = arguments[i];
	document.images[names].src = eval(names + "_on.src");
	}
}	
//END ACTIVATE IMAGE 

//DEACTIVATE IMAGE
function rollOff() {
	 for (i = 0; i < arguments.length; i++) {
	 names = arguments[i];
	 document.images[names].src = eval(names + "_off.src");
	 }
}
//END DEACTIVATE IMAGE

//CHANGE LOCATION OF TWO FRAMES AT ONCE
function changeFrames(navFrame, mainFrame) {
top.navfr.location = navFrame;
top.mainfr.location = mainFrame;
}
//END CHANGE LOCATION OF TWO FRAMES AT ONCE

//ACTIVATE ON_STATE IMAGES IN ANOTHER FRAME
function frRollOn(navImageName) {
	navImg = navImageName;
	type = typeof(top.navfr.document.images[navImg]);
	if(type != "object")
	setTimeout('frRollOn(navImg)',800);
	else 
	top.navfr.document.images[navImg].src = eval(navImg + "_on.src"); 
}
//END ACTIVATE ON_STATE IMAGES IN ANOTHER FRAME

//DEACTIVATE ON_STATE IMAGES IN ANOTHER FRAME
function frRollOff(navImageName) {
	navImg2 = navImageName;
	type = typeof(top.navfr.document.images[navImg2]);
	if(type != "object")
	setTimeout('frRollOff(navImg2)',500);
	else
	top.navfr.document.images[navImg2].src = eval(navImg2 + "_off.src"); 
}
//END DEACTIVATE ON_STATE IMAGES IN ANOTHER FRAME

//DEACTIVATE MULTIPLE ON_STATE IMAGES IN ANOTHER FRAME
function frRollOff2() {
	for(i=0;i < arguments.length;i++) {
	navImg3 = arguments[i];
	type = typeof(top.navfr.document.images[navImg3]);
	if(type != "object")
	setTimeout('frRollOff2()',500);
	else
	top.navfr.document.images[navImg3].src = eval(navImg3 + "_off.src"); 
	}
}
//END DEACTIVATE MULTIPLE ON_STATE IMAGES IN ANOTHER FRAME

//FUNCTION TO PRINT PAGE	
function printit() {
if (window.print)
 window.print();
else {
 if (navigator.platform.indexOf('Mac') != -1)
alert('This function does not work in your browser! \n Please select the Print option from the File menu.');
else if (navigator.platform.indexOf('Win') != -1)
alert('This function does not work in your browser! \n Please right click on your mouse and select the Print option.');
else alert('This function does not work in your browser!');
 }
}
// END FUNCTION TO PRINT PAGE	

//VIDEO VARIABLES
var vidSource = '';
var rate = '';
var vidName = '';
var vidCapName ='';
var vidCrName = '';
var vidWinW = null;
var vidWinH = null;
var realPlayWinW = null;
var realPlayWinH = null;
var positionFieldW = null;

//PLAY VIDEO FUNCTION
function playVideo(viSource,vcpName,vName,vcName) {
vidSource = baseDir + "video/" + viSource;
transSource = baseDir + "" +  viSource.substring(0,3) + "e_" + viSource.substring(5) + ".html";
vidCapName = vcpName;
if (vidCapName == null) vidCapName = "";
vidCrName = vcName;
if (vidCrName == null) vidCrName = "";
vidName =  vName;
if (vidName == null) vidName = "";
	if (document.cookie.indexOf('w0781video') != -1 || document.cookie == -1) {
		if (document.cookie.indexOf('w0781video=hi') != -1) {
		vidWinW = 400;
		vidWinH = 400; 
		realPlayWinW = 320;
		realPlayWinH = 240; 
		positionFieldW = 260; 
		rate = "_fast.rpm"; 
		}
		else {
		vidWinW = 260;
		vidWinH = 320; 
		realPlayWinW = 160;
		realPlayWinH = 120; 
		positionFieldW = 100; 
		rate = "_slow.rpm"; 
		}
	openVWin(baseDir + "main/w0781_popVid.html",vidWinW,vidWinH);
	}
	else {
	openVPWin("videoPref");  
	}
 }	
//END PLAYVIDEO FUNCTION

//OPEN VIDEO WINDOW
function openVWin(url,w,h) { 
topWin = (screen.availHeight - h) / 2;
leftWin = (screen.availWidth - w) / 2;
props="status=no,width="+w+",height="+h+",top="+topWin+",screenY="+topWin+",left="+leftWin+",screenX="+leftWin+",resizable=no";
var myVideo = window.open(url,"vidWin",props);
}
//END OPEN VIDEO WINDOW

//OPEN VIDEO PREFERENCE WINDOW
function openVPWin(vPrefname) { 
topWin = (screen.availHeight - 350) / 2;
leftWin = (screen.availWidth - 400) / 2;
props="status=yes,width=400,height=320,top="+topWin+",screenY="+topWin+",left="+leftWin+",screenX="+leftWin+",resizable=no";
myVPref = window.open("../main/w0781_vidpref.html",vPrefname,props);
myVPref.focus();
}
//END OPEN VIDEO PREFERENCE WINDOW

//DYNAMIC FRAME  FOR TRANSCRIPT POPUPS
var frameWrite = '';
function frameWriter(bottomFrame){	
frameWrite = '';	
frameWrite += "<html><head><title>Kennedy, Johnson, and the Great Society</title>";
frameWrite += "<script language='JavaScript'>";
frameWrite += "var bottomUrl = '"+bottomFrame+"'";
frameWrite += "<\/script>";
frameWrite += "</head>\n";
frameWrite += "\n<frameset rows=\"20,*\" framespacing=\"0\" frameborder=\"0\" border=\"0\">\n";
frameWrite +=    "\n<frame name=\"top\" marginwidth=\"10\" marginheight=\"10\" src=\"w0781_tr_top.html\" scrolling=\"no\" framespacing=\"0\" frameborder=\"0\" border=\"0\">\n";
frameWrite +=    "\n<frame name=\"bottom\" marginwidth=\"10\" marginheight=\"10\" src=\"" + bottomFrame+"\" scrolling=\"auto\" framespacing=\"0\" frameborder=\"0\" border=\"0\">\n";
frameWrite +=   "\n</frameset>";
frameWrite += "\n</html>";
}
//END DYNAMIC FRAME FOR TRANSCRIPT POPUPS

//FUNCTION FOR TRANSCRIPTS
function goTrans(bottomTrans){
topWin = (screen.availHeight - 400) / 2;
leftWin = (screen.availWidth - 440) / 2;
props="status=yes,width=440,height=400,top="+topWin+",screenY="+topWin+",left="+leftWin+",screenX="+leftWin+",resizable=yes,scrollbars=yes";
//frameWriter(bottomTrans);
//trPage = baseDir + 'main/w0781_tr_frameset.html';
var trWnd = window.open(bottomTrans,'transcript',props);
trWnd.focus();
}
//END FUNCTION FOR TRANSCRIPTS

//OLD FUNCTION FOR TRANSCRIPTS
function goTransOld(bottomTrans){
topWin = (screen.availHeight - 400) / 2;
leftWin = (screen.availWidth - 440) / 2;
props="status=yes,width=440,height=400,top="+topWin+",screenY="+topWin+",left="+leftWin+",screenX="+leftWin+",resizable=yes";
frameWriter(bottomTrans);
trPage = baseDir + 'main/w0781_tr_frameset.html';
var trWnd = window.open(trPage,'transcript',props);
trWnd.focus();
}
//OLD END FUNCTION FOR TRANSCRIPTS

//ANOTHER FUNCTION FOR TRANSCRIPTS
function goTransNew(bottomTrans, tImage){
trImage = tImage;
topWin = (screen.availHeight - 400) / 2;
leftWin = (screen.availWidth - 440) / 2;
props="status=yes,width=440,height=400,top="+topWin+",screenY="+topWin+",left="+leftWin+",screenX="+leftWin+",resizable=yes";
frameWriter(bottomTrans);
trPage = baseDir + 'main/w0781_tr_frameset.html';
var trWnd = window.open(trPage,'transcript',props);
trWnd.focus();
}
//END ANOTHER FUNCTION FOR TRANSCRIPTS

//DYNAMIC CONTENT FOR EXTERNAL LINKS
function frameWriter2(bottomFrame){	
	frameWrite2 = '';	
	frameWrite2 += "<html><head><title>Kennedy, Johnson, and the Great Society</title>";
	frameWrite2 += "<script language='JavaScript'>";
	frameWrite2 += "var bottomUrl = '"+bottomFrame+"'";
	frameWrite2 += "<\/script>";
	frameWrite2 += "</head>\n";
	frameWrite2 += "\n<frameset rows=\"57,*\" framespacing=\"0\" frameborder=\"0\" border=\"0\">\n";
	frameWrite2 +=    "\n<frame name=\"top\" marginwidth=\"10\" marginheight=\"10\" src=\"ci_top.html\" scrolling=\"no\" framespacing=\"0\" frameborder=\"0\" border=\"0\">\n";
	frameWrite2 +=    "\n<frame name=\"bottom\" marginwidth=\"10\" marginheight=\"10\" src=\""+bottomFrame+"\" scrolling=\"auto\" framespacing=\"0\" frameborder=\"0\" border=\"0\">\n";
	frameWrite2 +=   "\n</frameset>";
	frameWrite2 += "\n</html>";
}
// END DYNAMIC CONTENT FOR EXTERNAL LINKS

//Function for External   Links
function goHere(bottomLoc){
	frameWriter2(bottomLoc);
	framePage = baseDir + 'main/w0781_go_fr.html';
	var frmWnd = window.open(framePage, '_blank', "statusbar,status,menubar,titlebar,toolbar,location,width=760,height=400,resizable=yes,scrollbars");
	frmWnd.focus();
}
//End Function for External  Links

//FUNCTION TO OPEN A NEW BROWSER WINDOW
function openWin(url,winname,w,h) { 
topWin = (screen.availHeight - h) / 2;
leftWin = (screen.availWidth - w) / 2;
props = "width="+w+",height="+h+",top="+topWin+",screenY="+topWin+",left="+leftWin+",screenX="+leftWin+",resizable=yes,scrollbars=no"; 
var myWin = window.open(url,winname,props);
myWin.focus();
}
//END FUNCTION TO OPEN A NEW BROWSER WINDOW

//WINDOW OPENER FUNCTIONS
function openTrans(url,winname) {
topWin = (screen.availHeight - 400) / 2;
leftWin = (screen.availWidth - 440) / 2;
props="scrollbars=yes,status=yes,width=440,height=400,top="+topWin+",screenY="+topWin+",left="+leftWin+",screenX="+leftWin+",resizable=yes";
var myTrans = window.open(url,winname,props);
myTrans.focus();
}

var pluginWin = "";
function openPlugins(url) {
if(typeof(pluginWin) == "object" && pluginWin.closed != true){pluginWin.focus();} 
else{
var topWin = (screen.availHeight - 400) / 2;
var leftWin = (screen.availWidth - 440) / 2;
var props = "status=yes,width=440,height=400,top="+topWin+",screenY="+topWin+",left="+leftWin+",screenX="+leftWin+",resizable=yes,scrollbars=yes";
pluginWin = window.open(url,"plugIns",props);
pluginWin.focus(); }
}
//END  WINDOW OPENER FUNCTIONS
 
//OPENS WINDOW FOR DKV INFORMATION
function openDKVWIN(url) {
topWin = (screen.availHeight - 580) / 2;
leftWin = (screen.availWidth - 780) / 2;
props = "location=yes,menubar=yes,status=yes,toolbar=yes,resizable=yes,scrollbars=yes,width="+780+",height="+480+",top="+topWin+",screenY="+topWin+",left="+leftWin+",screenX="+leftWin;
var win = window.open(url,'theName',props);
win.focus();
}

//iMAGE CACHE
	if (document.images) {
	
	//help_on = new Image();
	//help_on.src = baseDir + "images/main/b_help_over.gif";
	
	//help_off = new Image();
	//help_off.src = baseDir + "images/main/b_help.gif";	
	
	//glossary_on = new Image();
	//glossary_on.src = baseDir + "images/main/nav_glossary_over.gif";
	
	//glossary_off = new Image();
	//glossary_off.src = baseDir + "images/main/nav_glossary.gif";	
	
	//tscripts_on = new Image();
	//tscripts_on.src = baseDir + "images/main/nav_tscripts_over.gif";
	
	//tscripts_off = new Image();
	//tscripts_off.src = baseDir + "images/main/nav_tscripts.gif";	
	
	//about_off = new Image();
	//about_off.src = baseDir + "images/main/nav_about.gif";
				
	//reading_on = new Image();
	//reading_on.src = baseDir + "images/main/nav_reading_over.gif";
	
	//reading_off = new Image();
	//reading_off.src = baseDir + "images/main/nav_reading.gif";	
	
	//media_on = new Image();
	//media_on.src = baseDir + "images/main/nav_media_over.gif";
	
	//media_off = new Image();
	//media_off.src = baseDir + "images/main/nav_media.gif";
	
	//credits_on = new Image();
	//credits_on.src = baseDir + "images/main/nav_credits_over.gif";
	
	//credits_off = new Image();
	//credits_off.src = baseDir + "images/main/nav_credits.gif";
		
	//print_on = new Image();
	//print_on.src = baseDir + "images/main/b_print_over.gif";
	
	//print_off = new Image();
	//print_off.src = baseDir + "images/main/b_print.gif";
	
	//prints_on = new Image();
	//prints_on.src = baseDir + "images/main/b_print_over.gif";
	
	//prints_off = new Image();
	//prints_off.src = baseDir + "images/main/b_print.gif";
	
	}
	
	//end image cache
	

	