//File Name: sieHeader_allinfo_CDJAMA.js. Created On:6/20/05.
//This file is used to write the header buttons in the sie page and sent the page mode.
//This file will be renamed to sieHeader_allinfo.js during CD and JAMA conversion.
/**
* SIE Header
*
*/
var header = "1", sieinfoid = "",menuitemno, menuSearch = new Array(), arrindex = 0,previousvalue = 1, nextvalue = 1,comptype = false,config="";

if(request.getParameter('header') != null)
	header = request.getParameter('header');
if(request.getParameter('sieinfoid') != null)
	sieinfoid = request.getParameter('sieinfoid');
if(request.getParameter('prev') != null)
	previousvalue = request.getParameter('prev');
if(request.getParameter('next') != null)
	nextvalue = request.getParameter('next');
if(request.getParameter('itemNo') != null) {
	menuitemno=request.getParameter('itemNo');
	session.setAttribute('itemNo', menuitemno);
}
else {
	menuitemno=session.getAttribute('itemNo');
}

var language = session.getAttribute('lang');
if(request.getParameter('prevnexttype') != null)
{
	if(request.getParameter('prevnexttype') == "true")
		comptype = true;
	else
		comptype = false;
}

if(request.getParameter('config') != null)
	config = request.getParameter('config');

var footer = 0, newWinFlag = 0, printFlag = 1, bookmark = 0;

var windloc, currentwindow, curwindow, menuItem;
var bFlag = true;
var checkboxvalue=0;
var submenu = new Array();

if (header == null) { header = "1"; }
if (footer == null) { footer = 1; }
if (newWinFlag == null) { newWinFlag = 1; }
if (bookmark == null) { bookmark = 1; }
if (printFlag == null) { copyFlag = 1; }

//Coded for bookmark of cd manual
bookmark = 0;
/**
	Function to change SIE Page header button image on mouse over.
*/
function changeImg(img)
{
if(img.name=='btnPrint')
	img.src="../../images/Print_f.jpg";
if(img.name=='btnBack')
	img.src="../../images/Back_operation_f.jpg";
if(img.name=='compare'){
	//if(session.getAttribute('PageOpenMode')=="1" || session.getAttribute('PageOpenMode')==1)
	if(this.document.sienew.hdradiobutton.value=="1" || this.document.sienew.hdradiobutton.value==1)
		img.src="../../images/Open_new_window_c.jpg";
	else
		img.src="../../images/Open_new_window_f.jpg";
}

if(img.name=='overWrite'){
	//if(session.getAttribute('PageOpenMode')=="0" || session.getAttribute('PageOpenMode')==0)
	if(this.document.sienew.hdradiobutton.value=="0" || this.document.sienew.hdradiobutton.value==0)
		img.src="../../images/Renew_window_c.jpg";
	else
		img.src="../../images/Renew_window_f.jpg";
}

if(img.name=='btnTitle')
	img.src="../../images/Show_Title_f.jpg";
if(img.name=='btnAll')
	img.src="../../images/Show_Detail_f.jpg";
if(img.name=='btnBookmark')
	img.src="../../images/Bookmark_f.jpg";
if(img.name=='btnSie')
	img.src="../../images/Related_Info_f.jpg";
if(img.name=='beforePage')
	img.src="../../images/Before_Page_f.jpg";
if(img.name=='afterPage')
	img.src="../../images/After_Page_f.jpg";
if(img.name=='btnTop')
	img.src="../../images/ESM_top_f.jpg";
}
/**
	Function to change SIE Page header button image on mouse click.
*/
function changeImgOnClick(img){
	if(img.name=='btnPrint')
		img.src="../../images/Print_c.jpg";
	if(img.name=='btnBack')
		img.src="../../images/Back_operation_c.jpg";
	if(img.name=='btnTitle')
		img.src="../../images/Show_Title_c.jpg";
	if(img.name=='btnAll')
		img.src="../../images/Show_Detail_c.jpg";
	if(img.name=='btnBookmark')
		img.src="../../images/Bookmark_c.jpg";
	if(img.name=='beforePage')
		img.src="../../images/Before_Page_c.jpg";
	if(img.name=='afterPage')
		img.src="../../images/After_Page_c.jpg";
	if(img.name=='btnTop')
		img.src="../../images/ESM_top_c.jpg";
}
/**
	Function to change SIE Page header button image on mouse out.
*/
function showDefault(img)
{
	if(img.name=='btnPrint')
		img.src="../../images/Print.jpg";
	if(img.name=='btnPageBack')
		img.src="../../images/Back.jpg";
	if(img.name=='btnBack')
		img.src="../../images/Back_operation.jpg";
	if(img.name=='compare')
		img.src="../../images/Open_new_window.jpg";
	if(img.name=='overWrite')
		img.src="../../images/Renew_window.jpg";
	if(img.name=='btnTitle')
		img.src="../../images/Show_Title.jpg";
	if(img.name=='btnAll')
		img.src="../../images/Show_Detail.jpg";
	if(img.name=='btnBookmark')
		img.src="../../images/Bookmark.jpg";
	if(img.name=='btnSie')
		img.src="../../images/Related_Info.jpg";
	if(img.name=='beforePage')
		img.src="../../images/Before_Page.jpg";
	if(img.name=='afterPage')
		img.src="../../images/After_Page.jpg";
	if(img.name=='beforePagen')
		img.src="../../images/Before_Page_n.jpg";
	if(img.name=='afterPagen')
		img.src="../../images/After_Page_n.jpg";
	if(img.name=='btnTop')
		img.src="../../images/ESM_top.jpg";
}
/**
	Function to set the page open mode button.
*/
function SetButtons()
{
	//if(request.getParameter("fromsielist")=="1" || request.getParameter("fromsielist") ==1)
	//{
		if(this.document.sienew.hdradiobutton.value =="1" || this.document.sienew.hdradiobutton.value ==1)
		{
			this.document.sienew.compare.src = "../../images/Open_new_window_c.jpg";
			this.document.sienew.overWrite.src = "../../images/Renew_window.jpg";
		}
		if(this.document.sienew.hdradiobutton.value =="0" || this.document.sienew.hdradiobutton.value ==0)
		{
			this.document.sienew.compare.src = "../../images/Open_new_window.jpg";
			this.document.sienew.overWrite.src = "../../images/Renew_window_c.jpg";
		}
	//}
	if(request.getParameter('anchor') != null)
	{
		document.sienew.anchor.value = request.getParameter('anchor');
		var obj = document.getElementById(request.getParameter('anchor'));
		obj.scrollIntoView();
		//self.location.href = '#'+request.getParameter('anchor');
	}
//Added on 2005/10/24 for title issue in SIE opened from Link Portal
	if (parent.frames.length != 0) 
	{
		// loaded in frames
		var objFrame=window.parent;
		objFrame.document.title=document.title;
	}

}
/**
	Function to set page open mode buttons as per current open mode.
*/
function enableDisableImg(thisImg,otherImg,val)
{
session.setAttribute("PageOpenMode",val);
if(window.parent.frames.length >1)
{
	if(window.parent.frames(1).name == "frameMainLeft" && (window.parent.frames(1).searchform.alphaflag.value == true || window.parent.frames(1).searchform.alphaflag.value == "true"))
	{
		session.setAttribute("OpenNewWindow",val);
	}
}
var open=val;
	if(open==1)
	{
		this.document.sienew.hdradiobutton.value=1;
		thisImg.src="../../images/Open_new_window_c.jpg";
		otherImg.src="../../images/Renew_window.jpg";
		session.setAttribute("open_new_window","yes");
	}
	else
	{
		this.document.sienew.hdradiobutton.value=0;
		thisImg.src="../../images/Renew_window_c.jpg";
		otherImg.src="../../images/Open_new_window.jpg";
		session.setAttribute("open_new_window","no");
	}
	//session.setAttribute('PageOpenMode',this.document.sienew.hdradiobutton.value);
	//setPageOpenMode(val);
}
function fncshowDefaultImages(img)
{
	if(img.name=='compare')
		img.src="../../images/Open_new_window.jpg";
	if(img.name=='overWrite')
		img.src="../../images/Renew_window.jpg";
}
/**
	Function to set the RenewWindow and OpenInSame window button mode as per the current page open mode.
*/
function checkStateAndDisable(thisImg,otherImg)
{
	//if(thisImg.name=="compare" && this.document.sienew.hdradiobutton.value==0)
	if(thisImg.name=="compare" && (this.document.sienew.hdradiobutton.value=="0" || this.document.sienew.hdradiobutton.value==0))
		fncshowDefaultImages(thisImg);
	//else if(thisImg.name=="overWrite" && this.document.sienew.hdradiobutton.value==1)
	else if(thisImg.name=="overWrite" && (this.document.sienew.hdradiobutton.value=="1" || this.document.sienew.hdradiobutton.value==1))
		fncshowDefaultImages(thisImg);
	//else if(thisImg.name=="overWrite" && this.document.sienew.hdradiobutton.value==0)
	else if(thisImg.name=="overWrite" && (this.document.sienew.hdradiobutton.value=="0" || this.document.sienew.hdradiobutton.value==0))
		fncChangeImages(thisImg);
	//else if(thisImg.name=="compare" && this.document.sienew.hdradiobutton.value==1)
	else if(thisImg.name=="compare" && (this.document.sienew.hdradiobutton.value=="1" || this.document.sienew.hdradiobutton.value==1))
		fncChangeImages(thisImg);
}
/**
	Function to change the image of page open mode buttons on click.
*/
function fncChangeImages(img)
{
	if(img.name=='compare')
		img.src="../../images/Open_new_window_c.jpg";
	if(img.name=='overWrite')
		img.src="../../images/Renew_window_c.jpg";
}
/**
	Function to enable the back button.
*/
function fnEnableButton()
{
	this.document.sienew.btnBack.disabled=false;
}
/**
	Function to enable of disable the allview, partview buttons.
*/
function fnDisableButton(flag)
{
	var disable=flag;
	if(disable=='true'){
		this.document.sienew.btnAll.disabled=true;
		this.document.sienew.btnTitle.disabled=true;
		if (document.getElementById("IMG1_2") != null)
		{
			this.document.all["IMG1_2"].style.visibility = 'visible';
			this.document.all["IMG2_2"].style.visibility = 'visible';
			this.document.all["IMG1_1"].style.visibility = 'hidden';
			this.document.all["IMG2_1"].style.visibility = 'hidden';
		}
	}
	else if(disable=='false'){
		this.document.sienew.btnAll.disabled=false;
		this.document.sienew.btnTitle.disabled=false;
		if (document.getElementById("IMG1_2") != null)
		{
			this.document.all["IMG1_2"].style.visibility = 'hidden';
			this.document.all["IMG2_2"].style.visibility = 'hidden';
			this.document.all["IMG1_1"].style.visibility = 'visible';
			this.document.all["IMG2_1"].style.visibility = 'visible';
		}
	}
}

function fnDisableButton_print()
{
	if (document.getElementById("Print_2") != null) {
		this.document.all["Print_1"].style.visibility = 'hidden';
		this.document.all["Print_2"].style.visibility = 'visible';
	}
}
/**
	Function to navigate to previously viewed page.
*/

function fnPageBack()
{
	if(document.sienew.hdintxref.value!='')
	{
		//Call history.back to clear the history list
		history.back();
		var intxref1 = intxrefArr.pop();
		var hdvalue = document.sienew.hdintxref.value;
		var hindex = hdvalue.lastIndexOf("?");
		var intxref = hdvalue.substring(hindex+1,hdvalue.length);
		xref = "intxref_"+intxref;
		document.sienew.hdintxref.value = hdvalue.substring(0,hindex);
		//Make the page to jump to the Anchor link if the back() method doesnt
		//var obj=document.getElementById(document.sienew.hdintxref.value);
		//var obj=document.getElementById(intxref);
		var obj=document.getElementById(xref);
		obj.focus();
	}
	else if(document.sienew.hdtestgrpxref.value!=''){
//Added on 2005/09/24
		history.back();
		var hdvalue = document.sienew.hdtestgrpxref.value;
		var hindex = hdvalue.lastIndexOf("?");
		var htestgrp = hdvalue.substring(hindex+1,hdvalue.length);
		document.sienew.hdtestgrpxref.value = hdvalue.substring(0,hindex);
		var prev_testgrp = testgrpArr.pop();
		//var test = 'TESTGRP'+prev_testgrp;
		var test = 'TESTGRP'+htestgrp;
		//var obj = document.getElementById('TESTGRP'+prev_testgrp);
		var obj = document.getElementById('TESTGRP'+htestgrp);
		var present_testgrp = document.getElementById("TESTGRP"+hdvalue.substring(8,hdvalue.length));
		var objDiv = document.all.tags('DIV');
		for (var i = 0; i < objDiv.length; i++) 
		{
			if(objDiv[i].id.indexOf('TESTGRP') !=-1 )
			{
				if(objDiv[i].id==test){
					objDiv[i].style.display = "block";
					var child = objDiv[i].children;
					for(var j=0;j<child.length;j++){
						child[j].style.display ="block";
					}
				}
				else{
						objDiv[i].style.display = "none";
				}
			}
		}
		obj.style.display = 'block';
		obj.focus();
	}
	else if(document.sienew.anchor.value != '')
	{
		document.sienew.anchor.value ="";
		history.back();
	}
	else
	{
		history.back();
	}
	//document.sienew.hdintxref.value="";
}
function fncLinkArray(group,item, link)
{
	this.group = group;
	this.item=item;
	this.link=link;
}

//function to hold the array of comptype / sie title for displaying the SITQ Dropdown values
function fncSITQArray(comptype,sietitle,sieinfoid)
{
	this.comptype = comptype;
	this.sietitle = sietitle;
	this.sieinfoid = sieinfoid;
}
//function to build the SITQ logic
function fncLoadSITQ()
{
	var sieinfoid = request.getParameter("sieinfoid");
	var dm = application.getAttribute("DATAMANAGER");
	var nq = new NamedQuery("GET_SIE_WITH_SITQ");
	nq.params["sieinfoid"] = sieinfoid;
	var rs = dm.executeNamedQuery(nq);
	var arrindex = 0;
	var rsi = rs.iterator();
	var s = "";
	while (rsi.hasNext())
	{
		var rec = rsi.getNext();
		var comptype,title,sieinfoid;
		comptype= rec["comptype"];
		title=rec["title"];
		sieinfoid=rec["infoid"];
		if(comptype != "")
			s = comptype + " // " + title;
		else
			s = title;
		submenu[arrindex] = new fncLinkArray("Menu",s,sieinfoid);
		arrindex++;
	}
	return submenu;
}
var submenu = new Array();
/**
	Function to write SITQ submenu
*/
function showSubmenu()
{
	submenu = fncLoadSITQ();
	var pageopenvalue = this.document.sienew.hdradiobutton.value;
	pageopenvalue = session.getAttribute('PageOpenMode');
	//document.write("<DIV style='POSITION: absolute; Z-INDEX: 10;top:\'"+yMousePos+"\';left:\'"+xMousePos+"//\';visibility:hidden;background-color: #ffffcc;' id=SubMenu0 onmouseleave='fnB()'>");
	//document.write("<DIV class='SubMenu0' id=SubMenu0 onmouseleave='fnB()'>");
	if( window.screenTop<400){
	    if (language =='JP' || language == 'CS' || language == 'CN') {
		if(submenu.length>24)
			document.write("<DIV class='SubMenu0' id=SubMenu0 onmouseleave='fnB();' style='height:581;overflow-y:scroll;'>");
		else
			document.write("<DIV class='SubMenu0' id=SubMenu0 onmouseleave='fnB();' style='height:auto;overflow-y:auto;'>");
	    } else {
		if(submenu.length>16)
			document.write("<DIV class='SubMenu0' id=SubMenu0 onmouseleave='fnB();' style='height:421;overflow-y:scroll;'>");
		else
			document.write("<DIV class='SubMenu0' id=SubMenu0 onmouseleave='fnB();' style='height:auto;overflow-y:auto;'>");
	   }	
	}
	else{
		if(submenu.length>9)
			document.write("<DIV class='SubMenu0' id=SubMenu0 onmouseleave='fnB();' style='height:241;overflow-y:scroll;'>");
		else
			document.write("<DIV class='SubMenu0' id=SubMenu0 onmouseleave='fnB();' style='height:auto;overflow-y:auto;'>");
	}

	document.write("<TABLE border=1 cellPadding=3 cellSpacing=0 >");
	//for (var iLoop = 0; iLoop<MaxLoop;iLoop++)
	for (var iLoop = 0; iLoop<submenu.length;iLoop++)
	{
		var submenulink=submenu[iLoop].link;
		document.write("<TR>");
		document.write("<TD style='font-size:12;width:360px;height:20px'>");
		//document.write("<TD bgcolor='#F4F4F0' style='font-size:12;' onmouseover='this.style.backgroundColor=\"#DCDCDC\";this.style.borderTop=\"1 solid gray\";this.style.borderLeft=\"1 solid black\";this.style.borderRight=\"1 solid white\";this.style.borderBottom=\"1 solid white\";' onmouseout='	this.style.backgroundColor=\"#F4F4F0\";this.style.textDecoration=\"none\"; this.style.textSize=2; this.style.color=\"#000000\";this.style.backgroundcolor=\"#ededed\";this.style.borderTop=\"1 solid white\";this.style.borderLeft=\"1 solid white\";this.style.borderRight=\"1 solid #dbdbdb\";this.style.borderBottom=\"1 solid #dbdbdb\";'>");
		document.write('<A href="#" id="back" onclick="javascript:linkWindowOpenSIE(\''+submenulink+'\');return false;">');
		document.write(submenu[iLoop].item)
		document.write('</a>');
		document.write("</TD>");
		document.write("</TR>");
	}
	document.write("</TABLE>");
	document.write("</div>");
}
/**
	Function to set the SITQ submenu height according to the browser window height.
*/
function setSubMenuHeight()
{
	if(document.getElementById("SubMenu0") != null)
	{
		if(((submenu.length) * 30) > document.body.clientHeight)
			document.getElementById("SubMenu0").style.height=document.body.clientHeight * 0.8;
		else
			document.getElementById("SubMenu0").style.height="auto";
	}
}
/**
	Function to set the position of SITQ submenu.
*/
function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}
/**
	Function to set the position of SITQ submenu.
*/
function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}
/**
	Function to show SITQ submenu.
*/
function fnA()
{
	var obj=this.document.getElementById("compare");
	var xPos = findPosX(obj);
	//xPos = 450;
	var yPos =findPosY(obj);
	var SubMenu = document.getElementById("SubMenu0");
	SubMenu.style.visibility="visible";
	SubMenu.style.top=yPos+23;
	SubMenu.style.left=xPos;
}
/**
	Function to hide SITQ submenu.
*/
function fnB()
{
	var SubMenu = document.getElementById("SubMenu0");
	if(SubMenu != null)
		SubMenu.style.visibility="hidden";
}
//function to go to the previous sie 
//Params :infoid - infoid of the currently viewed SIE page
//Params :comptype - to check if the comptype check of component id of currently viewed & the previous are the same
function fncPrevSIE(config,infoid, comptype, menuitemno)
{
try
{
	// The infoid is passed with .html extension only for comp type of link,so, truncate it 
	/*if(comptype == "true")
	var infoid = infoid.substring(0,infoid.length-5);*/
	var curIndex = null;
	var previoussieinfoid = "";
	if(comptype != "true")
	{
		var arrInfoId = new Array();
		arrInfoId = session.getAttribute('nqData');
		if(arrInfoId != null)
		{
			for(i=0;i<arrInfoId.length;i++)
			{
				if(arrInfoId[i].infoid==infoid){
					curIndex = i;
					break;
				}
			}
			if(curIndex != null){
				if(curIndex-1 >= 0)
				{
					if(arrInfoId[curIndex-1].config == config)
						previoussieinfoid = arrInfoId[curIndex-1].infoid;
					else
						previoussieinfoid = "";
				}else
					previoussieinfoid = "";
			}
		}
		else
			previoussieinfoid = "";
		if(previoussieinfoid != "")
			linkWindowOpenPrevNextSIE(previoussieinfoid,config);
	}
	else
	{
		var arrInfoId = new Array();
		arrInfoId = session.getAttribute('nqCompData');
		if(arrInfoId != null)
		{
			for(i=0;i<arrInfoId.length;i++)
			{
				if(arrInfoId[i].infoid==infoid)	{
					curIndex = i;
					break;
				}
			}
			if(curIndex != null){
				if(curIndex-1 >= 0)
					previoussieinfoid = arrInfoId[curIndex-1].infoid;
				else
					previoussieinfoid = "";
			}
		}
		else
			previoussieinfoid = "";
		if(previoussieinfoid != "")
		{
			// Pass only the .html file name, rinkwin_open has all the other functionalities
			var url = previoussieinfoid + ".html";
			// Pass first parameter 0 only for comp type of link to identify that prev/next should be in same window always
			// Checked the same in sie_logic.js for renew window mode
			RinkWin_Open('0',url,'','COMP');
		}
	}
}
catch(e)
{
//alert("Parent window is closed, cant go next");
}
}

//function to go to the next sie 
//Params :infoid - infoid of the currently viewed SIE page
//Params :comptype - to check if the comptype check of component id of currently viewed & the next are the same
function fncNextSIE(config,infoid, comptype, menuitemno)
{
try
{
	// The infoid is passed with .html extension only for comp type of link,so, truncate it 
	/*if(comptype == "true")
		var infoid = infoid.substring(0,infoid.length-5);*/
	var nextsieinfoid = "";
	var curIndex = null;
	if(comptype != "true")
	{
		var arrInfoId = new Array();
		arrInfoId = session.getAttribute('nqData');
		if(arrInfoId != null)
		{
			for(i=0;i<arrInfoId.length;i++)
			{
				if(arrInfoId[i].infoid==infoid){
					curIndex = i;
					break;
				}
			}
			if(curIndex != null){
				if(arrInfoId.length > curIndex+1)
				{
					if(arrInfoId[curIndex+1].config == config)
						nextsieinfoid = arrInfoId[curIndex + 1].infoid;
					else
						nextsieinfoid = "";
				}else
					nextsieinfoid = "";
			}
		}
		else
			nextsieinfoid = "";
		if(nextsieinfoid != "")
		{
			var url = nextsieinfoid + ".html";
			linkWindowOpenPrevNextSIE(nextsieinfoid,config);
		}
	}
	else
	{
		var arrInfoId = new Array();
		arrInfoId = session.getAttribute('nqCompData');
		if(arrInfoId != null)
		{
			for(i=0;i<arrInfoId.length;i++)
			{
				if(arrInfoId[i].infoid==infoid){
					curIndex = i;
					break;
				}
			}
			if(curIndex != null){
				if(arrInfoId.length > curIndex+1)
					nextsieinfoid = arrInfoId[curIndex + 1].infoid;
				else
					nextsieinfoid = "";
			}
		}
		else
			nextsieinfoid = "";
		if(nextsieinfoid != "")
		{
			var url = nextsieinfoid + ".html";
			// Pass first parameter 0 only for comp type of link to identify that prev/next should be in same window always
			RinkWin_Open('0',url,'','COMP');
		}
	}
}
catch(e)
{
//alert("Parent window is closed, cant go next");
}
}

//Changed By Neela - For CR 8
function fncPrevSIEDisp(config,infoid, comptype, menuitemno)
{
	var prevSIE = new Array 
	prevSIE = fncPrevSIEId(config,infoid, comptype, menuitemno);
	var pageopenvalue = this.document.sienew.hdradiobutton.value;
	pageopenvalue = session.getAttribute('PageOpenMode');
	if(prevSIE){
		document.write("<DIV class='SubMenu3' id=SubMenu3 onmouseleave='fnBPrev();'>");
		document.write("<TABLE border=1 cellPadding=3 cellSpacing=0 width=100%>");		document.write("<TR>");
		document.write('<TD style="font-size:12;width:362px;height:20px;">');
		document.write("<a id=back href=# onClick=\"javascript:"+prevSIE[0]+"\" >"+prevSIE[1]+"</a>");
		document.write("</TD>");
		document.write("</TR>");
		document.write("</TABLE>");
		document.write("</DIV>");
	}
}

function fncPrevSIEId(config,infoid, comptype, menuitemno)
{
	try
	{
		var curIndex = null;
		var previoussieinfoid = "";
		var previoussieinfotitle = "";
		if(comptype != "true")
		{
			var arrInfoId = new Array();
			arrInfoId = session.getAttribute('nqData');
			if(arrInfoId != null)
			{
				for(i=0;i<arrInfoId.length;i++)
				{
					if(arrInfoId[i].infoid==infoid)
					{
						curIndex = i;
						break;
					}
				}
				if(curIndex != null)
				{
					if(curIndex-1 >= 0)
					{
						if(arrInfoId[curIndex-1].config == config)
						{
							previoussieinfoid = arrInfoId[curIndex-1].infoid;
							previoussieinfotitle = arrInfoId[curIndex-1].title;
						}
						else
						{
							previoussieinfoid = "";
							previoussieinfotitle = "";
						}
					}
					else
					{
						previoussieinfoid = "";
						previoussieinfotitle = "";
					}
				}
			}
			else
			{
				previoussieinfoid = "";
				previoussieinfotitle = "";
			}
			if(previoussieinfoid != "")
			{
				var arr = new Array();
				arr[0] = "linkWindowOpenPrevNextSIE('"+previoussieinfoid+"','"+config+"');";
				arr[1] = previoussieinfotitle
				return arr;
			}
		}
		else
		{
			var arrInfoId = new Array();
			arrInfoId = session.getAttribute('nqCompData');
			if(arrInfoId != null)
			{
				for(i=0;i<arrInfoId.length;i++)
				{
					if(arrInfoId[i].infoid==infoid)
					{
						curIndex = i;
						break;
					}
				}
				if(curIndex != null)
				{
					if(curIndex-1 >= 0)
					{
						previoussieinfoid = arrInfoId[curIndex-1].infoid;
						previoussieinfotitle = arrInfoId[curIndex-1].title;
					}
					else
					{
						previoussieinfoid = "";
						previoussieinfotitle = "";
					}
				}
			}
			else
			{
				previoussieinfoid = "";
				previoussieinfotitle = "";
			}
			if(previoussieinfoid != "")
			{
				var arr = new Array();
				arr[0] = "RinkWin_Open('0','"+url+"','','COMP');";
				arr[1] = previoussieinfotitle
				return arr;
			}
		}
	}
	catch(e)
	{
		//Parent SIE list page has been closed
	}
}
function fnAPrev()
{
	var obj=this.document.getElementById("overWrite");
	var xPos = findPosX(obj);
	var yPos =findPosY(obj);
	var SubMenu = document.getElementById("SubMenu3");
	if(SubMenu){
	SubMenu.style.visibility="visible";
	SubMenu.style.top=yPos+23;
	SubMenu.style.left=xPos;
	}
}

function fnBPrev()
{
	var SubMenu = document.getElementById("SubMenu3");
	if(SubMenu != null)
		SubMenu.style.visibility="hidden";
}

//*************************************************************************************************
function fncNextSIEDisp(config,infoid, comptype, menuitemno)
{
	var nextSIE = new Array 
	nextSIE = fncNextSIEId(config,infoid, comptype, menuitemno);
	if(nextSIE){
		document.write("<DIV class='SubMenu4' id=SubMenu4 onmouseleave='fnBNext();'>");
		document.write("<TABLE border=1 cellPadding=3 cellSpacing=0 width=100%>");
		document.write("<TR>");
		document.write('<TD style="font-size:12;width:312px;height:20px;">');
		document.write("<a id=back href=# onClick=\"javascript:"+nextSIE[0]+"\" >"+nextSIE[1]+"</a>");
		document.write("</TD>");
		document.write("</TR>");
		document.write("</TABLE>");
		document.write("</DIV>");
	}
}

function fncNextSIEId(config,infoid, comptype, menuitemno)
{
	try
	{
		var nextsieinfoid = "";
		var nextsieinfotitle = "";
		var curIndex = null;
		if(comptype != "true")
		{
			var arrInfoId = new Array();
			arrInfoId = session.getAttribute('nqData');
			if(arrInfoId != null)
			{
				for(i=0;i<arrInfoId.length;i++)
				{
					if(arrInfoId[i].infoid==infoid)
					{
						curIndex = i;
						break;
					}
				}
				if(curIndex != null)
				{
					if(arrInfoId.length > curIndex+1)
					{
						if(arrInfoId[curIndex+1].config == config)
						{
							nextsieinfoid = arrInfoId[curIndex + 1].infoid;
							nextsieinfotitle = arrInfoId[curIndex + 1].title;
						}
						else
						{
							nextsieinfoid = "";
							nextsieinfotitle ="";
						}
					}
					else
					{
						nextsieinfoid = "";
						nextsieinfotitle = "";
					}
				}
			}
			else
			{
				nextsieinfoid = "";
				nextsieinfotitle ="";
			}
			if(nextsieinfoid != "")
			{
				var arr = new Array();
				var url = nextsieinfoid + ".html";
				arr[0] = "linkWindowOpenPrevNextSIE('"+nextsieinfoid+"','"+config+"');";
				arr[1] = nextsieinfotitle;
				return arr;
			}
		}
		else
		{
			var arrInfoId = new Array();
			arrInfoId = session.getAttribute('nqCompData');
			if(arrInfoId != null)
			{
				for(i=0;i<arrInfoId.length;i++)
				{
					if(arrInfoId[i].infoid==infoid){
						curIndex = i;
						break;
					}
				}
				if(curIndex != null){
					if(arrInfoId.length > curIndex+1)
					{
						nextsieinfoid = arrInfoId[curIndex + 1].infoid;
						nextsieinfotitle = arrInfoId[curIndex + 1].titleS;
					}
					else
					{
						nextsieinfoid = "";
						nextsieinfotitle = "";
					}
				}
			}
			else
			{
				nextsieinfoid = "";
				nextsieinfotitle = "";
			}
			if(nextsieinfoid != "")
			{
				var arr = new Array();
				var url = nextsieinfoid + ".html";
				arr[0] = "RinkWin_Open('0','"+url+"','','COMP');";
				arr[1] = nextsieinfotitle;
				return arr;
			}
		}
	}
	catch(e)
	{
		//alert("Parent window is closed, cant go next");
	}
}
function fnANext()
{
	var obj=this.document.getElementById("btnTitle");
	var xPos = findPosX(obj);
	var yPos =findPosY(obj);
	var SubMenu = document.getElementById("SubMenu4");
	if(SubMenu){
	SubMenu.style.visibility="visible";
	SubMenu.style.top=yPos+23;
	SubMenu.style.left=xPos;
	}
}
function fnBNext()
{
	var SubMenu = document.getElementById("SubMenu4");
	if(SubMenu != null)
		SubMenu.style.visibility="hidden";
}

//End-Changed By Neela - For CR 8
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
//Image Display Change by Maintenance - START - July 19,2006
function checkNextSIEExists(infoid)
{
	try
	{
		var curIndex = null;
		var arrInfoId = new Array();
		arrInfoId = session.getAttribute('nqData');
		if(arrInfoId != null)
		{
			for(i=0;i<arrInfoId.length;i++)
			{
				if(arrInfoId[i].infoid==infoid)
				{

					curIndex = i;
					break;
				}
			}
			if(curIndex != null)
			{
				if(arrInfoId.length > curIndex+1)
				{
					return true;
				}
				else
				{
					return false;
				}
			}
		}
	}
	catch(e)
	{
		//alert("Parent window is closed, cant go next");
	}
}
function checkPrevSIEExists(infoid)
{
	try
	{
		var curIndex = null;
		var arrInfoId = new Array();
		arrInfoId = session.getAttribute('nqData');
		if(arrInfoId != null)
		{
			for(i=0;i<arrInfoId.length;i++)
			{
				if(arrInfoId[i].infoid==infoid)
				{
					curIndex = i;
					break;
				}
			}
			if(curIndex != null)
			{
				if(curIndex-1 >= 0)
				{
					return true;
				}
				else
				{
					return false;
				}
			}
		}
	}
	catch(e)
	{
		//alert("Parent window is closed, cant go next");
	}
}
//Image Display Change by Maintenance - END - July 19,2006
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
/**
	Function to write the Header buttons in the SIE page according to the header value.
*/
function fncDispHeader(manualId, sieId,sieName,sctName,scName,configName,componentName,vehicleTypeName,publishDate){
var checkboxvalue = 0;
	if(header == "2")
	{
	//Set the initial page open mode of the sie list page to 1 for open in new window as the default setting
		//if(request.getParameter("PageOpenMode") != null && request.getParameter("next")==null && request.getParameter("prev")==null)
		if(request.getParameter("PageOpenMode") != null && request.getParameter("next")!=1 && request.getParameter("prev")!=1)
			session.setAttribute('PageOpenMode',parseInt(request.getParameter("PageOpenMode")));
		if(session.getAttribute("PageOpenMode") == null)
			session.setAttribute("PageOpenMode",1);
		//this.document.sienew.hdradiobutton.value = session.getAttribute("PageOpenMode");
		checkboxvalue = session.getAttribute("PageOpenMode"); //this.document.sienew.hdradiobutton.value;
		//setPageOpenMode(this.document.sienew.hdradiobutton.value);

		document.write('<thead id="header" name="header">');
		document.write('<tr height="20"><td nowrap>');
		document.write('<div class="headerbutton">');
		document.writeln('<span id="buttons" style="background-color:white;">');
		document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
		document.write('<tr><td style="font-size:10px;font-family:Times" width="21%" align="left" nowrap>');
		document.write(manualId + " - " + sieId);
		document.write('</td>');
		document.write('<td width="79%" align="right">');
		document.write('<table width="10%" border="0" cellspacing="0" cellpadding="0">');
		document.write('<tr>');
		if(checkboxvalue==1 || checkboxvalue=="1")
		//if(checkboxvalue==1)
		{
			document.write('<td>');
			document.write('<img src="../../images/Open_new_window_c.jpg" name="compare" title="' + getMessage("MSIBT_CreatNewWin") + '" onClick="enableDisableImg(this,document.sienew.overWrite,1);" onmouseover="changeImg(this);" onmouseout="checkStateAndDisable(this,document.sienew.overWrite);" >');
			document.write('</td>');
			document.write('<td>');
			document.write('<img src="../../images/Renew_window.jpg" name="overWrite" title="' + getMessage("MSIBT_ReWriteWin") + '" onClick="enableDisableImg(this,document.sienew.compare,0);" onmouseover="changeImg(this);" onmouseout="checkStateAndDisable(this,document.sienew.compare);" >');
			document.write('</td>');
		}
		else
		{
			document.write('<td>');
			document.write('<img src="../../images/Open_new_window.jpg" name="compare" title="' + getMessage("MSIBT_CreatNewWin") + '" onClick="enableDisableImg(this,document.sienew.overWrite,1);" onmouseover="changeImg(this);" onmouseout="checkStateAndDisable(this,document.sienew.overWrite);">');
			document.write('</td>');
			document.write('<td>');
			document.write('<img src="../../images/Renew_window_c.jpg" name="overWrite" title="' + getMessage("MSIBT_ReWriteWin") + '" onClick="enableDisableImg(this,document.sienew.compare,0);" onmouseover="changeImg(this);" onmouseout="checkStateAndDisable(this,document.sienew.compare);">');
			document.write('</td>');
		}
		document.write('<td>');
		document.write('<img src="../../images/Show_Title.jpg" name="btnTitle" value="" title="' + getMessage("MSIBT_DispTitle") + '" onclick="changeImgOnClick(this);all_view(1);" onmouseover="changeImg(this);" onmouseout="showDefault(this);" />');
		document.write('</td>');
		document.write('<td>');
		document.write('<img src="../../images/Show_Detail.jpg" name="btnAll" value="" title="' + getMessage("MSIBT_DispAll") + '" onclick="changeImgOnClick(this);all_view(0);" onmouseover="changeImg(this);" onmouseout="showDefault(this);"/>');
		document.write('<input type="hidden" name="btnBack">');
		document.write('</td>');
		document.write('</tr>');
		document.write('</table>');
		document.write('</td></tr></table>');
		document.write('</span>');
		document.write('<table width="100%">');
		document.write('<tr>');
		// Changed style of sie title display
		document.write('<td class="H3">' + sieName + '</td>');
		document.write('</tr></table>');
		document.write('</div>');
		document.write('</td></tr>');
		document.write('<tr height="2"><td background="../../images/line.gif"></td></tr>');
		document.write('</thead>');
	}
	else if (header == "1") {
	//Set the initial page open mode of the sie list page to 1 for open in new window as the default setting
		//if(request.getParameter("PageOpenMode") != null && request.getParameter("next")==null && request.getParameter("prev")==null)
		if(request.getParameter("PageOpenMode") != null && request.getParameter("next")!=1 && request.getParameter("prev")!=1)
			session.setAttribute('PageOpenMode',parseInt(request.getParameter("PageOpenMode")));
		if(session.getAttribute("PageOpenMode") == null)
			session.setAttribute("PageOpenMode",1);
		//this.document.sienew.hdradiobutton.value = session.getAttribute("PageOpenMode");
		checkboxvalue = session.getAttribute("PageOpenMode"); //this.document.sienew.hdradiobutton.value;
		//setPageOpenMode(this.document.sienew.hdradiobutton.value);

		document.write('<thead id="header" name="header">');
		document.write('<tr height="20"><td nowrap>');
		document.write('<div class="headerbutton">');
		document.writeln('<span id="buttons" style="background-color:white;">');
		showSubmenu();
		//Changed By Neela - For CR 8
		fncPrevSIEDisp(config,sieinfoid,'false',menuitemno);
		fncNextSIEDisp(config,sieinfoid,'false',menuitemno);
		//End-Changed By Neela - For CR 8
		document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
		document.write('<tr><td style="font-size:10px;font-family:Times" width="21%" align="left" nowrap>');
		document.write(manualId + " - " + sieId);
		document.write('</td>');
		document.write('<td width="79%" align="right">');
		document.write('<table width="50%" border="0" cellspacing="0" cellpadding="0">');
		document.write('<tr>');
		//Changed By Neela - For CR 5(2)
		document.write('<td>');
		document.write('<img src="../../images/ESM_top.jpg" name="btnTop" value="' + getMessage("MSIBT_ESMTOP") + '" title="' + getMessage("MSIBT_ESMTOP") + '" onclick="changeImgOnClick(this);SetFocusOpener();" onmouseover="fnB();fnBPrev();fnBNext();changeImg(this);" onmouseout="showDefault(this);"/>');
		document.write('</td>');
		//End - Changed By Neela - For CR 5(2)
		if (printFlag != 0) {
			document.write('<td>');
			document.write('<div id="Print_1" style="top:0px;position:absolute"> <img src="../../images/Print.jpg" name="btnPrint" value="' + getMessage("MSIBT_Print") + '" title="' + getMessage("MSIBT_Print") + '" onclick="changeImgOnClick(this);SIEPrint();" onmouseover="fnB();fnBPrev();fnBNext();changeImg(this);" onmouseout="showDefault(this);"/></div><div id="Print_2" style="visibility:hidden"><img src="../../images/Print_n.jpg" name="btnPrint" value="' + getMessage("MSIBT_Print") + '" title="' + getMessage("MSIBT_Print") + '"/></div>');
			document.write('</td>');
		} 
		var btnState = request.getParameter("clicked");
		if(btnState){
			document.write('<td>');
			document.write('<img src="../../images/Back_operation_c.jpg" name="btnBack" value="' + getMessage("MSIBT_PreLink") + '" title="' + getMessage("MSIBT_PreLink") + '" onclick="changeImgOnClick(this);fnPageBack();" onmouseover="fnB();fnBPrev();fnBNext();changeImg(this);" onmouseout="showDefault(this);"/>');
			document.write('</td>');
		}
		else{
			document.write('<td>');
			document.write('<img src="../../images/Back_operation.jpg" name="btnBack" value="' + getMessage("MSIBT_PreLink") + '" title="' + getMessage("MSIBT_PreLink") + '" onclick="changeImgOnClick(this);fnPageBack();" onmouseover="fnB();fnBPrev();fnBNext();changeImg(this);" onmouseout="showDefault(this);"/>');
			document.write('</td>');
		}
		if(checkboxvalue==1 || checkboxvalue=="1")
			//if(checkboxvalue==1)
			{
			document.write('<td>');
			document.write('<img src="../../images/Open_new_window_c.jpg" name="compare" title="' + getMessage("MSIBT_CreatNewWin") + '" onClick="enableDisableImg(this,document.sienew.overWrite,1);" onmouseover="fnB();fnBPrev();fnBNext();changeImg(this);" onmouseout="checkStateAndDisable(this,document.sienew.overWrite);" >');
			document.write('</td>');
			document.write('<td>');
			document.write('<img src="../../images/Renew_window.jpg" name="overWrite" title="' + getMessage("MSIBT_ReWriteWin") + '" onClick="enableDisableImg(this,document.sienew.compare,0);" onmouseover="fnB();fnBPrev();fnBNext();changeImg(this);" onmouseout="checkStateAndDisable(this,document.sienew.compare);" >');
			document.write('</td>');
		}
		else
		{
			document.write('<td>');
			document.write('<img src="../../images/Open_new_window.jpg" name="compare" title="' + getMessage("MSIBT_CreatNewWin") + '" onClick="enableDisableImg(this,document.sienew.overWrite,1);" onmouseover="fnB();fnBPrev();fnBNext();changeImg(this);" onmouseout="checkStateAndDisable(this,document.sienew.overWrite);">');
			document.write('</td>');
			document.write('<td>');
			document.write('<img src="../../images/Renew_window_c.jpg" name="overWrite" title="' + getMessage("MSIBT_ReWriteWin") + '" onClick="enableDisableImg(this,document.sienew.compare,0);" onmouseover="fnB();fnBPrev();fnBNext();changeImg(this);" onmouseout="checkStateAndDisable(this,document.sienew.compare);">');
			document.write('</td>');
		}
		document.write('<td>');
		document.write('<div id="IMG1_1" style="top:0px;position:absolute"> <img src="../../images/Show_Title.jpg" name="btnTitle" value="" title="' + getMessage("MSIBT_DispTitle") + '" onclick="changeImgOnClick(this);all_view(1);" onmouseover="fnB();fnBPrev();fnBNext();changeImg(this);" onmouseout="showDefault(this);" /></div><div id="IMG1_2"> <img src="../../images/Show_Title_n.jpg" name="btnTitle" value="" title="' + getMessage("MSIBT_DispTitle") + '"/></div>');
		document.write('</td>');
		document.write('<td>');
		document.write('<div id="IMG2_1" style="top:0px;position:absolute"> <img src="../../images/Show_Detail.jpg" name="btnAll" value="" title="' + getMessage("MSIBT_DispAll") + '" onclick="changeImgOnClick(this);all_view(0);" onmouseover="fnB();fnBPrev();fnBNext();changeImg(this);" onmouseout="showDefault(this);"/></div><div id="IMG2_2"> <img src="../../images/Show_Detail_n.jpg" name="btnAll" value="" title="' + getMessage("MSIBT_DispAll") + '"/></div>');
		document.write('</td>');
		if (bookmark != 0) {
			document.write('<td>');
			document.write('<input type="hidden" name="manualId" value="',manualId,'" />');
			document.write('<input type="hidden" name="sieId" value="',sieId,'" />');
			document.write('<img src="../../images/Bookmark.jpg" name="btnBookmark" value="" title="' + getMessage("MSIBT_RegiToBM") + '" onclick="changeImgOnClick(this);addBookmarkThisSIEPage(\''+manualId+'\', \''+ menuitemno +'\',\''+sieId+'\', \''+sieName+'\', \''+sctName+'\', \''+scName+'\', \''+configName+'\', \''+componentName+'\', \''+ vehicleTypeName +'\',\''+ publishDate +'\',getManualLanguage());" onmouseover="fnB();fnBPrev();fnBNext();changeImg(this);" onmouseout="showDefault(this);"/>');
			document.write('</td>');
		}
		document.write('<td>');
		document.write('<img src="../../images/Related_Info.jpg" name="btnSie" value="SIE" title="' + getMessage("MSIBT_SieLink") + '" onmouseover="fnA();fnBPrev();fnBNext();changeImg(this);" onmouseout="showDefault(this);"/>');
		document.write('</td>');
	if(checkPrevSIEExists(sieinfoid))
	{
		if(previousvalue==1) 
		{
			if(comptype == true)
			{ 
				//Implemented only for CD manual
				document.write('<td>');
				//Changed By Neela - For CR 8
				//document.write('<img src="../../images/Before_Page.jpg" title="' + getMessage("MSIBT_PrePage") + '" name="beforePage" onClick="javascript:changeImgOnClick(this);fncPrevSIE(\'' + config + '\',\''+ sieinfoid + '\',\'true\',' + menuitemno + ');" onmouseover="fnB();changeImg(this);" onmouseout="showDefault(this);"/>');
				document.write('<img src="../../images/Before_Page.jpg" name="beforePage" title="'+getMessage("MSIBT_PrePage")+'" onClick="javascript:changeImgOnClick(this);fncPrevSIE(\'' + config + '\',\''+ sieinfoid + '\',\'true\',' + menuitemno + ');" onmouseover="fnB();fnBNext();changeImg(this);fncPrevSIEDisp(\'' + config + '\',\''+ sieinfoid + '\',\'true\',' + menuitemno + ');fnAPrev();" onmouseout="showDefault(this);"/>');
				//End-Changed By Neela - For CR 8
				document.write('</td>');
				//this.document.sienew.hdradiobutton.value = 0;
			}
			else
			{
				//Implemented only for CD manual
				document.write('<td>');
				//Changed By Neela - For CR 8
				//document.write('<img src="../../images/Before_Page.jpg" title="' + getMessage("MSIBT_PrePage") + '" name="beforePage" onClick="javascript:changeImgOnClick(this);fncPrevSIE(\'' + config + '\',\''+ sieinfoid + '\',\'false\',' + menuitemno + ');" onmouseover="fnB();changeImg(this);" onmouseout="showDefault(this);"/>');
				document.write('<img src="../../images/Before_Page.jpg" name="beforePage" title="'+getMessage("MSIBT_PrePage")+'" onClick="javascript:changeImgOnClick(this);fncPrevSIE(\'' + config + '\',\''+ sieinfoid + '\',\'false\',' + menuitemno + ');" onmouseover="fnB();fnBNext();changeImg(this);fnAPrev();" onmouseout="showDefault(this);"/>');
				//End-Changed By Neela - For CR 8
				document.write('</td>');
				//this.document.sienew.hdradiobutton.value = 0;
			}
		}
		else
		{
			document.write('<td>');
			//Changed By Neela - For CR 8
			//document.write('<img src="../../images/Before_Page.jpg" title="' + getMessage("MSIBT_PrePage") + '" name="beforePage" onmouseover="changeImg(this);" onmouseout="showDefault(this);"/>' );
			document.write('<img src="../../images/Before_Page_n.jpg" name="beforePagen" title="'+getMessage("MSIBT_PrePage")+'" onmouseover="changeImg(this);fnB();fnBNext();fnBPrev();" onmouseout="showDefault(this);"/>' );
			//End-Changed By Neela - For CR 8
			document.write('</td>');
		}
	}
	else
	{
		document.write('<td>');
		document.write('<img src="../../images/Before_Page_n.jpg" name="beforePagen" title="'+getMessage("MSIBT_PrePage")+'" onmouseout="showDefault(this);"/>' );
		document.write('</td>');
	}
	if(checkNextSIEExists(sieinfoid))
	{
		if(nextvalue==1) 
		{
			if(comptype == true)
			{
				document.write('<td>');
				//Changed By Neela - For CR 8
				//document.write('<img src="../../images/After_Page.jpg" title="' + getMessage("MSIBT_NextPage") + '" name="afterPage" onClick="javascript:changeImgOnClick(this);fncNextSIE(\'' + config + '\',\'' + sieinfoid + '\',\'true\',' + menuitemno + ');" onmouseover="fnB();changeImg(this);" onmouseout="showDefault(this);"/>');
				document.write('<img src="../../images/After_Page.jpg" name="afterPage" title="'+getMessage("MSIBT_NextPage")+'" onClick="javascript:changeImgOnClick(this);fncNextSIE(\'' + config + '\',\'' + sieinfoid + '\',\'true\',' + menuitemno + ');" onmouseover="fnB();fnBPrev();changeImg(this);fncNextSIEDisp(\'' + config + '\',\''+ sieinfoid + '\',\'true\',' + menuitemno + ');fnANext();" onmouseout="showDefault(this);"/>');
				//End-Changed By Neela - For CR 8
				document.write('</td>');
				//this.document.sienew.hdradiobutton.value = 0;
			}
			else
			{
				document.write('<td>');
				//Changed By Neela - For CR 8
				//document.write('<img src="../../images/After_Page.jpg" title="' + getMessage("MSIBT_NextPage") + '" name="afterPage" onClick="javascript:changeImgOnClick(this);fncNextSIE(\'' + config + '\',\'' + sieinfoid + '\',\'false\',' + menuitemno + ');" onmouseover="fnB();changeImg(this);" onmouseout="showDefault(this);"/>');
				document.write('<img src="../../images/After_Page.jpg" name="afterPage" title="'+getMessage("MSIBT_NextPage")+'" onClick="javascript:changeImgOnClick(this);fncNextSIE(\'' + config + '\',\'' + sieinfoid + '\',\'false\',' + menuitemno + ');" onmouseover="fnB();fnBPrev();changeImg(this);fnANext();" onmouseout="showDefault(this);"/>');
				//End-Changed By Neela - For CR 8
				document.write('</td>');
				//this.document.sienew.hdradiobutton.value = 0;
			}
		}
		else
		{
			document.write('<td>');
			//Changed By Neela - For CR 8
			//document.write('<img src="../../images/After_Page.jpg" title="' + getMessage("MSIBT_NextPage") + '" name="afterPage" onmouseover="changeImg(this);" onmouseout="showDefault(this);"/>');
			document.write('<img src="../../images/After_Page_n.jpg" name="afterPagen" title="'+getMessage("MSIBT_NextPage")+'" onmouseover="changeImg(this);fnB();fnBNext();fnBPrev();" onmouseout="showDefault(this);"/>');
			//End-Changed By Neela - For CR 8
			document.write('</td>');
		}
	}
	else
	{
		document.write('<td>');
		document.write('<img src="../../images/After_Page_n.jpg" name="afterPagen" title="'+getMessage("MSIBT_NextPage")+'" onmouseover="changeImg(this);fnB();fnBNext();fnBPrev();" onmouseout="showDefault(this);"/>');
		document.write('</td>');
	}
	document.write('</tr>');
	document.write('</table>');
	document.write('</td></tr></table>');
	document.write('</span>');
	document.write('<table width="100%">');
	document.write('<tr>');
	// Changed style of sie title display
	document.write('<td class="H3">' + sieName + '</td>');
	document.write('</tr></table>');

	document.write('</div>');
	document.write('</td></tr>');
	document.write('<tr height="2"><td background="../../images/line.gif"></td></tr>');
	document.write('</thead>');
	//Disable (cannot be focused/clicked) the SITQ drop down image when there are no related SITQs. 
	if(submenu.length == 0 || (request.getParameter('header') != null && request.getParameter('header') == "2"))
		this.document.sienew.btnSie.disabled = true;
	//Disable prev & next for pages not from sie list page.
	//if(previousvalue == 0 || (request.getParameter('header') != null && request.getParameter('header') == "2"))
	//this.document.sienew.beforePage.disabled = true;
	//if(nextvalue == 0 || (request.getParameter('header') != null && request.getParameter('header') == "2"))
	//this.document.sienew.afterPage.disabled = true;
	}
	else
	{
		document.write('<input type="hidden" name="btnBack">');
		document.write('<input type="hidden" name="btnAll">');
		document.write('<input type="hidden" name="btnTitle">');
	}
}

//Changed By Neela - For CR 5(2)
function SetFocusOpener()
{
	try
	{
		var rootWin = getHighestParent(window.self);
	}
	catch(e)
	{
		if(e.number == -2147418094)
		{
			var win = window.open("../start.html","ESMWIN",'statusbar=no,location=no,toolbar=no,menubar=no,resizable=yes');
			win.moveTo(0,0);
			win.resizeTo(window.screen.availWidth,window.screen.availHeight);
			win.focus();
		}
	}
}
function getHighestParent(win)
{
	var curWin = win;
	var curParent = curWin.opener;
	while(curWin.opener != curWin)
	{
		curWin = curWin.opener;
		if (curWin.top.name=='ESMWIN'){
			curWin.focus(); 
			return curWin;
		}
	}
	return curWin;
}
//End - Changed By Neela - For CR 5(2)