<?php
#=
require_once("../include/utiljs.php");

function debug($mess,$var) {
if (!empty($mess)) $a=$mess.'\\n';
js_begin();
if (is_object($var)) {
    $tab=get_object_vars($var);
    js_ins("a=\"\"");
    foreach($tab as $key=>$value) {
        if (!empty($value)) js_ins("a=a+\"$key ~> ".trim($value)."\\n\"");
    }
}
elseif (is_array($var)) {
    js_ins("a=\"\"");
    foreach($var as $key=>$value) {
        if (!empty($value)) js_ins("a=a+\"$key ~> ".trim($value)."\\n\"");
    }
}
else {
    $z=gettype($var);
    print "a='($z) ";
    print_r($var);
    print "';\n";
}
js_ins("alert(a)");
js_end();
}

?>

