#!/usr/bin/perl

require('cgi-lib.pl');
&ReadParse();

$zone=$in{'zone'};
$city=$in{'city'};

print "Content-type: text/html\n\n";

if (($zone eq '')||($city eq ''))
{
 print "Error!\n";
 exit;
}

open(H,"../$zone/$city.html")||die "could not open file";
@lines=<H>;
close H;

print q{<HTML>
<HEAD>
};
$i=0;
while ($lines[$i]!~/\<TITLE/i)
{
 $i++;
}
print $lines[$i];
print q{</HEAD>
<BODY BGCOLOR=WHITE>
<CENTER>
<H2>
Telep&uuml;l&eacute;smarketing profillap
<BR>
<FONT COLOR=DARKBLUE>Profilblatt vom Siedlungsmarketing</FONT>
<BR>
<FONT COLOR=DARKGREEN>Settlement marketing profile sheet</FONT>
</H2>
</CENTER>
<P>
<BR><BR>
<B>
&Aacute;ltal&aacute;nos adatok
</B>
<FORM METHOD=POST ACTION="editps.cgi">
<INPUT TYPE=HIDDEN NAME="zone" VALUE="};
print $zone;
print q{">
<INPUT TYPE=CHECKBOX NAME="map" CHECKED>Térkép
<P>
<TABLE BORDER CELLPADDING=5>
<TR>
<TD><B>Telep&uuml;l&eacute;s neve:</B>
</TD>
<TD><B>};
while ($lines[$i]!~/\<\!\-\-name\-\-\>/)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;
print q{</B>
<INPUT TYPE=HIDDEN NAME="name" VALUE="};
print $1;
print q{"></TD>
</TR>

<TR>
<TD><B>Adatfelv&eacute;tel &eacute;ve:</B></TD>
<TD><INPUT SIZE=4 NAME="year" VALUE="};

while ($lines[$i]!~/\<\!\-\-year\-\-\>/)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>
<TR>
<TD><B>&Ouml;nkorm&aacute;nyzat c&iacute;me:</B></TD>
<TD><INPUT SIZE=50 NAME="address" VALUE="};
while ($lines[$i]!~/\<\!\-\-address\-\-\>/)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>
<TR>
<TD><B>Telefon/Fax:</B></TD>
<TD><INPUT SIZE=20 NAME="phone" VALUE="};
while ($lines[$i]!~/\<\!\-\-phone\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>
<TR>
<TD><B>Polg&aacute;rmester neve:</B></TD>
<TD><INPUT SIZE=50 NAME="mayor" VALUE="};
while ($lines[$i]!~/\<\!\-\-mayor\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>

<TR>
<TD><B>Rendez&eacute;si terv k&eacute;sz&iacute;t&eacute;s&eacute;nek
&eacute;ve:</B></TD>
<TD><INPUT SIZE=4 NAME="plan" VALUE="};
while ($lines[$i]!~/\<\!\-\-plan\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>

<TR>
<TD><B>Telep&uuml;l&eacute;s ter&uuml;lete:</B></TD>
<TD><INPUT SIZE=10 NAME="size" VALUE="};
while ($lines[$i]!~/\<\!\-\-size\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) m\<SUP\>2\<\/SUP\>\<\/B\>/i;
print $1;

print q{"> m<SUP>2</SUP></TD>
</TR>

<TR>
<TD><B>T&aacute;vols&aacute;ga a megyesz&eacute;khelyt&otilde;l k&ouml;z&uacute;ton:</B></TD>
<TD><INPUT SIZE=5 NAME="distance" VALUE="};
while ($lines[$i]!~/\<\!\-\-distance\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) km\<\/B\>/i;
print $1;

print q{"> km</TD>
</TR>

<TR>
<TD><B>Legk&ouml;zelebbi v&aacute;ros t&aacute;vols&aacute;ga k&ouml;z&uacute;ton:</B></TD>
<TD><INPUT SIZE=30 NAME="near_city" VALUE="};
while ($lines[$i]!~/\<\!\-\-near_city\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{">,
<INPUT SIZE="5" NAME="near_distance" VALUE="};
while ($lines[$i]!~/\<\!\-\-near_distance\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) km\<\/B\>/i;
print $1;

print q{"> km</TD>
</TR>

<TR>
<TD><B>N&eacute;pess&eacute;g:</B></TD>
<TD><INPUT SIZE=6 NAME="population" VALUE="};
while ($lines[$i]!~/\<\!\-\-population\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) \&/i;
print $1;

print q{"> f&otilde; &aacute;lland&oacute,
<INPUT SIZE=6 NAME="population_provisional" VALUE="};
while ($lines[$i]!~/\<\!\-\-population_provisional\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/^(.*) ideiglenes/i;
print $1;

print q{"> f&otilde; ideiglenes</TD>
</TR>

<TR>
<TD><B>Akt&iacute;v n&eacute;pess&eacute;g:</B></TD>
<TD><INPUT SIZE=6 NAME="population_active" VALUE="};
while ($lines[$i]!~/\<\!\-\-population_active\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"> f&otilde;</TD>
</TR>

<TR>
<TD><B>Regisztr&aacute;lt munkanélk&uuml;liek sz&aacute;ma:</B></TD>
<TD><INPUT SIZE=6 NAME="unemployed" VALUE="};
while ($lines[$i]!~/\<\!\-\-unemployed\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"> f&otilde;</TD>
</TR>
</TABLE>

<P>
<B>
&Aacute;lland&oacute; n&eacute;pess&eacute;g alakul&aacute;sa kor szerinti
megoszl&aacute;sban:
</B>

<TABLE BORDER CELLPADDING=5>
<TR ALIGN=CENTER>
<TD><B>Kor:</B></TD>
<TD>0 - 19</TD>
<TD>20 - 39</TD>
<TD>40 - 59</TD>
<TD>60 -</TD>
</TR>
<TR ALIGN=CENTER>
<TD><B>Fő:</B></TD>
<TD><INPUT SIZE=6 NAME="age_0_19" VALUE="};
while ($lines[$i]!~/\<\!\-\-age_0_19\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD><INPUT SIZE=6 NAME="age_20_39" VALUE="};
while ($lines[$i]!~/\<\!\-\-age_20_39\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD><INPUT SIZE=6 NAME="age_40_59" VALUE="};
while ($lines[$i]!~/\<\!\-\-age_40_59\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD><INPUT SIZE=6 NAME="age_60_" VALUE="};
while ($lines[$i]!~/\<\!\-\-age_60_\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>
</TABLE>

<P>
<B>
&Aacute;lland&oacute; n&eacute;pess&eacute;g alakul&aacute;sa iskolai
v&eacute;gzetts&eacute;g szerint
</B>
<TABLE BORDER>
<TR ALIGN=CENTER>
<TD><B>Iskolai v&eacute;gzetts&eacute;g:</B></TD>
<TD>8 &aacute;ltal&aacute;nosn&aacute;l kevesebb</TD>
<TD>&Aacute;ltal&aacute;nos iskola</TD>
<TD>Szakmunk&aacute;sk&eacute;pz&otilde;</TD>
<TD>Gimn&aacute;zium, szakk&ouml;z&eacute;piskola</TD>
<TD>Egyetem, f&otilde;iskola</TD>
</TR>
<TR ALIGN=CENTER>
<TD><B>Fő:</B></TD>
<TD><INPUT SIZE=6 NAME="edu_less8" VALUE="};
while ($lines[$i]!~/\<\!\-\-edu_less8\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD><INPUT SIZE=6 NAME="edu_elementary" VALUE="};
while ($lines[$i]!~/\<\!\-\-edu_elementary\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD><INPUT SIZE=6 NAME="edu_vocational" VALUE="};
while ($lines[$i]!~/\<\!\-\-edu_vocational\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD><INPUT SIZE=6 NAME="edu_high" VALUE="};
while ($lines[$i]!~/\<\!\-\-edu_high\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD><INPUT SIZE=6 NAME="edu_university" VALUE="};
while ($lines[$i]!~/\<\!\-\-edu_university\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>
</TABLE>
<P>
<B>
Tal&aacute;lhat&oacute;-e a telep&uuml;l&eacute;sen ...
</B>
<TABLE BORDER>
<TR>
<TD>B&ouml;lcs&otilde;de</TD>
<TD><SELECT NAME="isthere_nursery" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-isthere_nursery\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) \(\<FONT/i;
if ($1 eq 'igen')
{
 print '<OPTION SELECTED>igen',"\n";
 print '<OPTION>nem',"\n";
}
else
{
 print '<OPTION>igen',"\n";
 print '<OPTION SELECTED>nem',"\n";
}

print q{</SELECT>
</TD>
</TR>
<TR>
<TD>&Oacute;voda</TD>
<TD><SELECT NAME="isthere_kindergarten" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-isthere_kindergarten\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) \(\<FONT/i;
if ($1 eq 'igen')
{
 print '<OPTION SELECTED>igen',"\n";
 print '<OPTION>nem',"\n";
}
else
{
 print '<OPTION>igen',"\n";
 print '<OPTION SELECTED>nem',"\n";
}

print q{</SELECT>
</TD>
</TR>

<TR>
<TD>&Aacute;ltal&aacute;nos iskola Als&oacute;</TD>
<TD><SELECT NAME="isthere_elementary_low" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-isthere_elementary_low\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) \(\<FONT/i;
if ($1 eq 'igen')
{
 print '<OPTION SELECTED>igen',"\n";
 print '<OPTION>nem',"\n";
}
else
{
 print '<OPTION>igen',"\n";
 print '<OPTION SELECTED>nem',"\n";
}

print q{</SELECT>
</TD>
</TR>

<TR>
<TD>&Aacute;ltal&aacute;nos iskola Fels&otilde;</TD>
<TD><SELECT NAME="isthere_elementary_high" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-isthere_elementary_high\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) \(\<FONT/i;
if ($1 eq 'igen')
{
 print '<OPTION SELECTED>igen',"\n";
 print '<OPTION>nem',"\n";
}
else
{
 print '<OPTION>igen',"\n";
 print '<OPTION SELECTED>nem',"\n";
}

print q{</SELECT>
</TD>
</TR>

<TR>
<TD>K&ouml;z&eacute;piskola</TD>
<TD><SELECT NAME="isthere_highschool" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-isthere_highschool\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) \(\<FONT/i;
if ($1 eq 'igen')
{
 print '<OPTION SELECTED>igen',"\n";
 print '<OPTION>nem',"\n";
}
else
{
 print '<OPTION>igen',"\n";
 print '<OPTION SELECTED>nem',"\n";
}

print q{</SELECT>
</TD>
</TR>

<TR>
<TD>Speci&aacute;lis oktat&aacute;si int&eacute;zm&eacute;ny</TD>
<TD><SELECT NAME="isthere_special" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-isthere_special\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) \(\<FONT/i;
if ($1 eq 'igen')
{
 print '<OPTION SELECTED>igen',"\n";
 print '<OPTION>nem',"\n";
}
else
{
 print '<OPTION>igen',"\n";
 print '<OPTION SELECTED>nem',"\n";
}

print q{</SELECT>
</TD>
</TR>
</TABLE>

<P>
<B>
Szolgáltatások helyben, vagy legközelebbi távolságra
</B>

<TABLE BORDER>
<TR>
<TD>H&aacute;ziorvos</TD>
<TD><SELECT NAME="services_doctor" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-services_doctor\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*), (.*) km \(\<FONT/i;
if ($1 eq 'van')
{
 print '<OPTION SELECTED>van',"\n";
 print '<OPTION>nincs',"\n";
}
else
{
 print '<OPTION>van',"\n";
 print '<OPTION SELECTED>nincs',"\n";
}
print q{</SELECT>,
<INPUT SIZE=5 NAME="services_doctor_km" VALUE="};
print $2;
print q{"> km-re</TD>
</TR>

<TR>
<TD>Gy&oacute;gyszert&aacute;r</TD>
<TD><SELECT NAME="services_pharmacy" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-services_pharmacy\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*), (.*) km \(\<FONT/i;
if ($1 eq 'van')
{
 print '<OPTION SELECTED>van',"\n";
 print '<OPTION>nincs',"\n";
}
else
{
 print '<OPTION>van',"\n";
 print '<OPTION SELECTED>nincs',"\n";
}
print q{</SELECT>,
<INPUT SIZE=5 NAME="services_pharmacy_km" VALUE="};
print $2;

print q{"> km-re</TD>
</TR>

<TR>
<TD>K&oacute;rh&aacute;z</TD>

<TD><SELECT NAME="services_hospital" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-services_hospital\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*), (.*) km \(\<FONT/i;
if ($1 eq 'van')
{
 print '<OPTION SELECTED>van',"\n";
 print '<OPTION>nincs',"\n";
}
else
{
 print '<OPTION>van',"\n";
 print '<OPTION SELECTED>nincs',"\n";
}
print q{</SELECT>,
<INPUT SIZE=5 NAME="services_hospital_km" VALUE="};
print $2;

print q{"> km-re</TD>
</TR>

<TR>
<TD>Ment&otilde;</TD>
<TD><SELECT NAME="services_ambulance" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-services_ambulance\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*), (.*) km \(\<FONT/i;
if ($1 eq 'van')
{
 print '<OPTION SELECTED>van',"\n";
 print '<OPTION>nincs',"\n";
}
else
{
 print '<OPTION>van',"\n";
 print '<OPTION SELECTED>nincs',"\n";
}
print q{</SELECT>,
<INPUT SIZE=5 NAME="services_ambulance_km" VALUE="};
print $2;

print q{"> km-re</TD>
</TR>

<TR>
<TD>T&ucirc;zolt&oacute;s&aacute;g</TD>
<TD><SELECT NAME="services_fire" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-services_fire\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*), (.*) km \(\<FONT/i;
if ($1 eq 'van')
{
 print '<OPTION SELECTED>van',"\n";
 print '<OPTION>nincs',"\n";
}
else
{
 print '<OPTION>van',"\n";
 print '<OPTION SELECTED>nincs',"\n";
}
print q{</SELECT>,
<INPUT SIZE=5 NAME="services_fire_km" VALUE="};
print $2;

print q{"> km-re</TD>
</TR>

<TR>
<TD>Rend&otilde;rs&eacute;g</TD>

<TD><SELECT NAME="services_police" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-services_police\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*), (.*) km \(\<FONT/i;
if ($1 eq 'van')
{
 print '<OPTION SELECTED>van',"\n";
 print '<OPTION>nincs',"\n";
}
else
{
 print '<OPTION>van',"\n";
 print '<OPTION SELECTED>nincs',"\n";
}
print q{</SELECT>,
<INPUT SIZE=5 NAME="services_police_km" VALUE="};
print $2;

print q{"> km-re</TD>
</TR>
</TABLE>

<P>
<B>
Természeti adottságok
</B>
<BR>
<TEXTAREA NAME="resources" ROWS=5 COLS=50 WRAP=SOFT>
};
while ($lines[$i]!~/\<\!\-\-resources\-\-\>/i)
{
 $i++;
}
$i++;
$r='';
while ($lines[$i]!~/\<\/B\>/)
{
 $lines[$i]=~s/\<B\>//gi;
 $r.=$lines[$i++];
}
$lines[$i]=~s/\<B\>//gi;
$lines[$i]=~s/\<\/B\>//gi;
$r.=$lines[$i];
$r=~s/\<BR\>//gi;
print $r;

print q{</TEXTAREA>
<P>
<B>
Megoldott-e... 
</B>
<TABLE BORDER>
<TR>
<TD>Szennyv&iacute;ztiszt&iacute;t&aacute;s</TD>
<TD><SELECT NAME="solution_water" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-solution_water\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) \(\<FONT/i;
if ($1 eq 'igen')
{
 print '<OPTION SELECTED>igen',"\n";
 print '<OPTION>nem',"\n";
}
else
{
 print '<OPTION>igen',"\n";
 print '<OPTION SELECTED>nem',"\n";
}

print q{</SELECT>
</TD>
</TR>

<TR>
<TD>Hullad&eacute;kkezel&eacute;s</TD>
<TD><SELECT NAME="solution_waste" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-solution_waste\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) \(\<FONT/i;
if ($1 eq 'igen')
{
 print '<OPTION SELECTED>igen',"\n";
 print '<OPTION>nem',"\n";
}
else
{
 print '<OPTION>igen',"\n";
 print '<OPTION SELECTED>nem',"\n";
}

print q{</SELECT>
</TD>
</TR>
</TABLE>

<P>
<B>
Ell&aacute;totts&aacute;gi szint
</B>
<TABLE BORDER>
<TR>
<TD>Vezet&eacute;kes iv&oacute;v&iacute;z</TD>
<TD><INPUT SIZE=3 NAME="supply_water" VALUE="};
while ($lines[$i]!~/\<\!\-\-supply_water\-\-\>/)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) \%\<\/B\>/i;
print $1;

print q{"> %
</TD>
</TR>

<TR>
<TD>Vezet&eacute;kes g&aacute;z</TD>
<TD><INPUT SIZE=3 NAME="supply_gas" VALUE="};
while ($lines[$i]!~/\<\!\-\-supply_gas\-\-\>/)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) \%\<\/B\>/i;
print $1;

print q{"> %</TD>
</TR>

<TR>
<TD>Elektromos &aacute;ram</TD>
<TD><INPUT SIZE=3 NAME="supply_electricity" VALUE="};
while ($lines[$i]!~/\<\!\-\-supply_electricity\-\-\>/)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) \%\<\/B\>/i;
print $1;

print q{"> %</TD>
</TR>

<TR>
<TD>Csatorna</TD>
<TD><INPUT SIZE=3 NAME="supply_canal" VALUE="};
while ($lines[$i]!~/\<\!\-\-supply_canal\-\-\>/)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) \%\<\/B\>/i;
print $1;

print q{"> %</TD>
</TR>

<TR>
<TD>Aszfaltozott &uacute;t</TD>
<TD><INPUT SIZE=3 NAME="supply_road" VALUE="};
while ($lines[$i]!~/\<\!\-\-supply_road\-\-\>/)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) \%\<\/B\>/i;
print $1;

print q{"> %</TD>
</TR>

<TR>
<TD>Telefon</TD>
<TD><INPUT SIZE=3 NAME="supply_phone" VALUE="};
while ($lines[$i]!~/\<\!\-\-supply\_phone/)
{
 $i++;
}
$i++;
$lines[$i]=~/\<B\>(.*) db \<FONT/i;
print $1;

print q{"> db</TD>
</TR>
</TABLE>

<P>
<B>
Van-e helyben ...
</B>

<TABLE BORDER>
<TR>
<TD>Vas&uacute;tvonal</TD>
<TD><SELECT NAME="hasgot_rail" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-hasgot_rail\-\-\>/)
{
 $i++;
}
$i++;
if ($lines[$i]=~/km/i)
{
 $lines[$i]=~/\<B\>(.*)\, (.*) km \(\<FONT/i;
}
else
{
 $lines[$i]=~/\<B\>(.*) \(\<FONT/i;
}
if ($1 eq 'van')
{
 print '<OPTION SELECTED>van',"\n";
 print '<OPTION>nincs',"\n"; 
 print "</SELECT>\n";
}
else
{
 print '<OPTION>van',"\n";
 print '<OPTION SELECTED>nincs',"\n";
 print "</SELECT>\n";
}
print '<INPUT SIZE=5 NAME="hasgot_rail_km" VALUE="',$2,'">  km-re',"\n";

print q{</TD>
</TR>

<TR>
<TD>Iparvágány</TD>
<TD><SELECT NAME="hasgot_indrail" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-hasgot_indrail\-\-\>/)
{
 $i++;
}
$i++;
if ($lines[$i]=~/km/i)
{
 $lines[$i]=~/\<B\>(.*)\, (.*) km \(\<FONT/i;
}
else
{
 $lines[$i]=~/\<B\>(.*) \(\<FONT/i;
}
if ($1 eq 'van')
{
 print '<OPTION SELECTED>van',"\n";
 print '<OPTION>nincs',"\n"; 
 print "</SELECT>\n";
}
else
{
 print '<OPTION>van',"\n";
 print '<OPTION SELECTED>nincs',"\n";
 print "</SELECT>\n";
}
print '<INPUT SIZE=5 NAME="hasgot_indrail_km" VALUE="',$2,'">  km-re',"\n";

print q{</TD>
</TR>

<TR>
<TD>Kikötő</TD>
<TD><SELECT NAME="hasgot_harbour" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-hasgot_harbour\-\-\>/)
{
 $i++;
}
$i++;
if ($lines[$i]=~/km/i)
{
 $lines[$i]=~/\<B\>(.*)\, (.*) km \(\<FONT/i;
}
else
{
 $lines[$i]=~/\<B\>(.*) \(\<FONT/i;
}
if ($1 eq 'van')
{
 print '<OPTION SELECTED>van',"\n";
 print '<OPTION>nincs',"\n"; 
 print "</SELECT>\n";
}
else
{
 print '<OPTION>van',"\n";
 print '<OPTION SELECTED>nincs',"\n";
 print "</SELECT>\n";
}
print '<INPUT SIZE=5 NAME="hasgot_harbour_km" VALUE="',$2,'">  km-re',"\n";

print q{</TD>
</TR>

<TR>
<TD>Repülőtér</TD>
<TD><SELECT NAME="hasgot_airport" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-hasgot_airport\-\-\>/)
{
 $i++;
}
$i++;
if ($lines[$i]=~/km/i)
{
 $lines[$i]=~/\<B\>(.*)\, (.*) km \(\<FONT/i;
}
else
{
 $lines[$i]=~/\<B\>(.*) \(\<FONT/i;
}
if ($1 eq 'van')
{
 print '<OPTION SELECTED>van',"\n";
 print '<OPTION>nincs',"\n"; 
 print "</SELECT>\n";
}
else
{
 print '<OPTION>van',"\n";
 print '<OPTION SELECTED>nincs',"\n";
 print "</SELECT>\n";
}
print '<INPUT SIZE=5 NAME="hasgot_airport_km" VALUE="',$2,'">  km-re',"\n";

print q{</TD>
</TR>

<TR>
<TD>Üzemanyagtöltő</TD>
<TD><SELECT NAME="hasgot_fuel" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-hasgot_fuel\-\-\>/)
{
 $i++;
}
$i++;
if ($lines[$i]=~/km/i)
{
 $lines[$i]=~/\<B\>(.*)\, (.*) km \(\<FONT/i;
}
else
{
 $lines[$i]=~/\<B\>(.*) \(\<FONT/i;
}
if ($1 eq 'van')
{
 print '<OPTION SELECTED>van',"\n";
 print '<OPTION>nincs',"\n"; 
 print "</SELECT>\n";
}
else
{
 print '<OPTION>van',"\n";
 print '<OPTION SELECTED>nincs',"\n";
 print "</SELECT>\n";
}
print '<INPUT SIZE=5 NAME="hasgot_fuel_km" VALUE="',$2,'">  km-re',"\n";

print q{</TD>
</TR>

<TR>
<TD>Főútvonal</TD>
<TD><SELECT NAME="hasgot_aroad" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-hasgot_aroad\-\-\>/)
{
 $i++;
}
$i++;
if ($lines[$i]=~/km/i)
{
 $lines[$i]=~/\<B\>(.*)\, (.*) km \(\<FONT/i;
}
else
{
 $lines[$i]=~/\<B\>(.*) \(\<FONT/i;
}
if ($1 eq 'van')
{
 print '<OPTION SELECTED>van',"\n";
 print '<OPTION>nincs',"\n"; 
 print "</SELECT>\n";
}
else
{
 print '<OPTION>van',"\n";
 print '<OPTION SELECTED>nincs',"\n";
 print "</SELECT>\n";
}
print '<INPUT SIZE=5 NAME="hasgot_aroad_km" VALUE="',$2,'">  km-re',"\n";

print q{</TD>
</TR>

<TR>
<TD>Másodrendű út</TD>
<TD><SELECT NAME="hasgot_broad" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-hasgot_broad\-\-\>/)
{
 $i++;
}
$i++;
if ($lines[$i]=~/km/i)
{
 $lines[$i]=~/\<B\>(.*)\, (.*) km \(\<FONT/i;
}
else
{
 $lines[$i]=~/\<B\>(.*) \(\<FONT/i;
}
if ($1 eq 'van')
{
 print '<OPTION SELECTED>van',"\n";
 print '<OPTION>nincs',"\n"; 
 print "</SELECT>\n";
}
else
{
 print '<OPTION>van',"\n";
 print '<OPTION SELECTED>nincs',"\n";
 print "</SELECT>\n";
}
print '<INPUT SIZE=5 NAME="hasgot_broad_km" VALUE="',$2,'">  km-re',"\n";

print q{</TD>
</TR>
<TR>
<TD>Bekötőút</TD>
<TD><SELECT NAME="hasgot_approach" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-hasgot_approach\-\-\>/)
{
 $i++;
}
$i++;
if ($lines[$i]=~/km/i)
{
 $lines[$i]=~/\<B\>(.*)\, (.*) km \(\<FONT/i;
}
else
{
 $lines[$i]=~/\<B\>(.*) \(\<FONT/i;
}
if ($1 eq 'van')
{
 print '<OPTION SELECTED>van',"\n";
 print '<OPTION>nincs',"\n"; 
 print "</SELECT>\n";
}
else
{
 print '<OPTION>van',"\n";
 print '<OPTION SELECTED>nincs',"\n";
 print "</SELECT>\n";
}
print '<INPUT SIZE=5 NAME="hasgot_approach_km" VALUE="',$2,'">  km-re',"\n";

print q{</TD>
</TR>

<TR>
<TD>Kerékpárút, helyi</TD>
<TD><SELECT NAME="hasgot_localcycle" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-hasgot_localcycle\-\-\>/)
{
 $i++;
}
$i++;
if ($lines[$i]=~/km/i)
{
 $lines[$i]=~/\<B\>(.*)\, (.*) km \(\<FONT/i;
}
else
{
 $lines[$i]=~/\<B\>(.*) \(\<FONT/i;
}
if ($1 eq 'van')
{
 print '<OPTION SELECTED>van',"\n";
 print '<OPTION>nincs',"\n"; 
 print "</SELECT>\n";
}
else
{
 print '<OPTION>van',"\n";
 print '<OPTION SELECTED>nincs',"\n";
 print "</SELECT>\n";
}
print '<INPUT SIZE=5 NAME="hasgot_localcycle_km" VALUE="',$2,'">  km-re',"\n";

print q{</TD>
</TR>

<TR>
<TD>Kerékpárút, átmenő</TD>
<TD><SELECT NAME="hasgot_transitcycle" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-hasgot_transitcycle\-\-\>/)
{
 $i++;
}
$i++;
if ($lines[$i]=~/km/i)
{
 $lines[$i]=~/\<B\>(.*)\, (.*) km \(\<FONT/i;
}
else
{
 $lines[$i]=~/\<B\>(.*) \(\<FONT/i;
}
if ($1 eq 'van')
{
 print '<OPTION SELECTED>van',"\n";
 print '<OPTION>nincs',"\n"; 
 print "</SELECT>\n";
}
else
{
 print '<OPTION>van',"\n";
 print '<OPTION SELECTED>nincs',"\n";
 print "</SELECT>\n";
}
print '<INPUT SIZE=5 NAME="hasgot_transitcycle_km" VALUE="',$2,'">  km-re',"\n";

print q{</TD>
</TR>

<TR>
<TD>Postahivatal</TD>
<TD><SELECT NAME="hasgot_post" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-hasgot_post\-\-\>/)
{
 $i++;
}
$i++;
if ($lines[$i]=~/km/i)
{
 $lines[$i]=~/\<B\>(.*)\, (.*) km \(\<FONT/i;
}
else
{
 $lines[$i]=~/\<B\>(.*) \(\<FONT/i;
}
if ($1 eq 'van')
{
 print '<OPTION SELECTED>van',"\n";
 print '<OPTION>nincs',"\n"; 
 print "</SELECT>\n";
}
else
{
 print '<OPTION>van',"\n";
 print '<OPTION SELECTED>nincs',"\n";
 print "</SELECT>\n";
}
print '<INPUT SIZE=5 NAME="hasgot_post_km" VALUE="',$2,'">  km-re',"\n";

print q{</TD>
</TR>

<TR>
<TD>Takarékszövetkezet</TD>
<TD><SELECT NAME="hasgot_saving" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-hasgot_saving\-\-\>/)
{
 $i++;
}
$i++;
if ($lines[$i]=~/km/i)
{
 $lines[$i]=~/\<B\>(.*)\, (.*) km \(\<FONT/i;
}
else
{
 $lines[$i]=~/\<B\>(.*) \(\<FONT/i;
}
if ($1 eq 'van')
{
 print '<OPTION SELECTED>van',"\n";
 print '<OPTION>nincs',"\n"; 
 print "</SELECT>\n";
}
else
{
 print '<OPTION>van',"\n";
 print '<OPTION SELECTED>nincs',"\n";
 print "</SELECT>\n";
}
print '<INPUT SIZE=5 NAME="hasgot_saving_km" VALUE="',$2,'">  km-re',"\n";

print q{</TD>
</TR>

<TR>
<TD>Bankfiók</TD>
<TD><SELECT NAME="hasgot_bank" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-hasgot_bank\-\-\>/)
{
 $i++;
}
$i++;
if ($lines[$i]=~/km/i)
{
 $lines[$i]=~/\<B\>(.*)\, (.*) km \(\<FONT/i;
}
else
{
 $lines[$i]=~/\<B\>(.*) \(\<FONT/i;
}
if ($1 eq 'van')
{
 print '<OPTION SELECTED>van',"\n";
 print '<OPTION>nincs',"\n"; 
 print "</SELECT>\n";
}
else
{
 print '<OPTION>van',"\n";
 print '<OPTION SELECTED>nincs',"\n";
 print "</SELECT>\n";
}
print '<INPUT SIZE=5 NAME="hasgot_bank_km" VALUE="',$2,'">  km-re',"\n";

print q{</TD>
</TR>

<TR>
<TD>Vámszabad terület</TD>
<TD><SELECT NAME="hasgot_duty" SIZE=1>
};
while ($lines[$i]!~/\<\!\-\-hasgot_duty\-\-\>/)
{
 $i++;
}
$i++;
if ($lines[$i]=~/km/i)
{
 $lines[$i]=~/\<B\>(.*)\, (.*) km \(\<FONT/i;
}
else
{
 $lines[$i]=~/\<B\>(.*) \(\<FONT/i;
}
if ($1 eq 'van')
{
 print '<OPTION SELECTED>van',"\n";
 print '<OPTION>nincs',"\n"; 
 print "</SELECT>\n";
}
else
{
 print '<OPTION>van',"\n";
 print '<OPTION SELECTED>nincs',"\n";
 print "</SELECT>\n";
}
print '<INPUT SIZE=5 NAME="hasgot_duty_km" VALUE="',$2,'">  km-re',"\n";

print q{</TD>
</TR>
</TABLE>

<P>
<B>
Gazdálkodó szervezetek száma típusonként
</B>

<TABLE BORDER=1 CELLSPACING=0>
<TR ALIGN=CENTER>
<TD><B>Forma</B></TD>
<TD>Bt.</TD>
<TD>Rt.</TD>
<TD>Kft.</TD>
<TD>KKT.</TD>
<TD>Állami vállalat</TD>
<TD>Egyéni vállalkozó</TD>
<TD>Szövetkezet</TD>
</TR>
<TR ALIGN=CENTER>
<TD><B>Szám</B></TD>
<TD><INPUT SIZE=5 NAME="org_bt" VALUE="};
while ($lines[$i]!~/\<\!\-\-org_bt\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]!~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD><INPUT SIZE=5 NAME="org_rt" VALUE="};
while ($lines[$i]!~/\<\!\-\-org_rt\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]!~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD><INPUT SIZE=5 NAME="org_kft" VALUE="};
while ($lines[$i]!~/\<\!\-\-org_kft\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]!~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD><INPUT SIZE=5 NAME="org_kkt" VALUE="};
while ($lines[$i]!~/\<\!\-\-org_kkt\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]!~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD><INPUT SIZE=5 NAME="org_state" VALUE="};
while ($lines[$i]!~/\<\!\-\-org_state\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]!~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD><INPUT SIZE=5 NAME="org_private" VALUE="};
while ($lines[$i]!~/\<\!\-\-org_private\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]!~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD><INPUT SIZE=5 NAME="org_cooperative" VALUE="};
while ($lines[$i]!~/\<\!\-\-org_cooperative\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]!~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>
</TABLE>

<P>
<B>
Egyéni vállalkozók megoszlása ágazatok szerint</B>
<TABLE BORDER=1 CELSPACING=0>
<TR>
<TD><B>Ágazat</B></TD>
<TD>Mezőgazdaság</TD>
<TD>Ipar</TD>
<TD>Építőipar</TD>
<TD>Kereskedelem</TD>
<TD>Vendéglátás</TD>
<TD>Közlekedés</TD>
<TD>Szolgáltatás</TD>
<TD>Egyéb</TD>
</TR>
<TR>
<TD><B>Fő</B></TD>
<TD ALIGN=CENTER><INPUT SIZE=3 NAME="branch_agriculture" VALUE="};
while ($lines[$i]!~/\<\!\-\-branch_agriculture\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]!~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD ALIGN=CENTER><INPUT SIZE=3 NAME="branch_industry" VALUE="};
while ($lines[$i]!~/\<\!\-\-branch_industry\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]!~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD ALIGN=CENTER><INPUT SIZE=3 NAME="branch_building" VALUE="};
while ($lines[$i]!~/\<\!\-\-branch_building\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]!~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD ALIGN=CENTER><INPUT SIZE=3 NAME="branch_trade" VALUE="};
while ($lines[$i]!~/\<\!\-\-branch_trade\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]!~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD ALIGN=CENTER><INPUT SIZE=3 NAME="branch_catering" VALUE="};
while ($lines[$i]!~/\<\!\-\-branch_catering\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]!~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD ALIGN=CENTER><INPUT SIZE=3 NAME="branch_transport" VALUE="};
while ($lines[$i]!~/\<\!\-\-branch_transport\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]!~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD ALIGN=CENTER><INPUT SIZE=3 NAME="branch_services" VALUE="};
while ($lines[$i]!~/\<\!\-\-branch_services\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]!~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
<TD ALIGN=CENTER><INPUT SIZE=3 NAME="branch_others" VALUE="};
while ($lines[$i]!~/\<\!\-\-branch_others\-\-\>/i)
{
 $i++;
}
$i++;
$lines[$i]!~/\<B\>(.*)\<\/B\>/i;
print $1;

print q{"></TD>
</TR>
</TABLE>

<P>
<B>
Nagyobb gazdálkodó szervezetek
</B>
<TABLE BORDER=1 CELLSPACING=0>
<TR ALIGN=CENTER>
<TD><B>No.</B></TD>
<TD><B>Cég neve</B></TD>
<TD><B>Tevékenység, termék</B></TD>
<TD><B>Foglalkoztatottak száma</B></TD>
<TD><B>Export(%)</B></TD>
</TR>
};

$j=1;
while ($lines[$i]!~/\<\!\-\-end\-\-\>/i)
{
 while (($lines[$i]!~/\<\!\-\-mainorg$j\_name\-\-\>/i)&&($lines[$i]!~/\<\!\-\-end\-\-\>/i))
 {
  $i++;
 }
 if ($lines[$i]=~/\<\!\-\-end\-\-\>/i)
 {
  last;
 }
 $i++;
 $lines[$i]=~/\<B\>(.*)\<\/B\>/i;
 print "<TR ALIGN=CENTER>\n<TD>$j.</TD>\n";
 print '<TD><INPUT SIZE=30 NAME="mainorg',$j,'_name" VALUE="',$1,'"></TD>',"\n";
 while ($lines[$i]!~/\<\!\-\-mainorg$j\_product\-\-\>/i)
 {
  $i++;
 }
 $i++;
 $lines[$i]=~/\<B\>(.*)\<\/B\>/i;
 print '<TD><INPUT SIZE=30 NAME="mainorg',$j,'_product" VALUE="',$1,'"></TD>',"\n";
 while ($lines[$i]!~/\<\!\-\-mainorg$j\_employees\-\-\>/i)
 {
  $i++;
 }
 $i++;
 $lines[$i]=~/\<B\>(.*)\<\/B\>/;
 print '<TD><INPUT SIZE=5 NAME="mainorg',$j,'_employees" VALUE="',$1,'"></TD>',"\n";
 while ($lines[$i]!~/\<\!\-\-mainorg$j\_export\-\-\>/i)
 {
  $i++;
 }
 $i++;
 $lines[$i]=~/\<B\>(.*)\<\/B\>/;
 print '<TD><INPUT SIZE=5 NAME="mainorg',$j,'_export" VALUE="',$1,'"></TD>',"\n";
 print "</TR>\n";
 $j++;
}
print "<TR>\n";
print "<TR ALIGN=CENTER>\n<TD>$j.</TD>\n";
print '<TD><INPUT SIZE=30 NAME="mainorg',$j,'_name" VALUE=""></TD>',"\n";
print '<TD><INPUT SIZE=30 NAME="mainorg',$j,'_product" VALUE=""></TD>',"\n";
print '<TD><INPUT SIZE=5 NAME="mainorg',$j,'_employees" VALUE=""></TD>',"\n";
print '<TD><INPUT SIZE=5 NAME="mainorg',$j,'_employees" VALUE=""></TD>',"\n";
print "</TR>\n</TABLE>\n";

print q{<P>
<B>
El&otilde;nyben r&eacute;szes&iacute;tett tev&eacute;kenys&eacute;gek
</B>
<BR>
<TEXTAREA NAME="prefer" ROWS=5 COLS=50 WRAP=SOFT>};
while ($lines[$i]!~/\<\!\-\-prefer\-\-\>/i)
{
 $i++;
}
$i++;
$d='';
while ($lines[$i]!~/\<\/B\>/i)
{
 $lines[$i]=~s/\<B\>//gi;
 $d.=$lines[$i++];
}
$lines[$i]=~s/\<B\>//gi;
$lines[$i]=~s/\<\/B\>//gi;
$d.=$lines[$i];
$d=~s/\<BR\>//gi;
print $d;

print q{</TEXTAREA>
<P>
<B>
Strat&eacute;gia
</B>
<BR>
<TEXTAREA NAME="strat" ROWS=5 COLS=50 WRAP=SOFT>};
while ($lines[$i]!~/\<\!\-\-strat\-\-\>/i)
{
 $i++;
}
$i++;
$d='';
while ($lines[$i]!~/\<\/B\>/i)
{
 $lines[$i]=~s/\<B\>//gi;
 $d.=$lines[$i++];
}
$lines[$i]=~s/\<B\>//gi;
$lines[$i]=~s/\<\/B\>//gi;
$d.=$lines[$i];
$d=~s/\<BR\>//gi;
print $d;

print q{</TEXTAREA>
<BR><BR>
<TABLE WIDTH=100%>
<TR>
<TD ALIGN=LEFT>
<INPUT TYPE=SUBMIT VALUE="   M&oacute;dos&iacute;t&aacute;s elv&eacute;gz&eacute;se   ">
</TD>
<TD ALIGN=RIGTH>
<INPUT TYPE=RESET VALUE="Eredeti &aacute;llapot">
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
};