// JavaScript Document // AJAX Functions by DKD Agency function htmlSet(h,r) { r="#"+r; //jQuery(r).fadeOut("fast", function () { jQuery(r).empty(); jQuery(r).append(h); //jQuery(r).fadeIn("slow"); //}); //window.status ="Updating region "+r; } function ajaxPage(url,p,regionid) { if(regionid==undefined) { regionid ="regionPage"; } //alert(regionid); menuClose(); $('ajaxStatus').style.visibility="visible"; window.status ="Fetching (ASYNC) Data from "+url+" to "+regionid; p+="®ionid="+regionid; p+="&ajax=1"; jQuery.ajax({ url: url, data: p, cache: false, type: "GET", dataType: "html", success: function(html){ $('ajaxStatus').style.visibility="hidden"; window.status ="Updated from "+url+" into region "+regionid; jQuery("#"+regionid).empty(); new Effect.Opacity($(regionid),{from: 0, to: 1,duration: 1.0, queue: "end"}); jQuery("#"+regionid).append(html); } }); } function ajaxRegion(url,p,r) { var regionid =r; p+="®ionid="+r; p+="&ajax=1"; //jQuery("#"+regionid).empty(); jQuery("#"+regionid).append("
"); jQuery.ajax({ url: url, data: p, cache: false, success: function(html){ //new Effect.Opacity($(regionid),{from: 1, to: 0,duration: 1.0, queue: "front", afterFinish : function(p) { jQuery("#"+regionid).empty(); new Effect.Opacity($(regionid),{from: 0, to: 1,duration: 1.0, queue: "end"}); jQuery("#"+regionid).append(html); //} //}); } }); } function ajaxFORM(url,formname,regionid) { if(regionid==undefined) { regionid ="rendered_page"; } jQuery("#"+regionid).append("
"); var p=Form.serialize($(formname)); p+="®ionid="+regionid; p+="&ajax=1"; jQuery.ajax({ url: url, data: p, cache: false, dataType: "html", type: "POST", success: function(html){ $('ajaxStatus').style.visibility="hidden"; htmlSet(html,regionid); } }); /* if(regionid==undefined) { regionid ="rendered_page"; } var p=Form.serialize($(formname)); p+="®ionid="+regionid; p+="&ajax=1"; //alert(p); var myAjax = new Ajax.Updater( $(regionid), url, { evalScripts:'true', method:'post', parameters:p }); */ }