(function(){
var iframeHack = function( ul ) {
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){
		 f1 = document.createElement("IFRAME");
		 f1.setAttribute("src", "javascript: false;");
		 f1.setAttribute("marginWidth", "0");
		 f1.setAttribute("marginHeight", "0");
		 f1.setAttribute("align", "bottom");
		 f1.setAttribute("scrolling", "no");
		 f1.setAttribute("align", "bottom");
		 f1.style.position = "absolute";
		 f1.style.display = "block";
		 f1.style.zIndex = "-1";
		 f1.style.top = "0";
		 f1.style.left = "0";
		 f1.style.filter = "alpha(opacity=0)";
		 f1.style.height = ul.offsetHeight+'px';
		 f1.style.width = ul.offsetWidth+'px';
		 ul.appendChild(f1);
	}
}

var getChildNodes = function( el ) {
	var nodes = el.childNodes;
	var a = new Array();
	for(i=0; i < nodes.length; i++) {
		if (nodes[i].nodeType == 1) {
			a.push(nodes[i]);
		}
	}
	return a;
}


var awLib = window.awLib = {}
awLib.data = {};
awLib.lib  = {};

awLib.initMenu = function( id ) {
	var el = document.getElementById(id);
	if (el) {
		var item = id.replace(/-/g, '_');
		awLib.data[item] = new awLib.lib.aw_menu(el);
	}	
}

awLib.lib.aw_menu = function( el ) {
	var headers = getChildNodes(el);
	for (i=0; i < headers.length; i++) {
		var child = headers[i].getElementsByTagName('ul')[0];
		if (child) {
			iframeHack(child);
			child.style.display = 'none';

			headers[i].onmouseover = function() {
				var child = this.getElementsByTagName('ul')[0];
				this.className = 'over';
				if (child) {
					child.style.display = '';
					this.className = 'over';
//					child.style.left = this.style.left + this.offsetWidth - 300 + 'px';
				}
			}
			headers[i].onmouseout = function(){
				var child = this.getElementsByTagName('ul')[0];
				if (child){ 
					child.style.display = 'none';
					this.className = '';
				}
				
			}
		}
		else{
			headers[i].onmouseover = function() {
				this.className = 'over';
			}
			headers[i].onmouseout = function(){
				this.className = '';
			}
		}
	}
}
})();
