
/*
 * Contact Form
 */
$( function() {
    $('.form .text').each(function() {
        if($(this).attr('value') == '') {
            $(this).attr('value', $(this).attr('defaultText'))
        }
    }).focus( txtinputFocus ).blur( txtinputBlur );
    $('.form select').jgdDropdown();

} );
function txtinputFocus() {
    if($(this).hasClass('mess')) {
        if($(this).attr('defaultText') == $(this).text())
            $(this).text('');
    } else {
        if($(this).attr('defaultText') == $(this).attr('value'))
            $(this).attr('value','');

    }
}

function txtinputBlur() {
    if($(this).hasClass('mess')) {
        if($(this).attr('value') == '')
            $(this).text($(this).attr('defaultText'));
    } else {
        if($(this).attr('value') == '')
            $(this).attr('value', $(this).attr('defaultText') );

    }
}

$('#form').submit(function() {
    $('input.text').each(function() {
        if($(this).attr('value') == $(this).attr('defaultText')) {
            $(this).attr('value', '');
        }
    });
});
