window.addEvent('domready', function() {

    if($('contact-form')) {

        $('contact-form').getElements('.remo').each(function(item) {
            item.store('dvalue',item.getProperty('value'));
        });

        $('contact-form').getElements('.remo').addEvents({

            'focus' : function () {
                if(this.getProperty('value') == this.retrieve('dvalue'))
                    this.setProperty('value','');
            },

            'blur' : function () {
                if(this.getProperty('value') == '')
                    this.setProperty('value',this.retrieve('dvalue'));
            }
        });


        $('contact-send-bt').addEvent('click',function(e) {

            e = new Event(e).stop();

            if(
            $('contact_full_name').value == '' ||
            $('contact_company_name').value == '' ||
            $('contact_email').value == '' ||
            $('contact_subject').value == '' ||
            $('contact_message').value == '')
            {
                alert(langContact_form_all_fields_warn);
                return;
            }
            else
            {
                $('contact-form').submit();
                return;
            }
        });
    }
});
