// JavaScript Document

function carrega_frame(url, target_div){
   $(target_div).hide();
   
    new Ajax.Updater(target_div, url,
        {
          asynchronous: false,
          evalScripts: true
        }
    );
	
	 new Effect.BlindDown(target_div, { duration: 1} );
	
}


function formpost_frame(in_form, url, target_div){
    form = $(in_form);
    params = form.serialize(true);
    var hash_params = $H(params);  //$H constroi um objecto tipo array associativo com metodos proprios como set, unset, get, each, etc. É construido com new Hash() ou $H(objecto)
    new Ajax.Updater(target_div, url,
        {
        method: 'post',
        parameters: hash_params
        }
    );
    new Effect.BlindDown(target_div, { duration: 0.5} );
    //new Effect.Appear(target_div, {duration:0.5, from:0.0, to:1.0});
}




/*new Ajax.Request('/some_url', { method:'get',
  onSuccess: function(transport, json){
      alert(json ? Object.inspect(json) : "no JSON object");
    }
  });*/

