
	var imgid = 'image';
    // image dir set dynamically by asp.net
	var imgdir = '';
	var imgext = '.jpg';
	var thumbid = 'thumbs';
	var auto = true;
	var autodelay = 3;

$(document).ready(function () {
		
	$('.colapsable').each(function(i, o){
		//alert('index: ' + i + ' object id: ' + o.id);
		
		var $div = $('#search' + o.id);
		var $link = $('#' + o.id);
	    var width = $div.width();
	    $div.hide().css({width : 705, opacity: 1 });
	
	    var header = $('#headerBanner');
	    
	    $('#' + o.id).click(function () {
	        if ($div.is(':visible')) {
	            //$div.animate({width: 705, opacity: 0 }, { duration: 400, complete: function () {
	                $div.hide();
					$div.removeClass('expanded');
					$link.removeClass('active');
					header.show();
	            //} });
	        } else {
				//$('.expanded').animate({width: 705, opacity: 0 }, { duration: 400, complete: function () {
	                $('.expanded').hide();
					$('.expanded').removeClass('expanded');
					$('.active').removeClass('active');		
	            //} });
				//$div.show().animate({width :705, opacity: 1 }, { duration: 400, complete: function(){
				    $div.show();
					$div.addClass('expanded');
					$link.addClass('active');
				//} });
                header.hide();				
	        }
	        
	        return false;
	    });
	});

    $("#newsletter span").click(function () {
      $("#newsletter span").css('visibility','hidden');
    });



	$('.showPrices').each(function(i, o){
		//alert('index: ' + i + ' object id: ' + o.id);
		
		var $priceBox = $('#priceBox' + o.id);
		var $priceLink = $('#' + o.id);
	    var height = $priceBox.height();
	    $priceBox.hide().css({height: 0, opacity: 0.4 });
	
	    $('#' + o.id).click(function () {
	        if ($priceBox.is(':visible')) {
	            $priceBox.animate({height: 0, opacity: 0.4 }, { duration: 500, complete: function () {
	                $priceBox.hide();
					$priceBox.removeClass('expanded');
					$priceLink.removeClass('active');
	            } });
	        } else {
				$('.expanded').animate({height: 0, opacity: 0.4 }, { duration: 200, complete: function () {
	                $('.expanded').hide();
					$('.expanded').removeClass('expanded');
					$('.active').removeClass('active');		
	            } });
				$priceBox.show().animate({height :250, opacity: 1 }, { duration: 500, complete: function(){
					$priceBox.addClass('expanded');
					$priceLink.addClass('active');
				} });
				
	        }
	        
	        return false;
	    });
	});

	
    lastBlock = $("#a1");
    maxWidth = 420;
    minWidth = 25;	

    $("div.month").click(
      function(){
        $(lastBlock).animate({width: minWidth+"px"}, { queue:false, duration:400 });
	$(this).animate({width: maxWidth+"px"}, { queue:false, duration:400});
	lastBlock = this;
      }
    );

});
