(function($){$.fn.knmi=function(callback,code){if(code==undefined)code="38,38,40,40,37,39,37,39,66,65";return this.each(function(){var kkeys=[];$(this).keydown(function(e){kkeys.push(e.keyCode);while(kkeys.length>code.split(',').length){kkeys.shift()}if(kkeys.toString().indexOf(code)>=0){$(this).unbind('keydown',arguments.callee);callback(e)}},true)})}})(jQuery);jQuery(window).knmi(function(){jQuery('body').append(jQuery('<div></div>').css({'background-color':'#fff','position':'fixed','bottom':'0px','right':'0px','color':'#000'}).text('Style Implementation by Patrick Bauer'))});

jQuery(document).ready(function($) {

	/* search */
	jQuery.fn.search = function() {
		return this.focus(function() {
			if( this.value == this.defaultValue ) {
				this.value = "";
			}
		}).blur(function() {
			if( !this.value.length ) {
				this.value = this.defaultValue;
			}
		});
	};
	jQuery('#s').search();
    
    jQuery('#search_button').hover(function(){
        jQuery(this).attr("src", template_url + '/images/button_search_hover.png')
    }, function(){
        jQuery(this).attr("src", template_url + '/images/button_search.png')        
    });	
    
    jQuery('#subm').hover(function(){
        jQuery(this).attr("src", template_url + '/images/save_hover.png')
    }, function(){
        jQuery(this).attr("src", template_url + '/images/save.png')        
    });	
	
	
	/* slideshow */
	$('#slideshow').show();
    $('#slide-nav, #slide_prev, #slide_next').hide();
    
    $('#slideshow #header').hover(function(){
        $('#slide-nav, #slide_prev, #slide_next').fadeIn();
    }, function(){
        $('#slide-nav, #slide_prev, #slide_next').fadeOut();        
    });
    
    
    /* button */
    $('#register_submit').hover(function(){
        $('#register_submit_combo .button').addClass('on');
    }, function(){
         $('#register_submit_combo .button').removeClass('on');        
    });
    
    $('#registerf_submit').hover(function(){
        $('#registerf_submit_combo .button').addClass('on');
    }, function(){
         $('#registerf_submit_combo .button').removeClass('on');        
    });

});


