function fixPage() {
	var myWindows = document.getElementsByTagName('div');
	for(var idx = 0 ; idx < myWindows.length ; idx++) {
		if(myWindows[idx].className == 'tabbuttoncontainer') {
			myLabels = myWindows[idx].getElementsByTagName('img');
			for(var odx = 0 ; odx < myLabels.length ; odx++) {
				myLabels[odx].onclick = function() {
					raisePane(this);
				}
			}
		}
	}
}

function toggleLeftMenu() {
	var myButton = document.getElementById('menutabbutton');
	var myMenu = document.getElementById('leftmenu');
	if(myMenu.style.display == null || myMenu.style.display == 'none') {
		myMenu.style.display = 'block';
		myButton.style.marginLeft = '130px';
		document.getElementById('xclose').style.display = 'block';
	} else {
		myMenu.style.display = 'none';
		myButton.style.marginLeft = '0px';
		document.getElementById('xclose').style.display = 'none';
	}
}

function raisePane(obj) {
	var myPaneContainer = obj.parentNode;
	myOtherPanes = myPaneContainer.getElementsByTagName('img');
	for(var idx = 0 ; idx < myOtherPanes.length ; idx++) {
		myOtherPanes[idx].className = 'tmp';
		myOtherPanes[idx].src = myOtherPanes[idx].src.replace('2.gif', '1.gif');
		myFriend = document.getElementById(myOtherPanes[idx]["for"] || myOtherPanes[idx].htmlFor);
		
		myFriend = document.getElementById(myOtherPanes[idx].getAttribute("for") || myOtherPanes[idx].htmlFor);
		myFriend.style.display = 'none';
	}
	obj2 = document.getElementById(obj.getAttribute("for") || obj.htmlFor);
	obj2.style.display = 'block';
	obj.className = 'active';
	obj.src = obj.src.indexOf('1.gif') > 0 ? obj.src.replace('1.gif' , '2.gif') : obj.src.replace('2.gif', '1.gif');
}


function expandCategory(cat_id) {
	document.getElementById('cat_' + cat_id).style.display = 'block';
}

function hide(cat_id) {
	timeout_id = setTimeout("document.getElementById('cat_"  + cat_id + "').style.display = 'none';" , 10);
}

function interruptTimeout() {
	clearTimeout(timeout_id);
}

function continueTimeout(cat_id) {
	timeout_id = setTimeout("document.getElementById('cat_"  + cat_id + "').style.display = 'none';" , 10);
}

function showPane(pane_id) {
	document.getElementById(pane_id).style.display = 'block';
}

function hidePane(pane_id) {
	document.getElementById(pane_id).style.display = 'none';
}