window.addEvent('domready', function() {	
	if($('searchInput')) {
		$('searchInput').addEvent('focus', function() {
			if(this.value == 'Search Products') {
				this.value = '';	
			}
		});
		$('searchInput').addEvent('blur', function() {
			if(this.value == '') {
				this.value = 'Search Products';	
			}
		});
	}
	
	if($('samepay')) {
		$('samepay').addEvent('mouseup', function() {
			//TODO: Add same as shipping information functionality
		});
	}
	
	if($('billingSubmit')) {
		$('billingSubmit').addEvent('submit', function() {
			$('bscon').setHTML("<strong>Processing...</strong>");
		});
	}
	
	if ($('contactForm')) {
		var fx2 = new Fx.Styles($('contactResult'), { duration: 350, wait: false});
		fx2.start({'opacity': 0});
		
		$('contactForm').addEvent('submit', function(e){
			new Event(e).stop();
			
			this.send({
				onComplete: function(){
					$('contactResult').setHTML(this.response.text);
					fx2.start({
						'opacity': 1
					});
				}
			});
		});
	}
});
