function loadXMLDoc(url, writeM) {
	menuW = writeM;
	xmlDoc = window.ActiveXObject? new ActiveXObject("Microsoft.XMLDOM") : document.implementation.createDocument("", "", null);
	xmlDoc.async = false;
	xmlDoc.onreadystatechange=checkState;
	try{
		xmlDoc.onload=checkState2;
		}
	catch(e){
		
	}	
	xmlDoc.load("Products.xml");
}

function checkState(){
	if (xmlDoc.readyState == 4) {
		if(menuW == 'product') {
			writeMenu('productName', 'onclickProduct');
		}
		else if(menuW =='access'){
			writeMenu('accessName', 'onclickAccess');
		}
		else if(menuW =='faqs'){
			writeMenu('faqName', 'onclickFaq');
		}
	}
}
function checkState2(){
	if(menuW == 'product') {
		writeMenu('productName', 'onclickProduct');
	}
	else if(menuW =='access'){
			writeMenu('accessName', 'onclickAccess');
	}
	else if(menuW =='faqs'){
			writeMenu('faqName', 'onclickFaq');
	}
}

function writeMenu(menuName, menuOnclick){
	var list = document.createElement('ul');
	var links = xmlDoc.documentElement.getElementsByTagName(menuName);
	var onclickCall = xmlDoc.documentElement.getElementsByTagName(menuOnclick);
	for (i=0; i<links.length; i++) {
		var newText = document.createTextNode(links[i].childNodes[0].nodeValue);
		var newNode = document.createElement("li");
		var mAnchor = document.createElement("a");
		newNode.setAttribute("class","sideMenu");
		newNode.setAttribute("className","sideMenu");
		mAnchor.setAttribute("href", '#');
		mAnchor.setAttribute("title","default");
	   //if NN6 then OK to use the standard setAttribute
		if((!document.all)&&(document.getElementById)){
			mAnchor.setAttribute("onClick", onclickCall[i].childNodes[0].nodeValue);
 			}    
		//workaround for IE 5.x
		if((document.all)&&(document.getElementById)){
			mAnchor["onclick"]=new Function(onclickCall[i].childNodes[0].nodeValue);
		}
		mAnchor.appendChild(newText);
		newNode.appendChild(mAnchor);
		list.appendChild(newNode);
	}
 	document.getElementById("leftcol").innerHTML = "";
	document.getElementById("leftcol").appendChild(list);
}


	
	


















