	
$(function(){
	
	if ($.browser.msie && $.browser.version < 7)
		$('img[src$=.png]').pngfix();

	$('img[hover],input[hover]').imghover();
	

	
	$('input.reset-default').focus(function() {
        if(this.value == this.defaultValue) {
	        $(this).removeClass('reset-default');
	        this.value = '';
        }
    }).blur(function() {
        if($(this).attr('value').replace(/ +/, '') == '') {
	        $(this).addClass('reset-default');
            this.value = this.defaultValue;
        }
    }).parents('form').submit(function() {
        $('input.reset-default', this).attr('value', '');
    });
	
	// Scrollable: http://flowplayer.org/tools/scrollable.html#multiple
	
	// :first selector is optional if you have only one tabs on the page
	$("ul.css-tabs:first").tabs("div.css-panes:first > div");
	
	// initialize scrollable  
	$("div.smallthumbs").scrollable({ vertical:true, size: 6, next: '.nextPage', prev: '.prevPage' }).mousewheel(); 
	$("div.largethumbs").scrollable({ vertical:true, size: 3, next: '.nextPage', prev: '.prevPage' }).mousewheel(); 
	
});

;(function($){
	$.fn.pngfix = function () {	
		if ($.browser.msie && $.browser.version < 7) {
			return this.each (function () {
				$(this).css({
					filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.src+"')"
				});
				this.src = 'images/blank.gif';
			});
		} else {
			return this;
		}
	};

	$.prefetch = function() {
		for(var i = 0; i<arguments.length; i++)  {
			$("<img>").attr("src", arguments[i]);
		}
	}

	$.fn.imghover = function () {
		return this.each (function () {
			$(this).data('__img__original', this.src);
			$.prefetch($(this).attr('hover'));
		}).hover(function(){
			this.src = $(this).attr('hover');
		},function(){
			this.src = $(this).data('__img__original');
		});
	};
})(jQuery);
