	var httpRequest;

	function getBranch(module, content)
	{
		//var url = 'GeneralDetails';
		if (window.ActiveXObject)
		{
			httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
		}
		else if (window.XMLHttpRequest)
		{
			httpRequest = new XMLHttpRequest();
			if (httpRequest.overrideMimeType) {
                httpRequest.overrideMimeType('text/xml');
            }
		}
		httpRequest.onreadystatechange = function(){ProductsInfo();};
		httpRequest.open('POST', 'ProductSev.jsp?module='+module+'&content='+content, true);		
		httpRequest.send(null);
	
	}

	function ProductsInfo()
	{
		if (httpRequest.readyState == 4)
		{
			if (httpRequest.status == 200)
			{
				//alert(httpRequest.statusText);
				// get the XML send by the servlet
				ProductsXML = httpRequest.responseXML;
				// update html
				updateXML(ProductsXML);
			}
			else 
			{
				alert(httpRequest.responseText);
			}
		}
	}

	function updateXML(ProductsXML)
	{
		
		var product = document.getElementById('product');
		product.options.length = 0;
		
		// get all the root
		var root = ProductsXML.getElementsByTagName('root').item(0);	
		//alert(root.childNodes.length);
		if (root.childNodes.length == 0)
		{	
			product.options[0] = new Option("- Please Select Catalog -", "");
		}
		else
		{
			// for each <product>
			for (var i = 0; i<root.childNodes.length; i++)
			{
				var node = root.childNodes.item(i);
				var productLink, productName;
				// get the productLink and productName
				if (node.childNodes[0].firstChild.nodeValue != 'N/A')
				{
					if (node.childNodes[0].firstChild.nodeValue.length > 35)
						productName = node.childNodes[0].firstChild.nodeValue.substring(0,35)+" ...";
					else
						productName = node.childNodes[0].firstChild.nodeValue;
				}
				else
					productName = "";
				if (node.childNodes[1].firstChild.nodeValue != 'N/A')
					productLink = node.childNodes[1].firstChild.nodeValue;
				else
					productLink = "";

				product.options[i] = new Option(productName, productLink);
			}
		}
	}

	

