
 

var ajxpg = function(ajx_page,div,effect,margin_top){
		 
	
		var div = '#' + div;
		
		
		if(typeof margin_top === 'undefined')
			margin_top = 0;
			
		
		
	 	jQuery(div).html('<div style="width:100%; text-align:center;"><img src="../images/ajax_loader.gif" align="middle" border="0" align="center" style="margin-top:'+margin_top+'px;" /></div>');
 		
		jQuery.ajax({ 
					
					   type: "POST", 
					   url: ajx_page+'&rand=' + Math.floor(Math.random()*11),
					   cache: false,
					   success: function(data){ 
 				    
 					   
					 	jQuery(div).css('display','none');
						if (effect == 'fade')
						{
						 	jQuery(div).html(data).fadeIn('slow');
						}
						else if (effect == 'slide')
						{
							jQuery(div).html(data).slideDown('slow');
						}
						else if (effect == 'show')
						{
							jQuery(div).html(data).show('slow');
						}
						else if (effect == 'none')
						{
							jQuery(div).html(data);
							jQuery(div).css('display','block');
						}else
						{
							jQuery(div).html(data);
							jQuery(div).css('display','block');
						}
						
						
 				   } ,
				   error: function (){
				  	 alert("Sorry!\n\nAn Error Occured! While fatching data from server.\nDetails: \n\nURL: "+ajx_page+"\nDIV: "+div+"\nEFFECT: "+effect);
				   }
				   
		 });
	
};
	
 
