
// Global variables
var global_content;
var specialtext;
var current_user;
var thedate;

var is_ie = false;
var is_nav = false;

// Browser detection
if (navigator.appName == "Microsoft Internet Explorer")
{
	is_ie = true;
}
else if (navigator.appName == "Netscape")
{
	is_nav = true;
}

// Date variables
var date = new Date();
var day  = date.getDate();
var month = date.getMonth() + 1;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;

thedate = month + "/" + day + "/" + year;

// Question
function question_popup(response, content)
{	
	var my_width  		= 400;
	var my_height 		= 202;
	var my_scrollbars  	= 1;
	var bgcolor = "";
	var textcolor = "";
	
	if (response == "right")
	{
	titlecolor = "green";
	textcolor = "black";
	}
	else if (response == "wrong")
	{
	titlecolor = "red";
	textcolor = "black";
	}
	else
	{
	titlecolor = "black";
	textcolor = "black";
	}
	
	answerpopup = window.open("","questionpopper","resizable=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + my_scrollbars + ",copyhistory=0,width=" + my_width + ",height=" + my_height + ",left=50,top=50");
	
	answerpopup.document.open();
	answerpopup.document.writeln("<html><head><title>Answer</title>");
	answerpopup.document.writeln("<style>body  {background-color: #ffffcc;}");
	answerpopup.document.writeln("	.title {font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 14pt; font-weight: bold;   color: " + titlecolor + ";}");
	answerpopup.document.writeln("	.text  {font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: normal; color: " + textcolor + ";}");
	answerpopup.document.writeln("	.button { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12pt; color: " + textcolor + "; text-decoration : underline;}");
	answerpopup.document.writeln("</style></head><body>");
	
	if (response == "right")
	{
	answerpopup.document.writeln("<div class='title'><p>Correct!</p></div>");
	answerpopup.document.writeln("<div class='text' style='height: 90px'><table border='0' cellpadding='0' cellspacing='0'><tr><td class='text' height='90' valign='top'><p>" + content + "</p></td></tr></table></div>");
	}
	else
	{
	answerpopup.document.writeln("<div class='title'><p>Incorrect</p></div>");
	answerpopup.document.writeln("<div class='text' style='height: 90px'><table border='0' cellpadding='0' cellspacing='0'><tr><td class='text' height='90' valign='top'><p>" + content + "</p></td></tr></table></div>");
	}
	answerpopup.document.writeln("<div><p align='center'><b><a href='#' class='button' onClick='window.close()'>Close Window</a></b></p></div></body></html>");
	
	answerpopup.document.close();
	answerpopup.focus();
}

// Normal, Regular, Everyday Popup
function popup(title, content)
{		
	var my_width  		= 400;
	var my_height 		= 202;
	var my_scrollbars  	= 1;
	
	thepopup = window.open("","littlepopper","resizable=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + my_scrollbars + ",copyhistory=0,width=" + my_width + ",height=" + my_height + ",left=50,top=50");
	
	thepopup.document.open();
	thepopup.document.writeln("<html><head><title>" + title + "</title>");
	thepopup.document.writeln("<style>body  {background-color: white;}");
	thepopup.document.writeln("	.title {font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 14pt; font-weight: bold;   color: #000000;}");
	thepopup.document.writeln("	.text  {font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: normal; color: #000000;}");
	thepopup.document.writeln("	.button { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12pt; color: red; text-decoration : underline;}");
	thepopup.document.writeln("</style></head><body>");
	thepopup.document.writeln("<div class='title'><p>" + title + "</p></div>");
	thepopup.document.writeln("<div class='text' style='height: 90px'><table border='0' cellpadding='0' cellspacing='0'><tr><td class='text' height='90' valign='top'><p>" + content + "</p></td></tr></table></div>");
	thepopup.document.writeln("<div><p align='center'><b><a href='#' class='button' onClick='window.close()'>Close Window</a></b></p></div></body></html>");
	
	thepopup.document.close();
	thepopup.focus();
}

// Sized popup
function sized_popup(width, height, title, content)
{	
	var my_width  		= width;
	var my_height 		= height;
	var my_scrollbars  	= 1;
	
	thepopup = window.open("","littlepopper","resizable=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + my_scrollbars + ",copyhistory=0,width=" + my_width + ",height=" + my_height + ",left=50,top=50");
	
	thepopup.document.open();
	thepopup.document.writeln("<html><head><title>" + title + "</title>");
	thepopup.document.writeln("<style>body  {background-color: white;}");
	thepopup.document.writeln("	.title {font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 14pt; font-weight: bold;   color: #000000;}");
	thepopup.document.writeln("	.text  {font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 10pt; font-weight: normal; color: #000000;}");
	thepopup.document.writeln("	.button { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12pt; color: red; text-decoration : underline;}");
	thepopup.document.writeln("</style></head><body>");
	thepopup.document.writeln("<div class='title'><p>" + title + "</p></div>");
	thepopup.document.writeln("<div class='text' style='height: 90px'><table border='0' cellpadding='0' cellspacing='0'><tr><td class='text' height='90' valign='top'><p>" + content + "</p></td></tr></table></div>");
	thepopup.document.writeln("<div><p align='center'><b><a href='#' class='button' onClick='window.close()'>Close Window</a></b></p></div></body></html>");
	
	thepopup.document.close();
	thepopup.focus();
}

// Messsage Popup (Phone)
function phone_popup(from, content)
{	
	var my_width  		= 448;
	var my_height 		= 305;
	var my_scrollbars  	= 1;

	messagepopup = window.open("","messagepopper","resizable=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + my_scrollbars + ",copyhistory=0,width=" + my_width + ",height=" + my_height + ",left=50,top=50");

	messagepopup.document.writeln("<html><head><title>Phone Message</title>");
	messagepopup.document.writeln("<style type='text/css'>");
	messagepopup.document.writeln("	.title {font-family: 'Times New Roman', Times, serif; font-size: 14pt; color: black;}");
	messagepopup.document.writeln("	.text {font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12pt; color: black;}");
	messagepopup.document.writeln("	.button { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12pt; color: red; text-decoration : underline;}");
	messagepopup.document.writeln("</style></head><body leftmargin='5' topmargin='5' marginwidth='5' marginheight='5' bgcolor='white' text='black' link='blue' vlink='blue' alink='blue'>");
	messagepopup.document.writeln("<table align='left' border='0' cellspacing='0' cellpadding='1'><tr><td align='center' bgcolor='black'>");
	messagepopup.document.writeln("<table align='left' width='420' height='250' cellspacing='1' cellpadding='4' border='0'>");
	messagepopup.document.writeln("<tr>");
	messagepopup.document.writeln("    <td class='title' colspan='2' bgcolor='#FFFFCC' height='25' align='center' valign='top'><b>PHONE CALL</b></td>");
	messagepopup.document.writeln("</tr>");
	messagepopup.document.writeln("<tr>");
	messagepopup.document.writeln("    <td class='text' bgcolor='#FFFFCC' height='25' valign='top'><b>To:</b> " + current_user + "</td>");
	messagepopup.document.writeln("	<td class='text' bgcolor='#FFFFCC' width='140' height='25' valign='top'><b>Message:</b> 1 of 1</td>");
	messagepopup.document.writeln("</tr>");
	messagepopup.document.writeln("<tr>");
	messagepopup.document.writeln("    <td class='text' bgcolor='#FFFFCC' height='25' valign='top'><b>From:</b> " + from + "</td>");
	messagepopup.document.writeln("    <td class='text' bgcolor='#FFFFCC' width='140' height='25' valign='top'><b>Date:</b> " + thedate + "</td>");
	messagepopup.document.writeln("</tr>");
	messagepopup.document.writeln("<tr>");
	messagepopup.document.writeln("    <td class='text' colspan='2' bgcolor='#FFFFCC' height='175' valign='top'>" + content + "</td>");
	messagepopup.document.writeln("</tr>");
	messagepopup.document.writeln("<tr>");
	messagepopup.document.writeln("    <td class='button' colspan='2' bgcolor='#FFFFCC' height='25' align='center' valign='top'><b><a href='#' class='button' onClick='window.close()'>Close Message</a></b></td>");
	messagepopup.document.writeln("</tr>");
	messagepopup.document.writeln("</table>");
	messagepopup.document.writeln("</td></tr></table></body></html>");
	
	messagepopup.document.close();
	messagepopup.focus();
}

// E-Mail Attachment Popup
function attachment_popup(title,from,content)
{	
	var my_width  		= 720;
	var my_height 		= 375;
	var my_scrollbars  	= 1;

	attachpopup = window.open("","attachpopper","resizable=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + my_scrollbars + ",copyhistory=0,width=" + my_width + ",height=" + my_height + ",left=50,top=50");

	attachpopup.document.writeln("<html><head><title>Attachment</title>");
	attachpopup.document.writeln("<style type='text/css'>");
	attachpopup.document.writeln("	td {font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 10pt; color: black;}");
	attachpopup.document.writeln("	.title {font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12pt;	color: black;}");
	attachpopup.document.writeln("	.text {font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 10pt; color: black;}");
	attachpopup.document.writeln("	.button { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12pt; color: red; text-decoration : underline;}");
	attachpopup.document.writeln("</style>");
	attachpopup.document.writeln("</head>");
	attachpopup.document.writeln("<body leftmargin='5' topmargin='5' marginwidth='5' marginheight='5' bgcolor='white' text='black' link='blue' vlink='blue' alink='blue'>");
	attachpopup.document.writeln("<table cellspacing='0' cellpadding='1' border='0'><tr><td bgcolor='black'>");
	attachpopup.document.writeln("<table width='690' cellspacing='2' cellpadding='3' border='0'>");
	attachpopup.document.writeln("<tr>");
	attachpopup.document.writeln("	<td class='text' valign='top' bgcolor='white'>");
	attachpopup.document.writeln("	<b>Date:</b> " + thedate + "<br>");
	attachpopup.document.writeln("	<b>From:</b> " + from + "<br>");
	attachpopup.document.writeln("	<b>To:</b> " + current_user + "</td>");
	attachpopup.document.writeln("</tr>");
	attachpopup.document.writeln("<tr>");
	attachpopup.document.writeln("	<td class='text' height='275' valign='top' bgcolor='white'>");
	attachpopup.document.writeln("	<p class='title'><b>" + title + "</b></p>");
	attachpopup.document.writeln("	<p class='text'>" + content + "</p></td>");
	attachpopup.document.writeln("</tr>");
	attachpopup.document.writeln("<tr>");
	attachpopup.document.writeln("	<td class='button' valign='middle' bgcolor='white' height='25' align='center' valign='top'><b><a href='#' class='button' onClick='window.close()'>Close Attachment</a></b></td>");
	attachpopup.document.writeln("</tr>");
	attachpopup.document.writeln("</table>");
	attachpopup.document.writeln("</td></tr></table></body></html>");
	
	attachpopup.document.close();
	attachpopup.focus();
}

// E-Mail Response Popup
function email_popup(title,from,content)
{
	var my_width  		= 720;
	var my_height 		= 392;
	var my_scrollbars  	= 1;

	emailpopup = window.open("","emailpopper","resizable=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + my_scrollbars + ",copyhistory=0,width=" + my_width + ",height=" + my_height + ",left=50,top=50");

	emailpopup.document.writeln("<html><head><title>E-Mail Response</title>");
	emailpopup.document.writeln("<style type='text/css'>");
	emailpopup.document.writeln("	td {font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 10pt; color: black;}");
	emailpopup.document.writeln("	.title {font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12pt;	color: black;}");
	emailpopup.document.writeln("	.text {font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 10pt; color: black;}");
	emailpopup.document.writeln("	.button { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12pt; color: red; text-decoration : underline;}");
	emailpopup.document.writeln("</style>");
	emailpopup.document.writeln("</head>");
	emailpopup.document.writeln("<body leftmargin='5' topmargin='5' marginwidth='5' marginheight='5' bgcolor='white' text='black' link='blue' vlink='blue' alink='blue'>");
	emailpopup.document.writeln("<table cellspacing='0' cellpadding='1' border='0'><tr><td bgcolor='black'>");
	emailpopup.document.writeln("<table width='690' cellspacing='2' cellpadding='3' border='0'>");
	emailpopup.document.writeln("<tr>");
	emailpopup.document.writeln("	<td class='text' valign='top' bgcolor='white'>");
	emailpopup.document.writeln("	<b>Subject: Re: " + title + "</b><br>");
	emailpopup.document.writeln("	<b>Date:</b> " + thedate + "<br>");
	emailpopup.document.writeln("	<b>From:</b> " + from + "<br>");
	emailpopup.document.writeln("	<b>To:</b> " + current_user + "</td>");
	emailpopup.document.writeln("</tr>");
	emailpopup.document.writeln("<tr>");
	emailpopup.document.writeln("	<td class='text' height='275' valign='top' bgcolor='white'>" + content + "</td>");
	emailpopup.document.writeln("</tr>");
	emailpopup.document.writeln("<tr>");
	emailpopup.document.writeln("	<td class='button' valign='middle' bgcolor='white' height='25' align='center' valign='top'><b><a href='#' class='button' onClick='window.close()'>Close E-Mail Response</a></b></td>");
	emailpopup.document.writeln("</tr>");
	emailpopup.document.writeln("</table>");
	emailpopup.document.writeln("</td></tr></table></body></html>");
	
	emailpopup.document.close();
	emailpopup.focus();
}

function fullscreen_popup(url)
{	
	var my_width  	= screen.width - 10;
	var my_height 	= screen.height - 175;
	
	fullpopup = window.open(url,"fullscreen","resizable=1,toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,copyhistory=0,width=" + my_width + ",height=" + my_height + ",left=0,top=0");
	fullpopup.focus();
}

function smallpopup(file)
{
newWindow=window.open(file,"","toolbar=no,location=no,directories=no,status=no,scrollbars=Yes,menubar=no,resize=no,width=400,height=400,left=100,top=70");
if (newWindow.opener == null) {newWindow.opener = window};

}

function mediumpopup(file)
{
newWindow=window.open(file,"","toolbar=no,location=no,directories=no,status=no,scrollbars=Yes,menubar=no,resize=no,width=540,height=400,left=100,top=70");
if (newWindow.opener == null) {newWindow.opener = window};

}

function largepopup(file)
{
newWindow=window.open(file,"","toolbar=no,location=no,directories=no,status=no,scrollbars=Yes,menubar=no,resize=no,width=800,height=600,left=50,top=50");
if (newWindow.opener == null) {newWindow.opener = window};

}

function loadLessonWindow(file)
{
newWindow=window.open(file,"cc1","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,resize=no,width=790,height=544,left=0,top=0");
if (newWindow.opener == null) {newWindow.opener = window};
	
//parent.self.close();
//alert(newWindow.opener);
}

function loadWindow(file)
{
newWindow=window.open(file,"Glossary","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,resize=no,width=540,height=400,left=100,top=70");
if (newWindow.opener == null) {newWindow.opener = window};
	
//parent.self.close();
//alert(newWindow.opener);
}


function RemoteControl(file)
{
parent.opener.location.href = file;
	
parent.self.close();
//alert(newWindow.opener);
}

function changeIt(ImageToChange, ImageToShow) { 
if (document.images) { document[ImageToChange].src = ImageToShow; } 
} 
function bar(message) { 
if (document.images) { window.status = message; return true } 
}
if (document.images) { 
i1 = new Image; 
i1.src = "../images/mm1b.jpg"; 
i2 = new Image; 
i2.src = "../images/mm2b.jpg"; 
i3 = new Image; 
i3.src = "../images/mm3b.jpg"; 
i4 = new Image; 
i4.src = "../images/mm4b.jpg"; 
i5 = new Image; 
i5.src = "../images/mm5b.jpg"; 
}



function ShowMenu1()//course menu
{
remote1=window.open("../glossary/glossary.htm","glossary","width=600,height=500,left=100,top=50,resizable=no,scrollbars=yes,toolbar=no,menubar=no,status=no,titlebar=0");
	if (remote1.opener == null) remote1.opener = window;
}

function ShowMenu2()//help menu
{
remote1=window.open("../help/help.htm","help","width=600,height=400,left=100,top=50,resizable=no,scrollbars=yes,toolbar=no,menubar=no,status=no,titlebar=0");
	if (remote1.opener == null) remote1.opener = window;
}

function ShowMenu3()//feedback menu
{
remote1=window.open("../feedback/feedback.cfm","feedback","width=600,height=400,left=100,top=50,resizable=no,scrollbars=no,toolbar=no,menubar=no,status=no,titlebar=0");
	if (remote1.opener == null) remote1.opener = window;
}

function ShowMenu4()//reference menu
{
remote1=window.open("../chat/chat.htm","menu1","width=400,height=400,left=200,top=50,resizable=no,scrollbars=no,toolbar=no,menubar=no,status=no,titlebar=0");
	if (remote1.opener == null) remote1.opener = window;
}

function ShowMenu5()//index menu
{
remote1=window.open("../index/frame-module1.htm","menu1","width=650,height=550,left=0,top=0,resizable=no,scrollbars=yes,toolbar=no,menubar=no,status=no,titlebar=0");
	if (remote1.opener == null) remote1.opener = window;
}

function ShowMenu6()//ask instr menu
{
remote1=window.open("../askinstr/frame-module.htm","menu1","width=780,height=580,left=10,top=10,resizable=no,scrollbars=yes,toolbar=no,menubar=no,status=no,titlebar=0");
	if (remote1.opener == null) remote1.opener = window;
}

function ShowMenu7()//navigation menu
{
remote1=window.open("navigation.cfm","menu1","width=800,height=600,left=10,top=10,resizable=no,scrollbars=yes,toolbar=no,menubar=no,status=no,titlebar=0");
	if (remote1.opener == null) remote1.opener = window;
}

function ShowMenu8()//news menu
{
remote1=window.open("../news/news3.htm","menu1","width=500,height=500,left=150,top=75,resizable=no,scrollbars=yes,toolbar=no,menubar=no,status=no,titlebar=0");
	if (remote1.opener == null) remote1.opener = window;
}

function ShowMenu9()//news menu
{
remote1=window.open("../news/news4.htm","menu1","width=500,height=500,left=150,top=75,resizable=no,scrollbars=yes,toolbar=no,menubar=no,status=no,titlebar=0");
	if (remote1.opener == null) remote1.opener = window;
}

function ShowMenu10()//news menu
{
remote1=window.open("../news/news5.htm","menu1","width=500,height=500,left=150,top=75,resizable=no,scrollbars=yes,toolbar=no,menubar=no,status=no,titlebar=0");
	if (remote1.opener == null) remote1.opener = window;
}





