/*** Helper tips *******************
 
+ multi line string:
    var text = "this is\
        multi-line\
        text";

     OR

    var text  = "this is\n";
    var text += "multyline\n";
    var text += "text\n";

 */

/***********************************
 * get random value
 */
function rand(max){
	return Math.floor(Math.random()*(max+1) );
}

/***************************************
 * get full information about object
 */
function print_r(theObj, str){
  if(theObj.constructor == Array || theObj.constructor == Object){
    str += ("<ul>");
    for(var p in theObj){
      if(theObj[p].constructor == Array||theObj[p].constructor == Object){
	str += ("<li>["+p+"] => "+typeof(theObj)+"</li>");
        str += ("<ul>");
        str = print_r(theObj[p], str);
        str += ("</ul>");
      } else {
	str += ("<li>["+p+"] => "+theObj[p]+"</li>");
      }
    }
    str += ("</ul>");
    return str;
  }
}