
var Contemp;
var JunctionNo = new Array();

var finit = 0;

var gFigdelay2cnt = 0;
var gCondelaycnt = 0;
var gCondelay2cnt = 0;
var gCondelay3cnt = 0;
var gCondelay4cnt = 0;


function SetConFigIni()
{
	parent.info.SVG_ConiniSet('ChangFrameSize');
}


function FigData_InitWin()
{
	var p1 = 0;
	var p2 = 0;

  	var nJob = GetUrlQueryParam("j");
  	var sCate = GetUrlQueryParam("c");
  	var sSCate = GetUrlQueryParam("sc");
  	var sFig = GetUrlQueryParam("f");
  	var sCon = GetUrlQueryParam("cn");
  	var sHarCon = GetUrlQueryParam("h");
  	var sFigGrp = gXmlFigGrpName[nJob];

	if (sHarCon == "")
	{
		sHarCon = sCon;
	}

	parent.work.Contemp = sHarCon;//global

	if(parent.info.document.all("data") != null)
	{
  		parent.info.document.all("data").innerHTML = "";
	}
  	//parent.info.document.all("data").innerHTML = "";

		if(parent.work.Contemp != "")
		{//case tokutei
			//while(parent.info.document.all("data") == null)
			//{
			//	;
			//}
  			var vHtml = FigData_LoadConnInfoData(2, parent.work.Contemp, "info");

			var key_str = "<form name=\"infoform\" onsubmit=\"return false\;\">";
			var key_len = key_str.length;

			p1 = vHtml.indexOf("<form name=\"infoform\" onsubmit=\"return false\;\">",0);
			p2 = vHtml.indexOf("</form>",p1);

			//if(p2 == (p1 + key_len))20080805arg refine
			if(p2 == (p1 + key_len + 2))
			{//ESM arg error
				vHtml = "<text>" + gConnctorInfomation_ConnectorNotFound + "</text>";
				//TM3 = setTimeout("Arg_Err()",5000);//arg error for connectorID //20080805comment
			}

  			if(vHtml != "")
			{
				parent.info.gConSvgLoadFlag4 = 0;
    			parent.info.document.all("data").innerHTML = vHtml;

				TM7 = setTimeout("Condelay4()",10);

  			}

			TM8 = setTimeout("Figdelay2()",500);
		}
		else
		{//case wrong
			;
		}

  	parent.work.document.body.onmousedown = parent.work.SVG_ScrollbyMouseDragOnMD;
  	parent.work.document.body.onmousemove = parent.work.SVG_ScrollbyMouseDragOnMM;
  	parent.work.document.body.onmouseup = parent.work.SVG_ScrollbyMouseDragOnMU;
  	parent.work.document.body.onmouseout = parent.work.SVG_ScrollbyMouseDragOnMO;
  	parent.work.document.body.oncontextmenu = parent.work.SVG_ScrollbyMoseDragOnCM;
  	parent.work.document.body.onselectstart = parent.work.SVG_ScrollbyMoseDragOnSS;

  	window.focus();

}


function Figdelay2()
{
	if(gFigSvgLoadFlag2 == 0)
	{
		gFigdelay2cnt++;

		if(gFigdelay2cnt > 1000)
		{
			gFigdelay2cnt = 0;
			//alert(gTimeout_Error);
			clearTimeout(TM8);
			return;
		}
		TM8 = setTimeout("Figdelay2()",10);
	}
	else
	{
		gFigdelay2cnt = 0;
		gFigSvgLoadFlag2 = 0;
    	parent.work.SVGSerch("con",parent.work.Contemp,"","list","ListClick");
		clearTimeout(TM8);
	}
}


function Condelay4()
{
	if(parent.info.gConSvgLoadFlag4 == 0)
	{
		gCondelay4cnt++;

		if(gCondelay4cnt > 1000)
		{
			gCondelay4cnt = 0;
			//alert(gTimeout_Error);
			clearTimeout(TM7);
			return;
		}
		TM7 = setTimeout("Condelay4()",10);
	}
	else
	{
		gCondelay4cnt = 0;
		parent.info.gConSvgLoadFlag4 = 0;
    	parent.info.SVG_ConiniSet('list');
		clearTimeout(TM7);
	}
}


function Arg_Err()
{
	var temp = "<text>" + gConnctorInfomation_ConnectorNotFound + "</text>";
	parent.pan.document.all("data").innerHTML = temp;
	parent.list.document.all("data").innerHTML = temp;
	parent.work.document.all("data").innerHTML = temp;

	clearTimeout(TM3);
}


function FigData_Init_TokuteiLink()
{
  	var nJob = GetUrlQueryParam("j");
  	var sCate = GetUrlQueryParam("c");
  	var sSCate =  GetUrlQueryParam("sc");
  	var sFig =  GetUrlQueryParam("f");
	var sFigGrp = gXmlFigGrpName[nJob];

	temp_fig = FigData_LoadFigImageData(sFigGrp, sCate, sSCate, sFig);
	if (temp_fig == "")
	{
		temp_fig = "<text>" + gConnctorInfomation_ConnectorNotFound + "</text>";
	}

	temp_list = FigData_LoadConnData(sFig);

	temp_pan = FigData_LoadFigImage_pan(sFigGrp, sCate, sSCate, sFig);
	if (temp_pan == "")
	{
		temp_pan = "<text>" + gConnctorInfomation_ConnectorNotFound + "</text>";
	}

}

function Make_InfoURL()
{

	gFigSvgLoadFlag3 = 0;

	return parent.temp_fig;
}

function Make_ListURL()
{
	return parent.temp_list;
}

function Make_PanURL()
{
	return parent.temp_pan;
}


function FigData_ClickConnList(vConnNo,obj)
{
	window.parent.fs.cols = 280 + "," + "*" ;//20080912add

	if (gConnObj != "")
	{
		gConnObj.style.backgroundImage = 'url("../../common/image/other/maru.gif")';
		gConnObj.style.backgroundColor = '#FFFFFF';
		gConnObj.style.color = '#666666';
	}

	gConnObj = obj;
	gConnNo = vConnNo;

  	var vHtml = FigData_LoadConnInfoData(2, vConnNo, "info");

  	if(vHtml != "")
	{
		if(parent.info.document.all("data").innerHTML != null)
		{
			parent.info.document.all("data").innerHTML = vHtml;
		}

		parent.info.gConSvgLoadFlag3 = 0;
    	//parent.info.document.all("data").innerHTML = vHtml;

		TM7 = setTimeout("Condelay3()",10);

  	}

 	if(parent.work)
	{//case connector list click
		if(parent.gFigSvgLoadFlag == 1)
		{//viewer exsist
  			parent.work.SVGSerch("con",vConnNo,"","list","ListClick");//Fig is exsist. No Timer
  		}
	}
	return;
}


function Condelay3()
{
	if(parent.info.gConSvgLoadFlag3 == 0)
	{
		gCondelay3cnt++;

		if(gCondelay3cnt > 1000)
		{
			gCondelay3cnt = 0;
			//alert(gTimeout_Error);
			clearTimeout(TM7);
			return;
		}
		TM7 = setTimeout("Condelay3()",10);
	}
	else
	{
		gCondelay3cnt = 0;
		parent.info.gConSvgLoadFlag3 = 0;
    	SVG_ConiniSet('list');
		clearTimeout(TM7);
	}
}


function FigData_LoadConnData(vFigid)
{
	var ndMode = "";

	if(parent.gmsxv == "4")
	{
  		var oDoc = new ActiveXObject("msxml2.DOMDocument.4.0");
  		oDoc.async = false;
  		oDoc.load(gConXmlfile);
  		var oStl = new ActiveXObject("msxml2.DOMDocument.4.0");
	}
	else if(parent.gmsxv == "3")
	{
  		var oDoc = new ActiveXObject("msxml2.DOMDocument.3.0");
  		oDoc.async = false;
  		oDoc.load(gConXmlfile);
  		var oStl = new ActiveXObject("msxml2.DOMDocument.3.0");
	}
	else if(parent.gmsxv == "0")
	{
		Open_XML_Message();
		return;
	}
	else
	{
		alert(gMsxmlVersion_Error3);
		return;
	}

  	oStl.setProperty("SelectionLanguage","XPath");
  	oStl.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");
  	oStl.async = false;
  	oStl.load(gConXslfile);

  	ndMode = oStl.selectSingleNode("//xsl:variable[@name='viewmode']");
  	//ndMode.text = "list";//20080826 comment
	ndMode.text = "list5";//20080826 connector list mod

  	ndMode = oStl.selectSingleNode("//xsl:variable[@name='ConnectorList']");
  	ndMode.text = gConnctorInfomation_ConnectorList;

	if(vFigid != "")
	{
    	var sRet = "";

		if(parent.gmsxv == "4")
		{
    		var oWDoc = new ActiveXObject("msxml2.DOMDocument.4.0");
		}
		else if(parent.gmsxv == "3")
		{
    		var oWDoc = new ActiveXObject("msxml2.DOMDocument.3.0");
		}

    	var ndWk = oWDoc.createNode("1","connector","");

		var ndPickup = oDoc.selectNodes("/connector/con/link/fig[@id='" + vFigid + "']");
		var length = ndPickup.length;

		if (length != 0)
		{
			for(var i = 0; i < length; i++)
			{
     			ndWk.appendChild(ndPickup.item(i).parentNode.parentNode);
   			}
    		oWDoc.appendChild(ndWk);
    		sRet = oWDoc.transformNode(oStl);
		}
		else
		{
			sRet = "<text>" + gConnctorInfomation_ConnectorNotFound + "</text>";
		}
  	}
	else
	{
    	//sRet = oDoc.transformNode(oStl);
    	sRet = "";
  	}

  	return sRet;

}


function FigData_LoadConnInfoData(vConside, vConnList, nMode)
{
	var temp = "";

  	var nJob = GetUrlQueryParam("j");
  	var sCate = GetUrlQueryParam("c");
  	var sSCate = GetUrlQueryParam("sc");
  	var sFig = GetUrlQueryParam("f");

  	var sFigGrp = gXmlFigGrpName[nJob];

	if(parent.gmsxv == "4")
	{
  		var oDoc = new ActiveXObject("msxml2.DOMDocument.4.0");
  		oDoc.async = false;
  		oDoc.load(gConXmlfile);
  		var oStl = new ActiveXObject("msxml2.DOMDocument.4.0");
	}
	else if(parent.gmsxv == "3")
	{
  		var oDoc = new ActiveXObject("msxml2.DOMDocument.3.0");
  		oDoc.async = false;
  		oDoc.load(gConXmlfile);
  		var oStl = new ActiveXObject("msxml2.DOMDocument.3.0");
	}
	else if(parent.gmsxv == "0")
	{
		Open_XML_Message();
		return;
	}
	else
	{
		alert(gMsxmlVersion_Error3);
		return;
	}

  	oStl.setProperty("SelectionLanguage","XPath");
  	oStl.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");
  	oStl.async = false;

  	oStl.load(gConXslfile);

  	var ndVar = oStl.selectSingleNode("//xsl:variable[@name='viewmode']");

  	ndVar.text = nMode;
  	switch(vConside)
	{
    	case 1:
      		vConside = "Terminal-side";
      		break;

    	case 2:
      		vConside = "Harness-side";
      		break;

    	default:
      		vConside = "Terminal-side";
      		break;
  	}

  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='conside']");
  	ndVar.text = vConside;
  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='conimgfolder']");
  	ndVar.text = gConimgfolder;
  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='figgroup']");
  	ndVar.text = sFigGrp;
  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='figid']");
  	ndVar.text = sFig;

  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='ConnectorInfomation']");
  	ndVar.text = gConnctorInfomation_ConnectorInfomation;

  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='FuseNo1']");
  	ndVar.text = gConnctorInfomation_FuseNo1;

  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='ConnectorNo']");
  	ndVar.text = gConnctorInfomation_ConnectorNo;

  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='ConnectorName']");
  	ndVar.text = gConnctorInfomation_ConnectorName;

  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='ConnectorType']");
  	ndVar.text = gConnctorInfomation_ConnectorType;

  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='ConnectorRevers']");
  	ndVar.text = gConnctorInfomation_ConnectorRevers;


  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='HarnessSide']");
  	ndVar.text = gConnctorInfomation_HarnessSide;

  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='Shield']");
  	ndVar.text = gConnctorInfomation_Shield;


  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='Fuse']");
  	ndVar.text = gConnctorInfomation_Fuse;


  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='FuseNo']");
  	ndVar.text = gConnctorInfomation_FuseNo;

  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='Terminal']");
  	ndVar.text = gConnctorInfomation_Terminal;

  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='TerminalNo']");
  	ndVar.text = gConnctorInfomation_TerminalNo;

  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='WireColor']");
  	ndVar.text = gConnctorInfomation_WireColor;

  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='SignalName']");
  	ndVar.text = gConnctorInfomation_SignalName;

  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='Spec']");
  	ndVar.text = gConnctorInfomation_Spec;

  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='ConnectorNotFound']");
  	ndVar.text = gConnctorInfomation_ConnectorNotFound;

  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='WireToWire']");
  	ndVar.text = gJunction_WireToWire;


  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='JunctionMode']");
  	var JcMode = gDefine_JunctionMode;

	ndVar.text = JcMode;

  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='figgroup2']");

	switch(sFigGrp)
	{
		case "Circuit Diagram":
			temp = gCategory_CircuitDiagram;
			break;

		case "Harness Layout":
			temp = gCategory_HarnessLayout;
			break;

		case "Power Source / Grounding / Sneak Path":
			if(JcMode == "Y")
			{
  				temp = gCategory_PowerSource_Grounding_SneakPath1;
			}
			else
			{
  				temp = gCategory_PowerSource_Grounding_SneakPath2;
			}
			break;
	}
	ndVar.text = temp;

  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='PowerName']");
	if(JcMode == "Y")
	{
  		ndVar.text = gCategory_PowerSource_Grounding_SneakPath1;
	}
	else
	{
  		ndVar.text = gCategory_PowerSource_Grounding_SneakPath2;
	}

  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='CircuitDiagram']");
  	ndVar.text = gCategory_CircuitDiagram;

  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='HarnessLayout']");
  	ndVar.text = gCategory_HarnessLayout;

  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='PowerSource_Grounding_SneakPath']");
  	ndVar.text = gCategory_PowerSource_Grounding_SneakPath2;


////////////////////////////////////////////////////////////////////////
  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='SQotName']");
  	ndVar.text = "'";
  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='DELIName']");
  	ndVar.text = "DELIMITAsqot";



  	if(vConnList != "")
	{
    	var sConns = vConnList.split("\t");
    	var sRet = "";

		if(parent.gmsxv == "4")
		{
    		var oWDoc = new ActiveXObject("msxml2.DOMDocument.4.0");
		}
		else if(parent.gmsxv == "3")
		{
    		var oWDoc = new ActiveXObject("msxml2.DOMDocument.3.0");
		}

    	var ndWk = oWDoc.createNode("1","connector","");
		var length = sConns.length;

    	for(var i = 0; i < length; i++)
		{
      		if(sConns[i] != "")
			{
        		var ndPickup = oDoc.selectNodes("/connector/con[@no='" + sConns[i] + "']");
				var length2 = ndPickup.length;

        		for(var j = 0; j < length2; j++)
				{
          			ndWk.appendChild(ndPickup.item(j));
        		}
      		}
    	}
    	oWDoc.appendChild(ndWk);
    	sRet = oWDoc.transformNode(oStl);
  	}
	else
	{
    	sRet = oDoc.transformNode(oStl);
  	}

  	return sRet;

}


function GetConLinkName(vConnObj)
{

	var linkFig = vConnObj.getElementsByTagName('fig');
	var length = linkFig.length;
	for(i = 0; i < length; i++)
	{
		var linkNameValue = linkFig.item(i).firstChild.firstChild.nodeValue;
		var CateName = GetConLinkCate(linkNameValue);
		if(CateName)
		{
			linkNameValue = linkNameValue + '(' + CateName + ')';
		}
	}
	return vConnObj;

}


function GetConLinkCate(LinkName)
{
	if(parent.gmsxv == "4")
	{
		var oDoc_fig = new ActiveXObject("msxml2.DOMDocument.4.0");
	}
	else if(parent.gmsxv == "3")
	{
		var oDoc_fig = new ActiveXObject("msxml2.DOMDocument.3.0");
	}
	else if(parent.gmsxv == "0")
	{
		Open_XML_Message();
		return;
	}
	else
	{
		alert(gMsxmlVersion_Error3);
		return;
	}
	oDoc_fig.async = false;
	oDoc_fig.load(gFListXmlfile);

	var LinkFigNameObj = oDoc_fig.getElementsByTagName('name');
	var length = LinkFigNameObj.length;
	for(i = 0; i < length; i++)
	{
		var LinkFigNameObjValue = LinkFigNameObj.item(i).firstChild.nodeValue;

		if(LinkFigNameObjValue == LinkName)
		{
			TargetObj = LinkFigNameObj.item(i);

			for(j = 0; j < 10; j++)
			{
				CateObj = TargetObj.parentNode;

				if(CateObj.nodeName == "category")
				{
					var CateName = CateObj.firstChild.firstChild.nodeValue;
					return CateName;
				}
				else
				{
					 TargetObj = TargetObj.parentNode;
				}
			}
		}

	}

}


function FigData_ChangeConnImageBySide(vConnNo,vTImgfile,vHImgfile, obj)
{
	Rev_MouseClick(obj);

  	var id1 = "thstxt" + vConnNo;
  	var id2 = "thsimg" + vConnNo;
  	var id3 = "sideImg" + vConnNo;
  	var imghtml = "";

	//while(document.all(id1).innerHTML == null)
	//{
	//	;
	//}
	//while(document.all(id2).innerHTML == null)
	//{
	//	;
	//}
	//while(document.all(id3).innerHTML == null)
	//{
	//	;
	//}

  	if(document.all(id1).innerHTML == "Terminal-side")
	{
    	document.all(id1).innerHTML = "Harness-side";
    	imghtml = "<embed type=\"image/svg-xml\" WMODE=\"transparent\" name=\"ConFigsvg\" src=\"" + gConimgfolder + vHImgfile + "\"></embed>";//20070705 Modify

    	document.all(id3).src = "../../common/image/other/hs.gif";
		document.all(id3).alt = gConnctorInfomation_HarnessSide;
  	}
	else
	{
    	document.all(id1).innerHTML = "Terminal-side";
    	imghtml = "<embed type=\"image/svg-xml\" WMODE=\"transparent\" name=\"ConFigsvg\" src=\"" + gConimgfolder + vTImgfile + "\"></embed>";//20070705 Modify

    	document.all(id3).src = "../../common/image/other/ts.gif";
		document.all(id3).alt = gConnctorInfomation_TerminalSide;
  	}

	gConSvgLoadFlag = 0;

  	//gsvgCnt = window.parent.info.document.getElementsByTagName('embed').length-1;
  	document.all(id2).innerHTML = imghtml;

	TM7 = setTimeout("Condelay()",10);

}


function Condelay()
{
	if(gConSvgLoadFlag == 0)
	{
		gCondelaycnt++;

		if(gCondelaycnt > 1000)
		{
			gCondelaycnt = 0;
			//alert(gTimeout_Error);
			clearTimeout(TM7);
			return;
		}
		TM7 = setTimeout("Condelay()",10);
	}
	else
	{
		gCondelaycnt = 0;
		gConSvgLoadFlag = 0;
    	SVG_ConiniSet('list');
		clearTimeout(TM7);
	}
}


function FigData_LoadFigImageData(vFiggroup, vCategory, vSubcategory, vFigid)
{

//*** activeX support 20080911***
	if (vFiggroup == "Circuit Diagram")
	{
		gSvgFile_Name = "circuit/svg/" + vFigid + ".svg";
	}
	else if(vFiggroup == "Power Source / Grounding / Sneak Path")
	{
		gSvgFile_Name = "poeama/svg/" + vFigid + ".svg";
	}
	else if(vFiggroup == "Harness Layout")
	{
		gSvgFile_Name = "harness/svg/" + vFigid + ".svg";
	}
	else
	{
		//
	}
//*** activeX support 20080911***

	if(parent.gmsxv == "4")
	{
  		var oDoc = new ActiveXObject("msxml2.DOMDocument.4.0");
  		oDoc.async = false;
  		oDoc.load(gFListXmlfile);
  		var oStl = new ActiveXObject("msxml2.DOMDocument.4.0");
	}
	else if(parent.gmsxv == "3")
	{
  		var oDoc = new ActiveXObject("msxml2.DOMDocument.3.0");
  		oDoc.async = false;
  		oDoc.load(gFListXmlfile);
  		var oStl = new ActiveXObject("msxml2.DOMDocument.3.0");
	}
	else if(parent.gmsxv == "0")
	{
		Open_XML_Message();
		return;
	}
	else
	{
		alert(gMsxmlVersion_Error3);
		return;
	}
  	oStl.setProperty("SelectionLanguage","XPath");
  	oStl.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");
  	oStl.async = false;
  	oStl.load(gFListXslfile);

  	var ndVar = oStl.selectSingleNode("//xsl:variable[@name='viewmode']");
  	ndVar.text = "figimg";
  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='figgroup']");
  	ndVar.text = vFiggroup;

  	var sfimgfld = GetFolderFromFiggroup(vFiggroup);
  	sfimgfld+="svg/";
  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='figimgfolder']");
  	ndVar.text = sfimgfld;

  	var sUrlparam1 = "category.html?j=" + GetJobNoFromFiggroup(vFiggroup);
  	var sUrlparam2 = "";
  	var sUrlparam3 = "";

  	var sRet = "";
  	if(vFigid != "")
	{
		if(parent.gmsxv == "4")
		{
    		var oWDoc = new ActiveXObject("msxml2.DOMDocument.4.0");
		}
		else if(parent.gmsxv == "3")
		{
    		var oWDoc = new ActiveXObject("msxml2.DOMDocument.3.0");
		}

    	var ndWk = oWDoc.createNode("1","figlist","");
    	var ndPickup;

    	if(vFiggroup == gXmlFigGrpName[gXmlFigGrpCircuit] || vFiggroup == gXmlFigGrpName[gXmlFigGrpPoEaMa])
		{

      		ndPickup = oDoc.selectSingleNode("/figlist/figgroup/category/subcategory[fig/@id='" + vFigid + "']");

			if (ndPickup != null)
			{
      			vSubcategory = ndPickup.getAttribute("name");

      			ndPickup = oDoc.selectSingleNode("/figlist/figgroup/category[subcategory/fig/@id='" + vFigid + "']");
      			vCategory    = ndPickup.getElementsByTagName("name").item(0).text;

      			sUrlparam2 = sUrlparam1 + "&c=" + ndPickup.getAttribute("id");
      			sUrlparam3 = sUrlparam2 + "&sc=" + escape(vSubcategory);

      			ndVar = oStl.selectSingleNode("//xsl:variable[@name='category']");
      			ndVar.text = vCategory;
      			ndVar = oStl.selectSingleNode("//xsl:variable[@name='subcategory']");
      			ndVar.text = vSubcategory;

      			ndPickup = oDoc.selectNodes("/figlist/figgroup/category/subcategory/fig[@id='" + vFigid + "']");
			}
			else
			{
				sRet = "";
				return sRet;
			}

    	}
		else if(vFiggroup == gXmlFigGrpName[gXmlFigGrpPoEaMa])
		{
			;
		}
    	else
		{
      		ndPickup = oDoc.selectNodes("/figlist/figgroup/fig[@id='" + vFigid + "']");
			if (ndPickup == null)
			{
				sRet = "";
				return sRet;
			}
    	}

		var length = ndPickup.length;

    	for(var i = 0; i < length; i++)
		{
      		ndWk.appendChild(ndPickup.item(i));
    	}
    	oWDoc.appendChild(ndWk);

   		ndVar = oStl.selectSingleNode("//xsl:variable[@name='urlparam1']");
    	ndVar.text = sUrlparam1;
    	ndVar = oStl.selectSingleNode("//xsl:variable[@name='urlparam2']");
    	ndVar.text = sUrlparam2;
    	ndVar = oStl.selectSingleNode("//xsl:variable[@name='urlparam3']");
    	ndVar.text = sUrlparam3;

    	sRet = oWDoc.transformNode(oStl);

  	}

  	return sRet;

}


function FigData_LoadFigImage_pan(vFiggroup, vCategory, vSubcategory, vFigid)
{

//*** activeX support 20080911***
	//if (vFiggroup == "Circuit Diagram")
	//{
	//	gSvgFile_Name = "circuit/svg/" + vFigid + ".svg";
	//}
	//else if(vFiggroup == "Power Source / Grounding / Sneak Path")
	//{
	//	gSvgFile_Name = "poeama/svg/" + vFigid + ".svg";
	//}
	//else if(vFiggroup == "Harness Layout")
	//{
	//	gSvgFile_Name = "harness/svg/" + vFigid + ".svg";
	//}
	//else
	//{
		//
	//}
//*** activeX support 20080911***

	var temp = "";

	if(parent.gmsxv == "4")
	{
  		var oDoc = new ActiveXObject("msxml2.DOMDocument.4.0");
  		oDoc.async = false;
  		oDoc.load(gFListXmlfile);
  		var oStl = new ActiveXObject("msxml2.DOMDocument.4.0");
	}
	else if(parent.gmsxv == "3")
	{
  		var oDoc = new ActiveXObject("msxml2.DOMDocument.3.0");
  		oDoc.async = false;
  		oDoc.load(gFListXmlfile);
  		var oStl = new ActiveXObject("msxml2.DOMDocument.3.0");
	}
	else if(parent.gmsxv == "0")
	{
		Open_XML_Message();
		return;
	}
	else
	{
		alert(gMsxmlVersion_Error3);
		return;
	}
  	oStl.setProperty("SelectionLanguage","XPath");
  	oStl.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");
  	oStl.async = false;
  	oStl.load(gFListXslfile);

  	var ndVar = oStl.selectSingleNode("//xsl:variable[@name='viewmode']");
  	ndVar.text = "panmenu";

  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='figgroup2']");

	switch(vFiggroup)
	{
		case "Circuit Diagram":
			temp = gCategory_CircuitDiagram;
			break;
		case "Harness Layout":
			temp = gCategory_HarnessLayout;
			break;
		case "Power Source / Grounding / Sneak Path":
			var JcMode = gDefine_JunctionMode;
			if(JcMode == "Y")
			{
				temp = gCategory_PowerSource_Grounding_SneakPath1;
			}
			else
			{
				temp = gCategory_PowerSource_Grounding_SneakPath2;
			}
			break;
	}

	ndVar.text = temp;

  	var sfimgfld = GetFolderFromFiggroup(vFiggroup);
  	sfimgfld+="svg/";
  	ndVar = oStl.selectSingleNode("//xsl:variable[@name='figimgfolder']");
  	ndVar.text = sfimgfld;

  	var sUrlparam1 = "category.html?j=" + GetJobNoFromFiggroup(vFiggroup);
  	var sUrlparam2 = "";
  	var sUrlparam3 = "";

  	var sRet = "";

	var from_text = "";
	var to_text = "";

  	if(vFigid != "")
	{
		if(parent.gmsxv == "4")
		{
    		var oWDoc = new ActiveXObject("msxml2.DOMDocument.4.0");
		}
		else if(parent.gmsxv == "3")
		{
    		var oWDoc = new ActiveXObject("msxml2.DOMDocument.3.0");
		}

    	var ndWk = oWDoc.createNode("1","figlist","");
    	var ndPickup;

    	if(vFiggroup == gXmlFigGrpName[gXmlFigGrpCircuit] || vFiggroup == gXmlFigGrpName[gXmlFigGrpPoEaMa])
		{
      		ndPickup = oDoc.selectSingleNode("/figlist/figgroup/category/subcategory[fig/@id='" + vFigid + "']");
			if (ndPickup != null)
			{
      			vSubcategory = ndPickup.getAttribute("name");
      			ndPickup = oDoc.selectSingleNode("/figlist/figgroup/category[subcategory/fig/@id='" + vFigid + "']");
      			vCategory    = ndPickup.getElementsByTagName("name").item(0).text;

      			sUrlparam2=sUrlparam1 + "&c=" + ndPickup.getAttribute("id");

				//*** Pan Link 20061226***
				from_text = "&";
				to_text = "DELIMITAamp";
				vSubcategory = vSubcategory.split(from_text);
				vSubcategory = vSubcategory.join(to_text);
				//*** Pan Link 20061226***

      			sUrlparam3=sUrlparam2 + "&sc=" + escape(vSubcategory);

      			ndVar = oStl.selectSingleNode("//xsl:variable[@name='category']");
      			ndVar.text = vCategory;
      			ndVar = oStl.selectSingleNode("//xsl:variable[@name='subcategory']");
      			ndVar.text = vSubcategory;

      			ndPickup = oDoc.selectNodes("/figlist/figgroup/category/subcategory/fig[@id='" + vFigid + "']");
			}
			else
			{
				sRet = "";
				return sRet;
			}

    	}
		else if(vFiggroup == gXmlFigGrpName[gXmlFigGrpPoEaMa])
		{
			;
    	}
		else
		{
      		ndPickup = oDoc.selectNodes("/figlist/figgroup/fig[@id='" + vFigid + "']");
			if (ndPickup == null)
			{
				sRet = "";
				return sRet;
			}
    	}

		var length = ndPickup.length;
    	for(var i = 0; i < length; i++)
		{
      		ndWk.appendChild(ndPickup.item(i));
    	}

    	oWDoc.appendChild(ndWk);

    	ndVar = oStl.selectSingleNode("//xsl:variable[@name='urlparam1']");
    	ndVar.text = sUrlparam1;
    	ndVar = oStl.selectSingleNode("//xsl:variable[@name='urlparam2']");
    	ndVar.text = sUrlparam2;
    	ndVar = oStl.selectSingleNode("//xsl:variable[@name='urlparam3']");
    	ndVar.text = sUrlparam3;

    	sRet = oWDoc.transformNode(oStl);

  	}

	//*** Pan Link Reverse(only text) 20061227***
	from_text = " DELIMITAamp ";
	to_text = " & ";
	sRet = sRet.split(from_text);
	sRet = sRet.join(to_text);
	//*** Pan Link Reverse(only text) 20061227***

  	return sRet;

}


function FigData_ZoomConnInfo(vConnNo)
{
  SVG_ConExpansion('navicon');
}


function FigData_ConnInfoLinkClick(vTarget,vUrl)
{
	gFigSvgLoadFlag2 = 0;

  	var nwin = window.open(vUrl,vTarget,'status=no,location=no,menubar=no,toolbar=no,resizable=yes');

  	nwin.moveTo(20,20);
  	nwin.resizeTo(screen.width-20,screen.height-50);
  	nwin.focus();

}


function Find_jc_AllconnFrom(vSigid,vConNo,vSigCnt)
{
    var sRet = "";
	var ndMode = "";

	var gmsxv_jc = "";
	var xml_temp = "";

	gmsxv_jc = navigator.appVersion;

	var p1 = gmsxv_jc.indexOf("MSIE",0);
	if(p1 != -1)
	{
		gmsxv_jc = gmsxv_jc.substr(p1 + 5, 3);
	}

	if(gmsxv_jc == "5.5")
	{
		//if(window.ActiveXObject)
		//{
		//try {
		//	xml_temp = ( new ActiveXObject("Microsoft.XMLHTTP"))? "0":"";
			//xml_temp += ( new ActiveXObject("Msxml2.XMLHTTP.3.0"))? "3":"";
			//xml_temp += ( new ActiveXObject("Msxml2.XMLHTTP.4.0"))? "4":"";
		//	} catch (e) {
		//				}
		//}

		//if(xml_temp == "0")
		//{
  		//	gmsxv_jc = "0";
		//}
		//else
		//{
			gmsxv_jc = "4";
		//}
	}
	else if(gmsxv_jc == "6.0")
	{
		gmsxv_jc = "3";
	}
	else if(gmsxv_jc == "7.0")//20080902
	{
		gmsxv_jc = "3";
	}
	else
	{
		gmsxv_jc = "9";
	}

	if(gmsxv_jc == "4")
	{
  		var oDoc = new ActiveXObject("msxml2.DOMDocument.4.0");
  		oDoc.async = false;
  		oDoc.load(gConXmlfile);
  		var oStl = new ActiveXObject("msxml2.DOMDocument.4.0");
	}
	else if(gmsxv_jc == "3")
	{
  		var oDoc = new ActiveXObject("msxml2.DOMDocument.3.0");
  		oDoc.async = false;
  		oDoc.load(gConXmlfile);
  		var oStl = new ActiveXObject("msxml2.DOMDocument.3.0");
	}
	else if(gmsxv_jc == "0")
	{
		Open_XML_Message();
		return;
	}
	else
	{
		alert(gMsxmlVersion_Error3);
		return;
	}
  	oStl.setProperty("SelectionLanguage","XPath");
  	oStl.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");
  	oStl.async = false;
  	oStl.load(gConXslfile);

  	ndMode = oStl.selectSingleNode("//xsl:variable[@name='viewmode']");
  	ndMode.text = "list3";

  	ndMode = oStl.selectSingleNode("//xsl:variable[@name='pinno']");
  	ndMode.text = vSigid;

  	ndMode = oStl.selectSingleNode("//xsl:variable[@name='conno']");
  	ndMode.text = vConNo;

  	ndMode = oStl.selectSingleNode("//xsl:variable[@name='sigcnt']");
  	ndMode.text = vSigCnt;

  	ndMode = oStl.selectSingleNode("//xsl:variable[@name='ConnectorNotFound']");
  	ndMode.text = gConnctorInfomation_ConnectorNotFound;

  	ndMode = oStl.selectSingleNode("//xsl:variable[@name='JunctionFromList']");
  	ndMode.text = gJunction_JunctionFromList;

  	ndMode = oStl.selectSingleNode("//xsl:variable[@name='WireToWire']");
  	ndMode.text = gJunction_WireToWire;

  	if(vSigid != "")
	{
		if(gmsxv_jc == "4")
		{
    		var oWDoc = new ActiveXObject("msxml2.DOMDocument.4.0");
		}
		else if(gmsxv_jc == "3")
		{
    		var oWDoc = new ActiveXObject("msxml2.DOMDocument.3.0");
		}

    	var ndWk = oWDoc.createNode("1","connector","");

		var ndPickup = oDoc.selectNodes("/connector/con/term/pin/sig[@jc='" + vSigid + "']");
		var length = ndPickup.length;
		for(var i = 0; i < length; i++)
		{
			ndWk.appendChild(ndPickup.item(i).parentNode.parentNode.parentNode);
		}

    	oWDoc.appendChild(ndWk);
    	sRet = oWDoc.transformNode(oStl);
  	}
	else
	{
    	sRet = "";
  	}

  	return sRet;

}


function Find_jc_AllconnTo(vSigid,vConNo,vSigCnt)
{
    var sRet = "";
	var ndMode = "";

	var gmsxv_jc = "";
	var xml_temp = "";

	gmsxv_jc = navigator.appVersion;

	var p1 = gmsxv_jc.indexOf("MSIE",0);
	if(p1 != -1)
	{
		gmsxv_jc = gmsxv_jc.substr(p1 + 5, 3);
	}

	if(gmsxv_jc == "5.5")
	{
		//if(window.ActiveXObject)
		//{
		//try {
		//	xml_temp = ( new ActiveXObject("Microsoft.XMLHTTP"))? "0":"";
			//xml_temp += ( new ActiveXObject("Msxml2.XMLHTTP.3.0"))? "3":"";
			//xml_temp += ( new ActiveXObject("Msxml2.XMLHTTP.4.0"))? "4":"";
		//	} catch (e) {
		//				}
		//}

		//if(xml_temp == "0")
		//{
  		//	gmsxv_jc = "0";
		//}
		//else
		//{
			gmsxv_jc = "4";
		//}
	}
	else if(gmsxv_jc == "6.0")
	{
		gmsxv_jc = "3";
	}
	else if(gmsxv_jc == "7.0")//20080902
	{
		gmsxv_jc = "3";
	}
	else
	{
		gmsxv_jc = "9";
	}

	if(gmsxv_jc == "4")
	{
  		var oDoc = new ActiveXObject("msxml2.DOMDocument.4.0");
  		oDoc.async = false;
  		oDoc.load(gConXmlfile);
  		var oStl = new ActiveXObject("msxml2.DOMDocument.4.0");
	}
	else if(gmsxv_jc == "3")
	{
  		var oDoc = new ActiveXObject("msxml2.DOMDocument.3.0");
  		oDoc.async = false;
  		oDoc.load(gConXmlfile);
  		var oStl = new ActiveXObject("msxml2.DOMDocument.3.0");
	}
	else if(gmsxv_jc == "0")
	{
		Open_XML_Message();
		return;
	}
	else
	{
		alert(gMsxmlVersion_Error3);
		return;
	}
  	oStl.setProperty("SelectionLanguage","XPath");
  	oStl.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");
  	oStl.async = false;
  	oStl.load(gConXslfile);

  	ndMode = oStl.selectSingleNode("//xsl:variable[@name='viewmode']");
  	ndMode.text = "list2";

  	ndMode = oStl.selectSingleNode("//xsl:variable[@name='pinno']");
  	ndMode.text = vSigid;

  	ndMode = oStl.selectSingleNode("//xsl:variable[@name='conno']");
  	ndMode.text = vConNo;

  	ndMode = oStl.selectSingleNode("//xsl:variable[@name='sigcnt']");
  	ndMode.text = vSigCnt;

  	ndMode = oStl.selectSingleNode("//xsl:variable[@name='ConnectorNotFound']");
  	ndMode.text = gConnctorInfomation_ConnectorNotFound;

  	ndMode = oStl.selectSingleNode("//xsl:variable[@name='JunctionToList']");
  	ndMode.text = gJunction_JunctionToList;

  	ndMode = oStl.selectSingleNode("//xsl:variable[@name='WireToWire']");
  	ndMode.text = gJunction_WireToWire;

  	if(vSigid!="")
	{

		if(gmsxv_jc == "4")
		{
    		var oWDoc = new ActiveXObject("msxml2.DOMDocument.4.0");
		}
		else if(gmsxv_jc == "3")
		{
    		var oWDoc = new ActiveXObject("msxml2.DOMDocument.3.0");
		}

    	var ndWk = oWDoc.createNode("1","connector","");

		var ndPickup = oDoc.selectNodes("/connector/con/term/pin/sig[@jc='" + vSigid + "']");
		var length = ndPickup.length;
		for(var i = 0; i < length; i++)
		{
			ndWk.appendChild(ndPickup.item(i).parentNode.parentNode.parentNode);//ok
		}

    	oWDoc.appendChild(ndWk);

    	sRet = oWDoc.transformNode(oStl);
  	}
	else
	{
    	sRet = "";
  	}

  	return sRet;

}


function Find_Sig_jc(vvConNo,vvTermNo)
{
	var p1 = 0;
	var leng = 0;
	var sRet = "";
	var temp = "";

	var jcCNT = 0;
	var ndMode = "";

	var gmsxv_jc = "";
	var xml_temp = "";

	gmsxv_jc = navigator.appVersion;

	var p1 = gmsxv_jc.indexOf("MSIE",0);
	if(p1 != -1)
	{
		gmsxv_jc = gmsxv_jc.substr(p1 + 5, 3);
	}

	if(gmsxv_jc == "5.5")
	{
		//if(window.ActiveXObject)
		//{
		//try {
		//	xml_temp = ( new ActiveXObject("Microsoft.XMLHTTP"))? "0":"";
			//xml_temp += ( new ActiveXObject("Msxml2.XMLHTTP.3.0"))? "3":"";
			//xml_temp += ( new ActiveXObject("Msxml2.XMLHTTP.4.0"))? "4":"";
		//	} catch (e) {
		//				}
		//}

		//if(xml_temp == "0")
		//{
  		//	gmsxv_jc = "0";
		//}
		//else
		//{
			gmsxv_jc = "4";
		//}
	}
	else if(gmsxv_jc == "6.0")
	{
		gmsxv_jc = "3";
	}
	else if(gmsxv_jc == "7.0")//20080902
	{
		gmsxv_jc = "3";
	}
	else
	{
		gmsxv_jc = "9";
	}

	if(gmsxv_jc == "4")
	{
  		var oDoc = new ActiveXObject("msxml2.DOMDocument.4.0");
  		oDoc.async = false;
  		oDoc.load(gConXmlfile);
  		var oStl = new ActiveXObject("msxml2.DOMDocument.4.0");
	}
	else if(gmsxv_jc == "3")
	{
  		var oDoc = new ActiveXObject("msxml2.DOMDocument.3.0");
  		oDoc.async = false;
  		oDoc.load(gConXmlfile);
  		var oStl = new ActiveXObject("msxml2.DOMDocument.3.0");
	}
	else if(gmsxv_jc == "0")
	{
		Open_XML_Message();
		return;
	}
	else
	{
		alert(gMsxmlVersion_Error3);
		return;
	}
  	oStl.setProperty("SelectionLanguage","XPath");
  	oStl.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");
  	oStl.async = false;
  	oStl.load(gConXslfile);

  	ndMode = oStl.selectSingleNode("//xsl:variable[@name='viewmode']");
  	ndMode.text = "junc";

  	ndMode = oStl.selectSingleNode("//xsl:variable[@name='ConnectorNotFound']");
  	ndMode.text = gConnctorInfomation_ConnectorNotFound;

	if(gmsxv_jc == "4")
	{
    	var oWDoc = new ActiveXObject("msxml2.DOMDocument.4.0");
	}
	else if(gmsxv_jc == "3")
	{
    	var oWDoc = new ActiveXObject("msxml2.DOMDocument.3.0");
	}

    var ndWk = oWDoc.createNode("1","connector","");

	var ndPickup = oDoc.selectNodes("/connector/con[@no='" + vvConNo + "']/term/pin[@no='" + vvTermNo + "']");
	var length = ndPickup.length;
	for(var i = 0; i < length; i++)
	{
      	ndWk.appendChild(ndPickup.item(i).parentNode.parentNode);
    }

    oWDoc.appendChild(ndWk);

    temp = oWDoc.transformNode(oStl);

	var sp = temp.split("\n");
	var length = sp.length - 1;
	for(var j = 2; j < length; j = j + 6)
	{
		p1 = sp[j].indexOf(">" + vvTermNo + "</td>",0);

		if(p1 != -1)
		{
			leng = sp[j+1].length;

			JunctionNo[jcCNT] = sp[j+1].substr(24, leng - 6 - 24);
			jcCNT = jcCNT + 1;
		}
	}

	JunctionCnt = jcCNT;

  	return jcCNT;

}


function junction_serchFrom()
{
	var JunctionCnt;
	var JunctionURL = "";

  	var vConNo = GetUrlQueryParam("n");
  	var sContype = GetUrlQueryParam("p");
  	var sConName =  GetUrlQueryParam("m");
  	var sTermNo =  GetUrlQueryParam("t");

	var JunctionCnt = Find_Sig_jc(vConNo,sTermNo);

	var i = 0;
	JunctionURL = JunctionURL + Find_jc_AllconnFrom(JunctionNo[i],vConNo,JunctionCnt);

  	return JunctionURL;

}


function junction_serchTo()
{

	var JunctionCnt;
	var JunctionURL = "";

  	var vConNo = GetUrlQueryParam("n");
  	var sContype = GetUrlQueryParam("p");
  	var sConName =  GetUrlQueryParam("m");
  	var sTermNo =  GetUrlQueryParam("t");

	var JunctionCnt = Find_Sig_jc(vConNo,sTermNo);

	var p1 = 0;
	var p2 = 0;
	var JunctionURLtemp = "";
	var StartPos = 0;

	for(var i = 0; i < JunctionCnt; i++)
	{
		JunctionURL = JunctionURL + Find_jc_AllconnTo(JunctionNo[i],vConNo,i+1);
	}

	var myArray = new Array();
	var myArrayCnt = 0;
	var myTitle = "";
	var fonetime = 0;
	var length = JunctionURL.length - 1;
	for(var j = 0; StartPos < length; j++)
	{
		p1 = JunctionURL.indexOf("<div class=\"junclist\">",StartPos);

		if(p1 != -1)
		{
			if (p1 > StartPos)
			{
				if (fonetime == 0)
				{
					fonetime = 1;
					myTitle = JunctionURL.substr(StartPos, p1 - StartPos);
				}
			}

			p2 = JunctionURL.indexOf("</div>",p1+22);
			if(p2 != -1)
			{
				p3 = JunctionURL.indexOf(JunctionURL.substr(p1,p2-p1+6),p2+6);//</div>
				if(p3 != -1)
				{
					StartPos = p2 + 6
				}
				else
				{
					myArray[myArrayCnt] = JunctionURL.substr(p1,p2-p1+6);
					myArrayCnt++;
					StartPos = p2 + 6;
				}
			}
		}
		else
		{
			StartPos++;
		}

	}

	myArray.sort();

	for(j = 0; j < myArrayCnt; j++)
	{
		JunctionURLtemp = JunctionURLtemp+myArray[j];
	}
  	return myTitle + JunctionURLtemp;

}


function Serach_Junction(vConNo,vConName,vContype,vTermNo)
{
	var nwin = window.open("junction.html?n=" + vConNo + "&p=" + vContype + "&m=" + vConName + "&t=" + vTermNo,"junction",'status=no,location=no,menubar=yes,toolbar=yes,resizable=yes,scrollbars=yes');

	nwin.moveTo(20,20);
  	nwin.resizeTo(screen.width-300,screen.height-50);
	nwin.focus();

  	return;

}


function Jc_MouseOver(obj)
{
	obj.style.backgroundColor = '#DDDDDD';
	obj.style.color = '#eb2e62';
}


function Jc_MouseOut(obj)
{
	obj.style.backgroundColor='#FFFFFF';
	obj.style.color='#02bff7';
}


function Rev_MouseOver(obj)
{
	obj.style.cursor = "hand";
	obj.src = '../../common/image/button/connector/over_rev.gif';
}


function Rev_MouseOut(obj)
{
	obj.style.cursor = "default";
	obj.src = '../../common/image/button/connector/rev.gif';
}


function Rev_MouseClick(obj)
{
	obj.style.cursor = "default";
	obj.src = '../../common/image/button/connector/bottom_rev.gif';
}


function Make_MainFigURL()
{
  	var vSubcategory1 = "";
  	var vCategory1 = "";

  	var nJob = GetUrlQueryParam("j");

  	var sFig =  GetUrlQueryParam("f");

	MSXMLversion();

	FigData_Init_TokuteiLink();

	if (nJob == 6)
	{
  		var vFigid1 =  GetUrlQueryParam("f");
		var vFiggroup1 = "Power Source / Grounding / Sneak Path";

		if(gmsxv == "4")
		{
  			var oDoc = new ActiveXObject("msxml2.DOMDocument.4.0");
  			oDoc.async = false;
  			oDoc.load(gFListXmlfile);
  			var oStl = new ActiveXObject("msxml2.DOMDocument.4.0");
		}
		else if(gmsxv == "3")
		{
  			var oDoc = new ActiveXObject("msxml2.DOMDocument.3.0");
  			oDoc.async = false;
  			oDoc.load(gFListXmlfile);
  			var oStl = new ActiveXObject("msxml2.DOMDocument.3.0");
		}
		else if(gmsxv == "0")
		{
			Open_XML_Message();
			return;
		}
		else
		{
			alert(gMsxmlVersion_Error3);
			return;
		}

  		oStl.setProperty("SelectionLanguage","XPath");
  		oStl.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");
  		oStl.async = false;
  		oStl.load(gFListXslfile);

  		var ndVar = oStl.selectSingleNode("//xsl:variable[@name='viewmode']");
  		ndVar.text = "panmenu";

  		ndVar = oStl.selectSingleNode("//xsl:variable[@name='figgroup2']");

  		var sfimgfld = GetFolderFromFiggroup(vFiggroup1);
  		sfimgfld+="svg/";
  		ndVar = oStl.selectSingleNode("//xsl:variable[@name='figimgfolder']");
  		ndVar.text = sfimgfld;

  		var sRet = "";
  		if(vFigid1 != "")
		{
			if(gmsxv == "4")
			{
    			var oWDoc = new ActiveXObject("msxml2.DOMDocument.4.0");
			}
			else if(gmsxv == "3")
			{
    			var oWDoc = new ActiveXObject("msxml2.DOMDocument.3.0");
			}

    		var ndWk = oWDoc.createNode("1","figlist","");
    		var ndPickup;
      		ndPickup = oDoc.selectSingleNode("/figlist/figgroup/category/subcategory[fig/@id='" + vFigid1 + "']");
      		vSubcategory1 = ndPickup.getAttribute("name");
      		ndPickup = oDoc.selectSingleNode("/figlist/figgroup/category[subcategory/fig/@id='" + vFigid1 + "']");
      		vCategory1    = ndPickup.getElementsByTagName("name").item(0).text;
  		}

	}
	else
	{
		vSubcategory1 = "";
	}

	var sTitle_sub = '<frameset rows=\"*,0\" border=\"0\" framespacing=\"0\">';

	sTitle_sub = sTitle_sub + '<frameset cols=\"280,*\" name=\"fs\">';

	if(sFig.substr(4,1) == "z")
	{
		sTitle_sub = sTitle_sub + '<frameset rows=\"0,*\"  name=\"fs2\" style=\"border-top-style:solid\; border-left-style:solid\; border-right-style:solid\; border-bottom-style:solid\;border-width:0px 0px 0px 0px\; border-color:#cccccc\;\">';
	}
	else
	{
		sTitle_sub = sTitle_sub + '<frameset rows=\"150,*\"  name=\"fs2\" style=\"border-top-style:solid\; border-left-style:solid\; border-right-style:solid\; border-bottom-style:solid\;border-width:0px 0px 0px 0px\; border-color:#cccccc\;\">';
	}

	sTitle_sub = sTitle_sub + '<frame src=\"base_conlist.html\" name=\"list\" class=\"list\" style=\"border-top-style:solid\; border-width:0px 1px 1px 0px\; border-color:#cccccc\;\">';

	sTitle_sub = sTitle_sub + '<frameset rows=\"*,25\" framespacing=\"0\">';

	sTitle_sub = sTitle_sub + '<frame src=\"base_coninfo.html\" name=\"info\" style=\"border-top-style:solid\; border-left-style:none\; border-right-style:none\; border-bottom-style:solid\;border-width:0px 0px 0px 0px\; border-color:#cccccc\;\">';

	sTitle_sub = sTitle_sub + '<frame src=\"navicon.html\" name=\"navicon\" scrolling=\"NO\" style=\"border-top-style:solid\; border-left-style:none\; border-right-style:none\; border-bottom-style:solid\;border-width:0px 0px 0px 0px\; border-color:#cccccc\;\">';

	sTitle_sub = sTitle_sub + '</frameset>';

	sTitle_sub = sTitle_sub + '</frameset>';

	sTitle_sub = sTitle_sub + '<frameset rows=\"*,25\">';

	sTitle_sub = sTitle_sub + '<frameset rows=\"30,*\">';

	sTitle_sub = sTitle_sub + '<frame src=\"base.html\" name=\"pan\" class=\"pan\" scrolling=\"NO\" framespacing=\"0\" style=\"border-top-style:solid\; border-left-style:none\; border-right-style:none\; border-bottom-style:solid\;border-width:0px 0px 0px 0px\; border-color:#cccccc\;\">';

	sTitle_sub = sTitle_sub + '<frame src=\"base_figinfo.html\" name=\"work\" class=\"work\" border=\"0\" framespacing=\"0\" style=\"border-top-style:solid\; border-left-style:solid\; border-width:1px 1px 1px 1px\; border-color:#cccccc\;\">';
	sTitle_sub = sTitle_sub + '</frameset>';

	sTitle_sub = sTitle_sub + '<frame src=\"navi.html\" name=\"navi\" scrolling=\"NO\" class=\"navi\" OnLoad=\"setTimeout(\'FigData_InitWin()\',250)\" style=\"border-style:none\; border-bottom-style:solid\;border-width:0px 0px 0px 0px\; border-color:#cccccc\;\">';//Timer for backview delete

	sTitle_sub = sTitle_sub + '</frameset>';

	sTitle_sub = sTitle_sub + '</frameset>';

	sTitle_sub = sTitle_sub + '</frameset>';

	return sTitle_sub;

}


function SVGview_download_mesCLR()
{
	if(parent.gFigSvgLoadFlag3 == 1)
	{
		parent.gFigSvgLoadFlag3 = 0;

		document.all("SVGView_mes").innerHTML = "";

		SVG_FiginiSet2();
	}
	else
	{
		;//viewer error
	}

}


function SVG_Message()
{
	var SVG_Message = gHeader_Search;
	var SVG_Message1 = gHeader_Search1;
	var SVG_Message2 = gHeader_Search2;

	var OutHTML = '<div id=\"SVGView_mes\">';

	OutHTML = OutHTML + '<div class=\"installmes\">';
	OutHTML = OutHTML + '<text>' + SVG_Message + '</text>';
	OutHTML = OutHTML + '<br>';
	OutHTML = OutHTML + '<text>' + SVG_Message1 + '</text>';
	OutHTML = OutHTML + '<br>';
	OutHTML = OutHTML + '<a href=\"../../../SVGView.exe\">' + SVG_Message2 + '</a>';
	OutHTML = OutHTML + '</div>';
	OutHTML = OutHTML + '</div>';

	return OutHTML;

}

