﻿(function($) {
	$.fn.extend({
		gat_itemExpander: function(options) {
			var defaults = {
				itemSelector: '.itemSelector',
				collapsed: 1
			};

			var options = $.extend(defaults, options);
			defaults = null;

			return this.each(function() {
				var $this = $(this);
				var $item = $(options.itemSelector);

				// If defined as collapsed, collapse item
				if (options.collapsed > 0) {
					$item.slideUp();
				}

				// Bind click event
				$this.click(function(event) {
					event.preventDefault();

					// If item is hidden, then expand, else collapse
					if ($item.is(':hidden')) {
						// Display expand text and collapse item
						$this.html($this.attr('text-collapse'));
						$item.slideDown();
					}
					else {
						// Display collapse text and display item
						$this.html($this.attr('text-expand'));
						$item.slideUp();
					}
				});
			});
		}
	});
})(jQuery); 
$(document).ready(function() {

	Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequestHandler);
	Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequestHandler);
});

function endRequestHandler(sender, args) {
	$('#specialsMiddle').slideDown('slow');
}

function beginRequestHandler(sender, args) {
	$('#specialsMiddle').slideUp('slow');
}
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();