var imgSctC    = new Image(); imgSctC.src    = "../images/arrow_r.gif";
var imgSctO    = new Image(); imgSctO.src    = "../images/arrow_d.gif";
var imgScC     = new Image(); imgScC.src     = "../images/arrow_r.gif";
var imgScO     = new Image(); imgScO.src     = "../images/arrow_g_d.gif";

var imgConfigC = new Image(); imgConfigC.src = "../images/arrow_g2_r.gif";
var imgConfigO = new Image(); imgConfigO.src = "../images/arrow_g2_d.gif";


function openCloseSCT(){
	for(var i=0;i<2;i++){
			doSectionSCT('SCT0');
		}
	}

function doSectionSCT(item) {
  var section = 'sec' + item;
  var icon = 'ico' + item;
  //alert(section);
    if (document.all(section).style.display == "none") {
     document.all('anc' + item).hash = "anc" + item
    document.all(section).style.display = "block";
    //document.getElementById('scttree').style.height=calcMenuDivHeight(section);
    document.getElementById('scttree').style.height=document.body.clientHeight;
    document.getElementById('scttree').scrollIntoView(false);
    document.all(icon).src = imgSctO.src;
  } else {
    document.all('anc' + item).hash = "";
    document.all(section).style.display = "none";
    //document.getElementById('scttree').style.height="auto";
    //document.getElementById('scttree').style.height=document.body.clientHeight;
    document.getElementById('treebody').style.position="absolute";
    document.all(icon).src = imgSctC.src;
  }
}

function doSectionSC(item,sctid,scid,config,subsc,si) {
  var section = 'sec' + item;
  var icon = 'ico' + item;
  if (document.all(section).style.display == "none") {
    document.all(section).style.display = "block";
    document.all(icon).src = imgScO.src;
    var nodes = document.getElementById(section).all.tags("A");
    var count = 0; 
    for(i = 0; i < nodes.length; i++){
       if (nodes[i].name.indexOf('ancSI') !=-1 ) {
       count++;
       //alert(i + "/" + nodes.length +
       //                 "tagName: " + nodes.item(i).tagName +
       //                 "nodeName: " + nodes.item(i).nodeName +
       //                 "nodeType: " + nodes.item(i).nodeType +
       //                "nodeValue: " + nodes.item(i).nodeValue +
       //                 "innerHTML: " + nodes.item(i).innerHTML + "\n");
       }
    }
    //alert(nodes.length + "!" +  count);
    if (count == 1)
        searchWithParam(sctid,scid,config,subsc,si);
  } else {
    document.all(section).style.display = "none";
    document.all(icon).src = imgScC.src;
  }
}
function doSectionConfig(item,sctid,scid,config,subsc,si) {
  //alert(item+ sctid + scid+ config + subsc + si);
  var section = 'sec' + item;
  var icon = 'ico' + item;
  if (document.all(section).style.display == "none") {
    document.all(section).style.display = "block";
    document.all(icon).src = imgConfigO.src;
    var nodes = document.getElementById(section).childNodes;
    var nodes = document.getElementById(section).all.tags("A");
    var count = 0; 
    for(i = 0; i < nodes.length; i++){
       if (nodes[i].name.indexOf('ancSI') !=-1 ) {
       count++;
       //alert(i + "/" + nodes.length +
       //                 "tagName: " + nodes.item(i).tagName +
       //                 "nodeName: " + nodes.item(i).nodeName +
       //                 "nodeType: " + nodes.item(i).nodeType +
       //                 "nodeValue: " + nodes.item(i).nodeValue +
       //                 "innerHTML: " + nodes.item(i).innerHTML + "\n");
       }
    }
    //alert(nodes.length + "!" +  count);
    if (count == 1)
       searchWithParam(sctid,scid,config,subsc,si);
  } else {
    document.all(section).style.display = "none";
    document.all(icon).src = imgConfigC.src;
  }
}
function doSectionSubsc(item,sctid,scid,config,subsc,si) {
  var section = 'sec' + item;
  var icon = 'ico' + item;
  if (document.all(section).style.display == "none") {
    document.all(section).style.display = "block";
    document.all(icon).src = imgConfigO.src;
    var nodes = document.getElementById(section).all.tags("A");
    var count = 0; 
    for(i = 0; i < nodes.length; i++){
       if (nodes[i].name.indexOf('ancSI') !=-1 ) {
       count++;
       //alert(i + "/" + nodes.length + 
       //                 "tagName: " + nodes.item(i).tagName +
       //                 "nodeName: " + nodes.item(i).nodeName +
       //                 "nodeType: " + nodes.item(i).nodeType +
       //                 "nodeValue: " + nodes.item(i).nodeValue +
       //                 "innerHTML: " + nodes.item(i).innerHTML + "\n");
       }
    //alert(nodes.length + "!" +  count);
    if (count == 1)
       searchWithParam(sctid,scid,config,subsc,si);
    }
  } else {
    document.all(section).style.display = "none";
    document.all(icon).src = imgConfigC.src;
  }
}

function all_open(flag) {
  var objDiv = document.all.tags('div');
  if (flag) {
 	for (var i = 0; i < objDiv.length; i++) {
      if(objDiv[i].id.indexOf('sec') != -1) {
        objDiv[i].style.display = 'block';
      }
    }
  } else {
     for(var i = 0; i < objDiv.length; i++) {
      if (objDiv[i].id.indexOf('sec') != -1) {
        objDiv[i].style.display = 'none';
      }
    }
    location.href = "#pagetop";
  }
}

var selectedItem = null;
var previousClass = "";
var previousImage = "";
var selectedIcon = new Image(); selectedIcon.src = "../images/list2.gif";

function fncChangeItemStyle(item) {
  if (selectedItem != null) {
    document.all('anc' + selectedItem).className = previousClass;
    document.all('ico' + selectedItem).src = previousImage;
  }
  if (item != null) {
    selectedItem = item;
    previousClass = document.all('anc' + selectedItem).className;
    previousImage = document.all('ico' + selectedItem).src;
    document.all('anc' + selectedItem).className = "selected";
    document.all('ico' + selectedItem).src = selectedIcon.src;
  } else {
    selectedItem = null;
  }
}

function fncSearch(string) {

  var DATA_DIR = "sie/";
  if (string == "") {
  	 parent.frameMainRight.location.href = "error/Serch.html";
	   return;
  }
  var sieArray = getSie(string);
  if (sieArray.length == 1) {
     fncSieOpen(DATA_DIR + sieArray[0].sieid);
  }
  fncDispResultsInRightFrame(sieArray,rightframeerrname);
}

function searchWithParam(sct, sc, config, servcatsub,si) 
{
	if((this.document.searchform.dtc1==null) && (this.document.searchform.symptom==null))
	{
		fnStringSearchWithSCT_SC_CONFIG(this.document.searchform.string.value,menuSearch,'','','',this.document.sisform.sis.value,sct,sc,config,servcatsub,si)
	}
	else if((this.document.searchform.dtc1==null) && (this.document.searchform.symptom!=null))
	{
			fnStringSearchWithSCT_SC_CONFIG(this.document.searchform.string.value,menuSearch,'','',this.document.searchform.symptom.value,this.document.sisform.sis.value,sct,sc,config,servcatsub,si)
	}
	else
	{
		// Included to check DTC format while clicking the config also similar to search button click format check.
		var flag = "true";
		if(this.document.sisform.sis.value != null && this.document.sisform.sis.value !="" && trim(this.document.sisform.sis.value).length <18)
		{
			alert(getMessage("MMSMS_InvalidSIS"));
			document.sisform.sis.focus();			
		}
		else if(trim(this.document.searchform.dtc1.value).length != 0 && !fncCheckDTC(this.document.searchform.dtc1.value,"dtc1"))
		{
			alert(getMessage("MMSMS_InvalidDTC"));
			this.document.searchform.dtc1.focus();
		}
		else if(trim(this.document.searchform.dtc2.value).length != 0 && !fncCheckDTC(this.document.searchform.dtc2.value,"dtc2"))	
		{
			alert(getMessage("MMSMS_InvalidDTC"));	
			this.document.searchform.dtc2.focus();			
		}		
		else if(trim(this.document.searchform.string.value).length != 0 && hasSpecialCharacters(trim(this.document.searchform.string.value)))
		{
			alert(getMessage("MMSMS_InvalidChar"));			
			this.document.searchform.string.focus();
		}
		else
			fnStringSearchWithSCT_SC_CONFIG(this.document.searchform.string.value,menuSearch,this.document.searchform.dtc1.value,this.document.searchform.dtc2.value,'',this.document.sisform.sis.value,sct,sc,config,servcatsub,si)
	}
}

//function to replace in the given string the given value to another value - to replace <br> with &nbsp; in menu names
function replace(argvalue, x, y) {

  if ((x == y) || (parseInt(y.indexOf(x)) > -1)) {
    return argvalue;
  }
    
  while (argvalue.indexOf(x) != -1) {
    var leading = argvalue.substring(0, argvalue.indexOf(x));
    var trailing = argvalue.substring(argvalue.indexOf(x) + x.length, 
	argvalue.length);
    argvalue = leading + y + trailing;
  }

  return argvalue;

}

function fncWriteResultString(sieArray, sctval, scval, configval,  target) {
	unqCompTypeCount=fncWriteResultString1(sieArray, sctval, scval, configval,  target);
	if(session.getAttribute('PagesOpened') != null)
	{		
		session.setAttribute('PagesOpened',session.getAttribute('PagesOpened'));
	}
	else
		session.setAttribute('PagesOpened',0);
 var ulTagAdded="false";
 var comTypeOpened="false";
 var DATA_DIR = "sie/";
 session.setAttribute('nqData', sieArray);
    var sctid = "", scid = "", config = "", servcatsub = "", serviceitem = "", compid="",comptype = "", compdesc = "", sie = "" , sieinfoid = "";
	var subscid = "";
	var comptypeid = "";
  var compdescCount = 0;
  var comptypeCount = 0;

  if (!target) {
    return;
  }
  target.writeln('<table id=sietable cellspacing=0 cellpadding=0 vspace=0 hspace=0 border=0  width=100% bgcolor="white">');
  comp_count=0;
	var siectr = 0;
  for (var i = 0; i < sieArray.length; i++) {
      if (sctid != sieArray[i].sctid) { // Display SCT block
			if(siectr != 0)
				target.writeln('</ul></div>');
        target.writeln('<tr><td  width="100%" colspan=2><div class="sct">' + sieArray[i].sct + '</div></td></tr>');
      }
      if (scid != sieArray[i].scid || sctid !=  sieArray[i].sctid) { // Display SC block
			if(siectr != 0)
				target.writeln('</ul></div>');
       target.writeln('<tr><td colspan=2><div class="sc">' + sieArray[i].sc + '</div></td></tr>');
      }
      if (sieArray[i].configname != "" && (config != sieArray[i].config || scid!=sieArray[i].scid || sctid !=  sieArray[i].sctid)) {  // Display Config block
			if(siectr != 0)
				target.writeln('</ul></div>');
        target.writeln('<tr><td colspan=2><div class="config">' + sieArray[i].configname + '</div></td></tr>');
      }
			
      //if (servcatsub != sieArray[i].servcatsub) { // Display SubSc
	if (sieArray[i].servcatsub != "" && (subscid != sieArray[i].sub_sc_id || config != sieArray[i].config || scid!=sieArray[i].scid || sctid !=  sieArray[i].sctid)) {
				if(siectr != 0)
				target.writeln('</ul></div>');
        target.writeln('<tr><td colspan=2><div class="subsc">' + sieArray[i].servcatsub + '</div></td></tr>');
      }

      // Display SI
	if (sieArray[i].serviceitemname != "" && (serviceitem != sieArray[i].serviceitem || subscid != sieArray[i].sub_sc_id || config != sieArray[i].config || scid!=sieArray[i].scid || sctid !=  sieArray[i].sctid)) {
				if(siectr != 0)
				target.writeln('</ul></div>');
        target.writeln('<tr><td colspan=2><div class="si">' + sieArray[i].serviceitemname + '</div></td></tr>');
      }
      //if ((compid != sieArray[i].compid) || (config != sieArray[i].config)|| (scid!=sieArray[i].scid) ) { // Display Component left of right frame tr
		if ((compid != sieArray[i].compid) || serviceitem != sieArray[i].serviceitem || subscid != sieArray[i].sub_sc_id || (config != sieArray[i].config)|| (scid!=sieArray[i].scid) || (subscid!=sieArray[i].sub_sc_id) ||  (sctid !=  sieArray[i].sctid)) {
			var ancName = 'anccompdesc' + compdescCount;
			var secName = 'seccompdesc' + compdescCount;
			var comptdName = 'comptdseccompdesc' + compdescCount; 			
			if (compdescCount !=0)
			target.write('</ul></div></td></tr>');
			compdescCount++;

			target.write('<tr><td class="menuoff" valign="top" onmouseover="className=\'menuon\';" onmouseout="className=\'menuoff\';" onclick="doSectionComponent(\'',comptdName,'\'); return false;"> ');
			target.write('<a class=FIRST name="',ancName,'" href="#',ancName,'"');
			target.write('>' + sieArray[i].compdesc + '</a>');
			//swapped colors: #dcdcdc #ededed
			target.write('</td><td bgcolor="#dcdcdc" id="'+comptdName+'" width="70%">');
			ulTagAdded="false";
		}
      //if (comptypeid != sieArray[i].comptypeid) { // Display Comp type 
			if ((comptypeid != sieArray[i].comptypeid) || (compid != sieArray[i].compid) || serviceitem != sieArray[i].serviceitem || subscid != sieArray[i].sub_sc_id || (config != sieArray[i].config) ||  (subscid!=sieArray[i].sub_sc_id) || (scid!=sieArray[i].scid) || (sctid !=  sieArray[i].sctid)) { 
       
					if(sieArray[i].comptype!= "")	{
					 comptypeCount++; // Increment comp type count
					if((compid != sieArray[i].compid) || serviceitem != sieArray[i].serviceitem || subscid != sieArray[i].sub_sc_id || (config != sieArray[i].config)||  (subscid!=sieArray[i].sub_sc_id)|| (scid!=sieArray[i].scid)||(sctid !=  sieArray[i].sctid))
					  target.write('</ul></div><div class="comptype_sislist"><span style="padding-left=10px;">'+sieArray[i].comptype+'</span><ul class="sielistUl">');
					else
					{
						if(comp_count==0)
						{
							target.write('</ul></div><div class="comptype_sislist"><span style="padding-left=10px;">'+sieArray[i].comptype+'</span><ul class="sielistUl">');
							/*
							if(comptypeid == "" &&comptypeid != sieArray[i].comptypeid )
							target.write('</ul><div class="comptype_sislist">'+sieArray[i].comptype+'<ul class="sielistUl">');
							else
							target.write('</ul></div><div class="comptype_sislist">'+sieArray[i].comptype+'<ul class="sielistUl">');
							*/
							comp_count++;
						}
						else
						{
							/*
							if(comptypeid == "" &&comptypeid != sieArray[i].comptypeid )
							target.write('</ul><div class="comptype_sislist">'+sieArray[i].comptype+'<ul class="sielistUl">');
							else
							target.write('</ul></div><div class="comptype_sislist">'+sieArray[i].comptype+'<ul class="sielistUl">');
							*/
							if (sieArray[i].comptypeid!="")
							{
								target.write('</ul></div><div class="comptype_sislist" id="ctypeid'+sieArray[i].compid+comptypeCount+sieArray[i].comptypeid+'"><span style="padding-left=10px;">'+sieArray[i].comptype+'</span><ul class="sielistUl">');
							}
							else
							{
								if(comptypeid != "")
									target.write('</ul><div>'+sieArray[i].comptype+'<ul class="sielistUl">');
								else
									{
									//removed </div>
									target.write('</ul></div><div>'+sieArray[i].comptype+'<ul class="sielistUl">');
									}
							}
						}
					}
						//target.write('<div class="comptype_sislist">'+sieArray[i].comptype+'<ul style="padding-left:10px">');
						comTypeOpened="true";
						ulTagAdded="true";
					}
					else if(sieArray[i].comptype!= ""  && comTypeOpened=="true")	{
						//target.write('</ul> </div><ul style="padding-left:10px;">');
						target.write('</ul></div><ul class="sielistUl">');
						comTypeOpened="false";
						ulTagAdded="true";
					}
					else if(sieArray[i].comptype== "" && comTypeOpened=="true")
					{
						if(unqCompTypeCount==1){
							if(ulTagAdded == "true")
								{
									if(comptypeCount >= 2)
										target.write('</ul></div><ul class="sielistUl">');
									else
									target.write('</ul></div><ul class="sielistUl">');
								}	
								else
									target.write('</ul><ul class="sielistUl">');
						}else{
								if(ulTagAdded == "true")
								{
									if(comptypeCount >= 2)
									{
											var k = 0;
											//Removed Padma
											//target.write('</div><ul class="sielistUl">');
											// Added by Padma after Sri
											for(;k<comptypeCount;k++)
											{
												if(k == 0)
													target.write('</ul></div>');
												
												else
												target.write('</div>');
												
											}
											target.write('<ul class="sielistUl">');
										
									}	
									else	
									target.write('</ul></div><ul class="sielistUl">');
								}	
								else
									target.write('</ul><ul class="sielistUl">');
						}
			  			comTypeOpened="false";
						ulTagAdded="true";
					}
	
			}
			if(ulTagAdded=="false")   {
				//target.write('<ul style="padding-left:10px;">'); 
				target.write('<ul class="sielistUl">');
				ulTagAdded="true";
			}	
  
			var itemNo = "";
			if(request.getParameter('itemNo') != null) {
			 itemNo=request.getParameter('itemNo');
			 session.setAttribute('itemNo', itemNo);
			}
			else {
			 itemNo=session.getAttribute('itemNo');
			}
			
      if (sieinfoid != sieArray[i].infoid) 
			{
				if(sieArray[i].comptype!="")	{
					target.write('<li class="sie" ');
					target.write(' ><a href="javascript:fncSieOpen(\' ');
					// Parameters to be passed to sie page needs to be written here.	
					target.write(DATA_DIR + sieArray[i].infoid + ".html?sitqno=" + sieArray[i].sitqno);
					target.write("&fromsielist=1&PageOpenMode=0&menuitemno=" + itemNo + "&prevnexttype=false&sieinfoid=" + sieArray[i].infoid+ "&config=" + sieArray[i].config);
					target.write('\');" class="FOURTH">' + sieArray[i].title + '</a></li>');
					//ADDED HERE
					//target.write('</ul></div>');
					siectr++;
				}
				else 
				{	
					target.write('<li class="sie"');
					target.write(' ><a href="javascript:fncSieOpen(\' ');
					// Parameters to be passed to sie page needs to be written here.	
					target.write(DATA_DIR + sieArray[i].infoid + ".html?sitqno=" + sieArray[i].sitqno);
					target.write("&fromsielist=1&PageOpenMode=0&menuitemno=" + itemNo + "&prevnexttype=false&sieinfoid=" + sieArray[i].infoid+ "&config=" + sieArray[i].config);
					//target.write("&prevnexttype=false&sieinfoid=" + sieArray[i].infoid);
					target.write('\');" class="THIRD">' + sieArray[i].title + '</a></li>');
					siectr++;
				}
				
      }
	  else if(sieinfoid == sieArray[i].infoid && ((config != sieArray[i].config)|| (scid!=sieArray[i].scid))) {
         if(sieArray[i].comptype!="")	{
					target.write('<li class="sie" ');
					target.write(' ><a href="javascript:fncSieOpen(\' ');
					// Parameters to be passed to sie page needs to be written here.	
					target.write(DATA_DIR + sieArray[i].infoid + ".html?sitqno=" + sieArray[i].sitqno);
					target.write("&fromsielist=1&PageOpenMode=0&menuitemno=" + itemNo + "&prevnexttype=false&sieinfoid=" + sieArray[i].infoid+ "&config=" + sieArray[i].config);
							target.write('\');" class="FOURTH">' + sieArray[i].title + '</a></li>');
					siectr++;		
				}


				else {	
					target.write('<li class="sie"');
					target.write(' ><a href="javascript:fncSieOpen(\' ');
					// Parameters to be passed to sie page needs to be written here.	
					target.write(DATA_DIR + sieArray[i].infoid + ".html?sitqno=" + sieArray[i].sitqno);
					target.write("&fromsielist=1&PageOpenMode=0&menuitemno=" + itemNo + "&prevnexttype=false&sieinfoid=" + sieArray[i].infoid+ "&config=" + sieArray[i].config);
					target.write('\');" class="THIRD">' + sieArray[i].title + '</a></li>');	
					siectr++;
				}
				
	  }
		sct       = sieArray[i].sct;
		sc        = sieArray[i].sc;
		config    = sieArray[i].config;
		servcatsub     = sieArray[i].servcatsub;
		compdesc = sieArray[i].compdesc;
		comptype  = sieArray[i].comptype;
		sie       = sieArray[i].title;
		sieinfoid = sieArray[i].infoid;
		sctid = sieArray[i].sctid;
		scid = sieArray[i].scid;
		compid = sieArray[i].compid;
		comptypeid = sieArray[i].comptypeid;
		//subscid = "";
		subscid = sieArray[i].sub_sc_id;
		serviceitem = sieArray[i].serviceitem;
  }
  target.writeln('</ul></div></table>');
} 

function fncWriteResultString1(sieArray, sctval, scval, configval,  target) {
	
 var ulTagAdded="false";
 var comTypeOpened="false";
 var DATA_DIR = "sie/";
  var sctid = "", scid = "", config = "", servcatsub = "", serviceitem = "", compid="",comptype = "", compdesc = "", sie = "" , sieinfoid = "";
	var subscid = "";
	var comptypeid = "";
  var compdescCount = 0;
  var comptypeCount = 0;

  if (!target) {
    return;
  }
  comp_count=0;
  unqCompTypeCount=0;
  for (var i = 0; i < sieArray.length; i++) {
 	if ((compid != sieArray[i].compid) || (config != sieArray[i].config)|| (scid!=sieArray[i].scid) || (subscid!=sieArray[i].sub_sc_id) || (scid!=sieArray[i].scid) || (sctid !=  sieArray[i].sctid)) {
			var ancName = 'anccompdesc' + compdescCount;
			var secName = 'seccompdesc' + compdescCount;
			if (compdescCount !=0){
				}
			compdescCount++; 
			ulTagAdded="false";
		}
			if ((comptypeid != sieArray[i].comptypeid) || (compid != sieArray[i].compid) || (config != sieArray[i].config) ||  (subscid!=sieArray[i].sub_sc_id) || (scid!=sieArray[i].scid) || (sctid !=  sieArray[i].sctid)) { 
        var ancName = 'ancCOMPTYPE' + comptypeCount;
        var secName = 'secCOMPTYPE' + comptypeCount;
        comptypeCount++; // Increment comp type count

					if(sieArray[i].comptype!= "")	{
					
					if((compid != sieArray[i].compid) || (config != sieArray[i].config)||  (subscid!=sieArray[i].sub_sc_id)|| (scid!=sieArray[i].scid)||(sctid !=  sieArray[i].sctid)){
					}else
					{
						if(comp_count==0)
								comp_count++;
					}
						comTypeOpened="true";
						ulTagAdded="true";
					}
					else if(sieArray[i].comptype!= ""  && comTypeOpened=="true")	{
						comTypeOpened="false";
						ulTagAdded="true";
					}
					else if(sieArray[i].comptype== "" && comTypeOpened=="true")
					{
						unqCompTypeCount++;
		  			comTypeOpened="false";
						ulTagAdded="true";
						comp_type=0;
					}
       }
  }
 return unqCompTypeCount;
} 

function fncDispResultsInRightFrame(sieArray, rightframeerrname) {
//Set the initial page open mode of the sie list page to 1 for open in new window as the default setting
	if(session.getAttribute("OpenNewWindow") == null)
		session.setAttribute("OpenNewWindow",1);
  if (parent.frameMainRight) {
		if(sieArray.length == 0){
			parent.frameMainRight.location.href = rightframeerrname;
			return false;
		}
		var menuItemName = "";
		var valToCheck = itemNo;
		for (var i = 0 ; i < menuList.length ; i++ ) {
			var a = menuList[i].itemNo;
				if(menuList[i].itemNo == valToCheck)
				menuItemName = menuList[i].subClass;		
		}
		//Call replace function to replace all <br> with &nbsp; if available in the given menu item name
		menuItemName = replace(menuItemName,'<br>','&nbsp;');


       var screen_height=window.screen.height;
	var sizeArr = new Array();
	if(screen_height<=600)
	{
		sizeArr[0] = "7.5%";
		sizeArr[1] = "92.5%";
	}
	else
	{
		sizeArr[0] = "4.5%";
		sizeArr[1] = "95.5%";
	}
      parent.frameMainRight.document.open();
	  parent.frameMainRight.document.writeln('<html><head><title>ESMNEW</title>');
      parent.frameMainRight.document.writeln('<meta http-equiv="Content-Style-Type" content="text/css">');
      parent.frameMainRight.document.writeln('<meta http-equiv="Content-Script-Type" content="text/javascript">');
      parent.frameMainRight.document.writeln('<link rel="stylesheet" type="text/css" href="../css/common.css">');
      parent.frameMainRight.document.writeln('<link rel="stylesheet" type="text/css" href="../css/searchresult.css">');
      //writeln('<script type="text/javascript" src="../scripts/context.js"></script>');
      //writeln('<script type="text/javascript" src="../scripts/sieOpen.js"></script>');
      //writeln('<script type="text/javascript" src="../scripts/doSection.js"></script>');
	  	  parent.frameMainRight.document.writeln('<Script>');
//*************************************************************************************************************
//context.js created on 5/23/05. Used of finding the ancestor of a window where the data frame is loaded.
parent.frameMainRight.document.writeln('function getRootWindow(win)');
parent.frameMainRight.document.writeln('{');
parent.frameMainRight.document.writeln('  var rootWin = getHighestParent(win)  ');
parent.frameMainRight.document.writeln('  return rootWin;');
parent.frameMainRight.document.writeln('}');

parent.frameMainRight.document.writeln('function getHighestParent(win)');
parent.frameMainRight.document.writeln('{');
parent.frameMainRight.document.writeln('  var curWin = win;');
parent.frameMainRight.document.writeln('  var curParent = curWin.parent;');
parent.frameMainRight.document.writeln('  while(curWin.parent != curWin)');
parent.frameMainRight.document.writeln('  {');
parent.frameMainRight.document.writeln('    curWin = curWin.parent;');
parent.frameMainRight.document.writeln('  }');
parent.frameMainRight.document.writeln('  return curWin;');
parent.frameMainRight.document.writeln('}');

parent.frameMainRight.document.writeln('function _request()');
parent.frameMainRight.document.writeln('{');
parent.frameMainRight.document.writeln('  this.paramArray = new Array();');

parent.frameMainRight.document.writeln('  var tmpStr = location.search;');
parent.frameMainRight.document.writeln('  if (tmpStr.indexOf("?") != -1) {');
parent.frameMainRight.document.writeln('    tmpStr = tmpStr.substring(tmpStr.indexOf("?")+1);');
parent.frameMainRight.document.writeln('    var tmpArray = new Array();');
parent.frameMainRight.document.writeln('    if (tmpStr.match("%26")) {');

parent.frameMainRight.document.writeln('      tmpArray = tmpStr.split("%26");');
parent.frameMainRight.document.writeln('    } else {');

parent.frameMainRight.document.writeln('      tmpArray = tmpStr.split("&");');
parent.frameMainRight.document.writeln('    }');
parent.frameMainRight.document.writeln('    for (i in tmpArray) {');
parent.frameMainRight.document.writeln('      var param = tmpArray[i].split("=");');
parent.frameMainRight.document.writeln('      if (param[0] != "") {');
parent.frameMainRight.document.writeln('        this.paramArray[param[0]] = param[1];');
parent.frameMainRight.document.writeln('      }');
parent.frameMainRight.document.writeln('    }');
parent.frameMainRight.document.writeln('  }');

parent.frameMainRight.document.writeln('  this.getParameter = function(name) {');
parent.frameMainRight.document.writeln('    if (!this.paramArray[name]) {');
parent.frameMainRight.document.writeln('      return null;');
parent.frameMainRight.document.writeln('    }');
parent.frameMainRight.document.writeln('    return this.paramArray[name];');
parent.frameMainRight.document.writeln('  }');
parent.frameMainRight.document.writeln('}');

parent.frameMainRight.document.writeln('function AttributeContainer()');
parent.frameMainRight.document.writeln('{');

parent.frameMainRight.document.writeln(' this.attrMap = new ActiveXObject("Scripting.Dictionary")');
parent.frameMainRight.document.writeln(' this.getAttribute = function(name)');
parent.frameMainRight.document.writeln(' {');
parent.frameMainRight.document.writeln('   if (this.attrMap.Exists(name))');
parent.frameMainRight.document.writeln('   {');
     
parent.frameMainRight.document.writeln('     return this.attrMap.Item(name);');
parent.frameMainRight.document.writeln('   }');
   
parent.frameMainRight.document.writeln('   return null;');
parent.frameMainRight.document.writeln(' }');
parent.frameMainRight.document.writeln(' this.setAttribute = function(name, value)');
parent.frameMainRight.document.writeln(' {');
    
parent.frameMainRight.document.writeln('   if (this.attrMap.Exists(name))');
parent.frameMainRight.document.writeln('   {');
parent.frameMainRight.document.writeln('     this.attrMap.Remove(name);');
parent.frameMainRight.document.writeln('     this.attrMap.Add(name, value);');
parent.frameMainRight.document.writeln('   }');
parent.frameMainRight.document.writeln('   else');
parent.frameMainRight.document.writeln('   {');
parent.frameMainRight.document.writeln('     this.attrMap.Add(name, value);');
parent.frameMainRight.document.writeln('   }');
parent.frameMainRight.document.writeln(' }');
parent.frameMainRight.document.writeln(' this.removeAttribute = function(name)');
parent.frameMainRight.document.writeln(' {');
parent.frameMainRight.document.writeln('   if (this.attrMap.Exists(name))');
parent.frameMainRight.document.writeln('   {');
parent.frameMainRight.document.writeln('     return this.attrMap.Remove(name);');
parent.frameMainRight.document.writeln('   }');
parent.frameMainRight.document.writeln(' }');
parent.frameMainRight.document.writeln('}');
parent.frameMainRight.document.writeln('var application = new AttributeContainer();');
parent.frameMainRight.document.writeln('var session = new AttributeContainer();');

/**Modified on 2006/01/12 for removing Window dependency **/
parent.frameMainRight.document.writeln('try');
parent.frameMainRight.document.writeln('{');
parent.frameMainRight.document.writeln('	application=getRootWindow(window)._application;');
parent.frameMainRight.document.writeln('	session=getRootWindow(window)._session');
parent.frameMainRight.document.writeln('}');
parent.frameMainRight.document.writeln('catch(e)');
parent.frameMainRight.document.writeln('{');
//	alert("Error in context.js");
parent.frameMainRight.document.writeln('}');

parent.frameMainRight.document.writeln('var request = new _request();');
//*************************************************************************************************************
parent.frameMainRight.document.writeln('function doSection(section) {');
parent.frameMainRight.document.writeln('var a = new Array();');
parent.frameMainRight.document.writeln('a = document.all(section);');
parent.frameMainRight.document.writeln('if(a!= null)');
parent.frameMainRight.document.writeln('{');
parent.frameMainRight.document.writeln('if(a.parentElement.tagName =="TD")');
parent.frameMainRight.document.writeln('		a.parentElement.style.width = "70%";');
parent.frameMainRight.document.writeln('	if(a.style)');
parent.frameMainRight.document.writeln('	{');
parent.frameMainRight.document.writeln('		if(a.style.display == "none") {');
parent.frameMainRight.document.writeln('		a.style.display = "block";');
parent.frameMainRight.document.writeln('		}');
parent.frameMainRight.document.writeln('		else {');
parent.frameMainRight.document.writeln('			a.style.display = "none";');
parent.frameMainRight.document.writeln('		}	');
parent.frameMainRight.document.writeln('	}');
parent.frameMainRight.document.writeln('	else');
parent.frameMainRight.document.writeln('	{');
parent.frameMainRight.document.writeln('		 for(i=0; i<a.length; i++)');
parent.frameMainRight.document.writeln('		 {');
parent.frameMainRight.document.writeln('			if (document.all(section)(i).style.display == "none") {');
parent.frameMainRight.document.writeln('				document.all(section)(i).style.display = "block";');
parent.frameMainRight.document.writeln('			} else {');
parent.frameMainRight.document.writeln('				document.all(section)(i).style.display = "none";');
parent.frameMainRight.document.writeln('			}');
parent.frameMainRight.document.writeln('		  }');
parent.frameMainRight.document.writeln('	}');
parent.frameMainRight.document.writeln('	}');
parent.frameMainRight.document.writeln('}');

parent.frameMainRight.document.writeln('function all_view(flag) {');
  
parent.frameMainRight.document.writeln('  var objDiv = document.all.tags("div");');

parent.frameMainRight.document.writeln('  if (flag)	{');
parent.frameMainRight.document.writeln('    for (var i = 0; i < objDiv.length; i++) {');
parent.frameMainRight.document.writeln('      if(objDiv[i].id.indexOf("sec") != -1) {');
parent.frameMainRight.document.writeln('        objDiv[i].style.display = "block";');
parent.frameMainRight.document.writeln('	objDiv[i].parentElement.style.width = "70%";');
parent.frameMainRight.document.writeln('      }');
parent.frameMainRight.document.writeln('    }');
parent.frameMainRight.document.writeln('  } else {');
parent.frameMainRight.document.writeln('    for(var i = 0; i < objDiv.length; i++) {');
parent.frameMainRight.document.writeln('      if (objDiv[i].id.indexOf("sec") != -1) {');
parent.frameMainRight.document.writeln('        objDiv[i].style.display = "none";');
parent.frameMainRight.document.writeln('	objDiv[i].parentElement.style.width = "0%";');
parent.frameMainRight.document.writeln('      }');
parent.frameMainRight.document.writeln('    }');
parent.frameMainRight.document.writeln('    location.href = "#pagetop";');
parent.frameMainRight.document.writeln('  }');
parent.frameMainRight.document.writeln('}');

parent.frameMainRight.document.writeln('function all_view_component(flag)');
parent.frameMainRight.document.writeln('{');
parent.frameMainRight.document.writeln('var objDiv = document.all.tags("td");');
  
parent.frameMainRight.document.writeln('  if (flag)	{');
 
parent.frameMainRight.document.writeln('    for (var i = 0; i < objDiv.length; i++) {');
parent.frameMainRight.document.writeln('      if(objDiv[i].id.indexOf("sec") != -1) {');
parent.frameMainRight.document.writeln('		  objDiv[i].parentElement.children[0].colSpan = "1"');
parent.frameMainRight.document.writeln('        objDiv[i].style.display = "block";');
parent.frameMainRight.document.writeln('	objDiv[i].parentElement.style.width = "70%";');
parent.frameMainRight.document.writeln('      }');
parent.frameMainRight.document.writeln('    }');
parent.frameMainRight.document.writeln('  } else {');

parent.frameMainRight.document.writeln('    for(var i = 0; i < objDiv.length; i++) {');
parent.frameMainRight.document.writeln('      if (objDiv[i].id.indexOf("sec") != -1) {');
parent.frameMainRight.document.writeln('		  objDiv[i].parentElement.children[0].colSpan = "2"');
parent.frameMainRight.document.writeln('        objDiv[i].style.display = "none";');
parent.frameMainRight.document.writeln('				objDiv[i].parentElement.style.width = "0%";');
parent.frameMainRight.document.writeln('      }');
parent.frameMainRight.document.writeln('    }');
parent.frameMainRight.document.writeln('    location.href = "#pagetop";');
parent.frameMainRight.document.writeln('  }');
parent.frameMainRight.document.writeln('}');

parent.frameMainRight.document.writeln('function doSectionComponent(section) {');

parent.frameMainRight.document.writeln('	var a = new Array();');
parent.frameMainRight.document.writeln('	a = document.all(section);');
parent.frameMainRight.document.writeln('	if(a!= null)');
parent.frameMainRight.document.writeln('	{');

	
parent.frameMainRight.document.writeln('	if(a.parentElement.tagName =="td")');
parent.frameMainRight.document.writeln('		{');
parent.frameMainRight.document.writeln('		a.parentElement.style.width = "70%";');
parent.frameMainRight.document.writeln('		}');
		
parent.frameMainRight.document.writeln('	if(a.style)');
parent.frameMainRight.document.writeln('	{');
parent.frameMainRight.document.writeln('		if(a.style.display == "none") {');
parent.frameMainRight.document.writeln('			a.parentElement.children[0].colSpan = "1"');
parent.frameMainRight.document.writeln('			a.style.display = "block";');
parent.frameMainRight.document.writeln('		}');
parent.frameMainRight.document.writeln('		else {');
parent.frameMainRight.document.writeln('			a.parentElement.children[0].colSpan = "2"');
parent.frameMainRight.document.writeln('			a.style.display = "none";');

parent.frameMainRight.document.writeln('		}	');
parent.frameMainRight.document.writeln('	}');
parent.frameMainRight.document.writeln('	else');
parent.frameMainRight.document.writeln('	{');
parent.frameMainRight.document.writeln('		 for(i=0; i<a.length; i++)');
parent.frameMainRight.document.writeln('		 {');
parent.frameMainRight.document.writeln('			if (document.all(section)(i).style.display == "none") {');
parent.frameMainRight.document.writeln('				document.all(section)(i).style.display = "block";');
parent.frameMainRight.document.writeln('			} else {');
parent.frameMainRight.document.writeln('				document.all(section)(i).style.display = "none";');

parent.frameMainRight.document.writeln('			}');
parent.frameMainRight.document.writeln('		  }');
parent.frameMainRight.document.writeln('	}');
parent.frameMainRight.document.writeln('	}');
parent.frameMainRight.document.writeln('}');


parent.frameMainRight.document.writeln('function setPrevViewed()');
parent.frameMainRight.document.writeln('{');
parent.frameMainRight.document.writeln('	        var previousvalue, nextvalue, sieinfoid,pageopenmode,prevnexttype=false;');
parent.frameMainRight.document.writeln('		if(request.getParameter("PageOpenMode") != null)');
parent.frameMainRight.document.writeln('			pageopenmode = request.getParameter("PageOpenMode");');
parent.frameMainRight.document.writeln('		else if(this.document)');
parent.frameMainRight.document.writeln('			pageopenmode = this.document.sienew.hdradiobutton.value;');
parent.frameMainRight.document.writeln('		if(request.getParameter("sieinfoid") != null)');
parent.frameMainRight.document.writeln('			sieinfoid = request.getParameter("sieinfoid");');
parent.frameMainRight.document.writeln('		if(request.getParameter("prevnexttype") != null)');
parent.frameMainRight.document.writeln('			prevnexttype = request.getParameter("prevnexttype");');
parent.frameMainRight.document.writeln('		if(request.getParameter("prev") != null)');
parent.frameMainRight.document.writeln('			previousvalue   = request.getParameter("prev");');
parent.frameMainRight.document.writeln('		if(request.getParameter("next") != null)');
parent.frameMainRight.document.writeln('			nextvalue = request.getParameter("next");');
parent.frameMainRight.document.writeln('		url = sieinfoid+ ".html?sieinfoid=" + sieinfoid + "&prevnexttype=" + prevnexttype + "&prev=" +previousvalue+ "&next="+ nextvalue +"&PageOpenMode=" + pageopenmode;');
	
parent.frameMainRight.document.writeln('		if(event.type=="unload"){');
parent.frameMainRight.document.writeln('			 return;');
parent.frameMainRight.document.writeln(' 		 }			');
parent.frameMainRight.document.writeln('		if (event.clientY < 0) {');
parent.frameMainRight.document.writeln('				var PagesOpened = session.getAttribute("PagesOpened")-1;');
parent.frameMainRight.document.writeln('				session.setAttribute("PagesOpened", PagesOpened);');
parent.frameMainRight.document.writeln('			}	');

parent.frameMainRight.document.writeln('}');

parent.frameMainRight.document.writeln('function fncGetSieHeight()');
parent.frameMainRight.document.writeln('{');
parent.frameMainRight.document.writeln('	var winType = window.navigator.userAgent;	');
parent.frameMainRight.document.writeln('	var screen_width=window.screen.width;');
parent.frameMainRight.document.writeln('	var screen_height=window.screen.height;');
parent.frameMainRight.document.writeln('	var subwindheight="";');
parent.frameMainRight.document.writeln('	if(winType.indexOf("MSIE 5.5") != -1)');
parent.frameMainRight.document.writeln('	{');
parent.frameMainRight.document.writeln('		subwindheight = 650;');
parent.frameMainRight.document.writeln('		if(screen_width<=800){');
parent.frameMainRight.document.writeln('			subwindheight = 482;');
parent.frameMainRight.document.writeln('		}');
parent.frameMainRight.document.writeln('	}else');
parent.frameMainRight.document.writeln('	{');
parent.frameMainRight.document.writeln('		subwindheight = 642;');
parent.frameMainRight.document.writeln('		if(screen_width<=800){');
parent.frameMainRight.document.writeln('			subwindheight = 476;');
parent.frameMainRight.document.writeln('		}');
parent.frameMainRight.document.writeln('	}');
parent.frameMainRight.document.writeln('	return subwindheight;		');
parent.frameMainRight.document.writeln('}');

parent.frameMainRight.document.writeln('function fncSieOpen(url) {');
	
parent.frameMainRight.document.writeln('		url=url+"&PageOpenMode=";');
parent.frameMainRight.document.writeln('		url=url+this.document.sietree.checkboxvalue.value;');

parent.frameMainRight.document.writeln('		var winName = "ESMSUB";');
parent.frameMainRight.document.writeln('		var screen_width=window.screen.width;');
parent.frameMainRight.document.writeln('		var screen_height=window.screen.height;');

parent.frameMainRight.document.writeln('		var subwintop = window.parent.frames(0).screenTop;');
parent.frameMainRight.document.writeln('		var subwinleft = window.parent.screen.width - 792;');
parent.frameMainRight.document.writeln('		var subwinwidth = 780;');

parent.frameMainRight.document.writeln('		var subwinheight = fncGetSieHeight();');
parent.frameMainRight.document.writeln('		if(screen_width<=800)		{');
parent.frameMainRight.document.writeln('			var subwintop = window.parent.frames(0).screenTop;');
parent.frameMainRight.document.writeln('			var subwinleft = window.parent.screen.width - 752;');
parent.frameMainRight.document.writeln('			var subwinwidth = 740;');

parent.frameMainRight.document.writeln('			var subwinheight = fncGetSieHeight();');
parent.frameMainRight.document.writeln('		}else if(screen_height<=600)		{');
parent.frameMainRight.document.writeln('		subwinwidth = 710;');

parent.frameMainRight.document.writeln('			subwinheight = fncGetSieHeight();');
parent.frameMainRight.document.writeln('			subwinleft = 78;');
parent.frameMainRight.document.writeln('			subwintop = 25;  ');
		
parent.frameMainRight.document.writeln('		}');
parent.frameMainRight.document.writeln('		var option = "toolbar=no,location=no,direcries=no,status=no,menubar=no, ";');
parent.frameMainRight.document.writeln('		option+="scrollbars=yes,resizable=yes,width="+subwinwidth+",height="+subwinheight+",left="+subwinleft+",top="+subwintop; ');

parent.frameMainRight.document.writeln('		var oWin = window.open(url,winName,option);');
parent.frameMainRight.document.writeln('		oWin.focus();');
parent.frameMainRight.document.writeln('		var PagesOpened = session.getAttribute("PagesOpened")+1;');
parent.frameMainRight.document.writeln('		session.setAttribute("PagesOpened", PagesOpened);');

parent.frameMainRight.document.writeln('}');

parent.frameMainRight.document.writeln('function fncSieOpenLinkPortal(url){');
parent.frameMainRight.document.writeln('	var winName = "ESMSUB";');
parent.frameMainRight.document.writeln('	var screen_width=window.screen.width;');
parent.frameMainRight.document.writeln('	var screen_height=window.screen.height;');
parent.frameMainRight.document.writeln('	var subwintop =28;');
parent.frameMainRight.document.writeln('	var subwinleft = 232;');
parent.frameMainRight.document.writeln('	var subwinwidth = 780;');

parent.frameMainRight.document.writeln('	var subwinheight = fncGetSieHeight();');
parent.frameMainRight.document.writeln('	if(screen_width<=800)		{');
parent.frameMainRight.document.writeln('		var subwintop =28;');
parent.frameMainRight.document.writeln('		var subwinleft = 48;');
parent.frameMainRight.document.writeln('		var subwinwidth = 740;');

parent.frameMainRight.document.writeln('		var subwinheight = fncGetSieHeight();');
parent.frameMainRight.document.writeln('	}else if(screen_height<=600)		{');
parent.frameMainRight.document.writeln('		subwinwidth = 710;');

parent.frameMainRight.document.writeln('		subwinheight = fncGetSieHeight();');
parent.frameMainRight.document.writeln('		subwinleft = 78;');
parent.frameMainRight.document.writeln('		subwintop = 25;  		');
parent.frameMainRight.document.writeln('	}');
parent.frameMainRight.document.writeln('	var option = "toolbar=no,location=no,direcries=no,status=no,menubar=no, ";');
parent.frameMainRight.document.writeln('	option+="scrollbars=yes,resizable=yes,width="+subwinwidth+",height="+subwinheight+",left="+subwinleft+",top="+subwintop; ');

parent.frameMainRight.document.writeln('	var oWin = window.open(url,winName,option);');
parent.frameMainRight.document.writeln('	oWin.focus();');
parent.frameMainRight.document.writeln('}');

parent.frameMainRight.document.writeln('function fncOpenConsultSie(url,dtcflag) {');
parent.frameMainRight.document.writeln('		url=url+"&PageOpenMode=";');
parent.frameMainRight.document.writeln('		url=url+this.document.sietree.checkboxvalue.value;');
parent.frameMainRight.document.writeln('		var PageOpenMode = this.document.sietree.checkboxvalue.value;');

parent.frameMainRight.document.writeln('		var winName = "ESMSUB";		');
parent.frameMainRight.document.writeln('		var screen_width=window.screen.width;');
parent.frameMainRight.document.writeln('		var screen_height=window.screen.height;');
parent.frameMainRight.document.writeln('		var subwintop =28;');
parent.frameMainRight.document.writeln('		var subwinleft = 232;');
parent.frameMainRight.document.writeln('		var subwinwidth = 780;');

parent.frameMainRight.document.writeln('		var subwinheight = fncGetSieHeight();');
parent.frameMainRight.document.writeln('		if(screen_width<=800)		{');
parent.frameMainRight.document.writeln('			var subwintop =28 ;');
parent.frameMainRight.document.writeln('			var subwinleft = 48;');
parent.frameMainRight.document.writeln('			var subwinwidth = 740;');

parent.frameMainRight.document.writeln('			var subwinheight = fncGetSieHeight();');
parent.frameMainRight.document.writeln('		}else if(screen_height<=600)		{');
parent.frameMainRight.document.writeln('			subwinwidth = 710;');

parent.frameMainRight.document.writeln('			subwinheight = fncGetSieHeight();');
parent.frameMainRight.document.writeln('			subwinleft = 78;');
parent.frameMainRight.document.writeln('			subwintop = 25;  ');
		
parent.frameMainRight.document.writeln('		}');
parent.frameMainRight.document.writeln('	if( dtcflag == true){');
parent.frameMainRight.document.writeln('		var subwintop =400;');
parent.frameMainRight.document.writeln('		var subwinleft = 208;');
parent.frameMainRight.document.writeln('		var subwinwidth = 804;');
parent.frameMainRight.document.writeln('		var subwinheight = 300;');
parent.frameMainRight.document.writeln('		if(screen_width<=800 || screen_height<=600) {');
parent.frameMainRight.document.writeln('			var subwintop =312;');
parent.frameMainRight.document.writeln('			var subwinleft = 162;');
parent.frameMainRight.document.writeln('			var subwinwidth = 628;');
parent.frameMainRight.document.writeln('			var subwinheight = 235;');
parent.frameMainRight.document.writeln('		}');
parent.frameMainRight.document.writeln('		var option = "toolbar=no,location=no,direcries=no,status=no,menubar=no, ";');
parent.frameMainRight.document.writeln('		option+="scrollbars=yes,resizable=yes,width="+subwinwidth+",height="+subwinheight+",left="+subwinleft+",top="+subwintop; ');

parent.frameMainRight.document.writeln('		var oWin = window.open(url,winName,option);');
parent.frameMainRight.document.writeln('		oWin.focus();');
parent.frameMainRight.document.writeln('	}else');
parent.frameMainRight.document.writeln('	{');

parent.frameMainRight.document.writeln('		var option = "toolbar=no,location=no,direcries=no,status=no,menubar=no, ";');
parent.frameMainRight.document.writeln('		option+="scrollbars=yes,resizable=yes,width="+subwinwidth+",height="+subwinheight+",left="+subwinleft+",top="+subwintop; ');


parent.frameMainRight.document.writeln('		var oWin = window.open(url,winName,option);');
parent.frameMainRight.document.writeln('		oWin.focus();');

parent.frameMainRight.document.writeln('	}');
parent.frameMainRight.document.writeln('}');
parent.frameMainRight.document.writeln('function fnCheckBox(chkval,val)');
parent.frameMainRight.document.writeln('{');

parent.frameMainRight.document.writeln('var open=val;');

parent.frameMainRight.document.writeln('	if(open==1)');
parent.frameMainRight.document.writeln('		this.document.sietree.checkboxvalue.value=1;');
parent.frameMainRight.document.writeln('	else');
parent.frameMainRight.document.writeln('		this.document.sietree.checkboxvalue.value=0;');
		
parent.frameMainRight.document.writeln('}');

parent.frameMainRight.document.writeln('function fnEnableDisableImg(thisImg,otherImg,val)');
parent.frameMainRight.document.writeln('{');
parent.frameMainRight.document.writeln('	session.setAttribute("OpenNewWindow",val);');
parent.frameMainRight.document.writeln('	session.setAttribute("PageOpenMode",val);');
parent.frameMainRight.document.writeln('	var open=val;');

parent.frameMainRight.document.writeln('	if(open==1)');
parent.frameMainRight.document.writeln('	{');
parent.frameMainRight.document.writeln('		this.document.sietree.checkboxvalue.value=1;');
parent.frameMainRight.document.writeln('		thisImg.src="../images/Open_new_window_t_c.jpg";');
parent.frameMainRight.document.writeln('		otherImg.src="../images/Renew_window_t.jpg";');
parent.frameMainRight.document.writeln('	}	');
parent.frameMainRight.document.writeln('	else');
parent.frameMainRight.document.writeln('	{');
parent.frameMainRight.document.writeln('		this.document.sietree.checkboxvalue.value=0;');
parent.frameMainRight.document.writeln('		thisImg.src="../images/Renew_window_t_c.jpg";');
parent.frameMainRight.document.writeln('		otherImg.src="../images/Open_new_window_t.jpg";');
parent.frameMainRight.document.writeln('	}');
parent.frameMainRight.document.writeln('}');

parent.frameMainRight.document.writeln('function fnCheckStateAndDisable(thisImg,otherImg)');
parent.frameMainRight.document.writeln('{');
parent.frameMainRight.document.writeln('	if(thisImg.name=="compare" && (this.document.sietree.checkboxvalue.value==0 || this.document.sietree.checkboxvalue.value=="0"))');
parent.frameMainRight.document.writeln('		fnshowDefault(thisImg);');
parent.frameMainRight.document.writeln('	else if(thisImg.name=="overWrite" && (this.document.sietree.checkboxvalue.value==1 || this.document.sietree.checkboxvalue.value=="1"))');
parent.frameMainRight.document.writeln('		fnshowDefault(thisImg);');
parent.frameMainRight.document.writeln('	else if(thisImg.name=="overWrite" && (this.document.sietree.checkboxvalue.value==0 || this.document.sietree.checkboxvalue.value=="0"))');
parent.frameMainRight.document.writeln('		fnChangeImgOnClick(thisImg);');
parent.frameMainRight.document.writeln('	else if(thisImg.name=="compare" && (this.document.sietree.checkboxvalue.value==1 || this.document.sietree.checkboxvalue.value=="1"))');
parent.frameMainRight.document.writeln('		fnChangeImgOnClick(thisImg);');
parent.frameMainRight.document.writeln('}');

parent.frameMainRight.document.writeln('function fnchangeImg(img)');
parent.frameMainRight.document.writeln('{');
parent.frameMainRight.document.writeln('if(img.name=="compare")');
parent.frameMainRight.document.writeln('	if(document.sietree.checkboxvalue.value==1 || document.sietree.checkboxvalue.value=="1")');
parent.frameMainRight.document.writeln('		img.src="../images/Open_new_window_t_c.jpg";');
parent.frameMainRight.document.writeln('	else');
parent.frameMainRight.document.writeln('	img.src="../images/Open_new_window_t_f.jpg";');
parent.frameMainRight.document.writeln('if(img.name=="overWrite")');
parent.frameMainRight.document.writeln('	if(document.sietree.checkboxvalue.value==0 || document.sietree.checkboxvalue.value=="0")');
parent.frameMainRight.document.writeln('		img.src="../images/Renew_window_t_c.jpg";');
parent.frameMainRight.document.writeln('	else');
parent.frameMainRight.document.writeln('	img.src="../images/Renew_window_t_f.jpg";');
parent.frameMainRight.document.writeln('if(img.name=="btnTitle")');
parent.frameMainRight.document.writeln('img.src="../images/Show_Title_f.jpg";');
parent.frameMainRight.document.writeln('if(img.name=="btnAll")');
parent.frameMainRight.document.writeln('img.src="../images/Show_Detail_f.jpg";');
parent.frameMainRight.document.writeln('}');

parent.frameMainRight.document.writeln('function fnshowDefault(img)');
parent.frameMainRight.document.writeln('{');
parent.frameMainRight.document.writeln('if(img.name=="compare")');
parent.frameMainRight.document.writeln('img.src="../images/Open_new_window_t.jpg";');
parent.frameMainRight.document.writeln('if(img.name=="overWrite")');
parent.frameMainRight.document.writeln('img.src="../images/Renew_window_t.jpg";');
parent.frameMainRight.document.writeln('if(img.name=="btnTitle")');
parent.frameMainRight.document.writeln('img.src="../images/Show_Title.jpg";');
parent.frameMainRight.document.writeln('if(img.name=="btnAll")');
parent.frameMainRight.document.writeln('img.src="../images/Show_Detail.jpg";');
parent.frameMainRight.document.writeln('}');

parent.frameMainRight.document.writeln('function fnChangeImgOnClick(img){');
parent.frameMainRight.document.writeln('if(img.name=="btnTitle")');
parent.frameMainRight.document.writeln('img.src="../images/Show_Title_c.jpg";');
parent.frameMainRight.document.writeln('if(img.name=="btnAll")');
parent.frameMainRight.document.writeln('img.src="../images/Show_Detail_c.jpg";');
parent.frameMainRight.document.writeln('if(img.name=="compare")');
parent.frameMainRight.document.writeln('img.src="../images/Open_new_window_t_c.jpg";');
parent.frameMainRight.document.writeln('if(img.name=="overWrite")');
parent.frameMainRight.document.writeln('img.src="../images/Renew_window_t_c.jpg";');
parent.frameMainRight.document.writeln('}');
//**************************************************************************************************************************************
	  parent.frameMainRight.document.writeln('</script>');
	  parent.frameMainRight.document.writeln('</head>');
      parent.frameMainRight.document.writeln('<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" scroll="no">');      
      parent.frameMainRight.document.writeln('<div class="headertitle" style="width:100%;height:'+sizeArr[0]+';PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">');      
      parent.frameMainRight.document.writeln('<table id="windowtable" width="100%" cellpadding=0 cellspacing=0 >');
      parent.frameMainRight.document.writeln('<form name="sietree">');
      parent.frameMainRight.document.writeln('<tr><td valign=top align=left class="topclose">');
      var str = "";
		if(session.getAttribute("OpenNewWindow") == 0)
			{
			        parent.frameMainRight.document.writeln('<input type=hidden name="checkboxvalue" value=0 ID="Hidden1" size=5><b>'+ MANUAL_INFO.vehicle +  ' ('  +  MANUAL_INFO.vehicleNumber +') - ' +  MANUAL_INFO.dispYear + ' - ' +  menuItemName + '</b></td><td valign=top align=right>');
				str = '<img src="../images/Open_new_window_t.jpg" border=0 name="compare" alt="' + getMessage("MSLBT_CreatNewWin") + '" onClick="fnEnableDisableImg(this,document.sietree.overWrite,1);" onmouseover="fnchangeImg(this);"  onmouseout="fnCheckStateAndDisable(this,document.sietree.overWrite);" ><img src="../images/Renew_window_t_c.jpg" border=0 ';  
				str += 'name="overWrite" alt="' + getMessage("MSLBT_RewriteWin") + '" onClick="fnEnableDisableImg(this,document.sietree.compare,0);" onmouseover="fnchangeImg(this);"  onmouseout="fnCheckStateAndDisable(this,document.sietree.compare);"><img src="../images/Show_Title.jpg" border=0 ';
				str += 'name="btnTitle" alt="' + getMessage("MSLBT_DispTools") + '" onclick="fnChangeImgOnClick(this);all_view_component(false)" onmouseover="fnchangeImg(this);" onmouseout="fnshowDefault(this);"><img src="../images/Show_Detail.jpg" border=0 name="btnAll" alt="' + getMessage("MSLBT_DispAll") + '" onclick="fnChangeImgOnClick(this);all_view_component(true)" onmouseover="fnchangeImg(this);" onmouseout="fnshowDefault(this);">	';	 
			}
			else
			{
			        parent.frameMainRight.document.writeln('<input type=hidden name="checkboxvalue" value=1 ID="Hidden1" size=5><b>'+ MANUAL_INFO.vehicle +  ' ('  +  MANUAL_INFO.vehicleNumber +') - ' +  MANUAL_INFO.dispYear + ' - ' +  menuItemName + '</b></td><td valign=top align=right>');
				str = '<img src="../images/Open_new_window_t_c.jpg" border=0 name="compare" alt="' + getMessage("MSLBT_CreatNewWin") + '" onClick="fnEnableDisableImg(this,document.sietree.overWrite,1);" onmouseover="fnchangeImg(this);"  onmouseout="fnCheckStateAndDisable(this,document.sietree.overWrite);" ><img src="../images/Renew_window_t.jpg" border=0 ';  
				str += 'name="overWrite" alt="' + getMessage("MSLBT_RewriteWin") + '" onClick="fnEnableDisableImg(this,document.sietree.compare,0);" onmouseover="fnchangeImg(this);"  onmouseout="fnCheckStateAndDisable(this,document.sietree.compare);"><img src="../images/Show_Title.jpg" border=0 ';
				str += 'name="btnTitle" alt="' + getMessage("MSLBT_DispTools") + '" onclick="fnChangeImgOnClick(this);all_view_component(false)" onmouseover="fnchangeImg(this);" onmouseout="fnshowDefault(this);"><img src="../images/Show_Detail.jpg" border=0 name="btnAll" alt="' + getMessage("MSLBT_DispAll") + '" onclick="fnChangeImgOnClick(this);all_view_component(true)" onmouseover="fnchangeImg(this);" onmouseout="fnshowDefault(this);">	';	 
			}	
      parent.frameMainRight.document.writeln(str);
      parent.frameMainRight.document.writeln('</td></tr>');
      parent.frameMainRight.document.writeln('</form>');	      	  
      parent.frameMainRight.document.writeln('</table>');
      parent.frameMainRight.document.writeln('</div>');      
      parent.frameMainRight.document.writeln('<div style="width:100%;height:'+sizeArr[1]+';overflow:auto;PADDING-RIGHT: 0px; PADDING-LEFT: 0px; border-bottom:1 solid gray;border-top:1 solid gray;border-right:1 solid gray;border-left:1 solid gray;PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">');
      parent.frameMainRight.document.writeln('<a name="pagetop"/>');
      fncWriteResultString(sieArray, sct, sc, config, parent.frameMainRight.document);
      parent.frameMainRight.document.writeln('</div>');  
      parent.frameMainRight.document.writeln('</body>');
      parent.frameMainRight.document.close();
      return true;    
  }
}


