<!--
/******************************************************************************************************************
This Javascript Code is Protected by copyright laws, two patents and international treaties.  Unauthorized use, 
reproduction and/or distribution of this Javascript Code, or any portion of it, will result in severe civil 
and criminal penalties. Violators will be prosecuted to the maximum extent possible under the law.
******************************************************************************************************************/

var mainFrameHeader = 1;						//set to 1 for ON, set to 0 for off
var gradTopBottom = "#FF000000";
var gradLeftRight = "#FF000000";
var dropDepthX = 0;	
var dropDepthY = 0;
var dropColor = "#FFCCCCCC";
var scrollINTO = 700;							//sets the hieght the click next will come down in pix's 500 
var backtrackScrollenable = true;				//if true, the page will return to the scroll position when linked out of on backtrack
var checkSize = false;
var prelim = false;
var autoCenter = true;							//if true, graphics placed in right frame will auto center based on hidden layer size
var numBR_roksForm = 2;
var redoakLayer_scrollINTO = 155;
var demo = false;


//no edits below this line_________________________________________________________________________________________

var list = new Array()   						// create an array to put the List in. 
var allLinks = document.all.tags("a")  			//find all references to images within the document.
var totalProcedures = document.all.tags("li")  	//find all <li> tags within the document.
var totalOutline = document.all.tags("ol")		//find all outline tags (used to measure height later on)
var totalParagraphs = document.all.tags("p")  	//find all <p> tags within the document.
var allAreas=document.all.tags("area")			//find all <area> tags within the document
var allLines=document.all.tags("hr")			//find all <hr> tags within the document
var totalFile=document.all.tags("html")			//create array for all HTML docs in file
var allSpans=document.all.tags("div")			//find all <div> tags within the document		
var allClickNext=document.all.tags("span")		//find all <span> tags within the document	
var postOutlineBreaks = 0;						/*counter to record number of breaks found after
												  the </ol>. Used to change header offset*/  
var redoakTableheight = 0;						//sets the hieght of the tack in the click next - based on template table
	
ValnextStep = 1;								//global which stores the current step value
commentIDCounter = 0;							//global which holds the next comment ID to be added
newCommentID = 0;								//global value reset
viewComment = 0;								//global value reset
init = 0;
sframeVal = 0; 
activeNote = 0;
isopen = 0;
readyForComment = 0;
printActive = 0;
activeComment = 0;
oDisplay = null;  
titleBarHeight=0;
loadingFlag = 1;
projectPath = "";
titleHeight = "0";
win2 = 0;
SplitToFull = false;
thisCount = 0;

QueryString.keys = new Array();
QueryString.values = new Array();
NoteList = new Array() 

if (navigator.appName == "Netscape") alert("You are trying to run this knowledge System in Netscape Navigator. The script required for proper functionality will not run in Netscape.");

if (parent.frames.length)
{
 window.frames.attachEvent("onload", subLoad);
 
}
else
{ 
 
 window.attachEvent("onload", noframeEvent);

}

//setTimeout("populateNotes()",400);

//populateNotes();

/* START FRAME BUILDER FUNCTIONS */
//***************************************************************************************************** 
//***************************************************************************************************** 
//***************************************************************************************************** 

function noframeEvent()
{
 getMETAData();
 
 if (window.document.readyState == "complete")
{ 
  window.detachEvent("onload", noframeEvent);
  
  delete_cookie(fileNameFromURL(document.location.href)+"exit_scrollTop");
		
  frameStyle = dispProp[0]
  titleFramevisible = eval(dispProp[1])
   
   if (frameStyle != null)
   {
      sframeVal = frameStyle
   }  
   if (titleFramevisible != null)
	{
   if (titleFramevisible)
	 {
	    titleHeight = '25';
	    generateFrameSet(sframeVal,titleHeight);
	    return false;
	 }	
	 else
	 {
	    titleHeight = '0';
	    generateFrameSet(sframeVal,titleHeight);
	 }
	 }
	 else
	 {
	 return false;
	 }
	 
    }
} /***End Function***/



function getMETAData()
{
var metaData = document.getElementsByTagName('META')

for (var m = 0; m < metaData.length; m++) 
{
	if (metaData[m].name.toUpperCase() == "DISPLAYPROPERTIES") 
	{
      metaKeywords = metaData[m].content
	  oKeywords = metaData[m]
	  
	}
}
	
var oHead = document.getElementsByTagName('HEAD')

	if (oKeywords != null)
	 {
		
	 } 
	 else 
	 {
		var oMetaKeywords = document.createElement("META");
		oMetaKeywords.name = "DISPLAYPROPERTIES"
		oMetaKeywords.content = "50,true,true,false,false,false,false,false,,,,"
		oHead(0).appendChild(oMetaKeywords)
	}  
    this.dispProp = oKeywords.content.split(",");	
}


function generateFullObjectWindow(sFileOBJ)
{

	SplitToFull = true;
	openNew(sFileOBJ);
					
} /***End Function***/



function generateFrameSet(sType,sTHeight)
{
NOscroll = eval(dispProp[3])
	
	scrollBar = "scrolling='AUTO'" //set for backward compatibility
	
	if (NOscroll)
	{
	scrollBar = "scrolling='NO'"
	}
	
newDocs=location.href;
passTitle=escape(document.title);
HorizontalFrameSet = eval(dispProp[4])
No_Bottom_Controlbar = eval(dispProp[5])

if (No_Bottom_Controlbar)
{
bcb_height = 1;
} 
else 
{
bcb_height = 47;
}


No_Top_Controlbar = eval(dispProp[6])
if (No_Top_Controlbar)
{
tcb_height = 0;
} 
else 
{
tcb_height = 75;
}


if (HorizontalFrameSet != null)
{

	if (!HorizontalFrameSet)
	{
	var newFile = QueryString_Parse(newDocs)
	fromEditor = QueryString('ToDo');	
	No_Top  = document.getElementById("CBPath"); 
   
   		if (sType >= 0)
		{
		var checkPathLevel = document.getElementsByTagName("LINK")
		var findSlashes = checkPathLevel(0).href.lastIndexOf("StyleSheets");
		var sPrefix = checkPathLevel(0).href.substring(0,findSlashes);
		chooseControlBar();
		//controlbarbottom = "../_Controlbar_bottom/controlbar_bottom.asp?title=" + passTitle;
		//NotePopulate = "../_Controlbar_bottom/NotePopulateFrame.asp?title=" + passTitle;
		//controlbarbottom = "../_Controlbar_bottom/controlbar_bottom.htm";
		
		}
		else
		{
		alert("You must enter a positive number in the Size field.");
		}		
	    
		var replaceExistingFrame = '<html>'
				+ '<head>'
				+ '<title></title>'
				+ '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">'
				+ '<script id="AutoGen"></script>'
    			+ '</head>'
				+'<frameset name="framer1" rows="' + tcb_height + ',*" frameborder="NO" border="0" framespacing="0"> '
  					+ '<frame name="topFrame" scrolling="NO" noresize src=' + sPrefix + 'Controlbar_top/controlbar_top.htm>'
  					+ '<frameset name="framer2" rows="*,' + bcb_height + '" frameborder="NO" border="0" framespacing="0">' 
  					+ '<frameset name="framer3" cols="' + sType + '%,*" frameborder="NO" border="0" framespacing="0">' 
      				+ '<frameset name="framer4" rows="' + sTHeight + ',*" frameborder="NO" border="0" framespacing="0">'
					+ '<frame name="titleFrame" scrolling="NO" noresize src="" >'
					+ '<frame name="mainFrame" src="?'
					+ newDocs 
					+ '" noresize '
					+ scrollBar 
					+ '>'
  					+ '</frameset>'
					+ '<frame name="rightFrame" scrolling="NO" noresize src=' + sPrefix + '_ROKS_MasterFiles/splitscreen_clicknext_right.htm>'
  					+ '</frameset>'
					+ '<frame name="bottomFrame" scrolling="NO" noresize src='
					+ controlbarbottom
					+ '>'
					+ '</frameset>'
					+ '</frameset>'
					+ '<noframeset>'
					//+ '<iframe src='
					//+ NotePopulate
					//+ ' id="NotePopulateFrame" name="NotePopulateFrame" style="visibility:visible"></iframe>'
					+ '<body bgcolor="#cccccc" leftmargin="0" topmargin="0"></body>  '
					+ '</body>'
				+ '</noframeset>'
				+ '</html>';	
											
		}
	else
	{
	//horizontal
	var newFile = QueryString_Parse(newDocs)
	fromEditor = QueryString('ToDo');	
	No_Top  = document.getElementById("CBPath"); 
		
	var checkPathLevel = document.getElementsByTagName("LINK")
	var findSlashes = checkPathLevel(0).href.lastIndexOf("StyleSheets");
	var sPrefix = checkPathLevel(0).href.substring(0,findSlashes);
	chooseControlBar();
	//alert(sPrefix)
			
	var replaceExistingFrame = '<html>'
			+ '<head>'
			+ '<title></title>'
			+ '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">'
			+ '<script id="AutoGen"></script>'
    		+ '</head>'
			+ '<frameset rows="40,1*" frameborder="NO" border="0" framespacing="0" >'
			+ '<frame name="topFrame" scrolling="NO" noresize src=' + sPrefix + 'Controlbar_top/controlbar_top.htm>'
			+ '<frameset rows="' + sTHeight + ',*" frameborder="NO" border="0" framespacing="0">'
			+ '<frame name="titleFrame" scrolling="NO" noresize src="" >'
			+ '<frameset name="framer3" rows="'
			+ sType
			+ ',336*" frameborder="NO" border="0" framespacing="0" cols="*">' 
			+ '<frame name="rightFrame" scrolling="NO" noresize src=' + sPrefix + '_ROKS_MasterFiles/splitscreen_clicknext_right.htm>'
			+ '<frameset rows="1*,47" frameborder="NO" border="0" framespacing="0">'
	        + '<frame name="mainFrame" src="?'
	        + newDocs 
			+ '">'
			+ '<frame name="bottomFrame" scrolling="NO" noresize src='
	        + controlbarbottom
			+ '>'
			+ '</frameset>'
			+ '</frameset>'
			+ '</frameset>'
			+ '</frameset>';
				
	}
	}
				
else
{
alert('trap - should not see this, check form');
} 
	
//alert(replaceExistingFrame) 					
oNewdoc = parent.document.open("text/html","replace");
oNewdoc.write(replaceExistingFrame);
oNewdoc.close();
	
} /***End Function***/

/******************************************************************************
 This function will determine what control bar to place in the page. When viewing
 the Knowledge System pages locally or by previewing, the control bar needs to be 
 without any reference to Iframes. Also the Notes function is deactivated because
 it will not work.
******************************************************************************/ 
function chooseControlBar()
{
	//alert(location.href.substr(0,7));return false;
	
	if (location.href.substr(0,7) == "file://")
	{
		//alert("");
		controlbarbottom = "../_Controlbar_bottom/controlbar_bottom_dev.htm";
	}
	else
	{
		controlbarbottom = "../_Controlbar_bottom/controlbar_bottom.htm";
	}

//alert(controlbarbottom);
return controlbarbottom;

} /***End Function***/

//***************************************************************************************************** 
//***************************************************************************************************** 
//***************************************************************************************************** 

/* END FRAME BUILDER FUNCTIONS
START PAGE BUILDER FUNCTIONS */

function subLoad()
{
if (parent.frames.mainFrame && parent.frames.mainFrame.document.readyState == "complete")
  {	
    window.frames.detachEvent("onload", subLoad);	
	//alert('<link rel="stylesheet" type="text/css" href="../StyleSheets/RedOakStyleSheet.css">')
	//parent.frames.mainFrame.document.write('<link rel="stylesheet" type="text/css" href="../StyleSheets/RedOakStyleSheet.css">');	
	
	backTrakscrollTop = read_cookie(fileNameFromURL(document.location.href)+"exit_scrollTop");
		        		if (backTrakscrollTop != null) 
		        		{
				 			//requires onbeforeunload event in mainframe document which saves scrollTop in cookie
				 			setTimeout("javascript:window.scroll(0,backTrakscrollTop);",50);
				 			delete_cookie(document.location.pathname+"exit_scrollTop");
						};	
				
	loadingFlag = 0;		
	loadScript();
  }
}	

/******************************************************************************
 This function will find all <area> tags and add the onClick event so the 
 anchors will load without adding them to the history. The key is to convert
 the href to nxt's and then process the new data.
******************************************************************************/ 
function fixAreasHTML()
{
   for (var i=0 ;i<allAreas.length;i++)
    if (allAreas(i).className=="JS_Reference_Button")
	   {
           allAreas(i).outerHTML='<AREA  onmouseover="this.style.cursor=\'hand\'  " onClick= loadAnchor(this) coords='
		   + allAreas(i).coords
		   + ' shape='
		   + allAreas(i).shape
		   + ' nxt='
		   + allAreas(i).href
		   + ' target='
		   + allAreas(i).target 
		   + '>' 
	    }

}  /***End Function***/



/******************************************************************************
 This function will find all nxt or href properties within all <a> tags and add 
 the onClick event so the object will load when the link is clicked.
******************************************************************************/ 
function fixFSObjectHTML()
{

   for (var i=0 ;i<allLinks.length;i++)
   {
    if (allLinks(i).className=="JS_Object_Fullscreen")
	    {
		allLinks(i).outerHTML='<A class=JS_Object_Fullscreen '
				+ 'onmouseover="this.style.backgroundColor=\'blue\';this.style.color=\'white\'" onmouseout="this.style.backgroundColor=\'' + colour + '\';this.style.color=\'red\'"'
		 		+ 'onClick=loadObjectFull(this) nxt='
		 		+ allLinks(i).href
		 		+ '>' 
		 		+ allLinks(i).innerText 
		 		+ '</A>';
		}
	
	if (allLinks(i).className=="JS_Command_Fullscreen")
	    {
		allLinks(i).outerHTML='<A class=JS_Command_Fullscreen '
				+ 'onmouseover="this.style.backgroundColor=\'blue\';this.style.color=\'white\'" onmouseout="this.style.backgroundColor=\'' + colour + '\';this.style.color=\'black\'"'
		 		+ 'onClick=loadObjectFull(this) nxt='
		 		+ allLinks(i).href
		 		+ '>' 
		 		//+ allLinks(i).innerText 
				+ allLinks(i).innerHTML 
		 		+ '</A>';
		}
		
	if (allLinks(i).className=="JS_Command_Float")
	    {
		allLinks(i).outerHTML='<A class=JS_Command_Float '
				+ 'onmouseover="this.style.backgroundColor=\'blue\';this.style.color=\'white\'" onmouseout="this.style.backgroundColor=\'' + colour + '\';this.style.color=\'black\'"'
		 		+ 'onClick=displayDrawing(this) nxt='
		 		+ allLinks(i).href
		 		+ '>' 
		 		//+ allLinks(i).innerText 
				+ allLinks(i).innerHTML 
		 		+ '</A>';
		}
		
	}
}  /***End Function***/


/******************************************************************************
 This function will find all nxt or href properties within all <a> tags and add 
 the onClick event so the images will load when the link is clicked.
******************************************************************************/
function fixLayerHTML()
{
   for (var i=0 ;i<allLinks.length;i++)
    if (allLinks(i).className=="JS_Reference_Layer")
	    {
        allLinks(i).outerHTML='<A class=JS_Reference_Layer onClick=showLayer(this) nxt='
         + allLinks(i).href
		 + '>' 
		 + allLinks(i).innerText 
		 + '</A>';	
	}
}  /***End Function***/


/******************************************************************************
function fixBodyFooter()
******************************************************************************/ 
function fixBodyFooter()
{
 startingPoint = totalFile[0].outerHTML.indexOf("<BR>",totalFile[0].outerHTML.indexOf("</OL>"));
	while (startingPoint != -1)
	{
		postOutlineBreaks ++;
		startingPoint = totalFile[0].outerHTML.indexOf("<BR>",startingPoint + 4);
	}
	if (allLines.length > 0) postOutlineBreaks ++;	
} /***End Function***/

/******************************************************************************
 fixLITags (fix Line Item Tags) is used to add a click next javascript call to
 the end of each procedure step (<li> tag) found in the file with the exception
 of the last one.   
******************************************************************************/ 
function fixLITags()
{
   for (var i=0 ;i<totalProcedures.length-1;i++)
   {
     //+ "<span name='test' id=cn" + i
           totalProcedures[i].outerHTML = totalProcedures[i].outerHTML.substring(0,totalProcedures[i].outerHTML.length)		   
		//   + "<span id=cn"
		//   + " onClick='nextStep()'>"
		//   + "<font style='cursor:hand; font-size:15px;font-family: Arial;font-weight: bold;color: #0000FF'>{Click NEXT to Continue}</font></span><br><br>"
		//   + "</li>"   
	}
	
	if (totalProcedures.length > 0)
	{
	totalProcedures[i].outerHTML = totalProcedures[i].outerHTML.substring(0,totalProcedures[i].outerHTML.length) 
	   //    + "<span id=cn"
		//   + " onClick='nextStep()'>"
		//   + "<font style='cursor:hand; font-size:15px;font-family: Arial;font-weight: bold;color: #0000FF'><br><br>{Click to Continue}</font></span><br><br>"
		//   + "</li>"
		//   + "<li><font style='cursor:hand; font-size:20px;font-family: Arial;font-weight: bold;color: #000000'>End of procedure.</font></span><br><br><hr></li>"
	}
		   
} /***End Function***/


/******************************************************************************
 formatLineBreaks -- function called when click next is turned off. Creates line breaks.   
******************************************************************************/ 
function formatLineBreaks()
{

   for (var i=0 ;i<totalProcedures.length-1;i++)
   {
     //+ "<span name='test' id=cn" + i
           totalProcedures[i].outerHTML = totalProcedures[i].outerHTML.substring(0,totalProcedures[i].outerHTML.length)		   
		   + "<br>"
		  + "</li>"   
	}	
			   
} /***End Function***/


/******************************************************************************
 This function will find all nxt or href properties within all <a> tags and add 
 the onClick event so the images will load when the link is clicked.
******************************************************************************/ 
function fixImageHTML()
{
   for (var i=0 ;i<allLinks.length;i++)
    if (allLinks(i).className=="JS_Reference_Button")
	    {
        allLinks(i).outerHTML='<A class=JS_Reference_Button onClick=loadImage(this) nxt='
         + allLinks(i).href
		 + '>' 
		 + allLinks(i).innerText 
		 + '</A>';
	}
}  /***End Function***/

/******************************************************************************
 This function will find all nxt or href properties within all <a> tags and add 
 the onClick event so the images will load when the link is clicked.
******************************************************************************/ 

function fixImagePic()
{
 
var isopen =0
   for (var i=0 ;i<allLinks.length;i++)
    if (allLinks(i).className=="JS_Reference_Button")
	    {
        allLinks(i).outerHTML='<A class=JS_Reference_Button onClick=loadPic(this) nxt='
         + allLinks(i).href
		 + '>' 
		 + allLinks(i).innerText 
		 + '</A>';
		 
		 if (isopen == 0)
		   openPic(allLinks(i).nxt);
		   isopen=1;
		} 
		//alert(isopen);
		if (isopen == 1)return false;
		if (isopen == 0)return true;
				
}  /***End Function***/


function formatCommandButton()
{

 for (var i=0 ;i<allLinks.length;i++)
   
   switch(allLinks(i).className)
   {
   case "JS_Command_Button":
  
   testForFileType = (allLinks(i).href.substring(allLinks(i).href.lastIndexOf(".")) == ".dwf" 
    			   || allLinks(i).href.substring(allLinks(i).href.lastIndexOf(".")) == ".dwg"
  				   || allLinks(i).href.substring(allLinks(i).href.lastIndexOf(".")) == ".dxf");
   
   if (testForFileType == true)
   {
 	  if (allLinks(i).target == "")
	  
		    {
			  allLinks(i).target = "_self"
			}
			
			dTarget=allLinks(i).target;
		 
         		allLinks(i).outerHTML='<A class=JS_Command_Button '
				+ 'onmouseover="this.style.backgroundColor=\'blue\';this.style.color=\'white\'" onmouseout="this.style.backgroundColor=\'' + colour + '\';this.style.color=\'black\'"'
		 		+ 'target=' + allLinks(i).target
		 		+ ' onClick="openNew(this.nxt,' + '\''  + dTarget + '\'' + ');" nxt='
		 		+ allLinks(i).href
		 		+ '>' 
		 		+ allLinks(i).innerHTML 
		 		+ '</A>';
				//alert(allLinks(i).outerHTML);
			}	
        break					
   
   case "RO_Command_Button_Red":
  
   testForFileType = (allLinks(i).href.substring(allLinks(i).href.lastIndexOf(".")) == ".dwf" 
    			   || allLinks(i).href.substring(allLinks(i).href.lastIndexOf(".")) == ".dwg"
  				   || allLinks(i).href.substring(allLinks(i).href.lastIndexOf(".")) == ".dxf");
 
   if (testForFileType == true)
	 {
 	  if (allLinks(i).target == "")
		    {
			  allLinks(i).target = "_self"
			}
			
			dTarget=allLinks(i).target;
			
         		allLinks(i).outerHTML='<A class=RO_Command_Button_Red '
				+ 'onmouseover="this.style.backgroundColor=\'blue\';this.style.color=\'white\'" onmouseout="this.style.backgroundColor=\'' + colour + '\';this.style.color=\'red\'"'
		 		+ 'target=' + allLinks(i).target
		 		+ ' onClick="openNew(this.nxt,' + '\''  + dTarget + '\'' + ');" nxt='
		 		+ allLinks(i).href
		 		+ '>' 
		 		+ allLinks(i).innerHTML 
		 		+ '</A>';
	      }			
         break	
		}
  
  }  /***End Function***/ 


function Build_Drawing_Target() 
{
bgTable = document.getElementById("backgroundX");
	if (bgTable) 
	{
	colour = bgTable.bgColor;
	}
	else
	{
	colour = 'white';
	}

   for (var i=0 ;i<allLinks.length;i++)
    if (allLinks(i).className=="JS_Float_Window")
	    {
        allLinks(i).outerHTML='<A class=JS_Float_Window '
				+ 'onmouseover="this.style.backgroundColor=\'blue\';this.style.color=\'white\'" onmouseout="this.style.backgroundColor=\'' + colour + '\';this.style.color=\'red\'"'
		 		+ 'onClick=displayDrawing(this) nxt='
		 		+ escape(allLinks(i).href)
		 		+ '>' 
		 		+ allLinks(i).innerText 
		 		+ '</A>';  
		 }
}  /***End Function***/


function recordData()
{	

//alert("recordData");

var addOther = true;
pcTable = document.getElementById("RO_PC");
caTable = document.getElementById("RO_CA");

var hdr=""

if (pcTable && caTable)
{	
  //select the correct table
  htmlSource = pcTable.outerHTML;
  
  for (i=0;i<allClickNext.length;i++)
	{	
		if (allClickNext[i].className=="RO_Procedure_Header")
		{
 		hdr = allClickNext[i].outerHTML
		}
	}
	
	
if (hdr == "")
{
var allb=document.all.tags("b")	
  for (i=0;i<allb.length;i++)
	{	
		if (allb[i].className=="RO_Procedure_Header")
		{
 		hdr = allb[i].outerHTML
		}
	}
}

if (hdr == "")
{
var allb=document.all.tags("p")	
  for (i=0;i<allb.length;i++)
	{	
		if (allb[i].className=="RO_Procedure_Header")
		{
 		hdr = allb[i].outerHTML
		}
	}
}

if (hdr == "")
{
var allb=document.all.tags("p")	
  for (i=0;i<allb.length;i++)
	{	
		if (allb[i].className=="RO_Menu_Header")
		{
 		hdr = allb[i].outerHTML
		}
	}
}

if (hdr == "")
{
var allb=document.all.tags("span")	
  for (i=0;i<allb.length;i++)
	{	
		if (allb[i].className=="RO_Menu_Header")
		{
 		hdr = allb[i].outerHTML
		}
	}
}
	
hts = '<html> \n'
			+ '<head> \n'
			+ '<title>Red Oak Page</title> \n'
			+ '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> \n'
			+ '<link rel="stylesheet" href="../StyleSheets/RedOakStyleSheet.css"> \n'
			+ '<SCRIPT> \n'
 			+ 'function saveData() \n'
			+ '{ \n'
			+ 'var strCauses = ""; \n'
			+ 'var strCauseNumber = ""; \n'
  			+ 'oTable = document.getElementById("RO_PC"); \n'
			+ 'sTextArea = document.getElementById("comments"); \n'
  			+ 'totalchecks = document.all.tags("input"); \n'
        	+ 'if (oTable) \n'
			+ '{ \n'
    		+ 'for (i=0; i < oTable.cells.length; i++) \n'
              +'{ \n'
			  +'if (oTable.cells(i).childNodes(0).firstChild != null) \n'
			  +'{ \n'
			  + ' if (oTable.cells(i).childNodes(0).firstChild.type == "radio") \n'
                + '{ \n'
                   + ' if (oTable.cells(i).childNodes(0).firstChild.checked) \n' 
					+ '{ \n'
					 	+ 'strCauses = oTable.cells(i-1).innerText \n'		 
					    + 'strCauseNumber = parseInt(oTable.cells(i-2).innerText) \n'
						//+ 'alert(strCauseNumber); \n'
					+ '} \n'
				+ '} \n' 
			  +'} \n'
           	  + '} \n'
    	     + '} \n'
			 + 	'parent.frames.bottomFrame.document.EditorForm.ToDo.value = "record" \n'
			 + 	'parent.frames.bottomFrame.document.EditorForm.filename.value = escape(location.href.substring(location.href.lastIndexOf("\/"),location.href.length)); \n'
			 + 	'parent.frames.bottomFrame.document.EditorForm.causes.value = strCauses \n'
			// + 	'parent.frames.bottomFrame.document.EditorForm.comments.value =  escape(sTextArea.innerHTML )  \n'
			 + 	'parent.frames.bottomFrame.document.EditorForm.causenumber.value = strCauseNumber \n'
		     +  'parent.frames.bottomFrame.document.EditorForm.submit(); \n'
			+ '} \n'
			+ '</script> \n'
			+ '</head> \n'
			+ '<body leftmargin="20" marginwidth="20" bgcolor="#FFFFFF" style="overflow-x:hidden; visibility:visible" background="" > \n'
			+ hdr
			+ '<table width="60%" border="0" cellspacing="1" cellpadding="2"> \n'
  			+ '<tr> \n' 
    		+ '<td height="32"><span class="Body_Text"><span class="Body_Text_bold"><img src="../Graphics_Misc/Icon_instructions.gif" width="153" height="15"></span></span></td> \n'
  			+ '</tr> \n'
  			+ '<tr> \n' 
    		+ '<td> \n' 
      		+ '<ol> \n'
        	+ '<li>Select a Probable Cause from the list below that best describes the \n' 
          	+ 'cause for this alarm by clicking on the radio button next to its description.<br> \n'
          	+ '<br> \n'
        	+ '</li> \n'
        	//+ '<li>Type any comments associated with this Fault or Possible Cause into \n' 
          	//+ 'the Comment box below.<br> \n'
          	//+ '<br> \n'
        	//+ '</li> \n'
        	+ '<li>Click the Submit button to record the information to the Database.</li> \n'
      		+ '</ol> \n'
			+ '<br> \n'
    		+ '</td> \n'
  			+ '</tr> \n'
			+ '</table> \n'
			+ '<span class="Body_Text_bold_italic"><b><i>Probable Causes: </i></b></span><br> \n'
			+ htmlSource  
			//+ '<i><b> &nbsp;Comments: </b></i><br> \n'
			//+ '<textarea id= "comments" name="comments" rows="5" cols="70"></textarea> \n'
			+ '<br> \n'
            + '<input style="width:120" type="button" name="Button" value="SUBMIT" onClick ="saveData()"> \n'
            + 'Click the SUBMIT button to record information.<br> \n'
            + '<br> \n'
			+ '</body> \n'
 
 document.write(hts)
 
 pcTable = document.getElementById("RO_PC");
 caTable = document.getElementById("RO_CA");
 htmlSource = pcTable.outerHTML;
 pcTable.border=1
	  
 	 for (i=0; i < pcTable.rows.length; i++) 
              { 
			  pcTable.rows[i].insertCell();
			  var psc = '<div align="center"> \n'
        			  + '<input type="radio" name="radiobutton" value="radiobutton"> \n'
                      + '</div> \n'
			          pcTable.rows(i).cells(3).innerHTML = psc;
					
					  if (pcTable.rows(i).cells(2).innerText == "Other")
					  {
					  addOther = false;
					  }
			  }
			  if (addOther == true)
			  {
			  nbrRows = pcTable.rows.length
			  
			  var nbr = pcTable.rows(nbrRows-1).cells(0).innerText
			  var newRow = pcTable.insertRow();
			  newRow.insertCell();
			  newRow.cells(0).innerHTML = '<td class="Body_Text" valign="top" width="28" height="2">' + pcTable.rows.length + "." + '</td>'
			  newRow.cells(0).align="center";
			  newRow.insertCell();
			  newRow.cells(1).innerHTML = '<td class="Body_Text" valign="top" width="28" height="2">' + pcTable.rows.length + "." + '</td>'
			  newRow.cells(1).style.fontSize="0px";
			  newRow.cells(1).style.visibility="hidden";
			  newRow.insertCell();
			  newRow.cells(2).innerHTML = '<td class="Body_Text" colspan="2" valign="top">Other</td>'
			  newRow.insertCell();
			  newRow.cells(3).innerHTML = psc
			  }	
}  
} //end function

	function checkForSequence()
	{
	    var flName = escape(location.href.substring(location.href.lastIndexOf("\/"),location.href.length));
		parent.frames.bottomFrame.document.EditorForm.ToDo.value = "sequence";
		parent.frames.bottomFrame.document.EditorForm.filename.value = flName;
		parent.frames.bottomFrame.document.EditorForm.submit();	
		
	}	//end function



/******************************************************************************
 See if there is a rightFrame or not. If there is no rightframe then this
 statement assumes a fullscreen click next procedure. The offset value is set
 in each case so each step will display towards the middle of the screen.
******************************************************************************/
function loadScript()
{
//alert("loadScript");
delete_cookie("correct_answers");

	if (parent.framer3.cols == "*,100%")
			{			
			window.top.location.reload();
			SplitToFull = false;
			}	
			
verifyTitle(document.title);

	//create loading layer on the fly to hide parsing 
	//
	bdy = document.all.tags("body");
	bdy1 = bdy[0].outerHTML.split('>');
	bdyinner = bdy[0].innerHTML;

	//parent.frames.mainFrame.document.body.style.backgroundColor = '#CCCCCC';
	
	bgTable = document.getElementById("backgroundX");
	if (bgTable) 
	{
	parent.frames.mainFrame.document.body.style.backgroundColor = bgTable.bgColor;
	parent.frames.mainFrame.document.body.background = bgTable.background;
	}
	//afterEnd
	parent.frames.mainFrame.document.body.insertAdjacentHTML("afterEnd",'<div id="loading" style="width:100%; height:100%; layer-background-color:#FFFFFF; background-color:#FFFFFF "><font face="Arial, Helvetica, sans-serif"><br><br><b>Loading, one moment please ...</b></font></div>');
	if (prelim) {parent.frames.mainFrame.document.body.insertAdjacentHTML("beforeBegin",'<font size="4" color="#cc00ff" face="Arial, Helvetica, sans-serif"><b>PRELIMINARY - For Validation Only</b></font>');}
    parent.frames.mainFrame.document.body.insertAdjacentHTML("afterBegin",'<div id="noteDiv"></div>');
	setTimeout("continue_()",50);
	}
	function continue_()
	{
	
	isPC = document.getElementById("RO_PC");
    isCA = document.getElementById("RO_CA");
	
	if (isPC && isCA)
	{
	
var fbtn =	'<table style="border-top: buttonhighlight solid 1px; border-right: buttonshadow solid 1px; border-bottom: buttonshadow solid 1px; border-left: buttonhighlight solid 1px" width="100%" border="0" cellspacing="2" cellpadding="3" height="22" bgcolor="threedface"> \n'
             + '<tr> \n' 
   			 + '<td  style="font-family:arial; font-size:18px" valign="middle"  align="center"> \n' 
             + '<div align="center"> \n'
             +  '<input style="width:110px; font-family:arial; font-size:12px" type="button" name="Button" value="FEEDBACK" onclick ="recordData()"> \n'
             + '</div> \n'
             + '</td> \n'
             + '<td  style="font-family:arial; font-size:16px" valign="middle" width="88%" height="18">Click on the FEEDBACK button to record the Probable Cause. </td> \n'
             + '</tr> \n'
             + '</table> \n'
	
	parent.frames.mainFrame.document.body.insertAdjacentHTML("BeforeBegin", fbtn);
	
	checkForSequence();
	//setTimeout("checkForSequence()",500);
	}		
	
	
	//SpecialLoadScript();
	scrollINTO = redoakLayer_scrollINTO;
		
	document.body.attachEvent("onmousedown", displayNewCommentIcon);
    //loadCommentsFromCookie();
	Build_Drawing_Target();
	
	getMETAData();
	
	cList = eval(dispProp[2])
	
		if (cList)
		{
			initScript();
	 		init=1;
		}
		else
		{
			formatLineBreaks();
			fixImagePic();
			fixFSObjectHTML();
			formatCommandButton();
	  		if (backtrackScrollenable) window.attachEvent("onbeforeunload", savePosition);
	   		init=0;
		}
	
	
	//turn loading layer off 
	loadLayer= parent.frames.mainFrame.document.getElementById("loading");
	loadLayer.style.visibility='hidden';
	
	All_margins_0 = eval(dispProp[7])
	left_margin = dispProp[8]
	right_margin = dispProp[9]
	top_margin = dispProp[10]
	bottom_margin = dispProp[11]
	
	if (All_margins_0 != null)
   	{
	  if (All_margins_0)
	  {
	  document.body.style.marginLeft = 0;
	  document.body.style.marginRight = 0;
	  document.body.style.marginTop = 0;
	  document.body.style.marginBottom = 0;
	  }
	  else
	  {
		  	if (left_margin != null)
		  	{
			  if (left_margin != null)
			  {
		      document.body.style.marginLeft = left_margin;
			  }
			  else
			  {
			  document.body.style.marginLeft = 20;
			  }
		   	}  
			
			if (right_margin != null)
		   	{
			  if (right_margin != null)
			  {
		      document.body.style.marginRight = right_margin;
			  }
			  else
			  {
			  
			  }
		   	} 
			
			if (top_margin != null)
		   	{
			  if (top_margin != null)
			  {
		      document.body.style.marginTop = top_margin;
			  }
			  else
			  {
			  document.body.style.marginTop = 20;
			  }
		   	}  
			
			if (bottom_margin != null)
		   	{
			  if (bottom_margin != null)
			  {
		      document.body.style.marginBottom = bottom_margin;
			  }
			  else
			  {
			 
			  }
		   	} 
		}	
	}	
	
		
	redoak_layer = document.getElementById("redoak2");
	
	if (redoak_layer != null)
   	{	
		redoak_layer.style.width = 0;
		redoak_layer.style.height = 0;
		redoak_layer.innerHTML = "";
	}
	document.body.style.visibility='visible';
	
	if (checkSize) {checkRightFrameSize()};
	
	return false;
	
	
	
} /***End Function***/

/******************************************************************************
 This function will check your system for a cookie that stores the step you
 were on. If no cookie was detected or if you were on the very last step 
 then a cookie is written or updated to the first step.
******************************************************************************/ 
function initScript()
{
  theStep = read_cookie (document.location.pathname+"current_step");
   
  formatCommandButton();
  fixAreasHTML()
  fixFSObjectHTML()
  fixLayerHTML()
  fixImageHTML() 	//add onClick event and styleshheet parameters		
  fixLITags()		//See function for more details
  fixBodyFooter()	//See function for more details
     
	 if (theStep == null||theStep == (totalProcedures.length+2))
            {
			 write_cookie (document.location.pathname+"current_step", 2);
			 theStep=2;
			}

     if (theStep==2)
            {
			 scrollReset();			 
			 contractAll();
			 for (var i=0 ;i<allLinks.length;i++)
    			if (allLinks(i).className=="JS_Reference_Button")
	    			{
			 		openPic(allLinks(i).nxt);
					i = allLinks.length + 1;
					}
			 return false;
			}
 
     else
            {
		     contractAll();
			 return false;
            }
      
 
	  
} /***End Function***/

/* END PAGE BUILDER FUNCTIONS */
//***************************************************************************************************** 
//***************************************************************************************************** 
//***************************************************************************************************** 

function checkRightFrameSize()
{
alert('height= ' + parent.frames.rightFrame.document.body.clientHeight);
alert('width= ' + parent.frames.rightFrame.document.body.clientWidth);

parent.frames.rightFrame.document.write('height= ' + parent.frames.rightFrame.document.body.clientHeight + 'width= ' + parent.frames.rightFrame.document.body.clientWidth);

}

function showCurrentStep(iVal,jVal)
{
var sNewSteps
 if (jVal != 0)
 {
 counterStepper = parent.frames.titleFrame.document.getElementById("stepCounter"); 	
  if (counterStepper)
  {		
   sNewSteps	= (iVal +" of " + jVal);			
   counterStepper.innerHTML = sNewSteps;
   return sNewSteps;
  }
 } 
} /***End Function***/

/******************************************************************************
 This function will accept an object that refers to the <area> href tag and load
 it in the rightFrame when clicked.
******************************************************************************/ 
function loadAnchor(theStr)
{
    if (parent.frames.rightFrame)
       {
	    openNew(theStr.nxt);
       }
	   
} /***End Function***/

/******************************************************************************
 This function will find all of the steps in the document(<li> tags) and assign 
 them an id. Then all of the steps are initially hidden. The current step is
 determined and all steps up to the current step are made visible. This function
 will also make a call to another funtion to determine which graphic to open
 in the right frame if applicable. 
******************************************************************************/ 
function contractAll()  //assign an id to all steps and hide them all.
{
foundImage=0; 
     for (var i=1 ;i<totalProcedures.length+1;i++)
      {
        totalProcedures[i-1].id="step"+ i;
        list [i] =eval("step"+ i);
        hideStep( list [i]);
      }
		//setCommentScroll(theStep - 1);

     for (var j=1;j<theStep;j++) //determine current step
       { 
         if (j != totalProcedures.length+1 )
               {
			    showStep( list [ j ]);
				setScrollPosition(j -1);	
			   }   

         if (theStep==2 && foundImage != 1)
               {
				foundImage=1;
			    placeImage(0)
			   }
      
		 if (foundImage==0)
               {
			    foundImage=1;
			    placeImage(theStep -2);
			   }
        } 
		
	showCurrentStep(theStep - 1,totalProcedures.length);
} /***End Function***/

function explodeProc()
{
	foundOne=0;
	nn = parent.frames.mainFrame.document.getElementsByName('cn');
	
	for (var i=0 ;i<allLinks.length;i++)
    if (!cList || !parent.frames.rightFrame)
	    {
          foundOne=1;
		} 	
		
	if (foundOne == 0)
	{
	for (var i=1 ;i<totalProcedures.length+1;i++)
  		   showStep( list [i])
	}
}

/******************************************************************************
showStep(name)
******************************************************************************/ 
function showStep(name)
{

if (demo && (document.getElementById("demoID") == null))
{
if (name.id == "step2")
{
delete_cookie (document.location.pathname+"current_step");
//refreshCommentIcons();
scrollReset();
alert("demo version");
return false;
}
}


    if (ValnextStep !== totalProcedures.length+1 && name != null) 
         {
		 // alert("showStep");
		    openstep=name;			
		    name.style.visibility='visible';
		 }
     else 
	    {
         if (printActive == 0)
		 {
		 delete_cookie (document.location.pathname+"current_step");
		 alert("End of procedure. Click on the Back Button below to return to the previous page.");
		 }
        }
   //refreshCommentIcons();
} /***End Function***/

/******************************************************************************
hideStep(name)
******************************************************************************/ 
function hideStep(name)
{
if (isopen == 0) name.style.visibility='hidden';

} /***End Function***/

/******************************************************************************
 This function will make sure that step being passed to it is valid. The step
 is not valid if it has reached the last step. If valid, the step number will
 be passed to sortLinks function to extract the correct image for the step.
******************************************************************************/ 
function placeImage(idx)
{
   if (idx < totalProcedures.length &&  isopen == 0)
      {
	   sortLinks(idx);
	  }

} /***End Function***/

/******************************************************************************
 This function will cycle through all of the links that are in this step, find
 any that are marked with nxt, make sure there is a rightFrame to place it in 
 and put the first one there. note: use document.write to make nxt's clickable. 
******************************************************************************/ 
function sortLinks(curIdx)
{
 var iLnks=totalProcedures(curIdx).all.tags("a"); //returns the number of links within the step
 for (var j=0; j<iLnks.length; j++)   
      if (iLnks(j).nxt && parent.frames.rightFrame)
        {
		//alert("sortLinks"); 
         openNew(iLnks(j).nxt);
		 return false;
		}
	   else 
	    {
		if (iLnks(j).nxt)
		{
	     openNew(iLnks(j).nxt);
		 return false;
		 }
		}	 
        
} /***End Function***/

/******************************************************************************
 This function will accept an object that refers to the <a> nxt tag and load it
 in the rightFrame when clicked.
******************************************************************************/ 
function loadImage(theStr)
{
    if (parent.frames.rightFrame)
       {
	    openNew(theStr.nxt);
       }
	   
} /***End Function***/



/******************************************************************************
 This function will accept an object that refers to the <a> nxt tag and load it
 into a fullscreen with bottom control bar only when clicked.
******************************************************************************/ 
function loadObjectFull(theStr)
{
    if (parent.frames.mainFrame)
       {
	    generateFullObjectWindow(theStr.nxt);
		return false;
       }
	   
} /***End Function***/




/******************************************************************************
 This function will reset the scrollbar to the top of the page
******************************************************************************/ 
function scrollReset()
{
  setTimeout("javascript:window.scroll(0,0)",1000);
} /***End Function***/

/******************************************************************************
 This function will handle the click NEXT to continue command.
******************************************************************************/ 
function nextStep()
{

thisCount = 0;

 if (!cList || init==0)
	{
	alert('End of procedure');
	return false;
	} 
	
  for (var i=0;i<list.length;i++)
   if (openstep==list[i])
      {
	  placeImage(i);
	  ValnextStep=(i+1);
	  setScrollPosition(i);
	  }

   if (ValnextStep==list.length -1)
      {
	  showStep(list[ValnextStep]);
   
	  delete_cookie (document.location.pathname+"current_step")
	  
      showCurrentStep(ValnextStep,totalProcedures.length);
	  
	  return false;
	  }

   if (ValnextStep != (totalProcedures.length +1))
      {
	  showStep(list[ValnextStep]);
	  //totalProcedures(ValnextStep -2).style.backgroundColor= 'transparent' ;
	  
	  write_cookie (document.location.pathname+"current_step", (ValnextStep+1));
      
      showCurrentStep(ValnextStep,totalProcedures.length);
	  
	  }
   else  
      {
	   showStep(list[ValnextStep]); 
	  } 
	  
setCommentScroll(theStep - 1);
   
} /***End Function***/

/******************************************************************************
previousStep()
******************************************************************************/ 
function previousStep()
{
pStep = ValnextStep;

if (pStep != (totalProcedures.length + 1) && pStep != 1)
{
  if (pStep != 1  && list[pStep] != null)
      {
       hideStep(list[pStep]);
       	if (parseInt(pStep) > 2) 
		 {
	      	     write_cookie (document.location.pathname+"current_step", (pStep - 1));
                                         ValnextStep = pStep - 1;
                                         openstep=list[pStep - 1];
	                       showStep(list[pStep - 1]); 
	                       showCurrentStep(pStep - 1,totalProcedures.length);
	                       setScrollPosition(pStep - 2);
	                       placeImage(pStep - 2);
		    }
		     else
		            {
		              showStep(list[pStep - 1]); 
		              showCurrentStep(pStep - 1,totalProcedures.length);
		              scroll(0,0);
		              placeImage(pStep - 2);
		            }
        }
 }	
 else //code for last step or end of procedure 
    {
       if ( pStep != 1 )
             {
                hideStep(list[totalProcedures.length]);
                hideStep(list[totalProcedures.length - 1]);
                write_cookie (document.location.pathname+"current_step", (totalProcedures.length - 2));
                ValnextStep = totalProcedures.length - 2;
                openstep=list[totalProcedures.length - 2];
                placeImage(pStep - 4);
                showCurrentStep(pStep - 1,totalProcedures.length); 
                setScrollPosition(pStep - 2);
             }	
   }   
 
} /***End Function***/

/******************************************************************************
setScrollPosition(visibleStep)
******************************************************************************/
function setScrollPosition(visibleStep)
{
  //setCommentScroll();
  if (totalOutline.length == 0) return 0;
  totalProcedures = document.all.tags("li")
  offsetVal = document.body.scrollHeight - totalOutline[0].scrollHeight -((postOutlineBreaks - numBR_roksForm) * 21)
  scrollMultiplier=offsetVal;
  for (var stepIndex=0;stepIndex < visibleStep; stepIndex++)
       
	   scrollMultiplier = (scrollMultiplier+totalProcedures[stepIndex].scrollHeight);

       if (stepIndex < totalProcedures.length && stepIndex != 0)
           {
		   scroll(0,scrollMultiplier - scrollINTO);
		   }
 } /***End Function***/

/******************************************************************************
function write_cookie (name, value);
function write_cookie (name, value, path);

write_cookie creates a cookie with the name, value, and path given in the
parameters.  If no path is supplied, write_cookie uses the document's default
cookie path.  Each cookie is set with an expiration time of 1 year.
******************************************************************************/
function write_cookie (name, value, path)
{
        // Build the expiration date string:
        var expiration_date = new Date ();
        expiration_date . setYear (expiration_date . getYear () + 1);
        expiration_date = expiration_date . toGMTString ();
		// Build the set-cookie string:
        var cookie_string = escape (name) + "=" + escape (value) +
                "; expires=" + expiration_date;
        if (path != null)
                cookie_string += "; path=" + path;

        // Create/update the cookie:
        document . cookie = cookie_string;
   
} /***End Function***/

/******************************************************************************
function read_cookie (key)
function read_cookie (key, skips)

read_cookie searches through the current document's cookie string (i.e., the
concatenation of all cookies readable by the current document) for a cookie
whose name is identical to key.  If read_cookie finds a matching cookie, it
returns a string containing the value of cookie.  If read_cookie cannot find a
match, it returns null instead.

An optional skips parameter may be supplied if there is a need to select among
multiple cookies with the same name.  If a skips parameter is supplied,
read_cookie will skip that many occurrences of matching cookies and then return
the next one it finds, or null if there aren't any more.
******************************************************************************/
function read_cookie (key, skips)
{
        // Set skips to 0 if parameter was omitted:
        if (skips == null)
                skips = 0;

        // Get cookie string and separate into individual cookie phrases:
        var cookie_string = "" + document . cookie;
        var cookie_array = cookie_string . split ("; ");

        // Scan for desired cookie:
        for (var i = 0; i < cookie_array . length; ++ i)
        {
                var single_cookie = cookie_array [i] . split ("=");
                if (single_cookie . length != 2)
                        continue;
                var name  = unescape (single_cookie [0]);
                var value = unescape (single_cookie [1]);

                // Return cookie if found:
                if (key == name && skips -- == 0)
                        return value;
        }

        // Cookie was not found:
        return null;
  
} /***End Function***/

/******************************************************************************
delete_cookie (name)
delete_cookie (name, path)

delete_cookie deletes the cookie with the specified name and path.  If no path
is given, the default cookie path for the current document is used instead.  If
the name and path do not match an existing cookie, delete_cookie has no effect.
******************************************************************************/
function delete_cookie (name, path)
{
        // Build expiration date string:
        var expiration_date = new Date ();
        expiration_date . setYear (expiration_date . getYear () - 1);
        expiration_date = expiration_date . toGMTString ();

        // Build set-cookie string:
        var cookie_string = escape (name) + "=; expires=" + expiration_date;
        if (path != null)
                cookie_string += "; path=" + path;

        // Delete the cookie:
        document . cookie = cookie_string;
  
} /***End Function***/

/******************************************************************************
 Function is used to print the complete contents of the mainFrame. In order
 to do this, all of the line items must be temporairly displayed.  The function
 displays all of them, focuses on the frame, calls the print method, rehides
 all of the items, and then redisplays up to the current step.
******************************************************************************/
function printDocument()
{
	printComments = 0;
	printActive = 1;
	foundOne=0;
	nn = parent.frames.mainFrame.document.getElementsByName('cn');
   
    if (SplitToFull == true)
		{
		//alert("");
   		parent.frames.rightFrame.window.focus();
		parent.frames.rightFrame.window.print();
		return false;
		}
   
	for (var i=0 ;i<allLinks.length;i++)
    if (!cList || !parent.frames.rightFrame)
	    {
         foundOne=1;
		} 	
		
	if (foundOne == 0)
	{
	
	for (var i=0 ;i<nn.length;i++) 
	{
	 	nn(i).style.visibility='hidden';     
	} 
	for (var i=1 ;i<totalProcedures.length+1;i++)
  		   showStep( list [i-1])
	}
	
	for (i=0;i<allSpans.length;i++)
	{	
		if (allSpans[i].className=="noteIcon")
		{
			//allSpans[i].style.visibility = "visible";
			printComments = 1
		}
	}
	
	if (printComments == 1)	
	{
		commentTableString = "<b>NOTES:</b>"
		+ "<table border='1' width='600')>"
		+ "<tr><td width='100'>Name</td><td width='200'>Date</td><td width='300'>Comment</td></tr> "
			
		for (i=0;i<allSpans.length;i++)
		{	
			if (allSpans[i].className=="noteIcon")
			{
				commentTableString = commentTableString
				+ "<tr>"
		   		+ "<td width='100' valign='top'>&nbsp;" + allSpans[i].fdName + " </td> " 
				+ "<td width='200' valign='top'>&nbsp;" + allSpans[i].fdDate + " </td>"
				+ "<td width='300' valign='top'>&nbsp;" + allSpans[i].fdComment + "</td></tr>";
			}
		}
		parent.frames.mainFrame.document.body.insertAdjacentHTML("beforeEnd",commentTableString + "</table>");
	}
	parent.frames.mainFrame.window.focus();
	parent.frames.mainFrame.window.print();
	
	if (document.getElementById("noPrintRefresh") == null)
	{
	 parent.top.location.reload();
	}
	else
	{	
	for (i=0;i<allSpans.length;i++)
	{	
		if (allSpans[i].className=="noteIcon")
		{
		 allSpans[i].style.visibility = "visible";
		}
	  }
	}
	
	printActive = 0;
	
} /***End Function***/


/******************************************************************************
 Function is used to print the complete contents of the mainFrame. Function also
 prints all of the associated graphics referenced in the mainFrame.
 
 In order to do this, all of the line items must be temporairly displayed.  The function
 displays all of them, focuses on the frame, calls the print method, rehides
 all of the items, and then redisplays up to the current step.
******************************************************************************/
function printDocumentSpecial()
{
	
	printComments = 0;
	printActive = 1;
	foundOne=0;
	nn = parent.frames.mainFrame.document.getElementsByName('cn');
   
   
	for (var i=0 ;i<allLinks.length;i++)
    if (!cList || !parent.frames.rightFrame)
	    {
         foundOne=1;
		} 	
		
	if (foundOne == 0)
	{
	
	for (var i=0 ;i<nn.length;i++) 
	{
	 	nn(i).style.visibility='hidden';     
	} 
	for (var i=1 ;i<totalProcedures.length+1;i++)
  	
		   showStep( list [i-1])
	}
	
	
	for (var i=0 ;i<totalProcedures.length;i++)
	{
		var stepObj = totalProcedures(i).all.tags("a");
				
		//testForJPG = (thisPage.substring(thisPage.lastIndexOf(".")) = ".jpg");
		//testForGIF = (thisPage.substring(thisPage.lastIndexOf(".")) = ".gif");
		
		for (var x=0 ;x<stepObj.length;x++)
		{
		var objStep = (stepObj(x).nxt);		
				
		   	if (stepObj(x).className=="JS_Reference_Button")
	    		{
				
				testForExt = (objStep.substring(objStep.lastIndexOf(".")));
				testForExtUpper = testForExt.toUpperCase();
				testForExtUpper=testForExtUpper.split("$");
				testForExtUpper=testForExtUpper[0];
				
				//if (testForExtUpper[1] != undefined)
					//{
					//splittheLayer=testForExtUpper[1];
					//}				
				
				 if (testForExtUpper == ".JPG" || testForExtUpper == ".GIF")
				 	{
						//alert(stepObj(x).nxt);
						imageTableString =  "<br style='page-break-after:always'>"	
											+"<table width='100%' border='0' cellspacing='1' cellpadding='1'>"
											//+"<tr><td align='center'>" + (document.title) + "</td></tr>"
											+"<tr><td align='center' height='40'><b>Step " + (i+1) + " Graphic</b></td></tr>"
											+"<tr><td align='center'><img src=" + stepObj(x).nxt + "></td></tr>"
											+"</table>"		
											//+"<br style='page-break-after:always'>"					
					
						parent.frames.mainFrame.document.body.insertAdjacentHTML("beforeEnd",imageTableString + "</table>");
					}
				
				if (testForExtUpper == ".HTM" || testForExtUpper == ".HTML")
					{
						
						/*** SPLIT THE HREF IN ORDER TO DROP THE $LAYER REFERENCE. THEN OPEN THE HTM FILE,
							 IN A NEW WINDOW ***/
												
						var splitHTML = objStep.split("$");
						var getHTML = splitHTML[0];
						var getLayer = splitHTML[1];
						alert(getLayer);
						var newWind = window.open(getHTML, "subWindow", "status=1,menubar=1,height=10,width=10,left=2000,top=2000");
						var newWindSrc = newWind.document.getElementsByTagName("img");
						var newWindDiv = newWind.document.getElementsByTagName("div");
						
						/*** LOOP THROUGH ALL IMG TAGS IN HTM DOCUMENT. WHEN IMG TAG WITH NAME="MAINPIC" IS FOUND,
							 GET THE OUTERHTML FOR THAT IMG TAG AND PLACE INTO VARIABLE GETSRC ***/
						
							for (var x=0 ;x<newWindSrc.length;x++)
								{
									if (newWindSrc[x].name == "mainpic")
										{
											var getSrc = newWindSrc[x].outerHTML;
											//alert(getSrc); 
										}
								}						
												
						/*** LOOP THROUGH ALL DIV TAGS IN HTM DOCUMENT. WHEN DIV TAG WITH ID = $LAYER IS FOUND,
							 GET THE OUTERHTML FOR THAT DIV TAG AND PLACE INTO VARIABLE GETDIV.
							 THEN, IN THE VARIABLE GETDIV, REPLACE VISIBILITY:HIDDEN WITH VISIBILITY:VISIBLE.
							 IF THERE IS NO $ ATTACHED TO HTM LINK, RUN ELSE STATEMENT ***/
						
						if (getLayer != undefined)
							{
								for (var x=0 ;x<newWindDiv.length;x++)
								{
									if (newWindDiv[x].id == getLayer)
										{
											var getDiv = newWindDiv[x].outerHTML;
											//alert(getDiv);
											var srchText = /hidden/g;
											var replacement = "visible";
											var getDiv = getDiv.replace(srchText, replacement);
											//alert(getDiv); return false;
										}
								}
							}
						else
							{								
								//alert("layer does not exist"); 
								getDiv = ('&nbsp;');
							}
							
						newWind.close();
						
						imageTableString =  "<br style='page-break-after:always'>"	
						+"<table width='100%' border='0' cellspacing='1' cellpadding='1'>"
						+"<tr><td align='center' height='40'><b>Step " + (i+1) + " Graphic</b></td></tr>"
						//+"<tr><td align='center'>"
						+"</table>"
						+"<div style='position: relative; left: 0px; top: 0px; width:200px; height:200px; z-index: 1; vertical-align: middle; horizontal-align: center; visibility: visible'>"
						+"<div id='main' style='position: absolute; left: 0px; top: 0px; width:200px; height:200px; z-index: 1; vertical-align: middle; visibility: visible'>" 
						+"" + getSrc + ""
						+"" + getDiv + ""
						+"</div>"
						+"</div>"
												
						parent.frames.mainFrame.document.body.insertAdjacentHTML("beforeEnd",imageTableString + "</table>");
						//alert(""); return false;										
					}
					
				}
			
		}
	}
	
	
	for (i=0;i<allSpans.length;i++)
	{	
		if (allSpans[i].className=="noteIcon")
		{
			//allSpans[i].style.visibility = "visible";
			printComments = 1
		}
	}
	
	if (printComments == 1)	
	{
		commentTableString = "<b>NOTES:</b>"
		+ "<table border='1' width='600')>"
		+ "<tr><td width='100'>Name</td><td width='200'>Date</td><td width='300'>Comment</td></tr> "
			
		for (i=0;i<allSpans.length;i++)
		{	
			if (allSpans[i].className=="noteIcon")
			{
				commentTableString = commentTableString
				+ "<tr>"
		   		+ "<td width='100' valign='top'>&nbsp;" + allSpans[i].fdName + " </td> " 
				+ "<td width='200' valign='top'>&nbsp;" + allSpans[i].fdDate + " </td>"
				+ "<td width='300' valign='top'>&nbsp;" + allSpans[i].fdComment + "</td></tr>";
			}
		}
		parent.frames.mainFrame.document.body.insertAdjacentHTML("beforeEnd",commentTableString + "</table>");
		
	}
	parent.frames.mainFrame.window.focus();
	parent.frames.mainFrame.window.print();
	
	if (document.getElementById("noPrintRefresh") == null)
	{
	 parent.top.location.reload();
	}
	else
	{	
	for (i=0;i<allSpans.length;i++)
	{	
		if (allSpans[i].className=="noteIcon")
		{
		 allSpans[i].style.visibility = "visible";
		}
	  }
	}
	
	printActive = 0;
	
} /***End Function***/


/******************************************************************************
 Function ClassExists is used to test for a class type.Calling script passes 
 type to check for, returns true if class exists, returns false if class does 
 not exist. Jimb 1-2-01
******************************************************************************/
function ClassExists(ClassType)
{
var allLinks = document.all.tags("a") 

   for (var i=0 ;i<allLinks.length;i++)
   //alert(allLinks.length);
    if (allLinks(i).className==ClassType)
	    {
		   return true;
		}
		return false;
} /***End Function***/

/******************************************************************************
 Function is called from the bottomFrame 'back' button.  It is used to send
 the user back to a previous screen.
******************************************************************************/
function exit_Document()
{
	delete_cookie(document.location.pathname+"current_step");
	ValnextStep=1;
	write_cookie (document.location.pathname+"current_step", 2);
		
	theStep=2;
	
if (!cList.checked || init==0)
	{
     return false;
	}  
} /***End Function***/

/******************************************************************************
 Function is called from the bottomFrame 'reset' button.  It is used to send
 the user back to the top of the screen and hide all except the first step.
******************************************************************************/
function reset_Document()
{
	delete_cookie(document.location.pathname+"current_step");

	ValnextStep=1;
	scrollReset();
	
	write_cookie (document.location.pathname+"current_step", 2);
		
	theStep=2;
	
if (!cList || init==0)
	{
     return false;
	}  
  contractAll();	
  setCommentScroll(theStep - 1);
} /***End Function***/

/******************************************************************************
fileNameFromURL(startString)
******************************************************************************/
function fileNameFromURL(startString)
{
		if (startString.lastIndexOf("/") != -1)
			return startString.substring(startString.lastIndexOf("/") + 1 ,startString.length)
		else
			return startString
			
} /***End Function***/



function write_storage(oObj, sVal)
{
alert('write storage');
alert(oObj);

if (oObj != null)
   {
	oObj.setAttribute("XXPersistValue",sVal);
	oObj.save("XXXMLStore");
   }	
}

function read_storage(oObj)
{
 
if (oObj != null)
   {
	oObj.load("XXXMLStore");
        var lVal = oObj.getAttribute("XXPersistValue");
	return lVal;
   }	
}

function delete_storage(oObj)
{
if (oObj != null)
   {
	var oTimeNow = new Date(); // Start Time
    oTimeNow.setMinutes(oTimeNow.getMinutes() - 1);
    var sExpirationDate = oTimeNow.toUTCString();
	
    oObj.expires = sExpirationDate;
    write_storage(oObj, 0);		  
   }	
} /***End Function***/

function Instructionbox(pass) 
{
if (loadingFlag ==1) {return false;}

		layerExists=document.getElementById("Ibox");
		if (layerExists == null)
		{		
		tempBody=parent.frames.mainFrame.document.body;
		
		parent.frames.mainFrame.document.body.innerHTML='<div id="Ibox" style="position:absolute; width:100%; height:20px; z-index:1; left: 0; top: 0; visibility: visible">' 
        + '<table width="50%" border="2" height="100%" bgcolor="#FF3333" align="center" bordercolor="#000000">'
		+ '<tr>' 
		+ '<td align="center" id="MessageBox"><font id="fnt" face="arial">' 
		+ '<div id="nnn">'
		+ pass  
		+ '</div></font>'
		+ '</td>'
		+ '</tr>'
		+ '</table>'
		+ '</div>' 
		+ tempBody.innerHTML;
		}
		else
		{
		nnn.innerText=pass;
		
		};

		return false;
} /***End Function***/

function destroyInstructionbox()
{
layerExists=document.getElementById("Ibox");
if (layerExists != null) {Ibox.outerHTML=''}
} /***End Function***/

//************************************************************************************
//this function is passed an href
//it then checks for the anchor tag # in a path (href)
//if an anchor tag # is found it is retruned, as follows: #anchor
//if no anchor tag # is found, null is returned
//jimb 1-03-01*************************************************************************

function GetAnchor(t)
{
	x=t.charAt(0);
	var i=0;
	while ((x != '#') && ( i < t.length))
	{
		i=i+1;
		x=t.charAt(i);
	}
	if (i == t.length)
	{
		//no anchor tag # found
		return null
	}
	else
	{
		var build = x=t.charAt(i);
		for (var j=i ;j<t.length;j++)
		{
			x=t.charAt(j+1);
			build=build + x;
		}
	//alert('anchor ='+ build);
	return build;
	}
} /***End Function***/

function getURLfolder(passURL)
{
	passURL_ = passURL;
	if ((passURL_.indexOf("file") != -1) || (passURL_.indexOf("http") == 0))
	{
		passURL_ = passURL_.substring(0,passURL_.lastIndexOf("/"));
		passURL_ = passURL_.substring(0,passURL_.lastIndexOf("/") + 1);
		return passURL_;
	}
	
    monikerCheck = passURL_.indexOf(":");
	
	if (monikerCheck == 2)
	{
		//mk:@MSITStore: compliled .CHM file uses backward slashes
		x = 14;
	}
	else
	{
		//ms-its: compiled .ITS file - code below will not work for ITS
		//x = 7;
		alert('Red Oak Msg: Unable to determine external file path');
		alert(passURL);
		return false
	};
	
	y = passURL_.lastIndexOf("\\") + 1;
	tempX = (passURL_.substring(x,y));	   
	tempX = tempX.split("\\");
	passURL_ = tempX[0];
	for (var i=1 ;i<tempX.length;i++)
	   {
		   passURL_ = passURL_ + "/" + tempX[i];
	   }
	
	if (passURL_.indexOf("%20") != -1)
	{
		alert(passURL_ + "  folder names with spaces are not supported, please rename your folder without spaces, drawings will not be found");
	}
	
	//alert(passURL_);
	return passURL_;
	
} /***End Function***/

/******************************************************************************
 This function will accept an object that refers to the <a> nxt tag and load it
 in the righ frame when clicked.
******************************************************************************/ 

function loadPic(theStr)
{
    if (parent.frames.rightFrame)
       {
	    openPic(theStr.nxt);
       }
	   
} /***End Function***/


/******************************************************************************
This function extracts the values from the url
******************************************************************************/ 

function QueryString(key)
{

	var value = null;
	
	for (var i=0;i<QueryString.keys.length;i++)
	{
		if (QueryString.keys[i]==key)
		{
			value = QueryString.values[i];	
			
			break;
		}
	}
	
	return value;
}


function QueryString_Parse(newUrl)
{
QueryString.keys = new Array();
QueryString.values = new Array();

var pos2 = newUrl.indexOf('?');

    newUrl = newUrl.substring(pos2+1);
	//alert("new: " + newUrl);
	
	var query = newUrl;
	
	var pairs = query.split("&");
	
	for (var i=0;i<pairs.length;i++)
	{
		var pos = pairs[i].indexOf('=');
	
		if (pos >= 0)
		{
			var argname = pairs[i].substring(0,pos);
			var value = pairs[i].substring(pos+1);
			QueryString.keys[QueryString.keys.length] = argname;
			QueryString.values[QueryString.values.length] = value;	
			
		}
	}

}


/******************************************************************************
 This function will accept a URL or jpg and load it in the right frame when the
 red reference button is clicked. This new URL or jpg will replace the old one 
 and will not be added to the history list. If no right frame exists, this call
 will be ignored.
******************************************************************************/ 

function openPic(newurl,sTarget,bFull)
{

  testForFileType = (newurl.substring(newurl.lastIndexOf(".")) != ".htm" 
  						&& newurl.substring(newurl.lastIndexOf(".")) != ".swf" 
  						&& newurl.substring(newurl.lastIndexOf(".")) != ".wmv" 
  						&& newurl.substring(newurl.lastIndexOf(".")) != ".dwf" 
						&& newurl.substring(newurl.lastIndexOf(".")) != ".dxf" 
						&& newurl.substring(newurl.lastIndexOf(".")) != ".dwg" 
  						&& newurl.substring(newurl.lastIndexOf(".")) != ".dcr" 
  						&& newurl.substring(newurl.lastIndexOf(".")) != ".avi"
						&& newurl.substring(newurl.lastIndexOf(".")) != ".pdf"
						&& newurl.substring(newurl.lastIndexOf(".")) != ".mpg"						
						);
   
   if (parent.frames.rightFrame && testForFileType != false 
   						&& newurl.indexOf("#") < 0 
						&& newurl.indexOf("$") < 0 
						&& newurl.indexOf("?") < 0)
       {
	    var rightFrameDoc = parent.frames.rightFrame
		var mySize=0
		var vAuto = "no"		
		
		rightframeTable = '<body leftmargin="0" topmargin="0" ' 
						+ ' marginwidth="0" marginheight="0" scroll="no"> '
						+ ' <table id="holder" width="100%" height="100%" border="0" bordercolor="#000000" cellspacing="0" cellpadding="0" style="position:absolute; '
						+ ' filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, '
						+ ' StartColorStr=\''
						+ gradTopBottom
						+ '\', EndColorStr=\''
						+ gradLeftRight
						+ '\')"> '
						+ ' <tr>'
						+ ' <td>'
						+ ' <div align="center" position="absolute"><img id="pic"'
						+ ' style="filter: revealtrans(duration=0.2, transition=12) '
						+ ' progid:DXImageTransform.Microsoft.dropshadow(OffX='
						+ dropDepthX
						+ ', OffY='
						+ dropDepthY
						+ ', Color=\''
						+ dropColor
						+ '\', Positive=\'true\')" '
						+ ' src="' 
						+ newurl 
						+ '"'+' border="0"><div>'
						+ ' </td>' 
						+ ' </tr>'
						+ ' </table>'
						+ ' </body>';
								
		rightFrameDoc.document.open("text/html","replace");
		rightFrameDoc.document.write(rightframeTable);
		rightFrameDoc.document.close();		
		
		
		if (SplitToFull == true)
			{
			 parent.framer3.cols="*,100%";
			 parent.frames.mainFrame.document.open("../_ROKS_MasterFiles/splitscreen_clicknext_right.htm");
			}	
						
	   }  
    else
	   {	

	   if  (newurl.indexOf('?') > 0)
	      	{ 
			
		  	 var pos2 = newurl.indexOf('?')
             var extensionChoice = newurl.substring(pos2,newurl.lastIndexOf("."))
			 
			 }
			 else
			 {
			 var extensionChoice = newurl.substring(newurl.lastIndexOf("."))
			
	        }
			
	   switch(extensionChoice)
	   {
	    case ".wmv":
		
        QueryString_Parse(newurl); 
		
		if (newurl.indexOf('?') > 0)
		{
		 newurl = newurl.substring(0,newurl.indexOf('?'));
		}   
	   
	    var muteEnable = QueryString("mute");	
			if (muteEnable == null)
				{
		 	 	 muteEnable = 1;
				}
		
		var menuEnable = QueryString("menu");	
			if (menuEnable == null)
				{
		 		 menuEnable = 0;
				}		
	   	 
		var rightFrameDoc = parent.frames.rightFrame
		var mySize=0
					
	    rightframeTable = 	'<head> \n'
		 					+ '</head> \n' 
		 					+ '<BODY leftmargin="0" topmargin="0" scroll="no"> \n'
							+ '<OBJECT ID = "MediaPlayer" STYLE = "WIDTH:100%; HEIGHT: 100%; MARGIN: 0; BORDER: 0;" CLASSID = "CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" TYPE="application/x-oleobject"> \n '
							+ '<PARAM NAME = "FileName" ' + 'VALUE = "' +  newurl + '">  \n'
							+ '<PARAM NAME = "AUTOSTART" VALUE="true">  \n'
							+ '<PARAM NAME = "AUTOREWIND" VALUE="false">  \n'
							+ '<PARAM NAME = "SHOWDISPLAY" VALUE="false">  \n'
							+ '<PARAM NAME = "PLAYCOUNT" VALUE="true"> \n'
							+ '<PARAM NAME = "SHOWCONTROLS" VALUE="true"> \n'
							//+ '<PARAM NAME = "ENABLECONTEXTMENU" VALUE="' + menuEnable + '"> \n'
							//+ '<PARAM NAME = "MUTE" VALUE="' + muteEnable + '"> \n'	
							+ '<EMBED TYPE="application/x-mplayer2"  \n'
							+ 'SRC = "' + newurl + '" \n'
							+ 'WIDTH = "100%" \n'
							+ 'HEIGHT = "100%" \n'
							+ 'AUTOSTART = "true" \n'
							+ 'AUTOREWIND = "false" \n'
							+ 'SHOWCONTROLS = "true"> \n'
							+ 'PLAYCOUNT = "true"> \n'
							//+ 'ENABLECONTEXTMENU = "' + menuEnable + '" \n'
							//+ 'MUTE = "' + muteEnable + '"> \n'
							+ '</EMBED> \n'
		            		+ '</OBJECT> \n'
							+ '</BODY>';
								
	    rightFrameDoc.document.open("text/html","replace");		
		rightFrameDoc.document.write(rightframeTable);
	 	rightFrameDoc.document.close();	
		
		if (SplitToFull == true)
			{
			parent.framer3.cols="*,100%";
			parent.frames.mainFrame.document.open("../_ROKS_MasterFiles/splitscreen_clicknext_right.htm");
			}	
		
		 		 
	 	return false;
   		break
		
		
		case ".mpg":
		
		var rightFrameDoc = parent.frames.rightFrame
		var mySize=0
					
	    rightframeTable = 	'<head> \n'
		 					+ '</head> \n' 
		 					+ '<BODY leftmargin="0" topmargin="0" scroll="no"> \n'
							+ '<OBJECT ID = "MediaPlayer" STYLE = "WIDTH:100%; HEIGHT: 100%; MARGIN: 0; BORDER: 0;" CLASSID = "CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" TYPE="application/x-oleobject"> \n '
							+ '<PARAM NAME = "FileName" ' + 'VALUE = "' +  newurl + '">  \n'
							+ '<PARAM NAME = "AUTOSTART" VALUE="true">  \n'
							+ '<PARAM NAME = "AUTOREWIND" VALUE="false">  \n'
							+ '<PARAM NAME = "SHOWDISPLAY" VALUE="false">  \n'
							+ '<PARAM NAME = "PLAYCOUNT" VALUE="true"> \n'
							+ '<PARAM NAME = "SHOWCONTROLS" VALUE="true"> \n'
							//+ '<PARAM NAME = "ENABLECONTEXTMENU" VALUE="' + menuEnable + '"> \n'
							//+ '<PARAM NAME = "MUTE" VALUE="' + muteEnable + '"> \n'	
							+ '<EMBED TYPE="application/x-mplayer2"  \n'
							+ 'SRC = "' + newurl + '" \n'
							+ 'WIDTH = "100%" \n'
							+ 'HEIGHT = "100%" \n'
							+ 'AUTOSTART = "true" \n'
							+ 'AUTOREWIND = "false" \n'
							+ 'SHOWCONTROLS = "true"> \n'
							+ 'PLAYCOUNT = "true"> \n'
							//+ 'ENABLECONTEXTMENU = "' + menuEnable + '" \n'
							//+ 'MUTE = "' + muteEnable + '"> \n'
							+ '</EMBED> \n'
		            		+ '</OBJECT> \n'
							+ '</BODY>';
								
	    rightFrameDoc.document.open("text/html","replace");		
		rightFrameDoc.document.write(rightframeTable);
	 	rightFrameDoc.document.close();	
		
		if (SplitToFull == true)
			{
			parent.framer3.cols="*,100%";
			parent.frames.mainFrame.document.open("../_ROKS_MasterFiles/splitscreen_clicknext_right.htm");
			}			
		 		 
	 	return false;
   		break
		
		
		case ".avi":
		 
		QueryString_Parse(newurl); 
		
		if (newurl.indexOf('?') > 0)
		{
		 newurl = newurl.substring(0,newurl.indexOf('?'));
		}   
	   
	    var muteEnable = QueryString("mute");	
			if (muteEnable == null)
				{
		 	 	 muteEnable = 1;
				}
		
		var menuEnable = QueryString("menu");	
			if (menuEnable == null)
				{
		 		 menuEnable = 0;
				}		
	   	 
		var rightFrameDoc = parent.frames.rightFrame
		var mySize=0
		
		
		
	    rightframeTable = 	'<head> \n'
		 					+ '</head> \n' 
		 					+ '<BODY leftmargin="0" topmargin="0" scroll="no"> \n'
							+ '<OBJECT ID = "MediaPlayer" STYLE = "WIDTH:100%; HEIGHT: 100%; MARGIN: 0; BORDER: 0;" CLASSID = "CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" TYPE="application/x-oleobject"> \n '
							+ '<PARAM NAME = "FileName" ' + 'VALUE = "' +  newurl + '">  \n'
							+ '<PARAM NAME = "AUTOSTART" VALUE="true">  \n'
							+ '<PARAM NAME = "AUTOREWIND" VALUE="false">  \n'
							+ '<PARAM NAME = "SHOWDISPLAY" VALUE="false">  \n'
							+ '<PARAM NAME = "PLAYCOUNT" VALUE="true"> \n'
							+ '<PARAM NAME = "SHOWCONTROLS" VALUE="true"> \n'
							//+ '<PARAM NAME = "ENABLECONTEXTMENU" VALUE="' + menuEnable + '"> \n'
							//+ '<PARAM NAME = "MUTE" VALUE="' + muteEnable + '"> \n'	
							+ '<EMBED TYPE="application/x-mplayer2"  \n'
							+ 'SRC = "' + newurl + '" \n'
							+ 'WIDTH = "100%" \n'
							+ 'HEIGHT = "100%" \n'
							+ 'AUTOSTART = "true" \n'
							+ 'AUTOREWIND = "false" \n'
							+ 'SHOWCONTROLS = "true"> \n'
							+ 'PLAYCOUNT = "true"> \n'
							//+ 'ENABLECONTEXTMENU = "' + menuEnable + '" \n'
							//+ 'MUTE = "' + muteEnable + '"> \n'
							+ '</EMBED> \n'
		            		+ '</OBJECT> \n'
							+ '</BODY>';
								
	    rightFrameDoc.document.open("text/html","replace");		
		rightFrameDoc.document.write(rightframeTable);
	 	rightFrameDoc.document.close();	
		
		if (SplitToFull == true)
			{
			parent.framer3.cols="*,100%";
			parent.frames.mainFrame.document.open("../_ROKS_MasterFiles/splitscreen_clicknext_right.htm");
			}	
		
		 		 
	 	return false;
   		break
		
		 case ".dwf":	
		
			if (SplitToFull == true)
			{
			parent.framer3.cols="*,100%";
			parent.frames.mainFrame.document.open("../_ROKS_MasterFiles/splitscreen_clicknext_right.htm");
			}	
		
		
	if (sTarget == null)
		{
		rightFrameDoc = parent.frames.rightFrame
		sH = rightFrameDoc.document.body.clientHeight;
	    sW = rightFrameDoc.document.body.clientWidth;				
		}
		else
		{
		sH = document.body.clientHeight;
	    sW = document.body.clientWidth;
		}			
		
		var searchStr = "%20";
		var replaceStr = " ";
		var re = new RegExp(searchStr , "g");
		var newurl = newurl.replace(re, replaceStr);
		
		var newurlX = newurl.substr(0,8);
		
		if (newurlX == "file:///")
			{
			newurl = newurl.substr(8,500);
			
			}
		
		//var searchStr = "/";
		//var replaceStr = "\\";
		//var re = new RegExp(searchStr , "g");
		//var newurl = newurl.replace(re, replaceStr);
		
	     sDraw = '<head> \n'
		 		+ '<script language="VBScript"> \n'
				+ 'function FitWindow \n'
				+ 'call AdView.Viewer.WaitForPageLoaded() \n'
				+ 'AdView.Viewer.ExecuteCommand("FITTOWINDOW") \n'
				+ 'End Function \n'
				+ '</script>'
		 		+ '</head> \n' 
		 		+ '<body onLoad="vbscript:FitWindow" leftmargin="0" topmargin="0" \n' 
				+ ' marginwidth="0" marginheight="0" scroll="no"> \n' 
		        + '<table border="0" cellpadding="0" cellspacing="0" width="100%"> \n'
			  		+ '<tr> \n'
			  		//+ '<tr> <a href="vbscript:HideToolbar"> Hide the Toolbar </a> \n'
					+ '<td align="left" width="100%"> \n'
			  		+ '</td> \n'
			  		+ '</tr> \n'
			  	+ '</table> \n'
			 + '<table border="0" cellpadding="0" cellspacing="0" width="100%"> \n'
			 + '<tr> \n'
			 + '<td align="center"> \n'
			 + '<OBJECT id="AdView" align=baseline classid="clsid:A662DA7E-CCB7-4743-B71A-D817F6D575DF" TYPE="drawing/x-dwf" '
			 + 'codebase="../_ROKS_MasterFiles/ExpressViewerSetup.cab" '
			 + 'height=' + sH 
			 + ' width=' + sW 
			 //+ ' width=' + 400
			 + ' border="0"> \n'
			 + '<param name="Src" value="' + newurl + '"> \n'
				+'</object> \n' 
			  	+'</td> \n'
			  	+ '</tr> \n'
			 +'</table> \n'
			+ '</BODY>';	
			
	
	
	if (sTarget == null)
		{
		 rightFrameDoc = parent.frames.rightFrame
		 rightFrameDoc.document.open("text/html","replace");	  
		 rightFrameDoc.document.write(sDraw);
	 	 rightFrameDoc.document.close();		
		}
		else
		{
		
		 document.open("text/html","")	  
	     document.write(sDraw);
	     document.close();
		}	

		 
		return false;
   		break
		
		
		 case ".dwg":	
		
			if (SplitToFull == true)
			{
			parent.framer3.cols="*,100%";
			parent.frames.mainFrame.document.open("../_ROKS_MasterFiles/splitscreen_clicknext_right.htm");
			}	
		
	if (sTarget == null)
		{
		rightFrameDoc = parent.frames.rightFrame
		sH = rightFrameDoc.document.body.clientHeight;
	    sW = rightFrameDoc.document.body.clientWidth;				
		}
		else
		{
		sH = document.body.clientHeight;
	    sW = document.body.clientWidth;
		}			
		
	    sDraw = '<body leftmargin="0" topmargin="0" \n' 
				+ ' marginwidth="0" marginheight="0" scroll="no"> \n' 
		        + '<table border="0" cellpadding="0" cellspacing="0" width="100%"> \n'
			  		+ '<tr> \n'
			  		+ '<td align="left" width="100%"> \n'
			  		+ '</td> \n'
			  		+ '</tr> \n'
			  	+ '</table> \n'
			 + '<table border="0" cellpadding="0" cellspacing="0" width="100%"> \n'
			 + '<tr> \n'
			 + '<td align="center"> \n'
			 
			+ '<object id="DWFMain" classid="clsid:8718C658-8956-11D2-BD21-0060B0A12A50" ' 
			+ 'width=' + sW 
			+ ' height=' + sH +'> '
			+ '<param name="src" value="' + newurl + '"> \n'
			
			+ '</object> \n'
			  	+'</td> \n'
			  	+ '</tr> \n'
			 +'</table> \n'
			+ '</BODY>';
			
	
	
	if (sTarget == null)
		{
		 rightFrameDoc = parent.frames.rightFrame
		 rightFrameDoc.document.open("text/html","replace");	  
		 rightFrameDoc.document.write(sDraw);
	 	 rightFrameDoc.document.close();		
		}
		else
		{
		
		 document.open("text/html","")	  
	     document.write(sDraw);
	     document.close();
		}	

		 
		return false;
   		break
		
		
		 case ".dxf":	
		
			if (SplitToFull == true)
			{
			parent.framer3.cols="*,100%";
			parent.frames.mainFrame.document.open("../_ROKS_MasterFiles/splitscreen_clicknext_right.htm");
			}	
		
	if (sTarget == null)
		{
		rightFrameDoc = parent.frames.rightFrame
		sH = rightFrameDoc.document.body.clientHeight;
	    sW = rightFrameDoc.document.body.clientWidth;				
		}
		else
		{
		sH = document.body.clientHeight;
	    sW = document.body.clientWidth;
		}			
		
	    sDraw = '<body leftmargin="0" topmargin="0" \n' 
				+ ' marginwidth="0" marginheight="0" scroll="no"> \n' 
		        + '<table border="0" cellpadding="0" cellspacing="0" width="100%"> \n'
			  		+ '<tr> \n'
			  		+ '<td align="left" width="100%"> \n'
			  		+ '</td> \n'
			  		+ '</tr> \n'
			  	+ '</table> \n'
			 + '<table border="0" cellpadding="0" cellspacing="0" width="100%"> \n'
			 + '<tr> \n'
			 + '<td align="center"> \n'
			 
			+ '<object id="DWFMain" classid="clsid:8718C658-8956-11D2-BD21-0060B0A12A50" ' 
			+ 'width=' + sW 
			+ ' height=' + sH +'> '
			+ '<param name="src" value="' + newurl + '"> \n'
			
			+ '</object> \n'
			  	+'</td> \n'
			  	+ '</tr> \n'
			 +'</table> \n'
			+ '</BODY>';
			
	
	
	if (sTarget == null)
		{
		 rightFrameDoc = parent.frames.rightFrame
		 rightFrameDoc.document.open("text/html","replace");	  
		 rightFrameDoc.document.write(sDraw);
	 	 rightFrameDoc.document.close();		
		}
		else
		{
		
		 document.open("text/html","")	  
	     document.write(sDraw);
	     document.close();
		}	

		 
		return false;
   		break
		
		
		 case ".swf":	
		
		if (SplitToFull == true)
			{
			parent.framer1.rows="0,*";
			parent.framer2.rows="*,0";
			parent.framer3.cols="*,100%";
			parent.frames.mainFrame.document.open("../_ROKS_MasterFiles/splitscreen_clicknext_right.htm");
			}	
		
	if (sTarget == null)
		{
		rightFrameDoc = parent.frames.rightFrame
		sH = rightFrameDoc.document.body.clientHeight;
	    sW = rightFrameDoc.document.body.clientWidth;		
		sW = "800";
		sH = "600";						
		}
		else
		{
		sH = document.body.clientHeight;
	    sW = document.body.clientWidth;
		}			
		
	    sDraw = '<head> \n'
		 		+ '<script language="JavaScript"> \n'
				+ 'function mapcontrols_exitMovie(sArg) \n'
				+ '{ \n'
				+ 'parent.frames.bottomFrame.goBack() \n'
				//+ 'alert("XXXXX"); \n'
				+ '} \n'
				+ '</script> \n'			
				+ '<script language="VBScript"> \n'
				+ 'sub mapcontrols_FSCommand(ByVal command, ByVal args) \n'
				+ 'call mapcontrols_exitMovie() \n'
				+ 'End Sub \n'
				+ '</script>'
		 		+ '</head> \n' 
		 		+'<body bgColor="696969" leftmargin="0" topmargin="0" \n' 
				+ ' marginwidth="0" marginheight="0" scroll="no"> \n' 
		        
				+ '<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"> \n'
				+ '<tr> \n'
				+ '<td align="center"> \n'
				+ '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="mapcontrols" width=' + sW + ' height=' + sH + '> \n'
    				+ '<param name="movie" value="' + newurl + '"> \n'	
					+ '<embed src="' +  newurl + '" type="application/x-shockwave-flash" vspace="0" hspace="0" align="absbottom" name="mapcontrols"> \n'
					+ 'border="0" \n'
			 		//+ 'width="' + sW + '" \n' 
					//+ 'height="' + sH + '" \n' 
			 		+ 'userinterface="off"> \n' 
    				+ '</embed> \n'
  					+ '</object> \n'
			  	+'</td> \n'
			  	+ '</tr> \n'
			 +'</table> \n'
			+ '</BODY>';			
				
	
	if (sTarget == null)
		{
		 rightFrameDoc = parent.frames.rightFrame
		 rightFrameDoc.document.open("text/html","replace");	  
		 rightFrameDoc.document.write(sDraw);
	 	 rightFrameDoc.document.close();		
		}
		else
		{
		
		 document.open("text/html","")	  
	     document.write(sDraw);
	     document.close();
		}	

		 
		return false;
   		break
		
		
		case ".dcr":	
		
		if (SplitToFull == true)
			{
			parent.framer1.rows="0,*";
			parent.framer2.rows="*,0";
			parent.framer3.cols="*,100%";
			parent.frames.mainFrame.document.open("../_ROKS_MasterFiles/splitscreen_clicknext_right.htm");
			}	
		
	if (sTarget == null)
		{
		rightFrameDoc = parent.frames.rightFrame
		sH = rightFrameDoc.document.body.clientHeight;
	    sW = rightFrameDoc.document.body.clientWidth;		
	    sW = "800";
		sH = "600";				
		}
		else
		{
		sH = document.body.clientHeight;
	    sW = document.body.clientWidth;
		}			
		
	    sDraw =  '<head> \n'
		 		+ '<script language="JavaScript"> \n'
				+ 'function escapeMovie() \n'
				+ '{ \n'
				+ 'parent.frames.bottomFrame.goBack() \n'
				//+ 'alert("XXXXX"); \n'
				+ '} \n'
				+ '</script> \n'			
				+ '<script language="VBScript"> \n'
				+ 'sub MovieName_ExternalEvent(aCommand) \n'
				//+ 'Response.Write("XXXX") \n'
				+ 'call escapeMovie() \n'
				+ 'End Sub \n'
				+ '</script>'
		 		+ '</head> \n' 
		 		+ '<body bgColor="696969" leftmargin="0" topmargin="0" \n' 
				+ ' marginwidth="0" marginheight="0" scroll="no"> \n'       
				+ '<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"> \n'
			  	+ '<tr> \n'
				+ '<td align="center" valign="middle"> \n'
			// + '<div align="center"> \n'
			 	+ '<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" name="MovieName" width="100%" height="100%"> \n'
			 	+ '<param name="src" value="' + newurl + '" > \n'	
				+ '<embed src="' +  newurl + '" type="application/x-director" name="MovieName" width="' + sW + '" height="' + sH + '"> \n'
					//+ 'border="0" \n'
			 		//+ 'width="' + sW + '" \n' 
					//+ 'height="' + sH + '" \n' 
			 		//+ 'userinterface="off"> \n' 
    				+ '</embed> \n'
  					+ '</object> \n'
					//+ '</div> \n'
			  	+'</td> \n'
			  	+ '</tr> \n'
			 +'</table> \n'
			+ '</BODY>';				
				
	
	if (sTarget == null)
		{
		 rightFrameDoc = parent.frames.rightFrame
		 rightFrameDoc.document.open("text/html","replace");	  
		 rightFrameDoc.document.write(sDraw);
	 	 rightFrameDoc.document.close();		
		}
		else
		{
		
		 document.open("text/html","")	  
	     document.write(sDraw);
	     document.close();
		}	
		 
		return false;
   		break
		
		
		case ".pdf":	
		
		if (SplitToFull == true)
			{
			parent.framer3.cols="*,100%";
			parent.frames.mainFrame.document.open("../_ROKS_MasterFiles/splitscreen_clicknext_right.htm");
			}	
		
		if (sTarget == null)
			{
			rightFrameDoc = parent.frames.rightFrame
			sH = rightFrameDoc.document.body.clientHeight;
	    	sW = rightFrameDoc.document.body.clientWidth;				
			}
		else
			{
			sH = document.body.clientHeight;
	    	sW = document.body.clientWidth;
			}			
		
			//sDraw = "<head><title>View Drawing</title></head>"
					//+ "<body onload='changelocation();'>"
					//+ "<table height='100%'><tr><td><span><font face='Arial, Helvetica, sans-serif'><br><br><b>Loading...  One Moment Please...</B></font></span></td></tr></table>"
					//+ "</body>"
					//+ "<script language='javascript'>"
					//+ "function changelocation() {"
					//+ "timer = setTimeout(\"location.href = '" + newurl +"'\",60);"
					//+ " }"
					//+ "</script>";
			
			sDraw =  '<head> \n'
		 			+ '</head> \n' 
		 			+ '<body leftmargin="0" topmargin="0" \n' 
					+ ' marginwidth="0" marginheight="0" scroll="no"> \n'       
					+ '<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"> \n'
			  		+ '<tr> \n'
					+ '<td align="center" valign="middle"> \n'
					+ '<param name="src" value="' + newurl + '" > \n'	
					+ '<embed src="' +  newurl + '" type="application/pdf" name="PDF" width="' + sW + '" height="' + sH + '"> \n'
					+ '</embed> \n'
  					+ '</object> \n'
					//+ '</div> \n'
			  		+'</td> \n'
			  		+ '</tr> \n'
			 		+'</table> \n'
					+ '</BODY>';		
								
		if (sTarget == null)
		{
		 rightFrameDoc = parent.frames.rightFrame
		 rightFrameDoc.document.open("text/html","replace");	  
		 rightFrameDoc.document.write(sDraw);
	 	 rightFrameDoc.document.close();		
		}
		else
		{		
		 document.open("text/html","")	  
	     document.write(sDraw);
	     document.close();
		}		
		
		return false;
   		break
		
		
		case ".htm":	
	   
	   }
	   	  
	   
	   if (newurl.indexOf("#") > 0 )
	    {
	   		splitURL=newurl.split("#");
			ob = parent.frames.rightFrame.window.document.getElementsByName(splitURL[1]);
            ob(0).scrollIntoView();
		}
		else
		{
			splitURL=newurl.split("$");		//look for $ for exposeHighliteLayer()
			//write_cookie ("displayLayer", splitURL[1]); 
			write_cookie ("displayLayer", newurl); 
			parent.frames.rightFrame.window.location.replace(splitURL[0]); 
			return false;
			
		}	
	}	
} /***End Function***/

/******************************************************************************
 This function will accept a URL or jpg and load it in the right frame when the
 red reference button is clicked. This new URL or jpg will replace the old one 
 and will not be added to the history list. If no right frame exists, this call
 will be ignored.
******************************************************************************/ 

function openNew(newurl,sTarget,bFull)
{

  testForFileType = (newurl.substring(newurl.lastIndexOf(".")) != ".htm" 
  						&& newurl.substring(newurl.lastIndexOf(".")) != ".swf" 
  						&& newurl.substring(newurl.lastIndexOf(".")) != ".wmv" 
  						&& newurl.substring(newurl.lastIndexOf(".")) != ".dwf" 
						&& newurl.substring(newurl.lastIndexOf(".")) != ".dxf" 
						&& newurl.substring(newurl.lastIndexOf(".")) != ".dwg" 
  						&& newurl.substring(newurl.lastIndexOf(".")) != ".dcr" 
  						&& newurl.substring(newurl.lastIndexOf(".")) != ".avi"
						&& newurl.substring(newurl.lastIndexOf(".")) != ".pdf"
						&& newurl.substring(newurl.lastIndexOf(".")) != ".mpg"
						);
   
   if (parent.frames.rightFrame && testForFileType != false 
   						&& newurl.indexOf("#") < 0 
						&& newurl.indexOf("$") < 0 
						&& newurl.indexOf("?") < 0)
       {
	  
	   
	  	if (thisCount == 1)
	 	{	
	 		correctAnswer = '  <div id="corrLayer" style="position:absolute; left:0px; top:200px;  width:100%; height:55px; z-index:1; visibility: visible"><div align="center"><img src="../Graphics_Interface/Correct.gif" width="400" height="46"></div></div>'
		}
	 	else 
	 	{
	 		correctAnswer = ''
	 	}	   	   
	   
	   
	    var rightFrameDoc = parent.frames.rightFrame
		var mySize=0
		var vAuto = "no"		
		
		rightframeTable = '<body leftmargin="0" topmargin="0" ' 
						+ ' marginwidth="0" marginheight="0" scroll="no"> '
						+ ' <table id="holder" width="100%" height="100%" border="0" bordercolor="#000000" cellspacing="0" cellpadding="0" style="position:absolute; '
						+ ' filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, '
						+ ' StartColorStr=\''
						+ gradTopBottom
						+ '\', EndColorStr=\''
						+ gradLeftRight
						+ '\')"> '
						+ ' <tr>'
						+ ' <td>'
						+ correctAnswer
						+ ' <div align="center" position="absolute"><img id="pic"'
						+ ' style="filter: revealtrans(duration=0.2, transition=12) '
						+ ' progid:DXImageTransform.Microsoft.dropshadow(OffX='
						+ dropDepthX
						+ ', OffY='
						+ dropDepthY
						+ ', Color=\''
						+ dropColor
						+ '\', Positive=\'true\')" '
						+ ' src="' 
						+ newurl 
						+ '"'+' border="0"><div>'
						+ ' </td>' 
						+ ' </tr>'
						+ ' </table>'
						+ ' </body>';
								
		rightFrameDoc.document.open("text/html","replace");
		rightFrameDoc.document.write(rightframeTable);
		rightFrameDoc.document.close();				
			
		if (SplitToFull == true)
			{
				parent.framer3.cols="*,100%";
				parent.frames.mainFrame.document.open("../_ROKS_MasterFiles/splitscreen_clicknext_right.htm");
			}	
						
	   }  
    else
	   {	

	   if  (newurl.indexOf('?') > 0)
	      	{ 
			
		  	 var pos2 = newurl.indexOf('?')
             var extensionChoice = newurl.substring(pos2,newurl.lastIndexOf("."))
			 
			 }
			 else
			 {
			 var extensionChoice = newurl.substring(newurl.lastIndexOf("."))
			
	        }
			
	   switch(extensionChoice)
	   {
	    case ".wmv":
		
        QueryString_Parse(newurl); 
		
		if (newurl.indexOf('?') > 0)
		{
		 newurl = newurl.substring(0,newurl.indexOf('?'));
		}   
	   
	    var muteEnable = QueryString("mute");	
			if (muteEnable == null)
				{
		 	 	 muteEnable = 1;
				}
		
		var menuEnable = QueryString("menu");	
			if (menuEnable == null)
				{
		 		 menuEnable = 0;
				}		
	   	 
		var rightFrameDoc = parent.frames.rightFrame
		var mySize=0
					
	    rightframeTable = 	'<head> \n'
		 					+ '</head> \n' 
		 					+ '<BODY leftmargin="0" topmargin="0" scroll="no"> \n'
							+ '<OBJECT ID = "MediaPlayer" STYLE = "WIDTH:100%; HEIGHT: 100%; MARGIN: 0; BORDER: 0;" CLASSID = "CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" TYPE="application/x-oleobject"> \n '
							+ '<PARAM NAME = "FileName" ' + 'VALUE = "' +  newurl + '">  \n'
							+ '<PARAM NAME = "AUTOSTART" VALUE="true">  \n'
							+ '<PARAM NAME = "AUTOREWIND" VALUE="false">  \n'
							+ '<PARAM NAME = "SHOWDISPLAY" VALUE="false">  \n'
							+ '<PARAM NAME = "PLAYCOUNT" VALUE="true"> \n'
							+ '<PARAM NAME = "SHOWCONTROLS" VALUE="true"> \n'
							//+ '<PARAM NAME = "ENABLECONTEXTMENU" VALUE="' + menuEnable + '"> \n'
							//+ '<PARAM NAME = "MUTE" VALUE="' + muteEnable + '"> \n'	
							+ '<EMBED TYPE="application/x-mplayer2"  \n'
							+ 'SRC = "' + newurl + '" \n'
							+ 'WIDTH = "100%" \n'
							+ 'HEIGHT = "100%" \n'
							+ 'AUTOSTART = "true" \n'
							+ 'AUTOREWIND = "false" \n'
							+ 'SHOWCONTROLS = "true"> \n'
							+ 'PLAYCOUNT = "true"> \n'
							//+ 'ENABLECONTEXTMENU = "' + menuEnable + '" \n'
							//+ 'MUTE = "' + muteEnable + '"> \n'
							+ '</EMBED> \n'
		            		+ '</OBJECT> \n'
							+ '</BODY>';
								
	    rightFrameDoc.document.open("text/html","replace");		
		rightFrameDoc.document.write(rightframeTable);
	 	rightFrameDoc.document.close();	
		
		if (SplitToFull == true)
			{
				parent.framer3.cols="*,100%";
				parent.frames.mainFrame.document.open("../_ROKS_MasterFiles/splitscreen_clicknext_right.htm");
			}	
		
		 		 
	 	return false;
   		break
		
		
		case ".mpg":
		
		var rightFrameDoc = parent.frames.rightFrame
		var mySize=0
					
	    rightframeTable = 	'<head> \n'
		 					+ '</head> \n' 
		 					+ '<BODY leftmargin="0" topmargin="0" scroll="no"> \n'
							+ '<OBJECT ID = "MediaPlayer" STYLE = "WIDTH:100%; HEIGHT: 100%; MARGIN: 0; BORDER: 0;" CLASSID = "CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" TYPE="application/x-oleobject"> \n '
							+ '<PARAM NAME = "FileName" ' + 'VALUE = "' +  newurl + '">  \n'
							+ '<PARAM NAME = "AUTOSTART" VALUE="true">  \n'
							+ '<PARAM NAME = "AUTOREWIND" VALUE="false">  \n'
							+ '<PARAM NAME = "SHOWDISPLAY" VALUE="false">  \n'
							+ '<PARAM NAME = "PLAYCOUNT" VALUE="true"> \n'
							+ '<PARAM NAME = "SHOWCONTROLS" VALUE="true"> \n'
							//+ '<PARAM NAME = "ENABLECONTEXTMENU" VALUE="' + menuEnable + '"> \n'
							//+ '<PARAM NAME = "MUTE" VALUE="' + muteEnable + '"> \n'	
							+ '<EMBED TYPE="application/x-mplayer2"  \n'
							+ 'SRC = "' + newurl + '" \n'
							+ 'WIDTH = "100%" \n'
							+ 'HEIGHT = "100%" \n'
							+ 'AUTOSTART = "true" \n'
							+ 'AUTOREWIND = "false" \n'
							+ 'SHOWCONTROLS = "true"> \n'
							+ 'PLAYCOUNT = "true"> \n'
							//+ 'ENABLECONTEXTMENU = "' + menuEnable + '" \n'
							//+ 'MUTE = "' + muteEnable + '"> \n'
							+ '</EMBED> \n'
		            		+ '</OBJECT> \n'
							+ '</BODY>';
								
	    rightFrameDoc.document.open("text/html","replace");		
		rightFrameDoc.document.write(rightframeTable);
	 	rightFrameDoc.document.close();	
		
		if (SplitToFull == true)
			{
			parent.framer3.cols="*,100%";
			parent.frames.mainFrame.document.open("../_ROKS_MasterFiles/splitscreen_clicknext_right.htm");
			}			
		 		 
	 	return false;
   		break
		
		
		case ".avi":
		 
		QueryString_Parse(newurl); 
		
		if (newurl.indexOf('?') > 0)
		{
		 newurl = newurl.substring(0,newurl.indexOf('?'));
		}   
	   
	    var muteEnable = QueryString("mute");	
			if (muteEnable == null)
				{
		 	 	 muteEnable = 1;
				}
		
		var menuEnable = QueryString("menu");	
			if (menuEnable == null)
				{
		 		 menuEnable = 0;
				}		
	   	 
		var rightFrameDoc = parent.frames.rightFrame
		var mySize=0
		
		
		
	    rightframeTable = 	'<head> \n'
		 					+ '</head> \n' 
		 					+ '<BODY leftmargin="0" topmargin="0" scroll="no"> \n'
							+ '<OBJECT ID = "MediaPlayer" STYLE = "WIDTH:100%; HEIGHT: 100%; MARGIN: 0; BORDER: 0;" CLASSID = "CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" TYPE="application/x-oleobject"> \n '
							+ '<PARAM NAME = "FileName" ' + 'VALUE = "' +  newurl + '">  \n'
							+ '<PARAM NAME = "AUTOSTART" VALUE="true">  \n'
							+ '<PARAM NAME = "AUTOREWIND" VALUE="false">  \n'
							+ '<PARAM NAME = "SHOWDISPLAY" VALUE="false">  \n'
							+ '<PARAM NAME = "PLAYCOUNT" VALUE="true"> \n'
							+ '<PARAM NAME = "SHOWCONTROLS" VALUE="true"> \n'
							//+ '<PARAM NAME = "ENABLECONTEXTMENU" VALUE="' + menuEnable + '"> \n'
							//+ '<PARAM NAME = "MUTE" VALUE="' + muteEnable + '"> \n'	
							+ '<EMBED TYPE="application/x-mplayer2"  \n'
							+ 'SRC = "' + newurl + '" \n'
							+ 'WIDTH = "100%" \n'
							+ 'HEIGHT = "100%" \n'
							+ 'AUTOSTART = "true" \n'
							+ 'AUTOREWIND = "false" \n'
							+ 'SHOWCONTROLS = "true"> \n'
							+ 'PLAYCOUNT = "true"> \n'
							//+ 'ENABLECONTEXTMENU = "' + menuEnable + '" \n'
							//+ 'MUTE = "' + muteEnable + '"> \n'
							+ '</EMBED> \n'
		            		+ '</OBJECT> \n'
							+ '</BODY>';
								
	    rightFrameDoc.document.open("text/html","replace");		
		rightFrameDoc.document.write(rightframeTable);
	 	rightFrameDoc.document.close();	
		
		if (SplitToFull == true)
			{
				parent.framer3.cols="*,100%";
				parent.frames.mainFrame.document.open("../_ROKS_MasterFiles/splitscreen_clicknext_right.htm");
			}	
		
		 		 
	 	return false;
   		break
		
		 case ".dwf":	
		
			if (SplitToFull == true)
			{
				parent.framer3.cols="*,100%";
				parent.frames.mainFrame.document.open("../_ROKS_MasterFiles/splitscreen_clicknext_right.htm");
			}	
		
		
	if (sTarget == null)
		{
		rightFrameDoc = parent.frames.rightFrame
		sH = rightFrameDoc.document.body.clientHeight;
	    sW = rightFrameDoc.document.body.clientWidth;				
		}
		else
		{
		sH = document.body.clientHeight;
	    sW = document.body.clientWidth;
		}			
		
		var searchStr = "%20";
		var replaceStr = " ";
		var re = new RegExp(searchStr , "g");
		var newurl = newurl.replace(re, replaceStr);
		
		var newurlX = newurl.substr(0,8);
		
		if (newurlX == "file:///")
			{
			newurl = newurl.substr(8,500);
			
			}
			
		//var searchStr = "/";
		//var replaceStr = "\\";
		//var re = new RegExp(searchStr , "g");
		//var newurl = newurl.replace(re, replaceStr);
			
	     sDraw = '<head> \n'
		 		+ '<script language="VBScript"> \n'
				+ 'function FitWindow \n'
				+ 'call AdView.Viewer.WaitForPageLoaded() \n'
				+ 'AdView.Viewer.ExecuteCommand("FITTOWINDOW") \n'
				+ 'End Function \n'
				+ '</script>'
		 		+ '</head> \n' 
		 		+ '<body onLoad="vbscript:FitWindow" leftmargin="0" topmargin="0" \n' 
				+ ' marginwidth="0" marginheight="0" scroll="no"> \n' 
		        + '<table border="0" cellpadding="0" cellspacing="0" width="100%"> \n'
			  		+ '<tr> \n'
			  		//+ '<tr> <a href="vbscript:HideToolbar"> Hide the Toolbar </a> \n'
					+ '<td align="left" width="100%"> \n'
			  		+ '</td> \n'
			  		+ '</tr> \n'
			  	+ '</table> \n'
			 + '<table border="0" cellpadding="0" cellspacing="0" width="100%"> \n'
			 + '<tr> \n'
			 + '<td align="center"> \n'
			 + '<OBJECT id="AdView" align=baseline classid="clsid:A662DA7E-CCB7-4743-B71A-D817F6D575DF" TYPE="drawing/x-dwf" '
			 + 'codebase="../_ROKS_MasterFiles/ExpressViewerSetup.cab" '
			 + 'height=' + sH 
			 + ' width=' + sW 
			 //+ ' width=' + 400
			 + ' border="0"> \n'
			 + '<param name="Src" value="' + newurl + '"> \n'
				+'</object> \n' 
			  	+'</td> \n'
			  	+ '</tr> \n'
			 +'</table> \n'
			+ '</BODY>';	
			
	
	
	if (sTarget == null)
		{
		 rightFrameDoc = parent.frames.rightFrame
		 rightFrameDoc.document.open("text/html","replace");	  
		 rightFrameDoc.document.write(sDraw);
	 	 rightFrameDoc.document.close();		
		}
		else
		{
		
		 document.open("text/html","")	  
	     document.write(sDraw);
	     document.close();
		}	

		 
		return false;
   		break
		
		
		 case ".dwg":	
		
			if (SplitToFull == true)
			{
				parent.framer3.cols="*,100%";
				parent.frames.mainFrame.document.open("../_ROKS_MasterFiles/splitscreen_clicknext_right.htm");
			}	
		
	if (sTarget == null)
		{
		rightFrameDoc = parent.frames.rightFrame
		sH = rightFrameDoc.document.body.clientHeight;
	    sW = rightFrameDoc.document.body.clientWidth;				
		}
		else
		{
		sH = document.body.clientHeight;
	    sW = document.body.clientWidth;
		}			
		
	    sDraw = '<body leftmargin="0" topmargin="0" \n' 
				+ ' marginwidth="0" marginheight="0" scroll="no"> \n' 
		        + '<table border="0" cellpadding="0" cellspacing="0" width="100%"> \n'
			  		+ '<tr> \n'
			  		+ '<td align="left" width="100%"> \n'
			  		+ '</td> \n'
			  		+ '</tr> \n'
			  	+ '</table> \n'
			 + '<table border="0" cellpadding="0" cellspacing="0" width="100%"> \n'
			 + '<tr> \n'
			 + '<td align="center"> \n'
			 
			+ '<object id="DWFMain" classid="clsid:8718C658-8956-11D2-BD21-0060B0A12A50" ' 
			+ 'width=' + sW 
			+ ' height=' + sH +'> '
			+ '<param name="src" value="' + newurl + '"> \n'
			
			+ '</object> \n'
			  	+'</td> \n'
			  	+ '</tr> \n'
			 +'</table> \n'
			+ '</BODY>';
			
	
	
	if (sTarget == null)
		{
		 rightFrameDoc = parent.frames.rightFrame
		 rightFrameDoc.document.open("text/html","replace");	  
		 rightFrameDoc.document.write(sDraw);
	 	 rightFrameDoc.document.close();		
		}
		else
		{
		
		 document.open("text/html","")	  
	     document.write(sDraw);
	     document.close();
		}	

		 
		return false;
   		break
		
		
		 case ".dxf":	
		
			if (SplitToFull == true)
			{
				parent.framer3.cols="*,100%";
				parent.frames.mainFrame.document.open("../_ROKS_MasterFiles/splitscreen_clicknext_right.htm");
			}	
		
	if (sTarget == null)
		{
		rightFrameDoc = parent.frames.rightFrame
		sH = rightFrameDoc.document.body.clientHeight;
	    sW = rightFrameDoc.document.body.clientWidth;				
		}
		else
		{
		sH = document.body.clientHeight;
	    sW = document.body.clientWidth;
		}			
		
	    sDraw = '<body leftmargin="0" topmargin="0" \n' 
				+ ' marginwidth="0" marginheight="0" scroll="no"> \n' 
		        + '<table border="0" cellpadding="0" cellspacing="0" width="100%"> \n'
			  		+ '<tr> \n'
			  		+ '<td align="left" width="100%"> \n'
			  		+ '</td> \n'
			  		+ '</tr> \n'
			  	+ '</table> \n'
			 + '<table border="0" cellpadding="0" cellspacing="0" width="100%"> \n'
			 + '<tr> \n'
			 + '<td align="center"> \n'
			 
			+ '<object id="DWFMain" classid="clsid:8718C658-8956-11D2-BD21-0060B0A12A50" ' 
			+ 'width=' + sW 
			+ ' height=' + sH +'> '
			+ '<param name="src" value="' + newurl + '"> \n'
			
			+ '</object> \n'
			  	+'</td> \n'
			  	+ '</tr> \n'
			 +'</table> \n'
			+ '</BODY>';
			
	
	
	if (sTarget == null)
		{
		 rightFrameDoc = parent.frames.rightFrame
		 rightFrameDoc.document.open("text/html","replace");	  
		 rightFrameDoc.document.write(sDraw);
	 	 rightFrameDoc.document.close();		
		}
		else
		{
		
		 document.open("text/html","")	  
	     document.write(sDraw);
	     document.close();
		}	

		 
		return false;
   		break
		
		
		 case ".swf":	
		
		if (SplitToFull == true)
			{
			parent.framer1.rows="0,*";
			parent.framer2.rows="*,0";
			parent.framer3.cols="*,100%";
			parent.frames.mainFrame.document.open("../_ROKS_MasterFiles/splitscreen_clicknext_right.htm");
			}	
		
	if (sTarget == null)
		{
		rightFrameDoc = parent.frames.rightFrame
		sH = rightFrameDoc.document.body.clientHeight;
	    sW = rightFrameDoc.document.body.clientWidth;		
		sW = "800";
		sH = "600";						
		}
		else
		{
		sH = document.body.clientHeight;
	    sW = document.body.clientWidth;
		}			
		
	    sDraw = '<head> \n'
		 		+ '<script language="JavaScript"> \n'
				+ 'function mapcontrols_exitMovie(sArg) \n'
				+ '{ \n'
				+ 'parent.frames.bottomFrame.goBack() \n'
				//+ 'alert("XXXXX"); \n'
				+ '} \n'
				+ '</script> \n'			
				+ '<script language="VBScript"> \n'
				+ 'sub mapcontrols_FSCommand(ByVal command, ByVal args) \n'
				+ 'call mapcontrols_exitMovie() \n'
				+ 'End Sub \n'
				+ '</script>'
		 		+ '</head> \n' 
		 		+'<body bgColor="696969" leftmargin="0" topmargin="0" \n' 
				+ ' marginwidth="0" marginheight="0" scroll="no"> \n' 
		        
				+ '<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"> \n'
				+ '<tr> \n'
				+ '<td align="center"> \n'
				+ '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="mapcontrols" width=' + sW + ' height=' + sH + '> \n'
    				+ '<param name="movie" value="' + newurl + '"> \n'	
					+ '<embed src="' +  newurl + '" type="application/x-shockwave-flash" vspace="0" hspace="0" align="absbottom" name="mapcontrols"> \n'
					+ 'border="0" \n'
			 		//+ 'width="' + sW + '" \n' 
					//+ 'height="' + sH + '" \n' 
			 		+ 'userinterface="off"> \n' 
    				+ '</embed> \n'
  					+ '</object> \n'
			  	+'</td> \n'
			  	+ '</tr> \n'
			 +'</table> \n'
			+ '</BODY>';			
				
	
	if (sTarget == null)
		{
		 rightFrameDoc = parent.frames.rightFrame
		 rightFrameDoc.document.open("text/html","replace");	  
		 rightFrameDoc.document.write(sDraw);
	 	 rightFrameDoc.document.close();		
		}
		else
		{
		
		 document.open("text/html","")	  
	     document.write(sDraw);
	     document.close();
		}	

		 
		return false;
   		break
		
		
		case ".dcr":	
		
		if (SplitToFull == true)
			{
			parent.framer1.rows="0,*";
			parent.framer2.rows="*,0";
			parent.framer3.cols="*,100%";
			parent.frames.mainFrame.document.open("../_ROKS_MasterFiles/splitscreen_clicknext_right.htm");
			}	
		
	if (sTarget == null)
		{
		rightFrameDoc = parent.frames.rightFrame
		sH = rightFrameDoc.document.body.clientHeight;
	    sW = rightFrameDoc.document.body.clientWidth;		
	    sW = "800";
		sH = "600";				
		}
		else
		{
		sH = document.body.clientHeight;
	    sW = document.body.clientWidth;
		}			
		
	    sDraw =  '<head> \n'
		 		+ '<script language="JavaScript"> \n'
				+ 'function escapeMovie() \n'
				+ '{ \n'
				+ 'parent.frames.bottomFrame.goBack() \n'
				//+ 'alert("XXXXX"); \n'
				+ '} \n'
				+ '</script> \n'			
				+ '<script language="VBScript"> \n'
				+ 'sub MovieName_ExternalEvent(aCommand) \n'
				//+ 'Response.Write("XXXX") \n'
				+ 'call escapeMovie() \n'
				+ 'End Sub \n'
				+ '</script>'
		 		+ '</head> \n' 
		 		+ '<body bgColor="696969" leftmargin="0" topmargin="0" \n' 
				+ ' marginwidth="0" marginheight="0" scroll="no"> \n'       
				+ '<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"> \n'
			  	+ '<tr> \n'
				+ '<td align="center" valign="middle"> \n'
			// + '<div align="center"> \n'
			 	+ '<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" name="MovieName" width=800 height=600> \n'
			 	+ '<param name="src" value="' + newurl + '" > \n'	
				+ '<embed src="' +  newurl + '" type="application/x-director" name="MovieName" width="' + sW + '" height="' + sH + '"> \n'
					//+ 'border="0" \n'
			 		//+ 'width="' + sW + '" \n' 
					//+ 'height="' + sH + '" \n' 
			 		//+ 'userinterface="off"> \n' 
    				+ '</embed> \n'
  					+ '</object> \n'
					//+ '</div> \n'
			  	+'</td> \n'
			  	+ '</tr> \n'
			 +'</table> \n'
			+ '</BODY>';				
				
	
	if (sTarget == null)
		{
		 rightFrameDoc = parent.frames.rightFrame
		 rightFrameDoc.document.open("text/html","replace");	  
		 rightFrameDoc.document.write(sDraw);
	 	 rightFrameDoc.document.close();		
		}
		else
		{
		
		 document.open("text/html","")	  
	     document.write(sDraw);
	     document.close();
		}	
		 
		return false;
   		break
		
		
		case ".pdf":	
		
		if (SplitToFull == true)
			{
			parent.framer3.cols="*,100%";
			parent.frames.mainFrame.document.open("../_ROKS_MasterFiles/splitscreen_clicknext_right.htm");
			}	
		
		if (sTarget == null)
			{
			rightFrameDoc = parent.frames.rightFrame
			sH = rightFrameDoc.document.body.clientHeight;
	    	sW = rightFrameDoc.document.body.clientWidth;				
			}
		else
			{
			sH = document.body.clientHeight;
	    	sW = document.body.clientWidth;
			}			
		
			//sDraw = "<head><title>View Drawing</title></head>"
					//+ "<body onload='changelocation();'>"
					//+ "<table height='100%'><tr><td><span><font face='Arial, Helvetica, sans-serif'><br><br><b>Loading...  One Moment Please...</B></font></span></td></tr></table>"
					//+ "</body>"
					//+ "<script language='javascript'>"
					//+ "function changelocation() {"
					//+ "timer = setTimeout(\"location.href = '" + newurl +"'\",60);"
					//+ " }"
					//+ "</script>";
			
			sDraw =  '<head> \n'
		 			+ '</head> \n' 
		 			+ '<body leftmargin="0" topmargin="0" \n' 
					+ ' marginwidth="0" marginheight="0" scroll="no"> \n'       
					+ '<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"> \n'
			  		+ '<tr> \n'
					+ '<td align="center" valign="middle"> \n'
					+ '<param name="src" value="' + newurl + '" > \n'	
					+ '<embed src="' +  newurl + '" type="application/pdf" name="PDF" width="' + sW + '" height="' + sH + '"> \n'
					+ '</embed> \n'
  					+ '</object> \n'
					//+ '</div> \n'
			  		+'</td> \n'
			  		+ '</tr> \n'
			 		+'</table> \n'
					+ '</BODY>';		
					
								
		if (sTarget == null)
		{
		 rightFrameDoc = parent.frames.rightFrame
		 rightFrameDoc.document.open("text/html","replace");	  
		 rightFrameDoc.document.write(sDraw);
	 	 rightFrameDoc.document.close();		
		}
		else
		{		
		 document.open("text/html","")	  
	     document.write(sDraw);
	     document.close();
		}		
		
		return false;
   		break
		
		
		case ".htm":	
	   
	   }	   	   
	   
	   if (newurl.indexOf("#") > 0 )
	    {
	   		splitURL=newurl.split("#");
			ob = parent.frames.rightFrame.window.document.getElementsByName(splitURL[1]);
            ob(0).scrollIntoView();
		}
		else
		{
			
			splitURL=newurl.split("$");		//look for $ for exposeHighliteLayer()
			//alert(splitURL[0]);
			write_cookie ("displayLayer", newurl); 
			parent.frames.rightFrame.window.location.replace(splitURL[0]); 
			//alert("replacing right frame");
			return false; 
			
		}			
	
	}
} /***End Function***/

/******************************************************************************
 This function must be called at the bottom of an htm file with layers to expose.
 The click event from the procedure uses openNew to write a cookie saving the 
 target layer id.  the target id in the procudure must use an $ deliminator between
 the file and the layer name.
 
 This function reads the cookie "displayLayer".  
 
 if the cookie returns undefined, then this will point to a layer with the id="main"
******************************************************************************/ 

function exposeHighliteLayer()
{
//alert("exposeHighliteLayer");
if (parent.frames.rightFrame)
{		
		var rightFrameDoc = parent.frames.rightFrame;
		
		if (rightFrameDoc.document.getElementById("main") == null) {return false;}
		LayerToShow = read_cookie ("displayLayer");
				
		if (LayerToShow == null) {return false;}
	
		LayerToShow = LayerToShow.split("$");
			
		if (escape(LayerToShow[1]) == "undefined")
		{
			collObjects = parent.frames.rightFrame.document.getElementsByName("main");
			showLayer (collObjects);
		}
		else
		{
			for (i=1;i<LayerToShow.length;i++)
			{
				collObjects = parent.frames.rightFrame.document.getElementsByName(LayerToShow[i]);
				if (escape(collObjects[0]) == "undefined") {alert ("layer " + LayerToShow[i] + " does not exist, check your link.");return false;}
				showLayer (collObjects);
			}
		}
}
}

function showLayer (collObjects)
{
//alert("showLayer"); 
		var rightFrameDoc = parent.frames.rightFrame;
		var myHeight=0;
		var myWidth=0;
			
		if (SplitToFull == true && thisCount == 0)
			{
			thisCount = 1;
			parent.framer3.cols="*,100%"; 
			parent.frames.mainFrame.document.open("../_ROKS_MasterFiles/splitscreen_clicknext_right.htm"); 
			}			
		
		windowHeight = rightFrameDoc.document.body.clientHeight ;
	   	windowWidth = rightFrameDoc.document.body.clientWidth ;
		mainLayer= rightFrameDoc.document.getElementsByName("main");
		mainPic= rightFrameDoc.document.getElementsByName("mainpic");
				
		if (windowHeight > mainPic(0).height)
		{
			mainLayer(0).style.top = (windowHeight - mainPic(0).height) / 2;
		}
		else
		{
			
			if (!autoCenter)
			{
			mainLayer(0).style.top = 0;
			}
			else
			{
			
			if (((windowHeight - parseInt(collObjects(0).style.height)) / 2) < parseInt(collObjects(0).style.top))
			{
			
			mainLayer(0).style.top = ((windowHeight - parseInt(collObjects(0).style.height)) / 2) - parseInt(collObjects(0).style.top);
			}
			else
			{
			
			//mainLayer(0).style.top = - parseInt(collObjects(0).style.top);
			mainLayer(0).style.top = 0;
			} 
			}
		}
		
		if (windowWidth > mainPic(0).width)
		{
			mainLayer(0).style.left = (windowWidth - mainPic(0).width) / 2;
			
		}
		else
		{
			
			if (!autoCenter)
			{
				mainLayer(0).style.left = 0;
			}
			else
			{
			if (((windowWidth - parseInt(collObjects(0).style.width)) / 2) < parseInt(collObjects(0).style.left))
			{
			mainLayer(0).style.left = ((windowWidth - parseInt(collObjects(0).style.width)) / 2) - parseInt(collObjects(0).style.left);
			}
			else
			{
			//alert('l');
			//mainLayer(0).style.left = - parseInt(collObjects(0).style.left);
			mainLayer(0).style.left = 0;
			}
			}
		}
		
		
		
		collObjects(0).style.visibility='visible';
		//alert(collObjects);
		mainLayer(0).style.visibility='visible';
		delete_cookie ("displayLayer");
		return false;

	 
} /***End Function***/

function verifyTitle(sTitle)
{
	
//if (sTitle.length > 200)
    //{
    // sTitle=sTitle.substring(0,200) + "...";
	//}

	var w = parent.frames.mainFrame.document.body.clientWidth -65
	//var w = parent.frames.mainFrame.document.body.clientWidth -10
	
		
		var fakeTitle = '<body bgcolor="#003399" text="#000000" leftmargin="0" topmargin="0" scroll="no">'
				  + '<table valign="top" id="tBar"  width="100%" height="25" border="0" cellpadding="6" cellspacing="0" bgcolor="#003399" nowrap> '
				  + '<tr >'
              	  + '<td width="' + w + '" bgcolor="#003399" bordercolor="#003399" nowrap>'
				  + '<font style="font-family: Arial; font-size: 13px; text-decoration: none; color: #FFFFFF">' 
				  + sTitle + '</td>'
  				  + '<td  width="65" height="25" align="center" valign="top" bgcolor="#003399"  nowrap><font id = "stepCounter" '
				  + 'style="font-family: Arial; font-size: 13px; text-decoration: none; color: #FFFF00">'
				  + '</td>'
				  + '</tr>'
				  + '</table>' 
				  + '</body>'								
   
   //frameStyle = document.getElementById("frameType");
   getMETAData()
   
  frameStyle = dispProp[0]
  titleFramevisible = eval(dispProp[1])
     	
   if (frameStyle != null)
     {
      sframeVal = frameStyle
     }
	 
 // titleFramevisible = document.getElementById("titleBar");  
  if (titleFramevisible != null)
	{
   if (titleFramevisible)
	 {
  		parent.frames.titleFrame.document.write(fakeTitle);
	 }	
	}

} /***End Function***/

function savePosition()
{
 write_cookie (fileNameFromURL(document.location.href)+"exit_scrollTop", document.body.scrollTop);
} /***End Function***/

function attachUnload()
{
window.attachEvent("onbeforeunload", savePosition);
} /***End Function***/

function displayDrawing(paramx)
{
 newurl = unescape(paramx.nxt);
  
   if  (newurl.indexOf('?') > 0)
	      	{ 
		  	 var pos2 = newurl.indexOf('?')
             var extensionChoice = newurl.substring(pos2,newurl.lastIndexOf("."))
			 }
			 else
			 {
			 var extensionChoice = newurl.substring(newurl.lastIndexOf("."))
	        }
			
	   switch(extensionChoice)
	   {
	   
case ".wmv":

        QueryString_Parse(newurl); 

		if (newurl.indexOf('?') > 0)
		{
		 newurl = newurl.substring(0,newurl.indexOf('?'));
		 
		}   
	 
	    var muteEnable = QueryString("mute");	
		 
			if (muteEnable == null)
				{
		 	 	 muteEnable = 1;
				}
			
		
		var menuEnable = QueryString("menu");	
			if (menuEnable == null)
				{
		 		 menuEnable = 0;
				}		
	   	
		var newTitle = QueryString("title");	
			if (newTitle == null)
				{
		 	 	 newTitle = "View Video"
				} 
				else
				{
				 newTitle = QueryString("title");
				}
			
		
	    sWMV = '<html><head><title>' + newTitle																												
							+ '</title></head> \n'
							+ '<script FOR=window EVENT=onblur> \n'
						    +'self.focus(); \n'
							+ '</script> \n'
							+ '<script FOR=window EVENT=onload> \n'
							+ ' if (document.readyState=="complete") \n'
							+ '{ \n'
						    +'MediaPlayer.height=document.body.clientHeight; \n'
							+ 'mainlyr.width=document.body.clientWidth \n'
							+ 'mainlyr.height=document.body.clientHeight \n'
							+ 'mainlyr.style.visibility="visible" \n'
							+ ' } \n'
							+ '</script> \n'
							+ '<script FOR=window EVENT=onresize> \n'	
							+ ' if (document.readyState=="complete") \n'
							+ '{ \n'	
							+ 'loadMess.style.visibility="hidden" \n'
							+'MediaPlayer.height=document.body.clientHeight-25; \n'
							+ ' } \n'
							+ '</script> \n'
		                    + '<BODY leftmargin="0" topmargin="0" scroll="no"> \n'
							+ '<DIV id="mainlyr" style="visibility:hidden; position:absolute; z-index:220"> \n '
							+ '<OBJECT ID = "MediaPlayer" STYLE = "WIDTH:100%;  MARGIN: 0; BORDER: 0;" CLASSID = "CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" TYPE="application/x-oleobject"> \n '
							+ '<PARAM NAME = "FileName" ' + 'VALUE = "' +  newurl + '">  \n'
							+ '<PARAM NAME = "AUTOSTART" VALUE="true">  \n'
							+ '<PARAM NAME = "AUTOREWIND" VALUE="false">  \n'
							+ '<PARAM NAME = "SHOWDISPLAY" VALUE="false">  \n'
							+ '<PARAM NAME = "PLAYCOUNT" VALUE="true"> \n'
							+ '<PARAM NAME = "SHOWCONTROLS" VALUE="true"> \n' 
							+ '<EMBED TYPE="application/x-mplayer2"  \n'
							+ 'SRC = "' + newurl + '" \n'
							+ 'WIDTH = "100%" \n'
							//+ 'HEIGHT = "100%" \n'
							+ 'AUTOSTART = "true" \n'
							+ 'AUTOREWIND = "false" \n'
							+ 'SHOWCONTROLS = "true"> \n'
							+ 'PLAYCOUNT = "true"> \n'
							+ '</EMBED> \n'
		            		+ '</OBJECT> \n'
							+ '</DIV> \n '
							+ '</BODY> ';
										
		var loadg = '<div id="loadMess" class="RO_Menu_Header" z-index:290">Loading...Please Wait.</div>'
		win2 = open('','title', 'resizable=1 toolbar=0,location=0,status=0,menubar=0,scrollbars=0,titlebar=no, width=500, height=405 left='+ ((window.screen.width/2)-250) +' top=' + ((window.screen.height/2)-200) );
	    win2.document.write(sWMV);
		win2.document.write(loadg);
		win2.document.close();	
		win2.document.focus();		
		
	 	return false;
   		break


case ".mpg":

        QueryString_Parse(newurl); 

		if (newurl.indexOf('?') > 0)
		{
		 newurl = newurl.substring(0,newurl.indexOf('?'));
		 
		}   
	 
	    var newTitle = QueryString("title");	
			if (newTitle == null)
				{
		 	 	 newTitle = "View Video"
				} 
				else
				{
				 newTitle = QueryString("title");
				}
			
		
	    sMPG = '<html><head><title>' + newTitle																												
							+ '</title></head> \n'
							+ '<script FOR=window EVENT=onblur> \n'
						    +'self.focus(); \n'
							+ '</script> \n'
							+ '<script FOR=window EVENT=onload> \n'
							+ ' if (document.readyState=="complete") \n'
							+ '{ \n'
						    +'MediaPlayer.height=document.body.clientHeight; \n'
							+ 'mainlyr.width=document.body.clientWidth \n'
							+ 'mainlyr.height=document.body.clientHeight \n'
							+ 'mainlyr.style.visibility="visible" \n'
							+ ' } \n'
							+ '</script> \n'
							+ '<script FOR=window EVENT=onresize> \n'	
							+ ' if (document.readyState=="complete") \n'
							+ '{ \n'	
							+ 'loadMess.style.visibility="hidden" \n'
							+'MediaPlayer.height=document.body.clientHeight-25; \n'
							+ ' } \n'
							+ '</script> \n'
		                    + '<BODY leftmargin="0" topmargin="0" scroll="no"> \n'
							+ '<DIV id="mainlyr" style="visibility:hidden; position:absolute; z-index:220"> \n '
							+ '<OBJECT ID = "MediaPlayer" STYLE = "WIDTH:100%;  MARGIN: 0; BORDER: 0;" CLASSID = "CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" TYPE="application/x-oleobject"> \n '
							+ '<PARAM NAME = "FileName" ' + 'VALUE = "' +  newurl + '">  \n'
							+ '<PARAM NAME = "AUTOSTART" VALUE="true">  \n'
							+ '<PARAM NAME = "AUTOREWIND" VALUE="false">  \n'
							+ '<PARAM NAME = "SHOWDISPLAY" VALUE="false">  \n'
							+ '<PARAM NAME = "PLAYCOUNT" VALUE="true"> \n'
							+ '<PARAM NAME = "SHOWCONTROLS" VALUE="true"> \n' 
							+ '<EMBED TYPE="application/x-mplayer2"  \n'
							+ 'SRC = "' + newurl + '" \n'
							+ 'WIDTH = "100%" \n'
							//+ 'HEIGHT = "100%" \n'
							+ 'AUTOSTART = "true" \n'
							+ 'AUTOREWIND = "false" \n'
							+ 'SHOWCONTROLS = "true"> \n'
							+ 'PLAYCOUNT = "true"> \n'
							+ '</EMBED> \n'
		            		+ '</OBJECT> \n'
							+ '</DIV> \n '
							+ '</BODY> ';
										
		var loadg = '<div id="loadMess" class="RO_Menu_Header" z-index:290">Loading...Please Wait.</div>'
		win2 = open('','title', 'resizable=1 toolbar=0,location=0,status=0,menubar=0,scrollbars=0,titlebar=no, width=500, height=405 left='+ ((window.screen.width/2)-250) +' top=' + ((window.screen.height/2)-200) );
	    win2.document.write(sMPG);
		win2.document.write(loadg);
		win2.document.close();	
		win2.document.focus();		
		
	 	return false;
   		break
		
		
case ".avi":

       QueryString_Parse(newurl); 

		if (newurl.indexOf('?') > 0)
		{
		 newurl = newurl.substring(0,newurl.indexOf('?'));
		 
		}   
	 
	    var muteEnable = QueryString("mute");	
			if (muteEnable == null)
				{
		 	 	 muteEnable = 1;
				}
		
		var menuEnable = QueryString("menu");	
			if (menuEnable == null)
				{
		 		 menuEnable = 0;
				}		
	   	
		var newTitle = QueryString("title");	
			if (newTitle == null)
				{
		 	 	 newTitle = "View Video"
				} 
				else
				{
				 newTitle = QueryString("title");
				}
				
		 
		sAVI = '<html><head><title>' + newTitle																												
							+ '</title></head> \n'
							+ '<script FOR=window EVENT=onblur> \n'
						    +'self.focus(); \n'
							+ '</script> \n'
							+ '<script FOR=window EVENT=onload> \n'
							+ ' if (document.readyState=="complete") \n'
							+ '{ \n'
						    +'MediaPlayer.height=document.body.clientHeight; \n'
							+ 'mainlyr.width=document.body.clientWidth \n'
							+ 'mainlyr.height=document.body.clientHeight \n'
							+ 'mainlyr.style.visibility="visible" \n'
							+ ' } \n'
							+ '</script> \n'
							+ '<script FOR=window EVENT=onresize> \n'	
							+ ' if (document.readyState=="complete") \n'
							+ '{ \n'	
							+ 'loadMess.style.visibility="hidden" \n'
							+'MediaPlayer.height=document.body.clientHeight-25; \n'
							+ ' } \n'
							+ '</script> \n'
		                    + '<BODY leftmargin="0" topmargin="0" scroll="no"> \n'
							+ '<DIV id="mainlyr" style="visibility:hidden; position:absolute; z-index:220"> \n '
							+ '<OBJECT ID = "MediaPlayer" STYLE = "WIDTH:100%;  MARGIN: 0; BORDER: 0;" CLASSID = "CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" TYPE="application/x-oleobject"> \n '
							+ '<PARAM NAME = "FileName" ' + 'VALUE = "' +  newurl + '">  \n'
							+ '<PARAM NAME = "AUTOSTART" VALUE="true">  \n'
							+ '<PARAM NAME = "AUTOREWIND" VALUE="false">  \n'
							+ '<PARAM NAME = "SHOWDISPLAY" VALUE="false">  \n'
							+ '<PARAM NAME = "PLAYCOUNT" VALUE="true"> \n'
							+ '<PARAM NAME = "SHOWCONTROLS" VALUE="true"> \n' 
							+ '<EMBED TYPE="application/x-mplayer2"  \n'
							+ 'SRC = "' + newurl + '" \n'
							+ 'WIDTH = "100%" \n'
							//+ 'HEIGHT = "100%" \n'
							+ 'AUTOSTART = "true" \n'
							+ 'AUTOREWIND = "false" \n'
							+ 'SHOWCONTROLS = "true"> \n'
							+ 'PLAYCOUNT = "true"> \n'
							+ '</EMBED> \n'
		            		+ '</OBJECT> \n'
							+ '</DIV> \n '
							+ '</BODY> ';
										
		var loadg = '<div id="loadMess" class="RO_Menu_Header" z-index:290">Loading...Please Wait.</div>'
		win2 = open('','title', 'resizable=1 toolbar=0,location=0,status=0,menubar=0,scrollbars=0,titlebar=no, width=500, height=405 left='+ ((window.screen.width/2)-250) +' top=' + ((window.screen.height/2)-200) );
	    win2.document.write(sAVI);
		win2.document.write(loadg);
		win2.document.close();	
		win2.document.focus();		
		
	 	return false;
   		break
		
case ".dwf":	
		
		sH = '400'
	    sW = '500'
		
		var searchStr = "%20";
		var replaceStr = " ";
		var re = new RegExp(searchStr , "g");
		var newurl = newurl.replace(re, replaceStr);
		
		var newurlX = newurl.substr(0,8);
		
		if (newurlX == "file:///")
			{
			newurl = newurl.substr(8,500);
			
			}
		
		//var searchStr = "/";
		//var replaceStr = "\\";
		//var re = new RegExp(searchStr , "g");
		//var newurl = newurl.replace(re, replaceStr);
		
		sDWF = '<html><head><title>Drawing</title> \n'
							+'</head> \n'
							+ '<link rel="stylesheet" href="../StyleSheets/RedOakStyleSheet.css"> \n'		
							+ '<script FOR=window EVENT=onblur> \n'
						         +'self.focus(); \n'
							+ '</script> \n'
							+ '<script FOR=window EVENT=onload> \n'
						         +'AdView.height=document.body.clientHeight-25; \n'
								 +'AdView.width=document.body.clientWidth; \n'
								 +'FitWindow(); \n'
							+ '</script> \n'
							+ '<script FOR=window EVENT=onresize> \n'
						         +'AdView.height=document.body.clientHeight-25; \n'
								 +'AdView.width=document.body.clientWidth; \n'
							+ '</script> \n'
							+ '<script language="VBScript"> \n'
							+ 'function FitWindow \n'
							+ 'call AdView.Viewer.WaitForPageLoaded() \n'
							+ 'AdView.Viewer.ExecuteCommand("FITTOWINDOW") \n'
							+ 'End Function \n'
							+ '</script>'
							+ '<BODY leftmargin="0" topmargin="0" scroll="no" bgcolor="#CCCCCC"> \n'

							+ '<table align="center" width="40%" height="25" border="1" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC"> \n'
    						+ '<tr> \n'
      						//+ '<td width="33%"><div style = "border-style:outset" align="center"><a class="RO_Click_for_procedure" href="#" onclick = "drawingHolder.SetUserInterface(0); drawingHolder.CursorMode(4);">ZOOM RECTANGLE</a></div></td> \n'
      						//+ '<td width="50%"><div style = "border-style:outset" align="center"><a class="RO_Click_for_procedure" href="#" onclick = "AdView.PrintCurrentView();">PRINT DRAWING</a></div></td> \n'
      						+ '<td width="30%"><div style = "border-style:outset" align="center"><a class="RO_Click_for_procedure" href="#" onclick = "self.close();">CLOSE WINDOW</a></div></td> \n'
    						+ '</tr> \n'
							+ '</table> \n'	

							+ '<DIV id="mainlyr" style="position:absolute; width:100%; z-index:0"> \n '
                    //+ '<OBJECT ID = "drawingHolder" classid="clsid:B2BE75F3-9197-11CF-ABF4-08000996E931" TYPE="drawing/x-dwf"' 
							+ '<OBJECT id="AdView" align=baseline classid="clsid:A662DA7E-CCB7-4743-B71A-D817F6D575DF" TYPE="drawing/x-dwf" '
						 	+ 'codebase="../_ROKS_MasterFiles/ExpressViewerSetup.cab" '
			 				//+ 'CODEBASE="../_ROKS_masterfiles/whip.cab#version=4,0,42,93" '
			 				+ 'height=' + sH
			 				//+ 'name=drawingHolder '
			 				+ ' width=' + sW
							+ ' border="2"> \n'
			 				+ '<param name="Src" value="' + newurl + '"> \n'
					//+ '<EMBED SRC="' +  newurl + '" \n'  
			 			//+ 'border="0" \n'
			 			//+ 'width="' + sW + '" \n' 
			 			//+ 'height="' + sH + '" \n' 
			 			//+ 'userinterface="on"> \n' 
					//+ '</EMBED> \n'
			       + '</OBJECT> \n'
					
					+ '</DIV> \n '
					+ '</BODY> ';		
		
		win2 = open('','title', 'resizable=1 toolbar=0,location=0,status=0,menubar=0,scrollbars=0,titlebar=no, width=500, height=430 left='+ ((window.screen.width/2)-250) +' top=' + ((window.screen.height/2)-200) );
	    win2.document.write(sDWF);
		win2.document.close();	
		win2.document.focus();		 
		
		return false;
   		break

		
case ".dxf":	
		
		sH = '400'
	    sW = '500'
		
		sDXF = '<html><head><title>Drawing</title></head> \n'
							+ '<link rel="stylesheet" href="../StyleSheets/RedOakStyleSheet.css"> \n'		
							+ '<script FOR=window EVENT=onblur> \n'
						         +'self.focus(); \n'
							+ '</script> \n'
							+ '<script FOR=window EVENT=onload> \n'
						         +'drawingHolder.height=document.body.clientHeight-25; \n'
								 +'drawingHolder.width=document.body.clientWidth; \n'
							+ '</script> \n'
							+ '<script FOR=window EVENT=onresize> \n'
						         +'drawingHolder.height=document.body.clientHeight-25; \n'
								 +'drawingHolder.width=document.body.clientWidth; \n'
							+ '</script> \n'
		                    + '<BODY leftmargin="0" topmargin="0" scroll="no" bgcolor="#CCCCCC"> \n'
							+ '<DIV id="mainlyr" style="position:absolute; width:100%; z-index:0"> \n '
                    + '<OBJECT ID = "drawingHolder" classid="clsid:8718C658-8956-11D2-BD21-0060B0A12A50" TYPE="image/vnd.dxf" ' 
			 				//+ 'CODEBASE="../_ROKS_masterfiles/whip.cab#version=4,0,42,93" '
			 				+ 'height=' + sH
			 				+ 'name=drawingHolder '
			 				+ 'width=' + sW
			 				+ 'border="2"> \n'
			 				+ '<param name="SRC" value="' + newurl + '"> \n'
				+ '<EMBED SRC="' +  newurl + '" \n'  
			 			+ 'border="0" \n'
			 			+ 'width="' + sW + '" \n' 
			 			+ 'height="' + sH + '" \n' 
			 			+ 'userinterface="on"> \n' 
				+ '</EMBED> \n'	
					+ '</OBJECT> \n'
					+ '<table width="100%" height="25" border="2" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC"> \n'
    					+ '<tr> \n'
      					//+ '<td width="33%"><div style = "border-style:outset" align="center"><a class="RO_Click_for_procedure" href="#" onclick = "drawingHolder.SetUserInterface(0); drawingHolder.CursorMode(4);">ZOOM RECTANGLE</a></div></td> \n'
      					+ '<td width="50%"><div style = "border-style:outset" align="center"><a class="RO_Click_for_procedure" href="#" onclick = "drawingHolder.ShowPrintDialog();">PRINT DRAWING</a></div></td> \n'
      					+ '<td width="50%"><div style = "border-style:outset" align="center"><a class="RO_Click_for_procedure" href="#" onclick = "self.close();">CLOSE WINDOW</a></div></td> \n'
    					+ '</tr> \n'
  					+ '</table> \n'	
					+ '</DIV> \n '
					+ '</BODY> ';		
		
		win2 = open('','title', 'resizable=1 toolbar=0,location=0,status=0,menubar=0,scrollbars=0,titlebar=no, width=500, height=405 left='+ ((window.screen.width/2)-250) +' top=' + ((window.screen.height/2)-200) );
	    win2.document.write(sDXF);
		win2.document.close();	
		win2.document.focus();		 
			 
		return false;
   		break

		
case ".dwg":	
		
		sH = '400'
	    sW = '500'
		
		sDWG = '<html><head><title>Drawing</title></head> \n'
							+ '<link rel="stylesheet" href="../StyleSheets/RedOakStyleSheet.css"> \n'		
							+ '<script FOR=window EVENT=onblur> \n'
						         +'self.focus(); \n'
							+ '</script> \n'
							+ '<script FOR=window EVENT=onload> \n'
						         +'drawingHolder.height=document.body.clientHeight-25; \n'
								 +'drawingHolder.width=document.body.clientWidth; \n'
							+ '</script> \n'
							+ '<script FOR=window EVENT=onresize> \n'
						         +'drawingHolder.height=document.body.clientHeight-25; \n'
								 +'drawingHolder.width=document.body.clientWidth; \n'
							+ '</script> \n'
		                    + '<BODY leftmargin="0" topmargin="0" scroll="no" bgcolor="#CCCCCC"> \n'
							+ '<DIV id="mainlyr" style="position:absolute; width:100%; z-index:0"> \n '
                    + '<OBJECT ID = "drawingHolder" classid="clsid:8718C658-8956-11D2-BD21-0060B0A12A50" TYPE="image/vnd.dwg" ' 
			 				//+ 'CODEBASE="../_ROKS_masterfiles/whip.cab#version=4,0,42,93" '
			 				+ 'height=' + sH
			 				+ 'name=drawingHolder '
			 				+ 'width=' + sW
			 				+ 'border="2"> \n'
			 				+ '<param name="SRC" value="' + newurl + '"> \n'
				+ '<EMBED SRC="' +  newurl + '" \n'  
			 			+ 'border="0" \n'
			 			+ 'width="' + sW + '" \n' 
			 			+ 'height="' + sH + '" \n' 
			 			+ 'userinterface="on"> \n' 
				+ '</EMBED> \n'	
					+ '</OBJECT> \n'
					+ '<table width="100%" height="25" border="2" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC"> \n'
    					+ '<tr> \n'
      					//+ '<td width="33%"><div style = "border-style:outset" align="center"><a class="RO_Click_for_procedure" href="#" onclick = "drawingHolder.SetUserInterface(0); drawingHolder.CursorMode(4);">ZOOM RECTANGLE</a></div></td> \n'
      					+ '<td width="50%"><div style = "border-style:outset" align="center"><a class="RO_Click_for_procedure" href="#" onclick = "drawingHolder.ShowPrintDialog();">PRINT DRAWING</a></div></td> \n'
      					+ '<td width="50%"><div style = "border-style:outset" align="center"><a class="RO_Click_for_procedure" href="#" onclick = "self.close();">CLOSE WINDOW</a></div></td> \n'
    					+ '</tr> \n'
  					+ '</table> \n'	
					+ '</DIV> \n '
					+ '</BODY> ';		
		
		win2 = open('','title', 'resizable=1 toolbar=0,location=0,status=0,menubar=0,scrollbars=0,titlebar=no, width=500, height=405 left='+ ((window.screen.width/2)-250) +' top=' + ((window.screen.height/2)-200) );
	    win2.document.write(sDWG);
		win2.document.close();	
		win2.document.focus();		 
			 
		return false;
   		break
				

case ".swf":
    
	sH = '400'
	sW = '500'
	
	var sSWF = '<html><head><title>Shockwave Movie</title></head> \n'
       			+ '<link rel="stylesheet" href="../StyleSheets/RedOakStyleSheet.css"> \n'
	           	+ '<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" scroll="no"> \n'
				+ '<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF"> \n'

					  + '<tr> \n'
      				  //+ '<td bgcolor="#CCCCCC"><div style = "border-style:outset" align="center"><a href="#">SAVE</a></div></td> \n'
      				  + '<td width="50%" bgcolor="#CCCCCC"><div style = "border-style:outset" align="center"> \n'
					  + '<a class="RO_Click_for_procedure" href="#" onclick = "thisPrint()">PRINT</a></div></td> \n'
      				  + '<td width="50%"  bgcolor="#CCCCCC"><div style = "border-style:outset" align="center"> \n'
					  + '<a class="RO_Click_for_procedure" href="#" onclick = "self.close();">CLOSE WINDOW</a></div></td> \n'
    				  + '</tr> \n'

				   +' <tr> \n'
                      +' <td colspan="3" height="100%"> \n'
                      + '<div align="center"> \n'					 
					  + '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width=' + sW + ' height=' + sH + '> \n'
    				  + '<param name="movie" value="' + newurl + '"> \n'	
					  + '<embed src="' +  newurl + '" type="application/x-shockwave-flash" > \n'
					  + 'border="0" \n'
			 		  //+ 'width="' + sW + '" \n' 
					  //+ 'height="' + sH + '" \n' 
			 		  + 'userinterface="off"> \n' 
    				  + '</embed> \n'
  					  + '</object> \n'
					  + '</div> \n'
                      + '</td> \n'
                      + '<tr> \n'
    				
					
                      + '</table> \n'					
				+ '</body> \n'
				+ '</html>';	    
	
	    win2 = open('','title', 'resizable=1 toolbar=0,location=0,status=0,menubar=0,scrollbars=0,titlebar=no, width=500, height=430 left='+ ((window.screen.width/2)-250) +' top=' + ((window.screen.height/2)-200) );
	    win2.document.write(sSWF);
	    win2.document.close();	
		win2.document.focus();	
		
		return false;
   		break
		
case ".dcr":
    
	sH = '400'
	sW = '500'
	
	var sDCR = '<html><head><title>Shockwave Movie (DCR)</title></head> \n'
       			+ '<link rel="stylesheet" href="../StyleSheets/RedOakStyleSheet.css"> \n'
	           	+ '<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" scroll="no"> \n'
				+ '<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF"> \n'

					 + '<tr> \n'
    				  + '<tr> \n'
      				  //+ '<td bgcolor="#CCCCCC"><div style = "border-style:outset" align="center"><a href="#">SAVE</a></div></td> \n'
      				  + '<td width="50%" bgcolor="#CCCCCC"><div style = "border-style:outset" align="center"> \n'
					  + '<a class="RO_Click_for_procedure" href="#" onclick = "thisPrint()">PRINT</a></div></td> \n'
      				  + '<td width="50%"  bgcolor="#CCCCCC"><div style = "border-style:outset" align="center"> \n'
					  + '<a class="RO_Click_for_procedure" href="#" onclick = "self.close();">CLOSE WINDOW</a></div></td> \n'
    				  + '</tr> \n'

				   +' <tr> \n'
                      +' <td colspan="3" height="100%"> \n'
                      + '<div align="center"> \n'					 
					  + '<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" width=' + sW + ' height=' + sH + '> \n'
    				  + '<param name="src" value="' + newurl + '"> \n'	
					  + '<embed src="' +  newurl + '" type="application/x-director" > \n'
					  + 'border="0" \n'
			 		  //+ 'width="' + sW + '" \n' 
					  //+ 'height="' + sH + '" \n' 
			 		  + 'userinterface="off"> \n' 
    				  + '</embed> \n'
  					  + '</object> \n'
					  + '</div> \n'
                      + '</td> \n'
               
                      + '</table> \n'					
				+ '</body> \n'
				+ '</html>';	    
	
	    win2 = open('','title', 'resizable=1 toolbar=0,location=0,status=0,menubar=0,scrollbars=0,titlebar=no, width=500, height=430 left='+ ((window.screen.width/2)-250) +' top=' + ((window.screen.height/2)-200) );
	    win2.document.write(sDCR);
	    win2.document.close();	
		win2.document.focus();	
		
		return false;
   		break		
		
		
case ".jpg":
    
	
	    
	var sJPEG= '<html><head><title>Graphic</title></head> \n'
       			+ '<link rel="stylesheet" href="../StyleSheets/RedOakStyleSheet.css"> \n'
	            + '<script> \n'
				 + 'function thisPrint() \n'
				+ '{\n'
				+ 'isPrinting = 1; \n'
				+ 'self.print(); \n'
				+ 'return false; \n'
			    + '}\n'
				+ '</script> \n'
				+ '<script FOR=window EVENT=onblur> \n'
				+ 'if (!isPrinting == 1) \n' 
				+ '{ \n'
				+ 'self.focus(); \n'
				+ 'return false; \n'
				+ '} \n'
				+ 'isPrinting = 0; \n' 
				+ '</script> \n'
				+ '<script FOR=window EVENT=onprint> \n'
				+ 'alert(); \n'
				+ '</script> \n'
				+ '<script FOR=window EVENT=onload> \n'
				+ 'isPrinting = 0; \n'
				+ '</script> \n'				
				+ '<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" scroll="no"> \n'
				+ '<table width="100%" height="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="#CCCCCC"> \n'
				   +' <tr> \n'
					 + '<tr> \n'
      				  //+ '<td bgcolor="#CCCCCC"><div style = "border-style:outset" align="center"><a href="#">SAVE</a></div></td> \n'
      				  + '<td width="50%" bgcolor="#CCCCCC"><div style = "border-style:outset" align="center"> \n'
					  + '<a class="RO_Click_for_procedure" href="#" onclick = "thisPrint()">PRINT GRAPHIC</a></div></td> \n'
      				  + '<td width="50%"  bgcolor="#CCCCCC"><div style = "border-style:outset" align="center"> \n'
					  + '<a class="RO_Click_for_procedure" href="#" onclick = "self.close();">CLOSE WINDOW</a></div></td> \n'
    				  + '</tr> \n'	
                      +' <td colspan="3" height="100%"> \n'
                      + '<div align="center"> \n'
					  + '<img  src = "' + newurl + '"> \n'  
					  + '</div> \n'
                      + '</td> \n'
                      + '</tr> \n'
                      + '<tr> \n'
    				 
  				+ '</table> \n'					
				+ '</body> \n'
				+ '</html>';
	    win2 = open('','title', 'resizable=1 toolbar=0,location=0,status=0,menubar=0,scrollbars=0,titlebar=no, width=500, height=600 left='+ ((window.screen.width/2)-250) +' top=' + ((window.screen.height/2)-300) );
	    win2.document.write(sJPEG);
	    win2.document.close();	
		win2.document.focus();	
		
		return false;
   		break
		
case ".gif":
        
	var sGIF= '<html><head><title>Graphic</title></head> \n'
       			+ '<link rel="stylesheet" href="../StyleSheets/RedOakStyleSheet.css"> \n'
	            + '<script> \n'
				 + 'function thisPrint() \n'
				+ '{\n'
				+ 'isPrinting = 1; \n'
				+ 'self.print(); \n'
				+ 'return false; \n'
			    + '}\n'
				+ '</script> \n'
				+ '<script FOR=window EVENT=onblur> \n'
				+ 'if (!isPrinting == 1) \n' 
				+ '{ \n'
				+ 'self.focus(); \n'
				+ 'return false; \n'
				+ '} \n'
				+ 'isPrinting = 0; \n' 
				+ '</script> \n'
				+ '<script FOR=window EVENT=onprint> \n'
				+ 'alert(); \n'
				+ '</script> \n'
				+ '<script FOR=window EVENT=onload> \n'
				+ 'isPrinting = 0; \n'
				+ '</script> \n'				
				+ '<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" scroll="no"> \n'
				+ '<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC"> \n'

					 + '<tr> \n'
      				  //+ '<td bgcolor="#CCCCCC"><div style = "border-style:outset" align="center"><a href="#">SAVE</a></div></td> \n'
      				  + '<td width="50%" bgcolor="#CCCCCC"><div style = "border-style:outset" align="center"> \n'
					  + '<a class="RO_Click_for_procedure" href="#" onclick = "thisPrint()">PRINT GRAPHIC</a></div></td> \n'
      				  + '<td width="50%"  bgcolor="#CCCCCC"><div style = "border-style:outset" align="center"> \n'
					  + '<a class="RO_Click_for_procedure" href="#" onclick = "self.close();">CLOSE WINDOW</a></div></td> \n'
    				  + '</tr> \n'

				   +' <tr> \n'
                      +' <td colspan="3" height="100%"> \n'
                      + '<div align="center"> \n'
					  + '<img  src = "' + newurl + '"> \n'  
					  + '</div> \n'
                      + '</td> \n'
                      + '</tr> \n'
                      + '<tr> \n'
    				 
  				+ '</table> \n'					
				+ '</body> \n'
				+ '</html>';
	    win2 = open('','title', 'resizable=1 toolbar=0,location=0,status=0,menubar=0,scrollbars=0,titlebar=no, width=500, height=540 left='+ ((window.screen.width/2)-250) +' top=' + ((window.screen.height/2)-280) );
	    win2.document.write(sGIF);
	    win2.document.close();	
		win2.document.focus();	
		
		return false;
   		break

case ".pdf":	
		
		win2 = open('','title', 'resizable=1 left=0 top=0');
		win2.document.open("text/html","replace");
	
		var sPDF = "<html><head><title>View Drawing</title></head>"
					+ "<body onload='changelocation();'>"
					+ "<table height='100%'><tr><td><span><font face='Arial, Helvetica, sans-serif'><br><br><b>Loading...  One Moment Please...</B></font></span></td></tr></table>"
					+ "</body>"
					+ "<script language='javascript'>"
					+ "function changelocation() {"
					+ "self.focus();"
					+ "timer = setTimeout(\"location.href = '" + newurl +"'\",60);"
					+ " }"
					+ "</script></html>";
				
		win2.document.write(sPDF);
		win2.document.close();
		
		return false;
   		break
		
		
case ".htm":	
		
	   }	 
	   if (newurl.indexOf("#") > 0 )
	    {
	   		splitURL=newurl.split("#");
			ob = parent.frames.rightFrame.window.document.getElementsByName(splitURL[1]);
            ob(0).scrollIntoView();
		}
		else
		{
			splitURL=newurl.split("$");		//look for $ for exposeHighliteLayer()
			write_cookie ("displayLayer", newurl); 
			parent.frames.rightFrame.window.location.replace(splitURL[0]); 
			return false;
		}			
		 

} /***End Function***/


//**************** FUNCTIONS FOR TBT PAGES ****************//
function prepPage()
{	
	//********** Run function to Find all Tables with id="tbAnswers" *********//
	var linkTables = getLikeElements("table", "id", "tbAnswers");
	
	//********** loop through collection of linkTables and make all tables hidden **********//
	for (i=0;i<linkTables.length;i++)
		{
			linkTables[i].style.visibility="hidden";
		}
	

	//********** Run function to Find all Tables with id="tbStep" *********//
	var stepTables = getLikeElements("table", "id", "tbStep");	
	
	
	//********** loop through collection of stepTables **********//
	for (i=0;i<stepTables.length;i++)
		{
			stepsInTable = stepTables[i].rows.length;
			var getRowsArray = [];
		
			for (j=0;j<stepsInTable;j++)
				{
					var theRow = (stepTables[i].rows[j].outerHTML);
					getRowsArray.push(theRow);															
				}

			scrambleRows(getRowsArray);
			var newTbArray = (getRowsArray[0] + getRowsArray[1] + getRowsArray[2]);
			//alert(newTbArray);
			tbody = stepTables[i];
			drawTable(tbody, getRowsArray);
			//tbody = document.getElementById("tbBody");
			//drawTable("tbBody", getRowsArray, passTable);
			
			stepTables[i].bgcolor="#FFFFFF";
			stepTables[i].border="0";
			//stepTables[i].cellPadding="24";			
			//stepTables[i].style.textIndent="-25";	
			//return false;			
			
		}	

}

function scrambleRows(getRowsArray)
{	
	var randNumber = Math.round((Math.random() * 100));
		if (randNumber > 0 && randNumber < 33)
		{
		getRowsArray.reverse();
		}
		if (randNumber > 33 && randNumber < 66)
		{
		getRowsArray.sort();
		} 	
}


function drawTable(tbody, getRowsArray, passTable)
{
	var tr, td;
    //tbody = document.getElementById(tbody);
	clearTable(tbody, getRowsArray);
   	
    for (var l = 0; l < getRowsArray.length; l++) 
		{
		tr = tbody.insertRow(tbody.rows.length, 0);
        td = tr.insertCell(tr.cells.length);
        //td.setAttribute("padding-left", "30");
		td.innerHTML = getRowsArray[l];  
		}	
	//alert(tbody.innerHTML);
}

function clearTable(tbody, getRowsArray) 
{
	//alert("clearTable");
		for (var k = 0; k < getRowsArray.length; k++) 
		{
        tbody.deleteRow(0);
		}
}

function getLikeElements(tagName, attrName, attrValue) 
{
	//alert("getLikeElements");
	var startSet;
    var endSet = new Array( );
   
	if (tagName) 
		{
        startSet = document.getElementsByTagName(tagName);    
    	} 
	else 
		{
        startSet = (document.all) ? document.all : 
        document.getElementsByTagName("*");
    	}

	if (attrName) 
		{
        for (var i = 0; i < startSet.length; i++) 
			{
            if (startSet[i].getAttribute(attrName)) 
				{
                if (attrValue) 
					{
                    if (startSet[i].getAttribute(attrName) == attrValue) 
						{
                        endSet[endSet.length] = startSet[i];
                    	}
                	} 
				else 
					{
                    endSet[endSet.length] = startSet[i];
                	}
            	}
        	}
    	} 
	else 
		{
        endSet = startSet;
    	}

return endSet;

}


function processForm(frm, formName, groupName, booleanDisabled)
{
	
	checkSelect = "";
	sAnswer = "";
	//getAnswer(formName, 'answers');

	btn = document.forms[frm].all.Button;
	
		if (btn.value =="Click here for Next Question")
			{
			nextStep();
			btn.style.visibility="hidden";
			return false;
			}		
	
	nData = document.forms[frm].all.answer;
	nTotals = parent.frames.mainFrame.document.all.answer;
	totalCorrect = read_cookie ("correct_answers");
			 
		if (totalCorrect == null)
			{
			totalCorrect = 0;
        	write_cookie ("correct_answers", totalCorrect);
			}

	//correctAnswer = sAnswer;
	//answerSelected = false; 

//-----------------------------------Here It Is!!-------------------------------------
 		for (var i=0 ;i<nData.length;i++)
			{
			 
			 if (nData(i).checked)
                	{	
					var nTable = document.forms[frm].all.tbAnswers;
					var nTableLinks = nTable.all.tags("a");
					thisCount = 1;
					
					if (nData(i).value == "correct")
						{
						var nTableLinksHref = (nTableLinks[1].outerHTML.split(">"));
						nTableLinksHref = nTableLinksHref[0];
						//alert(nTableLinksHref);
						var nTableHrefLast = unescape(nTableLinksHref.substring(nTableLinksHref.lastIndexOf("\/"),nTableLinksHref.length-1));
						//alert(nTableHrefLast);
						var nTableHrefFirst = nTableLinksHref.split("\/"); 	
						var nTableHrefFirst = nTableHrefFirst[nTableHrefFirst.length-2];
						//alert(nTableHrefFirst);
						var nTableNewHref = "../" + nTableHrefFirst + nTableHrefLast;
						//alert(nTableNewHref); 
						openNew(nTableNewHref);
						btn.value ="Click here for Next Question"
						}
					else
						{
						var nTableLinksHref = (nTableLinks[2].outerHTML.split(">"));
						nTableLinksHref = nTableLinksHref[0];
						//alert(nTableLinksHref);
						var nTableHrefLast = unescape(nTableLinksHref.substring(nTableLinksHref.lastIndexOf("\/"),nTableLinksHref.length-1));
						//alert(nTableHrefLast);
						var nTableHrefFirst = nTableLinksHref.split("\/"); 	
						var nTableHrefFirst = nTableHrefFirst[nTableHrefFirst.length-2];
						//alert(nTableHrefFirst);
						var nTableNewHref = "../" + nTableHrefFirst + nTableHrefLast;
						//alert(nTableNewHref); 
						openNew(nTableNewHref);
						//openNew("../Pages_Right_Frames/Incorrect_1.htm");
						btn.value ="Click here for Next Question"
						write_cookie ("correct_answers", parseInt(totalCorrect) + 1);	
						}					
							
     					disableGroup(formName, groupName, booleanDisabled);	
						if (ValnextStep == parent.frames.mainFrame.document.all.tags("li").length)
							{
							btn.style.visibility="hidden";
							writeTable();
						}						
	 				return false;
					}

			} //End for
	alert("You have not selected an answer. Please click on a radio button to select an answer and then click on the Submit button."); 
	return false;

}


//****** Disable Radio Buttons in Current Step
function disableGroup(formName, groupName, booleanDisabled) 
{
	for (var i=0; i<formName.elements.length; i++)
	{
    	if (formName.elements[i].name == groupName) 
		{
    	formName.elements[i].disabled = booleanDisabled;
		
    	}
	}
}

//****** Loop through buttons to find value of hidden field named 'answers'
//****** THIS IS NOT NEEDED ANYMORE.
function getAnswer(formName, groupName, imageName) 
{
	for (var i=0; i<formName.elements.length; i++)
	{
    	if (formName.elements[i].name == groupName) 
		{		
			if (formName.elements[i].value != "")
			{
				sAnswer = (formName.elements[i].value);
				return true;
			}						
		}				
	}
}
	

//****** Write Last Name, Quiz Title, # of Questions, Correct answers into bottom form
function writeTable()
{
	document.frmTrack.reset;
	var inpTitle = document.getElementById("name");
	var thisTitle = parent.frames.mainFrame.document.title;
	var inpNumber = document.getElementById("number");
	var thisNumber = parent.frames.mainFrame.document.all.tags("li").length;
	var inpCorrect = document.getElementById("correct");
	var totalCorrect = read_cookie ("correct_answers");
	var totals = (totalCorrect);
	var thisCorrect = thisNumber - totals;
	var inpDate = document.getElementById("date");
	var inpTime = document.getElementById("time");
	var inpScore = document.getElementById("score");
	var theScore = Math.round((thisCorrect / thisNumber) * 100 ); 
	//alert(theScore);
	var thisScore = (theScore + "%")
	var inpHTML = document.getElementById("writeHTML");

	var date = new Date();
	var d  = date.getDate();
	var day = (d < 10) ? '0' + d : d;
	var m = date.getMonth() + 1;
	var month = (m < 10) ? '0' + m : m;
	var yy = date.getYear();
	var year = (yy < 1000) ? yy + 1900 : yy;
	var thisDate = (month + "/" + day + "/" + year);

	var hr = date.getHours();
	var minute = date.getMinutes();
	var sec = date.getSeconds();
	//If the hour is greater than or equal to 12, set
	//AMPM equal to "PM." Set AMPM equal to "AM" otherwise.
	var AMPM = (hr >= 12) ? "PM" : "AM";
	//If the hour is greater than 12, set hr = to hr - 12
	//to retrieve the current time for a 12-hour clock.
	if (hr > 12) hr -= 12;
	//If the hour equals zero, it's midnight, so set
	//hr equal to twelve.
	if (hr == 0) hr = 12;
	//If the minutes or seconds are less than ten, add
	//a zero in the tens place.
	if (minute < 10) minute = "0" + minute;
	if (sec < 10) sec = "0" + sec;
	thisTime = (hr + ":" + minute + ":" + sec + " " + AMPM); 

	inpTitle.insertAdjacentText("afterbegin",thisTitle);
	inpNumber.insertAdjacentText("afterbegin",thisNumber);
	inpCorrect.insertAdjacentText("afterbegin",thisCorrect);
	inpDate.insertAdjacentText("afterbegin",thisDate);
	inpTime.insertAdjacentText("afterbegin",thisTime);
	inpScore.insertAdjacentText("afterbegin",thisScore);
	inpHTML.insertAdjacentHTML("afterbegin",'<hr><div align="center">This Module is Complete.</div><br><div align="center"><a href="#" onClick="history.back()" class="RO_Command_Button_Red">Click here to go Back.</a></div>');
}


/////////////////END OF TBT FUNCTIONS////////////////////

/******************************************************************************
I moved this function from Note.js. I want to remove Note.js completely from the
JavaScripts folder. This function is not being referenced anymore because I
has to switch to another search function. But I am not sure yet how to edit the bottom
control bar so that I dont get error related to this function.
******************************************************************************/ 

function getLastSearch()
{
sSearch=read_cookie('lastSearch');
if (sSearch != null) 
	{
	//write_cookie('lastHighlight',sSearch);
	return sSearch;
	}
	
}  /***End Function***/


/******************************************************************************
/******************************************************************************
/ START NOTES FUNCIONS 
/******************************************************************************
/******************************************************************************

/******************************************************************************
populateNotes() This function is called after the Frame Builder functions at top of this file.
				This function will pass the Querystring to NotePopulateFrame.asp 
				This function only runs when project is run through web server and when
				there is a Control Bar selected for the page.
******************************************************************************/ 
function populateNotes()
{    

	getMETAData();
	No_Bottom_Controlbar = eval(dispProp[5])
	//alert(No_Bottom_Controlbar);
	
	if (location.href.substr(0,7) != "file://" & No_Bottom_Controlbar == false)
	{
		
		var hrefLast = escape(location.href.substring(location.href.lastIndexOf("\/"),location.href.length));
		var hrefFirst = location.href.split("\/"); 
		var hrefFirst = hrefFirst[hrefFirst.length-2];
		var newHref = "../" + hrefFirst + hrefLast;
		//alert(newHref);
		parent.frames.bottomFrame.NotePopulateFrame.document.location.replace("../_controlbar_bottom/NotePopulateFrame.asp?dbHref=" +  (newHref)); 
	}


} /***End Function***/

/******************************************************************************
setCommentScroll(visibleStep) -- This function is activated in "click NEXT" procedures
to show notes in the visible steps and hide notes in the hidden steps.
******************************************************************************/ 
function setCommentScroll(visibleStep)
{    

//alert("setCommentScroll");

	scrollMultiplier = currentVisibleHeight();
	allSpans = document.all.tags("div")
	//alert(scrollMultiplier);
	for (i=0;i<allSpans.length;i++)
	{
		//alert(allSpans[i].className);
		if (allSpans[i].className == "noteIcon")
		{
			
			 if (parseInt(allSpans[i].style.top) > (scrollMultiplier))
			 {
			 	//alert(scrollMultiplier);
			 	allSpans[i].style.visibility = 'hidden'
			 }
			 else
			 {
			 	//alert("visible");
			 	allSpans[i].style.visibility = 'visible'
			 }
		}
	}
} /***End Function***/

/******************************************************************************
currentVisibleHeight() -- This function calculates the scrollMultiplier value that
is used in the setCommentScroll function to determine whether to show or hide notes
in a "click NEXT" procedure.
******************************************************************************/
function currentVisibleHeight()
{

//alert("currentVisibleHeight");

    allSpans = document.all.tags("div")
	
    if (allSpans.length != 0) 
    {
        for (i=0;i<allSpans.length;i++)
    	{
	        	if (allSpans[i].className == "noteIcon")
		      {
                      	if (allSpans[i].deleteTag != "Yes")
			            {
                  		}
			  }
        }
    }	

	if (totalOutline.length == 0 || !cList ){return document.body.length;}
	totalProcedures = document.all.tags("li")
  	offsetVal = document.body.scrollHeight - totalOutline[0].scrollHeight - ((postOutlineBreaks - numBR_roksForm) * 40) - redoakTableheight;
	//offsetVal = document.body.scrollHeight - totalOutline[0].scrollHeight - redoakTableheight;
	 	
 	scrollMultiplier=offsetVal;
	//alert(scrollMultiplier);
	for (var stepIndex=0; stepIndex < totalProcedures.length; stepIndex++)
	{  
		 if (totalProcedures[stepIndex].style.visibility == 'visible')
		 	scrollMultiplier = (scrollMultiplier+totalProcedures[stepIndex].scrollHeight);
	
	}
	
	return scrollMultiplier;
} /***End Function***/

/******************************************************************************
displayNewCommentIcon() -- This function is called from the loadScript() function as follows:
document.body.attachEvent(onmousedown). When the user clicks on the page to select the area 
of the page to place the note, the values from an array in the function updateNote()
of "Note_Add.htm" are passed into this function. The values from the array are extracted and then
passed to NoteManageFrame.asp as a querystring.
******************************************************************************/ 
function displayNewCommentIcon()
{

var newQueryString  = ""

	NoteList[6] = (window.event.clientX-20 );
	NoteList[7] = (window.event.clientY + document.body.scrollTop)-(20 + titleBarHeight);
		
	newQueryString = "Name=" + NoteList[0] + "&" 
				   + "Date=" + NoteList[1] + "&" 
				   + "Note=" + NoteList[2] + "&" 
				   + "Page=" + NoteList[3] + "&" 
				   + "Time=" + NoteList[4] + "&" 
				   + "Title=" + NoteList[5] + "&"
				   + "Xpos=" + NoteList[6] + "&"
				   + "Ypos=" + NoteList[7] ;  
		
	if (newCommentID != 0 && readyForComment == 1)
	{
      readyForComment = 0;
		if (currentVisibleHeight() < window.event.offsetY && cList)
		{
			alert('Cannot place note there.  Try again.');
			readyForComment = 1;
		}
		else
		{
		
            window.event.srcElement.focus();
			parent.frames.bottomFrame.NoteManageFrame.document.location.replace("../_controlbar_bottom/NoteManageFrame.asp?" +  unescape(newQueryString));
						
			newCommentID = 0
			//refreshCommentIcons();
			
			document.body.style.cursor = "default"
			
			if (oModal != null)
				{
				  oModal.close();
				
				}
			
		  }
	}
} /***End Function***/


/******************************************************************************
NoteDelete() -- This function is called from the deleteNote() function from Note_Display.htm
******************************************************************************/ 
function NoteDelete(NoteID)
{
//alert("Note Delete in Redoak.js" + NoteID); 

var newQueryString  = ""

	newQueryString = "NoteID=" + NoteID;
	//window.event.srcElement.focus();
	parent.frames.bottomFrame.NoteManageFrame.document.location.replace("../_controlbar_bottom/NoteManageFrame.asp?" +  unescape(newQueryString));  
	parent.top.location.reload();
	//oModal.close();
//return false;

}


/******************************************************************************
NoteEdit() -- This function is called from the editNote() function from Note_Display.htm
******************************************************************************/ 
function NoteEdit(NoteID, fdNote)
{
//alert("Note Delete in Redoak.js" + NoteID); 

var newQueryString  = ""

	newQueryString = "noteEditID=" + NoteID + "&" 
				   + "noteEdit=" + fdNote;
	//alert(newQueryString);
	//window.event.srcElement.focus();
	parent.frames.bottomFrame.NoteManageFrame.document.location.replace("../_controlbar_bottom/NoteManageFrame.asp?" +  unescape(newQueryString));  
	parent.top.location.reload();
	//oModal.close();
//return false;

}

/******************************************************************************
NoteMove() -- This function is called from the mouseup function in RedOak.js.
This function is called after a Note is moved on a page and the mouse is 
released to establish the new tack position.
******************************************************************************/ 
function NoteMove(commentID, lLeft, lTop)
{

//alert("NoteMove function ID " + commentID + " Left " + lLeft + " Top " + lTop); 

var NoteID = commentID;
var newXPos = lLeft;
var newYPos = lTop;

var newQueryString  = ""

	newQueryString = "noteMoveID=" + NoteID + "&" 
				   + "newXPos=" + newXPos + "&"
				   + "newYPos=" + newYPos;
				   
		   
		//window.event.srcElement.focus();
		parent.frames.bottomFrame.NoteManageFrame.document.location.replace("../_controlbar_bottom/NoteManageFrame.asp?" +  unescape(newQueryString));  
		parent.top.location.reload();
		//oModal.close();
		//return false;
		

}
/******************************************************************************
addNewComment()
******************************************************************************/ 
function addNewComment()
{

//alert("addNewComment");

	// Adding a N in front of the Comment ID passed to the add comment window
	// will interpret the comment as a 'new' comment and begin in add mode
	displayComment("N");
	newCommentID = parseInt(FindCommentCounter()) + 1;
	//alert("newcommentID = " + newCommentID);
} /***End Function***/

/******************************************************************************
FindCommentCounter()
******************************************************************************/ 
function FindCommentCounter()
{

//alert("FindCommentCounter");

	strCookie = document.cookie
	
	arrayCookies = strCookie.split(';')
	 
	for (i=0;i<arrayCookies.length;i++)
	{
		cookieField=arrayCookies[i].split("=")
		if (cookieField[0].indexOf("CCID") != -1)
		{
			return cookieField[1]
		}
	}
	newCookie = "CCID=0;expires=Thursday, 31-Dec-20 12:00:00 GMT;"
	document.cookie = newCookie;
	return 0;	
} /***End Function***/



/******************************************************************************
displayComment(commentID) -- This function is run when adding a note (Note_Add.htm is launched)
and when viewing a note (Note_Display.htm is launched). 
******************************************************************************/
function displayComment(commentID,sName,sDate,sComment)
{

//alert("displayComment");

    var sUserName="temp";  
	viewComment = 1;
	
	newCookie = "CWStatus=1;expires=Thursday, 31-Dec-20 12:00:00 GMT;"
	
	document.cookie = newCookie;
	
	if (commentID == "N")
	{
	
	//alert(document.location.href);
	var hrefLast = escape(location.href.substring(location.href.lastIndexOf("\/"),location.href.length));
	var hrefFirst = location.href.split("\/"); 
	var hrefFirst = hrefFirst[hrefFirst.length-2];
	//alert(hrefFirst);
	var newHref = "../" + hrefFirst + hrefLast;
	//alert(newHref);
		
	
	var lVariables = new Array()
	
	lVariables[0] = window 
	lVariables[1] = "?"
	lVariables[2] = commentID
	lVariables[3] = "&"
	//lVariables[4] = document.location.href
	lVariables[4] = newHref
	lVariables[5] = document.title
	
	  oModal = window.showModelessDialog("../_Notes_Function/Note_Add.htm",lVariables , "dialogHeight: 465px; dialogWidth: 465px;  center: Yes; scroll: No; help: No; resizable: No; status: No; unadorned: yes;");
	}	
	
	else
	{
	var lVariables = new Array()
	
	lVariables[0] = window
	lVariables[1] = "?"
	lVariables[2] = commentID
	lVariables[3] = "&"
	lVariables[4] = sName
	lVariables[5] = "&"
	lVariables[6] = sDate
	lVariables[7] = "&"
	lVariables[8] = sComment
	lVariables[9] = "&"
	lVariables[10] = document.location.href
	//alert(lVariables[10]);
	
	if (oDisplay)
	 {
	  toReset = parent.frames.mainFrame.document.getElementById("note" + commentID);
	  if (toReset)
         {
		  toReset.moveable = 'false' ;
	      oDisplay.close();
		 }
	 }
	  oDisplay = window.showModelessDialog("../_Notes_Function/Note_Display.htm", lVariables , "dialogHeight: 465px; dialogWidth: 465px;  center: Yes; scroll: No; help: No; resizable: No; status: No; unadorned: Yes;");
   }
} /***End Function***/

/******************************************************************************
addCommentIcon(x, y, ID, Name, Date, Comment) -- This function is called from
NotePopulateFrame.asp as a page is opened or refreshed. This function is only called
if a note has been left on this page. NotePopulateFrame.asp pulls values from
the database and then passes them to this function, which then populates the page
with the pushpin. 
******************************************************************************/
function addCommentIcon(x, y, ID, Name, Date, Comment)
{   

//alert("addCommentIcon"); 
//setTimeout("alert()",1000);
//alert("x " + x);
//alert("y " + y);
var myComment = Comment

	ID = parseInt(ID)
	fakeSpan = document.getElementById("noteDiv");
	if (fakeSpan)
	{
		fakeSpan.outerHTML = fakeSpan.outerHTML 
		+ "<div class='noteIcon' "
		+ "id='note" + ID + "' "
		+ "moveable = 'false' "
		+ "fdDate='" + Date + "' "
		+ "fdName='" + Name + "' "
		+ "fdComment='" + Comment + "' "
		+ "fdCommentID='" + ID + "' "
		+ "deleteTag='No' "
		+ "fdX='" + x + "' "
		+ "style=' background: clear; border: 1;"
		+ "position: absolute; "
		+ "left:" + x + "px;"
		+ "top:" + y + ";"
		+ "z-index: 0; cursor: hand;'>"
		//+ "<a onclick=javascript:alert();>"  
		+ "<a onclick='drag_view(" + '"' + ID + '"'  + "," + '"' + Name + '"' + "," + '"' + Date + '"' + "," + '"' + myComment + '"' +  ")'>"  
		//+ "<a onclick=javascript:drag_view(" + ID  + "," +  Name + "," + Date + "," + Comment + ");>"
		+ "<IMG Id='pin' SRC='../_Notes_Function/Note_Pushpin.gif' style='cursor:hand;clip:auto' BORDER=0></font></a></div>";	
		//alert("drag_view(" + ID + "," + Name + "," + Date + "," + Comment + ")" )
		//alert(x + y + ID + unescape(Name) + unescape(Date) + unescape(Comment));
		
	}		

	theStep = read_cookie (document.location.pathname+"current_step");
	setCommentScroll(theStep - 1);	

} /***End Function***/

/******************************************************************************
drag_view(ID) -- This function is run when the user clicks on a note icon on a page.  
******************************************************************************/
function drag_view(note_ID,sName,sDate,sComment)
{	

//alert("drag_view"); 

   if (parent.frames.mainFrame.document.getElementById("note" + note_ID).moveable == 'false')
     {

     displayComment(note_ID,sName,sDate,sComment);
	
	 }
	 
} /***End Function***/

/******************************************************************************
displayCommentIcon(x,y,ID,Name,Date,Comment) -- After a note is created, its information
is sent to the database in NoteManageFrame.asp. Then, NoteManageFrame.asp sends the note
information to this function, which then passes the information to addCommentIcon so that
the note that was just left can be populated onto your page without a refresh.
NOTE: The code is not going past the return false. Does it need to??
******************************************************************************/
function displayCommentIcon(x,y,ID,Name,Date,Time,Comment)
{	

//alert("displayCommentIcon function");

		if (Name != "" || Comment != "")
		{
			addCommentIcon(x,y,ID,Name,Date,Comment);
			parent.top.location.reload();
		}
		
		return false;
	
	
	
	name = "note" + parseInt(ID);
	foundit = -1
	
	allSpans = document.all.tags("div")
	for (i=0;i<allSpans.length;i++)
	{	
		if (allSpans[i].className == "noteIcon")
		{	
		
			if (parseInt(allSpans[i].fdCommentID) == parseInt(ID))
			{
			
				allSpans[i].style.left = x
				allSpans[i].style.top = y
				allSpans[i].style.visibility = "visible"
				if (allSpans[i].fdName == "" && allSpans[i].fdComment == "")
				{
					allSpans[i].deleteTag = "Yes"
				 
					 
				}
				else
				{
					allSpans[i].deleteTag = "No"
				}
				foundit = i
			}
		}
	}
	if (foundit == -1)
	{
		if (Name != "" || Comment != "")
		{
			addCommentIcon(x,y,ID,Name,Date,Comment);
		}
		else
		{
			strCookie = ID + "=;expires=Sunday 17-Dec-00 12:00:00 GMT;"
			document.cookie = strCookie
		}			
	}
	setCommentScroll();
} /***End Function***/



function activateDrag()
{
	//alert("activateDrag");
	//alert(activeComment);
	toCancel = parent.frames.mainFrame.document.getElementById("note" + activeComment);
	//NoteID = NoteID;
	//toCancel = parent.frames.mainFrame.document.getElementById("note" + NoteID);
	toCancel.moveable = 'true' 
	parent.frames.mainFrame.document.onmousedown = mousedown;
	var lTop, lLeft;
	
} /***End Function***/

function cancelDrag()
{
	toCancel = parent.frames.mainFrame.document.getElementById("note" + activeComment);
	//toCancel = parent.frames.mainFrame.document.getElementById("note" + NoteID);
	toCancel.moveable = 'false'
} /***End Function***/

function mousedown() 
{
	//NoteID = NoteID;
	//alert("mouseDown");
	mp = findMoveable(window.event.srcElement);
   
	if (mp != null)
	{
	parent.frames.mainFrame.document.onmousemove = mousemove;
    lLeft = window.event.x;
    lTop = window.event.y;		
	}	
	
} /***End Function***/

function findMoveable(e) 
{
	//alert("findMoveable");
	if (e.moveable == 'true')
    return e;

	if (e.tagName == "BODY")
    return null;

	return findMoveable(e.parentElement);
} /***End Function***/

function mousemove() 
{
	//NoteID = NoteID;
	var i, dLeft, dTop;
  
	if (window.event.button == 1) 
	{
    sx = window.event.x;
    sy = window.event.y;
	//alert("sx " + sx + "sy " + sy);
	
    dLeft = sx - lLeft;
    dTop = sy - lTop;
		
	if (mp)
          {
           moveElement(mp, dLeft, dTop);
		  }  
    
	
    lLeft = sx;
    lTop = sy;
	parent.frames.mainFrame.document.onmouseup = mouseup;
	//alert("ID " + activeComment + " Left " + lLeft + " Top " + lTop);
	//NoteMove(activeComment, lLeft, lTop);
		
   return false;
  }
} /***End Function***/

function mouseup()
{
	//alert("ID " + activeComment + " Left " + lLeft + " Top " + lTop);
	NoteMove(activeComment, lLeft, lTop);

} /***End Function***/

function moveElement(mp, dLeft, dTop) 
{
	//alert("moveElement");
    var e
    e = mp;
    e.style.posTop += dTop;
    e.style.posLeft += dLeft;
	
} /***End Function***/


//////* END NOTES FUNCTIONS *//////



//-->

