<div id="default_contact_form_container" style="width:100%; clear:both;float:left;">
<h2><?= ucfirst($this->localization['formularz_kontaktowy']);?></h2>
<form id="contact_form" method="post" action="">
    <fieldset>
            <p>
                    <label for="cf_person_name"><?php echo ucfirst($this->localization['imie_i_nazwisko']); ?>*</label>
                    <input id="cf_person_name" name="person_name" class="required" style="width:300px;" />
            </p>
            <p>
                    <label for="cf_email">Email *</label>
                    <input id="cf_email" name="email" class="required email" style="width:300px;" />
            </p>
            <p>
                    <label for="cf_subject"><?php echo ucfirst($this->localization['temat']); ?>*</label>
                    <input id="cf_subject" name="subject" class="required" style="width:300px;" />
            </p>
            <p>
                    <label for="cf_message"><?php echo ucfirst($this->localization['wiadomosc']); ?>*</label>
                    <textarea cols="100" rows="10" class="required" name="message" id="cf_message" style="width:300px;"></textarea>
            </p>
            <p>
                * - <?= ($this->localization['pole_wymagane']) ?><br /><br />
            </p>
            <p style="text-align:right;">
                    <input class="submit" type="submit" value="<?= ucfirst($this->localization['wyslij']);?>"/>
            </p>
    </fieldset>
</form>
</div>
<!-- WALIDACJA -->
<script src="/files/js/jquery-validation-1.8.0/jquery.validate.min.js" type="text/javascript"></script>
<script src="/files/js/jquery-validation-1.8.0/localization/messages_<?php echo strtolower($this->localization['meta_data']['shortname']); ?>.js" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
    $("#contact_form").validate();
    
    $("#contact_form").submit(function(){

        var is_valid = $("#contact_form").validate();
        if(is_valid.errorList.length > 0)
            return false;

        $.post("/frontside/send_email", $("#contact_form").serialize(),function(data){
            $("#default_contact_form_container").html("<p style='margin:10px 0x;font-weight:bold;'>"+data+"<p>");
        });

        return false;

    });
});
//]]>
</script>

