(function(){
	jQuery.fn.extend({
		placehold: function(){
			var $query = this;
			var placeholdOptions = arguments[0] || {};
			var $inputs = $query.filter(":text, :password");
			$inputs
				.each(function(){
					var $this = jQuery(this);
					this.placeholdValue = placeholdOptions.placeholdValue || $.trim($this.val());
					$this.val(this.placeholdValue);
					$this.addClass(placeholdOptions.blurClass || "");
				})
				.bind("focus",function(){
					var $this = jQuery(this);
					var val = $.trim($this.val());
					if (val == this.placeholdValue || val == "") {
						$this.val("")
							.removeClass(placeholdOptions.blurClass || "")
							.addClass(placeholdOptions.focusClass || "");
					}
				})
				.bind("blur",function(){
					var $this = jQuery(this);
					var val = $.trim($this.val());
					if(val == this.placeholdValue || val == "") {
						$this.val(this.placeholdValue)
							.addClass(placeholdOptions.blurClass || "")
							.removeClass(placeholdOptions.focusClass || "")
					}
				});
			return $query;
		}
	})
})();

$.easing.easeOutQuart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};


$(document).ready(function() {
	$("#menu").dropdown();
	$('#header fieldset.search .query').placehold({blurClass: 'placehold', focusClass: 'focus'});
	$('a[rel*=banner]').bind('click', function() {
		$.ajax({type: "GET", url: "/click/" + $(this).attr('id') + '/', async: false});
	});
});