/**
 * 
 * Enter description here ...
 * 
 * Last changed: $LastChangedDate: 2011-06-13 21:38:03 +0800 (Mon, 13 Jun 2011) $
 * @author $Author: charles $
 * @version $Revision: 85 $
 *
 */

;(function($) {
	
	$.HomeClass = function() {
		this.construct();
	};
	
	$.extend($.HomeClass.prototype, {
		construct: function() {
			this.addEvents();
		},
		
		addEvents: function() {
			$('input[name="query"]').focus(function() {
				if (this.value == 'Search...') {
					this.value = '';
				}
			});
			$('input[name="query"]').blur(function() {
				if (this.value == '') {
					this.value = 'Search...';
				}
			});
			$('form[name="searchform"]').submit(function() {
				if ( $.trim($('input[name="query"]').val()) == 'Search...' ) {
					return false;
				}
				if ( $.trim($('input[name="query"]').val()) == '' ) {
					return false;
				}
				return true;
			});
			
			var max = 0;
			
			$('.bluebox').each(function() {	
				
				if ($(this).height() > max) {
					max = $(this).height() + 20;
				}
			});
			
			$('.bluebox').css({height: max});
		}
	});
	
	$(document).ready(function() {
		if (typeof $.Home == 'undefined') {
			$.Home = new $.HomeClass();
		}
	});
	
})(jQuery);

