	var ajaxObj = new XMLHTTP("mybic/mybic_server.php");
	//ajaxObj.call("action=helloworld", respHelloWorld);
	

	function template_confirm(msg,tpl,div,form)
	{
		
		 is_confirmed = confirm(msg);
  		if (is_confirmed) {
			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 false;
	}
function 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 false;
  }
  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 redirTimer(redirTime,redirURL) 
{ 
	self.setTimeout("self.location.href = '" + redirURL + "';",redirTime); 
}
   
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>")
  }
}
