$(document).ready(function() {
	if (document.all&&document.getElementById) {
		navRoot = $(".container");
		for (i=0; i<navRoot.length; i++) {
			for (j=0; j<navRoot[i].childNodes.length; j++) {
				node = navRoot[i].childNodes[j];
				if (node.nodeName=="LI") {
					node.onmouseover=function() {
						this.className+=" over";
					}
					node.onmouseout=function() {
						this.className=this.className.replace(" over", "");
					}
				}
			}
		}
	}
});

if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
	
	$(document).ready(function(){
		$("#leagues .hover").html('<a href="javascript:void(0);" class="iphone">Select League</a>:');
		$("#leagues .container").css("display","block");
		var iPhoneWidth = $("#leagues .container").width();
		$("#leagues .container").css({ width:iPhoneWidth+"px", display:"none" });
		
		$("#leagues a.iphone").toggle(
			function(){
				$("#leagues").css({ width:(iPhoneWidth+24)+"px" });
				$("#leagues .container").css({ width:iPhoneWidth+"px", display:"block" });
				$("#leagues .hover .iphone").html('Close Menu');
			},
			function(){
				$("#leagues").css({ width:"auto" });
				$("#leagues .container").css({ width:iPhoneWidth+"px", display:"none" });
				$("#leagues .hover .iphone").html('Select League');
			}
		);
	});
}