var Site = window.Site || {};

(function($) {
	
	$(function() {
		
	    // Setting up a background image array. 
	    // To add new images, just add a new line, 
	    // give the new array item a new number and
	    // put the full path to the image.

	    var bg=new Array();
    	    bg[0]="../../images/sothebys/bg/front-wallpaper-1.jpg";
    	    bg[1]="../../images/sothebys/bg/front-wallpaper-2.jpg";
    	    bg[2]="../../images/sothebys/bg/front-wallpaper-3.jpg";
    	    bg[3]="../../images/sothebys/bg/front-wallpaper-4.jpg";

		// Call the background stretch plugin
		
		$.backstretch( bg, { speed: 250 });

		// search clear text and replace

		$('#smart input[type=text]').each(function(event) {
			var value = $(this).val();
			$(this).focus(function() {
				if($(this).val() == value) {
					$(this).val('');
				};
			}).blur(function() {
				if($(this).val() == '') {
				  $(this).val(value);
				};
			});
		});

	});

})(jQuery);
