sfHover = function() {
	var sfEls = document.getElementById("navbar").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" hover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" hover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

$(function(){
					var s;
					var len;
					$(".sibling").corner("top 5px");
					if ((jQuery.browser.version >= 7.0) && (jQuery.browser.msie) && (jQuery.browser.version < 8.0)){ 
						$("#navbar li ul li").css("margin-left", "-16px");
						$(".tablediv").each(function(){
							s = $(this).text();
							$(this).width( (s.length * 4)  + 40);
						});
					}
					$("#navbar li ul").each(function(e){
						var iterat = -1;
						var e;
						var counterinside;
						$(this).children().each(function(e){//div
							if(e == 0){
									$(this).children().each(function(){ //li
										$(this).children().css("border", "none");	//a
									});
									counterinside = -1;
									$(this).children().each(function(e){counterinside++;});
									$(this).children().each(function(e){
										if (e == counterinside) $(this).corner("bl 5px");
									});
							}
							iterat++;
						});
						$(this).children().each(function(e){
							if(e == iterat){
								counterinside = -1;
								$(this).children().each(function(e){counterinside++;});
								$(this).children().each(function(e){
									if (e == counterinside) $(this).corner("br 5px");
								});
							}
						});
						
					});
					
					
					$(".sibling").bind("mouseenter",function(){
						$(this).css("background", "transparent url(/img/buttonhover.png) repeat-x").css("color", "#FFF").css("text-decoration", 
"none");
					}).bind("mouseleave",function(){
						$(this).css("background", "#cfd0d4 url(/img/button.png) no-repeat").css("color", "#434a83").css("text-decoration", "none");
					});
					$("#navbar li ul").bind("mouseenter",function(){
						$(this).parent().children(".sibling").css("background", "transparent url(/img/buttonhover.png) repeat-x").css("color", 
"#FFF");
					}).bind("mouseleave",function(){
						$(this).parent().children(".sibling").css("background", "#cfd0d4 url(/img/button.png) no-repeat").css("color", "#434a83");
						
					});
			   });

