var IEfix = {
//This object handles all the crap we need to do in IE(various versions) to get the menu working like other browsers
	/*@cc_on
	@if(@_jscript_version < 5.7)
		ie: true,
	@end
	@if(@_jscript_version < 5.6)
		ie5: true,
	@end
	@*/
	showing: false,
	uls: Array(),
	windowed: Array(),
	check: function(){
	//This function is repeatedly called, and handles the decision of when to hide/show the selects
		for(var i=0;i<this.uls.length;i++){
			if(this.uls[i].style.display == 'block'){
				this.show();
				return;
			}
		}
		this.hide();
	},
	load: function(){
	//This function will load the Select hiding mechanism if it is needed
		if(this.ie){
			var uls = document.getElementsByTagName('ul');
			for(var i=0;i<uls.length;i++){
				if(uls[i].className.indexOf('submenu') != -1){
					this.uls[this.uls.length] = uls[i];
				}
			}
			this.windowed = document.getElementsByTagName('select');
			if(this.windowed.length > 0){
				setInterval('IEfix.check()',10);
			}
		}
	},
	show: function(){
		//Hide the selects
		if(this.showing == false){
			this.showing = true;
			this.applyStyle(this.windowed,'visibility','hidden');
		}
	},
	hide: function(){
		//Show the selects
		if(this.showing == true){
			this.showing = false;
			this.applyStyle(this.windowed,'visibility','visible');
		}
	},
	fixBoxModel: function(ob){
	//This function will take a div and fix the box model if the browser is IE5(.5) or IE6 in Quirks Mode,this should probably be a style sheet, but this is easier for the user, and easier to detect
		if(this.ie5 || (this.ie && document.compatMode && document.compatMode == 'BackCompat')){
			var vertical = ob.className.indexOf('vertical') != -1;//Is this a vertical or a horizontal menu?
			var as = ob.getElementsByTagName('a');//Get all the tags
			var lis = ob.getElementsByTagName('li');
			var uls = ob.getElementsByTagName('ul');
			applyStyle(as,'height','20px');
			if(this.ie5){
				this.applyStyle(lis,'marginLeft','-16px');
			}
			if(vertical){
				this.applyStyle(uls,'width','200px');
			}
			else{
				this.applyStyle(as,'width','129px');
			}
			for(var i=0;i<uls.length;i++){
				if(uls[i].parentNode.nodeName == 'LI'){
					if(vertical){
						uls[i].style.left = '200px';
					}
					else{
						uls[i].style.width = '127px';
						if(uls[i].parentNode.parentNode.parentNode.nodeName == 'DIV'){
							uls[i].style.top = '20px';
						}
					}
				}
			}
		}
	},
	applyStyle: function(group,style_type,value){
		for(var i=0;i<group.length;i++){
			group[i].style[style_type] = value
		}
	},
	fakeTable: function(ob){
	//This function will take a div and fix the width if it is horizontal
		if(ob.className.indexOf('horizontal') != -1){
			var count = ob.children[0].children.length;//Use children[0] to avoid text/comment nodes
			ob.style.width = count*127+2+'px';
		}
	}
};