<!--

var mm_bannerPanelState = getCookie('mm_bannerPanelState') ? getCookie('mm_bannerPanelState') : 1;
var mm_searchPanelState = getCookie('mm_searchPanelState') ? getCookie('mm_searchPanelState') : 0;

function dateNow()
{
  var dayNames = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'); 
  var monthNames = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
  var postFix = new Array ('st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'st'); 

  // Find todays date, and display it.

  var now = new Date;
  var weekday = now.getDay();
  var day = now.getDate();
  var month = now.getMonth();
  var year = now.getFullYear();

  document.write(dayNames[weekday] + ", " + day + postFix[day-1] + " " + monthNames[month] + " " + year);
}

function showHide(layerID)
{
  if (document.all)
  {
	// it's IE
    document.all[layerID].style.visibility = (document.all[layerID].style.visibility == 'visible' ? 'hidden' : 'visible');
	document.all[layerID].style.display = (document.all[layerID].style.display == 'none' ? 'block' : 'none');
  }
  else if (document.getElementById)
  {
	document.getElementById(layerID).style.visibility = (document.getElementById(layerID).style.visibility == 'visible' ? 'hidden' : 'visible');
	document.getElementById(layerID).style.display = (document.getElementById(layerID).style.display == 'none' ? 'block' : 'none');
  }
  else if (document.layers)
  {
	// it's netscape 4.x
    document.layers[layerID].visibility = (document.layers[layerID].visibility == 'visible' ? 'hide' : 'show');
	document.layers[layerID].display = (document.layers[layerID].display == 'none' ? 'block' : 'none');
  }
  else if (isGecko())
  {
    // it's Netscape 6 (mozilla)
    var myDivs = document.getElementsByTagName("div")
    myDivs[layerID].style.visibility = (myDivs[layerID].style.visibility == 'visible' ? 'hidden' : 'visible');
	myDivs[layerID].style.display = (myDivs[layerID].style.display == 'none' ? 'block' : 'none');
  }
}

function toggleBannerPanel()
{
  showHide('bannerPanel');
  var today = new Date();
  var expiry = new Date(today.getTime() + (365 * 86400000));

  if (mm_bannerPanelState == 0)
  {
	mm_bannerPanelState = 1;
	setCookie('mm_bannerPanelState', 1, expiry, "", "", "");
    mm_changeItemProperty('Main Menu','Collapse/Expand Menu',29,'resources/images/dual_arrow_up.gif',true);
  }
  else
  {
    mm_bannerPanelState = 0;
	setCookie('mm_bannerPanelState', 0, expiry, "", "", "");
	mm_changeItemProperty('Main Menu','Collapse/Expand Menu',29,'resources/images/dual_arrow_down.gif',true)
  }
}

function toggleSearchPanel()
{
  if (mm_searchPanelState == 0)
  {
  }
  else
  {
  }
}

function setCookie(name, value, expires, path, domain, secure)
{
  document.cookie = name 
                  + "=" 
				  + escape(value)
				  + ((expires) ? "; expires=" + expires.toGMTString() : "")
				  + ((path) ? "; path=" + path : "")
				  + ((domain) ? "; domain=" + domain : "")
				  + ((secure) ? "; secure" : "");
}

function getCookie(name)
{
  var cookie = document.cookie;
  var prefix = name + "=";
  var begin = cookie.indexOf("; " + prefix);
  
  if (begin == -1)
  {
	begin = cookie.indexOf(prefix);
	if (begin != 0) return null;
  }
  else
  {
	begin += 2;
  }
  
  var end = cookie.indexOf(";", begin);
  
  if (end == -1)
  {
	end = cookie.length;
  }
  
  return unescape(cookie.substring(begin + prefix.length, end));
}

function deleteCookie(name, path, domain)
{
  if (getCookie(name))
  {
    document.cookie = name
	                + "="
					+ ((path) ? "; path=" + path : "")
					+ ((domain) ? "; domain=" + domain : "")
					+ "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function validateEmail(emailAddressForm)
{
  var email_fmt = /^[a-z0-9&\'\.\-_\+]+@[a-z0-9\-]+\.([a-z0-9\-]+\.)*?[a-z]+$/;
  
  if (emailAddressForm.emailAddress.value.toLowerCase() == 'your@email.com')
  {
	alert("The email address you have supplied is invalid. 'your@email.com' is simply an example - you should provide your real email address and then press 'Join' to begin the subscription process.");
    return false;
  }
  
  if (!email_fmt.test(emailAddressForm.emailAddress.value.toLowerCase()))
  {
	alert("The email address you have supplied is invalid. Please check that you have typed your email address correctly and then press 'Join' to begin the subscription process.");
	return false;
  }
  
  return true;
}

function validateMailingListSubscription(form)
{
  var email_fmt = /^[a-z0-9&\'\.\-_\+]+@[a-z0-9\-]+\.([a-z0-9\-]+\.)*?[a-z]+$/;
  var errorList = "Before you can subscribe to the ballinascreen.com mailing list\nyou must correct the following problems:\n\n";
  var errors = false;
  
  if ((!form.firstName.value) || (form.firstName.value == ''))
  {
    errorList += ">> First Name is missing/blank.\n";
	errors = true;
  }

  if ((!form.lastName.value) || (form.lastName.value == ''))
  {
	errorList += ">> Last Name is missing/blank.\n";
	errors = true;
  }

  if (form.emailAddress.value.toLowerCase() == 'your@email.com')
  {
	errorList += ">> Email address is invalid. 'your@email.com' is a sample email address.\n";
	errors = true;
  }
  
  if (!email_fmt.test(form.emailAddress.value.toLowerCase()))
  {
	errorList += ">> Email address is invalid.\n";
	errors = true;
  }

  if (errors)
  {
	alert(errorList + "\nPlease check your input and try again.");
    return false;
  }
  
  return true;
}

-->
