function PopUp()
{var panel = document.getElementById("popup");
if(panel.style.display == "inline") 
{ 
panel.style.display = "none"; 
} 
else 
{ 
panel.style.display = "inline"; 
} 
}

function OnOff(event) 
{ 
var style = this.parentNode.nextSibling.style;  
if(style.display == "none") 
{ 
style.display = "block"; 
} 
else 
{ 
style.display = "none"; 
} 
} 

function Hide(Element) 
{ 
alert(Element.style.display);
Element.style.display="none";
alert(Element.style.display);
} 

function Vide(Element) 
{ 
alert(Element.style.display);
Element.style.display="block";
alert(Element.style.display);
} 

function loadLeftBanner(pic,href)
{
var panel = document.getElementById("panel");
var newsblock = panel.firstChild;
var img = new Image();
img.src=pic;
	if (href)
		{var anchor = document.createElement("a");
		 anchor.href = href;
		 anchor.appendChild(img);
		 panel.insertBefore(anchor,newsblock);}
		else {
		 panel.insertBefore(img,newsblock);}
}

function loadrightBanner(pic,href)
{
var panel = document.getElementById("r1"); 
/* var panel = document.getElementById("panel");  */
var newsblock = panel.firstChild;
var img = new Image();
img.src=pic;
	if (href)
		{var anchor = document.createElement("a");
		 anchor.href = href;
		 anchor.appendChild(img);
		 panel.appendChild(anchor);}
		else {
		 panel.appendChild(anchor);}
}

function loadXML(fileName)
{
if (window.ActiveXObject) var xmldoc= new ActiveXObject("Microsoft.XMLDOM");
else if (window.XMLHttpRequest) {var xmlRequest = new XMLHttpRequest();xmlRequest.open("GET",fileName,false);xmlRequest.send(null); return xmlRequest.responseXML;}
else if (document.implementation&&document.implementation.createDocument) xmldoc=document.implementation.createDocument("","doc",null);
xmldoc.async=false;
xmldoc.load(fileName);
return xmldoc;
}

function loadXMLMenu(fileName)
{
var panel = document.getElementById("panel"); 
var newsblock = panel.firstChild;
if (fileName)
{ var xmldoc=loadXML(fileName);}
else { var xmldoc=loadXML("menu.xml");}


var 	root=xmldoc.documentElement;
	if (root.hasChildNodes())
	{ 

	var child = root.firstChild; 
	do 	{

		var anchor = document.createElement("a");
		var MenuGroup = document.createElement("div");
		var newtext= document.createTextNode(child.getAttribute("Name"));
		anchor.className = child.getAttribute("class");
		var ClassGroup = child.getAttribute("ClassGroup")
		MenuGroup.className=ClassGroup;

		var href = child.getAttribute("href");
		anchor.appendChild(newtext);
		MenuGroup.appendChild(anchor);
		panel.insertBefore(MenuGroup,newsblock);
	if (href)
		{anchor.href = href;
		var tt=new RegExp(href);if (tt.test(window.location.pathname)) MenuGroup.id="CUR";
		}
	else 	{anchor.href = "#";}

		if (child.hasChildNodes())
			{	var disp='none';
				var layer = document.createElement("div");
			layer.className="MENU_ACS";
			var chi = child.firstChild;
			do 	{ 
		var anchorItem = document.createElement("a");
		var br = document.createElement("br");
		anchorItem.className = chi.getAttribute("class");
		href = chi.getAttribute("href");
		anchorItem.href=href;
		var newtext= document.createTextNode(chi.getAttribute("Name"));
		anchorItem.appendChild(newtext);
		anchorItem.appendChild(br);
		var br = document.createElement("br");
		anchorItem.appendChild(br);
		tt=new RegExp(href);
		if (tt.test(window.location.pathname)) {
			disp='block';
			anchorItem.id="CUR";
			MenuGroup.id="CUR";
							}
		var MenuItem = document.createElement("div");		
		MenuItem.className=ClassGroup;
		MenuItem.appendChild(anchorItem)
		layer.appendChild(MenuItem);

		chi = chi.nextSibling;


				} while (chi)
		layer.style.display=disp;
		panel.insertBefore(layer,newsblock); 
		anchor.onclick=OnOff;
		}

	child = child.nextSibling;
		} while (child)

	}
return;
}