<?php
/*
  www.oscGold.com (C) Kamelia-Net Jacek Krysiak
  modul oscGold wer 4.0
*/
?>
<table border="0" width="100%" cellspacing="0" cellpadding="0">

 <!-- Naglowek BOF -->
 <tr>
  <td>
   <?php
   $info_box_contents = array();
   // PWA BOF
   if (!isset($HTTP_GET_VARS['guest']) && !isset($HTTP_POST_VARS['guest'])){
      $info_box_contents[] = array('text' => sprintf(HEADING_TITLE));
   } else {
      $info_box_contents[] = array('text' => sprintf(HEADING_TITLE_GOSC));
   }
   // PWA EOF
   $info_box_contents[] = array('text' => sprintf(HEADING_TITLE));
   new contentBoxHeading($info_box_contents);
   ?>
  </td>
 </tr>
 <tr>
  <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '1'); ?></td>
 </tr>
 <!-- Naglowek EOF -->

 <tr>
  <td class="smallText" style="padding-top:5px">&nbsp;&nbsp;<?php echo sprintf(TEXT_ORIGIN_LOGIN, tep_href_link(FILENAME_LOGIN, tep_get_all_get_params(), 'SSL')); ?></td>
 </tr>

<?php
 if ($messageStack->size('create_account') > 0) {
 ?>
 <tr><td><?php echo $messageStack->output('create_account'); ?></td></tr>
<?php
 }
?>

<tr><td width="100%" align="left" valign="top">
	<!-- PWA BOF -->
	<?php echo tep_draw_form('create_account', tep_href_link(FILENAME_CREATE_ACCOUNT, (isset($HTTP_GET_VARS['guest'])? 'guest=guest':'').(isset($HTTP_GET_VARS['act'])? 'act='.$HTTP_GET_VARS['act']:'') , 'SSL'), 'post') . tep_draw_hidden_field('action', 'process'); ?>
	<!-- PWA EOF -->
	<table border="0" width="100%" cellspacing="0" cellpadding="0">

	 <tr>
	  <td align="right">
		<span class="inputRequirement"><br><?php echo POLA_OBOWIAZKOWE; ?></span>
	  </td>
	 </tr>
	 <tr>
	  <td>
        <fieldset>
		<legend><?php echo CATEGORY_PERSONAL; ?></legend>
		  <table border="0" cellspacing="0" cellpadding="3" width="100%">
            <tr><td align="left">
            <div style="width:100%; clear:both">
                <div style="float:left;width:35%;" class="main">&nbsp;</div>
                <div style="float:left;width:55%;padding:3px;" class="main">
                    <?php
                    $rodzaj_osoby = tep_db_prepare_input($HTTP_POST_VARS['osoba']);
                    if ($rodzaj_osoby != '') {
                        if ($rodzaj_osoby == 'fizyczna') { $os1 = 'checked';$os2 = ''; } else { $os1 = '';$os2 = 'checked'; }
                        } else {
                        $os1 = 'checked';$os2 = '';
                    }
                    ?>
                    <input type="radio" name="osoba" value="fizyczna" onclick="rodzaj(2)" <?php echo $os1; ?>><?php echo FORM_OSOBA_FIZYCZNA; ?>&nbsp;&nbsp;
                    <input type="radio" name="osoba" value="firma" onclick="rodzaj(1)" <?php echo $os2; ?>><?php echo FORM_OSOBA_PRAWNA; ?>
                </div>
            </div>
            <div style="width:100%; clear:both;display:none" id="nazwa_firmy">
                <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_COMPANY; ?></div>
                <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('company', '', 'size="50"') . '&nbsp;' . '<span class="inputRequirement">*</span>'; ?></div>
            </div>
            <div style="width:100%; clear:both;display:none" id="nips">
                <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_NIP; ?></div>
                <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('nip', '', 'size="50"') . '&nbsp;' . '<span class="inputRequirement">*</span>'; ?></div>
            </div>
            <div style="width:100%; clear:both">
                <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_FIRST_NAME; ?></div>
                <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('firstname', '', 'size="50"') . '&nbsp;' . (tep_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?></div>
            </div>
            <div style="width:100%; clear:both">
                <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_LAST_NAME; ?></div>
                <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('lastname', '', 'size="50"') . '&nbsp;' . (tep_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?></div>
            </div>
            <?php if (!isset($_GET['guest']) && NICK_VALUE == 'true') { ?>
                <div style="width:100%; clear:both">
                    <div style="float:left;width:35%;padding:3px;" class="main"><?php echo NN_NICK; ?></div>
                    <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('nick', '', 'size="15"') . '&nbsp;' . (tep_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?></div>
                </div>
            <?php }
            if (ACCOUNT_DOB == 'true') { ?>
                <div style="width:100%; clear:both" id="data_urodzenia">
                    <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_DATE_OF_BIRTH; ?></div>
                    <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('dob', '', 'size="20"') . '&nbsp;' . (tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="inputRequirement">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>': ''); ?></div>
                </div>
            <?php }
            if (ACCOUNT_GENDER == 'true') { ?>
                <div style="width:100%; clear:both" id="plec">
                    <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_GENDER; ?></div>
                    <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_radio_field('gender', 'm') . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('gender', 'f') . '&nbsp;&nbsp;' . FEMALE . '&nbsp;' . (tep_not_null(ENTRY_GENDER_TEXT) ? '<span class="inputRequirement">' . ENTRY_GENDER_TEXT . '</span>': ''); ?></div>
                </div>
            <?php } ?>
            <div style="width:100%; clear:both">
                <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_STREET_ADDRESS; ?></div>
                <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('street_address', '', 'size="50"') . '&nbsp;' . (tep_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?></div>
            </div>
            <div style="width:100%; clear:both">
                <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_STREET_ADDRESS_DOM; ?></div>
                <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('street_address_dom', '', 'size="5"'). '&nbsp;' . '<span class="inputRequirement">*</span>'; ?>&nbsp;&nbsp;<?php echo ENTRY_STREET_ADDRESS_MIESZKANIE; ?>&nbsp;&nbsp;<?php echo tep_draw_input_field('street_address_mieszkanie', '', 'size="5"'); ?></div>
            </div>
            <?php if (ACCOUNT_SUBURB == 'true') { ?>
                <div style="width:100%; clear:both">
                    <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_SUBURB; ?></div>
                    <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('suburb', '', 'size="50"') . '&nbsp;' . (tep_not_null(ENTRY_SUBURB_TEXT) ? '<span class="inputRequirement">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?></div>
                </div>
            <?php } ?>
            <div style="width:100%; clear:both">
                <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_POST_CODE; ?></div>
                <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('postcode', '', 'size="15"') . '&nbsp;' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></div>
            </div>
            <div style="width:100%; clear:both">
                <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_CITY; ?></div>
                <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('city', '', 'size="50"') . '&nbsp;' . (tep_not_null(ENTRY_CITY_TEXT) ? '<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>': ''); ?></div>
            </div>
            <?php if (ACCOUNT_STATE == 'true') { ?>
                <div style="width:100%; clear:both">
                    <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_STATE; ?></div>
                    <div style="float:left;width:55%;padding:3px;" class="main">
                         <?php
                         $zones_array = array();
                         $zones_query = tep_db_query("select zone_id, zone_name from " . TABLE_ZONES . " where zone_country_id = " . (int)$country . " order by zone_name");
                         while ($zones_values = tep_db_fetch_array($zones_query)) {
                          $zones_array[] = array('id' => $zones_values['zone_id'], 'text' => $zones_values['zone_name']);
                         }
                         if (count($zones_array) > 0) {
                          echo tep_draw_pull_down_menu('zone_id', $zones_array);
                         } else {
                          echo tep_draw_input_field('state');
                         }
                         if (tep_not_null(ENTRY_STATE_TEXT)) echo ' <span class="inputRequirement">' . ENTRY_STATE_TEXT . '</span>';
                         ?>
                    </div>
                </div>
            <?php } ?>
            <div style="width:100%; clear:both">
                <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_COUNTRY; ?></div>
                <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_get_country_list('country',$country,'onChange="return refresh_form(create_account);"') . '&nbsp;' .(tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></div>
            </div>
            </td></tr>

            <tr><td class="main" align="left">
                <script type="text/javascript" language="javascript">
                function adres_dostawy() {
                var elem = document.getElementById('adres_wysylki');
                if (document.create_account.inny_adres.checked == true) { elem.style.display = 'block'; } else { elem.style.display = 'none'; } }
                </script>
                <?php
                if ((!isset($HTTP_GET_VARS['guest']) || (defined('PURCHASE_WITHOUT_ACCOUNT_SEPARATE_SHIPPING') && PURCHASE_WITHOUT_ACCOUNT_SEPARATE_SHIPPING=='true')) && !isset($HTTP_GET_VARS['act'])) {
                    $display = 'block';
                   } else {
                    $display = 'none';
                }
                ?>
                <div style="width:100%; clear:both;display:<?php echo $display; ?>;" id="nowy_adres">
                    <div>
                        <div style="float:left;width:35%;padding-left:3px;" class="main">&nbsp;</div>
                        <div style="float:left;width:55%;padding-left:3px;" class="main">
                            <input type="checkbox" value="1" name="inny_adres" onClick="adres_dostawy()" <?php echo $dostawa_zaznaczona; ?>><b><?php echo TEXT_ADRES_TEN_SAM_KONTO; ?></b>
                        </div>
                    </div>
                    <div style="width:100%; clear:both;<?php echo (($dostawa_zaznaczona=='') ? 'display:none' : ''); ?>;" id="adres_wysylki">
                        <div>
                            <div style="float:left;width:35%;padding:3px;padding-top:15px;" class="main"><?php echo ENTRY_COMPANY; ?></div>
                            <div style="float:left;width:55%;padding:3px;padding-top:15px;" class="main"><?php echo tep_draw_input_field('company_dostawa', '', 'size="50"'); ?></div>
                        </div>
                        <div style="width:100%; clear:both">
                            <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_FIRST_NAME; ?></div>
                            <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('firstname_dostawa', '', 'size="50"') . '&nbsp;' . (tep_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?></div>
                        </div>
                        <div style="width:100%; clear:both">
                            <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_LAST_NAME; ?></div>
                            <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('lastname_dostawa', '', 'size="50"') . '&nbsp;' . (tep_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?></div>
                        </div>
                        <div style="width:100%; clear:both">
                            <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_STREET_ADDRESS; ?></div>
                            <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('street_address_dostawa', '', 'size="50"') . '&nbsp;' . (tep_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?></div>
                        </div>
                        <div style="width:100%; clear:both">
                            <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_STREET_ADDRESS_DOM; ?></div>
                            <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('street_address_dom_dostawa', '', 'size="5"'). '&nbsp;' . '<span class="inputRequirement">*</span>'; ?>&nbsp;&nbsp;<?php echo ENTRY_STREET_ADDRESS_MIESZKANIE; ?>&nbsp;&nbsp;<?php echo tep_draw_input_field('street_address_mieszkanie_dostawa', '', 'size="5"'); ?></div>
                        </div>
                        <?php if (ACCOUNT_SUBURB == 'true') { ?>
                            <div style="width:100%; clear:both">
                                <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_SUBURB; ?></div>
                                <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('suburb_dostawa', '', 'size="50"') . '&nbsp;' . (tep_not_null(ENTRY_SUBURB_TEXT) ? '<span class="inputRequirement">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?></div>
                            </div>
                        <?php } ?>
                        <div style="width:100%; clear:both">
                            <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_POST_CODE; ?></div>
                            <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('postcode_dostawa', '', 'size="15"') . '&nbsp;' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></div>
                        </div>
                        <div style="width:100%; clear:both">
                            <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_CITY; ?></div>
                            <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('city_dostawa', '', 'size="50"') . '&nbsp;' . (tep_not_null(ENTRY_CITY_TEXT) ? '<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>': ''); ?></div>
                        </div>
                        <?php if (ACCOUNT_STATE == 'true') { ?>
                            <div style="width:100%; clear:both">
                                <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_STATE; ?></div>
                                <div style="float:left;width:55%;padding:3px;" class="main">
                                     <?php
                                     $zones_array = array();
                                     $zones_query = tep_db_query("select zone_id, zone_name from " . TABLE_ZONES . " where zone_country_id = " . (int)$country . " order by zone_name");
                                     while ($zones_values = tep_db_fetch_array($zones_query)) {
                                      $zones_array[] = array('id' => $zones_values['zone_id'], 'text' => $zones_values['zone_name']);
                                     }
                                     if (count($zones_array) > 0) {
                                      echo tep_draw_pull_down_menu('zone_id_dostawa', $zones_array);
                                     } else {
                                      echo tep_draw_input_field('state_dostawa');
                                     }
                                     if (tep_not_null(ENTRY_STATE_TEXT)) echo ' <span class="inputRequirement">' . ENTRY_STATE_TEXT . '</span>';
                                     ?>
                                </div>
                            </div>
                        <?php } ?>
                        <div style="width:100%; clear:both">
                            <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_COUNTRY; ?></div>
                            <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_get_country_list('country_dostawa',$country,'onChange="return refresh_form(create_account);"') . '&nbsp;' .(tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></div>
                        </div>
                    </div>
                </div>
            </td></tr>

            <tr><td class="main" align="left">
                <script type="text/javascript" language="javascript">
                function adres_faktury() {
                var elem = document.getElementById('adres_faktury');
                if (document.create_account.inny_adres_faktury.checked == true) { elem.style.display = 'block'; } else { elem.style.display = 'none'; } }
                </script>
                <div style="width:100%; clear:both;display:none;" id="cala_faktura">
                    <div>
                        <div style="float:left;width:35%;padding-left:3px;" class="main">&nbsp;</div>
                        <div style="float:left;width:55%;padding-left:3px;" class="main">
                            <input type="checkbox" value="1" name="inny_adres_faktury" onClick="adres_faktury()" <?php echo $faktura_zaznaczona; ?>><b><?php echo TEXT_ADRES_TEN_SAM_FAKTURA; ?></b>
                        </div>
                    </div>
                    <div style="width:100%; clear:both;<?php echo (($faktura_zaznaczona=='') ? 'display:none' : ''); ?>;" id="adres_faktury">
                        <div>
                            <div style="float:left;width:35%;padding:3px;padding-top:15px;" class="main"><?php echo ENTRY_COMPANY; ?></div>
                            <div style="float:left;width:55%;padding:3px;padding-top:15px;" class="main"><?php echo tep_draw_input_field('company_faktura', '', 'size="50"') . '&nbsp;' . '<span class="inputRequirement">*</span>'; ?></div>
                        </div>
                        <div>
                            <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_NIP; ?></div>
                            <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('nip_faktura', '', 'size="50"') . '&nbsp;' . '<span class="inputRequirement">*</span>'; ?></div>
                        </div>
                        <div style="width:100%; clear:both">
                            <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_STREET_ADDRESS; ?></div>
                            <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('street_address_faktura', '', 'size="50"') . '&nbsp;' . (tep_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?></div>
                        </div>
                        <div style="width:100%; clear:both">
                            <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_STREET_ADDRESS_DOM; ?></div>
                            <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('street_address_dom_faktura', '', 'size="5"'). '&nbsp;' . '<span class="inputRequirement">*</span>'; ?>&nbsp;&nbsp;<?php echo ENTRY_STREET_ADDRESS_MIESZKANIE; ?>&nbsp;&nbsp;<?php echo tep_draw_input_field('street_address_mieszkanie_faktura', '', 'size="5"'); ?></div>
                        </div>
                        <?php if (ACCOUNT_SUBURB == 'true') { ?>
                            <div style="width:100%; clear:both">
                                <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_SUBURB; ?></div>
                                <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('suburb_faktura', '', 'size="50"') . '&nbsp;' . (tep_not_null(ENTRY_SUBURB_TEXT) ? '<span class="inputRequirement">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?></div>
                            </div>
                        <?php } ?>
                        <div style="width:100%; clear:both">
                            <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_POST_CODE; ?></div>
                            <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('postcode_faktura', '', 'size="15"') . '&nbsp;' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></div>
                        </div>
                        <div style="width:100%; clear:both">
                            <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_CITY; ?></div>
                            <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('city_faktura', '', 'size="50"') . '&nbsp;' . (tep_not_null(ENTRY_CITY_TEXT) ? '<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>': ''); ?></div>
                        </div>
                        <?php if (ACCOUNT_STATE == 'true') { ?>
                            <div style="width:100%; clear:both">
                                <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_STATE; ?></div>
                                <div style="float:left;width:55%;padding:3px;" class="main">
                                     <?php
                                     $zones_array = array();
                                     $zones_query = tep_db_query("select zone_id, zone_name from " . TABLE_ZONES . " where zone_country_id = " . (int)$country . " order by zone_name");
                                     while ($zones_values = tep_db_fetch_array($zones_query)) {
                                      $zones_array[] = array('id' => $zones_values['zone_id'], 'text' => $zones_values['zone_name']);
                                     }
                                     if (count($zones_array) > 0) {
                                      echo tep_draw_pull_down_menu('zone_id_faktura', $zones_array);
                                     } else {
                                      echo tep_draw_input_field('state_faktura');
                                     }
                                     if (tep_not_null(ENTRY_STATE_TEXT)) echo ' <span class="inputRequirement">' . ENTRY_STATE_TEXT . '</span>';
                                     ?>
                                </div>
                            </div>
                        <?php } ?>
                        <div style="width:100%; clear:both">
                            <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_COUNTRY; ?></div>
                            <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_get_country_list('country_faktura',$country,'onChange="return refresh_form(create_account);"') . '&nbsp;' .(tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></div>
                        </div>
                    </div>
                </div>
            </td></tr>

          </table>
		</fieldset>
	  </td>
	 </tr>

	 <tr>
	  <td>
        <fieldset>
        <legend><?php echo CATEGORY_CONTACT; ?></legend>
		  <table border="0" cellspacing="0" cellpadding="3" width="100%">
		   <tr><td align="left">
            <div style="width:100%; clear:both">
                <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_EMAIL_ADDRESS; ?></div>
                <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('email_address', '', 'size="50"') . '&nbsp;' . (tep_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?></div>
            </div>
            <div style="width:100%; clear:both">
                <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_EMAIL_ADDRESS_CONFIRM; ?></div>
                <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('email_address_confirm', '', 'size="50"') . '&nbsp;' . (tep_not_null(ENTRY_EMAIL_ADDRESS_CONFIRM) ? '<span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?></div>
            </div>
            <div style="width:100%; clear:both">
                <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_TELEPHONE_NUMBER; ?></div>
                <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('telephone', '', 'size="50"') . '&nbsp;' . (tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?></div>
            </div>
            <div style="width:100%; clear:both">
                <div style="float:left;width:35%;padding:3px;" class="main"><?php echo ENTRY_FAX_NUMBER; ?></div>
                <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('fax', '', 'size="50"') . '&nbsp;' . (tep_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_FAX_NUMBER_TEXT . '</span>': ''); ?></div>
            </div>
            </td></tr>
          </table>
		</fieldset>
	  </td>
	 </tr>

   <?php echo tep_get_extra_fields($customer_id,$languages_id);?>

	<?php if (CZY_HASLO_GENERUJE_SKLEP == '0' && !isset($_GET['guest'])) { ?>
	<tr>
	  <td>
		<fieldset>
		<legend><?php echo HASLO_TITLE; ?></legend>
		  <table border="0" cellspacing="0" cellpadding="3" width="100%">
           <tr><td class="main">
            <div style="width:100%; clear:both">
                <div style="float:left;width:35%;padding:3px;" class="main"><?php echo HASLO_TEXT_1; ?></div>
                <div style="float:left;width:55%;padding:3px;" class="main">
                    <?php echo tep_draw_input_field('haslo1', '', 'size="20"','','password'). ' <span class="inputRequirement">*</span>'; ?>
                    <br><small><?php echo HASLO_TEXT_3; ?></small>
                </div>
            </div>
            <div style="width:100%; clear:both">
                <div style="float:left;width:35%;padding:3px;" class="main"><?php echo HASLO_TEXT_2; ?></div>
                <div style="float:left;width:55%;padding:3px;" class="main"><?php echo tep_draw_input_field('haslo2', '', 'size="20"','','password'). ' <span class="inputRequirement">*</span>'; ?></div>
            </div>
            </td></tr>
          </table>
		</fieldset>
      </td>
    </tr>
	<?php } ?>

	 <?php
	 // Ingo PWA Beginn
	 if (!isset($HTTP_GET_VARS['guest'])) {
	 ?>
	 <tr>
	  <td>
			<fieldset>
			<legend><?php echo CATEGORY_OPTIONS; ?></legend>
		  <table border="0" cellspacing="0" cellpadding="1" width="100%">
		   <tr>
			<td class="main"><?php echo tep_draw_checkbox_field('newsletter', '1') . '&nbsp;' . (tep_not_null(ENTRY_NEWSLETTER_TEXT) ? '<span class="inputRequirement">' . ENTRY_NEWSLETTER_TEXT . '</span>': ''); ?><?php echo ENTRY_NEWSLETTER; ?></td>
		   </tr>
		   <tr>
			<td colspan="2" class="smallText" style="text-align:justify">
				<?php echo ZGODA_DANE_OSOBOWE; ?>
			</td>
		   </tr>
		  </table>
			</fieldset>
	  </td>
	 </tr>

	 <!-- BOC Added for Account Agreement -->
	 <?php
	 } // Ingo PWA Ende
	 ?>
	 <?php
	 if (!isset($HTTP_GET_VARS['guest']) && (PROMO_POLECONY_STATUS == 'true')) {
	 ?>
	 <tr>
	  <td>
			<fieldset>
			<legend><?php echo TITLE_PROMOCJA_POLECONY; ?></legend>
		  <table border="0" cellspacing="2" cellpadding="2" width="100%">
		   <tr>
			<td class="main" width="37%"><?php echo ENTRY_EMIAL_POLECAJACY; ?></td>
			<td class="main" width="63%" align="left"><?php echo tep_draw_input_field('polecajacy', '', 'size="50"'); ?></td>
		   </tr>
		  </table>
			</fieldset>
	  </td>
	 </tr>

	 <?php
	 }
	 ?>

	 <tr>
	  <td>
			<fieldset>
			<legend><?php echo TEXT_ACCOUNT_AGREEMENT; ?></legend>
		  <table border="0" cellspacing="0" cellpadding="1" width="100%">
		   <tr>
			<td class="main"><?php echo tep_draw_checkbox_field('agreement', '1') . '&nbsp;' . (tep_not_null(ENTRY_AGREEMENT_TEXT) ? '<span class="inputRequirement">' . ENTRY_AGREEMENT_TEXT . '</span>&nbsp;' . ENTRY_AGREEMENT : ''); ?> </td>
		   </tr>
		   <tr>
			<td colspan="2" class="smallText" style="text-align:justify">
				<?php echo PRZETWARZANIE_DANYCH; ?>
			</td>
		   </tr>
		  </table>
			</fieldset>
	  </td>
	 </tr>
	 <!-- EOC Added for Account Agreement -->

	 <!-- // BOF Anti Robot Registration v2.2-->
	 <?php
	 if (ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,'create_account') &&  ACCOUNT_CREATE_VALIDATION == 'true') {
	 ?>
	 <tr>
	  <td>
			<fieldset>
			<legend><?php echo CATEGORY_ANTIROBOTREG; ?></legend>
		  <table border="0" cellspacing="0" cellpadding="1" width="100%">
		   <?php
		  if (ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,'create_account') &&  ACCOUNT_CREATE_VALIDATION == 'true') {
			if ( strstr($PHP_SELF,'create_account') ) {
			  $sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE timestamp < '" . (time() - 3600) . "' OR session_id = '" . tep_session_id() . "'";
			  if( !$result = tep_db_query($sql) ) { die('Could not delete validation key'); }
				$reg_key = gen_reg_key();
				$sql = "INSERT INTO ". TABLE_ANTI_ROBOT_REGISTRATION . " VALUES ('" . tep_session_id() . "', '" . $reg_key . "', '" . time() . "')";
				if( !$result = tep_db_query($sql) ) { die('Could not check registration information'); }
			 ?>
			 <tr>
			  <td class="main">
			   <table align="center" border="0" width="100%" cellspacing="0" cellpadding="1">
				<tr>
				 <td class="main"><span class="main"><?php echo ENTRY_ANTIROBOTREG; ?></span></td>
				 <td class="main">
				  <?php
				  $check_anti_robotreg_query = tep_db_query("select session_id, reg_key, timestamp from anti_robotreg where session_id = '" . tep_session_id() . "'");
				  $new_guery_anti_robotreg = tep_db_fetch_array($check_anti_robotreg_query);
				  $validation_images = '<img src="validation_png.php?rsid=' . $new_guery_anti_robotreg['session_id'] . '" alt="">';
				  if ( isset($entry_antirobotreg_error) && $entry_antirobotreg_error == true) {
				?>
				<span>
				<?php
					echo $validation_images . '</td><td valign="middle">';
					echo tep_draw_input_field('antirobotreg') . '';
				  } else {
				?>
				<span>
				<?php
					echo $validation_images . '</td><td valign="middle">';
					echo tep_draw_input_field('antirobotreg', '', '', '', false);
				  }
				  ?>
				 </td>
				</tr>
			   </table>
			  </td>
			 </tr>
			 <?php
			 }
			 ?>
			<?php
			}
			?>
		   </table>
			</fieldset>
	  </td>
	 </tr>
	 <?php
	 }
	 ?>
	 <!-- // EOF Anti Robot Registration v2.2-->
	 <?php if (CZY_HASLO_GENERUJE_SKLEP == '1' && !isset($_GET['guest'])) {
	 ?>
	 <tr>
	  <td>
			<fieldset>
			<legend><?php echo CATEGORY_PASSWORD; ?></legend>
		  <table border="0" cellspacing="2" cellpadding="2">
		   <tr>
			<td class="main"><?php echo ENTRY_EMAIL_WARNING; ?></td>
		   </tr>
		  </table>
			</fieldset>
	  </td>
	 </tr>
	<?php }

	// PWA BOF
	if (isset($HTTP_GET_VARS['guest']) || isset($HTTP_POST_VARS['guest'])) {
	  ?>
	  <tr>
	    <td><?php echo tep_draw_hidden_field('guest', 'guest'); ?></td>
	  </tr>
	  <?php
	}
	// PWA EOF
	?>

	 <!-- Przyciski BOF -->
	 <tr>
	  <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '3'); ?></td>
	 </tr>
	 <tr>
	  <td>
		  <table border="0" width="100%" cellspacing="0" cellpadding="2">
		   <tr>
			<td align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		   </tr>
		  </table>
	  </td>
	 </tr>
	 <!-- Przyciski EOF -->
</table>
</form>
</td></tr>
</table>

<script language="javascript" type="text/javascript">
function rodzaj(opcja) {
  if (opcja == 1) {
     // dla firmy
     if (document.getElementById('plec')) { document.getElementById('plec').style.display = "none"; }
     if (document.getElementById('data_urodzenia')) { document.getElementById('data_urodzenia').style.display = "none"; }
     document.getElementById('nazwa_firmy').style.display = "block";
     document.getElementById('nips').style.display = "block";
     if (document.forms["create_account"].dob) {
        document.forms["create_account"].dob.value = "" ;
     }
     <?php
     if (!isset($HTTP_GET_VARS['act'])) {
        echo 'document.getElementById(\'cala_faktura\').style.display = "block";';
       } else {
        echo 'document.getElementById(\'cala_faktura\').style.display = "none";';
     }
     ?>
    } else {
     // dla fizycznej
     if (document.getElementById('plec')) { document.getElementById('plec').style.display = "block"; }
     if (document.getElementById('data_urodzenia')) { document.getElementById('data_urodzenia').style.display = "block"; }
     document.getElementById('nazwa_firmy').style.display = "none";
     document.getElementById('nips').style.display = "none";
     document.forms["create_account"].company.value = "";
     document.forms["create_account"].nip.value = "";
     // okno zmiany faktury
     document.getElementById('cala_faktura').style.display = "none";
     document.forms["create_account"].inny_adres_faktury.checked = false;
     document.getElementById('adres_faktury').style.display = "none";
  }
}
<?php
$rodzaj_osoby = tep_db_prepare_input($HTTP_POST_VARS['osoba']);
if ($rodzaj_osoby != '') {
    if ($rodzaj_osoby == 'fizyczna') { echo 'rodzaj(2);'; } else { echo 'rodzaj(1);'; }
    } else {
    echo 'rodzaj(2);';
}
?>
</script>