jQuery.noConflict();
jQuery.extend(jQuery.easing, {
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	}
});
var Site = {

	// this vars should be set in <head> server-side
	config: {
		base_url: '',
		site_url: ''
	},
	
	// this method is called on every page
	init: function() {
		
			// On Dom Ready
			jQuery(function($) {
				
				$('.hint').input_hint();
				
				$('#brandup_brand_link a').bind('click', function(e) {
					e.preventDefault();
					$('#brandup_brand_link').addClass('active');
					$('#brandup_up_link').removeClass('active');
					$('#brandup_brand_container').show();
					$('#brandup_up_container').hide();
					$('#upstack_checks').hide();
					$('#brandstack_checks').show();
				});
				
				$('#brandup_up_link a').bind('click', function(e) {
					e.preventDefault();
					$('#brandup_brand_link').removeClass('active');
					$('#brandup_up_link').addClass('active');
					$('#brandup_brand_container').hide();
					$('#brandup_up_container').show();
					$('#upstack_checks').show();
					$('#brandstack_checks').hide();
				});
				
				$('.expander').bind('click', function(e) {
					
					e.preventDefault();

					$this = $(this);

					if ($('.' + $this.attr('id')).css('display') !== 'none')
					{
						$('#' + $this.attr('id') + ' .hide').show();
						$('.' + $this.attr('id')).hide('slow', 'easeOutQuart');
						$this.removeClass('active');
						return false;
					}

					this_id = $this.attr('id');
					$('.expander').each(function() {
						$this_inner = $(this);
						if ($this_inner.attr('id') !== this_id)
						{
							$('#' + $this_inner.attr('id') + ' .hide').show();
							$('.' + $this_inner.attr('id')).hide('slow', 'easeOutQuart');
							$this_inner.removeClass('active');
						}
					});
					
					$('#' + $this.attr('id') + ' .hide').hide();
					$('.' + $this.attr('id')).slideDown('fast');
					$this.addClass('active');
					
				});
				

			});
		
		// On Window Load
		jQuery(window).load(function ($) {

		});
		
		// Load Immediately
		(function($) {
		
		})(jQuery);

		/*if ($.browser.msie && $.browser.version <= 6 )
		{
		}*/
	}
};

Site.init();

(function($) {

	$.fn.input_hint = function(params) {

		// merge default and user parameters
		params = $.extend({attribute: 'title', color: '#999'}, params);

		// traverse all nodes
	    return this.each(function() {

	        var $this = $(this);
			
            if ($this.attr('value') == '')
                $this.attr('value', $this.attr(params.attribute)).css('color', params.color);

	        $this.focus(function() {
	            if ($this.attr('value') == $this.attr(params.attribute))
	                $this.attr('value', '').css('color', '');
	        }).blur(function() {
	            if ($this.attr('value') == '')
	                $this.attr('value', $this.attr(params.attribute)).css('color', params.color);
	        }).parents('form').submit(function() {
	            if ($this.attr('value') == $this.attr(params.attribute))
	                $this.attr('value', '').css('color', '');
	        });

	    });

		// allow jQuery chaining
		return this;
	};

})(jQuery);