
var lshTemplate='<div class="leadership"><div class="box_title_leadership_close" id="lsh_header[id]" onclick="Show([id])"><h3><a href="JavaScript:;">[title]</a></h3></div><div class="leadership-data" id="lsh_data[id]" style="display:none;">[text]</div></div>';
var xmlHttp;
var url="lsh.xml";
var iLsh = 0;
var aLsh = new Array();

function GetXmlHttpObject()
{
	if (window.XMLHttpRequest) {
        xmlHttp = new XMLHttpRequest();        
    } else if (window.ActiveXObject) {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");        
    }
    return xmlHttp;
}	

function GetLSH()
{ 
	xmlHttp=GetXmlHttpObject();
//	alert(xmlHttp);
	if (xmlHttp==null)
	{
	  alert ("Your browser does not support AJAX!");
	  return;
	}	
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	try
	{
		xmlHttp.send(url);
	}
	catch(err){}
}

function stateChanged() 
{ 
	if (xmlHttp.readyState==4)
	{
		
		xmlDoc=xmlHttp.responseXML.documentElement
		if(!xmlDoc)
		{
			xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
			xmlDoc.async="false";
			xmlDoc.load(url);
		}
		
		var links = xmlDoc.getElementsByTagName("link");
		var titles = xmlDoc.getElementsByTagName("title");
		var texts = xmlDoc.getElementsByTagName("text");	
		var content = "";
		for(;iLsh<titles.length;iLsh++)
		{
			var sLsh = lshTemplate;
			if(links[iLsh].childNodes[0].nodeValue)
				sLsh = sLsh.replace("[link]",titles[iLsh].childNodes[0].nodeValue);
			if(titles[iLsh].childNodes[0].nodeValue)
				sLsh = sLsh.replace("[title]",titles[iLsh].childNodes[0].nodeValue);
			if(texts[iLsh].childNodes[0].nodeValue)
				sLsh = sLsh.replace("[text]",texts[iLsh].childNodes[0].nodeValue);
			sLsh = sLsh.replace(/\[id\]/gi,iLsh);			
			content += sLsh;
			
			aLsh[iLsh] = 0;
			
		}
		document.getElementById("box_data_3").innerHTML = content;		
	}
	
}

function Show(id)
{
	if(aLsh[id])
	{
		aLsh[id] = 0;
		document.getElementById("lsh_header"+id).className = "box_title_leadership_close";
		document.getElementById("lsh_data"+id).style.display = "none";
	}
	else
	{
		aLsh[id] = 1;
		document.getElementById("lsh_header"+id).className = "box_title_leadership_open";
		document.getElementById("lsh_data"+id).style.display = "";
	}
}

