sub Printbehaviour
{
my($message, @label, %LABEL, %LABEL2, @label2, %HTML,%ARLABEL,@cfg,$n,$string);
($message) = @_ if $_[0];
@label = (1,0);
%LABEL =(1=>"Yes", 0=>"No");
%LABEL2 =(0=>"Yes", 1=>"No");
@label2 = ('instant', 'sendmail','pending');
@label_ads_when_expires= ('delete', 'suspend','expire','nothing');
%ARLABEL=("login"=>"login page","panel"=>"control panel","post"=>"ad posting page");
%DATETIME_ALGO=("POSIX"=>"POSIX","internal"=>"internal");
$HTML{flock}= $Cgi->popup_menu("flock", \@label, $CONFIG{flock}, \%LABEL);
$HTML{rename}= $Cgi->popup_menu("rename", \@label, $CONFIG{rename}, \%LABEL);
$HTML{javascript}= $Cgi->popup_menu("javascript", \@label, $CONFIG{javascript}, \%LABEL);
$HTML{ad_type}= $Cgi->popup_menu("ad_type", ['instant', 'pending'], $CONFIG{ad_type});
$HTML{ads_when_expires}=$Cgi->popup_menu("ads_when_expires", \@label_ads_when_expires, $CONFIG{ads_when_expires}); #, \%LABEL);
$HTML{ads_when_conforms}=$Cgi->popup_menu("ads_when_conforms", \@label, $CONFIG{ads_when_conforms}, \%LABEL);
$HTML{gal_file_type}=$Cgi->popup_menu("gal_file_type", ['instant', 'pending'], $CONFIG{gal_file_type});
$HTML{member_type}=$Cgi->popup_menu("member_type", \@label2, $CONFIG{member_type});
$HTML{duplicate_email}=$Cgi->popup_menu("duplicate_email", \@label, $CONFIG{duplicate_email}, \%LABEL);
$HTML{thumbnailer}=$Cgi->popup_menu("thumbnailer", [none, GD, "Image Magick"], $CONFIG{thumbnailer});
$HTML{show_empty_subs}=$Cgi->popup_menu("show_empty_subs", \@label, $CONFIG{show_empty_subs}, \%LABEL);
$HTML{allow_html}=$Cgi->popup_menu("allow_html", \@label, $CONFIG{allow_html}, \%LABEL);
$HTML{hide_blank}=$Cgi->popup_menu("hide_blank", \@label, $CONFIG{hide_blank}, \%LABEL);
$HTML{photos_first}=$Cgi->popup_menu("photos_first", \@label, $CONFIG{photos_first}, \%LABEL);
$HTML{after_reg}= $Cgi->popup_menu("after_reg",['panel','post'],$CONFIG{after_reg},\%ARLABEL);
$HTML{mail_non_members}=$Cgi->popup_menu("mail_non_members", \@label, $CONFIG{mail_non_members}, \%LABEL);
$HTML{convert_links_to_friendly}=$Cgi->popup_menu("convert_links_to_friendly", \@label, $CONFIG{convert_links_to_friendly}, \%LABEL);
$HTML{mod_perl}=$Cgi->popup_menu("mod_perl", \@label, $CONFIG{mod_perl}, \%LABEL);
$HTML{add_new_account_ads_allowed_to_previous_ads_allowed}=$Cgi->popup_menu("add_new_account_ads_allowed_to_previous_ads_allowed", \@label, $CONFIG{add_new_account_ads_allowed_to_previous_ads_allowed}, \%LABEL);
$HTML{increase_member_ads_used_during_renewing_ad}=$Cgi->popup_menu("increase_member_ads_used_during_renewing_ad", \@label, $CONFIG{increase_member_ads_used_during_renewing_ad}, \%LABEL);
$HTML{datetime_algorithm}= $Cgi->popup_menu("datetime_algorithm",['POSIX','internal'],$CONFIG{datetime_algorithm},\%DATETIME_ALGO);
$HTML{anti_robot_check}=$Cgi->popup_menu("anti_robot_check", \@label, $CONFIG{anti_robot_check}, \%LABEL);
$HTML{count_stats_from_non_registered}=$Cgi->popup_menu("count_stats_from_non_registered", \@label, $CONFIG{count_stats_from_non_registered}, \%LABEL);
$string=&FileRead($TEMPLATE{behaviour});
@cfg=('',1..64,'3a','18a','18b','18c','20a','20b');
foreach my $n (@cfg) {
$string=~ s/\[mj_cfg$n\]/$mj{cfg.$n}/ig;
}
$string=~ s/\[message\]/$message/i;
$string=~ s/\[CONFIG_ad_notify\]/$CONFIG{ad_notify}/i;
$string=~ s/\[CONFIG_max_message_length\]/$CONFIG{max_message_length}/i;
$string=~ s/\[CONFIG_currency\]/$CONFIG{currency}/i;
$string=~ s/\[CONFIG_registration_bonus\]/$CONFIG{registration_bonus}/i;
$string=~ s/\[CONFIG_days_keep_ads_in_db_after_expire\]/$CONFIG{days_keep_ads_in_db_after_expire}/i;
$string=~ s/\[CONFIG_datetime_algorithm\]/$CONFIG{datetime_algorithm}/i;
$string=~ s/\[CONFIG_datetime_format\]/$CONFIG{datetime_format}/i;
$string=~ s/\[CONFIG_add_new_account_ads_allowed_to_previous_ads_allowed\]/$CONFIG{add_new_account_ads_allowed_to_previous_ads_allowed}/i;
foreach my $key(keys %CONFIG) {$string=~ s/\[CONFIG_$key\]/$CONFIG{$key}/i;}
foreach $key(keys %HTML) {$string=~ s/\[HTML_$key\]/$HTML{$key}/i;}
&PrintHeader;
print $string;
&PrintFooter; exit;
}