set template in jQuery by named fun