function build_js($js, $config) {
$js_array = array();
if ($config['js_min'] AND version_compare(PHP_VERSION, '5.1.0', '>') ) {
$js_array[] = "<script type=\"text/javascript\" src=\"{$config['http_home_url']}engine/classes/min/index.php?charset={$config['charset']}&g=general&3\"></script>";
if ( count($js) ) $js_array[] = "<script type=\"text/javascript\" src=\"{$config['http_home_url']}engine/classes/min/index.php?charset={$config['charset']}&f=".implode(",", $js)."&3\"></script>";
return implode("\n", $js_array);
} else {
$default_array = array (
'engine/classes/js/jquery.js',
'engine/classes/js/jqueryui.js',
'engine/classes/js/dle_js.js',
);
$js = array_merge($default_array, $js);
foreach ($js as $value) {
$js_array[] = "<script type=\"text/javascript\" src=\"{$config['http_home_url']}{$value}\"></script>";
}
return implode("\n", $js_array);
}
}