
var returnValue="";
var xmldoc;
var errorMessage = "";
var harError = false;
var root = null;
var linkFileName = "";
var xmlPath = "/xml/productType.xml";

xmldoc = new ActiveXObject("Microsoft.XMLDOM");
xmldoc.async = false;
xmldoc.load(xmlPath);

if(xmldoc.parseError.errorCode!=0)
{
	hasError = true;
	errorMessage = xmldoc.parseError.reason;
}
else
{
	root = xmldoc.documentElement;
}

function BizType(bizTypeId)
{
	switch(bizTypeId)
	{
		case "1":
			returnValue = " &gt;&gt; <a href='http://en.m669.com/buy/'>Selling Leads</a>";
			break;
		case "2":
			returnValue = " &gt;&gt; <a href='http://en.m669.com/sell/'>Buying Leads</a>";
			break;
		case "3":
			returnValue = " &gt;&gt; <a href='http://en.m669.com/sell/'>Urgent Buying</a>";
			break;
		case "4":
			returnValue = " &gt;&gt; <a href='http://en.m669.com/buy/'>Recruit agent</a>";
			break;
		case "5":
			returnValue = " &gt;&gt; <a href='http://en.m669.com/sell/'>Apply for agent</a>";
			break;
		case "6":
			returnValue = " &gt;&gt; <a href='http://en.m669.com/buy/'>Cooperateing Leads</a>";
			break;
		case "":
			returnValue = " &gt;&gt; <a href='http://en.m669.com/product/'>Products</a>";
			break;
		default:
			returnValue = "";
	}
	
	document.write(returnValue);
}

function ProductType(productTypeId,bizTypeId)
{
	if(productTypeId!="" && productTypeId!=null)
	{
		var xmlNode_One;
		var xmlNode_Two;
		var xmlNode_Three;
		var xmlNode_One_Value = "";
		var xmlNode_Two_Value = "";
		var xmlNode_Three_Value = "";
		var xmlNode_One_Id = "";
		var xmlNode_Two_Id = "";
		var xmlNode_Three_Id = "";
		
		if(bizTypeId=="1")
		{
			linkFileName="http://en.m669.com/buy/buy";
		}
		else
		{
			if(bizTypeId=="2")
			{
				linkFileName="http://en.m669.com/sell/sell";
			}
			else
			{
				linkFileName="http://en.m669.com/product/product";
			}
		}
		
		if(productTypeId.length==3)
		{
			xmlNode_One = root.selectSingleNode("/AllType/One[@ID='" + productTypeId + "']");
			xmlNode_One_Value = xmlNode_One.attributes.getNamedItem("Value").value;
			xmlNode_One_Id = xmlNode_One.attributes.getNamedItem("ID").value;
			//document.title = xmlNode_One_Value;
			returnValue = " &gt;&gt; <a href='" + linkFileName + "_list.aspx?BizTypeId=" + bizTypeId + "&ProductTypeId=" + xmlNode_One_Id + "'>" + xmlNode_One_Value + "</a>";
		}
		
		if(productTypeId.length==6)
		{
			xmlNode_Two = root.selectSingleNode("/AllType/One/Two[@ID='" + productTypeId + "']");
			xmlNode_Two_Value = xmlNode_Two.attributes.getNamedItem("Value").value;
			xmlNode_Two_Id = xmlNode_Two.attributes.getNamedItem("ID").value;
			xmlNode_One = xmlNode_Two.parentNode;
			if(xmlNode_One!=null)
			{
				xmlNode_One_Value = xmlNode_One.attributes.getNamedItem("Value").value;
				xmlNode_One_Id = xmlNode_One.attributes.getNamedItem("ID").value;
			}
			//document.title = xmlNode_Two_Value;
			returnValue = " &gt;&gt; <a href='" + linkFileName + "_list.aspx?BizTypeId=" + bizTypeId + "&ProductTypeId=" + xmlNode_One_Id + "'>" + xmlNode_One_Value + "</a> &gt;&gt; <a href='" + linkFileName + "_List.aspx?BizTypeId=" + bizTypeId + "&ProductTypeId=" + xmlNode_Two_Id + "'>" + xmlNode_Two_Value + "</a>";
		}
		
		if(productTypeId.length==9)
		{
			xmlNode_Three = root.selectSingleNode("/AllType/One/Two/Three[@ID='" + productTypeId + "']");
			xmlNode_Three_Value = xmlNode_Three.attributes.getNamedItem("Value").value;
			xmlNode_Three_Id = xmlNode_Three.attributes.getNamedItem("ID").value;
			xmlNode_Two = xmlNode_Three.parentNode;
			if(xmlNode_Two!=null)
			{
				xmlNode_Two_Value = xmlNode_Two.attributes.getNamedItem("Value").value;
				xmlNode_Two_Id = xmlNode_Two.attributes.getNamedItem("ID").value;
				xmlNode_One = xmlNode_Two.parentNode;
				if(xmlNode_One!=null)
				{
					xmlNode_One_Value = xmlNode_One.attributes.getNamedItem("Value").value;
					xmlNode_One_Id = xmlNode_One.attributes.getNamedItem("ID").value;
				}
			}
			//document.title = xmlNode_Three_Value;
			returnValue = " &gt;&gt; <a href='" + linkFileName + "_list.aspx?BizTypeId=" + bizTypeId + "&ProductTypeId=" + xmlNode_One_Id + "'>" + xmlNode_One_Value + "</a> &gt;&gt; <a href='" + linkFileName + "_List.aspx?BizTypeId=" + bizTypeId + "&ProductTypeId=" + xmlNode_Two_Id + "'>" + xmlNode_Two_Value + "</a> &gt;&gt; <a href='" + linkFileName + "_List.aspx?BizTypeId=" + bizTypeId + "&ProductTypeId=" + xmlNode_Three_Id + "'>" + xmlNode_Three_Value + "</a>";
		}
		document.write(returnValue);
	}
}
