var App = {
	
	numStoresPerPage: 3,

	hostName: "localhost",
		
	boot: function() {
		this.slider();
		this.storeLocator();
		this.verticalCenter();
		window.addEvent('resize', function(e){
			this.verticalCenter();
		}.bind(this));
	},
	
	storeLocator: function(){
		
		var cityPostcode = $('tx_locator_pi1_city');
		var cityPostcodeInit = $('tx_locator_pi1_city_init');
		if($chk(cityPostcode)){
			cityPostcode.addEvent('click', function(){
				if(cityPostcode.value == cityPostcodeInit.value){
					cityPostcode.value = '';
				}
			});
			cityPostcode.addEvent('blur', function(){
				if(cityPostcode.value == ''){
					cityPostcode.value = cityPostcodeInit.value;
				}
			});
			
		}
	
	},

	slider: function() {
		if($chk($('show'))){
			window.addEvent('domready', function(){
				var data = null;
				var myShow = new Slideshow(
					'show',
					data,
					{
						controller: true,
						height: 550,
						thumbnails: true,
						width: 480,
						delay: 3000,
						loader: false
					}
				);
			});
		}
	},
	
	verticalCenter: function(){
		var margin = (window.getHeight() - $('container').getHeight()) / 2;
		if (margin > 0){
			$('container').setStyle('margin-top', (window.getHeight() - $('container').getHeight()) / 2);
		}
	}
}
