//var PrevPage = '';
//var CurrentPage = '';
//var NextPage = '';

//the following is for the progress bar

var ProgressTxt;
var ProgressImg;
var progPercent;
var progImage;
var currPage = ProgressPage - 0;
var totalPages = ProgressCount - 0;
	
progPercent = currPage / totalPages; //alert(progPercent)
progPercent = progPercent * 100;
progPercent = Math.round(progPercent);
progPercent = progPercent + "";
progPercent = progPercent.substring(0,progPercent.length-1) + "0";

if (currPage >= 1 & currPage < totalPages)
	{	progImage = "images/percent" + progPercent + ".gif";	} 

if (currPage == totalPages)
	{	progImage = "images/percent100.gif";	}

if (progPercent == "0")
	{	progImage = "images/percent01.gif";
		progPercent = "1";
	}

ProgressTxt = progPercent + '% Completed';
ProgressImg = '<img src="' + progImage + '" height="16" width="176" ALT="' + ProgressTxt + '" align="right">'

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

if (document.images) {
	imgs01 = newImage("images/content_05.gif");
	imgs02 = newImage("images/content_06.gif");
	imgs03 = newImage("images/content_07.gif");
	imgs04 = newImage("images/content_08.gif");
	imgs05 = newImage("images/content_09.gif");
}

//end code for the progress bar




function ShowGlossary()
{
//alert('The Glossary is not available yet');
newWindow=window.open("glossary.htm","Glossary","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,resizable=no,width=779,height=500,left=0,top=0");
if (newWindow.opener == null) {newWindow.opener = window};
}


function ShowHTC()
{
newWindow=window.open("HTC.htm","Howto","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,resizable=yes,width=624,height=500,left=0,top=0");
if (newWindow.opener == null) {newWindow.opener = window};
}

function ShowHelp()
{
//alert('Help is not available yet');
newWindow=window.open("help.htm","Help","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,resizable=no,width=779,height=500,left=0,top=0");
if (newWindow.opener == null) {newWindow.opener = window};
}

function ShowResources()
{
newWindow=window.open("resources.htm","Resources","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,resizable=yes,width=730,height=500,left=50,top=20");
if (newWindow.opener == null) {newWindow.opener = window};
}

function ShowAccessibility()
{
newWindow=window.open("http://training.USDA.gov/508.html","Accessibility","toolbar=yes,location=yes,directories=no,status=no,scrollbars=yes,menubar=yes,resizable=yes,width=730,height=500,left=50,top=20");
if (newWindow.opener == null) {newWindow.opener = window};
}

function ShowCourseMap()
{
	ok = confirm('Exiting now closes this window and returns you to the Course Map.\n\nIf you exit now, you will not get credit for the lesson.  To get credit, you must complete \nthe entire lesson.  You can either complete the lesson now or return at a later time. \n\nAre you sure you want to leave?')
	if(ok == true){javascript:top.close();}

}

function ShowCourseMapComplete()
{
	ok = confirm('Exiting now closes this window and returns you to the Course Map.\n\nSince you have completed the lesson, it is OK to exit. \n\nClick on the OK button now to get credit for completing the lesson.')
	if(ok == true){javascript:top.close();}

}

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;}
}

function OpenFlash(file)
{
vwidth = 370;
vheight = 355;
sWidth = screen.width;
tWidth = (sWidth/2);
hWidth = (vwidth/2);
uWidth = (tWidth-hWidth);

newWindow=window.open(file,"Presentation","toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no,resizable=no,width=" + vwidth + ",height=" + vheight + ",left=" + uWidth + ",top=20");
if (newWindow.opener == null) {newWindow.opener = window};
}

function OpenFlashBig(file)
{
vwidth = 511;
vheight = 390;
sWidth = screen.width;
tWidth = (sWidth/2);
hWidth = (vwidth/2);
uWidth = (tWidth-hWidth);

newWindow=window.open(file,"Presentation","toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no,resizable=no,width=" + vwidth + ",height=" + vheight + ",left=" + uWidth + ",top=20");
if (newWindow.opener == null) {newWindow.opener = window};
}


function OpenScript(file)
{
vwidth = 617;
vheight = 500;
sWidth = screen.width;
tWidth = (sWidth/2);
hWidth = (vwidth/2);
uWidth = (tWidth-hWidth);

newWindow=window.open(file,"Transcript","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,resizable=no,width=" + vwidth + ",height=" + vheight + ",left=" + uWidth + ",top=20");
if (newWindow.opener == null) {newWindow.opener = window};
}


//this is for sound only flash files
function LoadSoundFile(vSound,vID) 
{
		document.write(
		'<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ' + '\n' +
			'codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0\" ' + '\n' +
			'width=\"65\" ' + '\n' +
			'height=\"9\"' + '\n' +
			'border=\"0\"' + '\n' +
			'ID=\"' + vID + '\" ' + '\n' +
			'NAME=\"audioMovie\">' + '\n' +
		    '<PARAM NAME=\"FrameNum\" VALUE=\"1\">' + '\n' +
		    '<PARAM NAME=\"quality\" VALUE=\"high\">' + '\n' +
			'<PARAM NAME=\"playing\" VALUE=\"false\">' + '\n' +
		    '<PARAM NAME=\"LOOP\" VALUE=\"false\">' + '\n' +
		    '<PARAM NAME=\"movie\" VALUE=\"' + vSound + '\">' + '\n' +
		    '<embed src=\"' + vSound + '\" ' + '\n' +
			'quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" ' + '\n' +
			'type=\"application/x-shockwave-flash\" ' + '\n' +
			'width=\"65\" ' + '\n' +
			'height=\"9\" ' + '\n' +
			'PLAY=\"false\" ' + '\n' +
			'name=\"' + vID + '\" ' + '\n' +
			'loop=\"false\" ' + '\n' +
			'swliveconnect=\"true\">' + '\n' +
		    '</embed> ' + '\n' +
		  '</object>' + '\n'
				); 
}



function SendMe(url)
{
vwidth = 750;
vheight = 460;
sWidth = screen.width;
tWidth = (sWidth/2);
hWidth = (vwidth/2);
uWidth = (tWidth-hWidth);

newSite=window.open("","ExternalSite","toolbar=yes,location=yes,directories=no,status=no,scrollbars=yes,menubar=yes,resizable=yes,width=" + vwidth + ",height=" + vheight + ",left=" + uWidth + ",top=0");
if (newSite != null)
	{
		if (newSite.opener == null) {FBwin.opener = window};
		newSite.document.write('<html><head><title>Resource &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</title>');
		newSite.document.write('</head><link rel="stylesheet" href="Feedback.css">');
		newSite.document.write('<body bgcolor="white" onload="self.focus()" leftMargin=0 topMargin=0 MARGINWIDTH="0" MARGINHEIGHT="0">');
		newSite.document.write('<TABLE WIDTH="100%" BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><IMG SRC="images/SendMe_01.gif" WIDTH="536" HEIGHT="111" ALT="Resources" border="0"></TD><TD><a href="javascript:self.close()" onMouseOver="document.content1.src=\'images/SendMeHi_02.gif\';" onMouseOut="document.content1.src=\'images/SendMe_02.gif\';"><IMG SRC="images/SendMe_02.gif" WIDTH="120" HEIGHT="111" ALT="Close" name="content1" border="0"></a></TD><TD background="images/SendMe_03.gif" WIDTH="100%" HEIGHT=111>&nbsp;</TD></TR></TABLE>');
		newSite.document.write('<p style="padding-left: 10px;"><b>You are now exiting the USDA Web Site.</b>  <p style="padding-left: 10px;">You will now be entering the site: ' + url + '  <p style="padding-left: 10px;">We have provided a link to this site because it has information that may be of interest to our viewers. <ul>	<li>USDA does not necessarily endorse the views expressed or the facts presented on this site.  </li>	<li>USDA does not endorse any commercial products that may be advertised or on this site. </li>	<li>The USDA Privacy Notice Policy does not apply on this site. Please check the site for its Privacy Notice.  </li></ul><p style="padding-left: 10px;">When you\'re done, close the window by clicking on the little X in the upper right-hand corner of the window.');
		newSite.document.write('<p style="padding-left: 10px;"><a href="');
		newSite.document.write(url);
		newSite.document.write('">Click on this link to view the requested Internet resource.</a><br>');
		newSite.document.write('</body></html>');
		newSite.document.close();
	}	
}






function SendMeLocal(file)
{
vwidth = 750;
vheight = 460;
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");
localSite.focus();
}


function PopUpSize(howWide,howHigh,what)
{
	
vwidth = howWide;
vheight = howHigh;
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><link rel="stylesheet" href="Feedback.css">');
		Hintwin.document.write('<body bgcolor="white" onload="self.focus()">');
		Hintwin.document.write(what);
		Hintwin.document.write('<p><CENTER><A HREF="javascript:parent.self.close()"><IMG SRC="images/close.gif" WIDTH=60 HEIGHT=29 BORDER=0 ALT="Click here to close this window"></A></CENTER><br>');
		Hintwin.document.write('</body></html>');
		Hintwin.document.close();
	}	
}

function showDefShort(vDef)
{
	
vwidth = 350;
vheight = 300;
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><link rel="stylesheet" href="Feedback.css">');
		Hintwin.document.write('<body bgcolor="white" onload="self.focus()">');
		Hintwin.document.write(vDef);
		Hintwin.document.write('<p><CENTER><A HREF="javascript:parent.self.close()"><IMG SRC="images/close.gif" WIDTH=60 HEIGHT=29 BORDER=0 ALT="Click here to close this window"></A></CENTER><br>');
		Hintwin.document.write('</body></html>');
		Hintwin.document.close();
	}	
}




function showDefLong(vDef)
{
	
vwidth = 617;
vheight = 450;
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><link rel="stylesheet" href="Feedback.css">');
		Hintwin.document.write('<body bgcolor="white" onload="self.focus()" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>');
		Hintwin.document.write('<TABLE WIDTH=600 BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD COLSPAN=3><IMG SRC="images/DetailsHeader_01.gif" WIDTH=600 HEIGHT=59 ALT="Details"></TD>	</TR><TR><TD><IMG SRC="images/DetailsHeader_02.gif" WIDTH=403 HEIGHT=38 ALT=""></TD><TD><a href="javascript:self.print()" onMouseOver="document.r1.src=\'images/DetailsHeaderHi_03.gif\';" onMouseOut="document.r1.src=\'images/DetailsHeader_03.gif\';"><IMG SRC="images/DetailsHeader_03.gif" WIDTH="89" HEIGHT="38" ALT="Print" border="0" name="r1"></a></TD><TD><a href="javascript:self.close()" onMouseOver="document.r2.src=\'images/DetailsHeaderHi_04.gif\';" onMouseOut="document.r2.src=\'images/DetailsHeader_04.gif\';"><IMG SRC="images/DetailsHeader_04.gif" WIDTH="108" HEIGHT="38" ALT="Close" name="r2" border="0"></a></TD></TR></TABLE>');
		Hintwin.document.write('<table width="100%" border="0" cellspacing="0" cellpadding="12"><tr bgcolor="#FFFFFF">	<td><p>');
		Hintwin.document.write(vDef);
		Hintwin.document.write('</td></tr></table>');
		Hintwin.document.write('<p><CENTER><A HREF="javascript:parent.self.close()"><IMG SRC="images/spacer.gif" WIDTH=1 HEIGHT=1 BORDER=0 ALT="Click here to close this window"></A></CENTER><br>');
		Hintwin.document.write('</body></html>');
		Hintwin.document.close();
	}	
}



function showTrans(vNar)
{
vwidth = 500;
vheight = 420;
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 Transcript &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">');
		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="60" HEIGHT="29" BORDER="0" ALT="Click here to close this window"></A></CENTER><br>');
		Hintwin.document.write('</font></body></html>');
		Hintwin.document.close();
	}	
}

function doLong(extFile)
{
alert('The link you clicked will open a new browser window.  When you are done viewing the information in that new window, close the window to return to the lesson page.');
	
vwidth = 430;
vheight = 300;
sWidth = screen.width;
tWidth = (sWidth/2);
hWidth = (vwidth/2);
uWidth = (tWidth-hWidth);

	descWin=window.open(extFile,"detail","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,resizable=yes,width=" + vwidth + ",height=" + vheight + ",left=" + uWidth + ",top=50");
}

function doSupp(extFile)
{
alert('The link you clicked will open a new browser window.  When you are done viewing the information in that new window, close the window to return to the lesson page.');
	
vwidth = 600;
vheight = 400;
sWidth = screen.width;
tWidth = (sWidth/2);
hWidth = (vwidth/2);
uWidth = (tWidth-hWidth);

	suppWin=window.open(extFile,"supp","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=yes,resizable=yes,width=" + vwidth + ",height=" + vheight + ",left=" + uWidth + ",top=50");
}

function doFull(extFile)
{
alert('The link you clicked will open a new browser window.  When you are done viewing the information in that new window, close the window to return to the lesson page.');

	fullWin=window.open(extFile,"full","toolbar=yes,location=yes,directories=no,status=yes,scrollbars=yes,menubar=yes,resizable=yes,left=50,top=50");
}

