	var ajaxObj = new XMLHTTP("mybic/mybic_server.php");
	//ajaxObj.call("action=helloworld", respHelloWorld);
	
	
function smartjax_template(tpl,div,form) {
	
	url = "&tpl=" + tpl;
	if(div) {smartjax_loading(div); url = url + "&div=" + div ;}
	if(form) ajaxObj.getForm(form);
//	alert(url);
//	ajaxObj.debug = 1;
     ajaxObj.call("action=template" + url , cbtemplate);
	 return true;
  }
  function cbtemplate(resp) {
	//print_r(resp);
	//alert(resp.tpl);
	document.getElementById(resp.div).innerHTML = resp.output;
  }
 function smartjax_loading(div){
		document.getElementById(div).innerHTML = "<div style='width: 100%; text-align:center;padding:2px 2px 2px 2px;'><img src='images/ajax.gif' /></div>"
  }
  
function Go(id,url){
	self.location.href = url + document.getElementById(id).value;
	return false;
}

  
   
function print_r(theObj){
	if(theObj.constructor == Array || theObj.constructor == Object){
		document.write("<ul>")
	    for(var p in theObj){
    	if(theObj[p].constructor == Array|| theObj[p].constructor == Object){
			document.write("<li>["+p+"] => "+typeof(theObj)+"</li>");
			document.write("<ul>")
			print_r(theObj[p]);
			document.write("</ul>")
      } else {
			document.write("<li>["+p+"] => "+theObj[p]+"</li>");
      }
    }
		document.write("</ul>")
  }
}
