application.core.extend({
  public: {  
    Website: function(config) {
	  this.storeConfig(config);		
		
	  return this.init();
    }
  }
});

application.core.extend(
  application.public.Website.prototype, 
  application.base.Base.prototype, 
  {  
  	init: function() {
	  this.ready(function() {
		this.execUtils();
		this.writeBanner();
		this.writeMap();		
	  });
	  
	  return this;	
	},

	execUtils: function() {
	  application.ui.util.hide('.hide');
	  application.ui.util.toggle('.toggle');
	  application.ui.util.confirmDelete('.confirm-delete');
	  application.ui.util.fieldFocus();
	  application.ui.autocompleteOff();	 
	  application.ui.tooltip.associate('.tooltip');
      application.ui.clearText('input.cleartext, textarea.cleartext');			
	},

	writeBanner: function() {
	  swfobject.embedSWF(
		this.getGlobal('websiteResourcesPath') + 'flash/banner.swf', 
		'app-banner', 
		'918',
		'354',
		'9.0.0', 
		this.getGlobal('generalResourcesPath') + 'javascript/swfobject/expressInstall.swf', 
		{}, 
		{ menu: false, wmode: 'transparent' }
	  );		
	},
	
	writeMap: function() {
	  var rootUrl = application.core.isLive() ? 'http://' + document.domain + '/' : this.getGlobal('rootUrl');
	  
	  this.getId('app-map').show();	
	
	  swfobject.embedSWF(
		this.getGlobal('websiteResourcesPath') + 'flash/map.swf?' + this.uuid(), 
		'app-map', 
		'880',
		'500',
		'9.0.0', 
		this.getGlobal('generalResourcesPath') + 'javascript/swfobject/expressInstall.swf', 
		{ 
			remoteDataProviderMethod: encodeURIComponent(rootUrl + 'api/api.cfc?method=do&event=getMapData'),
			remoteDataSenderMethod: encodeURIComponent(rootUrl + 'api/api.cfc?method=do&event=processMapContactForm')
		}, 
		{ menu: false }
	  );
	}
  }  
);   