// remap jQuery to $
(function($){
	
	// Copyright script - found in the plugins.js file
	// To use, replace the '#copyright' id with the
	// id of the element that holds your copyright date
	$('#copyright').copyright();
	
	// Email defuscator - found in the plugins.js file
	$('.email').defuscate();
	
	// Infield labels
	//$('#footer fieldset label').inFieldLabels();
	
	// User defined functions go here
	
	// make background image fullscreen
	$.backstretch('/images/bg/landscape.jpg')
	
	// set up tabs on product detail page
	$('ul.tabs').tabs('div.panes > div');
	
	// set up tooltips on brand pages
	$('.brandComp a').tooltip({position: 'bottom center',effect:'slide'});
	
	// set up overlays on product detail page, engineering services page
	$('.stepCallout, .enlarge, img[rel]').overlay({
		mask: {
			color: '#666666'	
		}
	});
	
	// set up product demo video overlay
	$('.videoLink').overlay({
		mask: {
			color: '#666666'	
		},
		onBeforeLoad: function() {
			var wrapper = this.getOverlay().find('.wrapper');
			//var src = $('#mainContent_lvProduct_hidYouTubeID_0').val();
			var src = this.getTrigger().next().val();
			wrapper.html('<iframe width="640" height="480" src="http://www.youtube.com/embed/'+src+'" frameborder="0" allowfullscreen></iframe>');	
		},
		onClose: function() {
			var wrapper = this.getOverlay().find('.wrapper');
			wrapper.html('');	
		}
	});
	
})(this.jQuery);
