var gazeteTimer = null;

function showGazetePanel(visible) {
	if (visible) {
		// hizli erisimi gizle
		var pnlErisim = document.getElementById("divGazeteErisim");
		pnlErisim.style.display = "none";

		// clear list2 and fill with current selection
		fillGazeteList2();
	}

	var pnl = document.getElementById("divGazeteSecim");
	if (pnl != null)
		pnl.style.display = visible ? "block" : "none";
}

function toggleGazeteErisimPanel() {
	var pnl = document.getElementById("divGazeteErisim");
	var visible = pnl.style.display == "none";

	if (visible)
		showGazeteErisimPanel();
	else
		hideGazeteErisimPanel();
}

function hideGazeteErisimPanel() {
	var pnl = document.getElementById("divGazeteErisim");
	pnl.style.display = "none";
}

function hideGazeteErisimPanelDelayed() {
	setGazeteTimeout('hideGazeteErisimPanel()', 1000);
}

function showGazeteErisimPanel() {
	// yazar secimini gizle
	cancelGazeteChange();

	var pnl = document.getElementById("divGazeteErisim");
	pnl.style.display = "block";
}

function clearGazeteTimeout() {
	if (gazeteTimer != null) {
		clearTimeout(yazarTimer);
		gazeteTimer = null;
	}
}

function setGazeteTimeout(code, duration) {
	clearGazeteTimeout();
	gazeteTimer = setTimeout(code, duration);
}

function cancelGazeteChange() {
	showGazetePanel(false);
}

