﻿
// --------------------- BASIC SITE FUNCTIONS --------------------------
// PRINT PAGE
function printpage() {
window.print();  
}

// CLEAR ELEMENT TEXT
function ClearElementText(text, elementId) {
if (document.getElementById(elementId).value == text)
  document.getElementById(elementId).value = "";
}

// RE-ENTER ELEMENT TEXT ON BLUR
function SetElementText(text, elementId) {
if (document.getElementById(elementId).value == "")
  document.getElementById(elementId).value = text;
}

$(function() {
	if(document.getElementById('homeSlideshow')) {
		var hs = new homeSlideshow();
	}
});

function homeSlideshow() {
	var current = 0;
	var lis = $('#homeSlideshow li');
	var max = lis.length;
	
	function moveNext() {
		var temp = current;
		current++;
		if(current >= max) {
			current = 0;
		}
		lis.eq(current).css({ zIndex: 51 }).fadeIn(600, function() {
			lis.eq(temp).css({ display: 'none' });
			$(this).css({ zIndex: 50 });
		});
	}
	
	setInterval(function() { moveNext(); }, 8000);
}
