<!--

	function Fader(el)
	{
		var self = this;
		this.el = el;
		this.zIndex = 10;

		this.init = function() {
			var el = this.el;
			var images = this.images = el.getElementsByTagName('img');
			var img = images[0];
			var css = img.style;
			css.display  = 'block';
			css.zIndex   = 0;
			this.current = 0;
			return true;
		};

		this.start = function(time)
		{
			this.time = time;
			this.mainTimer = setTimeout(function(){self.fade()}, time);
		};

		this.fade = function()
		{
			this.current++;
			this.zIndex++;
			if(this.current == this.images.length) {
				this.current = 0;
				this.next = this.images[0];
			}
			var img = this.img = this.images[this.current];
			var css = img.style;
			setOpacity(img, 0);
			css.display  = 'block';
			css.zIndex   = this.zIndex;
			this.next    = this.images[this.current];
			this.opac    = 0;
			this.timer   = setInterval(function(){self.changeOpac()}, 100);
		};

		this.changeOpac = function()
		{
			if(this.opac < 100) {
				this.opac+=5;
				var img = this.next;
				var css = img.style;
				setOpacity(img, this.opac);
			} else {
				this.stop();
			}
		};

		// private function
		function setOpacity(el, opacity)
		{
			var css = el.style;
			css.opacity      = (opacity / 100); // FF
			css.MozOpacity   = (opacity / 100); // Mozilla
			css.KhtmlOpacity = (opacity / 100); // Konquorer
			css.filter       = "alpha(opacity=" + opacity + ")"; // IE
		};

		this.stop = function()
		{
			var el = this.el;
			clearInterval(this.timer);
			this.timer = null;
			this.start(this.time);
		}

		this.init();

	};

	var enquiry = {
		send: function()
		{
			if ($('#contactName').val() == 'Your name')
			{
				$('#contactName').val('');
			}
			if ($('#contactEmail').val() == 'you@youraddress.com')
			{
				$('#contactEmail').val('');
			}
			if ($('#contactPhone').val() == 'Your phone')
			{
				$('#contactPhone').val('');
			}
			if ($('#contactMessage').val() == 'Your message')
			{
				$('#contactMessage').val('');
			}
			setTimeout("vps.enquiry.reset()", 1000);
		},

		reset: function()
		{
			$('#contactName').val('Your name');
			$('#contactEmail').val('you@youraddress.com');
			$('#contactPhone').val('Your phone');
			$('#contactMessage').val('Your message');
		}
	};

	$(function()
	{
		$("#enquiry").validate();
		fader = new Fader(document.getElementById('slideshow'));
		fader.start(1000);
	});


-->

