(function($) {
	
	$.fn.defaultvalue = function() {
		
		// Scope
		var elements = this;
		var args = arguments;
		var c = 0;
		
		return(
			elements.each(function() {
                            
				var el = $(this);
				var def = args[c++];

				el.val(def).focus(function() {
					if(el.val() == def) {
						el.val("");
					}
					el.blur(function() {
						if(el.val() == "") {
							el.val(def);
						}
					});
				});
				
			})
		);
	}
})(jQuery)


jQuery(document).ready(function(){
    jQuery("#ctrl_2").defaultvalue("Suche auf NEXT ENERGY");
    jQuery("#ctrl_4").defaultvalue("Search through NEXT ENERGY");
    
    if(jQuery("#wrapper").height() < 1050) {
            jQuery('a#totop').hide();
    }
    
    jQuery('a#totop').click(function(){
            jQuery('html, body').animate({scrollTop: '0px'}, 300);
            return false;
       });
    
    jQuery('div.hoverme').hover(
                            function(){
                             jQuery(this).stop(true).animate({
                                'margin-top' : '-270px',
                                'height' : '250px'
                             }, 500);
                            },
                            function() {
                             jQuery(this).stop(true).animate({
                                'margin-top' : '-90px',
                                'height' : '70px'
                             },500);
                            }
    );
})
