function Menu(a){this.DivID=a;this.RootUrl="http://www.filigranes.be/"}Menu.prototype.Init=function(){if(document.getElementById(this.DivID)){var a=GetCookie("Mail");var b=GetCookie("UserType");if(a&&b){this.LoadMenu()}else{document.getElementById(this.DivID).appendChild(document.createTextNode("Veuillez vous connecter !"))}}};Menu.prototype.LoadMenu=function(){var a=this;new Ajax.Request(this.RootUrl+"Menu.ashx",{method:"POST",onSuccess:function(b){a.OnLoadMenuSucceed(b)},onFailure:function(b){a.OnLoadMenuSucceed()},postBody:GetCookie("Mail")})};Menu.prototype.OnLoadMenuSucceed=function(e){if(document.getElementById(this.DivID)){if(document.getElementById(this.DivID).hasChildNodes()){while(document.getElementById(this.DivID).childNodes.length>=1){document.getElementById(this.DivID).removeChild(document.getElementById(this.DivID).firstChild)}}if(e&&e.responseXML){var k=e.responseXML.getElementsByTagName("Menu");if(k&&k.length){for(var h=0;h<k.length;h++){var f=k[h];if(f&&f.childNodes.length>0){if(f.attributes.getNamedItem("Name")){var n=document.createElement("h3");n.appendChild(document.createTextNode(f.attributes.getNamedItem("Name").nodeValue));document.getElementById(this.DivID).appendChild(n);var c=f.getElementsByTagName("Item");if(c&&c.length){for(var g=0;g<c.length;g++){var a=c[g];var b="";var l="";if(a.attributes.getNamedItem("Name")){b=a.attributes.getNamedItem("Name").nodeValue}if(a.attributes.getNamedItem("Link")){l=a.attributes.getNamedItem("Link").nodeValue}var d=document.createElement("div");var m=document.createElement("a");m.setAttribute("href",l);m.setAttribute("target","_self");m.appendChild(document.createTextNode(b));d.appendChild(m);document.getElementById(this.DivID).appendChild(d)}}}}}}}}};