(function($) {
	
	var heatMyFloors = {
		
			init: function() {
				this.utilMethods();
				this.externalPlugins.init();
			},
			
			utilMethods: function() {
				$("body").addClass("jsEnabled"); // We use this to style non-js
				$('a[href^="http://"]').attr({target: "_blank"});
			},
			
			externalPlugins: {
				
				init: function() {
					this.prettyPhoto.init(); // Lightbox Plugin
				},
				
				prettyPhoto: {
					
					options: {
						animationSpeed: 'normal',
						allowresize: false,
						showTitle: false,
						theme: 'light_rounded'
					},
					
					init: function(){
						$("a[rel^='lightbox']").prettyPhoto(this.options);
					}
					
				} 
				
			}
	}
	
	heatMyFloors.init();
	
})(jQuery); 

// For landing page on www.heatmyfloors.com analytics tracking. This along with some code in mater-template.xhtml allows cross-domain tracking.
jQuery(function(){
	if( document.location.href.indexOf("www.heatmyfloors.com") != -1 ) {
		jQuery('a').click(function(elem){
			var href = this.href.replace(/www.heatmyfloors.com/i, "www.electricunderfloorheatingsystems.com");
			
			if( typeof(_gaq) != "undefined" && _gaq != null ) {
				_gaq.push(['_link', href]);
				return false;
			}
		});
	}
});

