function expand(id) {
	var elem = document.getElementById(id);
	if(elem.style.display != 'none') {
		elem.style.display = 'none';
		createCookie(id, 1, 365);
	}
	else {
		elem.style.display = '';
		createCookie(id, 0, 0);
	}
	
	return true;
}

function swapMenu(id, theme) {
	expand(id);
	
	if(readCookie(id) != 1) {
		document.getElementById('img_'+id).src = 'themes/'+theme+'/images/arrow_02.png';
	}
	else {
		document.getElementById('img_'+id).src = 'themes/'+theme+'/images/arrow_01.png';
	}
	
}

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

if (window.attachEvent) window.attachEvent("onload", sfHover);

$(function() {
	$(".bubble").tooltip({
		track: true,
		delay: 0,
		showURL: false,
		opacity: 1,
		fixPNG: true,
		showBody: " - ",
		extraClass: "pretty fancy",
		top: -15,
		left: 5
	});
	
	$(".bubble").live('mouseover', function() {
		$(this).css({cursor : 'pointer'});
	}).live('click', function() {
		document.location.href='index.php?m=matches&match='+this.id;
	});
	
	$(".pmenu").live('mouseover', function() {
		$(this).addClass('menu_02');
	}).live('mouseout', function() {
		$(this).removeClass('menu_02');
	});
	
	$(".smenu").live('mouseover', function() {
		$(this).addClass('menu_04');
	}).live('mouseout', function() {
		$(this).removeClass('menu_04');
	});
	
});

