    
    $(function() {
		
		// CHANGE THESE VALUES TO MATCH YOUR IMAGE SIZES
        var imgWidth = 350;
		var imgHeight = 250;
		
		// DON'T CHANGE ANYTHING BEYOND HERE
	    var width = imgWidth * 1.5;
        var height = imgHeight * 2;
        var sliding = false;
        
        // setup each image slider
        $('.awImageSlider').each(function() {
             var parent = this;
             $(this).css({
                height: height +'px',
                width: width +'px',
                position: 'relative'
             });
             
             $('.preview',this).css({
                height:    '80%',
                width:     '96%',
                border:    '1px solid #cfcfcf',
                padding:    '10px'
             });
             
             $('.preview img',this).css({
                'margin-left': width/2 - imgWidth/2 +'px'
                 
             });
             
             $('.caption',this).css({
                height: '20%',
                width:  '96%',
                padding: '5px',
                'margin-top': '3px'
             });
             
             $('.gallery',this).css({
                height: '70px',
                width: '96%',
                'margin-top':'5px'
             });
             
             $('.gallery li',this).css({
                 'float':'left',
                 'margin-right':'3px',
                 'opacity':'0.8',
                 'cursor':'pointer'
             });
			 
			 
			 $('.gallery li div.content ul',this).css({
                 'list-style-type':'none'
             });
			 
			 /*$('.gallery li div.content ul li',this).css({
			     'float':'none',
				 'background':'url(tick.png) no-repeat 0 -3px',
				 'padding':'0px 0px 0px 20px',
				 'margin':'0 0 5px',
				 'height':'25px',
				 'cursor':'auto'
			 });*/
             
            
            $('.gallery-viewport',this).css({height:'80px',position:'relative','overflow':'hidden','left':'29px','width':width-30+'px'})
            $('span.left',this).css({'position': 'absolute','top':height-55+'px','cursor':'pointer'});
            $('span.right',this).css({'position':'absolute','top':height-55+'px','left':width+3+'px','cursor':'pointer'});
            $('.gallery',this).css({width:($('.gallery li',this).not('div.content ul li').length * 84)+'px','left':'0px','position':'relative'});
             
             $('.gallery li',this).each(function() {
                $('span',this).hide();
                $('div.content',this).hide();
                $('img.item',this).attr('width',80).attr('height',80);
             });
             
             
             $('.preview img',this).attr('src',$('.gallery li:nth(0) img',this).attr('src'));
             $('.caption span',this).html($('.gallery li:nth(0) span',this).html()).css({'font-weight':'bold','color':'#77B3EF'});
             $('.caption div.content',this).html($('.gallery li:nth(0) div.content ',this).html()).css({'font-size':'11px'});
             
             
            //hover states
            $('.gallery li',this).hover(
                 function() {
                    $(this).css({'opacity':'1'})    
                 },
                 function() {
                    $(this).css({'opacity':'0.8'})
                 }
            ); 
        
        
             // attach left and right button events
            $('span.left',this).click(function() {
                var left = $('.gallery', parent).css('left');
                left = left.match(/(\-?\d+)px/)[1]
                if (left < 0 && !sliding) {
                    sliding=true;
                    $('.gallery', parent).animate({left: '+=80px'},500,function(){sliding=false;});
                }
            });
            
            $('span.right',this).click(function() {
                var left = $('.gallery', parent).css('left');
                var length = $('.gallery li',parent).not('div.content ul li').length *84;
                var maxLeft = (width-30)-length;
				
				
                left = left.match(/(\-?\d+)px/)[1]
                if (left > maxLeft && !sliding) {
                    sliding=true;
                    $('.gallery', parent).animate({left: '-=80px'},500,function(){sliding=false;});
                }
            });
            
            //attach click events on images
            $('.gallery li',this).click(function() {
                //console.log(this);
                $('.preview img',parent).attr('src',$('img',this).attr('src'));
                $('.preview .caption span',parent).html($('span',this).html());
                $('.preview .caption div.content',parent).html($('div.content',this).html());
            });
        });
        
        
        //banner blob
        $('#banner-blob span').hide();
        $('#banner-blob span:nth(0)').addClass('current').fadeIn();
        
        setInterval(function() {
          $('#banner-blob span.current').fadeOut('500',function() {
              $(this).removeClass('current');
              if($(this).next('span').length) {
                $(this).next('span').addClass('current').fadeIn(500);
              } else {
                $('#banner-blob span:nth(0)').addClass('current').fadeIn(500);
              }
          });
        },5000)
    });
	
	
