// JavaScript Document
<!--
// Javascript Clock www.elated.com
function init ( )
{
  timeDisplay = document.createTextNode ( "" );
  document.getElementById("clock").appendChild ( timeDisplay );
}

function updateClock ( )
{
  var currentTime = new Date ( );

  var currentHours = currentTime.getHours ( );
  var currentMinutes = currentTime.getMinutes ( );
  var currentSeconds = currentTime.getSeconds ( );

  // Pad the minutes and seconds with leading zeros, if required
  currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
  currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;

  // Choose either "AM" or "PM" as appropriate
  var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";

  // Convert the hours component to 12-hour format if needed
  currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;

  // Convert an hours component of "0" to "12"
  currentHours = ( currentHours == 0 ) ? 12 : currentHours;

  // Compose the string for display
  var currentTimeString = currentHours + ":" + currentMinutes + ":" + currentSeconds + " " + timeOfDay;

  // Update the time display
  document.getElementById("clock").firstChild.nodeValue = currentTimeString;
}

function ValidateContactForm()
{
    var name = document.ContactForm.Name;
    var email = document.ContactForm.Email;
    var Phone = document.ContactForm.Telephone;
    var nocall = document.ContactForm.DoNotCall;
    var type = document.ContactForm.Type;
    var question = document.ContactForm.Question;
	var comment = document.ContactForm.Comment;


    if (name.value == "")
    {
        window.alert("Please enter your name.");
        name.focus();
        return false;
    }
    
    if (email.value == "")
    {
        window.alert("Please enter a valid e-mail address.");
        email.focus();
        return false;
    }
    if (email.value.indexOf("@", 0) < 0)
    {
        window.alert("Please enter a valid e-mail address.");
        email.focus();
        return false;
    }
    if (email.value.indexOf(".", 0) < 0)
    {
        window.alert("Please enter a valid e-mail address.");
        email.focus();
        return false;
    }

    if ((nocall.checked == false) && (phone.value == ""))
    {
        window.alert("Please enter your telephone number.");
        phone.focus();
        return false;
    }

    if (type.selectedIndex < 1)
    {
        alert("Please select a type of question.");
        type.focus();
        return false;
    }
}

function EnableDisable(chkbx)
{
    if(chkbx.checked == true)
    {
        document.ContactForm.Telephone.disabled = true;
    }
    else
    {
        document.ContactForm.Telephone.disabled = false;
    }
}

// Photo Gallery

var slideshow_onload = null; //should be implemented as a function later in this document if it must be called onload
var slideshow = null; //should be implemented as a function later in this document when this function is needle

function go_link(link_object) {
	location.href = link_object.href;
}
function ev(e) { //process window events
	if (!e) var e = window.event;
	var key = (e.keyCode)? e.keyCode : ((e.which)?e.which:0);
	link_id = false;
	link_obj = null;
	if ((35 == key) && (true == e.ctrlKey)) { //ctrl + end
		link_id = 'page_last';
	}
	else if ((36 == key) && (true == e.ctrlKey)) { //ctrl + home
		link_id = 'page_first';
	}
	else if ((37 == key) && (true == e.ctrlKey)) { //ctrl + arrow left
		link_id = 'page_previous';
	}
	else if ((38 == key) && (true == e.ctrlKey)) { //ctrl + arrow up
		link_id = 'page_up';
	}
	else if ((39 == key) && (true == e.ctrlKey)) { //ctrl + arrow right
		link_id = 'page_next';
	}
	else if ((40 == key) && (true == e.ctrlKey)) { //ctrl + arrow down
		if (slideshow) {
			slideshow();
		}
	}
	if (link_id) link_obj = document.getElementById(link_id);
	if (link_obj) go_link(link_obj);
}
document.onkeydown = ev;

function onload_init() {
	if (slideshow_onload) {
		slideshow_onload();
	}
}
// -->

