function hover_focus() {
	this.className = 'hover';
}
function hover_blur() {
	this.className = '';
}

Behaviour.register({
	'#SearchForm_SearchForm_Search': {
		onfocus: function(){
			if(this.value == "Search website..."){
				this.value = "";
			}
		},
		onblur: function(){
			if(!this.value){
				this.value = "Search website...";
			}
		}
	},
	
	'#SearchForm_StockistsSearchForm_Search': {
		onfocus: function() {
			if(this.value == 'Enter location...') {
				this.value = '';
			}
		},
		onblur: function() {
			if(!this.value) {
				this.value = 'Enter location...';
			}
		}
	},
	
	'#ShowTechInfo': {
		onclick: function() {
			Element.toggle('techInfo');
			if(this.innerHTML == '<img src="lp/images/showLess.gif" alt="Show Less">') {
				this.innerHTML = '<img src="lp/images/showMore.gif" alt="Show More">';			
			} else {
				this.innerHTML = '<img src="lp/images/showLess.gif" alt="Show Less">';
			}
		}
	},
	
	'#techInfo': {
		initialize: function() {
			Element.toggle(this);
		}
	},
	
	'img.beforeafter' : {
		initialize: function() {
			this.beforeImage = this.src;
			this.afterImage = this.src.replace('-before','-after');
		},
		onmouseover: function () {
			this.src = this.afterImage;
		},
		onmouseout: function () {
			this.src = this.beforeImage;
		}
	},

	'#relatedDetails ul.products a' : {
		onmouseover: hover_focus,
		onmouseout: hover_blur
	},
	'#relatedDetails ul.products a' : {
		onmouseover: hover_focus,
		onmouseout: hover_blur
	}
	
	/* 'ul.products .before': {
		onmouseover: function () {
			Element.toggle('Before');
			Element.toggle('After');
		},
		onmouseout: function () {
			Element.toggle('After');
			Element.toggle('Before')
		}
	}, */
	/*
	'ul.products .after': {
		initialize: function() {
			Element.toggle(this);
		}
	},
	
	'ul.casestudies .after': {
		initialize: function() {
			Element.toggle(this);
		}
	}
	*/
});