/*
    By Jason Palmer
    http://www.jason-palmer.com/2008/08/jquery-plugin-form-field-default-value/
*/
jQuery.fn.DefaultValue = function(text){

    return this.each(function(){
        //Make sure we're dealing with text-based form fields
        if(this.type != 'text' && this.type != 'password' && this.type != 'textarea') {
            return;
        }
        
        //Store field reference
        var fld_current=this;
        
        //Set value initially if none are specified
        if(this.value === '') {
            this.value=text;
        } else {
            //Other value exists - ignore
            return;
        }
        
        //Remove values on focus
        $(this).focus(function() {
            if(this.value === text || this.value === '' ) {
                this.value='';
            }
        });
        
        //Place values back on blur
        $(this).blur(function() {
            if(this.value === text || this.value === '') {
                this.value=text;
            }
        });
        
        //Capture parent form submission
        //Remove field values that are still default
        $(this).parents("form").each(function() {
            //Bind parent form submit
            $(this).submit(function() {
                if(fld_current.value==text) {
                    fld_current.value='';
                }
            });
        });
    });
};


jQuery(function(){
    // Add drop shadow
    $(".shadow").dropShadow({
        left: 5, 
        top: 5, 
        blur: 3,
        opacity: 0.5
        
    });
    
    // The menu is draw off screen so we must redraw the shadow on mouse over
    $("#mainmenu ul.menu>li").hover(
        function( el ) {
            $(".shadow").redrawShadow();
        },
        function( el ) {
            $(".shadow").removeShadow();
        }
        
    );
    
    
    
    
    
    $(".more-content").hide();
    $(".more-content").each(function(){
        $(this).find("p:last").append('<a href="#" class="moin">-</a>')
    });
    $(".more").append('<a href="#" class="plus">+</a>');
    
    $(".plus").live( 'click', function(){
        el = $(this).parent();
        $(this).fadeTo(200,0);
        $(el).next(".more-content").slideDown();
        return false;
    });
    
    $(".moin").live( 'click', function(){
        el = $(this).parents(".more-content");
        $(el).slideUp();
        $(el).prev(".more").find(".plus").fadeTo(200,1);
        return false;
    });
    
    
    $("#print-button").click(function(){
        window.print();
    });
	
});
