	function initMenu(element,sub){	
		for(var i=0; i<element.childNodes.length; i++) {
			node = element.childNodes[i];
			node.myparent=element;
			if (node.nodeName=="LI") {
					node.sub=sub;
					node.onmouseover=function() {
						try {
							for( var x = 0; this.childNodes[x]; x++ ){
								if( this.childNodes[x].tagName == 'UL' ) { 
									//alert("eto go");
									this.childNodes[x].style.display="block";
									if(IE6){
										if(this.childNodes[x].childNodes[0].childNodes[0].innerHTML=="Profiles"){
											this.childNodes[x].style.marginLeft="-43px";
										}
										if(this.childNodes[x].childNodes[0].childNodes[0].innerHTML=="Grad Scheme"){
											this.childNodes[x].style.marginLeft="-123px";
										}
									}
									this.childNodes[x].style.zIndex="30"; 
									//document.getElementById(ob).style.cssText = styleString;	
								}
							}
						} 
						catch(e) {}
					}
					node.onmouseout=function() {
						try {
							for( var x = 0; this.childNodes[x]; x++ ){
								if( this.childNodes[x].tagName == 'UL' ) { 
									this.childNodes[x].style.display="none"; 
								}
							}
						} 
						catch(e) {}
					}
					
					for( var x = 0; x<node.childNodes.length; x++ ){
						if( node.childNodes[x].tagName == 'A'){ 
							node.childNodes[x].myparent=node;
							if(sub){
								node.childNodes[x].onmouseover=function(){
									//this.style.backgroundPosition="0px -498px"; 
								}	
								node.childNodes[x].onmouseout=function(){
									//this.style.backgroundPosition="0px 0px";
								}
								node.childNodes[x].onclick=function(){
									//alert(this.myparent.myparent.tagName);
									this.myparent.myparent.myparent.onmouseout(); 
								}
								
							}
							else{
								node.childNodes[x].onmouseover=function(){
									//this.style.backgroundPosition="0px -1000px"; 
								}	
								node.childNodes[x].onmouseout=function(){
									//this.style.backgroundPosition="0px 0px";
								}
					
							}		
						}
						if( node.childNodes[x].tagName == 'UL' ) { 
							node.childNodes[x].myparent=node;
							initMenu(node.childNodes[x],true);
						}						
					}			

			}	
		}
	}
	function clearLinks(){
		if (document.links) {
			try {
				for (var i=0;i < document.links.length;i++) {
					document.links[i].onfocus=function(){
						this.blur();
					}
				}
			} 
			catch(e) {}
		}
	}	
	startList = function() {
			navRoot = document.getElementById("nav");
			initMenu(navRoot,false);
			clearLinks();
	}
	window.onload=startList;

if (window.external && (typeof window.XMLHttpRequest == "undefined")) {
	var IE6=true;
}	
else{
	var IE6=false;
}
