//rollovers

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}


if (document.images) {
	imgs01 = newImage("images/interface-hi_04.gif");
	imgs02 = newImage("images/interface-hi_05.gif");
	imgs03 = newImage("images/interface-hi_06.gif");
	imgs04 = newImage("images/interface-hi_07.gif");
	imgs05 = newImage("images/back-hi.gif");
	imgs06 = newImage("images/next-hi.gif");
}


function BuildInstuctions(text)
{
		InstText = ''
		InstText = InstText + '<HTML><HEAD></HEAD><link rel="stylesheet" href="../lesson.css"><BODY BGCOLOR=#F0F0F0>';
		InstText = InstText + '<TABLE WIDTH=790 BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD COLSPAN=2><IMG SRC="../images/lesson-12.gif" WIDTH=790 HEIGHT=2></TD></TR>';
		InstText = InstText + '<TR><TD NOWRAP> <IMG SRC="../images/lesson-13.gif" WIDTH=17 HEIGHT=16> <IMG SRC="../images/lesson-13.gif" WIDTH=17 HEIGHT=16> <IMG SRC="../images/lesson-13.gif" WIDTH=17 HEIGHT=16> <IMG SRC="../images/lesson-13.gif" WIDTH=17 HEIGHT=16> </TD><TD WIDTH=100% HEIGHT=16> <font class="instruction" title="Instructions"> &nbsp;';
		InstText = InstText + text
		InstText = InstText + '</font> ('; 
		InstText = InstText + CurrentPage
		InstText = InstText + ')</TD></TR><TR><TD COLSPAN=2><IMG SRC="../images/lesson-15.gif" WIDTH=790 HEIGHT=14></TD></TR></TABLE></BODY></HTML>';
		
		if(BottomFrameIsThere ==1)
		{	
			LessonInstruction.document.write(InstText);
			LessonInstruction.document.close();
		}
}


function ShowGlossary()
{
newWindow=window.open("glossary.htm","Glossary","toolbar=no,location=no,directories=no,status=no,scrollbars=No,menubar=no,resizable=no,width=640,height=400,left=50,top=100");
if (newWindow.opener == null) {newWindow.opener = window};
}


function BuildHeader(topic)
{
		HdrText = ''
		HdrText = HdrText + '<TABLE  width="500" BORDER=0 CELLPADDING=0 CELLSPACING=0>	<TR>		<TD ROWSPAN=3><a href="#content"><IMG SRC="images/Sub-01.gif" WIDTH=113 HEIGHT=83 border="0" alt="skip nav"></a></TD>		<TD COLSPAN=5><IMG SRC="images/Sub-02.gif" WIDTH=599 HEIGHT=32></TD>		<TD ROWSPAN=3><IMG SRC="images/Sub-03a.gif" WIDTH=8 HEIGHT=83></TD>		<td width="45" rowspan="3" ><IMG SRC="images/Sub-03.gif" WIDTH=50 HEIGHT=83></td></TR><TR>		<TD><IMG SRC="images/Sub-04.gif" WIDTH=77 HEIGHT=23></TD>				<TD COLSPAN=4>';
		HdrText = HdrText + '<IMG SRC="images/Sub-05-';
		HdrText = HdrText + topic
		HdrText = HdrText + '.gif" WIDTH=522 HEIGHT=23></TD>	</TR><TR>';
		HdrText = HdrText + '<TD><a href="index.htm" onMouseOver="document.item1.src=\'images/SubHi-06.gif\';" onMouseOut="document.item1.src=\'images/Sub-06.gif\';"><IMG SRC="images/Sub-06.gif" WIDTH=77 HEIGHT=28 border="0" name="item1" alt="Menu"></TD>';
		HdrText = HdrText + '<TD><a href="help.htm" onMouseOver="document.item2.src=\'images/SubHi-07.gif\';" onMouseOut="document.item2.src=\'images/Sub-07.gif\';"><IMG SRC="images/Sub-07.gif" WIDTH=75 HEIGHT=28 border="0" name="item2" alt="Help"></TD>';
		HdrText = HdrText + '<TD><a href="javascript:ShowGlossary()" onMouseOver="document.item3.src=\'images/SubHi-08.gif\';" onMouseOut="document.item3.src=\'images/Sub-08.gif\';"><IMG SRC="images/Sub-08.gif" WIDTH=74 HEIGHT=28 border="0" name="item3" alt="Glossary"></TD>';
		HdrText = HdrText + '<TD><a href="resources.htm" onMouseOver="document.item4.src=\'images/SubHi-09.gif\';" onMouseOut="document.item4.src=\'images/Sub-09.gif\';"><IMG SRC="images/Sub-09.gif" WIDTH=78 HEIGHT=28 border="0" name="item4" alt="Resources"></TD>';
		HdrText = HdrText + '<TD><IMG SRC="images/Sub-10.gif" WIDTH=295 HEIGHT=28></TD>	</TR></TABLE><a name="content"></a>';
		return HdrText

}


function BuildPictureFrame(picture,align)
{
		PicData = ''
		PicData = PicData + '<TABLE align="';
		PicData = PicData + align;
		PicData = PicData + '"  BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><IMG SRC="../images/PicFrame_01.gif" WIDTH=11 HEIGHT=9></TD><td background="../images/PicFrame_02.gif"><IMG SRC="../images/PicFrame_02.gif" WIDTH="22" HEIGHT="9" border="0" alt=""></td><TD><IMG SRC="../images/PicFrame_03.gif" WIDTH=48 HEIGHT=9></TD></TR><TR><TD background="../images/PicFrame_04.gif"><IMG SRC="../images/PicFrame_04.gif" WIDTH="11" HEIGHT="16" border="0" alt=""></TD><TD bgcolor="ffffff">';
		PicData = PicData + picture;
		PicData = PicData + '</TD><TD background="../images/PicFrame_06.gif"><IMG SRC="../images/PicFrame_06.gif" WIDTH="48" HEIGHT="16" border="0" alt=""></TD></TR><TR><TD><IMG SRC="../images/PicFrame_07.gif" WIDTH=11 HEIGHT=13></TD><TD background="../images/PicFrame_08.gif"><IMG SRC="../images/PicFrame_08.gif" WIDTH="22" HEIGHT="13" border="0" alt=""></TD><TD><IMG SRC="../images/PicFrame_09.gif" WIDTH=48 HEIGHT=13></TD></TR></TABLE>';
		return PicData;
		//document.close();
}


function getPageStatus()
{
PrevPage = getCookie("PPg")
CurrentPage = getCookie("CPg")
NextPage = getCookie("NPg")
}


function setPageStatus(Prev,Current,Next)
{
setCookie("PPg", Prev);
setCookie("CPg", Current);
setCookie("NPg", Next);
}


//var PrevPage = '';
//var CurrentPage = '';
//var NextPage = '';


function GoNext()
{
if(NextPage == 'done' || NextPage == '')
	{
		//location.href="../index.htm";
	}
else
	{location.href=NextPage;}
}


function GoPrev()
{
if(PrevPage == 'done' || PrevPage == '')
	{
		//location.href="../index.htm";
	}
else
	{location.href=PrevPage;}
}



var TopicImg = ""
function ChangeTopic()
{
	//alert("run me");
	if(TopFrameIsThere ==1)	{LessonNav.document.Topic.src = TopicImg}
}


function WriteHeader(headertext)
{
		HeaderData = ''
		HeaderData = HeaderData + '<TABLE  BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD ROWSPAN=3><IMG SRC="../images/header_01.gif" WIDTH=85 HEIGHT=24></TD>	<td height="2" background="../images/header_02.gif"><IMG SRC="../images/header_02.gif" WIDTH="2" HEIGHT="2" border="0" alt=""></td><TD ROWSPAN=3><IMG SRC="../images/header_03.gif" WIDTH=12 HEIGHT=24></TD>	</TR><TR><TD  HEIGHT=20 class=header title="Heading""> &nbsp;';
		HeaderData = HeaderData + headertext;
		HeaderData = HeaderData + '</TD></TR><TR><td height="2" background="../images/header_05.gif"><IMG SRC="../images/header_05.gif" WIDTH="2" HEIGHT="2" border="0" alt=""></td></TR></TABLE>';
		return HeaderData;
}



var BeenThere1 = 0;
function SendMe(url)
{
if(BeenThere1 != 1)
	{alert('You are accessing another website, so \nwe\'ll open a new browser window to view it in.  \n\nWhen you\'re done close the window by \nclicking on the little X in the upper-right \nhand corner of the window.');BeenThere1 = 1}

newSite=window.open(url,"ExternalSite","toolbar=yes,location=yes,directories=no,status=yes,scrollbars=yes,menubar=yes,resizable=yes,width=700,height=460,left=50,top=0");
if (newSite.opener == null) {newSite.opener = window};
}


var BeenThere2 = 0;
function SendMeLocal(file)
{
if(BeenThere2 != 1)
	{alert('We\'re opening a new browser window to view this resource in.  \n\nWhen you\'re done close the window by either clicking on the \nlittle X in the upper-right hand corner of the window, or the Close button.');BeenThere2 = 1}
	

vwidth = 750;
vheight = 480;
sWidth = screen.width;
tWidth = (sWidth/2);
hWidth = (vwidth/2);
uWidth = (tWidth-hWidth);


localSite=window.open(file,"LocalPage","toolbar=yes,location=no,directories=no,status=no,scrollbars=yes,menubar=yes,resizable=yes,width=" + vwidth + ",height=" + vheight + ",left=" + uWidth + ",top=0");
if (localSite.opener == null) {localSite.opener = window};
	
}



function showDefLong(vDef)
{
	
vwidth = 500;
vheight = 400;
sWidth = screen.width;
tWidth = (sWidth/2);
hWidth = (vwidth/2);
uWidth = (tWidth-hWidth);

	Hintwin=window.open("","detail","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,resizable=yes,width=" + vwidth + ",height=" + vheight + ",left=" + uWidth + ",top=50");
	if (Hintwin != null)
	{
		if (Hintwin.opener == null) {FBwin.opener = window};
		Hintwin.document.write("<html><head><title>Detailed Information &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</title>");
		Hintwin.document.write("</head>");
		Hintwin.document.write("<body bgcolor='white' onload='self.focus()' onblur='self.focus()'>");
		Hintwin.document.write("<font face='arial' size='-1'>");		
		Hintwin.document.write(vDef);
		Hintwin.document.write("<p><CENTER><A HREF='javascript:parent.self.close()'><IMG SRC='images/close.gif' WIDTH=103 HEIGHT=23 BORDER=0 ALT='Click here to close this window'></A></CENTER><br>");
		Hintwin.document.write("</font></body></html>");
		Hintwin.document.close();
	}	
}


function showBenefits(vDef)
{
	
vwidth = 500;
vheight = 400;
sWidth = screen.width;
tWidth = (sWidth/2);
hWidth = (vwidth/2);
uWidth = (tWidth-hWidth);

	Hintwin=window.open("","detail","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,resizable=yes,width=" + vwidth + ",height=" + vheight + ",left=" + uWidth + ",top=50");
	if (Hintwin != null)
	{
		if (Hintwin.opener == null) {FBwin.opener = window};
		Hintwin.document.write("<html><head><title>Specific Benefits &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</title>");
		Hintwin.document.write("</head>");
		Hintwin.document.write("<body bgcolor='white' onload='self.focus()' onblur='self.focus()'>");
		Hintwin.document.write("<font face='arial' size='-1'>");		
		Hintwin.document.write(vDef);
		Hintwin.document.write("<p><CENTER><A HREF='javascript:parent.self.close()'><IMG SRC='images/close.gif' WIDTH=103 HEIGHT=23 BORDER=0 ALT='Click here to close this window'></A></CENTER><br>");
		Hintwin.document.write("</font></body></html>");
		Hintwin.document.close();
	}	
}


function showNarration(vNar)
{
	
vwidth = 500;
vheight = 400;
sWidth = screen.width;
tWidth = (sWidth/2);
hWidth = (vwidth/2);
uWidth = (tWidth-hWidth);

	Hintwin=window.open("","detail","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,resizable=yes,width=" + vwidth + ",height=" + vheight + ",left=" + uWidth + ",top=50");
	if (Hintwin != null)
	{
		if (Hintwin.opener == null) {FBwin.opener = window};
		Hintwin.document.write("<html><head><title>Text Version of Narration &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</title>");
		Hintwin.document.write("</head>");
		Hintwin.document.write("<body bgcolor='white' onload='self.focus()' onblur='self.focus()'>");
		Hintwin.document.write("<font face='arial' size='-1'>");		
		Hintwin.document.write(vNar);
		Hintwin.document.write("<p><CENTER><A HREF='javascript:parent.self.close()'><IMG SRC='images/close.gif' WIDTH=103 HEIGHT=23 BORDER=0 ALT='Click here to close this window'></A></CENTER><br>");
		Hintwin.document.write("</font></body></html>");
		Hintwin.document.close();
	}	
}


//COOKIES
function setCookie(name, value, expires)
{
document.cookie = name + "=" + escape(value) + "; path=/" + ((expires == null) ? "" : "; expires=" + expires.toGMTString());
}

function getCookie(name)
{
var cname = name + "="; var dc = document.cookie; if (dc.length > 0) 	{begin = dc.indexOf(cname); if(begin != -1) {begin += cname.length; end = dc.indexOf(";", begin); if (end == -1) end = dc.length; return unescape(dc.substring(begin, end));}}
}

var exp = new Date();
exp.setTime(exp.getTime() + (1000 * 60 * 60 * 24 * 2));
//END COOKIES

