// Script for news & events section of website.

var gneRootPath = "http://wamboincommunity.asn.au/newsandevents/";

var gneEventURLPrefix = gneRootPath + "index.php?op=events&eventRef=";
var gneEventWinRef = "neEventWinRef";

function showEventItems(pEventRef, pArchiveMode) {
	vUrl = gneEventURLPrefix + pEventRef + "&archive=" + pArchiveMode;
	openModalWindow(vUrl, gneEventWinRef, 630, 630);
}

var gneNewsURLPrefix = gneRootPath + "index.php?op=news&newsRef=";
var gneNewsWinRef = "neNewsWinRef";

function showNewsItems(pNewsRef, pArchiveMode) {
	vUrl = gneNewsURLPrefix + pNewsRef + "&archive=" + pArchiveMode;
	openModalWindow(vUrl, gneNewsWinRef, 630, 630);
}

function showHide(pItemId, pVisibility) {
  //alert("Inside showHide");
  var vItem = document.getElementById(pItemId);
  var vSwitchShow = document.getElementById(pItemId + "_switchShow");
  var vSwitchHide = document.getElementById(pItemId + "_switchHide");
  if (!vItem || !vSwitchShow || !vSwitchHide) return;

  if (pVisibility == "show") {
    vItem.style.display = "block";
    vSwitchShow.style.display = "none";
    vSwitchHide.style.display = "block";
  } else if (pVisibility == "hide") {
    vItem.style.display = "none";
    vSwitchShow.style.display = "block";
    vSwitchHide.style.display = "none";
  }
}

