$(document).ready(function () {
    // Set required field text
    $('.defaultEmail').DefaultValue('Enter your email address');
    // makes element clickable
    $('.clickable').each(function () {
        var elem = $(this);
        var link = $("a[href]:not([href='#']):not([href^='javascript:'])", elem).eq(0);
        if (!link) return true;
        var href = link.attr('href');
        if (!href) return true;
        elem.css('cursor', 'pointer').click(function () {
            window.location = $('a', this).attr('href');
        });
    });
    
});

// Default text functions
    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 and class initially if none are specified
            if (this.value == '' || this.value == text) {
                this.value = text;
                $(this).addClass('emptyrequired');
            } else {
                // Other value exists - ignore
                return;
            }

            // Remove values on focus and set class
            $(this).focus(function() {
                if (this.value == text || this.value == '')
                    this.value = '';
                $(this).removeClass('emptyrequired');
            });

            // Place values back on blur and set css class
            $(this).blur(function() {
                if (this.value == text || this.value == '') {
                    this.value = text;
                    $(this).addClass('emptyrequired');
                } else {
                    $(this).removeClass('emptyrequired');
                }
            });

            // 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 = '';
                    }
                });
            });
        });
    };

