/* * * * * * * * * * * * * * * * * * * * * *
 * Platzhalter-Feature 
 *      basierend auf dem HTMl5-placeholder-attribute
 * 
 * Leert alle Browser, die kein placeholder kennen, sich ähnlich zu verhalten.
 *
 * @author: Dustin Breuer <breuer@lemm.de>
 *
 * @var where = jQuery Element
 * @var placeholder = Wert der als Platzhalter gesetzt werden soll
 * @var phColor = Farbe der Platzhaltercschrift
 * @var fontColor = Eigentliche Schriftfarbe
 *
 *
 * * * * * * * * * * * * * * * * * * * * */
 
function placeholder(where, placeholder, phColor, fontColor){
    if($(where).is("[type=submit], [type=checkbox], [type=radio], [type=button]")){
        return;
    }
    if($(where).val() == ""){
        $(where).val(placeholder).css({fontStyle: "italic", color: phColor});
    }
    $(where).focus(function(){
        if($(where).val() == placeholder){
            $(where).val("").css({fontStyle: "normal", color: fontColor});
        }
    }).blur(function(){
        if($(where).val() == ""){
            $(where).val(placeholder).css({fontStyle: "italic", color: phColor});
        }
    });
    
    $(where).parent("form").submit(function(){
        if($(where).val() == placeholder){
            $(where).val("");
        }
    })
}
