$(document).ready(function(){ 
	//search field 
	$('.text').each(function() {
		var text = this.value;
		$(this).css('color', '#666');
		$(this).focus(function() {
			if(this.value == text) {
				this.value = '';
				$(this).css('color', '#333');
			}
		});
		$(this).blur(function() {
			if(this.value == '') {
				$(this).css('color', '#666');
				this.value = text;
			}
		});
	});
	
	//top navigation
	$("ul.sf-menu").supersubs({ 
		minWidth:    0,   
		maxWidth:    27,  
		extraWidth:  1 
	}).superfish(); 
	
	//homepage slideshow
	/*
	$('#slideshow').cycle({
		fx:     'fade',
		speed:  'slow',
		timeout: 4000,
		delay: 0,
		after: function(currSlideElement, nextSlideElement, options, forwardFlag) {
			//alert($('#slideshow img').index(currSlideElement));
		}
	});
	*/
	
	// message expand and contract on banner
	$('#slideshow a.more').click(function() {
		//$('#slideshow').cycle('pause');
		var box = $(this).parent('div.slidetext_message');
		$(box).children('a').hide();
		$(box).children('div').fadeOut('fast', function() {
			$(box).animate({ width:'750px', paddingRight:'30px' },500, function() {
				$(box).children('div.slideshow_fulltext, a.close').fadeIn('fast');
			});
		});
	});
	$('#slideshow a.close').click(function() {
		//$('#slideshow').cycle('resume');
		var box = $(this).parent('div.slidetext_message');
		$(box).children('a').hide();
		$(box).children('div').fadeOut('fast', function() {
			$(box).animate({ width:'302px', paddingRight:'0px' },500, function() {
				$(box).children('div.slideshow_text, a.more').fadeIn('fast');
			});
		});
	});	
	
}); 
