
var gXmlFigGrpCounts = 6;
var gXmlFigGrpCircuit = 1;
var gXmlFigGrpHarness = 2;
var gXmlFigGrpPower   = 3;
var gXmlFigGrpEarth   = 4;
var gXmlFigGrpMawari  = 5;
var gXmlFigGrpPoEaMa  = 6;

var gXmlFigGrpName = new Array("","Circuit Diagram","Harness Layout","POWER SOURCE","GROUNDING","SNEAK PATH","Power Source / Grounding / Sneak Path");

var gConimgfolder = "../consvg/";
var gPdffolder   = "pdf/";
var gSvgfolder   = "svg/";
var gFigGrpFolder = new Array("","../circuit/","../harness/","../power/","../earth/","../mawari/","../poeama/");

var gConXmlfile = "../connector.xml";
var gFListXmlfile = "../figlist.xml";
//var gLangXmlfile = "../language.xml";
//var gLangXmlfileTop = "vehicle/language.xml";

var gConXslfile = "../../common/xslt/connector.xsl";
var gFListXslfile = "../../common/xslt/figlist.xsl";
var gLangXslfile = "../../common/xslt/language.xsl";
var gLangXslfileTop = "common/xslt/language.xsl";


var gfweb_local = "None";
var temp_width = 0;
var temp_height = 0;
var temp_width2 = 0;
var temp_height2 = 0;

var temp_fig = "";
var temp_pan = "";
var temp_list = "";
var temp_con = "";

var gConnObj = "";
var gConnNo = "";

//var maru = new Image;
//var over_maru = new Image;
//var tri = new Image;
//var over_tri = new Image;
//var over_tri2 = new Image;

var gmsxv = "";

var gConSvgLoadFlag = 0;
var gConSvgLoadFlag2 = 0;
var gConSvgLoadFlag3 = 0;
var gConSvgLoadFlag4 = 0;

var gFigSvgLoadFlag = 0;
var gFigSvgLoadFlag2 = 0;
var gFigSvgLoadFlag3 = 0;

//*** 2 outline support 20070116***
var gFigSvgLoadFlag4 = 0;
//*** 2 outline support 20070116***

//*** IE7 support 20080908***
var IEVer;
//*** IE7 support 20080908***

//*** activeX support 20080911***
var gSvgFile_Name;
//*** activeX support 20080911***

function Expression_version1()
{
	var sVer = navigator.appVersion;
	var sExpression;

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

	var p2 = sVer.indexOf("Windows NT",0);
	if(p1 != -1)
	{
		WinVer = sVer.substr(p2 + 11, 3);
	}

	if((WinVer != "5.0") && (IEVer == "6.0"))
	{
		sExpression = "<link href=\"common/css/ie6.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />";
	}
	else
	{
		sExpression = "";
	}

	return sExpression;
}


function Expression_version2()
{
	var sVer = navigator.appVersion;
	var sExpression;

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

	var p2 = sVer.indexOf("Windows NT",0);
	if(p1 != -1)
	{
		WinVer = sVer.substr(p2 + 11, 3);
	}

	if((WinVer != "5.0") && (IEVer == "6.0"))
	{
		sExpression = "<link href=\"../../common/css/ie6.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />";
	}
	else
	{
		sExpression = "";
	}

	return sExpression;
}

function MSXMLversion()
{
	var xml_temp = "";
	gmsxv = navigator.appVersion;

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

	if(gmsxv == "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 = "0";
		//}
		//else
		//{
			gmsxv = "4";
		//}
	}
	else if(gmsxv == "6.0")
	{
		gmsxv = "3";
	}
	else if(gmsxv == "7.0")//20080902
	{
		gmsxv = "3";
	}
	else
	{
		gmsxv = "9";
	}

	return;
}


function GetUrlQueryParam(vVarname)
{
  	var sRet="";
  	var sQuery = parent.location.search;

  	if(sQuery!="") sQuery = sQuery.substr(1,sQuery.length-1);
  	sQuery = unescape(sQuery);

  	var sQ1 = sQuery.split("&");
	var length = sQ1.length;
  	for(var i=0; i<length; i++)
	{
    	var sWk1="";
    	var sWk2="";
    	sQ2 = sQ1[i].split("=");
		var length2 = sQ2.length;
    	for(var j=0; j<length2; j++)
		{
      		if(j==0)
			{
        		sWk1 = sQ2[j];
      		}
			else
			{
        		if(sWk2!="") sWk2 += "=";
        		sWk2 += sQ2[j];
      		}
    	}
    	if(sWk1.toLowerCase()==vVarname.toLowerCase())
		{
      		sRet = sWk2;
      		break;
    	}
  	}
  	return sRet;
}


function GetJobNoFromFiggroup(vFiggroup)
{
  	var nJobNo=0;

  	for(var i=1; i<=gXmlFigGrpCounts; i++)
	{
    	if(vFiggroup==gXmlFigGrpName[i]) nJobNo=i;
  	}

  	return nJobNo;
}


function GetFolderFromFiggroup(vFiggroup)
{
  	var sFolder="";
  	for(var i=1; i<=gXmlFigGrpCounts; i++)
	{
    	if(vFiggroup==gXmlFigGrpName[i]) sFolder=gFigGrpFolder[i];
  	}

  	return sFolder;
}


function GetParaFromId(vFiggroup, vFigid, vId)
{
  	var sTag = "";
  	var sName = "";
  	var sVal = "";
  	var sWk = "";

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

	var ListTemp = "";

	ListURL = parent.temp_list;

	var length = ListURL.length - 1;
	var ID_length = vId.length;

	for(var i = 0; i < length; i++)
	{//Connector List URL
		//p1 = ListURL.indexOf("FigData_ClickConnList(\'" +vId+ "\',this)\">",i);
		p1 = ListURL.indexOf("&lt;"+vId+ "&gt;",i);//20080826 connector list mod
		if(p1 != -1)
		{
			//StartPos = p1 + ID_length + 32;
			StartPos = p1 + ID_length + 8;//20080826 connector list mod
			for(var j = StartPos; j < length; j++)
			{
				//p2 = ListURL.indexOf("&lt;",j);
				p2 = ListURL.indexOf("</div>",j);//20080826 connector list mod

				if(p2 != -1)
				{
					//ListTemp = ListURL.substr(StartPos, p2 - StartPos - 6);
					ListTemp = ListURL.substr(StartPos, p2-StartPos);//20080826 connector list mod

					break;
				}
			}

			//break;

		}
			break;
	}

	sTag = "con";
	sName = ListTemp;
	sVal = vId;

  	if(sName == "")
	{
		sTag = "";
		sVal = "";

  		var sFolder = GetFolderFromFiggroup(vFiggroup);
  		var sFile = sFolder + "xml/" + vFigid + ".xml";

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

  		oDoc.setProperty("SelectionLanguage","XPath");

  		oDoc.async = false;
  		oDoc.load(sFile);

  		var ndPickup = oDoc.selectSingleNode("//descendant-or-self::*[@id='" + vId + "']");

		if(ndPickup != null)
		{
  			var ndVal;
    		sTag = ndPickup.tagName;

    		ndVal = ndPickup.selectSingleNode("name");

    		if(ndVal != null)
			{
      			sName = ndVal.text;
    		}

    		if(sTag == "line")
			{
      			ndVal = ndPickup.selectNodes("con");
				var length = ndVal.length;
      			for(var i = 0; i < length; i++)
				{
        			sWk = ndVal.item(i).getAttribute("no");
        			if(sWk != "")
					{
          				if(sVal != "") sVal = sVal + "\t";
          				sVal = sVal + sWk;
        			}
      			}
    		}

    		if(sTag == "circuit")
			{
      			ndVal = ndPickup.selectSingleNode("figid");
      			if(ndVal != null)
				{
        			sVal = ndVal.text;
      			}
    		}

    		if(sTag == "link")
			{
      			sVal = ndPickup.getAttribute("id");
    		}

    		if(sTag == "top")
			{
      			ndVal = ndPickup.selectSingleNode("subcategory");
      			if(ndVal != null)
				{
        			sVal = ndVal.text;
      			}
    		}

		}
		else
		{
			sTag = "con";
			sName = "";
			sVal = vId;
		}

	}

  	var ret = new Array(sTag,sName,sVal);

  	return ret;
}


function GetDocumentPath()
{
	var sdocpath;
	var p;

	sdocpath = parent.location.pathname;
	p = sdocpath.lastIndexOf("\\",1000);

	if (p == -1)
	{//Web
		p = sdocpath.lastIndexOf("/",1000);
		gfweb_local = "Web";
	}
	else
	{//Local
		gfweb_local = "Local";
	}

	sdocpath = sdocpath.substring(1,p);
	sdocpath = sdocpath.replace(/%20/g," ");

	return sdocpath;

}


function GetPdfFile(bIsescape)
{
	var nJob = GetUrlQueryParam("j");
	var sFig = GetUrlQueryParam("f");
	var spath = GetDocumentPath();
	var sfgrp = gFigGrpFolder[nJob];
	var p;
	var sp = sfgrp.split("../");
	var length = sp.length-1;

	for(i = 0; i < length; i++)
	{
		if(gfweb_local == "Web")
		{//Web
			p = spath.lastIndexOf("/",1000);
		}
		else
		{//local
			p = spath.lastIndexOf("\\",1000);
		}
		spath = spath.substring(0,p);
	}

//*** IE7 support 20080908***
	if(IEVer != "7.0")
	{
		if(gfweb_local == "Web")
		{//Web
			var spdf = "\\" + spath + "/" + sp[sp.length-1] + gPdffolder + sFig + ".pdf";
		}
		else
		{//local
			var spdf = spath + "/" + sp[sp.length-1] + gPdffolder + sFig + ".pdf";
		}
	}
	else
	{
		var p1;

		//p1 = spath.indexOf("\\C:/",0);
		p1 = spath.indexOf("C:/",0);

		if (p1 == -1)
		{//Web

			var spdf = "\\" +spath + "/" +sp[sp.length-1] + gPdffolder + sFig + ".pdf";
		}
		else
		{//Local
			var spdf = spath + "/" + sp[sp.length-1] + gPdffolder + sFig + ".pdf";

		}

	}
//*** IE7 support 20080908***

	if(bIsescape)
	{
		return escape(spdf);
	}
	else
	{
		return spdf;
	}
}


function GetCategoryInfoFromSubcategory(sSubcategory)
{
  	var vRet;

	var gmsxv_Sub = "";
	var xml_temp = "";

	gmsxv_Sub = navigator.appVersion;

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

	if(gmsxv_Sub == "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_Sub = "0";
		//}
		//else
		//{
			gmsxv_Sub = "4";
		//}
	}
	else if(gmsxv_Sub == "6.0")
	{
		gmsxv_Sub = "3";
	}

//*** IE7 support 20080908***
	else if(gmsxv_Sub == "7.0")
	{
		gmsxv_Sub = "3";
	}
//*** IE7 support 20080908***

	else
	{
		gmsxv_Sub = "9";
	}

	if(gmsxv_Sub == "4")
	{
  		var oDoc = new ActiveXObject("msxml2.DOMDocument.4.0");
	}
	else if(gmsxv_Sub == "3")
	{
 		var oDoc = new ActiveXObject("msxml2.DOMDocument.3.0");
	}
	else if(gmsxv_Sub == "0")
	{
		Open_XML_Message();
		return;
	}
	else
	{
		alert(gMsxmlVersion_Error3);
		return;
	}

  	oDoc.setProperty("SelectionLanguage","XPath");

  	oDoc.async = false;
  	oDoc.load(gFListXmlfile);

  	vRe = null;
  	var ndPickup = oDoc.selectSingleNode("/figlist/figgroup/category/subcategory[@name='" + sSubcategory + "']");
  	if(ndPickup != null)
	{
    	ndPickup = ndPickup.parentNode;
    	if(ndPickup != null)
		{
     	 	vRet = new Array(ndPickup.getAttribute("id"),ndPickup.getElementsByTagName("name").item(0).text);
    	}
  	}
  	return vRet;
}


function Title_Lang(vTopMode,vPage_Mode,vPage_No)
{
    var sRet = "";

  	var oDoc = new ActiveXObject("msxml2.DOMDocument.4.0");
  	//oStl.setProperty("SelectionLanguage","XPath");
  	//oStl.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");
  	oDoc.async = false;

	if (vTopMode == "Top")
	{
  		oDoc.load(gLangXmlfileTop);
	}
	else
	{
	  	oDoc.load(gLangXmlfile);
	}

  	var oStl = new ActiveXObject("msxml2.DOMDocument.4.0");

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

	if (vTopMode == "Top")
	{
  		oStl.load(gLangXslfileTop);
	}
	else
	{
  		oStl.load(gLangXslfile);
	}

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

  	var ndMode = oStl.selectSingleNode("//xsl:variable[@name='pagemode']");
  	ndMode.text = vPage_Mode;

  	var ndMode = oStl.selectSingleNode("//xsl:variable[@name='pageno']");
  	ndMode.text = vPage_No;

    	var oWDoc = new ActiveXObject("msxml2.DOMDocument.4.0");
    	var ndWk = oWDoc.createNode("1","title","");

		var ndPickup = oDoc.selectNodes("/title/page/view[@no='" + vPage_No + "']");
		var length = ndPickup.length;
		for(var i = 0; i < length; i++)
		{
			//ndWk.appendChild(ndPickup.item(i));
			ndWk.appendChild(ndPickup.item(i).parentNode);
      		//ndWk.appendChild(ndPickup.item(i).parentNode.parentNode);
			//ndWk.appendChild(ndPickup.item(i).parentNode.parentNode.parentNode);
		}

    	oWDoc.appendChild(ndWk);
    	sRet = oWDoc.transformNode(oStl);
  	return sRet;

}

function OutPutTitleMenu()
{
	var OutHtml = "";

	var sTitle = gHeader_Title;

	OutHtml = '<title>' + sTitle + '</title>';

	return OutHtml;

}

function OutPutTitleMenu2()
{
	var OutHtml = "";

	var sTitle = gHeader_Title;

	OutHtml = '<title>' + sTitle + '</title>';

	return OutHtml;

}

function OutPutTitleMenu3()
{
	var OutHtml = "";

	var sTitle = gHeader_Title;

	OutHtml = '<title>' + sTitle + '</title>';

	return OutHtml;

}

function OutPutTitleMenuTop()
{
	var OutHtml = "";

	var sTitle = gHeader_Title;

	OutHtml = '<title>' + sTitle + '</title>';

	return OutHtml;

}

function OutPutTitleMenuTop2()
{
	var OutHtml = "";
	var vBaloon_Circuit = gCategory_CircuitDiagram;
	var vBaloon_Harness = gCategory_HarnessLayout;

	var JcMode = gDefine_JunctionMode;
	if(JcMode == "Y")
	{
		var vBaloon_Power = gCategory_PowerSource_Grounding_SneakPath1;


		var vImg_hmPower = "po.gif";
		var vImg_overPower = "over_po.gif";
		var vImg_buttomPower = "buttom_po.gif";
	}
	else
	{
		var vBaloon_Power = gCategory_PowerSource_Grounding_SneakPath2;

		var vImg_hmPower = "poeama.gif";
		var vImg_overPower = "over_poeama.gif";
		var vImg_buttomPower = "buttom_poeama.gif";
	}

	var vBaloon_Connector = gCategory_Connector;
	var vTitle_Select = gHeader_Select_ewd;

	OutHtml = '<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">';
	OutHtml = OutHtml + '	<tr><td colspan=\"3\"><img src=\"common/image/other/space.gif\" width=\"10\" height=\"50\"></td>';
	OutHtml = OutHtml + '</tr>';
	OutHtml = OutHtml + '	<tr>';
	OutHtml = OutHtml + '		<td><img src=\"common/image/other/space.gif\" width=\"10\" height=\"1\"></td>';
	OutHtml = OutHtml + '		<td align=\"center\">';
	OutHtml = OutHtml + '			<table width=\"800\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">';

	OutHtml = OutHtml + '				  <tr>';
	OutHtml = OutHtml + '					<td colspan=\"4\"><img src=\"common/image/other/space.gif\" width=\"1\" height=\"20\" border=\"0\" alt=\"\"></td>';
	OutHtml = OutHtml + '				  </tr>';
	OutHtml = OutHtml + '				  <tr>';
	OutHtml = OutHtml + '					<td colspan=\"4\"><h1>' + vTitle_Select + '</h1></td>';
	OutHtml = OutHtml + '				  </tr>';
	OutHtml = OutHtml + '				  <tr>';
	OutHtml = OutHtml + '					<td colspan=\"4\"><img src=\"common/image/other/space.gif\" width=\"1\" height=\"10\" border=\"0\" alt=\"\"></td>';
	OutHtml = OutHtml + '				  </tr>';
	OutHtml = OutHtml + '				  <tr>';

	OutHtml = OutHtml + '					<td><a href=\"javascript:FigData_ConnInfoLinkClick(\'winfiggrp1\',\'vehicle/htmlsrc/category.html?j=1\')\;\" onMouseOver=\"MM_swapImage(\'Image1\',\'\',\'common/image/button/top/over_circuit.gif\',1)\" onMouseOut=\"MM_swapImgRestore()\"><img src=\"common/image/button/top/circuit.gif\" alt=\"'
	+ vBaloon_Circuit +
'\" name=\"Image1\" width=\"175\" height=\"54\" border=\"0\" id=\"Image1\"></a></td>';

	OutHtml = OutHtml + '					<td><a href=\"javascript:FigData_ConnInfoLinkClick(\'winfiggrp2\',\'vehicle/htmlsrc/category.html?j=2\')\;\" onMouseOver=\"MM_swapImage(\'Image2\',\'\',\'common/image/button/top/over_harness.gif\',1)\" onMouseOut=\"MM_swapImgRestore()\"><img src=\"common/image/button/top/harness.gif\" alt=\"'
	+ vBaloon_Harness +
'\" name=\"Image2\" width=\"175\" height=\"54\" border=\"0\" id=\"Image2\"></a></td>';

	OutHtml = OutHtml + '					<td><a href=\"javascript:FigData_ConnInfoLinkClick(\'winfiggrp6\',\'vehicle/htmlsrc/category.html?j=6\')\;\" onMouseOver=\"MM_swapImage(\'Image3\',\'\',\'common/image/button/top/'
	+ vImg_overPower +
'\',1)\" onMouseOut=\"MM_swapImgRestore()\"><img src=\"common/image/button/top/'
	+ vImg_hmPower +
'\" alt=\"'
	+ vBaloon_Power +
'\" name=\"Image3\" width=\"175\" height=\"54\" border=\"0\" id=\"Image3\"></a></td>';

	OutHtml = OutHtml + '					<td><a href=\"javascript:FigData_ConnInfoLinkClick(\'winfiggrp4\',\'vehicle/htmlsrc/search.html\')\;\" onMouseOver=\"MM_swapImage(\'Image6\',\'\',\'common/image/button/top/over_search.gif\',1)\" onMouseOut=\"MM_swapImgRestore()\"><img src=\"common/image/button/top/search.gif\" alt=\"'
	+ vBaloon_Connector +
'\" name=\"Image6\" width=\"175\" height=\"54\" border=\"0\" id=\"Image6\"></a></td>';

	OutHtml = OutHtml + '				  </tr>';
	OutHtml = OutHtml + '				<tr>';
	OutHtml = OutHtml + '					<td colspan=\"4\"><img src=\"common/image/other/space.gif\" width=\"5\" height=\"50\"></td>';
	OutHtml = OutHtml + '				</tr>';
	OutHtml = OutHtml + '			</table>';
	OutHtml = OutHtml + '		</td>';
	OutHtml = OutHtml + '		<td><img src=\"common/image/other/space.gif\" width=\"10\" height=\"1\"></td>';
	OutHtml = OutHtml + '	</tr>';
	OutHtml = OutHtml + '	<tr><td colspan=\"3\"><img src=\"common/image/other/space.gif\" width=\"10\" height=\"50\"></td></tr>';
	OutHtml = OutHtml + '</table>';

	return OutHtml;

}


function OutPutTitleMenuSearch1()
{
	return gSearch_ConnectorSearch;
}

function OutPutTitleMenuSearch2()
{
	return gSearch_ConnectorName;
}

function OutPutTitleMenuSearch3()
{
	return gSearch_ConnectorNo;
}

function OutPutTitleMenuSearch4()
{
	return gSearch_ConnectorSearchMemo;
}

function OutPutTitleMenuJC1()
{
	return gJunction_Junction;
}

function OutPutTitleMenuJC2()
{
	return gJunction_Ex;
}

function OutPutTitleMenuJC3()
{
	return gJunction_ConnectorNo;
}

function OutPutTitleMenuJC4()
{
	return gJunction_PinNo;
}

function OutPutTitleMenuJC5()
{
	return gJunction_ConnectorName;
}

function OutPutTitleMenuJC6()
{
	return gJunction_Ex2;
}

function OutPutTitleMenuJC7()
{
	return gHeader_Search;
}

function Disp_eWD(SITQ_Code,vFigid,vFigid2,vPath)
{
        switch(SITQ_Code)
		{
          	case '1010':
				if (vFigid == "")
				{
					var vTarget = 'winfiggrp1';
  					var nwin = window.open(vPath + "/vehicle/htmlsrc/category.html?j=1",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();
				}
				else
				{
					if (vFigid2 == "")
					{
						var vFiggroup = "Circuit Diagram";
  						nFiggroup = GetJobNoFromFiggroup(vFiggroup);
  						var nwin = window.open(vPath + "/vehicle/htmlsrc/fig.html?j=" + nFiggroup + "&f=" + vFigid, 'winfiggrp'+nFiggroup,'status=no,location=no,menubar=no,toolbar=no,resizable=yes');

						nwin.moveTo(20,20);
  						nwin.resizeTo(screen.width-20,screen.height-50);
  						nwin.focus();
					}
					else
					{
  						var vFiggroup = "Circuit Diagram";
  						nFiggroup = GetJobNoFromFiggroup(vFiggroup);

  						var nwin = window.open(vPath + "/vehicle/htmlsrc/fig.html?j=" + nFiggroup + "&f=" + vFigid + "&h=" + vFigid2,'winfiggrp'+nFiggroup,'status=no,location=no,menubar=no,toolbar=no,resizable=yes');

						nwin.moveTo(20,20);
  						nwin.resizeTo(screen.width-20,screen.height-50);
  						nwin.focus();
					}
				}
            	break;
          	case '1013':
				var vTarget = 'winfiggrp4';

  				var nwin = window.open(vPath + "/vehicle/htmlsrc/search.html",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();
            	break;

          	case '1014':
				if (vFigid == "")
				{
					var vTarget = 'winfiggrp2';
  					var nwin = window.open(vPath + "/vehicle/htmlsrc/category.html?j=2",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();
				}
				else
				{
  					var vFiggroup = "Harness Layout";
  					nFiggroup = GetJobNoFromFiggroup(vFiggroup);
  					var nwin = window.open(vPath + "/vehicle/htmlsrc/fig.html?j=" + nFiggroup + "&f=" + vFigid + "&h=" + vFigid2,'winfiggrp'+nFiggroup,'status=no,location=no,menubar=no,toolbar=no,resizable=yes');

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

          	case '1015':
				if (vFigid == "")
				{
					var vTarget = 'winfiggrp6';
  					var nwin = window.open(vPath + "/vehicle/htmlsrc/category.html?j=6",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();
				}
				else
				{
					if (vFigid2 == "")
					{
						var vFiggroup = "Power Source / Grounding / Sneak Path";
  						nFiggroup = GetJobNoFromFiggroup(vFiggroup);
  						var nwin = window.open(vPath + "/vehicle/htmlsrc/fig.html?j=" + nFiggroup + "&f=" + vFigid, 'winfiggrp'+nFiggroup,'status=no,location=no,menubar=no,toolbar=no,resizable=yes');

						nwin.moveTo(20,20);
  						nwin.resizeTo(screen.width-20,screen.height-50);
  						nwin.focus();
					}
					else
					{
  						var vFiggroup = "Power Source / Grounding / Sneak Path";
  						nFiggroup = GetJobNoFromFiggroup(vFiggroup);

  						var nwin = window.open(vPath + "/vehicle/htmlsrc/fig.html?j=" + nFiggroup + "&f=" + vFigid + "&h=" + vFigid2,'winfiggrp'+nFiggroup,'status=no,location=no,menubar=no,toolbar=no,resizable=yes');

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


            	break;
			default:
				break;
        }

}

function Disp_eWD_TOP(vPath)
{
	var vTarget = 'winfiggrp0';

  	var nwin = window.open(vPath + "/index.html",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 Open_XML_Message()
{
	var nwin = window.open('xml.html','_self','status=no,location=no,menubar=no,toolbar=no,resizable=no,scrollbars=no');
	nwin.moveTo(20,20);
	nwin.resizeTo(screen.width-20,screen.height-50);
	nwin.focus();

  	return;

}

function XML_Message()
{
	var XML_Message = gMsxmlVersion_Error;
	var XML_Message1 = gMsxmlVersion_Error1;
	var XML_Message2 = gMsxmlVersion_Error2;

	var OutHTML = '<div>';
	OutHTML = OutHTML + '<text>' + XML_Message + '</text>';
	OutHTML = OutHTML + '<br>';
	OutHTML = OutHTML + '<a href=\"../../../' + XML_Message2 + '\">' + XML_Message1 + '</a>';
	OutHTML = OutHTML + '</div>';

	return OutHTML;

}
